Debian Codegraph @

mysql-test/suite/clone/include/clone_exec_ddl.inc

raw
1 ## Execute / SHOW DDL statement
2 ## 1. ddl_op : DDL operation - CREATE TABLE, DROP TABLE, ALTER TABLE ...
3 ## 2. table_num : Table number - 1,2,3 ... [t1, t2 ...]
4 ## 3. ddl_stmt : DDL statement text following table name
5 ## 4. ddl_post : Any other follow up clause like partition
6 ## 5. ddl_table_rename : If DDL is renaming one table to another
7 ## 6. ddl_table_extn_from : Old table name extension - _old [t1_old, t2_old ...]
8 ## 7. ddl_table_extn : Second table name extension - _new [t1_new, t2_new ...]
9 ## 8. ddl_table_extn_show : Table name extension at test end - _new [t1_new, t2_new ...]
10 ## 9. ddl_count : Number of DDLs to execute
11
12 if (!$ddl_count) {
13 --let $ddl_count = 1
14 }
15
16 --let $ddl_num = 1
17
18 if ($ddl_exec) {
19
20 while ($ddl_num <= $ddl_count) {
21
22 --let $cur_ddl_op = \$ddl_op$ddl_num$after_dml
23 --let $cur_ddl_stmt = \$ddl_stmt$ddl_num$after_dml
24 --let $cur_ddl_post = \$ddl_post$ddl_num$after_dml
25
26 --let $cur_ddl_table_rename = \$ddl_table_rename$ddl_num$after_dml
27 --let $cur_ddl_table_extn = \$ddl_table_extn$ddl_num$after_dml
28 --let $cur_ddl_table_extn_from = \$ddl_table_extn_from$ddl_num$after_dml
29
30 if (!$ddl_undo) {
31
32 if (!$cur_ddl_table_rename) {
33
34 if ($ddl_redo_encrypt) {
35 --eval $cur_ddl_op
36 }
37
38 if (!$ddl_redo_encrypt) {
39 --eval $cur_ddl_op t$table_num $cur_ddl_stmt $cur_ddl_post
40 }
41 }
42
43 if ($cur_ddl_table_rename) {
44 --eval $cur_ddl_op t$table_num$cur_ddl_table_extn_from $cur_ddl_stmt t$table_num$cur_ddl_table_extn
45 }
46 }
47
48 if ($ddl_undo) {
49
50 --let $cur_ddl_post =
51
52 if ($ddl_undo_create) {
53 --let $cur_ddl_post = 'undo_0$table_num.ibu'
54 }
55
56 --eval $cur_ddl_op undo_0$table_num $cur_ddl_stmt $cur_ddl_post
57
58 if ($ddl_undo_empty) {
59 --let $inactive_undo_space = undo_0$table_num
60 --source include/wait_until_undo_space_is_empty.inc
61 }
62 }
63 --inc $ddl_num
64 }
65 }
66
67 if ($ddl_show) {
68 --eval SHOW CREATE TABLE t$table_num$ddl_table_extn_show
69 --eval CHECK TABLE t$table_num$ddl_table_extn_show EXTENDED
70 --eval SELECT count(*) from t$table_num$ddl_table_extn_show
71 --eval SELECT col1, col2, col3 FROM t$table_num$ddl_table_extn_show ORDER BY col1 LIMIT 10;
72 --eval SELECT col1, col2, col3 FROM t$table_num$ddl_table_extn_show ORDER BY col1 DESC LIMIT 10;
73
74 if ($ddl_undo) {
75
76 SELECT NAME, SPACE_TYPE, STATE
77 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES
78 WHERE SPACE_TYPE = 'Undo'
79 ORDER BY NAME;
80
81 SELECT TABLESPACE_NAME, FILE_NAME, FILE_TYPE, ENGINE
82 FROM INFORMATION_SCHEMA.FILES
83 WHERE FILE_NAME LIKE '%undo_0%'
84 ORDER BY TABLESPACE_NAME;
85 }
86 }