diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-11-03 21:17:17 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-11-04 08:12:28 +0100 |
commit | af9649c722810eb1754953eb406a84ec876ce693 (patch) | |
tree | 20089193150bac2119ca6a0a8a31c7e92321241f /mysql-test | |
parent | 8a346f31b913daa011085afec2b2d38450c73e00 (diff) | |
download | mariadb-git-af9649c722810eb1754953eb406a84ec876ce693.tar.gz |
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[].
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/vcol/r/races.result | 16 | ||||
-rw-r--r-- | mysql-test/suite/vcol/t/races.test | 22 |
2 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/races.result b/mysql-test/suite/vcol/r/races.result new file mode 100644 index 00000000000..c46ed5ba2ef --- /dev/null +++ b/mysql-test/suite/vcol/r/races.result @@ -0,0 +1,16 @@ +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'; +delete from t1; +connection default; +select * from t1; +f vf +foo foo +set debug_sync='now SIGNAL go'; +connection con1; +disconnect con1; +connection default; +drop table t1; +set debug_sync='reset'; diff --git a/mysql-test/suite/vcol/t/races.test b/mysql-test/suite/vcol/t/races.test new file mode 100644 index 00000000000..1bf4e43dec9 --- /dev/null +++ b/mysql-test/suite/vcol/t/races.test @@ -0,0 +1,22 @@ +# +# 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'; |