mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
BUG#29957 - alter_table.test fails
INSERT/DELETE/UPDATE followed by ALTER TABLE within LOCK TABLES may cause table corruption on Windows. That happens because ALTER TABLE writes outdated shared state info into index file. Fixed by removing obsolete workaround. Affects MyISAM tables on Windows only. myisam/mi_extra.c: On windows when mi_extra(HA_EXTRA_PREPARE_FOR_DELETE) is called, we release external lock and close index file. If we're in LOCK TABLES, MyISAM state info doesn't get updated until UNLOCK TABLES. That means when we release external lock and we're in LOCK TABLES, we may write outdated state info. As SQL layer closes all table instances, we do not need this workaround anymore. mysql-test/r/alter_table.result: A test case for BUG#29957. mysql-test/t/alter_table.test: A test case for BUG#29957.
This commit is contained in:
parent
d1210318db
commit
e92ce5d56c
3 changed files with 25 additions and 1 deletions
|
|
@ -278,7 +278,7 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
|
|||
case HA_EXTRA_PREPARE_FOR_DELETE:
|
||||
pthread_mutex_lock(&THR_LOCK_myisam);
|
||||
share->last_version= 0L; /* Impossible version */
|
||||
#ifdef __WIN__
|
||||
#ifdef __WIN__REMOVE_OBSOLETE_WORKAROUND
|
||||
/* Close the isam and data files as Win32 can't drop an open table */
|
||||
pthread_mutex_lock(&share->intern_lock);
|
||||
if (flush_key_blocks(share->key_cache, share->kfile,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue