You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

572 lines
16 KiB

  1. #
  2. # Basic tests of row-level logging
  3. #
  4. #
  5. # First we test tables with only an index.
  6. #
  7. eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ;
  8. SELECT * FROM t1;
  9. sync_slave_with_master;
  10. SELECT * FROM t1;
  11. # Testing insert
  12. connection master;
  13. INSERT INTO t1 VALUES ('A','B'), ('X','Y'), ('X','X');
  14. INSERT INTO t1 VALUES ('A','C'), ('X','Z'), ('A','A');
  15. SELECT * FROM t1 ORDER BY C1,C2;
  16. sync_slave_with_master;
  17. SELECT * FROM t1 ORDER BY C1,C2;
  18. # Testing delete
  19. # Observe that are several rows having the value for the index but only one
  20. # should be deleted.
  21. connection master;
  22. DELETE FROM t1 WHERE C1 = C2;
  23. SELECT * FROM t1 ORDER BY C1,C2;
  24. sync_slave_with_master;
  25. SELECT * FROM t1 ORDER BY C1,C2;
  26. #
  27. # Testing update.
  28. # Note that we have a condition on a column that is not part of the index for
  29. # the table. The right row should be updated nevertheless.
  30. #
  31. connection master;
  32. UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
  33. SELECT * FROM t1 ORDER BY C1,C2;
  34. sync_slave_with_master;
  35. SELECT * FROM t1 ORDER BY C1,C2;
  36. # Testing update with a condition that does not match any rows, but
  37. # which has a match for the index.
  38. connection master;
  39. UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
  40. SELECT * FROM t1 ORDER BY c1,c2;
  41. sync_slave_with_master;
  42. SELECT * FROM t1 ORDER BY c1,c2;
  43. #
  44. # Testing table with primary key
  45. #
  46. connection master;
  47. eval CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = $type ;
  48. INSERT INTO t2
  49. VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
  50. (6,'A',35), (7,'A',50), (8,'A',64), (9,'A',81);
  51. SELECT * FROM t2 ORDER BY c1,c2;
  52. SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
  53. sync_slave_with_master;
  54. SELECT * FROM t2 ORDER BY c1,c2;
  55. SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
  56. connection master;
  57. UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
  58. SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
  59. sync_slave_with_master;
  60. SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
  61. # Testing update with a condition that does not match any rows, but
  62. # which has a match for the primary key.
  63. connection master;
  64. UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
  65. SELECT * FROM t2 ORDER BY c1,c2;
  66. sync_slave_with_master;
  67. SELECT * FROM t2 ORDER BY c1,c2;
  68. connection master;
  69. DELETE FROM t2 WHERE c1 % 4 = 0;
  70. SELECT * FROM t2 ORDER BY c1,c2;
  71. sync_slave_with_master;
  72. SELECT * FROM t2 ORDER BY c1,c2;
  73. connection master;
  74. UPDATE t2 SET c12='X';
  75. #
  76. # Testing table with a multi-column primary key.
  77. #
  78. connection master;
  79. eval CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = $type ;
  80. INSERT INTO t3 VALUES ('A','B',1,'B',1), ('X','Y',2,'B',1), ('X','X',3,'B',1);
  81. INSERT INTO t3 VALUES ('A','C',1,'B',2), ('X','Z',2,'B',2), ('A','A',3,'B',2);
  82. SELECT * FROM t3 ORDER BY C1,C2;
  83. sync_slave_with_master;
  84. SELECT * FROM t3 ORDER BY C1,C2;
  85. connection master;
  86. DELETE FROM t3 WHERE C1 = C2;
  87. SELECT * FROM t3 ORDER BY C1,C2;
  88. sync_slave_with_master;
  89. SELECT * FROM t3 ORDER BY C1,C2;
  90. connection master;
  91. UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
  92. SELECT * FROM t3 ORDER BY C1,C2;
  93. sync_slave_with_master;
  94. SELECT * FROM t3 ORDER BY C1,C2;
  95. #
  96. # Testing table without index or primary key
  97. #
  98. connection master;
  99. eval CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT$extra_index_t6) ENGINE = $type;
  100. # Testing insert
  101. INSERT INTO t6 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
  102. INSERT INTO t6 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
  103. SELECT * FROM t6 ORDER BY C3;
  104. sync_slave_with_master;
  105. SELECT * FROM t6 ORDER BY C3;
  106. # Testing delete
  107. # Observe that are several rows having the value for the index but only one
  108. # should be deleted.
  109. connection master;
  110. DELETE FROM t6 WHERE C1 = C2;
  111. SELECT * FROM t6 ORDER BY C3;
  112. sync_slave_with_master;
  113. SELECT * FROM t6 ORDER BY C3;
  114. #
  115. # Testing update.
  116. # Note that we have a condition on a column that is not part of the index for
  117. # the table. The right row should be updated nevertheless.
  118. #
  119. connection master;
  120. UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
  121. SELECT * FROM t6 ORDER BY C3;
  122. sync_slave_with_master;
  123. SELECT * FROM t6 ORDER BY C3;
  124. # now mixing the 3 tables without begin/commit
  125. connection master;
  126. eval CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = $type ;
  127. INSERT INTO t5 VALUES ('A','B',1), ('X','Y',2), ('X','X',3);
  128. INSERT INTO t5 VALUES ('A','C',4), ('X','Z',5), ('A','A',6);
  129. UPDATE t5,t2,t3 SET t5.C2='Q', t2.c12='R', t3.C3 ='S' WHERE t5.C1 = t2.c12 AND t5.C1 = t3.C1;
  130. SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
  131. sync_slave_with_master;
  132. SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5.C3,t2.c1,t3.pk1,t3.pk2;
  133. #
  134. # Testing special column types
  135. #
  136. connection master;
  137. eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ;
  138. INSERT INTO t4 SET C1 = 1;
  139. SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
  140. sync_slave_with_master;
  141. SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
  142. #
  143. # Testing conflicting operations
  144. #
  145. connection master;
  146. eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
  147. sync_slave_with_master;
  148. --echo --- on slave: original values ---
  149. INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
  150. SELECT * FROM t7 ORDER BY C1;
  151. # since bug#31552/31609 idempotency is not default any longer. In order
  152. # the preceeding test INSERT INTO t7 to pass the mode is switched
  153. # temprorarily
  154. set @@global.slave_exec_mode= 'IDEMPOTENT';
  155. connection master;
  156. --echo --- on master: new values inserted ---
  157. INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
  158. SELECT * FROM t7 ORDER BY C1;
  159. sync_slave_with_master;
  160. set @@global.slave_exec_mode= default;
  161. --echo --- on slave: old values should be overwritten by replicated values ---
  162. SELECT * FROM t7 ORDER BY C1;
  163. #
  164. # A more complicated test where the table has several keys and we are
  165. # causing a conflict for a key that is not "last".
  166. #
  167. connection master;
  168. --echo --- on master ---
  169. eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
  170. # First we make sure that the constraints are correctly set.
  171. INSERT INTO t8 VALUES (99,99,99);
  172. --error ER_DUP_ENTRY
  173. INSERT INTO t8 VALUES (99,22,33);
  174. --error ER_DUP_ENTRY
  175. INSERT INTO t8 VALUES (11,99,33);
  176. --error ER_DUP_ENTRY
  177. INSERT INTO t8 VALUES (11,22,99);
  178. SELECT * FROM t8 ORDER BY a;
  179. sync_slave_with_master;
  180. --echo --- on slave ---
  181. SELECT * FROM t8 ORDER BY a;
  182. INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
  183. SELECT * FROM t8 ORDER BY a;
  184. # since bug#31552/31609 idempotency is not default any longer. In order
  185. # the preceeding test INSERT INTO t8 to pass the mode is switched
  186. # temprorarily
  187. set @@global.slave_exec_mode= 'IDEMPOTENT';
  188. connection master;
  189. --echo --- on master ---
  190. # We insert a row that will cause conflict on the primary key but not
  191. # on the other keys.
  192. INSERT INTO t8 VALUES (2,4,8);
  193. sync_slave_with_master;
  194. set @@global.slave_exec_mode= default;
  195. --echo --- on slave ---
  196. SELECT * FROM t8 ORDER BY a;
  197. # BUG#31552: Replication breaks when deleting rows from out-of-sync
  198. # table without PK
  199. --echo **** Test for BUG#31552 ****
  200. --echo **** On Master ****
  201. # Clean up t1 so that we can use it.
  202. connection master;
  203. DELETE FROM t1;
  204. sync_slave_with_master;
  205. # Just to get a clean binary log
  206. source include/reset_master_and_slave.inc;
  207. --echo **** On Master ****
  208. connection master;
  209. INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
  210. --echo **** On Master ****
  211. sync_slave_with_master;
  212. # since bug#31552/31609 idempotency is not default any longer. In order
  213. # the following test DELETE FROM t1 to pass the mode is switched
  214. # temprorarily
  215. set @@global.slave_exec_mode= 'IDEMPOTENT';
  216. DELETE FROM t1 WHERE C1 = 'L';
  217. connection master;
  218. DELETE FROM t1;
  219. query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
  220. sync_slave_with_master;
  221. set @@global.slave_exec_mode= default;
  222. let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
  223. disable_query_log;
  224. eval SELECT "$last_error" AS Last_SQL_Error;
  225. enable_query_log;
  226. query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
  227. # BUG#37076: TIMESTAMP/DATETIME values are not replicated correctly
  228. # between machines with mixed endiannes
  229. # (regression test)
  230. --echo **** Test for BUG#37076 ****
  231. --echo **** On Master ****
  232. connection master;
  233. DROP TABLE IF EXISTS t1;
  234. CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
  235. INSERT INTO t1 VALUES(
  236. '2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
  237. --echo **** On Slave ****
  238. sync_slave_with_master slave;
  239. SELECT * FROM t1;
  240. #
  241. # cleanup
  242. #
  243. connection master;
  244. DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
  245. sync_slave_with_master;
  246. #
  247. # BUG#37426: RBR breaks for CHAR() UTF8 fields > 85 chars
  248. #
  249. # We have 4 combinations to test with respect to the field length
  250. # (i.e., the number of bytes) of the CHAR fields:
  251. #
  252. # 1. Replicating from CHAR<256 to CHAR<256
  253. # 2. Replicating from CHAR<256 to CHAR>255
  254. # 3. Replicating from CHAR>255 to CHAR<256
  255. # 4. Replicating from CHAR>255 to CHAR>255
  256. # We also make a special case of using the max size of a field on the
  257. # master, i.e. CHAR(255) in UTF-8, giving another three cases.
  258. #
  259. # 5. Replicating UTF-8 CHAR(255) to CHAR(<256)
  260. # 6. Replicating UTF-8 CHAR(255) to CHAR(>255)
  261. # 7. Replicating UTF-8 CHAR(255) to CHAR(255) UTF-8
  262. connection master;
  263. eval CREATE TABLE t1 (i INT NOT NULL,
  264. c CHAR(16) CHARACTER SET utf8 NOT NULL,
  265. j INT NOT NULL) ENGINE = $type ;
  266. eval CREATE TABLE t2 (i INT NOT NULL,
  267. c CHAR(16) CHARACTER SET utf8 NOT NULL,
  268. j INT NOT NULL) ENGINE = $type ;
  269. sync_slave_with_master;
  270. ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
  271. connection master;
  272. eval CREATE TABLE t3 (i INT NOT NULL,
  273. c CHAR(128) CHARACTER SET utf8 NOT NULL,
  274. j INT NOT NULL) ENGINE = $type ;
  275. sync_slave_with_master;
  276. ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
  277. connection master;
  278. eval CREATE TABLE t4 (i INT NOT NULL,
  279. c CHAR(128) CHARACTER SET utf8 NOT NULL,
  280. j INT NOT NULL) ENGINE = $type ;
  281. eval CREATE TABLE t5 (i INT NOT NULL,
  282. c CHAR(255) CHARACTER SET utf8 NOT NULL,
  283. j INT NOT NULL) ENGINE = $type ;
  284. sync_slave_with_master;
  285. ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
  286. connection master;
  287. eval CREATE TABLE t6 (i INT NOT NULL,
  288. c CHAR(255) CHARACTER SET utf8 NOT NULL,
  289. j INT NOT NULL) ENGINE = $type ;
  290. sync_slave_with_master;
  291. ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
  292. connection master;
  293. eval CREATE TABLE t7 (i INT NOT NULL,
  294. c CHAR(255) CHARACTER SET utf8 NOT NULL,
  295. j INT NOT NULL) ENGINE = $type ;
  296. --echo [expecting slave to replicate correctly]
  297. connection master;
  298. INSERT INTO t1 VALUES (1, "", 1);
  299. INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
  300. sync_slave_with_master;
  301. let $diff_table_1=master:test.t1;
  302. let $diff_table_2=slave:test.t1;
  303. source include/diff_tables.inc;
  304. --echo [expecting slave to replicate correctly]
  305. connection master;
  306. INSERT INTO t2 VALUES (1, "", 1);
  307. INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
  308. sync_slave_with_master;
  309. let $diff_table_1=master:test.t2;
  310. let $diff_table_2=slave:test.t2;
  311. source include/diff_tables.inc;
  312. --echo [expecting slave to stop]
  313. connection master;
  314. INSERT INTO t3 VALUES (1, "", 1);
  315. INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2);
  316. connection slave;
  317. source include/wait_for_slave_sql_to_stop.inc;
  318. let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
  319. disable_query_log;
  320. eval SELECT "$last_error" AS Last_SQL_Error;
  321. enable_query_log;
  322. connection master;
  323. RESET MASTER;
  324. connection slave;
  325. STOP SLAVE;
  326. RESET SLAVE;
  327. START SLAVE;
  328. source include/wait_for_slave_to_start.inc;
  329. --echo [expecting slave to replicate correctly]
  330. connection master;
  331. INSERT INTO t4 VALUES (1, "", 1);
  332. INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
  333. sync_slave_with_master;
  334. let $diff_table_1=master:test.t4;
  335. let $diff_table_2=slave:test.t4;
  336. source include/diff_tables.inc;
  337. --echo [expecting slave to stop]
  338. connection master;
  339. INSERT INTO t5 VALUES (1, "", 1);
  340. INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
  341. connection slave;
  342. source include/wait_for_slave_sql_to_stop.inc;
  343. let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
  344. disable_query_log;
  345. eval SELECT "$last_error" AS Last_SQL_Error;
  346. enable_query_log;
  347. connection master;
  348. RESET MASTER;
  349. connection slave;
  350. STOP SLAVE;
  351. RESET SLAVE;
  352. START SLAVE;
  353. source include/wait_for_slave_to_start.inc;
  354. --echo [expecting slave to stop]
  355. connection master;
  356. INSERT INTO t6 VALUES (1, "", 1);
  357. INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
  358. connection slave;
  359. source include/wait_for_slave_sql_to_stop.inc;
  360. let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
  361. disable_query_log;
  362. eval SELECT "$last_error" AS Last_SQL_Error;
  363. enable_query_log;
  364. connection master;
  365. RESET MASTER;
  366. connection slave;
  367. STOP SLAVE;
  368. RESET SLAVE;
  369. START SLAVE;
  370. source include/wait_for_slave_to_start.inc;
  371. --echo [expecting slave to replicate correctly]
  372. connection master;
  373. INSERT INTO t7 VALUES (1, "", 1);
  374. INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
  375. sync_slave_with_master;
  376. let $diff_table_1=master:test.t7;
  377. let $diff_table_2=slave:test.t7;
  378. source include/diff_tables.inc;
  379. connection master;
  380. drop table t1, t2, t3, t4, t5, t6, t7;
  381. sync_slave_with_master;
  382. #
  383. # BUG#32709: Assertion failed: trx_data->empty(), file .\log.cc, line 1293
  384. #
  385. connection master;
  386. eval CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=$type;
  387. INSERT INTO t1 VALUES (1), (2), (3);
  388. --error ER_DUP_ENTRY
  389. UPDATE t1 SET a = 10;
  390. INSERT INTO t1 VALUES (4);
  391. sync_slave_with_master;
  392. let $diff_table_1=master:test.t1;
  393. let $diff_table_2=slave:test.t1;
  394. source include/diff_tables.inc;
  395. connection master;
  396. drop table t1;
  397. sync_slave_with_master;
  398. #
  399. # BUG#40004: Replication failure with no PK + no indexes
  400. #
  401. # The test cases are taken from the bug report. It is difficult to
  402. # produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
  403. # with the test cases we have.
  404. connection master;
  405. eval CREATE TABLE t1 (a int) ENGINE=$type;
  406. INSERT IGNORE INTO t1 VALUES (NULL);
  407. INSERT INTO t1 ( a ) VALUES ( 0 );
  408. INSERT INTO t1 ( a ) VALUES ( 9 );
  409. INSERT INTO t1 ( a ) VALUES ( 2 );
  410. INSERT INTO t1 ( a ) VALUES ( 9 );
  411. INSERT INTO t1 ( a ) VALUES ( 5 );
  412. UPDATE t1 SET a = 5 WHERE a = 9;
  413. DELETE FROM t1 WHERE a < 6;
  414. UPDATE t1 SET a = 9 WHERE a < 3;
  415. INSERT INTO t1 ( a ) VALUES ( 3 );
  416. UPDATE t1 SET a = 0 WHERE a < 4;
  417. UPDATE t1 SET a = 8 WHERE a < 5;
  418. sync_slave_with_master;
  419. let $diff_table_1=master:test.t1;
  420. let $diff_table_2=slave:test.t1;
  421. source include/diff_tables.inc;
  422. connection master;
  423. drop table t1;
  424. sync_slave_with_master;
  425. #
  426. # Bug #39752: Replication failure on RBR + MyISAM + no PK
  427. #
  428. # The test cases are taken from the bug report. It is difficult to
  429. # produce a test case that generates a HA_ERR_RECORD_DELETED, so we go
  430. # with the test cases we have.
  431. connection master;
  432. --disable_warnings
  433. eval CREATE TABLE t1 (a bit) ENGINE=$type;
  434. INSERT IGNORE INTO t1 VALUES (NULL);
  435. INSERT INTO t1 ( a ) VALUES ( 0 );
  436. UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
  437. INSERT INTO t1 ( a ) VALUES ( 5 );
  438. DELETE FROM t1 WHERE a < 2 LIMIT 4;
  439. DELETE FROM t1 WHERE a < 9 LIMIT 4;
  440. INSERT INTO t1 ( a ) VALUES ( 9 );
  441. UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
  442. INSERT INTO t1 ( a ) VALUES ( 8 );
  443. UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
  444. INSERT INTO t1 ( a ) VALUES ( 4 );
  445. INSERT INTO t1 ( a ) VALUES ( 3 );
  446. UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
  447. DELETE FROM t1 WHERE a = 4 LIMIT 7;
  448. UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
  449. UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
  450. DELETE FROM t1 WHERE a < 0 LIMIT 5;
  451. INSERT INTO t1 ( a ) VALUES ( 5 );
  452. UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
  453. INSERT INTO t1 ( a ) VALUES ( 5 );
  454. UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
  455. DELETE FROM t1 WHERE a < 8 LIMIT 8;
  456. INSERT INTO t1 ( a ) VALUES ( 6 );
  457. DELETE FROM t1 WHERE a < 6 LIMIT 7;
  458. UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
  459. UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
  460. INSERT INTO t1 ( a ) VALUES ( 7 );
  461. DELETE FROM t1 WHERE a < 9 LIMIT 4;
  462. INSERT INTO t1 ( a ) VALUES ( 7 );
  463. INSERT INTO t1 ( a ) VALUES ( 6 );
  464. UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
  465. DELETE FROM t1 WHERE a = 2 LIMIT 9;
  466. DELETE FROM t1 WHERE a = 1 LIMIT 4;
  467. UPDATE t1 SET a = 4 WHERE a = 2 LIMIT 7;
  468. INSERT INTO t1 ( a ) VALUES ( 0 );
  469. DELETE FROM t1 WHERE a < 3 LIMIT 0;
  470. UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
  471. INSERT INTO t1 ( a ) VALUES ( 1 );
  472. UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
  473. --enable_warnings
  474. sync_slave_with_master;
  475. let $diff_table_1=master:test.t1;
  476. let $diff_table_2=slave:test.t1;
  477. source include/diff_tables.inc;
  478. connection master;
  479. drop table t1;
  480. sync_slave_with_master;