diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index bed4f47abe..1885a4ca95 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -64,12 +64,9 @@ module ActiveRecord end def columns(table_name, name = nil) - sql = "SHOW FIELDS FROM #{table_name}" - result = nil - log(sql, name, @connection) { |connection| result = connection.query(sql) } - + sql = "SHOW FIELDS FROM #{table_name}" columns = [] - result.each { |field| columns << Column.new(field[0], field[4], field[1]) } + execute(sql, name).each { |field| columns << Column.new(field[0], field[4], field[1]) } columns end |