0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-16 11:28:45 +00:00
libsql/libsql-wal/tests/assets/fixtures/tkt-b1d3a2e531.test
ad hoc ad79ef48a2
libsql wal tests (#1408)
* add tests

* add bench
2024-05-24 13:59:17 +00:00

67 lines
1.3 KiB
Plaintext

PRAGMA foreign_keys = ON
CREATE TABLE pp(x PRIMARY KEY);
CREATE TABLE cc(y REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
INSERT INTO pp VALUES('abc');
INSERT INTO cc VALUES('abc');
BEGIN;
DROP TABLE pp;
DROP TABLE cc;
COMMIT;
CREATE TABLE pp(x PRIMARY KEY);
CREATE TABLE cc(y REFERENCES pp DEFERRABLE INITIALLY DEFERRED);
INSERT INTO pp VALUES('abc');
INSERT INTO cc VALUES('abc');
BEGIN;
DROP TABLE cc;
DROP TABLE pp;
COMMIT;
CREATE TABLE pp(x PRIMARY KEY);
CREATE TABLE cc(
y INTEGER PRIMARY KEY REFERENCES pp DEFERRABLE INITIALLY DEFERRED
);
INSERT INTO pp VALUES(5);
INSERT INTO cc VALUES(5);
BEGIN;
DROP TABLE pp;
DROP TABLE cc;
COMMIT;
CREATE TABLE pp(x PRIMARY KEY);
CREATE TABLE cc(
y INTEGER PRIMARY KEY REFERENCES pp DEFERRABLE INITIALLY DEFERRED
);
INSERT INTO pp VALUES(5);
INSERT INTO cc VALUES(5);
BEGIN;
DROP TABLE cc;
DROP TABLE pp;
COMMIT;
CREATE TABLE pp1(x PRIMARY KEY);
CREATE TABLE cc1(y REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED);
CREATE TABLE pp2(x PRIMARY KEY);
CREATE TABLE cc2(y REFERENCES pp1 DEFERRABLE INITIALLY DEFERRED);
INSERT INTO pp1 VALUES(2200);
INSERT INTO cc1 VALUES(NULL);
INSERT INTO pp2 VALUES(2200);
INSERT INTO cc2 VALUES(2200);