Debian Codegraph @

mysql-test/suite/galera/r/galera_enum.result

raw
1 connection node_2;
2 connection node_1;
3 connection node_1;
4 CREATE TABLE t1 (f1 ENUM('', 'one', 'two'), KEY (f1)) ENGINE=InnoDB;
5 INSERT INTO t1 VALUES ('');
6 INSERT INTO t1 VALUES ('one'), ('two');
7 INSERT IGNORE INTO t1 VALUES (0), (1), (2);
8 Warnings:
9 Warning 1265 Data truncated for column 'f1' at row 1
10 connection node_2;
11 SELECT COUNT(*) FROM t1;
12 COUNT(*)
13 6
14 SELECT COUNT(*) FROM t1 where f1 = '';
15 COUNT(*)
16 2
17 SELECT COUNT(*) FROM t1 where f1 = 'one';
18 COUNT(*)
19 2
20 DROP TABLE t1;
21 connection node_1;
22 CREATE TABLE t1 (f1 ENUM('', 'one', 'two', 'three', 'four') PRIMARY KEY) ENGINE=InnoDB;
23 INSERT INTO t1 VALUES (''), ('one'), ('two');
24 connection node_2;
25 SELECT COUNT(*) FROM t1;
26 COUNT(*)
27 3
28 SELECT COUNT(*) FROM t1 WHERE f1 = '';
29 COUNT(*)
30 1
31 connection node_1;
32 SET AUTOCOMMIT=OFF;
33 START TRANSACTION;
34 UPDATE t1 SET f1 = 'three' where f1 = '';
35 connection node_2;
36 SET AUTOCOMMIt=OFF;
37 START TRANSACTION;
38 UPDATE t1 SET f1 = 'four' where f1 = '';
39 connection node_1;
40 COMMIT;
41 connection node_2;
42 COMMIT;
43 ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
44 connection node_1;
45 SELECT COUNT(*) FROM t1 WHERE f1 = 'three';
46 COUNT(*)
47 1
48 SELECT * FROM t1;
49 f1
50 one
51 two
52 three
53 DROP TABLE t1;