[Maria-developers] Changing the error message for ER_LOCK_WAIT_TIMEOUT
Hi Sergei and everyone, MariaDB defines ER_LOCK_WAIT_TIMEOUT as share/errmsg-utf8.txt: eng "Lock wait timeout exceeded; try restarting transaction" facebook/mysql-5.6 has an enhancement: it also shows what kind of lock is held: share/errmsg-utf8.txt: eng "Lock wait timeout exceeded; try restarting transaction: %-.256s" the new error messages have more info and look like this: https://gist.github.com/spetrunia/266272c384a1b43081572e1ba2baf3f3 note that MyRocks also provides extra information. So, the questions are: - Is it (generally) possible to change error message texts in 10.2 still? - Can/should we change the ER_LOCK_WAIT_TIMEOUT error text? - (non-question) I assume that adding another error code with the new error text is not a good solution: two error codes for the same error will be very confusing. The number of times ER_LOCK_WAIT_TIMEOUT is used in the source is actually quite small: https://gist.github.com/spetrunia/2bc2ed7040a930d75b39162becbc7963 (25 occurences, and most of them actually dont care about the error message). There are lots of .result files to update, though. Any opinions? BR Sergei -- Sergei Petrunia, Software Developer MariaDB Corporation | Skype: sergefp | Blog: http://s.petrunia.net/blog
Hi, Sergey! On Nov 12, Sergey Petrunia wrote:
Hi Sergei and everyone,
MariaDB defines ER_LOCK_WAIT_TIMEOUT as
share/errmsg-utf8.txt: eng "Lock wait timeout exceeded; try restarting transaction"
facebook/mysql-5.6 has an enhancement: it also shows what kind of lock is held:
share/errmsg-utf8.txt: eng "Lock wait timeout exceeded; try restarting transaction: %-.256s"
the new error messages have more info and look like this: https://gist.github.com/spetrunia/266272c384a1b43081572e1ba2baf3f3
note that MyRocks also provides extra information.
So, the questions are:
- Is it (generally) possible to change error message texts in 10.2 still?
Yes
- Can/should we change the ER_LOCK_WAIT_TIMEOUT error text?
Yes
- (non-question) I assume that adding another error code with the new error text is not a good solution: two error codes for the same error will be very confusing.
Not a problem, see how we print ER_DUP_ENTRY, for example: my_printf_error(ER_DUP_ENTRY, ER(ER_DUP_ENTRY_WITH_KEY_NAME), errflag, str.c_ptr_safe(), key->name); that is, the error *code* is the old ER_DUP_ENTRY, but the error *message* is the newer ER_DUP_ENTRY_WITH_KEY_NAME. But you don't have to resort to this, I think, just add this extra text to ER_LOCK_WAIT_TIMEOUT. Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (2)
-
Sergei Golubchik
-
Sergey Petrunia