We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug MySQL error with the code 1366 and 1367 are mapped to InternalError instead of DataError
To Reproduce For example try to pass string for the column which should be INTEGER, then you'll receive:
pymysql.err.InternalError: (1366, "Incorrect integer value: 'bad_value' for column 'col_int' at row 1")
Both MySQL errors defined in the ER.py:
ER.py
TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366 ILLEGAL_VALUE_FOR_TYPE = 1367
are not explicitly mapped to the DataError in err.py thus the InternalError is raised by default.
err.py
Schema:
CREATE DATABASE ... CREATE TABLE ...
Code:
import pymysql con = pymysql.connect(...)
Expected behavior Expect to be raised DataError for data not conformant with the schema
Environment
Additional context Other cases like exceeding the number value for TINYINT or exceeding maximum allowed length for VARCHAR fields results in DataError
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Describe the bug
MySQL error with the code 1366 and 1367 are mapped to InternalError instead of DataError
To Reproduce
For example try to pass string for the column which should be INTEGER, then you'll receive:
pymysql.err.InternalError: (1366, "Incorrect integer value: 'bad_value' for column 'col_int' at row 1")
Both MySQL errors defined in the
ER.py
:are not explicitly mapped to the DataError in
err.py
thus the InternalError is raised by default.Schema:
Code:
Expected behavior
Expect to be raised DataError for data not conformant with the schema
Environment
Additional context
Other cases like exceeding the number value for TINYINT or exceeding maximum allowed length for VARCHAR fields results in DataError
The text was updated successfully, but these errors were encountered: