[CONPY-106] Exceptions and MariaDB Error codes Created: 2020-08-14  Updated: 2020-08-16  Resolved: 2020-08-14

Status: Closed
Project: MariaDB Connector/Python
Component/s: Generic
Affects Version/s: 1.0.0
Fix Version/s: 1.0.1

Type: Bug Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: sqlalchemy

Issue Links:
Blocks
blocks CONPY-77 Add mariadb dialect to sqlalchemy Closed

 Description   

Currently exception types are checked via SQLSTATE which isn't accurate.

Instead depending on the error number the exception type should be chosen.

MariaDB.DataError:

  • ER_DATA_TOO_LONG
  • ER_DATETIME_FUNCTION_OVERFLOW
  • ER_DIVISION_BY_ZERO
  • ER_NO_DEFAULT
  • ER_PRIMARY_CANT_HAVE_NULL
  • ER_WARN_DATA_OUT_OF_RANGE
  • WARN_DATA_TRUNCATED

Mariadb.ProgrammingError:

  • CR_COMMANDS_OUT_OF_SYNC
  • ER_CANT_DO_THIS_DURING_AN_TRANSACTION
  • ER_DB_CREATE_EXISTS
  • ER_FIELD_SPECIFIED_TWICE
  • ER_INVALID_GROUP_FUNC_USE
  • ER_NO_SUCH_INDEX
  • ER_NO_SUCH_KEY_VALUE
  • ER_NO_SUCH_TABLE
  • ER_NO_SUCH_USER
  • ER_PARSE_ERROR
  • ER_SYNTAX_ERROR
  • ER_TABLE_MUST_HAVE_COLUMNS
  • ER_UNSUPPORTED_EXTENSION
  • ER_WRONG_DB_NAME
  • ER_WRONG_TABLE_NAME

Mariadb.IntegrityError:

  • ER_CANNOT_ADD_FOREIGN
  • ER_DUP_ENTRY
  • ER_DUP_UNIQUE
  • ER_NO_DEFAULT_FOR_FIELD
  • ER_NO_REFERENCED_ROW
  • ER_NO_REFERENCED_ROW_2
  • ER_ROW_IS_REFERENCED
  • ER_ROW_IS_REFERENCED_2

Mariadb.OperationError:
For errornumbers >= 1000 which aren't listed above

Mariadb.InternalError
For errornumbers < 1000 which aren't listed above



 Comments   
Comment by Georg Richter [ 2020-08-14 ]

Fixed rev. e091edd54909f07e18875526debd5231bd444b5c

Generated at Thu Feb 08 03:30:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.