| 1 |
|
| 2 |
# Bug#12728221 - MULTI-TABLE DELETE ON UNIQUE INDEX REMOVES WRONG ROWS IN CLUSTER |
| 3 |
|
| 4 |
CREATE TABLE t1 ( |
| 5 |
a int(11) NOT NULL, |
| 6 |
b int(11) DEFAULT NULL, |
| 7 |
c varchar(64) DEFAULT NULL, |
| 8 |
PRIMARY KEY (a), |
| 9 |
UNIQUE KEY c (c), |
| 10 |
KEY b (b) |
| 11 |
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; |
| 12 |
Warnings: |
| 13 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 14 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 15 |
CREATE TABLE t2 ( |
| 16 |
a int(11) NOT NULL, |
| 17 |
b text, |
| 18 |
PRIMARY KEY (a) |
| 19 |
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; |
| 20 |
Warnings: |
| 21 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 22 |
INSERT INTO t1 VALUES (1,3,'test3'),(2,2,'test2'),(3,1,'test1'); |
| 23 |
INSERT INTO t2 VALUES (1,''),(2,''),(3,''); |
| 24 |
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.c='test1'; |
| 25 |
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.c='test2'; |
| 26 |
delete t1,t2 from t1,t2 where t1.b=t2.a and t1.c='test3'; |
| 27 |
select * from t1,t2; |
| 28 |
a b c a b |
| 29 |
drop table t1,t2; |
| 30 |
|
| 31 |
# Bug#12718336 - 61705: TRIGGER WORKS IMPROPERLY IN MYSQL CLUSTER. |
| 32 |
|
| 33 |
CREATE TABLE t1 (a int(11) NOT NULL, b int(11) DEFAULT NULL, c |
| 34 |
varchar(64) DEFAULT NULL, d char(10), j int, PRIMARY KEY (a), |
| 35 |
UNIQUE KEY c (c), KEY b (b)) ENGINE=ndbcluster DEFAULT |
| 36 |
CHARSET=latin1; |
| 37 |
Warnings: |
| 38 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 39 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 40 |
CREATE TABLE t2 ( e int(11) NOT NULL, f char(10), PRIMARY KEY |
| 41 |
(e)) ENGINE=ndbcluster DEFAULT CHARSET=latin1; |
| 42 |
Warnings: |
| 43 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 44 |
CREATE TABLE t3 (t3_id int(11) NOT NULL AUTO_INCREMENT,g int(11) |
| 45 |
DEFAULT NULL, h char(10), PRIMARY KEY (t3_id)) ENGINE=ndbcluster |
| 46 |
DEFAULT CHARSET=latin1; |
| 47 |
Warnings: |
| 48 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 49 |
Warning 1681 Integer display width is deprecated and will be removed in a future release. |
| 50 |
CREATE TRIGGER trg1 AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO |
| 51 |
t3(g,h) values (old.b, old.d); |
| 52 |
INSERT INTO t1 VALUES (11,1,'test1', 'hei1',111),(22,2,'test2', |
| 53 |
'hei2',222),(33,3,'test3', 'hei3',333); |
| 54 |
INSERT INTO t2 VALUES (1,'xx'),(2,'yy'),(3,'zz'); |
| 55 |
select * from t1; |
| 56 |
a b c d j |
| 57 |
11 1 test1 hei1 111 |
| 58 |
22 2 test2 hei2 222 |
| 59 |
33 3 test3 hei3 333 |
| 60 |
select * from t2; |
| 61 |
e f |
| 62 |
1 xx |
| 63 |
2 yy |
| 64 |
3 zz |
| 65 |
select * from t3; |
| 66 |
t3_id g h |
| 67 |
update t1,t2 set t1.d=t2.f where t1.b=t2.e and t1.c='test1'; |
| 68 |
select * from t1; |
| 69 |
a b c d j |
| 70 |
11 1 test1 xx 111 |
| 71 |
22 2 test2 hei2 222 |
| 72 |
33 3 test3 hei3 333 |
| 73 |
select * from t2; |
| 74 |
e f |
| 75 |
1 xx |
| 76 |
2 yy |
| 77 |
3 zz |
| 78 |
select * from t3; |
| 79 |
t3_id g h |
| 80 |
1 1 hei1 |
| 81 |
drop table t1,t2,t3; |