| 1 |
include/master-slave.inc |
| 2 |
Warnings: |
| 3 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 |
Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. |
| 5 |
[connection master] |
| 6 |
# |
| 7 |
# 1. Setup: |
| 8 |
# Start the replica channel with GTID_ONLY=1 |
| 9 |
# Add some info in the source and replicate it |
| 10 |
# Record the source positions to wait later on |
| 11 |
[connection slave] |
| 12 |
CHANGE REPLICATION SOURCE TO REQUIRE_ROW_FORMAT = 1, GTID_ONLY = 1; |
| 13 |
[connection master] |
| 14 |
CREATE TABLE t(s INT); |
| 15 |
INSERT INTO t VALUES(1); |
| 16 |
INSERT INTO t VALUES(2); |
| 17 |
# |
| 18 |
# 2. Start replication |
| 19 |
# Check SOURCE_POS_WAIT does not time out when giving it a valid positioning info |
| 20 |
[connection slave] |
| 21 |
include/start_slave.inc |
| 22 |
[connection master] |
| 23 |
include/sync_slave_sql_with_master.inc |
| 24 |
include/assert.inc [The function did not time out] |
| 25 |
# |
| 26 |
# 3. Restart the server so positions become invalid |
| 27 |
# Use relay log recovery so the new relay log contains no source info when the applier starts |
| 28 |
include/rpl_restart_server.inc [server_number=2 parameters: --skip_slave_start=1 --relay-log-recovery=1] |
| 29 |
include/start_slave_sql.inc |
| 30 |
include/assert.inc [The source log file name in the applier is invalid] |
| 31 |
include/assert.inc [The source log file position in the applier is 0] |
| 32 |
# |
| 33 |
# 4. Test that the command times out cause positions are invalid |
| 34 |
[connection server_2] |
| 35 |
include/assert.inc [The function timed out] |
| 36 |
# |
| 37 |
# 5. Execute a wait with a large timeout |
| 38 |
# Turn applier positions valid again |
| 39 |
# Check the function does not time out when positions become valid |
| 40 |
CREATE TABLE query_result(res INT); |
| 41 |
INSERT INTO query_result SELECT SOURCE_POS_WAIT('LOG_FILE_ON_SOURCE', LOG_POS_ON_SOURCE, 100);; |
| 42 |
[connection slave] |
| 43 |
include/start_slave_io.inc |
| 44 |
[connection master] |
| 45 |
INSERT INTO t VALUES(3); |
| 46 |
[connection server_2] |
| 47 |
include/assert.inc [The function did not time out] |
| 48 |
# |
| 49 |
# 6. SOURCE_POS_WAIT does not timeout when invoked with valid positioning info |
| 50 |
[connection slave] |
| 51 |
include/assert.inc [The function did not time out] |
| 52 |
# |
| 53 |
# 7. Cleanup |
| 54 |
include/stop_slave.inc |
| 55 |
CHANGE REPLICATION SOURCE TO REQUIRE_ROW_FORMAT = 0, GTID_ONLY = 0; |
| 56 |
include/start_slave.inc |
| 57 |
CALL mtr.add_suppression("Relay log recovery on channel with GTID_ONLY=1*"); |
| 58 |
DROP TABLE query_result; |
| 59 |
[connection master] |
| 60 |
DROP TABLE t; |
| 61 |
include/rpl_end.inc |