Debian Codegraph @

mysql-test/suite/atomic/drop_db_long_names.test

raw
1 --source include/have_debug.inc
2 --source include/have_log_bin.inc
3 --source include/not_valgrind.inc
4
5 # Speed up wait_until_connected_again.inc
6 let NO_WSREP=1;
7 RESET MASTER;
8
9 #
10 # Testing of atomic DROP DATABASE when the generated query could be too long
11 #
12
13 let $engine_count=1;
14 let $engines='aria';
15
16 let $crash_count=2;
17 let $crash_points='ddl_log_drop_after_drop_tables','ddl_log_drop_before_binlog';
18
19 let $max_tables=30;
20
21 let $old_debug=`select @@debug_dbug`;
22
23 let $keep_include_silent=1;
24 let $grep_script=DROP;
25 --disable_query_log
26
27 let $e=0;
28 while ($e < $engine_count)
29 {
30 inc $e;
31 let $engine=`select ELT($e, $engines)`;
32 let $default_engine=$engine;
33 let $extra_option=;
34
35 if ($engine == "aria")
36 {
37 let $extra_option=transactional=1;
38 }
39 if ($engine == "aria_notrans")
40 {
41 let $default_engine="aria";
42 let $extra_option=transactional=0;
43 }
44
45 let $c=0;
46 while ($c < $crash_count)
47 {
48 inc $c;
49 let $crash=`select ELT($c, $crash_points)`;
50 let $r=0;
51 while ($r < 1)
52 {
53 inc $r;
54 create database test2;
55 use test2;
56 --eval set @@default_storage_engine=$default_engine
57 let $t=0;
58 while ($t < $max_tables)
59 {
60 inc $t;
61 let $name=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),60))`;
62 let $view=`select concat("t",char(floor(65+$t/26)),repeat(char(65+mod($t,26)),30),'v')`;
63 --eval create table $name (a int not null) $extra_option
64 --eval create view $view as select * from $name
65 }
66
67 flush tables;
68 use test;
69
70 FLUSH BINARY LOGS;
71 --let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
72
73 echo "engine: $engine crash point: $crash position: $r";
74 --exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
75 --disable_reconnect
76 --eval set @@debug_dbug="+d,$crash",@debug_crash_counter=$r
77 let $errno=0;
78 --error 0,2013
79 DROP DATABASE test2;
80 let $error=$errno;
81 --enable_reconnect
82 --source include/wait_until_connected_again.inc
83 --disable_query_log
84 --eval set @@debug_dbug="$old_debug"
85
86 if ($error == 0)
87 {
88 echo "No crash!";
89 }
90 use test;
91 # Check which tables still exists
92 --error 0,1
93 --list_files $MYSQLD_DATADIR/test2 t*
94 --error 0,ER_SP_DOES_NOT_EXIST
95
96 --let $binlog_file=$start_binlog_file
97 --let $binlog_output_name=master-bin.000001
98 if ($error)
99 {
100 --let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1)
101 --let $binlog_output_name=master-bin.000002
102 if ($binlog_file != $start_binlog_file)
103 {
104 --source include/show_binlog_events.inc
105 }
106 }
107 # Really drop the tables. The warnings will show what was dropped
108 --disable_warnings
109 --error 0, ER_DB_DROP_EXISTS
110 DROP DATABASE test2;
111 --enable_warnings
112 }
113 }
114 }
115 drop database if exists test2;
116
117 --enable_query_log