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

Unexpected ER_INVALID_USE_OF_NULL upon concurrent UPDATE and ALTER

    XMLWordPrintable

Details

    Description

      Note: Quite possibly related to MDEV-21658.

      --source include/have_innodb.inc
       
      --connect (con1,localhost,root,,test)
       
      --connection default
      CREATE  TABLE t1 (a INT, b INT) ENGINE=InnoDB;
      ALTER TABLE t1 DROP COLUMN a;
      INSERT INTO t1 (b) VALUES (NULL);
      SET SQL_MODE= '';
       
      --send
      ALTER TABLE t1 ADD PRIMARY KEY (b) ;
      --connection con1
      PREPARE stmt FROM "UPDATE t1 SET b = 1";
      EXECUTE stmt;
       
      # Cleanup
      --disconnect con1
      --connection default
      --reap
      DROP TABLE t1;
      

      10.4 574354a6

      mysqltest: At line 20: query 'reap' failed: 1138: Invalid use of NULL value
      

      Reproducible on 10.4, 10.5.
      Not reproducible on 10.3.
      Not reproducible with MyISAM.
      Not reproducible if UPDATE is executed without a prepared statement.
      Not reproducible without ALTER which drops a column.
      Not reproducible if ALTER .. DROP is run with ALGORITHM=COPY.

      In all "not reproducible" variations above ALTER .. ADD PRIMARY KEY produces a warning Data truncated for column 'b' at row 1 which I think is expected.

      Attachments

        Issue Links

          Activity

            People

              marko Marko Mäkelä
              elenst Elena Stepanova
              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.