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

MyISAM: ERROR 126 (HY000): Index for table ... is corrupt followed by ERROR 145 (HY000): Table ... is marked as crashed when using key_cache_segments=1, and 'Got an error from unknown thread' in error log

    XMLWordPrintable

Details

    Description

      CREATE TEMPORARY TABLE t (a INT KEY) ENGINE=MyISAM;
      SET GLOBAL key_cache_segments=1;
      INSERT INTO t VALUES (1);
      SET GLOBAL key_cache_segments=1;
      INSERT INTO t VALUES (1);
      SET max_session_mem_used=8912;
      ALTER TABLE t CHANGE COLUMN a a CHAR(1);
      SELECT * FROM t;
      

      Leads to:

      11.1.2 3883eb63dc5e663558571c33d086c9fd3aa0cf8f (Debug)

      11.1.2-dbg>CREATE TEMPORARY TABLE t (a INT KEY) ENGINE=MyISAM;
      Query OK, 0 rows affected (0.002 sec)
       
      11.1.2-dbg>SET GLOBAL key_cache_segments=1;
      Query OK, 0 rows affected (0.131 sec)
       
      11.1.2-dbg>INSERT INTO t VALUES (1);
      Query OK, 1 row affected (0.000 sec)
       
      11.1.2-dbg>SET GLOBAL key_cache_segments=1;
      Query OK, 0 rows affected (0.026 sec)
       
      11.1.2-dbg>INSERT INTO t VALUES (1);
      ERROR 126 (HY000): Index for table '-mariadb-11.1.2-linux-x86_64-dbg/data/#sql-temptable-b22-4-0.MYI' is corrupt; try to repair it
      11.1.2-dbg>SET max_session_mem_used=8912;
      Query OK, 0 rows affected (0.001 sec)
       
      11.1.2-dbg>ALTER TABLE t CHANGE COLUMN a a CHAR(1);
      ERROR 1290 (HY000): The MariaDB server is running with the --max-session-mem-used=8912 option so it cannot execute this statement
      11.1.2-dbg>SELECT * FROM t;
      ERROR 145 (HY000): Table '0623-mariadb-11.1.2-linux-x86_64-dbg/data/#sql-temptable-b22-4-0' is marked as crashed and should be repaired
      

      And:

      11.1.2 3883eb63dc5e663558571c33d086c9fd3aa0cf8f (Debug)

      Version: '11.1.2-MariaDB-debug'  socket: '/test/MD220623-mariadb-11.1.2-linux-x86_64-dbg/socket.sock'  port: 12294  MariaDB Server
      2023-06-30 14:29:24 4 [ERROR] mariadbd: Index for table 'riadb-11.1.2-linux-x86_64-dbg/data/#sql-temptable-1971bd-4-0.MYI' is corrupt; try to repair it
      2023-06-30 14:29:24 4 [ERROR] mariadbd: Index for table 'riadb-11.1.2-linux-x86_64-dbg/data/#sql-temptable-1971bd-4-0.MYI' is corrupt; try to repair it
      2023-06-30 14:29:24 4 [ERROR] Got an error from unknown thread, /test/11.1_dbg/storage/myisam/mi_write.c:226
      2023-06-30 14:29:24 4 [ERROR] mariadbd: Index for table 't' is corrupt; try to repair it
      

      Bug confirmed present in:
      MariaDB: 10.4.31 (dbg), 10.4.31 (opt), 10.5.22 (dbg), 10.5.22 (opt), 10.6.15 (dbg), 10.6.15 (opt), 10.9.8 (dbg), 10.9.8 (opt), 10.10.6 (dbg), 10.10.6 (opt), 10.11.5 (dbg), 10.11.5 (opt), 11.0.3 (dbg), 11.0.3 (opt), 11.1.2 (dbg), 11.1.2 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 8.0.33 (dbg), 8.0.33 (opt)

      Attachments

        Activity

          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.