Loading myisam/mi_delete.c +2 −2 Original line number Diff line number Diff line Loading @@ -826,8 +826,8 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag, else get_key_length(rest_length,keypos); if (next_length > prev_length) { /* Key after is based on deleted key */ /* Key after is based on deleted key */ { uint pack_length,tmp; bmove_upp((char*) keypos,(char*) (lastkey+next_length), tmp=(next_length-prev_length)); Loading mysql-test/r/key.result +23 −0 Original line number Diff line number Diff line Loading @@ -267,3 +267,26 @@ select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; t ??!"#???? drop table t1; DROP TABLE IF EXISTS t1; Warnings: Note 1051 Unknown table 't1' CREATE TABLE t1 ( c1 int, c2 varbinary(240), UNIQUE KEY (c1), KEY (c2) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); select c1 from t1 where c2='\Z\Z\Z\Z'; c1 1 3 DELETE FROM t1 WHERE (c1 = 1); select c1 from t1 where c2='\Z\Z\Z\Z'; c1 3 DELETE FROM t1 WHERE (c1 = 3); select c1 from t1 where c2='\Z\Z\Z\Z'; c1 mysql-test/t/key.test +19 −0 Original line number Diff line number Diff line Loading @@ -252,3 +252,22 @@ select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1; select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; drop table t1; # # BUG#6151 - myisam index corruption # DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( c1 int, c2 varbinary(240), UNIQUE KEY (c1), KEY (c2) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 1); select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 3); select c1 from t1 where c2='\Z\Z\Z\Z'; Loading
myisam/mi_delete.c +2 −2 Original line number Diff line number Diff line Loading @@ -826,8 +826,8 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag, else get_key_length(rest_length,keypos); if (next_length > prev_length) { /* Key after is based on deleted key */ /* Key after is based on deleted key */ { uint pack_length,tmp; bmove_upp((char*) keypos,(char*) (lastkey+next_length), tmp=(next_length-prev_length)); Loading
mysql-test/r/key.result +23 −0 Original line number Diff line number Diff line Loading @@ -267,3 +267,26 @@ select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; t ??!"#???? drop table t1; DROP TABLE IF EXISTS t1; Warnings: Note 1051 Unknown table 't1' CREATE TABLE t1 ( c1 int, c2 varbinary(240), UNIQUE KEY (c1), KEY (c2) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); select c1 from t1 where c2='\Z\Z\Z\Z'; c1 1 3 DELETE FROM t1 WHERE (c1 = 1); select c1 from t1 where c2='\Z\Z\Z\Z'; c1 3 DELETE FROM t1 WHERE (c1 = 3); select c1 from t1 where c2='\Z\Z\Z\Z'; c1
mysql-test/t/key.test +19 −0 Original line number Diff line number Diff line Loading @@ -252,3 +252,22 @@ select c from t1 where c=0xD0B1212223D0B1D0B1D0B1D0B1D0B1; select t from t1 where t=0xD0B1D0B1212223D0B1D0B1D0B1D0B1; drop table t1; # # BUG#6151 - myisam index corruption # DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( c1 int, c2 varbinary(240), UNIQUE KEY (c1), KEY (c2) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,'\Z\Z\Z\Z'); INSERT INTO t1 VALUES (2,'\Z\Z\Z\Z\Z\Z'); INSERT INTO t1 VALUES (3,'\Z\Z\Z\Z'); select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 1); select c1 from t1 where c2='\Z\Z\Z\Z'; DELETE FROM t1 WHERE (c1 = 3); select c1 from t1 where c2='\Z\Z\Z\Z';