← Back to team overview

maria-developers team mailing list archive

Re: Changing the error message for ER_LOCK_WAIT_TIMEOUT

 

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@xxxxxxxxxxx


References