1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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

@ -5,7 +5,9 @@ create temporary table t3 (a_in_temporary int) engine=myisam;
#
# Check how create table and create or replace table are logged
#
connection server_2;
create table t1 (to_be_deleted int);
connection server_1;
CREATE TABLE t1 AS SELECT 1 AS f1;
CREATE OR REPLACE TABLE t1 AS SELECT 2 AS f1;
CREATE OR REPLACE table t1 like t2;
@ -31,6 +33,7 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@ -53,6 +56,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
connection server_1;
#
# Ensure that also failed create_or_replace are logged
#
@ -87,9 +91,11 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create temporary table t9 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */
connection server_2;
show tables;
Tables_in_test
t2
connection server_1;
create table t1 (a int);
create or replace table t1 (a int, a int) select * from t2;
ERROR 42S21: Duplicate column name 'a'
@ -106,17 +112,22 @@ Note 1051 Unknown table 'test.t9'
#
# Ensure that CREATE are run as CREATE OR REPLACE on slave
#
connection server_2;
create table t1 (server_2_to_be_delete int);
connection server_1;
create table t1 (new_table int);
connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`new_table` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
connection server_1;
drop table t1;
#
# Check how CREATE is logged on slave in case of conflicts
#
connection server_2;
create table t1 (server_2_to_be_delete int);
create table t2 (server_2_to_be_delete int);
create table t4 (server_2_to_be_delete int);
@ -126,12 +137,14 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
connection server_1;
create temporary table t9 (a int);
insert into t9 values(1);
create table t1 (new_table int);
create table t2 select * from t9;
create table t4 like t9;
create table t5 select * from t9;
connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@ -166,15 +179,19 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
connection server_1;
drop table t1,t2,t4,t5,t9;
#
# Ensure that DROP TABLE is run as DROP IF NOT EXISTS
#
create table t1 (server_1_ver_1 int);
create table t4 (server_1_ver_2 int);
connection server_2;
drop table t1;
connection server_1;
drop table t1,t4;
create table t1 (server_2_ver_2 int);
connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@ -189,14 +206,18 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t4` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (server_2_ver_2 int)
connection server_1;
drop table t1;
#
# Ensure that CREATE ... SELECT is recorded as one GTID on the slave
#
connection server_2;
connection server_1;
create table t1 (a int);
insert into t1 values (0),(1),(2);
create table t2 engine=myisam select * from t1;
create or replace table t2 engine=innodb select * from t1;
connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@ -209,6 +230,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t2 engine=myisam select * from t1
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create or replace table t2 engine=innodb select * from t1
connection server_1;
drop table t1;
#
# Check logging of drop temporary table