From 6ccbc638494e41e1f9320a00b51ddfc16a387191 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Wed, 30 Mar 2016 05:54:15 +0900 Subject: Add a test case for create a record with primary key as zero --- .../lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activerecord/lib/active_record') 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 0e22062913..e31d2237eb 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -856,6 +856,7 @@ module ActiveRecord sql_mode = "REPLACE(#{sql_mode}, 'STRICT_ALL_TABLES', '')" sql_mode = "REPLACE(#{sql_mode}, 'TRADITIONAL', '')" end + sql_mode = "CONCAT(#{sql_mode}, ',NO_AUTO_VALUE_ON_ZERO')" end sql_mode_assignment = "@@SESSION.sql_mode = #{sql_mode}, " if sql_mode -- cgit v1.2.3