Skip to content

Commit

Permalink
Fixed test cases that broke because we now print changing of connections
Browse files Browse the repository at this point in the history
- Don't log connection creation in galera_connect.inc
  • Loading branch information
montywi committed May 1, 2016
1 parent 4f1c81d commit 5a7374d
Show file tree
Hide file tree
Showing 140 changed files with 741 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mysql-test/include/galera_connect.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,15 @@ if (!$_galera_port)
if ($galera_debug)
{
--disable_query_log
--echo connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
--enable_query_log
}
# Temporal solution to avoid concurrent IST MDEV-7178
--sleep 1
# Open a connection
--disable_query_log
--connect($galera_connection_name,127.0.0.1,root,,test,$_galera_port,)
--enable_query_log
7 changes: 7 additions & 0 deletions mysql-test/suite/galera/r/binlog_checksum.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# On node_1
connection node_1;
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
# On node_2
connection node_2;
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
USE test;
Expand All @@ -23,6 +25,7 @@ c1
5

# On node_2
connection node_2;
SELECT * FROM test.t1;
c1
1
Expand All @@ -31,6 +34,10 @@ c1
4
5
DROP TABLE t1;
connection node_1;
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
connection node_2;
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
disconnect node_2;
disconnect node_1;
# End of test
4 changes: 4 additions & 0 deletions mysql-test/suite/galera/r/create.result
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
#
# MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
#
connection node_1;
CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
SELECT * FROM t1;
i
1
connection node_2;
SELECT * FROM t1;
i
1
Expand All @@ -37,6 +39,7 @@ DROP TABLE t1;
# MDEV-8166 : Adding index on new table from select crashes Galera
# cluster
#
connection node_1;
CREATE TABLE t1(i int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1(i) VALUES (1), (2), (3);
CREATE TABLE t2 (i INT) SELECT i FROM t1;
Expand All @@ -46,6 +49,7 @@ i
1
2
3
connection node_2;
SELECT * FROM t2;
i
1
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/r/enforce_storage_engine.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
# MDEV-8831 : enforce_storage_engine doesn't block table creation on
# other nodes (galera cluster)
#
connection node_1;
SET @@enforce_storage_engine=INNODB;
CREATE TABLE t1(i INT) ENGINE=INNODB;
CREATE TABLE t2(i INT) ENGINE=MYISAM;
ERROR 42000: Unknown storage engine 'MyISAM'
INSERT INTO t1 VALUES(1);
connection node_2;
SHOW TABLES;
Tables_in_test
t1
SELECT COUNT(*)=1 FROM t1;
COUNT(*)=1
1
CREATE TABLE t2(i INT) ENGINE=MYISAM;
connection node_1;
SHOW TABLES;
Tables_in_test
t1
Expand Down
7 changes: 7 additions & 0 deletions mysql-test/suite/galera/r/fk.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
USE test;

# On node_1
connection node_1;
CREATE TABLE networks (
`tenant_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`id` varchar(36) COLLATE utf8_unicode_ci NOT NULL,
Expand Down Expand Up @@ -60,9 +61,11 @@ INSERT INTO ipallocations VALUES ('f37aa3fe-ab99-4d0f-a566-6cd3169d7516','10.25.
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
connection node_2;
select * from ports where ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 fa:16:3e:e3:cc:bb 1 DOWN f37aa3fe-ab99-4d0f-a566-6cd3169d7516 network:router_gateway
connection node_1;
DELETE FROM ports WHERE ports.id = 'f37aa3fe-ab99-4d0f-a566-6cd3169d7516';
select * from networks;
tenant_id id name status admin_state_up shared
Expand All @@ -78,6 +81,7 @@ select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner

# On node_2
connection node_2;
select * from networks;
tenant_id id name status admin_state_up shared
f37aa3fe-ab99-4d0f-a566-6cd3169d7516 f37aa3fe-ab99-4d0f-a566-6cd3169d7516 MyNet ACTIVE 0 0
Expand All @@ -90,7 +94,10 @@ select * from ipallocations;
port_id ip_address subnet_id network_id
select * from ports;
tenant_id id name network_id mac_address admin_state_up status device_id device_owner
connection node_1;
drop table ipallocations;
drop table subnets;
drop table ports;
drop table networks;
disconnect node_2;
disconnect node_1;
16 changes: 16 additions & 0 deletions mysql-test/suite/galera/r/galera_account_management.result
Original file line number Diff line number Diff line change
@@ -1,39 +1,55 @@
connection node_1;
CREATE USER user1, user2 IDENTIFIED BY 'password';
connection node_2;
SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 2
1
connection node_1;
RENAME USER user2 TO user3;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user = 'user2';
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user3';
COUNT(*) = 1
1
connection node_1;
SET PASSWORD FOR user3 = PASSWORD('foo');
connection node_1;
SELECT password != '' FROM mysql.user WHERE user = 'user3';
password != ''
1
connection node_1;
DROP USER user1, user3;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.user WHERE user IN ('user1', 'user2');
COUNT(*) = 0
1
connection node_1;
GRANT ALL ON *.* TO user4 IDENTIFIED BY 'password';
connection node_2;
SELECT COUNT(*) = 1 FROM mysql.user WHERE user = 'user4';
COUNT(*) = 1
1
SELECT Select_priv = 'Y' FROM mysql.user WHERE user = 'user4';
Select_priv = 'Y'
1
connection node_1;
CREATE USER user5;
GRANT PROXY ON user4 TO user5;
connection node_2;
SELECT COUNT(*) = 1 FROM mysql.proxies_priv WHERE user = 'user5';
COUNT(*) = 1
1
connection node_1;
REVOKE ALL PRIVILEGES ON *.* FROM user4;
connection node_2;
SELECT Select_priv = 'N' FROM mysql.user WHERE user = 'user4';
Select_priv = 'N'
1
connection node_1;
REVOKE PROXY ON user4 FROM user5;
connection node_2;
SELECT COUNT(*) = 0 FROM mysql.proxies_priv WHERE user = 'user5';
COUNT(*) = 0
1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
ALTER TABLE t1 ENGINE=InnoDB;
connection node_2;
SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
ENGINE = 'InnoDB'
1
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/galera/r/galera_alter_engine_myisam.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ SET GLOBAL wsrep_replicate_myisam = TRUE;
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
ALTER TABLE t1 ENGINE=InnoDB;
connection node_2;
SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
ENGINE = 'InnoDB'
1
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
connection node_1;
DROP TABLE t1;
1 change: 1 addition & 0 deletions mysql-test/suite/galera/r/galera_alter_table_force.result
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
ALTER TABLE t1 FORCE;
connection node_2;
SELECT ENGINE = 'InnoDB' FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
ENGINE = 'InnoDB'
1
Expand Down
5 changes: 5 additions & 0 deletions mysql-test/suite/galera/r/galera_applier_ftwrl_table.result
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
connection node_1;
SET SESSION wsrep_sync_wait = 0;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
FLUSH TABLE t1 WITH READ LOCK;
connection node_2;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_1;
UNLOCK TABLES;
SET SESSION wsrep_sync_wait = 7;
SELECT COUNT(*) = 2 FROM t1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
connection node_1;
SET SESSION wsrep_sync_wait = 0;
SET SESSION lock_wait_timeout = 60;
SET SESSION innodb_lock_wait_timeout=60;
SET SESSION wait_timeout=60;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
FLUSH TABLE t1 WITH READ LOCK;
connection node_2;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_1;
SELECT 1 FROM DUAL;
1
1
Expand Down
6 changes: 6 additions & 0 deletions mysql-test/suite/galera/r/galera_as_master.result
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
START SLAVE;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
# Disable binary logging for current session
Expand All @@ -10,6 +12,7 @@ CREATE TABLE test.t3 AS SELECT * from t1;
SET SQL_LOG_BIN=ON;
INSERT INTO t1 VALUES(3);
CREATE TABLE test.t4 AS SELECT * from t1;
connection node_2;
SELECT * FROM t1;
f1
1
Expand All @@ -27,6 +30,7 @@ f1
1
2
3
connection node_3;
SHOW TABLES;
Tables_in_test
t1
Expand All @@ -41,8 +45,10 @@ f1
2
3
# Cleanup
connection node_1;
DROP TABLE t1, t4;
SET SQL_LOG_BIN=OFF;
DROP TABLE t2, t3;
connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
6 changes: 6 additions & 0 deletions mysql-test/suite/galera/r/galera_as_master_large.result
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# MDEV-9044 : Getting binlog corruption on my Galera cluster (10.1.8)
# making it impossible to async slave.
#
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
START SLAVE;
connection node_1;
SELECT @@GLOBAL.BINLOG_CACHE_SIZE;
@@GLOBAL.BINLOG_CACHE_SIZE
8192
Expand All @@ -12,19 +14,23 @@ START TRANSACTION;
INSERT INTO t1 VALUES(1, REPEAT('-', 10000));
COMMIT;
INSERT INTO t2 VALUES(1);
connection node_2;
SELECT c1, LENGTH(c2) FROM t1;
c1 LENGTH(c2)
1 10000
SELECT * FROM t2;
c1
1
connection node_3;
SELECT c1, LENGTH(c2) FROM t1;
c1 LENGTH(c2)
1 10000
SELECT * FROM t2;
c1
1
# Cleanup
connection node_1;
DROP TABLE t1, t2;
connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
9 changes: 9 additions & 0 deletions mysql-test/suite/galera/r/galera_as_slave.result
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2;
START SLAVE;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
connection node_2;
INSERT INTO t1 VALUES (2);
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
INSERT INTO t1 VALUES (3);
connection node_2;
SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
1
connection node_1;
DROP TABLE t1;
connection node_2;
STOP SLAVE;
RESET SLAVE ALL;
connection node_1;
RESET MASTER;
8 changes: 8 additions & 0 deletions mysql-test/suite/galera/r/galera_as_slave_gtid.result
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2;
START SLAVE;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
SELECT LENGTH(@@global.gtid_binlog_state) > 1;
LENGTH(@@global.gtid_binlog_state) > 1
1
connection node_2;
gtid_binlog_state_equal
1
connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
gtid_binlog_state_equal
1
connection node_1;
DROP TABLE t1;
connection node_3;
connection node_2;
STOP SLAVE;
RESET SLAVE ALL;
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET AUTOCOMMIT=OFF;
FLUSH TABLES t1 FOR EXPORT;
connection node_1;
INSERT INTO t1 VALUES (2);
connection node_2;
SET SESSION wsrep_sync_wait = 0;
UNLOCK TABLES;
COMMIT;
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/suite/galera/r/galera_bf_abort_ftwrl.result
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET AUTOCOMMIT=OFF;
FLUSH TABLES WITH READ LOCK;;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
UNLOCK TABLES;
wsrep_local_aborts_increment
1
Expand Down

0 comments on commit 5a7374d

Please sign in to comment.