Debian Codegraph @

mysql-test/suite/rpl/t/rpl_master_pos_wait.test

raw
1 # See if master_pos_wait(,,timeout)
2 # Terminates with "timeout expired" (-1)
3 source include/master-slave.inc;
4 sync_slave_with_master;
5 # Ask for a master log that has certainly not been reached yet
6 # timeout= 2 seconds
7 select master_pos_wait('master-bin.999999',0,2);
8 explain extended select master_pos_wait('master-bin.999999',0,2);
9 # Testcase for bug 651 (master_pos_wait() hangs if slave idle and STOP SLAVE).
10 send select master_pos_wait('master-bin.999999',0);
11 connection slave1;
12 stop slave sql_thread;
13 --source include/wait_for_slave_sql_to_stop.inc
14 connection slave;
15 reap;
16
17 #
18 # bug#26622 MASTER_POS_WAIT does not work as documented
19 #
20
21 connection master;
22 echo "*** must be empty ***";
23 query_vertical show slave status;
24
25 echo "*** must be NULL ***";
26 select master_pos_wait('foo', 98);
27
28 # End of 4.1 tests
29
30
31 --echo *** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout ***
32
33 --connection slave
34 --source include/stop_slave.inc
35 reset slave all;
36 --replace_result $MASTER_MYPORT MASTER_MYPORT
37 eval change master 'my_slave' to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root', master_ssl_verify_server_cert=0;
38 set default_master_connection = 'my_slave';
39 --source include/start_slave.inc
40
41 --echo # Call without connection name -- works (expected -1)
42 select master_pos_wait('master-bin.000001',1000000,1);
43
44 set default_master_connection = '';
45
46 --echo # Call for non-existing anonymous connection -- works (expected NULL)
47 select master_pos_wait('master-bin.000001',1000000,1);
48
49 --echo # Call with a valid connection name -- hangs before MDEV-7130 fix (expected -1)
50 select master_pos_wait('master-bin.000001',1000000,1,"my_slave");
51 select master_pos_wait('master-bin.000001',1000000,1,"MY_SLAVE");
52
53 STOP SLAVE 'my_slave';
54 RESET SLAVE 'my_slave' ALL;
55
56 --replace_result $MASTER_MYPORT MASTER_MYPORT
57 eval change master to master_port=$MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
58
59 # End of 10.0 tests
60
61 --echo #
62 --echo # Start of 10.3 tests
63 --echo #
64
65 --echo #
66 --echo # MDEV-13965 Parameter data type control for Item_longlong_func
67 --echo #
68
69 --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
70 SELECT MASTER_POS_WAIT('x',1,ROW(1,1));
71 --error ER_ILLEGAL_PARAMETER_DATA_TYPE_FOR_OPERATION
72 SELECT MASTER_POS_WAIT('x',1,1,ROW(1,1));
73
74 --echo #
75 --echo # End of 10.3 tests
76 --echo #
77
78
79 --let $rpl_only_running_threads= 1
80 --source include/rpl_end.inc