## 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
.progress 3
PRAGMA legacy_file_format;
PRAGMA defer_foreign_keys = FALSE;
.timer datetime( )
PRAGMA auto_vacuum;
-- 1.7976931348623157e+308

.open random-json.db
.width -(-(-(-inf)) + -(-(CAST('|' AS MEDIUMINT)))) -2 -3
BEGIN DEFERRED;
PRAGMA secure_delete = ON;
.exit
BEGIN;
.quit
.open employee.db
BEGIN DEFERRED;
CREATE TABLE t1( w SMALLINT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE `t0`(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(sign(1.7976931348623157e+308)), ('' || '') || ('$.nonexistent')), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE NOT NOT (b IS NOT NULL) OVER (PARTITION BY b) ORDER BY b RANGE BETWEEN CURRENT ROW OR UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
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;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT,	b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
BEGIN DEFERRED;
CREATE TABLE t1( w INT GENERATED ALWAYS, x TEXT, y TEXT, a INT, b TEXT, c ANY);
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 AS (c0+c1-c3) REFERENCES t0, c3);
INSERT INTO t0 VALUES (jsonb_object(), json_array_insert(json_array_length(cos(0), '$.nonexistent'), '$.arr[0]', 0), 0), (11, 5, 5);
UPDATE t0 SET c1 = c0, c3 = c0;
INSERT INTO t1(a,b,c) VALUES(1,'abcdef',5.5),(3,'cantaloupe',NULL);
SELECT w, x, y, '|' FROM t1 ORDER BY a;
SELECT *, '|' FROM t0 ORDER BY +c0;
INSERT INTO t0 DEFAULT VALUES;
ALTER TABLE t0 RENAME TO t0_r8214;
INSERT INTO t0 SELECT * FROM t0;
PRAGMA empty_result_callbacks = 0;
COMMIT;
ALTER TABLE t1 DROP COLUMN c;
ALTER TABLE t0 RENAME TO t0_r1026;
ALTER TABLE t0 ADD COLUMN extra_2029 DECIMAL(10,5) DEFAULT '';
CREATE TRIGGER IF NOT EXISTS trg_t1_544 BEFORE UPDATE ON t1 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
ALTER TABLE t0 ADD COLUMN extra_4847 TINYINT COLLATE NOCASE;
SELECT MAX(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
PRAGMA cache_size;
END TRANSACTION;
ALTER TABLE t0 RENAME COLUMN c0 TO c0_r4608;
UPDATE t0 SET c1 = c1 + 1 WHERE rowid = 1 RETURNING *;
CREATE TRIGGER IF NOT EXISTS trg_t1_6123 BEFORE DELETE ON t1 BEGIN INSERT INTO t1(c) VALUES (NULL); END;
INSERT INTO t0 SELECT * FROM t0;
SELECT LAG(y, 2, y) OVER (ORDER BY y ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
REINDEX;
ROLLBACK;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',1.25), (2,'b',-3.5), (3,'c',9e999);
WITH d AS (SELECT * FROM T) SELECT * FROM d WHERE c > 0;
SELECT COUNT(y) FILTER (WHERE NULL) OVER (ORDER BY y GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
INSERT INTO t1 VALUES ('x', NULL, NULL, 1, 'x', 1) ON CONFLICT(w) DO UPDATE SET w = excluded.w, x = excluded.x, y = excluded.y;
SELECT * FROM t1;
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<72) SELECT * FROM cnt;
SELECT LAG(a, 0) OVER (PARTITION BY a ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t1;
ALTER TABLE t1 ADD COLUMN extra_3100 SMALLINT DEFAULT NULL;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t0_8826 ON t0(c3) WHERE c3 IS NOT NULL;
DROP VIEW IF EXISTS t0;
ALTER TABLE t1 RENAME TO t1_r9241;
CREATE TEMP  VIEW IF NOT EXISTS v_T_1512 AS SELECT a FROM T;
SELECT * FROM t1 AS a INNER JOIN t0 AS b ON a.rowid = b.rowid;
INSERT INTO T SELECT * FROM T;
DELETE FROM t0 WHERE 1 RETURNING *;
INSERT INTO t0 DEFAULT VALUES;
SELECT * FROM t0;
VACUUM;
SELECT * FROM t0 AS a LEFT JOIN t0 AS b ON a.rowid = b.rowid;
WITH cte AS (SELECT c1 FROM t0 INTERSECT SELECT c1 FROM t0) SELECT * FROM cte;
DELETE FROM t0 WHERE 0 RETURNING *;
ALTER TABLE T ADD COLUMN extra_3192 DATETIME COLLATE RTRIM;
UPDATE t0 SET c1 = CURRENT_TIMESTAMP WHERE c1 BETWEEN 0 AND 100;
INSERT OR FAIL INTO t1 VALUES ('x', NULL, NULL, 'x', /* if('', {v}, {v}) */ -10, NULL);
WITH RECURSIVE cnt(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM cnt WHERE x<9) SELECT COUNT(*) FROM cnt;
WITH cte AS (SELECT CASE WHEN c1 IS NULL THEN 0 ELSE c1 END AS val FROM t0) SELECT * FROM cte;
ALTER TABLE T RENAME COLUMN a TO a_r744;
ALTER TABLE t1 RENAME TO t1_r2914;
SELECT * FROM t0 AS a FULL OUTER JOIN T AS b ON a.rowid = b.rowid;
WITH cte AS (SELECT "123" AS x) SELECT x + 0 FROM cte;
SELECT * FROM t0 WHERE EXISTS (SELECT 1 FROM t0);
SELECT COUNT(*) FILTER (WHERE w IS NOT NULL), SUM(rowid) FILTER (WHERE w > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(w) FILTER (WHERE w > 0 AND w < 100), COUNT(*) FILTER (WHERE typeof(w) = "text") FROM t1;
INSERT INTO t0 VALUES (NULL, NULL, NULL, NULL);
SELECT * FROM t0 WHERE c3 <> ALL (SELECT c3 FROM t0);
SELECT * FROM t1;
SELECT * FROM t0;
INSERT OR FAIL INTO t1 VALUES ('', 0, 0, 'x', 0, 'x');
ALTER TABLE T ADD COLUMN extra_1973 REAL COLLATE RTRIM;
SELECT * FROM t1;
WITH cte(a, b) AS (VALUES(1, "a"),(2, "b"),(3, "c")) SELECT * FROM cte;
DELETE FROM t1 WHERE rowid = 37 RETURNING *;
ALTER TABLE T DROP COLUMN a;
INSERT INTO T DEFAULT VALUES;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T_9756 ON T(a COLLATE NOCASE) WHERE a IS NOT NULL;
DROP TABLE IF EXISTS T;
ALTER TABLE t1 RENAME COLUMN a TO a_r7959;
CREATE TEMP  VIEW IF NOT EXISTS v_t0_3053 AS SELECT c2 FROM t0;
```

## Actual output

```sql
Progress 1
Progress 2
Progress 3
Progress 4
Progress 5
0
1
```

## Expectation

```sql
Progress 1
Progress 2
Progress 3
Progress 4
Progress 5
0
Progress 6
1
```

## Flag

```

```

