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

An error is wrongly reported during INSERT with vcol index

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1(a INT PRIMARY KEY, b INT, vb DATE AS(b) VIRTUAL, KEY(vb))
      ENGINE=InnoDB;
      INSERT IGNORE INTO t1 (a,b) VALUES(1,20190132);
      BEGIN;
      DELETE FROM t1;
      # error ER_TRUNCATED_WRONG_VALUE Is wrongly reported here
      INSERT INTO t1 (a,b) VALUES(1,20190123);
      SELECT * FROM t1;
      ROLLBACK;
      SELECT * FROM t1;
      CHECK TABLE t1;
      DROP TABLE t1;
      

      The expected behavior is a succeeded insert.

      See commits aa8a31da (Bug #22990029 GCOLS: INCORRECT BEHAVIOR AFTER DATA INSERTED WITH IGNORE KEYWORD) and 64678c (Bug #22990029: Add a test case).

      That fix is better than incorrect behavior, but the expected behavior is to make an insert.
      The insert is truing to delete-unmark the record and for that it needed to recompute the value for the deleted record, which was inserted with IGNORE flag. The correct way would be to set the correcvt sql_mode and thd->abort_on_warning values for that recomputation, so that it always succeeds.

      See also MDEV-29299 where the case can be also affected

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              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.