diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-22 16:38:18 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-22 16:38:18 +0000 |
commit | 8fff2381ca372d1a7c29d02ce59c3dccdfb99a31 (patch) | |
tree | ef8861856269424f8df32ecc5d9f562f2a3a52d9 /activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | |
parent | f3cf76d32dfce86a29c6e8a417841beb8c0a04a2 (diff) | |
download | rails-8fff2381ca372d1a7c29d02ce59c3dccdfb99a31.tar.gz rails-8fff2381ca372d1a7c29d02ce59c3dccdfb99a31.tar.bz2 rails-8fff2381ca372d1a7c29d02ce59c3dccdfb99a31.zip |
Fixed the Broken pipe error on SHOW FIELDs queries too
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@746 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql_adapter.rb')
-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 |