From 96557eb35b2f28df663f2df6de4288931ee6143a Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Thu, 25 Oct 2007 18:53:07 +0000 Subject: Remove superfluous code and quote table name. References #9971 [jkit, nzkoz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8015 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 5242151736..2b79823d04 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -442,9 +442,8 @@ module ActiveRecord # Returns a table's primary key and belonging sequence. def pk_and_sequence_for(table) #:nodoc: - table_desc_result = execute("describe #{table}") keys = [] - execute("describe #{table}").each_hash do |h| + execute("describe #{quote_table_name(table)}").each_hash do |h| keys << h["Field"]if h["Key"] == "PRI" end keys.length == 1 ? [keys.first, nil] : nil -- cgit v1.2.3