mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
adds trailing +s to the output of EXPLAIN for MySQL
This commit is contained in:
@@ -282,8 +282,8 @@ module ActiveRecord
|
||||
end
|
||||
|
||||
def build_separator(widths)
|
||||
# Each cell has one char of padding at both sides, that's why we add 2.
|
||||
'+' + widths.map {|w| '-' * (w + 2)}.join('+')
|
||||
padding = 1
|
||||
'+' + widths.map {|w| '-' * (w + (padding*2))}.join('+') + '+'
|
||||
end
|
||||
|
||||
def build_cells(items, widths)
|
||||
@@ -364,7 +364,6 @@ module ActiveRecord
|
||||
# these, we must use a subquery. However, MySQL is too stupid to create a
|
||||
# temporary table for this automatically, so we have to give it some prompting
|
||||
# in the form of a subsubquery. Ugh!
|
||||
|
||||
def join_to_update(update, select) #:nodoc:
|
||||
if select.limit || select.offset || select.orders.any?
|
||||
subsubselect = select.clone
|
||||
|
||||
@@ -1324,17 +1324,17 @@ User.where(:id => 1).includes(:posts).explain
|
||||
yields
|
||||
|
||||
<plain>
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+
|
||||
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+
|
||||
| 1 | SIMPLE | users | const | PRIMARY | PRIMARY | 4 | const | 1 | |
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------
|
||||
+----+-------------+-------+-------+---------------+---------+---------+-------+------+-------+
|
||||
1 row in set (0.00 sec)
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
||||
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
||||
| 1 | SIMPLE | posts | ALL | NULL | NULL | NULL | NULL | 1 | Using where |
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------
|
||||
+----+-------------+-------+------+---------------+------+---------+------+------+-------------+
|
||||
1 row in set (0.00 sec)
|
||||
</plain>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user