## 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
PRAGMA wal_checkpoint('TRUNCATE');
CREATE TABLE main.T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (((json_remove(ceil(coalesce('a', 'b', 'c'))) * 'false') + 0.0),1.5,10.0), (2,-2.5,20.0), (3,-9e999,30.0);
SELECT * FROM T WHERE NOT b < 2.0 ORDER BY b;
.system false && echo "success" || echo "error code: $?"
PRAGMA foreign_key_list(users);
.log stdout
BEGIN;
-- LAG({c}, 0)

.exit
CREATE TABLE T (
  A VARCHAR(time(random() % acosh(likelihood(json_extract(exp(radians(NULL)), '$.key'), log2('1e10'))))),
  B VARCHAR((10 + 0)),
  PRIMARY KEY (A, B)
);
INSERT INTO T VALUES ('a', 'p');
INSERT INTO T VALUES ('a', 'q');
INSERT INTO T VALUES ('b', 'q');
INSERT INTO T VALUES ('c', 'r');
INSERT INTO T VALUES ('b', 'r');
INSERT INTO T VALUES ('b', 't');
SELECT B, COUNT(DISTINCT A) AS D FROM T GROUP BY B ORDER BY D DESC, B ASC;
BEGIN TRANSACTION;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(CAST(123 AS DOUBLE)),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE main.`t4` (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 LEFT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 AND b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT  INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;
.quit
PRAGMA wal_checkpoint('TRUNCATE');
BEGIN EXCLUSIVE TRANSACTION;
CREATE TABLE T (
  a INTEGER,
  b REAL,
  c REAL
);
INSERT INTO T VALUES (replace(NULL, 'a', ''),lower(123),10.5), (1,-3.5,20.25), (2,9e999,-1.0);
WITH d AS (SELECT a,SUM(b*c) AS e FROM T GROUP BY a) SELECT * FROM d;
SAVEPOINT sp6342;
PRAGMA cell_size_check = FALSE;
PRAGMA vdbe_addoptrace = NO;
PRAGMA query_only = FALSE;
.limit COLUMN 5
CREATE TABLE t1 (a); INSERT INTO t1 (a) VALUES (104);
CREATE TABLE t2 (b); INSERT INTO t2 (b) VALUES (104);
CREATE TABLE t3 (c); INSERT INTO t3 (c) VALUES (104);
CREATE TABLE t4 (d); INSERT INTO t4 (d) VALUES (104);
SELECT * FROM t1 RIGHT JOIN t2 ON (t1.a = t2.b) WHERE t2.b IN ( SELECT t3.c FROM t3 WHERE t3.c IN ( SELECT d FROM (SELECT DISTINCT d FROM t4) AS x WHERE x.d=104));
CREATE TABLE t5(a, b, c, d);
CREATE INDEX t5a ON t5(a);
CREATE INDEX t5b ON t5(b);
CREATE TABLE t6(e);
INSERT INTO t6 VALUES(1);
INSERT INTO t5 VALUES(1,1,1,1), (2,2,2,2);
SELECT * FROM t5 WHERE (a=1 OR b=2) AND c IN ( SELECT e FROM (SELECT DISTINCT e FROM t6) WHERE e=1);

ANALYZE;
SELECT * FROM t1 AS a FULL JOIN t5 AS b ON a.rowid = b.rowid;
INSERT INTO t5 VALUES (NULL, NULL, NULL, NULL);
ROLLBACK TRANSACTION TO SAVEPOINT sp6342;
RELEASE SAVEPOINT sp6342;
WITH cte AS (SELECT CASE WHEN c > 0 THEN "pos" ELSE "neg" END AS sign FROM t3) SELECT * FROM cte;
WITH cte AS (SELECT * FROM t2) SELECT * FROM cte LEFT JOIN t2 ON cte.b = t2.b;
END TRANSACTION;
ALTER TABLE t1 RENAME TO t1_r9404;
INSERT INTO t1 DEFAULT VALUES;
SELECT MIN(b) FROM T;

SELECT COUNT(*) FROM t3;
CREATE  VIEW IF NOT EXISTS v_t4_2764 AS SELECT d FROM t4;
VACUUM main;
SELECT * FROM T;
CREATE TRIGGER IF NOT EXISTS trg_t2_742 AFTER INSERT ON t2 BEGIN SELECT RAISE(ABORT, 'abort'); END;
INSERT INTO t4 VALUES (NULL);
ALTER TABLE t4 RENAME COLUMN d TO d_r6559;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
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 T;
PRAGMA application_id = 12345;

INSERT INTO t2 DEFAULT VALUES;
CREATE TRIGGER IF NOT EXISTS trg_t3_9972 BEFORE INSERT ON t3 BEGIN SELECT RAISE(ABORT, 'abort'); END;

SELECT COUNT(*) FROM t5;
COMMIT;
SELECT NTH_VALUE(c, 1) OVER (PARTITION BY c ORDER BY c RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t3;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<0) SELECT * FROM cnt;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t5;
DELETE FROM t4 WHERE rowid = 89;
SELECT * FROM t1;
ALTER TABLE t1 RENAME /* -safe */ TO t1_r3367;
INSERT OR ROLLBACK INTO T VALUES (NULL, '', 0);
INSERT INTO t1 VALUES (1) ON CONFLICT(a) DO UPDATE SET a = excluded.a;
WITH a AS (SELECT * FROM t6), RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<40) SELECT * FROM a CROSS JOIN cnt;
INSERT INTO T VALUES (1, NULL, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t4 DEFAULT VALUES;
REINDEX t5;
PRAGMA wal_checkpoint('FULL');
WITH m AS MATERIALIZED (SELECT * FROM t2) SELECT m.b FROM m JOIN m AS m2 ON m.b = m2.b;
INSERT INTO t4 VALUES (NULL);
UPDATE t1 SET a = 'x' WHERE 1;
ROLLBACK;
CREATE TRIGGER IF NOT EXISTS trg_T_3136 AFTER INSERT ON T FOR EACH ROW BEGIN SELECT RAISE(IGNORE); END;
REINDEX;
ANALYZE t2;
INSERT INTO t5 SELECT * FROM t5;
WITH cte AS (SELECT NULL AS x, NULL AS y) SELECT x, y, x IS NULL FROM cte;
WITH cte AS (SELECT a, COUNT(*) FROM t1 GROUP BY a) SELECT * FROM cte;

ALTER TABLE t4 DROP COLUMN d;
UPDATE t5 SET c = '';
ALTER TABLE t3 RENAME COLUMN c TO c_r3438;
SELECT COUNT(*) FILTER (WHERE c IS NOT NULL), SUM(rowid) FILTER (WHERE c > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(c) FILTER (WHERE c > 0 AND c < 100), COUNT(*) FILTER (WHERE typeof(c) = "text") FROM t3;
CREATE TRIGGER IF NOT EXISTS trg_t3_6384 AFTER DELETE ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t6 RENAME TO t6_r8602;
PRAGMA vdbe_trace = 1;
INSERT INTO t3 DEFAULT VALUES;
SELECT MAX(c) FROM t5;
INSERT INTO t1 VALUES (NULL);
INSERT OR ABORT INTO T VALUES (NULL, NULL, -4);
ALTER TABLE t6 RENAME TO t6_r215;
SELECT * FROM t3 WHERE (c) IN (SELECT c FROM t3);
INSERT INTO t3 DEFAULT VALUES;
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 t2;
VACUUM main;
CREATE  INDEX IF NOT EXISTS idx_T_5526 ON T(lower(a)) WHERE a IS NOT NULL;
ALTER TABLE t4 RENAME COLUMN d TO d_r4254;
WITH cte AS (SELECT NULL AS x) SELECT * FROM cte;
SELECT * FROM T;
SELECT COUNT(c) FROM t3;
INSERT INTO t3 VALUES (NULL) ON CONFLICT(c) DO UPDATE SET c = excluded.c;
INSERT INTO t3 DEFAULT VALUES;
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 t2;
DELETE FROM t2 WHERE b IS NULL;
ALTER TABLE t4 RENAME TO t4_r9156;
SELECT * FROM t2 WHERE EXISTS (SELECT 1 FROM t2 WHERE 1 = 1);

SELECT COUNT(*) FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_507 ON t1(lower(a)) WHERE a > 0;
WITH RECURSIVE inf(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM inf) SELECT * FROM inf LIMIT 10;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
SELECT * FROM t5 WHERE c <= ANY (SELECT c FROM t5);
CREATE  VIEW IF NOT EXISTS v_t6_7436 AS SELECT e FROM t6;
```

## Actual output

```sql
0|-1|-1
Memory Used:                         67704 (max 67792) bytes
Number of Outstanding Allocations:   141 (max 142)
Number of Pcache Overflow Bytes:     8464 (max 8464) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                36 (max 76)
Successful lookaside attempts:       89
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    9248 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   736 bytes
Statement Heap/Lookaside Usage:      3728 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               5
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3728
Bytes received by read():            10409
Bytes sent to write():               0
Read() system calls:                 13
Write() system calls:                0
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         78936 (max 80488) bytes
Number of Outstanding Allocations:   163 (max 177)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                32 (max 88)
Successful lookaside attempts:       164
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1048 bytes
Statement Heap/Lookaside Usage:      2448 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               30
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2448
Bytes received by read():            10760
Bytes sent to write():               1296
Read() system calls:                 16
Write() system calls:                1
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         76512 (max 82192) bytes
Number of Outstanding Allocations:   152 (max 177)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                52 (max 91)
Successful lookaside attempts:       235
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1072 bytes
Statement Heap/Lookaside Usage:      5776 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               43
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        5776
Bytes received by read():            10858
Bytes sent to write():               2593
Read() system calls:                 18
Write() system calls:                2
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         76512 (max 82192) bytes
Number of Outstanding Allocations:   152 (max 177)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                54 (max 92)
Successful lookaside attempts:       288
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1072 bytes
Statement Heap/Lookaside Usage:      6976 bytes
Fullscan Steps:                      2
Sort Operations:                     1
Autoindex Inserts:                   0
Virtual Machine Steps:               22
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        6976
Bytes received by read():            10956
Bytes sent to write():               3890
Read() system calls:                 20
Write() system calls:                3
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
error code: 1
Memory Used:                         76512 (max 82192) bytes
Number of Outstanding Allocations:   152 (max 177)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                36 (max 92)
Successful lookaside attempts:       294
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1072 bytes
Statement Heap/Lookaside Usage:      3728 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               3
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3728
Bytes received by read():            15202
Bytes sent to write():               5201
Read() system calls:                 30
Write() system calls:                5
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         76512 (max 82192) bytes
Number of Outstanding Allocations:   152 (max 177)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                35 (max 92)
Successful lookaside attempts:       297
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1072 bytes
Statement Heap/Lookaside Usage:      2528 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               2
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2528
Bytes received by read():            15300
Bytes sent to write():               6497
Read() system calls:                 32
Write() system calls:                6
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Expectation

```sql
0|-1|-1
Memory Used:                         68416 (max 68496) bytes
Number of Outstanding Allocations:   151 (max 152)
Number of Pcache Overflow Bytes:     8472 (max 8472) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                52 (max 87)
Successful lookaside attempts:       100
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    9256 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   632 bytes
Statement Heap/Lookaside Usage:      3728 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               6
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3728
Bytes received by read():            11185
Bytes sent to write():               0
Read() system calls:                 14
Write() system calls:                0
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         79472 (max 81008) bytes
Number of Outstanding Allocations:   173 (max 187)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                48 (max 97)
Successful lookaside attempts:       168
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   880 bytes
Statement Heap/Lookaside Usage:      2344 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               30
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2344
Bytes received by read():            11280
Bytes sent to write():               1336
Read() system calls:                 16
Write() system calls:                1
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         77136 (max 82768) bytes
Number of Outstanding Allocations:   162 (max 187)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                68 (max 100)
Successful lookaside attempts:       242
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   888 bytes
Statement Heap/Lookaside Usage:      8992 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               43
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        8992
Bytes received by read():            11378
Bytes sent to write():               2671
Read() system calls:                 18
Write() system calls:                2
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         77136 (max 82768) bytes
Number of Outstanding Allocations:   162 (max 187)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                66 (max 101)
Successful lookaside attempts:       291
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   888 bytes
Statement Heap/Lookaside Usage:      6464 bytes
Fullscan Steps:                      2
Sort Operations:                     1
Autoindex Inserts:                   0
Virtual Machine Steps:               22
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        6464
Bytes received by read():            11476
Bytes sent to write():               4007
Read() system calls:                 20
Write() system calls:                3
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
error code: 1
Memory Used:                         77136 (max 82768) bytes
Number of Outstanding Allocations:   162 (max 187)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                52 (max 101)
Successful lookaside attempts:       297
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   888 bytes
Statement Heap/Lookaside Usage:      3728 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               4
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3728
Bytes received by read():            15722
Bytes sent to write():               5357
Read() system calls:                 30
Write() system calls:                5
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         77136 (max 82768) bytes
Number of Outstanding Allocations:   162 (max 187)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                51 (max 101)
Successful lookaside attempts:       300
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   888 bytes
Statement Heap/Lookaside Usage:      2528 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               3
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2528
Bytes received by read():            15820
Bytes sent to write():               6692
Read() system calls:                 32
Write() system calls:                6
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Flag

```
-stats
```

