mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
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:
parent
893f605d61
commit
c8480627ca
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user