Debian Codegraph @

mysql-test/suite/vcol/t/races.test

raw
1 #
2 # 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
3 #
4 source include/have_innodb.inc;
5 source include/have_debug_sync.inc;
6 create table t1 (f text, vf tinytext as (f), key (vf(64))) engine=innodb;
7 insert t1 (f) values ('foo');
8 flush tables;
9 connect con1,localhost,root,,test;
10 set debug_sync='TABLE_after_field_clone WAIT_FOR go';
11 send delete from t1;
12 connection default;
13 let $wait_condition= select state like 'debug sync point%' from information_schema.processlist;
14 source include/wait_condition.inc;
15 select * from t1;
16 set debug_sync='now SIGNAL go';
17 connection con1;
18 reap;
19 disconnect con1;
20 connection default;
21 drop table t1;
22 set debug_sync='reset';
23
24 --echo #
25 --echo # MDEV-39261 MariaDB crash on startup in presence of
26 --echo # indexed virtual columns
27 --echo #
28 # To make purge thread to work on multiple tables on the same batch,
29 # we need 33 tables because there are 32 pre-existing purge_node exists.
30
31 --echo # Create 33 tables with virtual index
32 --disable_query_log
33 let $i = 33;
34 while ($i)
35 {
36 eval CREATE TABLE t$i(
37 a INT PRIMARY KEY,
38 b INT DEFAULT 1, INDEX(b),
39 c INT GENERATED ALWAYS AS (a + b) VIRTUAL,
40 INDEX(c)
41 ) ENGINE=InnoDB;
42 eval INSERT INTO t$i(a) VALUES(1);
43 dec $i;
44 }
45 --enable_query_log
46 --source ../../innodb/include/wait_all_purged.inc
47 --connect purge_control,localhost,root
48 START TRANSACTION WITH CONSISTENT SNAPSHOT;
49
50 --connection default
51 --echo # Do update on all 33 tables
52 --disable_query_log
53 let $i = 33;
54 while ($i)
55 {
56 eval UPDATE t$i SET b = 11 WHERE a = 1;
57 dec $i;
58 }
59 --enable_query_log
60
61 let $shutdown_timeout=0;
62 let $restart_parameters=--innodb_purge_threads=1 --debug_dbug=d,ib_purge_virtual_index_callback;
63 --source include/restart_mysqld.inc
64 --source ../../innodb/include/wait_all_purged.inc
65
66 --echo # Drop all 33 tables
67 --disable_query_log
68 let $i = 33;
69 while ($i)
70 {
71 eval DROP TABLE t$i;
72 dec $i;
73 }
74 --enable_query_log
75
76 let $restart_parameters=;
77 let $shutdown_timeout=;
78 --source include/restart_mysqld.inc