## 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
.import corrupt001.db main
ATTACH DATABASE ':memory:' AS aux92;
BEGIN TRANSACTION;
CREATE TABLE t1(a, b, c);
INSERT INTO "t1" VALUES(json_valid(1, 8),'one','I');
CREATE TABLE t2(d, e, f);
INSERT INTO "t2" VALUES(5,'ten','XX');
INSERT INTO "t2" VALUES(6,NULL,NULL);
CREATE INDEX i1 ON t1(b, a);
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15),
  C BIGINT NOT NULL,
  UNIQUE (B, C)
);
INSERT INTO T VALUES ('a', 'p', 3000);
INSERT INTO T VALUES ('b', 'q', 9223372036854775807);
INSERT INTO T VALUES ('c', 'r', 1700);
INSERT INTO T VALUES ('e', 'q', -9223372036854775808);
INSERT INTO T VALUES ('f', 'r', 0);
SELECT B, COUNT(*) AS D, SUM(C) AS E, AVG(C) AS F FROM T GROUP BY B HAVING SUM(C) > 0;
COMMIT;
REINDEX;
DELETE FROM t2 WHERE NOT NOT (d > (WITH _m AS MATERIALIZED (SELECT * FROM t2) SELECT AVG(d) FROM _m)) ;
ANALYZE t1;
DROP INDEX IF EXISTS t2;
REINDEX;
PRAGMA vdbe_debug = OFF;
SELECT * FROM t2 AS a LEFT OUTER JOIN t2 AS b ON a.rowid = b.rowid;
DETACH DATABASE aux92;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_9582 AS SELECT b FROM t1;
VACUUM;
SELECT * FROM t1 AS a RIGHT JOIN t1 AS b ON a.rowid = b.rowid;
CREATE  INDEX IF NOT EXISTS idx_t1_266 ON t1(c);
INSERT INTO t1 DEFAULT VALUES;
ANALYZE t1;
SELECT LAG(a, 1) OVER (ORDER BY a ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM t1;
INSERT OR FAIL INTO t2 VALUES (9, 'x', 'x');
ALTER TABLE t1 ADD COLUMN extra_3246 REAL COLLATE RTRIM;
DROP TRIGGER IF EXISTS t2;
SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t1);
INSERT INTO t2 VALUES (NULL, NULL, NULL);
UPDATE t1 SET b = -70 WHERE b IS NOT NULL RETURNING *;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_8808 ON t1(b) WHERE b IS NOT NULL;
INSERT INTO t2 VALUES (NULL, NULL, NULL);
CREATE  INDEX IF NOT EXISTS idx_t2_3119 ON t2((e + 1));
SELECT * FROM t2 CROSS JOIN T;
SELECT * FROM T AS a LEFT OUTER JOIN T AS b ON a.rowid = b.rowid;
```

## Actual output

```sql
p|1|3000|3000.0
r|2|1700|850.0
5|ten|XX|5|ten|XX

5|ten|XX|a|p|3000
5|ten|XX|b|q|9223372036854775807
5|ten|XX|c|r|1700
5|ten|XX|e|q|-9223372036854775808
5|ten|XX|f|r|0
9|x|x|a|p|3000
9|x|x|b|q|9223372036854775807
9|x|x|c|r|1700
9|x|x|e|q|-9223372036854775808
9|x|x|f|r|0
|||a|p|3000
|||b|q|9223372036854775807
|||c|r|1700
|||e|q|-9223372036854775808
|||f|r|0
|||a|p|3000
|||b|q|9223372036854775807
|||c|r|1700
|||e|q|-9223372036854775808
|||f|r|0
a|p|3000|a|p|3000
b|q|9223372036854775807|b|q|9223372036854775807
c|r|1700|c|r|1700
e|q|-9223372036854775808|e|q|-9223372036854775808
f|r|0|f|r|0
```

## Expectation

```sql

```

## Flag

```

```

