[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.137.182.206: ~ $
# ==== Purpose ====
#
# Tests that transactions containing multiple table types are
# replicated correctly to the slave.
#
# This test was previously part of rpl_ndb_transactions.
#
#
# ==== Method ====
#
# Try all combinations of the following:
#  - Committed/rollback transactions.
#  - Transactions started by AUTOCOMMIT = 0 or BEGIN.
#  - Transactions using myisam, innodb, or ndb tables, or combinations
#    of them. For combinations, we use the engines in all possible
#    orders.
# For single-engine transactions, we also try with AUTOCOMMIT = 1.
#
#
# ==== Related bugs ====
#
# BUG#26395: if crash during autocommit update to transactional table on master, slave fails


source include/have_ndb.inc;
source suite/ndb_rpl/ndb_master-slave.inc;
source include/have_innodb.inc;

CREATE TABLE tmyisam (a int) ENGINE = MYISAM;
CREATE TABLE tinnodb (a int) ENGINE = INNODB;
CREATE TABLE tndb (a int) ENGINE = NDB;

SHOW CREATE TABLE tmyisam;
SHOW CREATE TABLE tinnodb;
SHOW CREATE TABLE tndb;


--echo [on master]


--echo ==== Single-engine transactions ====

--echo ---- autocommitted ----

SET AUTOCOMMIT = 1;

INSERT INTO tmyisam VALUES (0);
INSERT INTO tinnodb VALUES (1);
INSERT INTO tndb VALUES (2);

--echo ---- committed with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (3);
INSERT INTO tmyisam VALUES (4);
COMMIT;

BEGIN;
INSERT INTO tinnodb VALUES (5);
INSERT INTO tinnodb VALUES (6);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (7);
INSERT INTO tndb VALUES (8);
COMMIT;

--echo ---- rolled back with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (9);
INSERT INTO tmyisam VALUES (10);
ROLLBACK;

BEGIN;
INSERT INTO tinnodb VALUES (11);
INSERT INTO tinnodb VALUES (12);
ROLLBACK;

BEGIN;
INSERT INTO tndb VALUES (13);
INSERT INTO tndb VALUES (14);
ROLLBACK;


--echo ---- committed with AUTOCOMMIT = 0 ----

SET AUTOCOMMIT = 0;

INSERT INTO tmyisam VALUES (15);
INSERT INTO tmyisam VALUES (16);
COMMIT;

INSERT INTO tinnodb VALUES (17);
INSERT INTO tinnodb VALUES (18);
COMMIT;

INSERT INTO tndb VALUES (19);
INSERT INTO tndb VALUES (20);
COMMIT;

--echo ---- rolled back with AUTOCOMMIT = 0 ----

INSERT INTO tmyisam VALUES (21);
INSERT INTO tmyisam VALUES (22);
ROLLBACK;

INSERT INTO tinnodb VALUES (23);
INSERT INTO tinnodb VALUES (24);
ROLLBACK;

INSERT INTO tndb VALUES (25);
INSERT INTO tndb VALUES (26);
ROLLBACK;

SET AUTOCOMMIT = 1;


--echo ==== MyISAM + InnoDB ====

--echo ---- committed with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (27);
INSERT INTO tinnodb VALUES (28);
COMMIT;

BEGIN;
INSERT INTO tinnodb VALUES (29);
INSERT INTO tmyisam VALUES (30);
COMMIT;

--echo ---- rolled back with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (31);
INSERT INTO tinnodb VALUES (32);
ROLLBACK;

BEGIN;
INSERT INTO tinnodb VALUES (33);
INSERT INTO tmyisam VALUES (34);
ROLLBACK;

--echo ---- committed with AUTOCOMMIT = 0 ----

SET AUTOCOMMIT = 0;

INSERT INTO tmyisam VALUES (35);
INSERT INTO tinnodb VALUES (36);
COMMIT;

INSERT INTO tinnodb VALUES (37);
INSERT INTO tmyisam VALUES (38);
COMMIT;

--echo ---- rolled back with AUTOCOMMIT = 0 ----

INSERT INTO tmyisam VALUES (39);
INSERT INTO tinnodb VALUES (40);
ROLLBACK;

INSERT INTO tinnodb VALUES (41);
INSERT INTO tmyisam VALUES (42);
ROLLBACK;

SET AUTOCOMMIT = 1;


--echo ==== MyISAM + NDB ====

--echo ---- committed with BEGIN----

BEGIN;
INSERT INTO tmyisam VALUES (43);
INSERT INTO tndb VALUES (44);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (45);
INSERT INTO tmyisam VALUES (46);
COMMIT;

--echo ---- rolled back with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (47);
INSERT INTO tndb VALUES (48);
ROLLBACK;

BEGIN;
INSERT INTO tndb VALUES (49);
INSERT INTO tmyisam VALUES (50);
ROLLBACK;

--echo ---- committed with AUTOCOMMIT = 0 ----

SET AUTOCOMMIT = 0;

INSERT INTO tmyisam VALUES (51);
INSERT INTO tndb VALUES (52);
COMMIT;

INSERT INTO tndb VALUES (53);
INSERT INTO tmyisam VALUES (54);
COMMIT;

--echo ---- rolled back with AUTOCOMMIT = 0 ----

INSERT INTO tmyisam VALUES (55);
INSERT INTO tndb VALUES (56);
ROLLBACK;

INSERT INTO tndb VALUES (57);
INSERT INTO tmyisam VALUES (58);
ROLLBACK;

SET AUTOCOMMIT = 1;


--echo ==== InnoDB + NDB ====

--echo ---- committed with BEGIN ----

BEGIN;
INSERT INTO tinnodb VALUES (59);
INSERT INTO tndb VALUES (60);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (61);
INSERT INTO tinnodb VALUES (62);
COMMIT;

--echo ---- rolled back with BEGIN ----

BEGIN;
INSERT INTO tinnodb VALUES (63);
INSERT INTO tndb VALUES (64);
ROLLBACK;

BEGIN;
INSERT INTO tndb VALUES (65);
INSERT INTO tinnodb VALUES (66);
ROLLBACK;

--echo ---- committed with AUTOCOMMIT = 0 ----

SET AUTOCOMMIT = 0;

INSERT INTO tinnodb VALUES (67);
INSERT INTO tndb VALUES (68);
COMMIT;

INSERT INTO tndb VALUES (69);
INSERT INTO tinnodb VALUES (70);
COMMIT;

--echo ---- rolled back with AUTOCOMMIT = 0 ----

INSERT INTO tinnodb VALUES (71);
INSERT INTO tndb VALUES (72);
ROLLBACK;

INSERT INTO tndb VALUES (73);
INSERT INTO tinnodb VALUES (74);
ROLLBACK;

SET AUTOCOMMIT = 1;


--echo ==== MyISAM + InnoDB + NDB ====

--echo ---- committed with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (75);
INSERT INTO tinnodb VALUES (76);
INSERT INTO tndb VALUES (77);
COMMIT;

BEGIN;
INSERT INTO tmyisam VALUES (78);
INSERT INTO tndb VALUES (79);
INSERT INTO tinnodb VALUES (80);
COMMIT;

BEGIN;
INSERT INTO tinnodb VALUES (81);
INSERT INTO tmyisam VALUES (82);
INSERT INTO tndb VALUES (83);
COMMIT;

BEGIN;
INSERT INTO tinnodb VALUES (84);
INSERT INTO tndb VALUES (85);
INSERT INTO tmyisam VALUES (86);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (87);
INSERT INTO tmyisam VALUES (88);
INSERT INTO tinnodb VALUES (89);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (90);
INSERT INTO tinnodb VALUES (91);
INSERT INTO tmyisam VALUES (92);
COMMIT;

--echo ---- rolled back with BEGIN ----

BEGIN;
INSERT INTO tmyisam VALUES (93);
INSERT INTO tinnodb VALUES (94);
INSERT INTO tndb VALUES (95);
ROLLBACK;

BEGIN;
INSERT INTO tmyisam VALUES (96);
INSERT INTO tndb VALUES (97);
INSERT INTO tinnodb VALUES (98);
ROLLBACK;

BEGIN;
INSERT INTO tinnodb VALUES (99);
INSERT INTO tmyisam VALUES (100);
INSERT INTO tndb VALUES (101);
ROLLBACK;

BEGIN;
INSERT INTO tinnodb VALUES (102);
INSERT INTO tndb VALUES (103);
INSERT INTO tmyisam VALUES (104);
ROLLBACK;

BEGIN;
INSERT INTO tndb VALUES (105);
INSERT INTO tmyisam VALUES (106);
INSERT INTO tinnodb VALUES (107);
ROLLBACK;

BEGIN;
INSERT INTO tndb VALUES (108);
INSERT INTO tinnodb VALUES (109);
INSERT INTO tmyisam VALUES (110);
ROLLBACK;

--echo ---- committed with AUTOCOMMIT = 0 ----

SET AUTOCOMMIT = 0;

INSERT INTO tmyisam VALUES (111);
INSERT INTO tinnodb VALUES (112);
INSERT INTO tndb VALUES (113);
COMMIT;

INSERT INTO tmyisam VALUES (114);
INSERT INTO tndb VALUES (115);
INSERT INTO tinnodb VALUES (116);
COMMIT;

INSERT INTO tinnodb VALUES (117);
INSERT INTO tmyisam VALUES (118);
INSERT INTO tndb VALUES (119);
COMMIT;

INSERT INTO tinnodb VALUES (120);
INSERT INTO tndb VALUES (121);
INSERT INTO tmyisam VALUES (122);
COMMIT;

INSERT INTO tndb VALUES (123);
INSERT INTO tmyisam VALUES (124);
INSERT INTO tinnodb VALUES (125);
COMMIT;

INSERT INTO tndb VALUES (126);
INSERT INTO tinnodb VALUES (127);
INSERT INTO tmyisam VALUES (128);
COMMIT;

--echo ---- rolled back with AUTOCOMMIT = 0 ----

INSERT INTO tmyisam VALUES (129);
INSERT INTO tinnodb VALUES (130);
INSERT INTO tndb VALUES (131);
ROLLBACK;

INSERT INTO tmyisam VALUES (132);
INSERT INTO tndb VALUES (133);
INSERT INTO tinnodb VALUES (134);
ROLLBACK;

INSERT INTO tinnodb VALUES (135);
INSERT INTO tmyisam VALUES (136);
INSERT INTO tndb VALUES (137);
ROLLBACK;

INSERT INTO tinnodb VALUES (138);
INSERT INTO tndb VALUES (139);
INSERT INTO tmyisam VALUES (140);
ROLLBACK;

INSERT INTO tndb VALUES (141);
INSERT INTO tmyisam VALUES (142);
INSERT INTO tinnodb VALUES (143);
ROLLBACK;

INSERT INTO tndb VALUES (144);
INSERT INTO tinnodb VALUES (145);
INSERT INTO tmyisam VALUES (146);
ROLLBACK;

SET AUTOCOMMIT = 1;

--echo ---- Mixed statements Innodb ----

BEGIN;
INSERT INTO tndb VALUES (147);
INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
COMMIT;

INSERT INTO tndb VALUES (148);
BEGIN;
INSERT INTO tinnodb SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
INSERT INTO tndb VALUES (149);
COMMIT;

BEGIN;
INSERT INTO tndb VALUES (150);
INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
COMMIT;

INSERT INTO tndb VALUES (151);
BEGIN;
INSERT INTO tmyisam SELECT * FROM tndb ORDER BY a DESC LIMIT 1;
INSERT INTO tndb VALUES (152);
COMMIT;

--echo ==== Verify the result ====

SELECT * FROM tmyisam ORDER BY a;
SELECT * FROM tinnodb ORDER BY a;
SELECT * FROM tndb ORDER BY a;

--echo [on slave]
--sync_slave_with_master

let $diff_tables= master:tmyisam, slave:tmyisam;
source include/diff_tables.inc;

let $diff_tables= master:tinnodb, slave:tinnodb;
source include/diff_tables.inc;

let $diff_tables= master:tndb, slave:tndb;
source include/diff_tables.inc;


--echo ==== Clean up ====

--echo [on master]
connection master;
DROP TABLE tmyisam, tinnodb, tndb;

--echo [on slave]
sync_slave_with_master;

--source include/rpl_end.inc

Filemanager

Name Type Size Permission Actions
disabled.def File 688 B 0644
ndb_apply_status.frm File 8.51 KB 0644
ndb_conflict_info.inc File 1013 B 0644
ndb_conflict_info_init.inc File 692 B 0644
ndb_rpl_2innodb-master.opt File 32 B 0644
ndb_rpl_2innodb-slave.opt File 56 B 0644
ndb_rpl_2innodb.test File 1.63 KB 0644
ndb_rpl_2multi_basic.inc File 3.42 KB 0644
ndb_rpl_2multi_eng.inc File 10.33 KB 0644
ndb_rpl_2myisam-master.opt File 25 B 0644
ndb_rpl_2myisam-slave.opt File 47 B 0644
ndb_rpl_2myisam.test File 1.6 KB 0644
ndb_rpl_2ndb-slave.opt File 58 B 0644
ndb_rpl_2ndb.test File 648 B 0644
ndb_rpl_2other-slave.opt File 54 B 0644
ndb_rpl_2other.test File 2.18 KB 0644
ndb_rpl_add_column.test File 3.56 KB 0644
ndb_rpl_apply_status-master.opt File 28 B 0644
ndb_rpl_apply_status.test File 1.29 KB 0644
ndb_rpl_auto_inc.test File 3.98 KB 0644
ndb_rpl_bank.test File 6.47 KB 0644
ndb_rpl_basic.test File 11.29 KB 0644
ndb_rpl_binlog_format_errors.test File 3.26 KB 0644
ndb_rpl_bitfield.test File 7.9 KB 0644
ndb_rpl_blob.test File 3.91 KB 0644
ndb_rpl_break_3_chain.cnf File 1.71 KB 0644
ndb_rpl_break_3_chain.test File 3.53 KB 0644
ndb_rpl_bug22045.test File 2.2 KB 0644
ndb_rpl_check_for_mixed.test File 804 B 0644
ndb_rpl_circular.test File 4.21 KB 0644
ndb_rpl_circular_2ch.cnf File 878 B 0644
ndb_rpl_circular_2ch.test File 4.21 KB 0644
ndb_rpl_circular_2ch_rep_status.cnf File 183 B 0644
ndb_rpl_circular_2ch_rep_status.test File 9.01 KB 0644
ndb_rpl_circular_simplex.test File 2.22 KB 0644
ndb_rpl_conflict.test File 9.99 KB 0644
ndb_rpl_conflict_1.inc File 5.15 KB 0644
ndb_rpl_conflict_epoch.cnf File 561 B 0644
ndb_rpl_conflict_epoch.test File 6.86 KB 0644
ndb_rpl_conflict_epoch_1.inc File 12.36 KB 0644
ndb_rpl_conflict_max-master.opt File 28 B 0644
ndb_rpl_conflict_max.test File 2.83 KB 0644
ndb_rpl_conflict_max_delete_win-master.opt File 28 B 0644
ndb_rpl_conflict_max_delete_win.test File 2.86 KB 0644
ndb_rpl_conflict_old-master.opt File 28 B 0644
ndb_rpl_conflict_old.test File 2.83 KB 0644
ndb_rpl_ctype_ucs2_def-master.opt File 70 B 0644
ndb_rpl_ctype_ucs2_def.test File 1.13 KB 0644
ndb_rpl_dd_advance.test File 10.04 KB 0644
ndb_rpl_dd_basic.test File 1.38 KB 0644
ndb_rpl_dd_partitions-master.opt File 11 B 0644
ndb_rpl_dd_partitions-slave.opt File 11 B 0644
ndb_rpl_dd_partitions.test File 8.53 KB 0644
ndb_rpl_do_db-slave.opt File 26 B 0644
ndb_rpl_do_db.test File 1.52 KB 0644
ndb_rpl_do_table-slave.opt File 29 B 0644
ndb_rpl_do_table.test File 1.21 KB 0644
ndb_rpl_empty_epoch.test File 934 B 0644
ndb_rpl_gap_event-master.opt File 24 B 0644
ndb_rpl_gap_event.test File 1.52 KB 0644
ndb_rpl_get_binlog_events.inc File 1.09 KB 0644
ndb_rpl_idempotent.test File 2.95 KB 0644
ndb_rpl_ignore_db-master.opt File 25 B 0644
ndb_rpl_ignore_db.test File 1.07 KB 0644
ndb_rpl_init_rep_status.test File 2.95 KB 0644
ndb_rpl_innodb2ndb-master.opt File 9 B 0644
ndb_rpl_innodb2ndb-slave.opt File 42 B 0644
ndb_rpl_innodb2ndb.test File 714 B 0644
ndb_rpl_innodb_trans-slave.opt File 34 B 0644
ndb_rpl_innodb_trans.test File 1.54 KB 0644
ndb_rpl_load.test File 2.34 KB 0644
ndb_rpl_logging.test File 3.76 KB 0644
ndb_rpl_mix_eng_trans-master.opt File 9 B 0644
ndb_rpl_mix_eng_trans-slave.opt File 9 B 0644
ndb_rpl_mix_eng_trans.test File 8.84 KB 0644
ndb_rpl_mix_innodb-master.opt File 41 B 0644
ndb_rpl_mix_innodb.test File 533 B 0644
ndb_rpl_mixed_tables-master.opt File 22 B 0644
ndb_rpl_mixed_tables-slave.opt File 70 B 0644
ndb_rpl_mixed_tables.test File 8.35 KB 0644
ndb_rpl_multi.test File 2.68 KB 0644
ndb_rpl_multi_binlog_update.cnf File 1.85 KB 0644
ndb_rpl_multi_binlog_update.inc File 6.78 KB 0644
ndb_rpl_multi_update2-slave.opt File 42 B 0644
ndb_rpl_myisam2ndb-slave.opt File 42 B 0644
ndb_rpl_myisam2ndb.test File 672 B 0644
ndb_rpl_ndbapi_multi.test File 614 B 0644
ndb_rpl_relayrotate-slave.opt File 57 B 0644
ndb_rpl_rep_error.test File 2.29 KB 0644
ndb_rpl_rep_ignore-slave.opt File 63 B 0644
ndb_rpl_rep_ignore.test File 1.58 KB 0644
ndb_rpl_skip_gap_event-slave.opt File 24 B 0644
ndb_rpl_skip_gap_event.test File 1.65 KB 0644
ndb_rpl_slave_lsu.cnf File 57 B 0644
ndb_rpl_slave_lsu.test File 5.66 KB 0644
ndb_rpl_slave_lsu_anyval.cnf File 176 B 0644
ndb_rpl_slave_lsu_anyval.test File 2.25 KB 0644
ndb_rpl_slave_restart.test File 2.87 KB 0644
ndb_rpl_stm_innodb-master.opt File 41 B 0644
ndb_rpl_stm_innodb.test File 622 B 0644
ndb_rpl_sync.test File 3.02 KB 0644
ndb_rpl_ui.test File 1.2 KB 0644
ndb_rpl_ui2.test File 747 B 0644
ndb_rpl_ui3.test File 1.3 KB 0644
ndb_rpl_xxx_innodb.inc File 6.22 KB 0644
rpl_truncate_7ndb.test File 1.58 KB 0644
rpl_truncate_7ndb_2.test File 383 B 0644
select_ndb_apply_status.inc File 505 B 0644
wait_schema_logging.inc File 2.33 KB 0644