Skip to content
Browse files

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
  • Loading branch information...
1 parent 11d2a30 commit 96557eb35b2f28df663f2df6de4288931ee6143a @NZKoz NZKoz committed Oct 25, 2007
Showing with 1 addition and 2 deletions.
  1. +1 −2 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
View
3 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -442,9 +442,8 @@ def show_variable(name)
# 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

0 comments on commit 96557eb

Please sign in to comment.
Something went wrong with that request. Please try again.