Loading heap/hp_write.c +0 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record, heap_rb_param custom_arg; uint old_allocated; info->last_pos= NULL; /* For heap_rnext/heap_rprev */ custom_arg.keyseg= keyinfo->seg; custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos); if (keyinfo->flag & HA_NOSAME) Loading mysql-test/r/heap_btree.result +27 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,33 @@ a 1 1 drop table t1; CREATE TABLE t1 ( c1 CHAR(3), c2 INTEGER, KEY USING BTREE(c1), KEY USING BTREE(c2) ) ENGINE= MEMORY; INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; SELECT * FROM t1; c1 c2 ABC 0 A 1 B 0 C 0 DROP TABLE t1; CREATE TABLE t1 ( c1 ENUM('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; CREATE TABLE t1 ( c1 SET('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; End of 4.1 tests CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory; INSERT INTO t1 VALUES(0); Loading mysql-test/t/heap_btree.test +31 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,37 @@ delete from t1 where a >= 2; select a from t1 order by a; drop table t1; # # Bug#26996 - Update of a Field in a Memory Table ends with wrong result # CREATE TABLE t1 ( c1 CHAR(3), c2 INTEGER, KEY USING BTREE(c1), KEY USING BTREE(c2) ) ENGINE= MEMORY; INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; SELECT * FROM t1; DROP TABLE t1; # # Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE # causes incorrect duplicate entries # CREATE TABLE t1 ( c1 ENUM('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; CREATE TABLE t1 ( c1 SET('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; --echo End of 4.1 tests # Loading sql/ha_heap.cc +4 −1 Original line number Diff line number Diff line Loading @@ -604,6 +604,9 @@ int ha_heap::create(const char *name, TABLE *table_arg, seg->length= (uint) key_part->length; seg->flag= key_part->key_part_flag; if (field->flags & (ENUM_FLAG | SET_FLAG)) seg->charset= &my_charset_bin; else seg->charset= field->charset(); if (field->null_ptr) { Loading sql/ha_myisam.cc +16 −0 Original line number Diff line number Diff line Loading @@ -976,6 +976,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize) ha_rows rows= file->state->records; DBUG_ENTER("ha_myisam::repair"); /* Normally this method is entered with a properly opened table. If the repair fails, it can be repeated with more elaborate options. Under special circumstances it can happen that a repair fails so that it closed the data file and cannot re-open it. In this case file->dfile is set to -1. We must not try another repair without an open data file. (Bug #25289) */ if (file->dfile == -1) { sql_print_information("Retrying repair of: '%s' failed. " "Please try REPAIR EXTENDED or myisamchk", table->s->path); DBUG_RETURN(HA_ADMIN_FAILED); } param.db_name= table->s->db; param.table_name= table->alias; param.tmpfile_createflag = O_RDWR | O_TRUNC; Loading Loading
heap/hp_write.c +0 −1 Original line number Diff line number Diff line Loading @@ -105,7 +105,6 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record, heap_rb_param custom_arg; uint old_allocated; info->last_pos= NULL; /* For heap_rnext/heap_rprev */ custom_arg.keyseg= keyinfo->seg; custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos); if (keyinfo->flag & HA_NOSAME) Loading
mysql-test/r/heap_btree.result +27 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,33 @@ a 1 1 drop table t1; CREATE TABLE t1 ( c1 CHAR(3), c2 INTEGER, KEY USING BTREE(c1), KEY USING BTREE(c2) ) ENGINE= MEMORY; INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; SELECT * FROM t1; c1 c2 ABC 0 A 1 B 0 C 0 DROP TABLE t1; CREATE TABLE t1 ( c1 ENUM('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; CREATE TABLE t1 ( c1 SET('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; End of 4.1 tests CREATE TABLE t1(val INT, KEY USING BTREE(val)) ENGINE=memory; INSERT INTO t1 VALUES(0); Loading
mysql-test/t/heap_btree.test +31 −0 Original line number Diff line number Diff line Loading @@ -182,6 +182,37 @@ delete from t1 where a >= 2; select a from t1 order by a; drop table t1; # # Bug#26996 - Update of a Field in a Memory Table ends with wrong result # CREATE TABLE t1 ( c1 CHAR(3), c2 INTEGER, KEY USING BTREE(c1), KEY USING BTREE(c2) ) ENGINE= MEMORY; INSERT INTO t1 VALUES ('ABC',0), ('A',0), ('B',0), ('C',0); UPDATE t1 SET c2= c2 + 1 WHERE c1 = 'A'; SELECT * FROM t1; DROP TABLE t1; # # Bug#24985 - UTF8 ENUM primary key on MEMORY using BTREE # causes incorrect duplicate entries # CREATE TABLE t1 ( c1 ENUM('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; CREATE TABLE t1 ( c1 SET('1', '2'), UNIQUE USING BTREE(c1) ) ENGINE= MEMORY DEFAULT CHARSET= utf8; INSERT INTO t1 VALUES('1'), ('2'); DROP TABLE t1; --echo End of 4.1 tests # Loading
sql/ha_heap.cc +4 −1 Original line number Diff line number Diff line Loading @@ -604,6 +604,9 @@ int ha_heap::create(const char *name, TABLE *table_arg, seg->length= (uint) key_part->length; seg->flag= key_part->key_part_flag; if (field->flags & (ENUM_FLAG | SET_FLAG)) seg->charset= &my_charset_bin; else seg->charset= field->charset(); if (field->null_ptr) { Loading
sql/ha_myisam.cc +16 −0 Original line number Diff line number Diff line Loading @@ -976,6 +976,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool do_optimize) ha_rows rows= file->state->records; DBUG_ENTER("ha_myisam::repair"); /* Normally this method is entered with a properly opened table. If the repair fails, it can be repeated with more elaborate options. Under special circumstances it can happen that a repair fails so that it closed the data file and cannot re-open it. In this case file->dfile is set to -1. We must not try another repair without an open data file. (Bug #25289) */ if (file->dfile == -1) { sql_print_information("Retrying repair of: '%s' failed. " "Please try REPAIR EXTENDED or myisamchk", table->s->path); DBUG_RETURN(HA_ADMIN_FAILED); } param.db_name= table->s->db; param.table_name= table->alias; param.tmpfile_createflag = O_RDWR | O_TRUNC; Loading