Debian Codegraph @

mysql-test/suite/maria/maria_notembedded.test

raw
1 # Tests which cannot be run in embedded server.
2
3 -- source include/not_embedded.inc
4 -- source include/have_maria.inc
5
6 call mtr.add_suppression("Deadlock found when trying to get lock; try restarting transaction");
7
8 let $default_engine=`select @@session.default_storage_engine`;
9 set session default_storage_engine=aria;
10
11 # Verify that INSERT DELAYED is disabled only for transactional tables
12 # ("embedded" server translates them to plain INSERT)
13
14 create table t1 (a int) row_format=page;
15 --error ER_DELAYED_NOT_SUPPORTED
16 insert delayed into t1 values(1);
17 drop table t1;
18 create table t1 (a int) row_format=page transactional=0;
19 insert delayed into t1 values(1);
20 flush table t1;
21 select * from t1;
22 select count(*) from t1;
23 drop table t1;
24 create table t1 (a int) row_format=dynamic;
25 insert delayed into t1 values(1);
26 flush table t1;
27 select * from t1;
28 select count(*) from t1;
29 drop table t1;
30
31 # This cannot be run in embedded server, see BUG#40661, because
32 # mysqltest runs "send" commands in separate OS thread.
33 #
34 # an example of a deadlock
35 #
36 create table t1 (a int unique) transactional=1;
37 insert t1 values (1);
38
39 lock table t1 write concurrent;
40 insert t1 values (2);
41
42 connect(con_a,localhost,root,,);
43 lock table t1 write concurrent;
44 insert t1 values (3);
45 send insert t1 values (2);
46
47 connect(con_b,localhost,root,,);
48 lock table t1 write concurrent;
49 insert t1 values (4);
50 send insert t1 values (3);
51
52 connect(con_c,localhost,root,,);
53 lock table t1 write concurrent;
54 insert t1 values (5);
55 send insert t1 values (4);
56
57 connect(con_d,localhost,root,,);
58 lock table t1 write concurrent;
59 insert t1 values (6);
60 send insert t1 values (5);
61
62 connection default;
63 let $wait_condition=select count(*) = 4 from information_schema.processlist where state="waiting for a resource";
64 --source include/wait_condition.inc
65 --error ER_LOCK_DEADLOCK
66 insert t1 values (6);
67 unlock tables;
68
69 connection con_a;
70 --error ER_DUP_ENTRY
71 reap;
72 unlock tables;
73 disconnect con_a;
74
75 connection con_b;
76 --error ER_DUP_ENTRY
77 reap;
78 unlock tables;
79 disconnect con_b;
80
81 connection con_c;
82 --error ER_DUP_ENTRY
83 reap;
84 unlock tables;
85 disconnect con_c;
86
87 connection con_d;
88 --error ER_DUP_ENTRY
89 reap;
90 unlock tables;
91 disconnect con_d;
92
93 connection default;
94 check table t1;
95 drop table t1;
96
97 --disable_result_log
98 --disable_query_log
99 eval set session default_storage_engine=$default_engine;
100 --enable_result_log
101 --enable_query_log