mariadb/mysql-test/suite/vcol/t/races.test
Sergei Golubchik af9649c722 MDEV-17349 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on concurrent SELECT and DELETE after RENAME from table with index on virtual column
Race condition. field->flags were copied from s->field->flags during
field->clone(), early in open_table_from_share(). But s->field->flags
were getting their PART_INDIRECT_KEY_FLAG bit much later in
TABLE::mark_columns_used_by_virtual_fields() and only once per share.

If two threads were executing the code between field->clone()
and mark_columns_used_by_virtual_fields() at the same time, only
one would get PART_INDIRECT_KEY_FLAG bits in field[].
2018-11-04 08:12:28 +01:00

22 lines
793 B
Text

#
# MDEV-17349 Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed on concurrent SELECT and DELETE after RENAME from table with index on virtual column
#
source include/have_innodb.inc;
source include/have_debug_sync.inc;
create table t1 (f text, vf tinytext as (f), key (vf(64))) engine=innodb;
insert t1 (f) values ('foo');
flush tables;
connect con1,localhost,root,,test;
set debug_sync='TABLE_after_field_clone WAIT_FOR go';
send delete from t1;
connection default;
let $wait_condition= select state like 'debug sync point%' from information_schema.processlist;
source include/wait_condition.inc;
select * from t1;
set debug_sync='now SIGNAL go';
connection con1;
reap;
disconnect con1;
connection default;
drop table t1;
set debug_sync='reset';