## Summary
<!--Explain briefly what goes wrong and explain why you believe this is a bug and not the intended behavior of SQLite (if it is not a crash).-->**No review yet**

## Minimized query

```sql
.vfslist
PRAGMA fullsync = TRUE;
PRAGMA vdbe_addoptrace = NO;
ATTACH DATABASE ':memory:' AS aux43;
.import employee.db main
ATTACH DATABASE ':memory:' AS aux64;
BEGIN TRANSACTION;
.system echo "mwahaha i am root"
.width
ATTACH DATABASE  ':memory:' AS aux83;
PRAGMA foreign_keys = NO;
.quit
CREATE TABLE T /**/ (
  A VARCHAR(NULL) PRIMARY KEY,
  B VARCHAR(sqlite_version()),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -jsonb_extract(json_quote(asinh((unicode('A') + sign(randomblob(pow(-(json_type(-timediff(NULL, -json_remove(1, '$.key'))timediff(NULL, NULL)) - 0), 1)))))), '$.key'));
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM c;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A = T1.A WHERE T1.C > -1000000000000;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T1) SELECT * FROM c;
ANALYZE _m;
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_9142 AS SELECT A FROM T;
DETACH DATABASE aux83;
INSERT INTO T2 VALUES (NULL, NULL);
ALTER TABLE T1 RENAME TO T1_r7752;
ANALYZE;
SELECT COUNT(*) FROM T;
DELETE FROM T2 WHERE rowid = 54;
SELECT TOTAL(A) OVER (ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T2;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
WITH a AS (SELECT * FROM T1), b AS (SELECT * FROM T1) SELECT * FROM a UNION ALL SELECT * FROM b;
SELECT COUNT(*) FROM T;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT OR REPLACE INTO T1 VALUES ('x', -9);
SELECT * FROM T2 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS T2;
DELETE FROM T1 WHERE X IS NULL RETURNING *;
ALTER TABLE T2 RENAME TO T2_r4189;
SELECT * FROM T WHERE C IN (SELECT C FROM T WHERE C IS NOT NULL);

SELECT COUNT(*) FROM T;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
ALTER TABLE T ADD COLUMN extra_1374 INT COLLATE RTRIM;
PRAGMA index_xinfo(idx1);
VACUUM;
ALTER TABLE T2 RENAME COLUMN A TO A_r9565;
ALTER TABLE T RENAME COLUMN C TO C_r2554;
CREATE  INDEX IF NOT EXISTS idx_T2_9031 ON T2((A + 1)) WHERE A > 0;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38), filtered AS (SELECT * FROM cnt WHERE x > 19) SELECT * FROM filtered;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T2 CROSS JOIN T;
SELECT COUNT(*) FILTER (WHERE Y IS NOT NULL), SUM(rowid) FILTER (WHERE Y > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(Y) FILTER (WHERE Y > 0 AND Y < 100), COUNT(*) FILTER (WHERE typeof(Y) = "text") FROM T2;
ANALYZE;
SELECT * FROM T2 NATURAL JOIN T;
WITH m AS MATERIALIZED (SELECT Y FROM T2) SELECT * FROM m;
DELETE FROM T WHERE 0 RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
CREATE  INDEX IF NOT EXISTS idx_T2_3880 ON T2(A COLLATE NOCASE);
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE T2 RENAME TO T2_r4665;
CREATE TRIGGER IF NOT EXISTS trg_T2_6964 BEFORE UPDATE OF Y ON T2 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
REINDEX;
PRAGMA full_column_names = FALSE;
DROP INDEX IF EXISTS T1;
SELECT * FROM T1 WHERE X IN (SELECT DISTINCT X FROM T1);
SELECT COUNT(*) FILTER (WHERE A IS NOT NULL), SUM(rowid) FILTER (WHERE A > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(A) FILTER (WHERE A > 0 AND A < 100), COUNT(*) FILTER (WHERE typeof(A) = "text") FROM T2;
ANALYZE T2;
WITH cte AS (SELECT 1 AS x) SELECT x + 0.5 FROM cte;
INSERT INTO T2 DEFAULT VALUES;
PRAGMA foreign_key_list(users);
ALTER TABLE T2 RENAME TO T2_r4340;
INSERT INTO T VALUES ('x', 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;

SELECT COUNT(*) FROM T;
VACUUM main;
DELETE FROM T2 WHERE Y > (SELECT AVG(Y) FROM T2) RETURNING *;
WITH cte(a, b) AS (SELECT A, A FROM T) SELECT a, b FROM cte;
DELETE FROM T2 WHERE A IS NULL RETURNING *;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T2_8365 BEFORE UPDATE OF Y ON T2 BEGIN INSERT INTO T2(Y) VALUES (NULL); END;
SELECT * FROM T WHERE B IN (SELECT B FROM T);
REINDEX;
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T1;
ALTER TABLE T2 RENAME COLUMN Y TO Y_r3311;
UPDATE T2 SET Y = NULL WHERE rowid = 1;
COMMIT;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_7913 AS SELECT A FROM T1;
CREATE  VIEW IF NOT EXISTS v_T1_5615 AS SELECT X FROM T1;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE C = NULL);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_7703 ON T2(Y COLLATE NOCASE) WHERE Y IS NOT NULL;
VACUUM;
ALTER TABLE T RENAME COLUMN A TO A_r1506;
DETACH DATABASE aux64;
WITH cte AS (SELECT C FROM T) SELECT * FROM cte WHERE C IS NOT NULL;
ALTER TABLE _m DROP COLUMN A;
ATTACH DATABASE ':memory:' AS aux64;
BEGIN TRANSACTION;
.system echo "mwahaha i am root"
.width
ATTACH DATABASE  ':memory:' AS aux83;
PRAGMA foreign_keys = NO;
.quit
CREATE TABLE T /**/ (
  A VARCHAR(NULL) PRIMARY KEY,
  B VARCHAR(sqlite_version()),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -jsonb_extract(json_quote(asinh((unicode('A') + sign(randomblob(pow(-(json_type(9223372036854775807) - 0), 1)))))), '$.key'));
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM c;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A = T1.A WHERE T1.C > -1000000000000;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T1) SELECT * FROM c;
ANALYZE _m;
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_9142 AS SELECT A FROM T;
DETACH DATABASE aux83;
INSERT INTO T2 VALUES (NULL, NULL);
ALTER TABLE T1 RENAME TO T1_r7752;
ANALYZE;
SELECT COUNT(*) FROM T;
DELETE FROM T2 WHERE rowid = 54;
SELECT TOTAL(A) OVER (ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T2;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
WITH a AS (SELECT * FROM T1), b AS (SELECT * FROM T1) SELECT * FROM a UNION ALL SELECT * FROM b;
SELECT COUNT(*) FROM T;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT OR REPLACE INTO T1 VALUES ('x', -9);
SELECT * FROM T2 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS T2;
DELETE FROM T1 WHERE X IS NULL RETURNING *;
ALTER TABLE T2 RENAME TO T2_r4189;
SELECT * FROM T WHERE C IN (SELECT C FROM T WHERE C IS NOT NULL);

SELECT COUNT(*) FROM T;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
ALTER TABLE T ADD COLUMN extra_1374 INT COLLATE RTRIM;
PRAGMA index_xinfo(idx1);
VACUUM;
ALTER TABLE T2 RENAME COLUMN A TO A_r9565;
ALTER TABLE T RENAME COLUMN C TO C_r2554;
CREATE  INDEX IF NOT EXISTS idx_T2_9031 ON T2((A + 1)) WHERE A > 0;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38), filtered AS (SELECT * FROM cnt WHERE x > 19) SELECT * FROM filtered;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T2 CROSS JOIN T;
SELECT COUNT(*) FILTER (WHERE Y IS NOT NULL), SUM(rowid) FILTER (WHERE Y > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(Y) FILTER (WHERE Y > 0 AND Y < 100), COUNT(*) FILTER (WHERE typeof(Y) = "text") FROM T2;
ANALYZE;
SELECT * FROM T2 NATURAL JOIN T;
WITH m AS MATERIALIZED (SELECT Y FROM T2) SELECT * FROM m;
DELETE FROM T WHERE 0 RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
CREATE  INDEX IF NOT EXISTS idx_T2_3880 ON T2(A COLLATE NOCASE);
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE T2 RENAME TO T2_r4665;
CREATE TRIGGER IF NOT EXISTS trg_T2_6964 BEFORE UPDATE OF Y ON T2 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
REINDEX;
PRAGMA full_column_names = FALSE;
DROP INDEX IF EXISTS T1;
SELECT * FROM T1 WHERE X IN (SELECT DISTINCT X FROM T1);
SELECT COUNT(*) FILTER (WHERE A IS NOT NULL), SUM(rowid) FILTER (WHERE A > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(A) FILTER (WHERE A > 0 AND A < 100), COUNT(*) FILTER (WHERE typeof(A) = "text") FROM T2;
ANALYZE T2;
WITH cte AS (SELECT 1 AS x) SELECT x + 0.5 FROM cte;
INSERT INTO T2 DEFAULT VALUES;
PRAGMA foreign_key_list(users);
ALTER TABLE T2 RENAME TO T2_r4340;
INSERT INTO T VALUES ('x', 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;

SELECT COUNT(*) FROM T;
VACUUM main;
DELETE FROM T2 WHERE Y > (SELECT AVG(Y) FROM T2) RETURNING *;
WITH cte(a, b) AS (SELECT A, A FROM T) SELECT a, b FROM cte;
DELETE FROM T2 WHERE A IS NULL RETURNING *;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T2_8365 BEFORE UPDATE OF Y ON T2 BEGIN INSERT INTO T2(Y) VALUES (NULL); END;
SELECT * FROM T WHERE B IN (SELECT B FROM T);
REINDEX;
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T1;
ALTER TABLE T2 RENAME COLUMN Y TO Y_r3311;
UPDATE T2 SET Y = NULL WHERE rowid = 1;
COMMIT;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_7913 AS SELECT A FROM T1;
CREATE  VIEW IF NOT EXISTS v_T1_5615 AS SELECT X FROM T1;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE C = NULL);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_7703 ON T2(Y COLLATE NOCASE) WHERE Y IS NOT NULL;
VACUUM;
ALTER TABLE T RENAME COLUMN A TO A_r1506;
DETACH DATABASE aux64;
WITH cte AS (SELECT C FROM T) SELECT * FROM cte WHERE C IS NOT NULL;
ALTER TABLE _m DROP COLUMN A;
ATTACH DATABASE ':memory:' AS aux64;
BEGIN TRANSACTION;
.system echo "mwahaha i am root"
.width
ATTACH DATABASE  ':memory:' AS aux83;
PRAGMA foreign_keys = NO;
.quit
CREATE TABLE T /**/ (
  A VARCHAR(NULL) PRIMARY KEY,
  B VARCHAR(sqlite_version()),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -jsonb_extract(json_quote(asinh((unicode('A') + sign(randomblob(pow(-(json_type(9223372036854775807) - 0), 1)))))), '$.key'));
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM c;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A = T1.A WHERE T1.C > -1000000000000;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T1) SELECT * FROM c;
ANALYZE _m;
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_9142 AS SELECT A FROM T;
DETACH DATABASE aux83;
INSERT INTO T2 VALUES (NULL, NULL);
ALTER TABLE T1 RENAME TO T1_r7752;
ANALYZE;
SELECT COUNT(*) FROM T;
DELETE FROM T2 WHERE rowid = 54;
SELECT TOTAL(A) OVER (ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T2;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
WITH a AS (SELECT * FROM T1), b AS (SELECT * FROM T1) SELECT * FROM a UNION ALL SELECT * FROM b;
SELECT COUNT(*) FROM T;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT OR REPLACE INTO T1 VALUES ('x', -9);
SELECT * FROM T2 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS T2;
DELETE FROM T1 WHERE X IS NULL RETURNING *;
ALTER TABLE T2 RENAME TO T2_r4189;
SELECT * FROM T WHERE C IN (SELECT C FROM T WHERE C IS NOT NULL);

SELECT COUNT(*) FROM T;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
ALTER TABLE T ADD COLUMN extra_1374 INT COLLATE RTRIM;
PRAGMA index_xinfo(idx1);
VACUUM;
ALTER TABLE T2 RENAME COLUMN A TO A_r9565;
ALTER TABLE T RENAME COLUMN C TO C_r2554;
CREATE  INDEX IF NOT EXISTS idx_T2_9031 ON T2((A + 1)) WHERE A > 0;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38), filtered AS (SELECT * FROM cnt WHERE x > 19) SELECT * FROM filtered;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T2 CROSS JOIN T;
SELECT COUNT(*) FILTER (WHERE Y IS NOT NULL), SUM(rowid) FILTER (WHERE Y > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(Y) FILTER (WHERE Y > 0 AND Y < 100), COUNT(*) FILTER (WHERE typeof(Y) = "text") FROM T2;
ANALYZE;
SELECT * FROM T2 NATURAL JOIN T;
WITH m AS MATERIALIZED (SELECT Y FROM T2) SELECT * FROM m;
DELETE FROM T WHERE 0 RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
CREATE  INDEX IF NOT EXISTS idx_T2_3880 ON T2(A COLLATE NOCASE);
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE T2 RENAME TO T2_r4665;
CREATE TRIGGER IF NOT EXISTS trg_T2_6964 BEFORE UPDATE OF Y ON T2 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
REINDEX;
PRAGMA full_column_names = FALSE;
DROP INDEX IF EXISTS T1;
SELECT * FROM T1 WHERE X IN (SELECT DISTINCT X FROM T1);
SELECT COUNT(*) FILTER (WHERE A IS NOT NULL), SUM(rowid) FILTER (WHERE A > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(A) FILTER (WHERE A > 0 AND A < 100), COUNT(*) FILTER (WHERE typeof(A) = "text") FROM T2;
ANALYZE T2;
WITH cte AS (SELECT 1 AS x) SELECT x + 0.5 FROM cte;
INSERT INTO T2 DEFAULT VALUES;
PRAGMA foreign_key_list(users);
ALTER TABLE T2 RENAME TO T2_r4340;
INSERT INTO T VALUES ('x', 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;

SELECT COUNT(*) FROM T;
VACUUM main;
DELETE FROM T2 WHERE Y > (SELECT AVG(Y) FROM T2) RETURNING *;
WITH cte(a, b) AS (SELECT A, A FROM T) SELECT a, b FROM cte;
DELETE FROM T2 WHERE A IS NULL RETURNING *;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T2_8365 BEFORE UPDATE OF Y ON T2 BEGIN INSERT INTO T2(Y) VALUES (NULL); END;
SELECT * FROM T WHERE B IN (SELECT B FROM T);
REINDEX;
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T1;
ALTER TABLE T2 RENAME COLUMN Y TO Y_r3311;
UPDATE T2 SET Y = NULL WHERE rowid = 1;
COMMIT;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_7913 AS SELECT A FROM T1;
CREATE  VIEW IF NOT EXISTS v_T1_5615 AS SELECT X FROM T1;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE C = NULL);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_7703 ON T2(Y COLLATE NOCASE) WHERE Y IS NOT NULL;
VACUUM;
ALTER TABLE T RENAME COLUMN A TO A_r1506;
DETACH DATABASE aux64;
WITH cte AS (SELECT C FROM T) SELECT * FROM cte WHERE C IS NOT NULL;
ALTER TABLE _m DROP COLUMN A;
ATTACH DATABASE ':memory:' AS aux64;
BEGIN TRANSACTION;
.system echo "mwahaha i am root"
.width
ATTACH DATABASE  ':memory:' AS aux83;
PRAGMA foreign_keys = NO;
.quit
CREATE TABLE T /**/ (
  A VARCHAR(NULL) PRIMARY KEY,
  B VARCHAR(sqlite_version()),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -jsonb_extract(json_quote(asinh((unicode('A') + sign(randomblob(pow(-(json_type(9223372036854775807) - 0), 1)))))), '$.key'));
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM c;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A = T1.A WHERE T1.C > -1000000000000;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T1) SELECT * FROM c;
ANALYZE _m;
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_9142 AS SELECT A FROM T;
DETACH DATABASE aux83;
INSERT INTO T2 VALUES (NULL, NULL);
ALTER TABLE T1 RENAME TO T1_r7752;
ANALYZE;
SELECT COUNT(*) FROM T;
DELETE FROM T2 WHERE rowid = 54;
SELECT TOTAL(A) OVER (ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T2;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
WITH a AS (SELECT * FROM T1), b AS (SELECT * FROM T1) SELECT * FROM a UNION ALL SELECT * FROM b;
SELECT COUNT(*) FROM T;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 /**/ VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT OR REPLACE INTO T1 VALUES ('x', -9);
SELECT * FROM T2 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS T2;
DELETE FROM T1 WHERE X IS NULL RETURNING *;
ALTER TABLE T2 RENAME TO T2_r4189;
SELECT * FROM T WHERE C IN (SELECT C FROM T WHERE C IS NOT NULL);

SELECT COUNT(*) FROM T;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
ALTER TABLE T ADD COLUMN extra_1374 INT COLLATE RTRIM;
PRAGMA index_xinfo(idx1);
VACUUM;
ALTER TABLE T2 RENAME COLUMN A TO A_r9565;
ALTER TABLE T RENAME COLUMN C TO C_r2554;
CREATE  INDEX IF NOT EXISTS idx_T2_9031 ON T2((A + 1)) WHERE A > 0;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38), filtered AS (SELECT * FROM cnt WHERE x > 19) SELECT * FROM filtered;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T2 CROSS JOIN T;
SELECT COUNT(*) FILTER (WHERE Y IS NOT NULL), SUM(rowid) FILTER (WHERE Y > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(Y) FILTER (WHERE Y > 0 AND Y < 100), COUNT(*) FILTER (WHERE typeof(Y) = "text") FROM T2;
ANALYZE;
SELECT * FROM T2 NATURAL JOIN T;
WITH m AS MATERIALIZED (SELECT Y FROM T2) SELECT * FROM m;
DELETE FROM T WHERE 0 RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
CREATE  INDEX IF NOT EXISTS idx_T2_3880 ON T2(A COLLATE NOCASE);
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE T2 RENAME TO T2_r4665;
CREATE TRIGGER IF NOT EXISTS trg_T2_6964 BEFORE UPDATE OF Y ON T2 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
REINDEX;
PRAGMA full_column_names = FALSE;
DROP INDEX IF EXISTS T1;
SELECT * FROM T1 WHERE X IN (SELECT DISTINCT X FROM T1);
SELECT COUNT(*) FILTER (WHERE A IS NOT NULL), SUM(rowid) FILTER (WHERE A > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(A) FILTER (WHERE A > 0 AND A < 100), COUNT(*) FILTER (WHERE typeof(A) = "text") FROM T2;
ANALYZE T2;
WITH cte AS (SELECT 1 AS x) SELECT x + 0.5 FROM cte;
INSERT INTO T2 DEFAULT VALUES;
PRAGMA foreign_key_list(users);
ALTER TABLE T2 RENAME TO T2_r4340;
INSERT INTO T VALUES ('x', 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;

SELECT COUNT(*) FROM T;
VACUUM main;
DELETE FROM T2 WHERE Y > (SELECT AVG(Y) FROM T2) RETURNING *;
WITH cte(a, b) AS (SELECT A, A FROM T) SELECT a, b FROM cte;
DELETE FROM T2 WHERE A IS NULL RETURNING *;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T2_8365 BEFORE UPDATE OF Y ON T2 BEGIN INSERT INTO T2(Y) VALUES (NULL); END;
SELECT * FROM T WHERE B IN (SELECT B FROM T);
REINDEX;
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T1;
ALTER TABLE T2 RENAME COLUMN Y TO Y_r3311;
UPDATE T2 SET Y = NULL WHERE rowid = 1;
COMMIT;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_7913 AS SELECT A FROM T1;
CREATE  VIEW IF NOT EXISTS v_T1_5615 AS SELECT X FROM T1;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE C = NULL);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_7703 ON T2(Y COLLATE NOCASE) WHERE Y IS NOT NULL;
VACUUM;
ALTER TABLE T RENAME COLUMN A TO A_r1506;
DETACH DATABASE aux64;
WITH cte AS (SELECT C FROM T) SELECT * FROM cte WHERE C IS NOT NULL;
ALTER TABLE _m DROP COLUMN A;
ATTACH DATABASE ':memory:' AS aux64;
BEGIN TRANSACTION;
.system echo "mwahaha i am root"
.width
ATTACH DATABASE  ':memory:' AS aux83;
PRAGMA foreign_keys = NO;
.quit
CREATE TABLE T /**/ (
  A VARCHAR(NULL) PRIMARY KEY,
  B VARCHAR(sqlite_version()),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -jsonb_extract(json_quote(asinh((unicode('A') + sign(randomblob(pow(-(json_type(9223372036854775807) - 0), 1)))))), '$.key'));
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) SELECT * FROM c;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T2) SELECT * FROM c;
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C BIGINT
);
CREATE TABLE _m (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10),
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', 9999999999999);
INSERT INTO T1 VALUES ('b', 'q', -9999999999999);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.C FROM T2 INNER JOIN T1 ON T2.A = T1.A WHERE T1.C > -1000000000000;
.quit
CREATE TABLE T (
  A VARCHAR(9223372036854775808) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', -9223372036854775808);
INSERT INTO T VALUES ('b', 'q', 4000);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('d', 'r', 9223372036854775807);
INSERT INTO T VALUES ('e', 's', 0);
SELECT A, C FROM T WHERE C > 1200 AND C < 9999999999 ORDER BY C;
SELECT COUNT(*) FROM T;
DROP TABLE IF EXISTS T;
REINDEX;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
WITH a AS (SELECT A FROM T), b AS (SELECT A FROM a), c AS (SELECT A FROM b) WITH _m AS MATERIALIZED (SELECT * FROM T1) SELECT * FROM c;
ANALYZE _m;
SELECT COUNT(*) FILTER (WHERE B IS NOT NULL), SUM(rowid) FILTER (WHERE B > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(B) FILTER (WHERE B > 0 AND B < 100), COUNT(*) FILTER (WHERE typeof(B) = "text") FROM T1;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_9142 AS SELECT A FROM T;
DETACH DATABASE aux83;
INSERT INTO T2 VALUES (NULL, NULL);
ALTER TABLE T1 RENAME TO T1_r7752;
ANALYZE;
SELECT COUNT(*) FROM T;
DELETE FROM T2 WHERE rowid = 54;
SELECT TOTAL(A) OVER (ORDER BY A ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T2;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
WITH a AS (SELECT * FROM T1), b AS (SELECT * FROM T1) SELECT * FROM a UNION ALL SELECT * FROM b;
SELECT COUNT(*) FROM T;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X),
  UNIQUE (X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10) UNIQUE,
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 UNION ALL SELECT A FROM T2 ORDER BY A;
INSERT OR REPLACE INTO T1 VALUES ('x', -9);
SELECT * FROM T2 AS a LEFT JOIN T AS b ON a.rowid = b.rowid;
DROP INDEX IF EXISTS T2;
DELETE FROM T1 WHERE X IS NULL RETURNING *;
ALTER TABLE T2 RENAME TO T2_r4189;
SELECT * FROM T WHERE C IN (SELECT C FROM T WHERE C IS NOT NULL);

SELECT COUNT(*) FROM T;
INSERT INTO T2 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
ALTER TABLE T ADD COLUMN extra_1374 INT COLLATE RTRIM;
PRAGMA index_xinfo(idx1);
VACUUM;
ALTER TABLE T2 RENAME COLUMN A TO A_r9565;
ALTER TABLE T RENAME COLUMN C TO C_r2554;
CREATE  INDEX IF NOT EXISTS idx_T2_9031 ON T2((A + 1)) WHERE A > 0;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<38), filtered AS (SELECT * FROM cnt WHERE x > 19) SELECT * FROM filtered;
SELECT * FROM T1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
INSERT INTO T1 VALUES (NULL, NULL);
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T2 CROSS JOIN T;
SELECT COUNT(*) FILTER (WHERE Y IS NOT NULL), SUM(rowid) FILTER (WHERE Y > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(Y) FILTER (WHERE Y > 0 AND Y < 100), COUNT(*) FILTER (WHERE typeof(Y) = "text") FROM T2;
ANALYZE;
SELECT * FROM T2 NATURAL JOIN T;
WITH m AS MATERIALIZED (SELECT Y FROM T2) SELECT * FROM m;
DELETE FROM T WHERE 0 RETURNING *;
INSERT INTO T2 DEFAULT VALUES;
CREATE  INDEX IF NOT EXISTS idx_T2_3880 ON T2(A COLLATE NOCASE);
INSERT INTO T1 VALUES (NULL, NULL);
ALTER TABLE T2 RENAME TO T2_r4665;
CREATE TRIGGER IF NOT EXISTS trg_T2_6964 BEFORE UPDATE OF Y ON T2 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
REINDEX;
PRAGMA full_column_names = FALSE;
DROP INDEX IF EXISTS T1;
SELECT * FROM T1 WHERE X IN (SELECT DISTINCT X FROM T1);
SELECT COUNT(*) FILTER (WHERE A IS NOT NULL), SUM(rowid) FILTER (WHERE A > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(A) FILTER (WHERE A > 0 AND A < 100), COUNT(*) FILTER (WHERE typeof(A) = "text") FROM T2;
ANALYZE T2;
WITH cte AS (SELECT 1 AS x) SELECT x + 0.5 FROM cte;
INSERT INTO T2 DEFAULT VALUES;
PRAGMA foreign_key_list(users);
ALTER TABLE T2 RENAME TO T2_r4340;
INSERT INTO T VALUES ('x', 'x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, B = excluded.B, C = excluded.C;

SELECT COUNT(*) FROM T;
VACUUM main;
DELETE FROM T2 WHERE Y > (SELECT AVG(Y) FROM T2) RETURNING *;
WITH cte(a, b) AS (SELECT A, A FROM T) SELECT a, b FROM cte;
DELETE FROM T2 WHERE A IS NULL RETURNING *;
REINDEX;
CREATE TRIGGER IF NOT EXISTS trg_T2_8365 BEFORE UPDATE OF Y ON T2 BEGIN INSERT INTO T2(Y) VALUES (NULL); END;
SELECT * FROM T WHERE B IN (SELECT B FROM T);
REINDEX;
SELECT COUNT(*) FILTER (WHERE X IS NOT NULL), SUM(rowid) FILTER (WHERE X > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(X) FILTER (WHERE X > 0 AND X < 100), COUNT(*) FILTER (WHERE typeof(X) = "text") FROM T1;
ALTER TABLE T2 RENAME COLUMN Y TO Y_r3311;
UPDATE T2 SET Y = NULL WHERE rowid = 1;
COMMIT;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T1_7913 AS SELECT A FROM T1;
CREATE  VIEW IF NOT EXISTS v_T1_5615 AS SELECT X FROM T1;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE C = NULL);
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T2_7703 ON T2(Y COLLATE NOCASE) WHERE Y IS NOT NULL;
VACUUM;
ALTER TABLE T RENAME COLUMN A TO A_r1506;
DETACH DATABASE aux64;
WITH cte AS (SELECT C FROM T) SELECT * FROM cte WHERE C IS NOT NULL;
ALTER TABLE _m DROP COLUMN A;

INSERT INTO _m VALUES (1, 'x') ON CONFLICT(X) DO UPDATE SET X = excluded.X, A = excluded.A;
CREATE  INDEX IF NOT EXISTS idx_T2_993 ON T2((A + 1));
VACUUM;
SELECT SUM(A) FROM T2;
WITH cte AS (SELECT * FROM T1) SELECT * FROM cte a, cte b WHERE a.A = b.A;
DETACH DATABASE aux43;
SELECT LAG(B, 1) OVER (PARTITION BY B ORDER BY B RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM T;
CREATE TRIGGER IF NOT EXISTS trg_T_4494 BEFORE INSERT ON T FOR EACH ROW BEGIN SELECT RAISE(IGNORE); END;
SELECT MAX(B) OVER (ORDER BY B ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx__m_4678 ON _m(X) WHERE X IS NOT NULL;
SELECT STRING_AGG(C) FROM T;

SELECT COUNT(*) FROM T1;
SELECT * FROM T AS a RIGHT OUTER JOIN T AS b ON a.rowid = b.rowid;
SELECT AVG(X) FROM _m;
REINDEX T2;
SELECT 0x0ACB29BM205381;
SELECT sqlite_compileoption_used('æçå¤©ä½ æ¯æä¹äº');
SELECT 1 >> -999999999999999999999999999;
SELECT sqlite_compileoption_get($1);
SELECT sqlite_version();
VACUUM main;
WITH RECURSIVE r AS (SELECT X FROM _m UNION ALL SELECT X FROM _m LIMIT 5) SELECT * FROM r;
ANALYZE;
UPDATE _m SET X = 'x' WHERE rowid = 1 RETURNING *;
VACUUM;
CREATE TABLE T1 (
  A VARCHAR(20) PRIMARY KEY,
  X VARCHAR(10) UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(20) PRIMARY KEY,
  Y VARCHAR(10) UNIQUE
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
INSERT INTO T2 VALUES ('c', 'l');
SELECT A FROM T1 INTERSECT SELECT A FROM T2;
SELECT * FROM T1 WHERE EXISTS (SELECT 1 FROM T1 WHERE 1 = 0);
```

## Actual output

```sql
3.39.0 2022-05-10 23:28:12 764b71267e0b31ff7eaf2a0def7526a1a02dce4d5b456dea060d97ed342ealt1
```

## Expectation

```sql
3.51.1 2025-11-28 17:28:25 281fc0e9afc38674b9b0991943b9e9d1e64c6cbdb133d35f6f5c87ff6af38a88 (64-bit)
```

## Flag

```
-version
```

