Add comment motivating magic number for MySQL error codes (#133516)

* Add comment motivating magic number for MySQL error codes

* Pick nits
This commit is contained in:
Erik Montnemery 2024-12-19 09:56:32 +01:00 committed by GitHub
parent 893f605d61
commit c8480627ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -175,7 +175,7 @@ def _unindexable_legacy_column(
) -> bool:
"""Ignore index errors on char(0) columns."""
# The error code is hard coded because the PyMySQL library may not be
# installed when using other database engines than MySQL or MariaDB.
# installed when using database engines other than MySQL or MariaDB.
# 1167: The used storage engine can't index column '%s'
return bool(
base == LegacyBase

View File

@ -107,6 +107,8 @@ MAX_RESTART_TIME = timedelta(minutes=10)
# Retry when one of the following MySQL errors occurred:
RETRYABLE_MYSQL_ERRORS = (1205, 1206, 1213)
# The error codes are hard coded because the PyMySQL library may not be
# installed when using database engines other than MySQL or MariaDB.
# 1205: Lock wait timeout exceeded; try restarting transaction
# 1206: The total number of locks exceeds the lock table size
# 1213: Deadlock found when trying to get lock; try restarting transaction