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

Mariabackup does not work with MyISAM tables with vector keys

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      create or replace table t (a int, v vector(1) not null, vector(v)) engine=MyISAM;
      insert into t values (1,0x31313131),(2,0x32323232);
      --echo # Running backup
      --exec $XTRABACKUP --backup --target-dir=$MYSQL_TMP_DIR/mbackup_backup --socket=$MASTER_MYSOCK --user=root > $MYSQL_TMP_DIR/mbackup.log 2>&1
      --echo # Running prepare
      --exec $XTRABACKUP --prepare --target-dir=$MYSQL_TMP_DIR/mbackup_backup > $MYSQL_TMP_DIR/mprepare.log 2>&1
      --echo # Running restore
      --exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$MYSQL_TMP_DIR/mbackup_restore --target-dir=$MYSQL_TMP_DIR/mbackup_backup > $MYSQL_TMP_DIR/mrestore.log 2>&1
      --echo # Restarting on the restored datadir
       
      --let $restart_parameters= --datadir=$MYSQL_TMP_DIR/mbackup_restore
      --list_files $MYSQL_TMP_DIR/mbackup_restore/test/
      --source include/restart_mysqld.inc
       
      select * from t order by vec_distance_euclidean(v,0x30303030) limit 1;
      check table t extended;
      repair table t;
       
      # Cleanup
      drop table t;
      

      Prepare complains about "Invalid (old?) table or database name":

      b28e2f261e5b0ab7d128ce521dbeaef4515cbf6a

      $ grep -A 2 -B 2 ERROR var/tmp/mbackup.log 
      [00] 2024-10-25 18:11:50 Collect log table file: ./mysql/slow_log.CSM
      [00] 2024-10-25 18:11:50 Collect log table file: ./mysql/slow_log.CSV
      2024-10-25 18:11:50 0 [ERROR] Invalid (old?) table or database name 't#i#00'
      2024-10-25 18:11:50 0 [ERROR] Invalid (old?) table or database name 't#i#00'
      [00] 2024-10-25 18:11:50 Stop scanning common engine tables
      [00] 2024-10-25 18:11:50 Start copying aria log file tail: /mnt8t/bld/preview-11.7-bb-11.6-MDEV-32887-vector-rel/mysql-test/var/mysqld.1/data//aria_log.00000001
      --
      [00] 2024-10-25 18:11:50 aria table file ./mysql/help_topic.MAD is copied successfully.
      [00] 2024-10-25 18:11:50 Start scanning common engine tables, need backup locks: 1, collect log and stat tables: 0
      2024-10-25 18:11:50 0 [ERROR] Invalid (old?) table or database name 't#i#00'
      [00] 2024-10-25 18:11:50 Skip table test.#mysql50#t#i#00 at it is in exclude list
      2024-10-25 18:11:50 0 [ERROR] Invalid (old?) table or database name 't#i#00'
      [00] 2024-10-25 18:11:50 Skip table test.#mysql50#t#i#00 at it is in exclude list
      [00] 2024-10-25 18:11:50 Skip table test.t at it is in exclude list
      

      There is indeed no vector files in the directory after backup.
      Prepare and restore don't complain about anything.
      The table doesn't work after restore. SELECT using the vector key and CHECK table fail, REPAIR hangs.

      # Restarting on the restored datadir
      db.opt
      t.MYD
      t.MYI
      t.frm
      # restart: --datadir=MYSQLTEST_VARDIR/tmp/mbackup_restore
      select * from t order by vec_distance_euclidean(v,0x30303030) limit 1;
      mysqltest: At line 17: query 'select * from t order by vec_distance_euclidean(v,0x30303030) limit 1' failed: ER_FILE_NOT_FOUND (1017): Can't find file: './test/t#i#00.MYI' (errno: 2 "No such file or directory")
      check table t extended;
      Table	Op	Msg_type	Msg_text
      test.t	check	Error	Can't find file: './test/t#i#00.MYI' (errno: 2 "No such file or directory")
      test.t	check	status	Operation failed
      repair table t;
      

      A fix for MDEV-35223 is already in the tree.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              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.