## 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
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (json_set(1, '$.new_key', 1), '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
.progress
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE NOT NOT (t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111) ;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;
PRAGMA user_version;
PRAGMA foreign_keys;
PRAGMA wal_checkpoint('TRUNCATE');
.dbconfig fk on
ATTACH ':memory:' AS aux1;
CREATE TABLE t1(a,b); INSERT INTO t1 VALUES(CAST(2.718281828459045 AS INTEGER),'x1');
CREATE TABLE t2(a,b); INSERT INTO t2 VALUES(222,'x2');
CREATE TEMP TABLE t3(a,b); INSERT INTO t3 VALUES(333,'x3');
CREATE TABLE main.t4(a,b); INSERT INTO main.t4 VALUES(444,'x4');
CREATE TABLE aux1.t4(a,b); INSERT INTO aux1.t4 VALUES(555,'x5');
UPDATE t2 SET a=111;
UPDATE t3 SET a=111;
UPDATE t4 SET a=111;
SELECT * FROM (t1), (t2), (t3), (t4) WHERE t4.a=t3.a+111 AND t3.a=t2.a+111 AND t2.a=t1.a+111;

CREATE TRIGGER IF NOT EXISTS trg_t3_9085 AFTER UPDATE OF a ON t3 BEGIN SELECT RAISE(ROLLBACK, 'rb'); END;
DROP VIEW IF EXISTS t4;
ANALYZE t1;
ALTER TABLE t2 RENAME COLUMN b TO b_r8876;

SELECT COUNT(*) FROM t1;
SELECT COUNT(*) OVER (ORDER BY b ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM t1;
SELECT * FROM t3;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t2_1814 ON t2(lower(a)) WHERE a IS NOT NULL;

INSERT INTO t3 DEFAULT VALUES;
WITH cte AS (SELECT NULL AS x) SELECT * FROM cte;
```

## 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

```
-vfs unix-none
```

