rails/activerecord/test/cases
Doug Barth 5d870c9291 Don't swallow exceptions in transctional statements
The MySQL connection adapater swallows all StandardError exceptions,
which includes Mysql::Error and Mysql2::Error. The comment in the
exception clause claims errors thrown here indicate that transactions
aren't supported by the server but that isn't necessarily true. It's
possible the MySQL server has gone away and swallowing a failed commit
may let the application return a successful response when the data has
not been saved. Also, replication libraries like Galera require that the
application handle exceptions thrown at BEGIN/COMMIT.

I'm unable to determine what version of MySQL threw an exception for
transactional statements. I tried as far back as 3.23.49 with InnoDB
disabled but BEGIN & COMMIT statements do not throw an error. If there's
a real case for this logic to continue, we could instead push this
behavior into a configuration setting.

The exception swallowing has been there since the beginning:
db045dbbf60b53dbe013ef25554fd013baf88134
2013-11-05 11:47:08 -08:00
..
adapters Don't swallow exceptions in transctional statements 2013-11-05 11:47:08 -08:00
associations Fix wrong behavior where associations with dependent: :destroy options 2013-11-01 19:04:30 -02:00
attribute_methods initialize generated modules on inclusion and on inheritence 2013-07-02 17:11:35 -07:00
coders Remove all error masking when decoding serialized data fails? 2013-04-02 11:45:14 -04:00
connection_adapters Move method used only in the test to the test code itself 2013-04-25 01:43:28 +04:00
connection_specification Do not type cast all the database url values. 2013-02-24 14:36:18 -03:00
fixture_set Move/rename files to follow naming conventions 2012-10-07 20:43:18 +02:00
migration Make 'enable_extension' revertible 2013-08-10 03:25:04 -04:00
relation Delegate #rewhere to all on the class like all other relation methods 2013-11-02 19:45:03 -07:00
scoping unscope now works on default_scope after 94924dc32baf78f13e289172534c2e71c9c8cade 2013-11-02 22:11:20 -02:00
tasks More Warnings removed for ruby trunk 2013-11-01 13:47:23 +01:00
validations Properly repair validations when dynamically added 2013-07-29 03:03:24 +09:00
adapter_test.rb Defines the return type of select / select_all method. 2013-07-23 02:05:49 +09:00
aggregations_test.rb Removed unnecessary class 2013-04-06 02:17:38 +05:30
ar_schema_test.rb Call assume_migrated_upto_version on connection 2013-05-11 22:39:39 -04:00
associations_test.rb do is_a? tests on assignment so runtime is faster 2013-07-31 18:19:36 -07:00
attribute_methods_test.rb Merge pull request #9860 from wangjohn/update_attributes_throws_error_with_nil 2013-09-24 11:56:50 -03:00
autosave_association_test.rb Squashed commit of the following: 2013-10-01 15:40:40 -07:00
base_test.rb Remove private API test 2013-11-05 13:31:31 -02:00
batches_test.rb Merge pull request #11161 from dmitry/find_in_batches_works_without_logger 2013-06-28 06:00:20 -07:00
binary_test.rb Use Encoding::UTF_8 constant 🚯 2013-01-28 17:06:02 +09:00
bind_parameter_test.rb fix todo: use minitest skip instead of return nil 2012-05-13 02:27:52 -05:00
calculations_test.rb Change test_registering_new_handlers and test_count_on_invalid_columns_raises 2013-08-02 05:55:31 +09:00
callbacks_test.rb callbacks are wrapped with lambdas 2013-05-10 10:13:21 -07:00
clone_test.rb Fix freeze applying to cloned objects 2013-04-15 19:57:28 -04:00
column_alias_test.rb
column_definition_test.rb decouple column definition from the database connection 2013-03-22 16:21:59 -07:00
column_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
connection_management_test.rb rescue from all exceptions in ConnectionManagement#call 2013-07-22 14:44:33 +05:30
connection_pool_test.rb if we remove the connection from the pool, we should close it 2013-07-08 16:21:47 -07:00
core_test.rb Extract AR::Core#inspect and AR::Core.inspect's test code from base_test.rb 2013-05-22 02:24:37 +09:00
counter_cache_test.rb Refactor AR's counter_cache_test.rb test 2013-05-23 01:28:04 +09:00
custom_locking_test.rb Deprecate ActiveRecord::Base.scoped. 2012-07-27 17:27:47 +01:00
database_statements_test.rb
date_time_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
defaults_test.rb Handle single quotes in PostgreSQL default column values 2013-06-19 11:03:40 -05:00
dirty_test.rb prevent time_zone_aware_attributes test leak. follow-up to #12633. 2013-10-25 17:05:41 +02:00
disconnected_test.rb Fix rake test_sqlite3_mem 2013-06-28 11:37:42 +01:00
dup_test.rb Don't need to check if the scope respond to call 2013-08-31 14:53:28 -03:00
enum_test.rb store enum mapping using Strings instead of Symbols. 2013-11-05 17:44:08 +01:00
explain_subscriber_test.rb Don't try to EXPLAIN select_db calls 2013-05-10 16:21:59 +02:00
explain_test.rb Remove unused return value, because collecting_queries_for_explain isn't public API. 2013-03-06 00:35:55 +09:00
finder_respond_to_test.rb Avoid compiling regexs in AR::Base.respond_to? 2013-08-21 18:18:26 -07:00
finder_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
fixtures_test.rb Just change ENV and restore it afterwards. 2013-10-07 10:15:23 +02:00
forbidden_attributes_protection_test.rb Add regression test to #12343 2013-09-24 20:59:26 -03:00
habtm_destroy_order_test.rb
helper.rb Warnings removed for ruby trunk 2013-11-01 09:49:57 +01:00
hot_compatibility_test.rb Add an explicit test for hot compatibility 2012-09-28 18:08:14 +01:00
i18n_test.rb
inheritance_test.rb Port test from cf1904f to avoid future regression 2013-10-03 14:11:12 -04:00
integration_test.rb Respect cache timestamp format when giving timestamps to #cache_key 2013-11-04 13:11:51 -02:00
invalid_connection_test.rb Fix test 2013-06-28 11:46:03 +01:00
invalid_date_test.rb Remove unused assignments from activerecord tests 2012-04-29 10:02:58 -07:00
invertible_migration_test.rb fix failing test caused by 3771e4d511 2013-05-06 16:49:06 -04:00
json_serialization_test.rb rewrite tests to have no side-effects on include_root_in_json. 2013-03-04 21:18:40 +01:00
locking_test.rb Deprecate unused quoted_locking_column method. 2013-09-24 21:56:52 +09:00
log_subscriber_test.rb log the sql that is actually sent to the database 2013-06-19 17:37:27 +05:30
migration_test.rb Warnings removed for ruby trunk 2013-11-01 09:49:57 +01:00
migrator_test.rb Remove deprecated String constructor from ActiveRecord::Migrator. 2013-07-04 09:49:03 +02:00
mixin_test.rb
modules_test.rb add missing require 2013-10-02 17:04:02 -07:00
multiparameter_attributes_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
multiple_db_test.rb Remove ActiveRecord::Model 2012-10-26 15:51:02 +01:00
nested_attributes_test.rb This test does not test anything that happens in the real world. If you 2013-06-13 15:36:50 -07:00
nested_attributes_with_callbacks_test.rb Use assert_not rather than refute 2013-08-12 15:21:21 +02:00
persistence_test.rb Raising an error when nil or non-hash is passed to update_attributes. 2013-06-25 20:56:58 -07:00
pooled_connections_test.rb remove dead code 2013-07-08 16:30:10 -07:00
primary_keys_test.rb Fix class and method name typos 2013-05-12 15:03:14 +05:30
query_cache_test.rb Standardize the use of current_adapter? 2013-01-01 19:18:34 -03:00
quoting_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
readonly_test.rb implicit_readonly is being removed in favor of calling readonly explicitly 2013-05-27 21:07:39 +02:00
reaper_test.rb ConnectionPool wait_timeout no longer used for different types of timeouts. #6441 2012-05-23 12:08:11 -04:00
reflection_test.rb scope_chain should not be mutated for other reflections 2013-10-14 11:59:59 -04:00
relation_test.rb Merge pull request #12129 from Empact/deprecate-array-bang-delegation 2013-09-12 21:36:00 -03:00
relations_test.rb Fix order dependent tests 2013-10-22 11:35:33 -02:00
reload_models_test.rb Revert "Merge pull request #8989 from robertomiranda/use-rails-4-find-by" 2013-01-18 09:15:19 -05:00
result_test.rb Merge pull request #10993 from Empact/result-each-enumerator 2013-06-25 20:07:59 -03:00
sanitize_test.rb Process sub-query relation's binding values 2013-10-20 21:07:07 +03:00
schema_dumper_test.rb Escape the parentheses in the default function regexp 2013-10-21 16:20:28 -02:00
serialization_test.rb ActiveRecord::Base.include_root_in_json is false by default. 2013-03-04 21:18:40 +01:00
serialized_attribute_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
statement_cache_test.rb cleanup statement cache test 2013-04-11 18:08:46 +05:30
store_test.rb stored_attributes need to be specific to a subclass. 2013-10-25 08:35:35 +02:00
test_case.rb assert_no_queries should allow to ignore some queries 2013-07-30 13:31:00 +05:30
timestamp_test.rb Removed unused associations 2013-04-24 15:07:39 +01:00
transaction_callbacks_test.rb Don't rewrite AR connection#commit_db_transaction method globally 2013-07-29 03:03:24 +09:00
transaction_isolation_test.rb Rename update_attributes method to update, keep update_attributes as an alias 2013-01-03 11:51:21 -05:00
transactions_test.rb Assert presence of "frozen" in error message, not the full MRI message. 2013-10-08 00:15:07 +02:00
unconnected_test.rb Remove ActiveRecord::Model 2012-10-26 15:51:02 +01:00
validations_repair_helper.rb The repair_validations helper was not working correctly before because 2013-03-19 12:23:20 -04:00
validations_test.rb Remove mass assignment security from ActiveRecord 2012-09-16 23:58:19 -05:00
xml_serialization_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00
yaml_serialization_test.rb prevent global timezone state from leaking out of test cases. 2013-10-25 14:40:57 +02:00