Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5544

Custom errors (generated from storage engine) not getting returned by mariadb

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.6
    • Fix Version/s: 10.0.8
    • Component/s: None
    • 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.

      handler::print_error(int error, myf errflag)
      {
      ....
       default:
          {
            /* The error was "unknown" to this function.
      	 Ask handler if it has got a message for this error */
            bool temporary= FALSE;
            String str;
            temporary= get_error_message(error, &str);
      ...
      }

      Which will then call into the storage engine function

      virtual bool get_error_message(int error, String *buf);

      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.

      ERROR 1005 (HY000): Can't create table `test`.`call_data_record31` (errno: 168 "Unknown (generic) error from engine")

      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.

        Attachments

          Activity

            People

            • Assignee:
              serg Sergei Golubchik
              Reporter:
              michael Michael Fitzmaurice
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: