aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql2
diff options
context:
space:
mode:
authorGabriel Courtemanche <gabriel.courtemanche@shopify.com>2017-08-22 13:32:38 -0400
committerGabriel Courtemanche <gabriel.courtemanche@shopify.com>2017-08-22 14:26:14 -0400
commitc5edd97721aeaa4ceaa11e66327842a0aba1fdf7 (patch)
treede0f8edbdeeee40ec7eb7ec745ce49b58b0de627 /activerecord/test/cases/adapters/mysql2
parent39e6eea9e54c93f836d79f0614f463bdcf95bab5 (diff)
downloadrails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.tar.gz
rails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.tar.bz2
rails-c5edd97721aeaa4ceaa11e66327842a0aba1fdf7.zip
Add TransactionTimeout for MySQL error code 1205
Diffstat (limited to 'activerecord/test/cases/adapters/mysql2')
-rw-r--r--activerecord/test/cases/adapters/mysql2/transaction_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/mysql2/transaction_test.rb b/activerecord/test/cases/adapters/mysql2/transaction_test.rb
index e603baab69..25d9f69a89 100644
--- a/activerecord/test/cases/adapters/mysql2/transaction_test.rb
+++ b/activerecord/test/cases/adapters/mysql2/transaction_test.rb
@@ -59,5 +59,11 @@ module ActiveRecord
end
end
end
+
+ test "raises TransactionTimeout when mysql raises ER_LOCK_WAIT_TIMEOUT" do
+ assert_raises(ActiveRecord::TransactionTimeout) do
+ ActiveRecord::Base.connection.execute("SIGNAL SQLSTATE 'HY000' SET MESSAGE_TEXT = 'Testing error', MYSQL_ERRNO = 1205;")
+ end
+ end
end
end