diff options
Diffstat (limited to 'activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb')
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb b/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb index ed3f669331..a5b53f76b4 100644 --- a/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb +++ b/activerecord/test/cases/adapters/mysql2/mysql2_adapter_test.rb @@ -204,6 +204,14 @@ class Mysql2AdapterTest < ActiveRecord::Mysql2TestCase end end + def test_doesnt_error_when_a_read_query_with_leading_chars_is_called_while_preventing_writes + @conn.execute("INSERT INTO `engines` (`car_id`) VALUES ('138853948594')") + + @conn.while_preventing_writes do + assert_equal 1, @conn.execute("(\n( SELECT `engines`.* FROM `engines` WHERE `engines`.`car_id` = '138853948594' ) )").entries.count + end + end + private def with_example_table(definition = "id int auto_increment primary key, number int, data varchar(255)", &block) |