## 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 secure_delete = ON;
PRAGMA foreign_keys = FALSE;
-- sign(1)

PRAGMA cell_size_check = 3370811959573763011;
PRAGMA page_size;
.recover
CREATE TABLE map_integer /**/ (id INT, name);
INSERT INTO map_integer VALUES(1,'a');
CREATE TABLE [map_text] (id TEXT, name);
INSERT INTO map_text VALUES('4','e');
CREATE TABLE data (id TEXT, name);
INSERT INTO data VALUES(1,'abc');
INSERT INTO data VALUES('4','xyz');
CREATE VIEW idmap as SELECT * FROM map_integer UNION SELECT * FROM map_text;
CREATE TABLE mzed AS SELECT * FROM idmap;
PRAGMA automatic_index=ON;
SELECT * FROM data JOIN idmap USING(id);
CREATE TEMP  VIEW IF NOT EXISTS v_map_integer_924 AS SELECT id FROM map_integer;
SELECT NTILE(4) OVER (ORDER BY name GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM map_integer;
CREATE  VIEW IF NOT EXISTS v_map_integer_8760 AS SELECT name FROM map_integer;
CREATE TABLE T (
  a TEXT,
  b TEXT
);
INSERT INTO T VALUES ('a','b'), ('c','d');
SELECT * FROM T WHERE a = REPLACE('a;',';','') AND b = 'b';
WITH cte(x) AS (SELECT id FROM map_integer) SELECT x FROM cte;
REINDEX;
ALTER TABLE map_text RENAME COLUMN name TO name_r1633;
WITH cte AS (SELECT name, ROW_NUMBER() OVER (ORDER BY name) AS rn FROM data) SELECT * FROM cte WHERE rn <= 5;
ALTER TABLE data RENAME TO data_r811;
SELECT MAX(b) FROM T;
DELETE FROM T WHERE a > (SELECT AVG(a) FROM T);
CREATE TABLE T1 (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) UNIQUE,
  C INTEGER
);
CREATE TABLE T2 (
  X VARCHAR(20) PRIMARY KEY,
  A VARCHAR(10) NOT NULL UNIQUE,
  FOREIGN KEY (A) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('a', 'p', -2147483648);
INSERT INTO T1 VALUES ('b', 'q', 2147483647);
INSERT INTO T2 VALUES ('m', 'a');
INSERT INTO T2 VALUES ('n', 'b');
SELECT T2.X, T1.B, T1.C FROM T2, T1 WHERE T2.A = T1.A AND T1.C >= 0;
SELECT * FROM T WHERE a IN (SELECT a FROM T WHERE a IN (SELECT a FROM T));
```

## Actual output

```sql
1
4096
PRAGMA foreign_keys=OFF;
BEGIN;
PRAGMA writable_schema = on;
PRAGMA writable_schema = off;
COMMIT;
1|abc|a
1
a|b
1
abc|1
xyz|2
d
n|q|2147483647
```

## Expectation

```sql
1
4096
.dbconfig defensive off
BEGIN;
PRAGMA writable_schema = on;
PRAGMA foreign_keys = off;
PRAGMA encoding = 'UTF-8';
PRAGMA page_size = '4096';
PRAGMA auto_vacuum = '0';
PRAGMA user_version = '0';
PRAGMA application_id = '0';
PRAGMA writable_schema = off;
COMMIT;
4|xyz|e
1
a|b
1
abc|1
xyz|2
d
n|q|2147483647
```

## Flag

```

```

