aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-11-07 02:01:37 -0800
committerXavier Noria <fxn@hashref.com>2011-11-07 02:01:56 -0800
commit17ecdd388c70f7faf002ef21be6a674b4c0df7ca (patch)
treee0f5aac63c66c580c2ff8b4e6826b752a5012997 /activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
parent1a8df8aa883ebb5fbe4f74ec30e96f558b5a3521 (diff)
downloadrails-17ecdd388c70f7faf002ef21be6a674b4c0df7ca.tar.gz
rails-17ecdd388c70f7faf002ef21be6a674b4c0df7ca.tar.bz2
rails-17ecdd388c70f7faf002ef21be6a674b4c0df7ca.zip
adds trailing +s to the output of EXPLAIN for MySQL
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index 1146323147..baf4c043c4 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -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