-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MySQL errors default to InternalError #816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hi - in this issue we would like to determine if this stack trace in PyMySQL is a bug:
I believe it is an error because "connection was killed" is being emitted by the server and PyMySQL should be anticipating this error and raising an OperationalError; an InternalError means it was not handled. can we get a yes/no on this? I'm likely going to work around in SQLAlchemy in any case. |
sqlalchemy-bot
pushed a commit
to sqlalchemy/sqlalchemy
that referenced
this issue
Nov 11, 2019
Added "Connection was killed" message interpreted from the base pymysql.Error class in order to detect closed connection, based on reports that this message is arriving via a pymysql.InternalError() object which indicates pymysql is not handling it correctly. Change-Id: If6bbe0eb5993e1996c0c5de752eebaf7446cf93e References: PyMySQL/PyMySQL#816 Fixes: #4945 (cherry picked from commit 31a66b5)
sqlalchemy-bot
pushed a commit
to sqlalchemy/sqlalchemy
that referenced
this issue
Nov 11, 2019
Added "Connection was killed" message interpreted from the base pymysql.Error class in order to detect closed connection, based on reports that this message is arriving via a pymysql.InternalError() object which indicates pymysql is not handling it correctly. Change-Id: If6bbe0eb5993e1996c0c5de752eebaf7446cf93e References: PyMySQL/PyMySQL#816 Fixes: #4945
methane
added a commit
to methane/PyMySQL
that referenced
this issue
Nov 12, 2019
methane
added a commit
to methane/PyMySQL
that referenced
this issue
Nov 12, 2019
methane
added a commit
that referenced
this issue
Nov 13, 2019
sumau
pushed a commit
to sumau/sqlalchemy
that referenced
this issue
Dec 29, 2019
Added "Connection was killed" message interpreted from the base pymysql.Error class in order to detect closed connection, based on reports that this message is arriving via a pymysql.InternalError() object which indicates pymysql is not handling it correctly. Change-Id: If6bbe0eb5993e1996c0c5de752eebaf7446cf93e References: PyMySQL/PyMySQL#816 Fixes: sqlalchemy#4945
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there any reason why MySQL errors are mapped to InternalError by default ?
PyMySQL/pymysql/err.py
Line 103 in fe0cd60
IMHO, most of the errors returned by MySQL are more likely to be related with OperationalError instead of InternalError. For instance, mysqldb use InternalError for codes below 1000 and OperationalError for other.
Also, this choice imply that any new error added in the future by implementors will be treated as InternalError. This already the case at least for MariaDB specific errors, and caused bugs like #607 or sqlalchemy/sqlalchemy#4945
The text was updated successfully, but these errors were encountered: