mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #35017 from yahonda/mysql8014
MySQL 8.0.14 adds `ER_FK_INCOMPATIBLE_COLUMNS`
This commit is contained in:
commit
0815474d2f
1 changed files with 2 additions and 1 deletions
|
@ -627,6 +627,7 @@ module ActiveRecord
|
||||||
ER_LOCK_WAIT_TIMEOUT = 1205
|
ER_LOCK_WAIT_TIMEOUT = 1205
|
||||||
ER_QUERY_INTERRUPTED = 1317
|
ER_QUERY_INTERRUPTED = 1317
|
||||||
ER_QUERY_TIMEOUT = 3024
|
ER_QUERY_TIMEOUT = 3024
|
||||||
|
ER_FK_INCOMPATIBLE_COLUMNS = 3780
|
||||||
|
|
||||||
def translate_exception(exception, message:, sql:, binds:)
|
def translate_exception(exception, message:, sql:, binds:)
|
||||||
case error_number(exception)
|
case error_number(exception)
|
||||||
|
@ -634,7 +635,7 @@ module ActiveRecord
|
||||||
RecordNotUnique.new(message, sql: sql, binds: binds)
|
RecordNotUnique.new(message, sql: sql, binds: binds)
|
||||||
when ER_NO_REFERENCED_ROW, ER_ROW_IS_REFERENCED, ER_ROW_IS_REFERENCED_2, ER_NO_REFERENCED_ROW_2
|
when ER_NO_REFERENCED_ROW, ER_ROW_IS_REFERENCED, ER_ROW_IS_REFERENCED_2, ER_NO_REFERENCED_ROW_2
|
||||||
InvalidForeignKey.new(message, sql: sql, binds: binds)
|
InvalidForeignKey.new(message, sql: sql, binds: binds)
|
||||||
when ER_CANNOT_ADD_FOREIGN
|
when ER_CANNOT_ADD_FOREIGN, ER_FK_INCOMPATIBLE_COLUMNS
|
||||||
mismatched_foreign_key(message, sql: sql, binds: binds)
|
mismatched_foreign_key(message, sql: sql, binds: binds)
|
||||||
when ER_CANNOT_CREATE_TABLE
|
when ER_CANNOT_CREATE_TABLE
|
||||||
if message.include?("errno: 150")
|
if message.include?("errno: 150")
|
||||||
|
|
Loading…
Reference in a new issue