diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2011-05-01 18:22:43 -0600 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-05-01 18:22:43 -0600 |
commit | 635abc7194a0847fee1592eff9fa2fe84bafc5bf (patch) | |
tree | d26096858940f2f0c5c08e973af8f3e207a461e4 /activerecord/lib/active_record | |
parent | a8861c8f5b57ea653e1518325a686fd97995aef4 (diff) | |
download | rails-635abc7194a0847fee1592eff9fa2fe84bafc5bf.tar.gz rails-635abc7194a0847fee1592eff9fa2fe84bafc5bf.tar.bz2 rails-635abc7194a0847fee1592eff9fa2fe84bafc5bf.zip |
Remove schema noise from logging (TODO: Deprecate/remove the name attribute to all these methods -- will take a pull request!)
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index d3a054c29b..b6f838e49c 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -412,7 +412,7 @@ module ActiveRecord def tables(name = nil) tables = [] - execute("SHOW TABLES", name).each do |field| + execute("SHOW TABLES", 'SCHEMA').each do |field| tables << field.first end tables @@ -426,7 +426,7 @@ module ActiveRecord def indexes(table_name, name = nil) indexes = [] current_index = nil - result = execute("SHOW KEYS FROM #{quote_table_name(table_name)}", name) + result = execute("SHOW KEYS FROM #{quote_table_name(table_name)}", 'SCHEMA') result.each(:symbolize_keys => true, :as => :hash) do |row| if current_index != row[:Key_name] next if row[:Key_name] == PRIMARY # skip the primary key @@ -444,7 +444,7 @@ module ActiveRecord def columns(table_name, name = nil) sql = "SHOW FIELDS FROM #{quote_table_name(table_name)}" columns = [] - result = execute(sql) + result = execute(sql, 'SCHEMA') result.each(:symbolize_keys => true, :as => :hash) { |field| columns << Mysql2Column.new(field[:Field], field[:Default], field[:Type], field[:Null] == "YES") } @@ -546,7 +546,7 @@ module ActiveRecord # Returns a table's primary key and belonging sequence. def pk_and_sequence_for(table) keys = [] - result = execute("describe #{quote_table_name(table)}") + result = execute("DESCRIBE #{quote_table_name(table)}", 'SCHEMA') result.each(:symbolize_keys => true, :as => :hash) do |row| keys << row[:Field] if row[:Key] == "PRI" end |