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

MyISAM auto-repair does not repair vector key

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (pk INT PRIMARY KEY, v VECTOR(1) NOT NULL, VECTOR(v)) ENGINE=MyISAM;
      INSERT INTO t VALUES (1,0x31313131);
      --let $restart_parameters= --myisam-recover-options=FORCE
      --let $shutdown_timeout= 0
      --source include/restart_mysqld.inc
      SELECT * FROM t;
      CHECK TABLE t EXTENDED;
      REPAIR TABLE t;
      CHECK TABLE t EXTENDED;
       
      DROP TABLE t;
      

      11.8 311171c176d78730e94cc9acd2ae5f407607c9e3

      # restart: --myisam-recover-options=FORCE
      SELECT * FROM t;
      pk	v
      1	1111
      Warnings:
      Error	145	Table './test/t' is marked as crashed and should be repaired
      Warning	1034	1 client is using or hasn't closed the table properly
      Note	1034	Table is fixed
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	Error	Table './test/t#i#01' is marked as crashed and should be repaired
      test.t	check	status	Operation failed
      REPAIR TABLE t;
      Table	Op	Msg_type	Msg_text
      test.t	repair	note	Table does not support optimize, doing recreate + analyze instead
      test.t	repair	status	OK
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      DROP TABLE t;
      bug.vec1                                 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2025-07-02 16:52:33
      line
      2025-07-02 16:52:32 3 [ERROR] mariadbd: Table './test/t' is marked as crashed and should be repaired
      2025-07-02 16:52:32 3 [Warning] Checking table:   './test/t'
      2025-07-02 16:52:32 3 [ERROR] mariadbd: Table './test/t#i#01' is marked as crashed and should be repaired
      

      So, it fixes the main table, but not the vector key "table".

      Compare to a spatial key, for example (not sure it's a meaningful comparison, but anyway):

      CREATE TABLE t (pk INT PRIMARY KEY, v GEOMETRY NOT NULL, SPATIAL(v)) ENGINE=MyISAM;
      INSERT INTO t VALUES (1,POINT(0,0));
      # restart: --myisam-recover-options=FORCE
      SELECT * FROM t;
      pk	v
      1	
      Warnings:
      Error	145	Table './test/t' is marked as crashed and should be repaired
      Warning	1034	1 client is using or hasn't closed the table properly
      Note	1034	Table is fixed
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      REPAIR TABLE t;
      Table	Op	Msg_type	Msg_text
      test.t	repair	status	OK
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      DROP TABLE t;
      bug.vec1                                 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2025-07-02 16:55:36
      line
      2025-07-02 16:55:35 3 [ERROR] mariadbd: Table './test/t' is marked as crashed and should be repaired
      2025-07-02 16:55:35 3 [Warning] Checking table:   './test/t'
      

      or with partitioning:

      CREATE TABLE t (pk INT PRIMARY KEY, v VECTOR(1) NOT NULL) ENGINE=MyISAM PARTITION BY HASH(pk) PARTITIONS 2;
      INSERT INTO t VALUES (1,0x31313131);
      # restart: --myisam-recover-options=FORCE
      SELECT * FROM t;
      pk	v
      1	1111
      Warnings:
      Error	145	Table './test/t#P#p1' is marked as crashed and should be repaired
      Warning	1034	1 client is using or hasn't closed the table properly
      Note	1034	Table is fixed
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      REPAIR TABLE t;
      Table	Op	Msg_type	Msg_text
      test.t	repair	status	OK
      CHECK TABLE t EXTENDED;
      Table	Op	Msg_type	Msg_text
      test.t	check	status	OK
      DROP TABLE t;
      bug.vec1                                 [ fail ]  Found warnings/errors in server log file!
              Test ended at 2025-07-02 17:05:12
      line
      2025-07-02 17:05:12 3 [ERROR] mariadbd: Table './test/t#P#p1' is marked as crashed and should be repaired
      2025-07-02 17:05:12 3 [Warning] Checking table:   './test/t'
      2025-07-02 17:05:12 3 [Warning] Checking table:   './test/t'
      ^ Found warnings in /share8t/bld/11.8-asan-ubsan/mysql-test/var/log/mysqld.1.err
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.