Bug #96725 WL#11678 introduces issues with custom storage engines error codes
Submitted: 3 Sep 2019 14:13 Modified: 14 Jan 14:09
Reporter: Yura Sorokin (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S4 (Feature request)
Version:8.0.17 OS:Any
Assigned to: CPU Architecture:Any

[3 Sep 2019 14:13] Yura Sorokin
Description:
WL#11678 "Logging services: Add unique error-ids to the messages logged using error_log_printf()"
(https://dev.mysql.com/worklog/task/?id=11678)
(https://github.com/mysql/mysql-server/commit/682bc7d)
does a great job with separating server-to-client error codes from server error message codes at the boundary 'ER_SERVER_RANGE_START' (10000).

Basically, error codes are now reorganized into the following ranges:
*  1000.. 1999 - server-to-client messages =< 5.6
*  2000.. 2999 - reserved
*  3000.. 3499 - server-to-client messages 5.7
*  3500.. 4999 - server-to-client messages 8.0
*  5000.. 5999 - reserved for X Plugin
* 10000..49999 - server log messages
* 50000..51999 - reserved

How to repeat:
The problem here is that before this commit 50000..51999 range by silent agreement was reserved for alternative storage engine error codes (in particular for RocksDB).
This is why this range is marked as 'reserved' in the 'errmsg-utf8.txt'.

However, after the refactoring server-to-client error codes in this range 50000..51999 are greater than 'ER_SERVER_RANGE_START' (10000) and trigger assertions.

Suggested fix:
It would be great if in one of the upcoming versions, say 8.0.18, Oracle could make a reservation for alternative SE error codes in the client range as well.
8000..9999 looks like a fair candidate.
[3 Sep 2019 14:51] Sinisa Milivojevic
Hello Mr. Sorokin,

Thank you for your bug report.

I consider this as a valid request for a new feature that would allow third-party storage engines to have their own range of error codes.

Verified as.a feature request.
[14 Jan 14:09] Yura Sorokin
I believe this issue is at least partially addressed in MySQL Server 8.0.19

WL#13423: Split errmgs-utf8.txt into one file for messages to clients and another for messages to the error log
https://dev.mysql.com/worklog/task/?id=13423
https://github.com/mysql/mysql-server/commit/650d8cf7d07
[14 Jan 14:31] Sinisa Milivojevic
Yes, this note about 8.0.19 seems to be correct .....