Commit 5a7374d7 authored by Monty's avatar Monty

Fixed test cases that broke because we now print changing of connections

- Don't log connection creation in galera_connect.inc
parent 4f1c81de
......@@ -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
# 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;
......@@ -23,6 +25,7 @@ c1
5
# On node_2
connection node_2;
SELECT * FROM test.t1;
c1
1
......@@ -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
......@@ -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
......@@ -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;
......@@ -46,6 +49,7 @@ i
1
2
3
connection node_2;
SELECT * FROM t2;
i
1
......
......@@ -2,11 +2,13 @@
# 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
......@@ -14,6 +16,7 @@ SELECT COUNT(*)=1 FROM t1;
COUNT(*)=1
1
CREATE TABLE t2(i INT) ENGINE=MYISAM;
connection node_1;
SHOW TABLES;
Tables_in_test
t1
......
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,
......@@ -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
......@@ -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
......@@ -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;
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
......
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
......
......@@ -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;
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
......
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;
......
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
......
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
......@@ -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
......@@ -27,6 +30,7 @@ f1
1
2
3
connection node_3;
SHOW TABLES;
Tables_in_test
t1
......@@ -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;
......@@ -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
......@@ -12,12 +14,14 @@ 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
......@@ -25,6 +29,8 @@ SELECT * FROM t2;
c1
1
# Cleanup
connection node_1;
DROP TABLE t1, t2;
connection node_3;
STOP SLAVE;
RESET SLAVE ALL;
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;
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;
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;
......
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
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2a;
SELECT GET_LOCK("foo", 1000);
GET_LOCK("foo", 1000)
1
connection node_2;
SET AUTOCOMMIT=OFF;
INSERT INTO t1 VALUES (1);
SELECT GET_LOCK("foo", 1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET AUTOCOMMIT=OFF;
LOCK TABLE t1 WRITE;
connection node_1;
INSERT INTO t1 VALUES (2);
connection node_2;
UNLOCK TABLES;
COMMIT;
SELECT COUNT(*) = 1 FROM t1;
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET AUTOCOMMIT=OFF;
INSERT INTO t1 VALUES (1);
SELECT SLEEP(1000);;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
wsrep_local_aborts_increment
1
......
......@@ -3,6 +3,7 @@ CREATE TABLE ten (f1 INTEGER);
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;
connection node_1a;
SET AUTOCOMMIT=ON;
START TRANSACTION;
INSERT INTO t1 SELECT REPEAT('a', 767) FROM ten;
......
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
connection node_1;
UPDATE t1 SET f1 = 2 WHERE f1 = 1;
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
......
CREATE TABLE t1 (f1 VARCHAR(1000));
INSERT INTO t1 VALUES (REPEAT('x', 1000));
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('x', 1000);
COUNT(*) = 1
1
......
disconnect node_2;
disconnect node_1;
# End of test
connection node_1;
CREATE USER 'user1';
CREATE
DEFINER = 'user1'
......@@ -18,12 +19,14 @@ DETERMINISTIC
NO SQL
SQL SECURITY INVOKER
RETURN 123;
connection node_1;
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTION `f1`(param INTEGER) RETURNS varchar(200) CHARSET latin1
MODIFIES SQL DATA
COMMENT 'f1_comment'
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SELECT 1 FROM DUAL;
1
1
......@@ -33,6 +36,7 @@ f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` FUNCTIO
MODIFIES SQL DATA
COMMENT 'f1_comment'
RETURN 'abc' latin1 latin1_swedish_ci latin1_swedish_ci
connection node_1;
SHOW CREATE FUNCTION f2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
......@@ -40,6 +44,7 @@ f2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost`
DETERMINISTIC
SQL SECURITY INVOKER
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SHOW CREATE FUNCTION f2;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f2`(param VARCHAR(100)) RETURNS int(11)
......@@ -53,6 +58,7 @@ f1(1) = 'abc'
SELECT f2('abc') = 123;
f2('abc') = 123
1
connection node_1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP USER 'user1';
connection node_1;
CREATE USER 'user1';
CREATE TABLE t1 (f1 INTEGER);
CREATE
......@@ -16,12 +17,14 @@ PROCEDURE p2 (param VARCHAR(100))
DETERMINISTIC
NO SQL
SQL SECURITY INVOKER BEGIN END ;
connection node_1;
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDURE `p1`(IN param1 INTEGER, OUT param2 INTEGER, INOUT param3 INTEGER)
MODIFIES SQL DATA
COMMENT 'p1_comment'
INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SELECT 1 FROM DUAL;
1
1
......@@ -31,6 +34,7 @@ p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`user1`@`%` PROCEDU
MODIFIES SQL DATA
COMMENT 'p1_comment'
INSERT INTO t1 VALUES (1) latin1 latin1_swedish_ci latin1_swedish_ci
connection node_1;
SHOW CREATE PROCEDURE p2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100))
......@@ -38,6 +42,7 @@ p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost`
DETERMINISTIC
SQL SECURITY INVOKER
BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci
connection node_2;
SHOW CREATE PROCEDURE p2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p2`(param VARCHAR(100))
......@@ -47,6 +52,7 @@ p2 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost`
BEGIN END latin1 latin1_swedish_ci latin1_swedish_ci
CALL p1(@a, @b, @c);
CALL p2('abc');
connection node_1;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP USER 'user1';
......
......@@ -11,6 +11,7 @@ CREATE TABLE real_table3 LIKE schema1.myisam_table;
CREATE TEMPORARY TABLE temp_table1 LIKE schema1.real_table;
CREATE TEMPORARY TABLE temp_table2 LIKE schema1.temp_table;
CREATE TEMPORARY TABLE temp_table3 LIKE schema1.myisam_table;
connection node_2;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'real_table' AND TABLE_SCHEMA = 'schema1';
COUNT(*) = 1
1
......@@ -38,6 +39,7 @@ COUNT(*) = 0
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'temp_table3' AND TABLE_SCHEMA = 'schema2';
COUNT(*) = 0
1
connection node_1;
DROP TABLE schema1.real_table;
DROP TABLE schema1.myisam_table;
DROP TABLE schema2.real_table1;
......
......@@ -7,6 +7,7 @@ CREATE DEFINER=root@localhost TRIGGER definer_root BEFORE INSERT ON definer_root
CREATE DEFINER=user1 TRIGGER definer_user BEFORE INSERT ON definer_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
CREATE DEFINER=current_user TRIGGER definer_current_user BEFORE INSERT ON definer_current_user FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
CREATE TRIGGER definer_default BEFORE INSERT ON definer_default FOR EACH ROW SET NEW.trigger_user = CURRENT_USER();
connection node_2;
INSERT INTO definer_root (f1) VALUES (1);
SELECT DEFINER = 'root@localhost' FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME = 'definer_root';
DEFINER = 'root@localhost'
......@@ -35,6 +36,7 @@ DEFINER = 'root@localhost'
SELECT trigger_user = 'root@localhost' FROM definer_default;
trigger_user = 'root@localhost'
1
connection node_1;
DROP TABLE definer_current_user;
DROP TABLE definer_user;
DROP TABLE definer_root;
......
connection node_1;
CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
connection node_2;
DELETE FROM t1 ORDER BY RAND() LIMIT 5;
connection node_1;
sum_matches
1
max_matches
......@@ -10,7 +13,9 @@ max_matches
DROP TABLE t1;
CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
connection node_2;
DELETE FROM t2 ORDER BY RAND() LIMIT 5;
connection node_1;
sum_matches
1
max_matches
......
......@@ -8,6 +8,7 @@ START TRANSACTION;
DROP TABLE t1, t2, t3, t4;
INSERT INTO t5 VALUES (1);
COMMIT;
connection node_2;
SHOW CREATE TABLE t1;
ERROR 42S02: Table 'test.t1' doesn't exist
SHOW CREATE TABLE t2;
......@@ -17,4 +18,5 @@ ERROR 42S02: Table 'test.t3' doesn't exist
SHOW CREATE TABLE t4;
ERROR 42S02: Table 'test.t4' doesn't exist
CALL mtr.add_suppression("Slave SQL: Error 'Unknown table 'test.t2,test.t4'' on query\. Default database: 'test'\. Query: 'DROP TABLE t1, t2, t3, t4', Error_code: 1051");
connection node_1;
DROP TABLE t5;
connection node_1;
CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('');
INSERT INTO t1 VALUES ('one'), ('two');
INSERT INTO t1 VALUES (0), (1), (2);
Warnings:
Warning 1265 Data truncated for column 'f1' at row 1
connection node_2;
SELECT COUNT(*) = 6 FROM t1;
COUNT(*) = 6
1
......@@ -14,23 +16,30 @@ SELECT COUNT(*) = 2 FROM t1 where f1 = 'one';
COUNT(*) = 2
1
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (''), ('one'), ('two');
connection node_2;
SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
1
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = '';
COUNT(*) = 1
1
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'three' where f1 = '';
connection node_2;
SET AUTOCOMMIt=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'four' where f1 = '';
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 'three';
COUNT(*) = 1
1
......
connection node_1;
CREATE EVENT event1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT 1;
connection node_2;
SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE'
1 1 1 1 1
connection node_1;
ALTER EVENT event1 DISABLE;
connection node_2;
SELECT DEFINER= 'root@localhost', ORIGINATOR = 1, STATUS = 'SLAVESIDE_DISABLED', EVENT_TYPE = 'ONE TIME', ON_COMPLETION = 'NOT PRESERVE' FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
DEFINER= 'root@localhost' ORIGINATOR = 1 STATUS = 'SLAVESIDE_DISABLED' EVENT_TYPE = 'ONE TIME' ON_COMPLETION = 'NOT PRESERVE'
1 1 1 1 1
connection node_2;
SET GLOBAL event_scheduler = ON;
CREATE EVENT event2 ON SCHEDULE AT CURRENT_TIMESTAMP ON COMPLETION NOT PRESERVE DO SELECT 1;
connection node_1;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event2';
COUNT(*) = 0
1
connection node_1;
DROP EVENT event1;
connection node_2;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME = 'event1';
COUNT(*) = 0
1
connection node_2;
SET GLOBAL event_scheduler = OFF;;
......@@ -18,7 +18,9 @@ ON DELETE CASCADE
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
connection node_2;
DELETE FROM grandparent WHERE id = 1;
connection node_1;
SELECT COUNT(*) = 0 FROM parent WHERE grandparent_id = 1;
COUNT(*) = 0
1
......
......@@ -18,7 +18,9 @@ ON UPDATE CASCADE
INSERT INTO grandparent VALUES (1),(2);
INSERT INTO parent VALUES (1,1), (2,2);
INSERT INTO child VALUES (1,1), (2,2);
connection node_2;
UPDATE grandparent SET id = 3 WHERE id = 1;
connection node_1;
SELECT COUNT(*) = 1 FROM parent WHERE grandparent_id = 3;
COUNT(*) = 1
1
......
......@@ -10,13 +10,17 @@ REFERENCES parent(id)
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (2);
INSERT INTO child VALUES (1,1);
connection node_1;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
DELETE FROM parent WHERE id = 2;
connection node_2;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO child VALUES (2, 2);
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE child;
......
......@@ -13,11 +13,14 @@ ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1, 2);
INSERT INTO child VALUES (1, 1);
connection node_2;
UPDATE parent SET id1 = 3 WHERE id1 = 1;
connection node_1;
SELECT COUNT(*) = 1 FROM child WHERE parent_id1 = 3;
COUNT(*) = 1
1
DELETE FROM parent WHERE id1 = 3;
connection node_2;
SELECT COUNT(*) = 0 FROM child WHERE parent_id1 = 3;
COUNT(*) = 0
1
......
......@@ -17,7 +17,9 @@ ON UPDATE CASCADE
INSERT INTO t0 VALUES (0, 0);
INSERT INTO t1 VALUES (0);
INSERT INTO t2 VALUES (0);
connection node_2;
UPDATE t0 SET f1 = 1, f2 = 2;
connection node_1;
SELECT f1 = 1 FROM t1 WHERE f1 = 1;
f1 = 1
1
......
......@@ -11,7 +11,9 @@ ON DELETE CASCADE
INSERT INTO t0 VALUES (0), (1);
INSERT INTO t1 VALUES (0, 0);
INSERT INTO t1 VALUES (1, 0);
connection node_2;
DELETE t0.*, t1.* FROM t0, t1 WHERE t0.f0 = 0 AND t1.f1 = 0;
connection node_1;
SELECT COUNT(*) = 1 FROM t0;
COUNT(*) = 1
1
......
......@@ -12,11 +12,14 @@ ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1), (1), (2), (2);
INSERT INTO child VALUES (1,1), (2,2), (1,1), (2,2);
connection node_2;
DELETE FROM parent WHERE id = 1;
SELECT COUNT(*) = 0 FROM child WHERE id = 1;
COUNT(*) = 0
1
connection node_1;
UPDATE parent SET id = 3 WHERE id = 2;
connection node_2;
SELECT COUNT(*) = 0 FROM child WHERE parent_id = 1;
COUNT(*) = 0
1
......
......@@ -6,7 +6,9 @@ REFERENCES t1(f1)
ON DELETE CASCADE
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 1), (2, 1);
connection node_2;
DELETE FROM t1 WHERE f1 = 1;
connection node_1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
......
......@@ -12,10 +12,12 @@ ON DELETE SET NULL
) ENGINE=InnoDB;
INSERT INTO parent VALUES (1),(2);
INSERT INTO child VALUES (1,1),(2,2);
connection node_2;
DELETE FROM parent WHERE id = 1;
SELECT parent_id IS NULL FROM child WHERE id = 1;
parent_id IS NULL
1
connection node_1;
SELECT parent_id IS NULL FROM child WHERE id = 1;
parent_id IS NULL
1
......@@ -23,8 +25,10 @@ UPDATE parent SET id = 3 WHERE id = 2;
SELECT parent_id IS NULL FROM child WHERE id = 2;
parent_id IS NULL
1
connection node_2;
SELECT parent_id IS NULL FROM child WHERE id = 2;
parent_id IS NULL
1
connection node_1;
DROP TABLE child;
DROP TABLE parent;
connection node_1;
RESET MASTER;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
......@@ -40,4 +41,6 @@ GRANT ALL PRIVILEGES ON `testdb_9401`.`t1` TO 'dummy'@'localhost'
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE testdb_9401;
disconnect node_2;
disconnect node_1;
# End of tests
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
FLUSH TABLES WITH READ LOCK;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
SHOW TABLES;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1;
......
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SET GLOBAL wsrep_provider_options = 'gcs.fc_limit=1';
FLUSH TABLES WITH READ LOCK;
connection node_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
connection node_1a;
connection node_2;
UNLOCK TABLES;
connection node_1;
INSERT INTO t1 VALUES (6);
connection node_2;
SELECT COUNT(*) = 6 FROM t1;
COUNT(*) = 6
1
......
CREATE TABLE t1 (f1 INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
UPDATE t1 SET f1 = 2;
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 2;
COUNT(*) = 1
1
......
SET GLOBAL wsrep_sync_wait = 7;
connection node_2;
SET GLOBAL wsrep_sync_wait = 7;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT IGNORE INTO t1 VALUES (1), (2);
......@@ -9,10 +11,12 @@ SELECT * FROM t1;
f1
1
2
connection node_2;
SELECT * FROM t1;
f1
1
2
connection node_2;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t2 VALUES (0), (2), (3);
INSERT IGNORE INTO t1 SELECT f1 FROM t2;
......@@ -24,14 +28,17 @@ f1
1
2
3
connection node_1;
SELECT * FROM t1;
f1
0
1
2
3
connection node_2;
CREATE TABLE t3 (f1 INTEGER UNIQUE) Engine=InnoDB;
INSERT INTO t3 VALUES (NULL);
connection node_1;
INSERT IGNORE INTO t3 VALUES (1), (NULL), (2);
SELECT * FROM t3;
f1
......@@ -39,6 +46,7 @@ NULL
NULL
1
2
connection node_2;
SELECT * FROM t3;
f1
NULL
......@@ -46,6 +54,7 @@ NULL
1
2
SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
connection node_1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
......
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2);
connection node_2;
INSERT INTO t1 VALUES (3),(4);
connection node_1;
SELECT COUNT(*) = 4 FROM t1;
COUNT(*) = 4
1
connection node_2;
SELECT COUNT(*) = 4 FROM t1;
COUNT(*) = 4
1
DROP TABLE t1;
connection node_2;
CREATE TABLE t1 (f1 INTEGER, KEY (f1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(1);
connection node_1;
INSERT INTO t1 VALUES (2),(2);
connection node_2;
SELECT COUNT(*) = 4 FROM t1;
COUNT(*) = 4
1
connection node_1;
SELECT COUNT(*) = 4 FROM t1;
COUNT(*) = 4
1
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (1), (2);
connection node_2;
SET AUTOCOMMIT = OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (2), (1);
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ROLLBACK;
INSERT INTO t1 VALUES (1), (2);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1), (2);
connection node_2;
START TRANSACTION;
INSERT INTO t1 VALUES (2), (1);
connection node_1;
ROLLBACK;
connection node_2;
COMMIT;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
connection node_1;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
......
connection node_1;
Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
......
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
connection node_2;
Killing server ...
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_2;
connection node_2a;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='t1';
COUNT(*) = 2
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_1;
DROP TABLE t1;
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
connection node_2;
Killing server ...
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
connection node_2a;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_1;
DROP TABLE t1;
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
LOCK TABLE t1 READ;
connection node_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2a;
SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
......@@ -10,6 +13,7 @@ COUNT(*) = 0
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
connection node_2;
UNLOCK TABLES;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
......
......@@ -3,12 +3,14 @@ INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (id INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT COUNT(*) = 2 FROM t2;
COUNT(*) = 2
1
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
FLUSH LOGS;
SHOW BINLOG EVENTS IN 'mysqld-bin.000002' LIMIT 4,18;
......@@ -31,6 +33,7 @@ mysqld-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
mysqld-bin.000002 # Xid # # COMMIT /* xid=# */
mysqld-bin.000002 # Gtid # # GTID 0-1-6
mysqld-bin.000002 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
connection node_2;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
......@@ -56,4 +59,5 @@ mysqld-bin.000003 # Gtid # # GTID 0-1-6
mysqld-bin.000003 # Query # # use `test`; ALTER TABLE t1 ADD COLUMN f2 INTEGER
DROP TABLE t1;
DROP TABLE t2;
connection node_1;
RESET MASTER;
......@@ -63,6 +63,7 @@ CREATE UNIQUE INDEX i3 ON t1(f1);
CREATE UNIQUE INDEX i2 ON t1(f1);
CREATE UNIQUE INDEX i1 ON t1(f1);
INSERT INTO t1 VALUES (REPEAT('a', 767));
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......@@ -91,6 +92,7 @@ INSERT INTO t1 VALUES (REPEAT('b', 767));
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
connection node_1;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
......@@ -98,6 +100,7 @@ ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status OK
DELETE FROM t1 WHERE f1 = REPEAT('b', 767);
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT COUNT(*) = 1 FROM t1;
......@@ -108,16 +111,23 @@ ROLLBACK;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
connection node_2;
START TRANSACTION;
SET AUTOCOMMIT=OFF;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
connection node_1;
START TRANSACTION;
connection node_2;
START TRANSACTION;
connection node_1;
UPDATE t1 SET f1 = REPEAT('e', 767);
connection node_2;
UPDATE t1 SET f1 = REPEAT('f', 767);
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
......@@ -2,24 +2,32 @@ CREATE TABLE t1 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 CHAR(1));
INSERT INTO t1 VALUES (1, 'a');
INSERT INTO t1 VALUES (2, 'a');
connection node_1;
SET AUTOCOMMIT=ON;
START TRANSACTION;
UPDATE t1 SET f2 = 'b' WHERE f1 = 1;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
LOCK TABLE t2 WRITE;
connection node_1;
SET GLOBAL DEBUG = "d,sync.wsrep_before_mdl_wait";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SELECT * FROM t2;;
connection node_1a;
SET GLOBAL DEBUG = "d,sync.wsrep_after_BF_victim_lock";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
connection node_2;
UPDATE t1 SET f2 = 'c' WHERE f1 = 1;
connection node_1a;
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_before_mdl_wait";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_after_BF_victim_lock";
UNLOCK TABLES;
connection node_1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
......@@ -27,6 +35,7 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'c';
COUNT(*) = 1
1
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f2 = 'a';
COUNT(*) = 1
1
......@@ -35,4 +44,5 @@ COUNT(*) = 1
1
DROP TABLE t1;
DROP TABLE t2;
connection node_1a;
SET DEBUG_SYNC = "RESET";
......@@ -2,13 +2,17 @@ CREATE DATABASE d1;
CREATE TABLE d1.t1(f1 INTEGER) ENGINE=InnoDB;
CREATE DATABASE d2;
CREATE TABLE d2.t1(f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO d1.t1 VALUES (1);
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO d2.t1 VALUES (1);
connection node_1;
COMMIT;
connection node_2;
COMMIT;
SELECT COUNT(*) = 1 FROM d1.t1;
COUNT(*) = 1
......@@ -16,6 +20,7 @@ COUNT(*) = 1
SELECT COUNT(*) = 1 FROM d2.t1;
COUNT(*) = 1
1
connection node_1;
SELECT COUNT(*) = 1 FROM d1.t1;
COUNT(*) = 1
1
......
......@@ -14,6 +14,7 @@ DELETE FROM t1 WHERE f1 = 9;
DELETE FROM t2 WHERE f1 = 9;
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
......
......@@ -7,6 +7,7 @@ START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
COMMIT;
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......@@ -16,12 +17,14 @@ COUNT(*) = 0
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
connection node_1;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......
CREATE TABLE t1 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(0),(b'1');
connection node_2;
SELECT f1 IS NULL, f1 = b'1' FROM t1;
f1 IS NULL f1 = b'1'
1 NULL
......@@ -8,19 +9,24 @@ f1 IS NULL f1 = b'1'
DELETE FROM t1 WHERE f1 = b'1';
UPDATE t1 SET f1 = b'1' WHERE f1 IS NULL;
UPDATE t1 SET f1 = 1 WHERE f1 = b'0';
connection node_1;
SELECT f1 IS NULL, f1 = b'1' FROM t1;
f1 IS NULL f1 = b'1'
0 1
0 1
connection node_1;
CREATE TABLE t2 (f1 BIT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 0 WHERE f1 IS NULL;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 1 WHERE f1 IS NULL;
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
......
CREATE TABLE t1 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),('abc');
connection node_2;
SELECT f1 FROM t1;
f1
NULL
abc
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = 'xyz' WHERE f1 = 'abc';
connection node_1;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT f1 = 'abc' FROM t1;
f1 = 'abc'
0
connection node_1;
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (NULL);
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 IS NULL;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 IS NULL;
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
......
CREATE TABLE t1 (f1 VARCHAR(8000)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (NULL),(CONCAT(REPEAT('x', 7999), 'a'));
connection node_2;
SELECT LENGTH(f1) FROM t1;
LENGTH(f1)
NULL
8000
DELETE FROM t1 WHERE f1 IS NULL;
UPDATE t1 SET f1 = CONCAT(REPEAT('x', 7999), 'b') WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
connection node_1;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......@@ -15,15 +17,19 @@ LENGTH(f1) = 8000
SELECT f1 = CONCAT(REPEAT('x', 7999), 'b') FROM t1;
f1 = CONCAT(REPEAT('x', 7999), 'b')
1
connection node_1;
CREATE TABLE t2 (f1 BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (CONCAT(REPEAT('x', 7999), 'a'));
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'abc' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t2 SET f1 = 'xyz' WHERE f1 = CONCAT(REPEAT('x', 7999), 'a');
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
......
......@@ -3,16 +3,21 @@ f1 VARCHAR(255),
KEY (f1)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('текст');
connection node_2;
SELECT f1 = 'текст' FROM t1;
f1 = 'текст'
1
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст2';
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст3';
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT f1 = 'текст2' FROM t1;
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
CREATE TABLE t2 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET GLOBAL wsrep_slave_threads = 2;
LOCK TABLE t1 READ;
connection node_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
connection node_2a;
SET SESSION wsrep_sync_wait=0;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE STATE LIKE '%applied write set%';
COUNT(*) = 1
......@@ -17,7 +20,9 @@ COUNT(*) = 0
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
connection node_2;
UNLOCK TABLES;
connection node_2a;
SET SESSION wsrep_sync_wait = 7;;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
......
connection node_1;
connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
connection node_2;
Killing server ...
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
......@@ -10,3 +15,4 @@ SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABL
VARIABLE_VALUE = 'ON'
1
SET GLOBAL wsrep_cluster_address = '';
connection node_2;
......@@ -3,23 +3,29 @@ INSERT INTO t1 VALUES
(-9223372036854775808, 'min'),
(9223372036854775807, 'max')
;
connection node_2;
SELECT * FROM t1;
f1 f2
-9223372036854775808 min
9223372036854775807 max
UPDATE t1 SET f2 = CONCAT(f2, '_');
connection node_1;
SELECT * FROM t1;
f1 f2
-9223372036854775808 min_
9223372036854775807 max_
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'foo' WHERE f1 = -9223372036854775808;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'bar' WHERE f1 = -9223372036854775808;
connection node_1;
COMMIT;
SET AUTOCOMMIT=ON;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET AUTOCOMMIT=ON;
......
......@@ -2,21 +2,27 @@ CREATE TABLE t1 (f1 BIGINT UNSIGNED PRIMARY KEY, f2 VARCHAR(5)) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(18446744073709551615, 'max')
;
connection node_2;
SELECT f1 = 18446744073709551615 FROM t1;
f1 = 18446744073709551615
1
UPDATE t1 SET f2 = CONCAT(f2, '_');
connection node_1;
SELECT f1 = 18446744073709551615 FROM t1;
f1 = 18446744073709551615
1
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'foo' WHERE f1 = 18446744073709551615;
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f2 = 'bar' WHERE f1 = 18446744073709551615;
connection node_1;
COMMIT;
SET AUTOCOMMIT=ON;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET AUTOCOMMIT=ON;
......
......@@ -11,6 +11,7 @@ EXECUTE st1;
EXECUTE st2;
EXECUTE st3;
EXECUTE st4;
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......@@ -25,8 +26,10 @@ COUNT(*) = 1
1
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
ALTER TABLE t1 DROP COLUMN f1;
connection node_1;
EXECUTE st1;
ERROR 22007: Incorrect integer value: 'abc' for column 'f2' at row 1
connection node_1;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
RESET QUERY CACHE;
FLUSH STATUS;
SELECT COUNT(*) FROM t1;
......@@ -14,7 +15,9 @@ COUNT(*)
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
VARIABLE_VALUE = 1
1
connection node_1;
INSERT INTO t1 VALUES (2);
connection node_2;
FLUSH STATUS;
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
VARIABLE_VALUE = 0
......@@ -34,7 +37,9 @@ COUNT(*)
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
VARIABLE_VALUE = 1
1
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_2;
FLUSH STATUS;
SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Qcache_queries_in_cache';
VARIABLE_VALUE = 0
......
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET GLOBAL wsrep_provider_options = "repl.causal_read_timeout=PT1S";
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
Warnings:
......@@ -8,7 +9,9 @@ SET SESSION wsrep_sync_wait = 7;
SELECT MAX(id) FROM t1;
MAX(id)
1
connection node_1;
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT MAX(id) FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET GLOBAL DEBUG = "";
......@@ -21,14 +24,18 @@ SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "RESET";
connection node_1;
INSERT INTO t1 VALUES (3);
connection node_2;
SELECT MAX(id) FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_1;
INSERT INTO t1 VALUES (4);
connection node_2;
SET SESSION wsrep_sync_wait = 7;
SELECT MAX(id) FROM t1;
MAX(id)
......@@ -44,13 +51,18 @@ VARIABLE_VALUE = 1
SET GLOBAL DEBUG = "d,sync.wsrep_apply_cb";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
connection node_1;
INSERT INTO t1 VALUES (5);
connection node_2;
SET SESSION wsrep_sync_wait = 7;
SELECT MAX(id) FROM t1 ;
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
SET GLOBAL DEBUG = "";
Warnings:
Warning 1287 '@@debug' is deprecated and will be removed in a future release. Please use '@@debug_dbug' instead
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
MAX(id)
5
SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'Qcache_hits';
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
SET GLOBAL read_only=TRUE;
connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
CREATE USER foo@localhost;
# Open connection to node 2 using 'foo' user.
connect foo_node_2,127.0.0.1,foo,,test,$port_2,;
# Connect with foo_node_2
connection foo_node_2;
INSERT INTO t1 VALUES (2);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......
connection node_1;
SET GLOBAL wsrep_provider_options = 'repl.key_format=FLAT16';
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (123);
CREATE TABLE t2 (f1 VARCHAR(256)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (REPEAT('a', 256));
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
UPDATE t1 SET f1 = 234;
UPDATE t2 SET f1 = REPEAT('b', 256);
connection node_1;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 234;
COUNT(*) = 1
1
......
connection node_1;
CREATE TABLE t1 (f1 VARCHAR(512)) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options = 'repl.max_ws_size=512';
INSERT INTO t1 VALUES (REPEAT('a', 512));
......
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
connection node_2a;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......
......@@ -3,6 +3,7 @@
#
# On node_1
connection node_1;
CREATE DATABASE test1;
CREATE TABLE test1.t1 (a int, b int);
CREATE TABLE test1.t2 (a int, b int);
......@@ -18,8 +19,11 @@ GRANT EXECUTE ON PROCEDURE test1.pr1 TO role1;
GRANT SELECT ON test1.t1 TO role1;
GRANT SELECT (a) ON test1.t2 TO role1;
# Open connections to the 2 nodes using 'foo' user.
connect foo_node_1,127.0.0.1,foo,,test,$port_1,;
connect foo_node_2,127.0.0.1,foo,,test,$port_2,;
# Connect with foo_node_1
connection foo_node_1;
SHOW GRANTS;
Grants for foo@localhost
GRANT role1 TO 'foo'@'localhost'
......@@ -55,6 +59,7 @@ pr1
pr1
# Connect with foo_node_2
connection foo_node_2;
SHOW GRANTS;
Grants for foo@localhost
GRANT role1 TO 'foo'@'localhost'
......@@ -93,13 +98,16 @@ pr1
#
#
# Connect with node_1
connection node_1;
REVOKE EXECUTE ON PROCEDURE test1.pr1 FROM role1;
# Connect with foo_node_1
connection foo_node_1;
CALL test1.pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test1.pr1'
# Connect with foo_node_2
connection foo_node_2;
CALL test1.pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test1.pr1'
#
......@@ -107,9 +115,11 @@ ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test1
#
# Connect with node_1
connection node_1;
DROP ROLE role1;
# Connect with foo_node_1
connection foo_node_1;
FLUSH TABLES;
SELECT * FROM mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
......@@ -131,6 +141,7 @@ CURRENT_ROLE()
role1
# Connect with foo_node_2
connection foo_node_2;
FLUSH TABLES;
SELECT * FROM mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
......@@ -150,7 +161,11 @@ NULL
SELECT CURRENT_ROLE();
CURRENT_ROLE()
role1
disconnect foo_node_2;
# Connect with node_1
connection node_1;
DROP USER foo@localhost;
DROP DATABASE test1;
disconnect node_2;
disconnect node_1;
# End of test
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 VALUES (1), (1);
connection node_2;
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 ADD PRIMARY KEY (f1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
......@@ -8,6 +9,7 @@ SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME =
COUNT(*) = 0
1
INSERT INTO t1 VALUES (1);
connection node_1;
SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME = 't1';
COUNT(*) = 0
1
......@@ -15,6 +17,7 @@ SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
1
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(3) = 4 FROM t1;
COUNT(3) = 4
1
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
connection node_2;
SET SESSION wsrep_OSU_method = "RSU";
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 2
1
connection node_1;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 1
1
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
INSERT INTO t1 (f1) VALUES (2);
connection node_1;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 1
1
......
connection node_1;
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET GLOBAL wsrep_desync=1;
SET wsrep_OSU_method=RSU;
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
SET GLOBAL wsrep_desync=0;
SET DEBUG_SYNC= 'now SIGNAL continue';
connection node_1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -17,6 +21,7 @@ wsrep_desync OFF
SET wsrep_OSU_method=TOI;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
connection node_1;
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
SET GLOBAL wsrep_desync=0;
Warnings:
......@@ -24,10 +29,12 @@ Warning 1231 'wsrep_desync' is already OFF.
SET wsrep_OSU_method=RSU;
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
connection node_1a;
SET GLOBAL wsrep_desync=1;
ERROR HY000: Operation 'desync' failed for SET GLOBAL wsrep_desync=1
SET GLOBAL wsrep_desync=0;
SET DEBUG_SYNC= 'now SIGNAL continue';
connection node_1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -39,4 +46,5 @@ DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
CALL mtr.add_suppression("Protocol violation");
CALL mtr.add_suppression("desync failed");
connection node_2;
CALL mtr.add_suppression("Protocol violation");
connection node_1;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
......@@ -7,8 +8,10 @@ SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
DROP TABLE t1;
connection node_1;
SET GLOBAL binlog_format = 'ROW';
connection node_1;
SET SESSION binlog_format = 'STATEMENT';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: STATEMENT
......@@ -7,8 +8,10 @@ SET SESSION binlog_format = 'MIXED';
Warnings:
Warning 1105 MariaDB Galera does not support binlog format: MIXED
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
DROP TABLE t1;
connection node_1;
SET GLOBAL binlog_format = 'ROW';
connection node_1;
CREATE TABLE t1 (id INT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
SET AUTOCOMMIT=OFF;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
START TRANSACTION;
SELECT * FROM t1;
id f2
connection node_2;
INSERT INTO t1 VALUES (1,1);
connection node_1;
SELECT * FROM t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ROLLBACK;
DELETE FROM t1;
connection node_1;
INSERT INTO t1 VALUES (1,1);
START TRANSACTION;
SELECT * FROM t1;
id f2
1 1
connection node_2;
UPDATE t1 SET f2 = 2;
connection node_1;
UPDATE t1 SET f2 = 3;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ROLLBACK;
DELETE FROM t1;
connection node_1;
START TRANSACTION;
connection node_1;
INSERT INTO t1 VALUES (1,1);
connection node_2;
INSERT INTO t1 VALUES (1,2);
connection node_1;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
DROP TABLE t1;
connection node_1;
# On node_1
CREATE SERVER s1
FOREIGN DATA WRAPPER mysql
OPTIONS (HOST 'foo');
connection node_2;
# On node_2
SELECT * FROM mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
s1 foo 3306 mysql
ALTER SERVER s1
OPTIONS (HOST 'bar');
connection node_1;
# On node_1
SELECT * FROM mysql.servers;
Server_name Host Db Username Password Port Socket Wrapper Owner
s1 bar 3306 mysql
DROP SERVER s1;
connection node_2;
# On node_2
SELECT COUNT(*)=0 FROM mysql.servers;
COUNT(*)=0
1
disconnect node_2;
disconnect node_1;
# End of test
call mtr.add_suppression("WSREP: TO isolation failed for: ");
connection node_1;
connection node_1;
connection node_2;
connection node_2;
Killing server ...
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SET GLOBAL wsrep_cluster_address = '';
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
......@@ -3,10 +3,12 @@ SET SESSION sql_log_bin = 0;
INSERT INTO t1 VALUES (1);
SET SESSION sql_log_bin = 1;
INSERT INTO t1 VALUES (2);
connection node_2;
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = 1;
COUNT(*) = 1
1
connection node_1;
DROP TABLE t1;
......@@ -6,6 +6,7 @@ VARIABLE_VALUE = 2
1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
......
......@@ -4,19 +4,23 @@ VARIABLE_VALUE = 'Synced'
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_2;
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
connection node_1;
SET GLOBAL wsrep_provider_options = "socket.ssl_compression=No";
ERROR HY000: Incorrect arguments to SET
CREATE TABLE t1 (f1 VARCHAR(333) PRIMARY KEY, f2 BLOB) Engine=InnoDB;
INSERT INTO t1 VALUES (REPEAT('a', 333), REPEAT('b', 65535));
connection node_2;
SELECT COUNT(*) = 1 FROM t1 WHERE f1 = REPEAT('a', 333) AND f2 = REPEAT('b', 65535);
COUNT(*) = 1
1
connection node_1;
DROP TABLE t1;
CALL mtr.add_suppression("Unknown parameter 'socket\.ssl_compression'");
CALL mtr.add_suppression("Set options returned 7");
connection node_1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status';
VARIABLE_VALUE = 'Primary'
1
connection node_2;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
......
connection node_1;
CREATE TABLE wsrep_local_indexes (wsrep_local_index INTEGER);
INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
connection node_2;
INSERT INTO wsrep_local_indexes VALUES ((SELECT variable_value FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE variable_name = 'wsrep_local_index'));
connection node_1;
SELECT COUNT(*) = 2 FROM wsrep_local_indexes;
COUNT(*) = 2
1
......
connection node_1;
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
disconnect node_2;
connection node_1;
Suspending node_2 ...
INSERT INTO t1 VALUES (1);
Got one of the listed errors
Resuming node_2 ...
INSERT INTO t1 VALUES (1);
connection node_2a;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
......
connection node_2;
SET SESSION wsrep_sync_wait = 1;
connection node_1;
CREATE DATABASE db1;
connection node_2;
SHOW CREATE DATABASE db1;
Database Create Database
db1 CREATE DATABASE `db1` /*!40100 DEFAULT CHARACTER SET latin1 */
DROP DATABASE db1;
connection node_1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
connection node_2;
SHOW CREATE PROCEDURE p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 FROM DUAL latin1 latin1_swedish_ci latin1_swedish_ci
DROP PROCEDURE p1;
connection node_1;
CREATE PROCEDURE p1 () SELECT 1 FROM DUAL;
connection node_2;
SHOW PROCEDURE CODE p1;
Pos Instruction
0 stmt 0 "SELECT 1 FROM DUAL"
DROP PROCEDURE p1;
connection node_1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
connection node_2;
SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 123 latin1 latin1_swedish_ci latin1_swedish_ci
DROP FUNCTION f1;
connection node_1;
CREATE FUNCTION f1 () RETURNS INTEGER RETURN 123;
connection node_2;
SHOW FUNCTION CODE f1;
Pos Instruction
0 freturn 3 123
DROP FUNCTION f1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a';
connection node_2;
SHOW CREATE TRIGGER tr1;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
tr1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER tr1 BEFORE INSERT ON t1 FOR EACH ROW SET NEW.f1 = 'a' latin1 latin1_swedish_ci latin1_swedish_ci
DROP TABLE t1;
connection node_1;
CREATE EVENT event1 ON SCHEDULE AT '2038-01-01 23:59:59' DO SELECT 1;
connection node_2;
SHOW CREATE EVENT event1;
Event sql_mode time_zone Create Event character_set_client collation_connection Database Collation
event1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION SYSTEM CREATE DEFINER=`root`@`localhost` EVENT `event1` ON SCHEDULE AT '2038-01-01 23:59:59' ON COMPLETION NOT PRESERVE DISABLE ON SLAVE DO SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
......
connection node_1;
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
connection node_2;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
ALTER TABLE t1 AUTO_INCREMENT = 1000;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
connection node_1;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20
1 1 1
connection node_2;
SELECT MIN(f1) >= 1000, COUNT(*) = 20, COUNT(DISTINCT f1) = 20 FROM t1 WHERE f1 >= 1000;
MIN(f1) >= 1000 COUNT(*) = 20 COUNT(DISTINCT f1) = 20
1 1 1
connection node_1;
ALTER TABLE t1 AUTO_INCREMENT = 5;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
connection node_2;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40
1 1 1
connection node_1;
SELECT MIN(f1) >= 1000, COUNT(*) = 40, COUNT(DISTINCT f1) = 40 FROM t1 WHERE f1 >= 1000;
MIN(f1) >= 1000 COUNT(*) = 40 COUNT(DISTINCT f1) = 40
1 1 1
DROP TABLE t1;
connection node_1;
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
connection node_2;
SET GLOBAL wsrep_auto_increment_control = OFF;
SET GLOBAL auto_increment_increment = 1;
SET GLOBAL auto_increment_offset = 1;
connection node_1a;
CREATE TABLE t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER) ENGINE=InnoDB;
connection node_2a;
ALTER TABLE t1 AUTO_INCREMENT=100;
connection node_1a;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
connection node_2a;
INSERT INTO t1 (f2) SELECT 1 FROM ten;
SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20
1 1 1 1
connection node_1a;
SELECT MIN(f1) = 100, MAX(f1) = 119, COUNT(f1) = 20, COUNT(DISTINCT f1) = 20 FROM t1;
MIN(f1) = 100 MAX(f1) = 119 COUNT(f1) = 20 COUNT(DISTINCT f1) = 20
1 1 1 1
......
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE t2 (f1 INTEGER) ENGINE=InnoDB;
connection node_1;
SET DEBUG_SYNC = 'alter_table_before_open_tables WAIT_FOR continue';
ALTER TABLE t1 ADD COLUMN f2 INTEGER;;
connection node_1a;
SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
......@@ -15,6 +17,7 @@ SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
COMMIT;;
connection node_1b;
SET SESSION wsrep_sync_wait = 0;
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO = 'Commit';
COUNT(*) = 1
......@@ -23,19 +26,24 @@ SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
SET DEBUG_SYNC= 'now SIGNAL continue';
connection node_1a;
connection node_1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM t2;
COUNT(*) = 1
1
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM t2;
COUNT(*) = 1
1
connection node_1;
SET DEBUG_SYNC= 'RESET';
connection node_1b;
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
DROP TABLE t2;
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY AUTO_INCREMENT, f2 INTEGER);
connection node_2;
ALTER TABLE t1 ADD COLUMN f3 INTEGER; INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 123);;
connection node_1;
CREATE UNIQUE INDEX i1 ON t1(f2);;
connection node_2;
INSERT INTO t1 (f1, f2) VALUES (DEFAULT, 234);
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 3
......@@ -11,6 +14,7 @@ COUNT(*) = 2
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
connection node_1;
SELECT COUNT(*) = 3 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 't1';
COUNT(*) = 3
1
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
INSERT INTO t1 VALUES (2, 3);
connection node_1;
ALTER TABLE t1 DROP COLUMN f2;
INSERT INTO t1 VALUES (4);
connection node_2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......@@ -18,6 +21,7 @@ f1
1
2
4
connection node_1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
connection node_2;
FLUSH TABLES WITH READ LOCK;
connection node_1;
ALTER TABLE t1 ADD COLUMN f2 INTEGER;
connection node_2;
UNLOCK TABLES;
SHOW CREATE TABLE t1;
Table Create Table
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (2);
connection node_2a;
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=EXCLUSIVE;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
connection node_1;
INSERT INTO t1 VALUES (2, 2);
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
connection node_2;
INSERT INTO t1 VALUES (3, 3);
SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
......
CREATE TABLE t1 (id INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
ALTER TABLE t1 ADD COLUMN f2 INTEGER, LOCK=SHARED;
connection node_1;
INSERT INTO t1 VALUES (2, 2);
SELECT COUNT(*) = 2 FROM t1;
COUNT(*) = 2
1
connection node_2;
INSERT INTO t1 VALUES (3, 3);
SELECT COUNT(*) = 3 FROM t1;
COUNT(*) = 3
......
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_2;
CREATE TABLE t2 (f1 VARCHAR(255)) Engine=InnoDB;
INSERT INTO t2 VALUES ('abc');
connection node_1;
TRUNCATE TABLE t2;
connection node_2;
SELECT COUNT(*) = 0 FROM t2;
COUNT(*) = 0
1
connection node_1;
CREATE TABLE t3 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB;
INSERT INTO t3 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
CREATE TABLE t4 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY) Engine=InnoDB AUTO_INCREMENT=1234;
INSERT INTO t4 VALUES (DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT),(DEFAULT);
TRUNCATE TABLE t3;
TRUNCATE TABLE t4;
connection node_2;
SELECT AUTO_INCREMENT = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME IN ('t3', 't4');
AUTO_INCREMENT = 1
1
......
......@@ -4,8 +4,10 @@ TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_2;
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
connection node_1;
DROP TABLE t1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
......@@ -21,12 +23,14 @@ TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_2;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
SELECT f1 = 1 FROM t1;
f1 = 1
1
connection node_1;
DROP TABLE t1;
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
......@@ -38,18 +42,23 @@ TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_2;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_1;
DROP TABLE t1;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
CREATE TEMPORARY TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (2);
connection node_2;
TRUNCATE TABLE t1;
SELECT COUNT(*) = 0 FROM t1;
COUNT(*) = 0
1
connection node_1;
SELECT f1 = 2 FROM t1;
f1 = 2
1
......
SET GLOBAL wsrep_sync_wait = 7;
connection node_2;
SET GLOBAL wsrep_sync_wait = 7;
connection node_1;
CREATE DATABASE `database with space`;
USE `database with space`;
CREATE TABLE `table with space` (
......@@ -24,6 +26,7 @@ CREATE TABLE `втора таблица` (
KEY `първи индекс` (`първа колона`)
);
INSERT INTO `втора таблица` VALUES (1, 1);
connection node_2;
USE `database with space`;
SELECT `second column with space` FROM `table with space`;
second column with space
......@@ -37,6 +40,7 @@ SELECT `втора колона` FROM `втора таблица`;
втора колона
1
SET GLOBAL wsrep_sync_wait = (SELECT @@wsrep_sync_wait);
connection node_1;
DROP TABLE `database with space`.`table with space`;
DROP TABLE `база`.`таблица`;
DROP TABLE `втора база`.`втора таблица`;
......
......@@ -2,16 +2,21 @@ CREATE TABLE t1 (
f1 VARCHAR(255) PRIMARY KEY
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1 VALUES ('текст');
connection node_2;
SELECT f1 = 'текст' FROM t1;
f1 = 'текст'
1
connection node_1;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст2';
connection node_2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
UPDATE t1 SET f1 = 'текст3';
connection node_1;
COMMIT;
connection node_2;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
SELECT f1 = 'текст2' FROM t1;
......@@ -20,11 +25,15 @@ f1 = 'текст2'
SELECT f1 = 'текст2' FROM t1 WHERE f1 = 'текст2';
f1 = 'текст2'
1
connection node_2;
START TRANSACTION;
INSERT INTO t1 VALUES ('текст4');
connection node_1;
START TRANSACTION;
INSERT INTO t1 VALUES ('текст4');
connection node_2;
COMMIT;
connection node_1;
COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
......
connection node_1;
CREATE TABLE ten (f1 INTEGER) Engine=InnoDB;
INSERT INTO ten VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 SELECT f1 FROM ten ORDER BY RAND();
connection node_2;
UPDATE IGNORE t1 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
connection node_1;
sum_matches
1
max_matches
......@@ -10,7 +13,9 @@ max_matches
DROP TABLE t1;
CREATE TABLE t2 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t2 SELECT f1 FROM ten ORDER BY RAND();
connection node_2;
UPDATE IGNORE t2 SET f1 = FLOOR(1 + (RAND() * 10)) ORDER BY RAND() LIMIT 5;
connection node_1;
sum_matches
1
DROP TABLE t2;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment