diff options
author | kennyj <kennyj@gmail.com> | 2012-01-31 01:32:49 +0900 |
---|---|---|
committer | kennyj <kennyj@gmail.com> | 2012-01-31 02:13:12 +0900 |
commit | 1a1d9e687a488fb44fdcb8d02c982fbb7bd52909 (patch) | |
tree | cbae9c8b66e090b05917b11055ce140a74d02fb8 /activerecord/test | |
parent | 6831ab11106c582a67bb5109921629059e690610 (diff) | |
download | rails-1a1d9e687a488fb44fdcb8d02c982fbb7bd52909.tar.gz rails-1a1d9e687a488fb44fdcb8d02c982fbb7bd52909.tar.bz2 rails-1a1d9e687a488fb44fdcb8d02c982fbb7bd52909.zip |
Fix GH #4754. Remove double-quote when using ANSI_QUOTES
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/primary_keys_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/cases/primary_keys_test.rb b/activerecord/test/cases/primary_keys_test.rb index b4d1a631fa..e6e50a4cd4 100644 --- a/activerecord/test/cases/primary_keys_test.rb +++ b/activerecord/test/cases/primary_keys_test.rb @@ -200,3 +200,19 @@ class PrimaryKeyWithNoConnectionTest < ActiveRecord::TestCase assert_equal 'foo', model.primary_key end end + +if current_adapter?(:MysqlAdapter) or current_adapter?(:Mysql2Adapter) + class PrimaryKeyWithAnsiQuotesTest < ActiveRecord::TestCase + self.use_transactional_fixtures = false + + def test_primaery_key_method_with_ansi_quotes + con = ActiveRecord::Base.connection + con.execute("SET SESSION sql_mode='ANSI_QUOTES'") + assert_equal "id", con.primary_key("topics") + ensure + con.reconnect! + end + + end +end + |