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

Table 't' is marked as crashed and should be repaired on UPDATE and sql_mode changes

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.9(EOL)
    • 10.5, 10.6
    • None

    Description

      Slightly alike to MDEV-11691, but this one is not in upstream and the SQL required is different.

      SET sql_mode='';
      CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV;
      INSERT INTO t0 VALUES (0);
      RENAME TABLE t0 TO t;
      SET sql_mode='traditional';
      UPDATE t SET a=0;
      

      Leads to:

      10.7.0 1bc82aaf0a7746c0921a94034aff2d51f0d75cd0 (Debug)

      2021-09-10  8:26:50 4 [ERROR] mysqld: Table 't' is marked as crashed and should be repaired
      

      Attachments

        Issue Links

          Activity

            correct test case

            SET sql_mode='';
            CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV;
            INSERT INTO t0 VALUES (0);
            RENAME TABLE t0 TO t;
            SET sql_mode='traditional';
            --error ER_TRUNCATED_WRONG_VALUE
            UPDATE t SET a=0;
            

            sanja Oleksandr Byelkin added a comment - correct test case SET sql_mode=''; CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV; INSERT INTO t0 VALUES (0); RENAME TABLE t0 TO t; SET sql_mode='traditional'; --error ER_TRUNCATED_WRONG_VALUE UPDATE t SET a=0;

            The previously seen corruption is no longer present. However, versions up to 10.9 now give ERROR 1292, and 10.10 and onwards show ERROR 1178:

            10.4.32 47f0135d7aba57d160d1d95ff7f1f6b7bb07c2fb (Debug)

            10.4.32-dbg>UPDATE t SET a=0;
            ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column `test`.`t`.`a` at row 1
            

            ...

            10.9.8 3e0009dc3a771e4dbf2fa4a4cf87e750453fb2eb (Debug)

            10.9.8-dbg>UPDATE t SET a=0;
            ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column `test`.`t`.`a` at row 1
            

            10.10.7 11c69177e9eebaab65984ee06e7b2873b3067d5f (Debug)

            10.10.7-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV;
            ERROR 1178 (42000): The storage engine for the table doesn't support nullable columns
            

            ...

            10.11.6 e39ed5d76fea4b6247db0db8d878cb2209e44455 (Debug)

            10.11.6-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV;
            ERROR 1178 (42000): The storage engine for the table doesn't support nullable columns
            

            ...

            11.3.0 905c3d61e18ae6222d0d195c43d335046eec65d9 (Debug)

            11.3.0-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV;
            ERROR 1178 (42000): The storage engine for the table doesn't support nullable column
            

            Roel Roel Van de Paar added a comment - The previously seen corruption is no longer present. However, versions up to 10.9 now give ERROR 1292 , and 10.10 and onwards show ERROR 1178 : 10.4.32 47f0135d7aba57d160d1d95ff7f1f6b7bb07c2fb (Debug) 10.4.32-dbg>UPDATE t SET a=0; ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column `test`.`t`.`a` at row 1 ... 10.9.8 3e0009dc3a771e4dbf2fa4a4cf87e750453fb2eb (Debug) 10.9.8-dbg>UPDATE t SET a=0; ERROR 1292 (22007): Incorrect datetime value: '0000-00-00 00:00:00' for column `test`.`t`.`a` at row 1 10.10.7 11c69177e9eebaab65984ee06e7b2873b3067d5f (Debug) 10.10.7-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV; ERROR 1178 (42000): The storage engine for the table doesn't support nullable columns ... 10.11.6 e39ed5d76fea4b6247db0db8d878cb2209e44455 (Debug) 10.11.6-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV; ERROR 1178 (42000): The storage engine for the table doesn't support nullable columns ... 11.3.0 905c3d61e18ae6222d0d195c43d335046eec65d9 (Debug) 11.3.0-dbg>CREATE TABLE t0 (a TIMESTAMP) ENGINE=CSV; ERROR 1178 (42000): The storage engine for the table doesn't support nullable column

            People

              sanja Oleksandr Byelkin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.