mysql2 icon indicating copy to clipboard operation
mysql2 copied to clipboard

MySQL2 gem doesn't handle new MariaDB10.4 error code: 1396

Open Rudis1261 opened this issue 4 years ago • 0 comments

Hi There,

Seems that the gem doesn't handle new error codes introduced by MariaDB 10.4. See this following error code 1396 which MariaDB throws when attempting to insert a new user which collides with an existing user:

ERROR 1396 (HY000): Operation CREATE USER failed for 'user4e63'@'%'

I did grep through the code and it seems this error code isn't currently handled. It would be awesome if it could catch this error code, and re-throw it in a more descriptive way. So clients are able to make a decision based on that result.

The error code is documented here: https://mariadb.com/kb/en/mariadb-error-codes/

Error Code SQLSTATE Error Description
1396 HY000 ER_CANNOT_USER Operation %s failed for %s

There may be more that aren't currently accounted for.

Rudis1261 avatar Sep 21 '20 14:09 Rudis1261