Commit 9d1bfec2 authored by svoj@mysql.com/june.mysql.com's avatar svoj@mysql.com/june.mysql.com
Browse files

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.
parent 574079a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,
+12 −0
Original line number Diff line number Diff line
@@ -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;
+12 −0
Original line number Diff line number Diff line
@@ -684,3 +684,15 @@ alter table t1 add column f4 datetime not null default '2002-02-02',
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;