mirror of
https://github.com/tursodatabase/libsql.git
synced 2024-12-15 08:39:46 +00:00
ad79ef48a2
* add tests * add bench
37 lines
637 B
Plaintext
37 lines
637 B
Plaintext
|
|
CREATE TABLE w(a);
|
|
CREATE TABLE x(a);
|
|
CREATE TABLE y(a);
|
|
CREATE TABLE z(a);
|
|
|
|
INSERT INTO x(a) VALUES(5);
|
|
INSERT INTO y(a) VALUES(10);
|
|
|
|
CREATE TRIGGER t AFTER INSERT ON w BEGIN
|
|
INSERT INTO z
|
|
SELECT (SELECT x.a + y.a FROM y) FROM x;
|
|
END;
|
|
INSERT INTO w VALUES('incorrect');
|
|
|
|
|
|
SELECT * FROM z;
|
|
|
|
|
|
CREATE TABLE w(a);
|
|
CREATE TABLE x(b);
|
|
CREATE TABLE y(a);
|
|
CREATE TABLE z(a);
|
|
|
|
INSERT INTO x(b) VALUES(5);
|
|
INSERT INTO y(a) VALUES(10);
|
|
|
|
CREATE TRIGGER t AFTER INSERT ON w BEGIN
|
|
INSERT INTO z
|
|
SELECT (SELECT x.b + y.a FROM y) FROM x;
|
|
END;
|
|
INSERT INTO w VALUES('assert');
|
|
|
|
|
|
SELECT * FROM z;
|
|
|