[MDEV-5544] Custom errors (generated from storage engine) not getting returned by mariadb Created: 2014-01-20 Updated: 2014-02-04 Resolved: 2014-02-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 10.0.6 |
| Fix Version/s: | 10.0.8 |
| Type: | Bug | Priority: | Major |
| Reporter: | Michael Fitzmaurice | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
windows,linux |
||
| Description |
|
For most SQL statements, eg, delete, select etc, if i return a HA_ERRO_GENERIC, then Mariadb/Mysql will call back into the storage engine via the following function.
Which will then call into the storage engine function
I am then able to return my custom error message. However, If a CREATE TABLE fails, and i return a HA_ERR_GENERIC mariadb never call back into the storage engine to get the custom error, so my custom error will not get shown. Instead an ambiguous error like this will get returned.
Is this a know problem, or is there something i need to do to get generic errors returned when a create table fails. note even if i enable --show-warnings, i am still not getting the custom errors back when create table fails. |
| Comments |
| Comment by Sergei Golubchik [ 2014-01-29 ] |
|
I cannot really use get_error_message() instead of the current error message. The current message says "Can't create table..." and the error number. Calling handler::print_error() instead would've replaced that with "Got error NNN from..." which is not appropriate here, particularly if the engine doesn't provide a custom error message for this case. But I can call handler::print_error() in addition to the "Can't create table..." error message. Custom engine error text will be visible in SHOW WARNINGS (or, exactly, with --show-warnings). Would that be ok for you? |
| Comment by Michael Fitzmaurice [ 2014-01-29 ] |
|
Yes, returning the custom error information as a warning will be OK (ie. via SHOW WARNINGS) thanks, |