1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-6720 - enable connection log in mysqltest by default

This commit is contained in:
Sergey Vojtovich
2016-03-25 20:51:22 +04:00
parent 5052e2479e
commit 282497dd6d
1559 changed files with 38534 additions and 9891 deletions

View File

@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
# Test case1: INVOKES A TRIGGER with after insert action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after insert on t1 for each row insert into t2(a) values(6);
@@ -25,8 +26,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -104,11 +107,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -116,7 +122,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case2: INVOKES A TRIGGER with before insert action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before insert on t1 for each row insert into t2(a) values(6);
@@ -141,8 +149,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -220,11 +230,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -232,7 +245,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case3: INVOKES A TRIGGER with after update action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after update on t1 for each row insert into t2(a) values(6);
@@ -257,8 +272,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -336,11 +353,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after update action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -348,7 +368,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case4: INVOKES A TRIGGER with before update action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before update on t1 for each row insert into t2(a) values(6);
@@ -373,8 +395,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -452,11 +476,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before update action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -464,7 +491,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case5: INVOKES A TRIGGER with after delete action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after delete on t1 for each row insert into t2(a) values(6);
@@ -489,8 +518,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -568,11 +599,14 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after delete action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -580,7 +614,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case6: INVOKES A TRIGGER with before delete action
connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before delete on t1 for each row insert into t2(a) values(6);
@@ -605,8 +641,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -684,11 +722,14 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before delete action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -696,7 +737,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
connection slave;
# Test case7: CALLS A FUNCTION which INVOKES A TRIGGER with after insert action
connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -712,7 +755,9 @@ insert into t3(a) values(new.a);
end |
begin;
insert into t1(a) values(f1_two_inserts_trigger());
connection master1;
insert into t2(a) values(4),(5);
connection master;
commit;
insert into t1(a) values(f1_two_inserts_trigger());
# To verify if insert/update in an autoinc column causes statement to be logged in row format
@@ -755,15 +800,20 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with after insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t3, slave:t3]
connection master;
drop table t1;
drop table t2;
drop table t3;
drop function f1_two_inserts_trigger;
connection slave;
# Test case8: CALLS A FUNCTION which INVOKES A TRIGGER with before insert action
connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -779,7 +829,9 @@ insert into t3(a) values(new.a);
end |
begin;
insert into t1(a) values(f1_two_inserts_trigger());
connection master1;
insert into t2(a) values(4),(5);
connection master;
commit;
insert into t1(a) values(f1_two_inserts_trigger());
# To verify if insert/update in an autoinc column causes statement to be logged in row format
@@ -822,15 +874,20 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
connection master;
connection slave;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with before insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t3, slave:t3]
connection master;
drop table t1;
drop table t2;
drop table t3;
drop function f1_two_inserts_trigger;
connection slave;
# Test case9: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with after insert action
connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -842,19 +899,25 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v16(c1) VALUES (15),(16);
INSERT INTO v16(c2) VALUES (17),(18);
connection master1;
INSERT INTO v16(c1) VALUES (19),(20);
INSERT INTO v16(c2) VALUES (21),(22);
connection master;
INSERT INTO v16(c1) VALUES (23), (24);
INSERT INTO v16(c1) VALUES (25), (26);
commit;
connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
include/diff_tables.inc [master:t3, slave:t3]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP VIEW v16;
connection slave;
# Test case10: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with before insert action
connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -866,19 +929,25 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v16(c1) VALUES (15),(16);
INSERT INTO v16(c2) VALUES (17),(18);
connection master1;
INSERT INTO v16(c1) VALUES (19),(20);
INSERT INTO v16(c2) VALUES (21),(22);
connection master;
INSERT INTO v16(c1) VALUES (23), (24);
INSERT INTO v16(c1) VALUES (25), (26);
commit;
connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
include/diff_tables.inc [master:t3, slave:t3]
connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP VIEW v16;
connection slave;
# Test case11: INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES INTO A TABLE WITH AUTOINC COLUMN
connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
CREATE FUNCTION f1_two_inserts() RETURNS INTEGER
@@ -889,10 +958,13 @@ RETURN 1;
END//
begin;
insert into t1(a) values(f1_two_inserts());
connection master1;
insert into t2(a) values(4),(5);
connection master;
commit;
insert into t1(a) values(f1_two_inserts());
commit;
connection master;
#Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on master
select * from t2 ORDER BY i1;
i1 a
@@ -902,6 +974,8 @@ i1 a
4 5
5 2
6 2
connection slave;
connection slave;
#Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on slave
select * from t2 ORDER BY i1;
i1 a
@@ -911,10 +985,13 @@ i1 a
4 5
5 2
6 2
connection master;
drop table t1;
drop table t2;
drop function f1_two_inserts;
connection slave;
# Test case12: INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES OF A TABLE WITH AUTOINC COLUMN
connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
CREATE FUNCTION f1_two_updates() RETURNS INTEGER
@@ -925,14 +1002,17 @@ update t2 set a = a + 5 where b = 3;
update t2 set a = a + 5 where b = 4;
RETURN 1;
END//
connection master1;
insert into t2(a,b) values(1,1);
insert into t2(a,b) values(2,2);
insert into t2(a,b) values(3,3);
insert into t2(a,b) values(4,4);
insert into t1(a) values(f1_two_updates());
connection master;
begin;
insert into t1(a) values(f1_two_updates());
commit;
connection master;
#Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on master
select * from t2 ORDER BY i1;
i1 a b
@@ -940,6 +1020,8 @@ i1 a b
2 12 2
3 13 3
4 14 4
connection slave;
connection slave;
#Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on slave
select * from t2 ORDER BY i1;
i1 a b
@@ -947,10 +1029,13 @@ i1 a b
2 12 2
3 13 3
4 14 4
connection master;
drop table t1;
drop table t2;
drop function f1_two_updates;
connection slave;
# Test case13: UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT
connection master;
create table t1(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
begin;
@@ -974,13 +1059,17 @@ master-bin.000001 # Query # # use `test`; insert into t1(a,b) values(3,3)
master-bin.000001 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `test`; insert into t2(a,b) values(3,3)
master-bin.000001 # Xid # # COMMIT /* XID */
connection slave;
#Test if the results are consistent on master and slave
#for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
connection master;
drop table t1;
drop table t2;
connection slave;
# Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES
connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
begin;
@@ -989,8 +1078,10 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v15 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v15(c1) VALUES (15),(16);
INSERT INTO v15(c2) VALUES (17),(18);
connection master1;
INSERT INTO v15(c1) VALUES (19),(20);
INSERT INTO v15(c2) VALUES (21),(22);
connection master;
INSERT INTO v15(c1) VALUES (23), (24);
INSERT INTO v15(c2) VALUES (25), (26);
commit;
@@ -1029,11 +1120,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Intvar # # INSERT_ID=7
master-bin.000001 # Query # # use `test`; INSERT INTO v15(c2) VALUES (25), (26)
master-bin.000001 # Xid # # COMMIT /* XID */
connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
connection master;
drop table t1;
drop table t2;
drop view v15;
connection slave;
include/rpl_end.inc