## 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
.limit
ATTACH DATABASE (':memory:' || '') AS aux61;
SAVEPOINT sp4978;
SAVEPOINT sp163;
SAVEPOINT sp9675;
ATTACH DATABASE ':memory:' AS aux5;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ((round('123.45', (random() - log(-(-((-1 + 0))), 0))) - 0),'a',1.25), (2,'b',-3.5), (3,'c',9e999);
WITH d AS (SELECT * FROM T) SELECT * FROM d WHERE NOT NOT NOT (c IS NOT 0) ;
SAVEPOINT sp8164;
.check
PRAGMA recursive_triggers = CAST(-cosh(9223372036854775808) AS BOOLEAN);
-- PRAGMA checkpoint_fullsync = TRUE;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS `t1`;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(json_array_length(1, '$.arr')) UNION ALL SELECT x+1 FROM c WHERE NOT NOT (x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c) ;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE +a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
CREATE TABLE T (
  A VARCHAR(10) 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;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
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;
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
PRAGMA wal_checkpoint('PASSIVE');
PRAGMA read_uncommitted = FALSE;
PRAGMA journal_mode = 'OFF';
.shell pwd
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z, PRIMARY KEY(a,b DESC)) WITHOUT ROWID;
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<100) INSERT INTO t1(a,b,c,d) SELECT x%10, x/10, x, printf('xyz%dabc',x) FROM c;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 CROSS JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
SELECT t3.c FROM (SELECT a,max(b) AS m FROM t1 WHERE a>=5 GROUP BY a) AS t2 LEFT JOIN t1 AS t3 WHERE t2.a=t3.a AND t2.m=t3.b ORDER BY t3.a;
creATE VIRTUAL TABLE t0 USING fts3("x", "y", "z");
CREATE TABLE T (
  a TEXT,
  b REAL
);
INSERT INTO T VALUES ('a',100.0), ('b',-200.5), ('c',9e999);
SELECT a,b,
LEAD(b,1) OVER (ORDER BY b DESC) AS c,
NTILE(2) OVER (ORDER BY b DESC) AS d FROM T;
DROP TABLE t0;
INSERT INTO t1 VALUES (1, 'x', 1, NULL, NULL, NULL, 1, 'x', NULL, 1, 1, NULL, 1, 'x', 'x', 1, NULL, 'x', NULL, NULL, 1, 'x', NULL, 1, 'x', 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT TOTAL(b) FROM t1;
SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, NULL, NULL, 'x', NULL, 'x', 1, NULL, NULL, 'x', 'x', 'x', 1, NULL, 1, 1, 'x', 1, 'x', 'x', 1, NULL, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
INSERT INTO t1 DEFAULT VALUES;
UPDATE t1 SET i = 'x' WHERE i BETWEEN 0 AND 100 RETURNING *;
VACUUM;
INSERT INTO t1 VALUES (1, 'x', NULL, 'x', 'x', NULL, 1, 1, NULL, 1, 'x', 1, 'x', NULL, 1, 'x', 1, 'x', 1, NULL, 'x', 1, 'x', NULL, 1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
SELECT * FROM t1 NATURAL JOIN t1;
ALTER TABLE t1 RENAME COLUMN u TO u_r336;
ALTER TABLE t1 RENAME COLUMN w TO w_r6558;
CREATE TRIGGER IF NOT EXISTS trg_t1_9462 AFTER UPDATE OF l ON t1 FOR EACH ROW BEGIN INSERT INTO t1(l) VALUES (NULL); END;
UPDATE t1 SET r = -83 WHERE rowid = 1;
WITH cte AS (SELECT t, ROW_NUMBER() OVER (ORDER BY t) AS rn FROM t1) SELECT * FROM cte WHERE rn <= 5;
INSERT INTO t1 SELECT * FROM t1;
REINDEX T;
INSERT OR FAIL INTO t1 VALUES (NULL, NULL, 0, 'x', NULL, 7, 4, 0, NULL, 0, '', 'x', '', '', 7, '', '', 0, NULL, '', 0, 0, '', 0, NULL, NULL);
INSERT INTO t1 VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
UPDATE t1 SET q = q + 1 WHERE 1;
SELECT COUNT(*) FROM t1;
ALTER TABLE T DROP COLUMN A;
INSERT INTO T SELECT * FROM T;
ROLLBACK TRANSACTION TO SAVEPOINT sp8164;
RELEASE SAVEPOINT sp8164;
ALTER TABLE t1 ADD COLUMN extra_4914 INT DEFAULT '';
SELECT * FROM t1 AS a JOIN t1 AS b ON a.rowid = b.rowid;
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 T;
WITH cte(a, b, c) AS (SELECT e, e, e FROM t1) SELECT a, b, c FROM cte;
ALTER TABLE T DROP COLUMN C;
WITH cte AS (SELECT A, SUM(A) AS total FROM T GROUP BY A) SELECT * FROM cte ORDER BY total DESC;
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 T;
SELECT MIN(A) FROM T;
WITH cte AS (SELECT r, SUM(r) AS total FROM t1 GROUP BY r) SELECT * FROM cte ORDER BY total DESC;
INSERT INTO t1 DEFAULT VALUES;
INSERT INTO T VALUES (NULL, NULL, NULL);
PRAGMA synchronous = '2';
ALTER TABLE T RENAME COLUMN A TO A_r6370;
SELECT ROW_NUMBER() OVER (PARTITION BY n ORDER BY n RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
DETACH DATABASE aux5;

SELECT COUNT(*) FROM T2;
VACUUM;
WITH a AS (SELECT a FROM T), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
SELECT LEAD(a, 2, a) OVER (PARTITION BY a ORDER BY a ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 WHERE ROW_NUMBER() OVER (ORDER BY Y) = 1);
CREATE TEMPORARY  VIEW IF NOT EXISTS v_T_1818 AS SELECT b FROM T;
ROLLBACK TRANSACTION TO SAVEPOINT sp9675;
RELEASE SAVEPOINT sp9675;
ANALYZE;
INSERT INTO t1 DEFAULT VALUES;
ALTER TABLE T1 ADD COLUMN extra_1395 NCHAR(55) UNIQUE;
INSERT INTO T1 VALUES ('x', 'x') ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
SELECT GROUP_CONCAT(b, b) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM T;
RELEASE sp163;
RELEASE sp4978;
INSERT INTO t1 VALUES ('x', NULL, 1, 'x', 'x', NULL, 'x', 'x', 1, 1, NULL, 1, 1, 'x', 1, NULL, 1, 1, NULL, NULL, 1, 'x', 1, 1, 'x', 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
DETACH DATABASE aux61;
ALTER TABLE T ADD COLUMN extra_2978 NATIVE CHARACTER(70)NVARCHAR(100) UNIQUE;
SELECT * FROM T2 WHERE Y IN (SELECT Y FROM T2 WHERE Y GLOB "*");
INSERT INTO t1 DEFAULT VALUES;
DELETE FROM T1 WHERE rowid = 63 RETURNING *;
VACUUM main;
CREATE TRIGGER IF NOT EXISTS trg_T_4049 BEFORE UPDATE ON T FOR EACH ROW BEGIN SELECT RAISE(IGNORE); END;
VACUUM;
SELECT AVG(X) FROM T1;
WITH cte AS (SELECT CASE WHEN v IS NULL THEN 0 ELSE v END AS val FROM t1) SELECT * FROM cte;
SELECT * FROM T;
INSERT INTO T1 DEFAULT VALUES;
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',1.0), ('a','c',-1.0), ('b','d',0.0);
SELECT
COALESCE(a,'e') AS d,
COALESCE(b,'f') AS e,
SUM(c) AS f
FROM T
GROUP BY a,b;
WITH cte AS (SELECT * FROM T1), cte2 AS (SELECT * FROM cte) SELECT * FROM cte2;
ALTER TABLE T1 DROP COLUMN A;
SELECT AVG(n) FROM t1;
CREATE TABLE T (
  A VARCHAR(10) 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;
ANALYZE;
```

## Actual output

```sql
length 1000000000
          sql_length 1000000000
              column 2000
          expr_depth 1000
     compound_select 500
             vdbe_op 250000000
        function_arg 127
            attached 10
 like_pattern_length 50000
     variable_number 32766
       trigger_depth 1000
      worker_threads 0
```

## Expectation

```sql
length 1000000000
          sql_length 1000000000
              column 2000
          expr_depth 1000
     compound_select 500
             vdbe_op 250000000
        function_arg 1000
            attached 10
 like_pattern_length 50000
     variable_number 32766
       trigger_depth 1000
      worker_threads 0
```

## Flag

```

```

