1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
include/master-slave.inc
Warnings:
Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
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.
[connection master]
#####1.Verifying the value of partition_id written to the binary log #####
CREATE TABLE employees (store_id INT NOT NULL) PARTITION BY RANGE (store_id)
( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20), PARTITION p2 VALUES LESS THAN (30));
include/save_binlog_position.inc
INSERT INTO employees VALUES(22);
include/rpl_partition_info.inc
ALTER TABLE employees ADD PARTITION (PARTITION p3 VALUES LESS THAN (40));
include/save_binlog_position.inc
INSERT INTO employees VALUES(38);
include/rpl_partition_info.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 39 WHERE store_id = 38;
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 28 WHERE store_id = 39;
include/rpl_partition_info_update.inc
#####2.INSERT, UPDATE, DELETE in a partitioned table affecting same and multiple partition #####
#####3.Verifying the number of events created when executing statements affecting same and multiple partitions #####
-----INSERT-----
include/save_binlog_position.inc
INSERT INTO employees VALUES(4), (5);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
INSERT INTO employees VALUES(7), (15);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
-----UPDATE-----
include/save_binlog_position.inc
UPDATE employees SET store_id = 9 WHERE store_id < 6;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 12 WHERE store_id < 25 AND store_id > 10;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = store_id + 2 WHERE store_id < 10;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
-----DELETE-----
include/save_binlog_position.inc
DELETE FROM employees where store_id < 10;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
DELETE FROM employees where store_id < 40;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
DROP TABLE employees;
CREATE TABLE employees (store_id INT NOT NULL);
ALTER TABLE employees PARTITION BY RANGE (store_id) ( PARTITION p0 VALUES LESS THAN (10),
PARTITION p1 VALUES LESS THAN (20),
PARTITION p2 VALUES LESS THAN (30));
include/save_binlog_position.inc
INSERT INTO employees VALUES(22);
include/rpl_partition_info.inc
ALTER TABLE employees ADD PARTITION (PARTITION p3 VALUES LESS THAN (40));
include/save_binlog_position.inc
INSERT INTO employees VALUES(38);
include/rpl_partition_info.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 39 WHERE store_id = 38;
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 28 WHERE store_id = 39;
include/rpl_partition_info_update.inc
#####2.INSERT, UPDATE, DELETE in a partitioned table affecting same and multiple partition #####
#####3.Verifying the number of events created when executing statements affecting same and multiple partitions #####
-----INSERT-----
include/save_binlog_position.inc
INSERT INTO employees VALUES(4), (5);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
INSERT INTO employees VALUES(7), (15);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
-----UPDATE-----
include/save_binlog_position.inc
UPDATE employees SET store_id = 9 WHERE store_id < 6;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = 12 WHERE store_id < 25 AND store_id > 10;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE employees SET store_id = store_id + 2 WHERE store_id < 10;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
-----DELETE-----
include/save_binlog_position.inc
DELETE FROM employees where store_id < 10;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
DELETE FROM employees where store_id < 40;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
DROP TABLE employees;
#####4.Verifying the value of partition_id written to the binary log in case of table with more than 128 partitions######
CREATE TABLE tp (
id INT primary key
)
PARTITION BY RANGE( id ) (
PARTITION p0 VALUES LESS THAN (0), PARTITION p1 VALUES LESS THAN (1),
PARTITION p2 VALUES LESS THAN (2), PARTITION p3 VALUES LESS THAN (3),
PARTITION p4 VALUES LESS THAN (4), PARTITION p5 VALUES LESS THAN (5),
PARTITION p6 VALUES LESS THAN (6), PARTITION p7 VALUES LESS THAN (7),
PARTITION p8 VALUES LESS THAN (8), PARTITION p9 VALUES LESS THAN (9),
PARTITION p10 VALUES LESS THAN (10), PARTITION p11 VALUES LESS THAN (11),
PARTITION p12 VALUES LESS THAN (12), PARTITION p13 VALUES LESS THAN (13),
PARTITION p14 VALUES LESS THAN (14), PARTITION p15 VALUES LESS THAN (15),
PARTITION p16 VALUES LESS THAN (16), PARTITION p17 VALUES LESS THAN (17),
PARTITION p18 VALUES LESS THAN (18), PARTITION p19 VALUES LESS THAN (19),
PARTITION p20 VALUES LESS THAN (20), PARTITION p21 VALUES LESS THAN (21),
PARTITION p22 VALUES LESS THAN (22), PARTITION p23 VALUES LESS THAN (23),
PARTITION p24 VALUES LESS THAN (24), PARTITION p25 VALUES LESS THAN (25),
PARTITION p26 VALUES LESS THAN (26), PARTITION p27 VALUES LESS THAN (27),
PARTITION p28 VALUES LESS THAN (28), PARTITION p29 VALUES LESS THAN (29),
PARTITION p30 VALUES LESS THAN (30), PARTITION p31 VALUES LESS THAN (31),
PARTITION p32 VALUES LESS THAN (32), PARTITION p33 VALUES LESS THAN (33),
PARTITION p34 VALUES LESS THAN (34), PARTITION p35 VALUES LESS THAN (35),
PARTITION p36 VALUES LESS THAN (36), PARTITION p37 VALUES LESS THAN (37),
PARTITION p38 VALUES LESS THAN (38), PARTITION p39 VALUES LESS THAN (39),
PARTITION p40 VALUES LESS THAN (40), PARTITION p41 VALUES LESS THAN (41),
PARTITION p42 VALUES LESS THAN (42), PARTITION p43 VALUES LESS THAN (43),
PARTITION p44 VALUES LESS THAN (44), PARTITION p45 VALUES LESS THAN (45),
PARTITION p46 VALUES LESS THAN (46), PARTITION p47 VALUES LESS THAN (47),
PARTITION p48 VALUES LESS THAN (48), PARTITION p49 VALUES LESS THAN (49),
PARTITION p50 VALUES LESS THAN (50), PARTITION p51 VALUES LESS THAN (51),
PARTITION p52 VALUES LESS THAN (52), PARTITION p53 VALUES LESS THAN (53),
PARTITION p54 VALUES LESS THAN (54), PARTITION p55 VALUES LESS THAN (55),
PARTITION p56 VALUES LESS THAN (56), PARTITION p57 VALUES LESS THAN (57),
PARTITION p58 VALUES LESS THAN (58), PARTITION p59 VALUES LESS THAN (59),
PARTITION p60 VALUES LESS THAN (60), PARTITION p61 VALUES LESS THAN (61),
PARTITION p62 VALUES LESS THAN (62), PARTITION p63 VALUES LESS THAN (63),
PARTITION p64 VALUES LESS THAN (64), PARTITION p65 VALUES LESS THAN (65),
PARTITION p66 VALUES LESS THAN (66), PARTITION p67 VALUES LESS THAN (67),
PARTITION p68 VALUES LESS THAN (68), PARTITION p69 VALUES LESS THAN (69),
PARTITION p70 VALUES LESS THAN (70), PARTITION p71 VALUES LESS THAN (71),
PARTITION p72 VALUES LESS THAN (72), PARTITION p73 VALUES LESS THAN (73),
PARTITION p74 VALUES LESS THAN (74), PARTITION p75 VALUES LESS THAN (75),
PARTITION p76 VALUES LESS THAN (76), PARTITION p77 VALUES LESS THAN (77),
PARTITION p78 VALUES LESS THAN (78), PARTITION p79 VALUES LESS THAN (79),
PARTITION p80 VALUES LESS THAN (80), PARTITION p81 VALUES LESS THAN (81),
PARTITION p82 VALUES LESS THAN (82), PARTITION p83 VALUES LESS THAN (83),
PARTITION p84 VALUES LESS THAN (84), PARTITION p85 VALUES LESS THAN (85),
PARTITION p86 VALUES LESS THAN (86), PARTITION p87 VALUES LESS THAN (87),
PARTITION p88 VALUES LESS THAN (88), PARTITION p89 VALUES LESS THAN (89),
PARTITION p90 VALUES LESS THAN (90), PARTITION p91 VALUES LESS THAN (91),
PARTITION p92 VALUES LESS THAN (92), PARTITION p93 VALUES LESS THAN (93),
PARTITION p94 VALUES LESS THAN (94), PARTITION p95 VALUES LESS THAN (95),
PARTITION p96 VALUES LESS THAN (96), PARTITION p97 VALUES LESS THAN (97),
PARTITION p98 VALUES LESS THAN (98), PARTITION p99 VALUES LESS THAN (99),
PARTITION p100 VALUES LESS THAN (100), PARTITION p101 VALUES LESS THAN (101),
PARTITION p102 VALUES LESS THAN (102), PARTITION p103 VALUES LESS THAN (103),
PARTITION p104 VALUES LESS THAN (104), PARTITION p105 VALUES LESS THAN (105),
PARTITION p106 VALUES LESS THAN (106), PARTITION p107 VALUES LESS THAN (107),
PARTITION p108 VALUES LESS THAN (108), PARTITION p109 VALUES LESS THAN (109),
PARTITION p110 VALUES LESS THAN (110), PARTITION p111 VALUES LESS THAN (111),
PARTITION p112 VALUES LESS THAN (112), PARTITION p113 VALUES LESS THAN (113),
PARTITION p114 VALUES LESS THAN (114), PARTITION p115 VALUES LESS THAN (115),
PARTITION p116 VALUES LESS THAN (116), PARTITION p117 VALUES LESS THAN (117),
PARTITION p118 VALUES LESS THAN (118), PARTITION p119 VALUES LESS THAN (119),
PARTITION p120 VALUES LESS THAN (120), PARTITION p121 VALUES LESS THAN (121),
PARTITION p122 VALUES LESS THAN (122), PARTITION p123 VALUES LESS THAN (123),
PARTITION p124 VALUES LESS THAN (124), PARTITION p125 VALUES LESS THAN (125),
PARTITION p126 VALUES LESS THAN (126), PARTITION p127 VALUES LESS THAN (127),
PARTITION p128 VALUES LESS THAN (128), PARTITION p129 VALUES LESS THAN (129));
include/save_binlog_position.inc
INSERT INTO tp VALUES(126), (127), (128);
include/rpl_partition_info.inc
#####5.Verifying the value of partition_id written to the binary log in case of sub-partitions######
CREATE TABLE sp(id INT, age INT) PARTITION BY RANGE(age) SUBPARTITION BY KEY(id) (
PARTITION p0 VALUES LESS THAN (30) (SUBPARTITION p0a, SUBPARTITION p0b),
PARTITION p1 VALUES LESS THAN (60) (SUBPARTITION p1a, SUBPARTITION p1b));
include/save_binlog_position.inc
INSERT INTO sp VALUES(101, 31);
include/rpl_partition_info.inc
include/save_binlog_position.inc
INSERT INTO sp VALUES (102, 32);
include/rpl_partition_info.inc
#####6.INSERTS, UPDATES, DELETES in a partitioned table affecting same and multiple sub_partition #####
#####7.Verifying the number of events created when executing statements affecting single and multiple sub_partitions #####
-----INSERT-----
include/save_binlog_position.inc
INSERT INTO sp VALUES(103, 31), (105, 32);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
INSERT INTO sp VALUES(104, 32), (105, 32);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
-----UPDATE-----
include/save_binlog_position.inc
UPDATE sp set age=31 where id = 102 or id=104;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
UPDATE sp set age=29 where id = 102 or id=103;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
-----DELETE-----
include/save_binlog_position.inc
DELETE FROM sp where id = 101 or id=105;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/save_binlog_position.inc
DELETE FROM sp where id = 102 or id=103;
include/assert_binlog_events.inc
include/rpl_partition_info.inc
#####8.INSERT, UPDATE, DELETE in a table with no partition #####
#####9.Verifying the number of events created when executing the above statements #####
CREATE TABLE t(s int, x int);
INSERT INTO t VALUES (11, 2);
INSERT INTO t VALUES (13, 4);
-----INSERT-----
include/save_binlog_position.inc
INSERT INTO t VALUES (10, 1), (11, 20);
include/assert_binlog_events.inc
-----UPDATE-----
include/save_binlog_position.inc
UPDATE t SET s= 7 WHERE x > 3;
include/assert_binlog_events.inc
-----DELETE------
include/save_binlog_position.inc
DELETE from t where x < 4;
include/assert_binlog_events.inc
#####10.Sync with slave and check if all the tables are replicated correctly#####
include/sync_slave_sql_with_master.inc
include/diff_tables.inc [master:tp, slave:tp]
include/diff_tables.inc [master:t, slave:t]
include/diff_tables.inc [master:sp, slave:sp]
DROP TABLE tp;
DROP TABLE t;
DROP TABLE sp;
#####11.INSERT in a table which has both partition info and ndb_info #####
CREATE TABLE t1 (store_id INT NOT NULL) PARTITION BY RANGE (store_id) ( PARTITION p0 VALUES LESS THAN (10), PARTITION p1 VALUES LESS THAN (20));
include/save_binlog_position.inc
INSERT INTO t1 VALUES (1), (11), (15);
include/assert_binlog_events.inc
include/rpl_partition_info.inc
include/mysqlbinlog.inc
### Extra row ndb info: data_format: 0, len: 0, data: ""
### Extra row info for partitioning: partition: 0
### INSERT INTO `test`.`t1`
### SET
### @1=1
### Extra row ndb info: data_format: 1, len: 1, data: 0x01
### Extra row info for partitioning: partition: 1
### INSERT INTO `test`.`t1`
### SET
### @1=11
### Extra row ndb info: data_format: 2, len: 2, data: 0x0202
### Extra row info for partitioning: partition: 1
### INSERT INTO `test`.`t1`
### SET
### @1=15
include/sync_slave_sql_with_master.inc
#####12.Test partial JSON Update #####
SET @@SESSION.BINLOG_ROW_VALUE_OPTIONS= PARTIAL_JSON;
Warnings:
Warning 3647 When binlog_row_image=FULL, the option binlog_row_value_options=PARTIAL_JSON will be used only for the after-image. Full values will be written in the before-image, so the saving in disk space due to binlog_row_value_options is limited to less than 50%.
include/save_binlog_position.inc
UPDATE t1 SET store_id = 8 WHERE store_id = 11;
include/assert_binlog_events.inc
include/rpl_partition_info_update.inc
include/save_binlog_position.inc
INSERT INTO t1 VALUES (2);
include/assert_grep.inc [The error block is working fine for ndb_info print.]
DROP TABLE t1;
RESET MASTER;
include/rpl_end.inc
|