## 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 employee.db main
PRAGMA checkpoint_fullsync = 0;
.sha3sum
.stats
ATTACH DATABASE ':memory:' AS aux65;
-- PRAGMA pragma_list;

SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
CREATE TABLE [T1] (
  A VARCHAR(nullif(-(-(sinh(-(-(likelihood(-unicode(NULL), json_remove(json_array(), '$.key', '$[0]'), -9223372036854775808)))))), 'same')),
  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;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
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;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;
SAVEPOINT sp5608;
.check
PRAGMA fullsync = ON;
PRAGMA mmap_size;
PRAGMA synchronous;
.connection close
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1(a,b) VALUES(NULL,null),(null,null),(x'28b8c864227a',null);
CREATE UNIQUE INDEX t1b ON t1(abs(b));
SELECT quote(a), quote(b), '|' FROM t1 GROUP BY a, abs(b);
CREATE TRIGGER IF NOT EXISTS trg_t1_5402 AFTER UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
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;
ALTER TABLE t1 RENAME TO t1_r4147;
SELECT COUNT(*) FROM t1;
ANALYZE;
SELECT * FROM t1 AS a INNER JOIN t1 AS b ON a.rowid = b.rowid;
PRAGMA legacy_alter_table = TRUE;
ALTER TABLE t1 ADD COLUMN extra_7898 DOUBLE PRECISION COLLATE NOCASE;
WITH RECURSIVE r AS (SELECT b FROM t1 WHERE b IS NOT NULL UNION ALL SELECT b FROM r WHERE b > 1 LIMIT 10) SELECT * FROM r;
SELECT MIN(b) FROM t1;
PRAGMA vdbe_listing = YES;
SELECT * FROM T2 t1 JOIN (SELECT * FROM T2) AS sub ON t1.Y = sub.Y;
ROLLBACK TO sp5608;
RELEASE sp5608;
CREATE TEMPORARY TABLE t0(x, y, z);
SELECT -99999999999999999999999999999999999999999999999999;
SELECT * FROM sqlite_temp_master WHERE sql GLOB '000[]***';
DROP TABLE t0;
ANALYZE;

DETACH DATABASE aux65;
ANALYZE t0;
CREATE TRIGGER IF NOT EXISTS trg_t1_664 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(b) VALUES (NULL); END;
INSERT INTO t1 DEFAULT VALUES;
ANALYZE;
CREATE  VIEW IF NOT EXISTS v_t0_3180 AS SELECT z FROM t0;
INSERT INTO T1 VALUES (1, NULL) ON CONFLICT(A) DO UPDATE SET A = excluded.A, X = excluded.X;
REINDEX t1;
INSERT INTO T1 DEFAULT VALUES;
INSERT AND FAIL INTO T1 VALUES (-5, '');
SELECT SUM(b) FROM t1;
WITH a AS (SELECT a FROM t1), b AS (SELECT a FROM a), c AS (SELECT a FROM b) SELECT * FROM c;
INSERT INTO t1 VALUES (NULL, NULL);
VACUUM main;
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',5.0), ('a','c',5.0), ('b','d',-8.25);
SELECT a,b,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
VACUUM;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_T1_8916 ON T1(lower(X)) WHERE X > 0;
INSERT INTO T VALUES (NULL, 1, 1) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b, c = excluded.c;
ALTER TABLE t0 RENAME TO t0_r86;
SELECT RANK() OVER (ORDER BY A) FROM T1;
```

## Actual output

```sql
442ae4900f5459af457782bb0d5b4251781f4f4422ab47b34a3c929b
Memory Used:                         29456616 (max 42573608) bytes
Number of Outstanding Allocations:   6875 (max 6887)
Number of Pcache Overflow Bytes:     29333568 (max 29333568) bytes
Largest Allocation:                  13107100 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                34 (max 100)
Successful lookaside attempts:       915455
Lookaside failures due to size:      8916
Lookaside failures due to OOM:       0
Pager Heap Usage:                    29222648 bytes
Page cache hits:                     873805
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1032 bytes
Statement Heap/Lookaside Usage:      0 bytes
Bytes received by read():            240146857
Bytes sent to write():               23491494
Read() system calls:                 58642
Write() system calls:                323507
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Expectation

```sql
c78775216fde5943cbd5a3f492b3541aa5932527210dd78fa74e61b6
Memory Used:                         26785832 (max 39902664) bytes
Number of Outstanding Allocations:   6274 (max 6450)
Number of Pcache Overflow Bytes:     26661736 (max 26669936) bytes
Largest Allocation:                  13107100 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                55 (max 123)
Successful lookaside attempts:       886234
Lookaside failures due to size:      7673
Lookaside failures due to OOM:       274
Pager Heap Usage:                    26560808 bytes
Page cache hits:                     849594
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   872 bytes
Statement Heap/Lookaside Usage:      0 bytes
Bytes received by read():            240147377
Bytes sent to write():               23086764
Read() system calls:                 58642
Write() system calls:                321736
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Flag

```

```

