## 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 checkpoint_fullsync = OFF;
CREATE TABLE T (
  a TEXT,
  b INTEGER,
  c REAL
);
INSERT INTO T VALUES ('a',1,2.0), ('a',2,-3.0), ('b',1,4.5);
SELECT a,b,c,
SUM(c) OVER (
  PARTITION BY a
  ORDER BY b
) AS d
FROM T;
VACUUM main;
VACUUM;
CREATE  INDEX IF NOT EXISTS idx_T_4915 ON T(lower(b)) WHERE b > 0;
ALTER TABLE T RENAME COLUMN c TO c_r7795;
ALTER TABLE T RENAME COLUMN b TO b_r3208;
INSERT OR REPLACE INTO T VALUES ('', NULL, 0);
SELECT GROUP_CONCAT(a, '|') FROM T;
DELETE FROM T WHERE 0;
```

## Actual output

```sql
PRAGMA foreign_keys=OFF;
BEGIN;
PRAGMA writable_schema = on;
PRAGMA writable_schema = off;
COMMIT;
a|1|2.0|2.0
a|2|-3.0|-1.0
b|1|4.5|4.5
a|a|b|
```

## 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;
a|1|2.0|2.0
a|2|-3.0|-1.0
b|1|4.5|4.5
a|a|b|
```

## Flag

```

```

