blob: b626d963af8001ca2a4fb3ef80d5888947a29d87 (
plain)
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
|
connection node_2;
connection node_1;
CREATE TABLE t0 (
f1 INT PRIMARY KEY,
f2 INT UNIQUE
);
CREATE TABLE t1 (
f1 INT PRIMARY KEY,
FOREIGN KEY (f1)
REFERENCES t0(f1)
ON UPDATE CASCADE
);
CREATE TABLE t2 (
f2 INT PRIMARY KEY,
FOREIGN KEY (f2)
REFERENCES t0(f2)
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
SELECT f2 = 2 FROM t2 WHERE f2 = 2;
f2 = 2
1
SELECT f1 = 1 FROM t1;
f1 = 1
1
SELECT f2 = 2 FROM t2;
f2 = 2
1
DROP TABLE t2;
DROP TABLE t1;
DROP TABLE t0;
|