• unknown's avatar
    Fix for · ddac4525
    unknown authored
    ./mtr --mysqld=--default-storage-engine=maria --mem ps:
    I got "can't sync on file UNOPENED" among the messages of REPAIR TABLE;
    due to a missing setting of bitmap.file.file to -1.
    Maria had two names "Maria" and "MARIA", using one now: "MARIA".
    
    
    storage/maria/ha_maria.cc:
      plug.in uses "MARIA". Some code apparently picks the name from
      plug.in (SHOW CREATE TABLE, run ps.test on Maria tables), other from
      mysql_declare_plugin (SHOW CREATE TABLE on partitioned tables, run
      partition.test with Maria tables), better make names identical.
    storage/maria/ma_check.c:
      running ps.test on Maria tables I got "can't sync on file UNOPENED"
      among the messages of REPAIR TABLE. That was due to maria_repair()
      closing the data file, setting info->dfile.file to -1 to prevent
      a wrong double close, but forgetting to also set
      info->s->bitmap.file.file to -1; it left it unchanged and so,
      when close_thread_tables() closed the old version of the repaired
      table, _ma_once_end_block_record() tried to fsync the closed
      descriptor, resulting in a message.
      Basically, when setting info->dfile.file to something it's always
      safe and recommended to set bitmap.file.file to the same value
      as it's just a copy of the same descriptor see _ma_bitmap_init().
      Using change_data_file_descriptor() for that.
      Changing that function to use MY_WME as it looks safe.
    storage/maria/ma_close.c:
      no need to make the index file durable if table is not transactional
    ddac4525
ma_check.c 183 KB