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

Include full name of object in message about incorrect value for column

    XMLWordPrintable

Details

    Description

      When a value isn't compatible with a column, the user sees an error message like the following:

      MariaDB [db1]> DELETE FROM tab1 WHERE col1='abcd';
      ERROR 1366 (22007): Incorrect decimal value: 'abcd' for column 'col1' at row 1
      

      It would be helpful if this error message also named the database and table, since a statement can affect multiple tables (such as when stored procedures, triggers, and views are involved), and multiple tables can have a column with the same name.

      For example, run the following SQL:

      CREATE TABLE tab1 (
          col1 char(10) NOT NULL
      );
       
      CREATE TABLE tab1_tgr (
          col1 decimal(8,0) NOT NULL
      );
       
      DELIMITER //
       
      CREATE TRIGGER delete_tab1_tgr BEFORE DELETE ON tab1 FOR EACH ROW
      BEGIN
          INSERT INTO tab1_tgr (col1) VALUES (old.col1);
      END //
       
      DELIMITER ;
       
      INSERT INTO tab1 VALUES ('abcd');
      DELETE FROM tab1 WHERE col1='abcd';
      

      Attachments

        Activity

          People

            holyfoot Alexey Botchkov
            GeoffMontee Geoff Montee (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.