Browse Source
MDEV-17070 Table corruption or Assertion `table->file->stats.records > 0 || error' or Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon actions on temporary table
MDEV-17070 Table corruption or Assertion `table->file->stats.records > 0 || error' or Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon actions on temporary table
This was caused by a combination of factors: * MyISAM/Aria temporary tables historically never saved the state to disk (MYI/MAI), because the state never needed to persist * certain ALTER TABLE operations modify the original TABLE structure and if they fail, the original table has to be reopened to revert all changes (m_needs_reopen=1) as a result, when ALTER fails and MyISAM/Aria temp table gets reopened, it reads the stale state from the disk. As a fix, MyISAM/Aria tables now *always* write the state to disk on close, *unless* HA_EXTRA_PREPARE_FOR_DROP was done first. And the server now always does HA_EXTRA_PREPARE_FOR_DROP before dropping a temporary table.pull/895/head
9 changed files with 117 additions and 33 deletions
-
53mysql-test/r/reopen_temp_table.result
-
40mysql-test/t/reopen_temp_table.test
-
11sql/temporary_tables.cc
-
4storage/maria/ma_blockrec.c
-
17storage/maria/ma_close.c
-
2storage/maria/ma_extra.c
-
2storage/maria/ma_open.c
-
17storage/myisam/mi_close.c
-
4storage/myisam/mi_extra.c
Write
Preview
Loading…
Cancel
Save
Reference in new issue