| 1 |
include/only_with_option.inc [GLOBAL.binlog_row_image = 'full'] |
| 2 |
include/master-slave.inc |
| 3 |
Warnings: |
| 4 |
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 5 |
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. |
| 6 |
[connection master] |
| 7 |
|
| 8 |
################################################## |
| 9 |
# 1. Enable the generation of GIPKs in the source |
| 10 |
# With the binary log temporarily disabled, create table t1 |
| 11 |
# Create the same table on the replica with an extra auto inc column at the end |
| 12 |
[connection slave] |
| 13 |
CREATE TABLE t1(f1 INT, f2 INT, extra_column INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (extra_column)); |
| 14 |
[connection master] |
| 15 |
SET SESSION sql_generate_invisible_primary_key = ON; |
| 16 |
include/disable_binlog.inc |
| 17 |
CREATE TABLE t1(f1 INT, f2 INT); |
| 18 |
include/restore_binlog.inc |
| 19 |
SET SESSION sql_generate_invisible_primary_key = OFF; |
| 20 |
|
| 21 |
################################################## |
| 22 |
# 2. Add 3 rows to the table on the source |
| 23 |
# Check the generated values on the replica are the expected |
| 24 |
[connection slave] |
| 25 |
include/save_sysvars.inc [ "GLOBAL.replica_parallel_workers" ] |
| 26 |
include/stop_slave_sql.inc |
| 27 |
SET @@GLOBAL.replica_parallel_workers= 1; |
| 28 |
include/start_slave_sql.inc |
| 29 |
[connection master] |
| 30 |
INSERT INTO t1 VALUES (1, 1); |
| 31 |
INSERT INTO t1 VALUES (2, 2); |
| 32 |
INSERT INTO t1 VALUES (3, 3); |
| 33 |
include/sync_slave_sql_with_master.inc |
| 34 |
include/assert.inc [The table contains a row with generated key 1] |
| 35 |
include/assert.inc [The table contains a row with generated key 2] |
| 36 |
include/assert.inc [The table contains a row with generated key 3] |
| 37 |
|
| 38 |
################################################## |
| 39 |
# 3. Update/Delete rows on the source |
| 40 |
[connection master] |
| 41 |
UPDATE t1 SET t1.f2 = 60 WHERE t1.f1=2; |
| 42 |
DELETE FROM t1 WHERE t1.f1=1; |
| 43 |
include/sync_slave_sql_with_master.inc |
| 44 |
[connection slave] |
| 45 |
include/assert.inc [The table contains 2 rows] |
| 46 |
include/assert.inc [The table contains a row with generated key 2] |
| 47 |
include/assert.inc [The table contains a row with generated key 3] |
| 48 |
|
| 49 |
################################################## |
| 50 |
# 4. Cleanup |
| 51 |
include/restore_sysvars.inc |
| 52 |
[connection master] |
| 53 |
DROP TABLE t1; |
| 54 |
include/rpl_end.inc |