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

An error is wrongly reported during INSERT with vcol index

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

            nikitamalyavin Nikita Malyavin created issue -
            nikitamalyavin Nikita Malyavin made changes -
            Field Original Value New Value
            nikitamalyavin Nikita Malyavin made changes -
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.10 [ 27530 ]
            Fix Version/s 10.11 [ 27614 ]
            nikitamalyavin Nikita Malyavin made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Nikita Malyavin [ nikitamalyavin ] Marko Mäkelä [ marko ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            nikitamalyavin Nikita Malyavin made changes -
            Assignee Marko Mäkelä [ marko ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            nikitamalyavin Nikita Malyavin made changes -
            Component/s Storage Engine - InnoDB [ 10129 ]
            Component/s Virtual Columns [ 10803 ]
            Fix Version/s 10.3.37 [ 28404 ]
            Fix Version/s 10.4.27 [ 28405 ]
            Fix Version/s 10.5.18 [ 28421 ]
            Fix Version/s 10.6.11 [ 28441 ]
            Fix Version/s 10.7.7 [ 28442 ]
            Fix Version/s 10.8.6 [ 28443 ]
            Fix Version/s 10.9.4 [ 28444 ]
            Fix Version/s 10.10.2 [ 28410 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.7 [ 24805 ]
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.10 [ 27530 ]
            Fix Version/s 10.11 [ 27614 ]
            Assignee Sergei Golubchik [ serg ] Nikita Malyavin [ nikitamalyavin ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            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.