| 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 |
SET binlog_format = STATEMENT; |
| 7 |
Warnings: |
| 8 |
Warning 1287 '@@binlog_format' is deprecated and will be removed in a future release. |
| 9 |
[connection master] |
| 10 |
create table t1 (a int key, b int) engine innodb; |
| 11 |
create table t2 (a int key, b int) engine innodb; |
| 12 |
|
| 13 |
include/sync_slave_sql_with_master.inc |
| 14 |
alter table t1 engine ndb; |
| 15 |
alter table t2 engine ndb; |
| 16 |
|
| 17 |
*** Test 1 *** |
| 18 |
|
| 19 |
[connection master] |
| 20 |
insert into t1 values (1,2); |
| 21 |
include/show_binlog_events.inc |
| 22 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 23 |
master-bin.000001 # Query # # BEGIN |
| 24 |
master-bin.000001 # Query # # use `test`; insert into t1 values (1,2) |
| 25 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 26 |
include/sync_slave_sql_with_master.inc |
| 27 |
select log_name, start_pos from mysql.ndb_apply_status |
| 28 |
|
| 29 |
*** Test 1B *** |
| 30 |
|
| 31 |
[connection master] |
| 32 |
begin; |
| 33 |
insert into t1 values (2,3); |
| 34 |
insert into t2 values (3,4); |
| 35 |
commit; |
| 36 |
include/show_binlog_events.inc |
| 37 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 38 |
master-bin.000001 # Query # # BEGIN |
| 39 |
master-bin.000001 # Query # # use `test`; insert into t1 values (2,3) |
| 40 |
master-bin.000001 # Query # # use `test`; insert into t2 values (3,4) |
| 41 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 42 |
include/sync_slave_sql_with_master.inc |
| 43 |
select log_name, start_pos from mysql.ndb_apply_status |
| 44 |
[connection master] |
| 45 |
DROP TABLE test.t1, test.t2; |
| 46 |
include/sync_slave_sql_with_master.inc |
| 47 |
SHOW TABLES; |
| 48 |
Tables_in_test |
| 49 |
|
| 50 |
*** Test 2 *** |
| 51 |
|
| 52 |
[connection master] |
| 53 |
DROP DATABASE IF EXISTS tpcb; |
| 54 |
CREATE DATABASE tpcb; |
| 55 |
|
| 56 |
CREATE TABLE tpcb.account (id INT, bid INT, balance DECIMAL(10,2), |
| 57 |
filler CHAR(255), PRIMARY KEY(id)); |
| 58 |
|
| 59 |
CREATE TABLE tpcb.branch (bid INT, balance DECIMAL(10,2), filler VARCHAR(255), |
| 60 |
PRIMARY KEY(bid)); |
| 61 |
|
| 62 |
CREATE TABLE tpcb.teller (tid INT, balance DECIMAL(10,2), filler VARCHAR(255), |
| 63 |
PRIMARY KEY(tid)); |
| 64 |
|
| 65 |
CREATE TABLE tpcb.history (id MEDIUMINT NOT NULL AUTO_INCREMENT,aid INT, |
| 66 |
tid INT, bid INT, amount DECIMAL(10,2), |
| 67 |
tdate DATETIME, teller CHAR(20), uuidf LONGBLOB, |
| 68 |
filler CHAR(80),PRIMARY KEY (id)); |
| 69 |
|
| 70 |
--- Create stored procedures & functions --- |
| 71 |
|
| 72 |
|
| 73 |
*** Stored Procedures Created *** |
| 74 |
|
| 75 |
include/sync_slave_sql_with_master.inc |
| 76 |
USE tpcb; |
| 77 |
ALTER TABLE account ENGINE NDB; |
| 78 |
ALTER TABLE branch ENGINE NDB; |
| 79 |
ALTER TABLE teller ENGINE NDB; |
| 80 |
ALTER TABLE history ENGINE NDB; |
| 81 |
[connection master] |
| 82 |
COMMIT |
| 83 |
COMMIT |
| 84 |
COMMIT |
| 85 |
COMMIT |
| 86 |
COMMIT |
| 87 |
include/show_binlog_events.inc |
| 88 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 89 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 90 |
include/sync_slave_sql_with_master.inc |
| 91 |
select log_name, start_pos from mysql.ndb_apply_status |
| 92 |
|
| 93 |
** Test 3 ** |
| 94 |
|
| 95 |
[connection master] |
| 96 |
FLUSH LOGS; |
| 97 |
COMMIT |
| 98 |
COMMIT |
| 99 |
COMMIT |
| 100 |
COMMIT |
| 101 |
COMMIT |
| 102 |
include/show_binlog_events.inc |
| 103 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 104 |
master-bin.000002 # Xid # # COMMIT /* XID */ |
| 105 |
include/sync_slave_sql_with_master.inc |
| 106 |
select log_name, start_pos from mysql.ndb_apply_status |
| 107 |
|
| 108 |
** Test 4 ** |
| 109 |
|
| 110 |
[connection master] |
| 111 |
include/rpl_reset.inc |
| 112 |
|
| 113 |
[connection master] |
| 114 |
COMMIT |
| 115 |
COMMIT |
| 116 |
COMMIT |
| 117 |
COMMIT |
| 118 |
COMMIT |
| 119 |
include/show_binlog_events.inc |
| 120 |
Log_name Pos Event_type Server_id End_log_pos Info |
| 121 |
master-bin.000001 # Xid # # COMMIT /* XID */ |
| 122 |
include/sync_slave_sql_with_master.inc |
| 123 |
select log_name, start_pos from mysql.ndb_apply_status |
| 124 |
include/diff_tables.inc [tpcb.account, master:tpcb.account] |
| 125 |
include/diff_tables.inc [tpcb.teller, master:tpcb.teller] |
| 126 |
include/diff_tables.inc [tpcb.branch, master:tpcb.branch] |
| 127 |
include/diff_tables.inc [tpcb.history, master:tpcb.history] |
| 128 |
[connection master] |
| 129 |
DROP DATABASE tpcb; |
| 130 |
include/sync_slave_sql_with_master.inc |
| 131 |
include/rpl_end.inc |