| 1 |
--source include/have_debug.inc |
| 2 |
--source include/have_sequence.inc |
| 3 |
--source include/have_log_bin.inc |
| 4 |
--source include/not_valgrind.inc |
| 5 |
|
| 6 |
# |
| 7 |
# Testing of atomic create view with crashes in a lot of different places |
| 8 |
|
| 9 |
--disable_query_log |
| 10 |
call mtr.add_suppression("InnoDB: .* does not exist in the InnoDB internal"); |
| 11 |
# Speed up wait_until_connected_again.inc |
| 12 |
let NO_WSREP=1; |
| 13 |
RESET MASTER; |
| 14 |
--enable_query_log |
| 15 |
let $MYSQLD_DATADIR= `SELECT @@datadir`; |
| 16 |
|
| 17 |
let $crash_count=6; |
| 18 |
let $crash_points='ddl_log_create_before_copy_view', 'ddl_log_create_before_create_view', 'definition_file_after_create','ddl_log_create_after_create_view', 'ddl_log_create_before_binlog', 'ddl_log_create_after_binlog'; |
| 19 |
|
| 20 |
let $statement_count=3; |
| 21 |
let $statements='CREATE VIEW t1 as select "new"', |
| 22 |
'CREATE OR REPLACE VIEW t1 as select "new"', |
| 23 |
'CREATE OR REPLACE VIEW t2 as select "new"'; |
| 24 |
|
| 25 |
let $old_debug=`select @@debug_dbug`; |
| 26 |
|
| 27 |
let $e=0; |
| 28 |
let $keep_include_silent=1; |
| 29 |
let $grep_script=CREATE|DROP; |
| 30 |
--disable_query_log |
| 31 |
|
| 32 |
while ($e < 1) |
| 33 |
{ |
| 34 |
inc $e; |
| 35 |
|
| 36 |
let $r=0; |
| 37 |
while ($r < $statement_count) |
| 38 |
{ |
| 39 |
inc $r; |
| 40 |
|
| 41 |
let $statement=`select ELT($r, $statements)`; |
| 42 |
--echo query: $statement |
| 43 |
|
| 44 |
let $c=0; |
| 45 |
while ($c < $crash_count) |
| 46 |
{ |
| 47 |
inc $c; |
| 48 |
let $crash=`select ELT($c, $crash_points)`; |
| 49 |
|
| 50 |
create view t2 as select "old"; |
| 51 |
|
| 52 |
FLUSH BINARY LOGS; |
| 53 |
--let $start_binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) |
| 54 |
|
| 55 |
--echo crash point: $crash |
| 56 |
--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 57 |
--disable_reconnect |
| 58 |
--eval set @@debug_dbug="+d,$crash",@debug_crash_counter=1 |
| 59 |
let $errno=0; |
| 60 |
--error 0,2013 |
| 61 |
--eval $statement; |
| 62 |
let $error=$errno; |
| 63 |
--enable_reconnect |
| 64 |
--source include/wait_until_connected_again.inc |
| 65 |
--disable_query_log |
| 66 |
--eval set @@debug_dbug="$old_debug" |
| 67 |
|
| 68 |
if ($error == 0) |
| 69 |
{ |
| 70 |
echo "No crash!"; |
| 71 |
} |
| 72 |
# Check which tables still exists |
| 73 |
--list_files $MYSQLD_DATADIR/test t* |
| 74 |
--list_files $MYSQLD_DATADIR/test *sql* |
| 75 |
select * from t2; |
| 76 |
|
| 77 |
--let $binlog_file=$start_binlog_file |
| 78 |
--let $binlog_output_name=master-bin.000001 |
| 79 |
--source include/show_binlog_events.inc |
| 80 |
if ($error) |
| 81 |
{ |
| 82 |
--let $binlog_file= query_get_value(SHOW MASTER STATUS, File, 1) |
| 83 |
--let $binlog_output_name=master-bin.00c0002 |
| 84 |
if ($binlog_file != $start_binlog_file) |
| 85 |
{ |
| 86 |
--source include/show_binlog_events.inc |
| 87 |
} |
| 88 |
} |
| 89 |
# Drop the tables. The warnings will show what was dropped |
| 90 |
--disable_warnings |
| 91 |
drop view if exists t1,t2; |
| 92 |
--enable_warnings |
| 93 |
} |
| 94 |
} |
| 95 |
} |
| 96 |
drop view if exists t1,t2; |
| 97 |
|
| 98 |
--enable_query_log |