Debian Codegraph @

mysql-test/suite/binlog/include/binlog_reset_master_to_option.inc

raw
1 # Inc file to be used with binlog_reset_master_to_option.test
2 # This tests if a particular binary file is present or not
3
4 --let $fname_prefix= `select @@log_bin_basename`
5 # set the extension expected
6 --let $expected_filename= $fname_prefix.$binlog_number
7 # assert that the file exists
8 file_exists $expected_filename;
9
10 # assert that file names in the file system and in SHOW BINARY LOGS
11 # are the same
12 --let $show_filename= query_get_value("SHOW BINARY LOGS", Log_name, 1)
13 --let $show_filename= `select concat("$MYSQLD_DATADIR","$show_filename")`
14
15 --let $assert_text= Assert that filename is same in both file system and show binary logs
16 --let $assert_cond= STRCMP("$expected_filename", "$show_filename") = 0
17 --source include/assert.inc
18
19 --let $assert_text= Assert that file is created and opened
20 --let $assert_cond= `SELECT OPEN_COUNT FROM performance_schema.file_instances WHERE FILE_NAME LIKE '%$binlog_number%' = 1`
21 --source include/assert.inc
22
23 if (`SELECT COUNT(*) = 1 FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'GTID_MODE' AND VARIABLE_VALUE = 'ON'`)
24 {
25 # Check that GTID_EXECUTED and GTID_PURGED is reset to empty.
26 --let $wait_condition = SELECT VARIABLE_VALUE = "" FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'gtid_purged'
27 --source include/wait_condition.inc
28 --let $wait_condition = SELECT VARIABLE_VALUE = "" FROM performance_schema.global_variables WHERE VARIABLE_NAME = 'gtid_executed'
29 --source include/wait_condition.inc
30 }