diff options
author | Jon Leighton <j@jonathanleighton.com> | 2012-01-31 00:20:05 -0800 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2012-01-31 08:23:25 +0000 |
commit | c472843bbc498fc0a21cb883c3929e191e061b3c (patch) | |
tree | 27901d73a4537d0d86d8f2afc89d83f8245fd606 /activerecord/lib/active_record | |
parent | 413790559c6d803b89eb5daf7d0dff39d8f7c991 (diff) | |
download | rails-c472843bbc498fc0a21cb883c3929e191e061b3c.tar.gz rails-c472843bbc498fc0a21cb883c3929e191e061b3c.tar.bz2 rails-c472843bbc498fc0a21cb883c3929e191e061b3c.zip |
Merge pull request #4763 from kennyj/fix_4754
[MySQL] Fix GH #4754. Remove double-quote characters around PK when using sql_mode=ANSI_QUOTES
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index 560773ca86..0cc5ee2958 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -505,7 +505,7 @@ module ActiveRecord execute_and_free("SHOW CREATE TABLE #{quote_table_name(table)}", 'SCHEMA') do |result| create_table = each_hash(result).first[:"Create Table"] if create_table.to_s =~ /PRIMARY KEY\s+\((.+)\)/ - keys = $1.split(",").map { |key| key.gsub(/`/, "") } + keys = $1.split(",").map { |key| key.gsub(/[`"]/, "") } keys.length == 1 ? [keys.first, nil] : nil else nil |