## 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
BEGIN DEFERRED TRANSACTION;
SAVEPOINT sp8273;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (log2(NULL), 'Wernher', 10, 100);
INSERT INTO t1 VALUES (2, 'von', 20, 200);
INSERT INTO t1 VALUES (3, 'Braun', 30, 300);
CREATE INDEX t1bc ON t1(b, c);
PRAGMA writable_schema = ON;
.imposter t1bc t2

SELECT * FROM t2;
SELECT b, c FROM t1 ORDER BY b, c;
.quit
BEGIN EXCLUSIVE TRANSACTION;
SAVEPOINT sp3516;
ATTACH DATABASE (':memory:' || '') AS aux52;
CREATE TABLE t1(x INTEGER PRIMARY KEY, y, z);
CREATE	TABLE t2(a, b);
CREATE VIEW agg2 AS SELECT a, sum(b) AS m FROM t2 GROUP BY a;
SELECT t1.z, agg2.m FROM t1 LEFT JOIN agg2 ON t1.y=agg2.m WHERE t1.x IN (concat(1, NULL, 1),2,3);
CREATE TABLE t920(x);
INSERT INTO t920 VALUES(3),(4),(5);
SELECT * FROM t920,(SELECT 0 FROM t920),(VALUES(9)) WHERE 5 IN (x);
CREATE  INDEX IF NOT EXISTS idx_t1_9737 ON t1(x COLLATE NOCASE);
DETACH DATABASE aux52;
REINDEX;
WITH cte AS (SELECT x, ROW_NUMBER() OVER (ORDER BY x) AS rn FROM t920) SELECT * FROM cte WHERE rn <= 5;
DELETE FROM t920 WHERE 1;
SELECT * FROM t2 AS a LEFT JOIN t2 AS b ON a.rowid = b.rowid;
ALTER TABLE t2 ADD COLUMN extra_9493 ANY DEFAULT 0;
ROLLBACK TRANSACTION TO SAVEPOINT sp3516;
RELEASE SAVEPOINT sp3516;
END;
DELETE FROM t920 WHERE 1;
SELECT SUM(x) FROM t920;
SELECT AVG(x) FROM t920;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
SELECT b,a,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
ROLLBACK TO sp8273;
RELEASE sp8273;
ROLLBACK;
INSERT AND FAIL INTO t2 VALUES (8, '');
SELECT STRING_AGG(x, '|') FROM t920;
SELECT LAST_VALUE(a) OVER (ORDER BY a ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM t2;
```

## Actual output

```sql
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Expectation

```sql
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
Braun|30|3
Wernher|10|1
von|20|2
Braun|30
Wernher|10
von|20
```

## Flag

```

```

