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

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

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

          holyfoot Alexey Botchkov added a comment - http://lists.askmonty.org/pipermail/commits/2018-November/013056.html

          I didn't include modified test results in this patch to make it smaller.
          http://lists.askmonty.org/pipermail/commits/2018-November/013083.html

          Here is an example of tests that change with this patch:
          http://lists.askmonty.org/pipermail/commits/2018-November/013084.html

          holyfoot Alexey Botchkov added a comment - I didn't include modified test results in this patch to make it smaller. http://lists.askmonty.org/pipermail/commits/2018-November/013083.html Here is an example of tests that change with this patch: http://lists.askmonty.org/pipermail/commits/2018-November/013084.html

          holyfoot, I think that this should be closed as fixed, now that this is in the 10.2, 10.3, and 10.4 branches.
          Before closing, maybe you would fix the omission that I noticed in int select_export::send_data(List<Item> &items) (and add a test to cover the message)?

          marko Marko Mäkelä added a comment - holyfoot , I think that this should be closed as fixed, now that this is in the 10.2, 10.3, and 10.4 branches. Before closing, maybe you would fix the omission that I noticed in int select_export::send_data(List<Item> &items) (and add a test to cover the message)?

          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.