From e92ce5d56c66a96be64d3e64fea84bf66dae0b73 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 27 Jul 2007 14:30:25 +0500 Subject: 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. --- mysql-test/r/alter_table.result | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mysql-test/r/alter_table.result') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 4eace9ac628..f24a1788404 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -903,3 +903,15 @@ f1 f2 f21 f4 f41 1 2000-01-01 00:00:00 2000-01-01 2002-02-02 00:00:00 2002-02-02 drop table t1; set sql_mode= @orig_sql_mode; +create table t1 (c char(10) default "Two"); +lock table t1 write; +insert into t1 values (); +alter table t1 modify c char(10) default "Three"; +unlock tables; +select * from t1; +c +Two +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +drop table t1; -- cgit v1.2.1