1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/adapters/mysql
Jon Leighton 66982772b7 Fix broken mysql test
test_mysql_integer_not_null_defaults in test/cases/defaults_test.rb was
failing. This test relies on the connection being in strict mode. By
default a new connection is not in strict mode, but Active Record
automatically places it in strict mode.

ActiveSchemaTest overwrites the connection's #execute method in order to
prevent SQL statements from actually being executed. One of the
operations which is performed in ActiveSchema test is a #recreate_database.

Since 2088bf2798, recreate_database on
mysql or mysql2 will trigger a reconnect.

Due to the implementation of the hacking of #execute in
ActiveSchemaTest, this reconnect would take place, but the connection
would *not* be placed in strict mode because #execute had been
overridden to prevent SQL queries hitting the database.

Therefore, after ActiveSchemaTest, the connection would no longer be in
strict mode, causing test_mysql_integer_not_null_defaults to fail.

I don't think that the way that ActiveSchemaTest is implemented is
particularly nice or clean, but I have taken steps to make its hacks
more isolated - it now create a separate connection object which is
thrown away after the test, and the hacks are applied on the singleton
class of this object.
2013-05-03 11:36:02 +01:00
..
active_schema_test.rb Fix broken mysql test 2013-05-03 11:36:02 +01:00
case_sensitivity_test.rb fix to remove warning in test cases 2011-10-16 14:29:06 +05:30
connection_test.rb Removed unused loop variable 2013-03-22 14:21:46 +05:30
enum_test.rb fix detect column type of enum 2013-04-01 17:09:20 +09:00
mysql_adapter_test.rb Created a layer of abstraction for the valid type checking in schema dumper. Now, connection handles the check for valid types so that each database can handle the changes individually. 2013-03-25 09:35:22 -07:00
quoting_test.rb please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
reserved_word_test.rb Connection#structure_dump is no longer used. #9518 2013-03-06 15:12:20 +01:00
schema_test.rb Add support for FULLTEXT and SPATIAL indexes using the :type flag for MySQL. 2013-03-27 23:35:54 -04:00
sp_test.rb please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
sql_types_test.rb Use the MySQL varbinary type when appropriate in migrations. 2012-10-27 13:41:27 -04:00
statement_pool_test.rb LRU cache in mysql and sqlite are now per-process caches. 2011-09-07 15:26:47 -07:00