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

Wrong result after instant size change of integer

    XMLWordPrintable

    Details

      Description

      The following test fails for ROW_FORMAT=REDUNDANT:

      --source include/have_innodb.inc
      --source include/innodb_row_format.inc
      CREATE TABLE t1 (a SERIAL, b INT, c TINYINT UNIQUE) ENGINE=InnoDB;
      INSERT INTO t1 (c) VALUES(1),(2),(3);
      --enable_info
      ALTER TABLE t1 MODIFY c BIGINT;
      --disable_info
      UPDATE t1 SET b=1 WHERE c=2;
      UPDATE t1 SET c=4 WHERE a=3;
      UPDATE t1 SET b=2 WHERE c>3;
      --error ER_DUP_ENTRY
      UPDATE t1 SET c=c+1;
      SELECT * FROM t1;
      DROP TABLE t1;
      

      It fails to flag the duplicate key error in the UPDATE, and the results are wrong. The most likely explanation is that row_build() is not (sign-)extending the integer column c to the correct size. For example, the value 0x83 should be properly sign-extended to 0x8000000000000003.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: