Permalink
Browse files

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
  • Loading branch information...
1 parent f3cf76d commit 8fff2381ca372d1a7c29d02ce59c3dccdfb99a31 @dhh dhh committed Feb 22, 2005
Showing with 2 additions and 5 deletions.
  1. +2 −5 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -64,12 +64,9 @@ def select_one(sql, name = nil)
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

0 comments on commit 8fff238

Please sign in to comment.