MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Sergey Vojtovich Date:July 27 2007 9:30am
Subject:bk commit into 5.0 tree (svoj:1.2531) BUG#29957
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of svoj. When svoj does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-07-27 14:30:25+05:00, svoj@stripped +3 -0
  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@stripped, 2007-07-27 14:30:24+05:00, svoj@stripped +1 -1
    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@stripped, 2007-07-27 14:30:24+05:00, svoj@stripped +12 -0
    A test case for BUG#29957.

  mysql-test/t/alter_table.test@stripped, 2007-07-27 14:30:24+05:00, svoj@stripped +12 -0
    A test case for BUG#29957.

diff -Nrup a/myisam/mi_extra.c b/myisam/mi_extra.c
--- a/myisam/mi_extra.c	2006-12-31 00:02:04 +04:00
+++ b/myisam/mi_extra.c	2007-07-27 14:30:24 +05:00
@@ -278,7 +278,7 @@ int mi_extra(MI_INFO *info, enum ha_extr
   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,
diff -Nrup a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
--- a/mysql-test/r/alter_table.result	2007-05-22 01:20:29 +05:00
+++ b/mysql-test/r/alter_table.result	2007-07-27 14:30:24 +05:00
@@ -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;
diff -Nrup a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
--- a/mysql-test/t/alter_table.test	2007-05-22 01:18:34 +05:00
+++ b/mysql-test/t/alter_table.test	2007-07-27 14:30:24 +05:00
@@ -684,3 +684,15 @@ alter table t1 add column f4 datetime no
 select * from t1;
 drop table t1;
 set sql_mode= @orig_sql_mode;
+
+#
+# BUG#29957 - alter_table.test fails
+#
+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;
+check table t1;
+drop table t1;
Thread
bk commit into 5.0 tree (svoj:1.2531) BUG#29957Sergey Vojtovich27 Jul
  • Re: bk commit into 5.0 tree (svoj:1.2531) BUG#29957Ingo Strüwing27 Jul