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

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.0.6
    • 10.0.8
    • None
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.