## 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
.recover
PRAGMA parser_trace = NO;
.exit
CREATE TABLE a(b);
CREATE VIEW c(d) AS SELECT b FROM a ORDER BY b;
SELECT sum(d) OVER( PARTITION BY(SELECT  -CAST(exp(time(-inf)) AS UNSIGNED BIG INT) FROM c CROSS JOIN a WHERE NOT NOT (b =(SELECT b INTERSECT SELECT d FROM c) AND b = sqrt(NULL))) FROM c) ;

DROP TRIGGER IF EXISTS a;
SELECT * FROM a;
INSERT OR ABORT INTO a VALUES (NULL);
SELECT * FROM a;
VACUUM main;
SELECT STRING_AGG(b) FROM a;
ALTER TABLE a DROP COLUMN b;
ALTER TABLE a ADD COLUMN extra_6091 DECIMAL(replace(-(1797854924602735207 + 0), 'a', NULL),5) DEFAULT (random());

SELECT COUNT(*) FROM a;
UPDATE a SET b = 26 WHERE 1;
ALTER TABLE a DROP COLUMN b;
ALTER TABLE a DROP COLUMN b;
INSERT INTO a DEFAULT VALUES;
WITH a AS (SELECT b FROM a), b AS (SELECT b FROM a WHERE b IS NOT NULL), c AS (SELECT COUNT(*) AS cnt FROM b) SELECT cnt FROM c;
VACUUM main;

CREATE TEMPORARY  VIEW IF NOT EXISTS v_a_8387 AS SELECT b FROM a;
SELECT * FROM a WHERE b IN (SELECT b FROM a WHERE 1/0 = 0);SELECT * FROM a WHERE b IN (SELECT b FROM a LIMIT -1);
INSERT INTO a DEFAULT VALUES;
INSERT INTO a SELECT * FROM a;
INSERT INTO a VALUES (1) ON CONFLICT(b) DO UPDATE SET b = excluded.b;
INSERT INTO a VALUES (NULL);
CREATE TRIGGER IF NOT EXISTS trg_a_9336 AFTER DELETE ON a BEGIN INSERT INTO a(b) VALUES (NULL); END;
INSERT INTO a DEFAULT VALUES;
CREATE TABLE T1 (
  A VARCHAR(15) PRIMARY KEY,
  B VARCHAR(30) NOT NULL UNIQUE
);
CREATE TABLE T2 (
  A VARCHAR(10) PRIMARY KEY,
  X VARCHAR(15) NOT NULL,
  C BIGINT,
  FOREIGN KEY (X) REFERENCES T1(A)
);
INSERT INTO T1 VALUES ('p', 'x');
INSERT INTO T1 VALUES ('q', 'y');
INSERT INTO T2 VALUES ('a', 'p', 9223372036854775807);
INSERT INTO T2 VALUES ('b', 'q', -9223372036854775808);
SELECT X, SUM(C) AS D, COUNT(*) AS E FROM T2 GROUP BY X;
SELECT * FROM T1;
INSERT OR ROLLBACK INTO T2 VALUES (5, NULL, 0);
CREATE  VIEW IF NOT EXISTS v_a_4667 AS SELECT b FROM a;
ALTER TABLE T1 RENAME TO T1_r7620;
```

## Actual output

```sql
PRAGMA foreign_keys=OFF;
BEGIN;
PRAGMA writable_schema = on;
PRAGMA writable_schema = off;
COMMIT;
```

## Expectation

```sql
.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;
```

## Flag

```

```

