1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#
# Test wsrep_certify_nonPK = OFF
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--let $wsrep_certify_nonPK_orig = `SELECT @@wsrep_certify_nonPK`
SET GLOBAL wsrep_certify_nonPK = OFF;
--connection node_2
SET GLOBAL wsrep_certify_nonPK = OFF;
--connection node_1
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB /* Table has no primary key */;
CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
# All DML without a PK is rejected with an error
--error ER_LOCK_DEADLOCK,ER_ERROR_DURING_COMMIT
INSERT INTO t1 VALUES (1), (2);
# DML with a PK is allowed to proceed
INSERT INTO t2 VALUES (1), (2);
UPDATE t2 SET f1 = 3 WHERE f1 = 1;
--connection node_2
SELECT COUNT(*) = 0 FROM t1;
SELECT COUNT(*) = 2 FROM t2;
SELECT COUNT(*) = 1 FROM t2 WHERE f1 = 3;
--connection node_1
--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
--connection node_2
--eval SET GLOBAL wsrep_certify_nonPK = $wsrep_certify_nonPK_orig
DROP TABLE t1;
DROP TABLE t2;
--connection node_1
call mtr.add_suppression("SQL statement was ineffective");
--source include/galera_end.inc
|