Skip to content

Commit

Permalink
Treat all Trilogy errors with error code 1205 as Sequel::DatabaseLock…
Browse files Browse the repository at this point in the history
…Timeout in the trilogy adapter

This fixes issues in recent versions of Trilogy where they changed
the format of the exception message.  Checking based solely on the
error code is how the mysql and mysql2 adapters handle things, and
it is best to be similar to those.
  • Loading branch information
jeremyevans committed Nov 8, 2024
1 parent c6c9588 commit d20c40d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
=== master

* Treat all Trilogy errors with error code 1205 as Sequel::DatabaseLockTimeout in the trilogy adapter (jeremyevans)

* Allow Data{base,set}#extension to not require files if the extension is already registered (jeremyevans) (#2246)

* Do not limit imports to 40 rows at a time if using pg_auto_parameterize extension with the no_auto_parameterize method (davekaro) (#2242)
Expand Down
3 changes: 1 addition & 2 deletions lib/sequel/adapters/trilogy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ def server_version(_server=nil)
private

def database_specific_error_class(exception, opts)
case exception.message
when /1205 - Lock wait timeout exceeded; try restarting transaction\z/
if exception.error_code == 1205
DatabaseLockTimeout
else
super
Expand Down

0 comments on commit d20c40d

Please sign in to comment.