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

Cannot repair myisam table with mysqlcheck option --use-frm

    XMLWordPrintable

    Details

      Description

      With mysqlcheck -r --use-frm database table it should be possible to repair a myisam table even if the MYI file is corrupted.

      CREATE  TABLE IF NOT EXISTS `testdb`.`t1` (
        `Idx` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT ,
        PRIMARY KEY (`Idx`))
      ENGINE = MYISAM
      DEFAULT CHARACTER SET = latin1
      COLLATE = latin1_german1_ci
      COMMENT = 'test table';
      

      mysqlcheck -ce testdb t1
      testdb.t1                                   OK
       
      rm t1.MYI
      mysqlcheck -ce testdb t1
      Failed to SHOW CREATE TABLE `t1`
      Error: Can't find file: './testdb/t1.MYI' (errno: 2 "No such file or directory")
       
      mysqlcheck -r --use-frm testdb t1
      Failed to SHOW CREATE TABLE `t1`
      Error: Can't find file: './testdb/t1.MYI' (errno: 2 "No such file or directory")
      

      mysql --database=testdb  --execute="REPAIR TABLE t1 USE_FRM"
      +------------------+--------+----------+------------------------------------+
      | Table            | Op     | Msg_type | Msg_text                           |
      +------------------+--------+----------+------------------------------------+
      | testdb.t1 | repair | warning  | Number of rows changed from 0 to 6 |
      | testdb.t1 | repair | status   | OK                                 |
      +------------------+--------+----------+------------------------------------+
      

      mysqlcheck -ce testdb t1
      testdb.t1   
      

        Attachments

          Activity

            People

            Assignee:
            serg Sergei Golubchik
            Reporter:
            christian.stern Christian Stern
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration