mirror of
https://github.com/mariadb-corporation/mariadb-connector-python.git
synced 2025-08-06 18:19:50 +00:00
Error handling fixes:
Instead of OperationalException and IntegrityException will be raised for the following eror types: ER_BAD_NULL_ERROR, ER_DATA_OUT_OF_RANGE, ER_CONSTRAINT_FAILED, ER_DUP_CONSTRAINT_NAME
This commit is contained in:
@ -96,6 +96,10 @@ static PyObject *get_exception_type(int error_number)
|
||||
case ER_ROW_IS_REFERENCED_2:
|
||||
case ER_XAER_OUTSIDE:
|
||||
case ER_XAER_RMERR:
|
||||
case ER_BAD_NULL_ERROR:
|
||||
case ER_DATA_OUT_OF_RANGE:
|
||||
case ER_CONSTRAINT_FAILED:
|
||||
case ER_DUP_CONSTRAINT_NAME:
|
||||
return Mariadb_IntegrityError;
|
||||
default:
|
||||
/* MariaDB Error */
|
||||
|
Reference in New Issue
Block a user