## 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
ATTACH DATABASE (':memory:' || '') AS aux9;
.nullvalue cos(2)32327d3-536b-41de-a764-a6301986aeab
PRAGMA query_only = OFF;
PRAGMA reverse_unordered_selects = NO;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (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
PRAGMA count_changes = 0;
BEGIN DEFERRED TRANSACTION;
CREATE TABLE t61(a);
CREATE TABLE t62(b);
INSERT INTO t61 VALUES(json_array(like('*111', 111), 111));
INSERT INTO t62 VALUES(222);
SELECT a FROM t61 WHERE 0 UNION ALL SELECT b FROM t62;
SELECT a FROM t61 UNION SELECT b FROM t62 WHERE 0;
SELECT a FROM t61 WHERE 0 UNION SELECT b FROM t62;
COMMIT;
SELECT COUNT(*) FROM t61;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t61;
SELECT AVG(b) FROM t62;
VACUUM;
SELECT a FROM t61 INTERSECT SELECT a FROM (SELECT * FROM t61) AS sub;
SELECT COUNT(*) FROM t61;
ALTER TABLE t61 ADD COLUMN extra_8289 SMALLINT DEFAULT (abs(random()) % 1000);
ALTER TABLE t61 RENAME COLUMN a TO a_r2610;
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;
SELECT COUNT(*) FILTER (WHERE a IS NOT NULL), SUM(rowid) FILTER (WHERE a > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(a) FILTER (WHERE a > 0 AND a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t61;
ALTER TABLE t61 RENAME COLUMN a TO a_r2555;
SELECT NTH_VALUE(a, a) OVER (PARTITION BY a ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t61;
SELECT COUNT(*) FROM t61;
CREATE TABLE T1 (
  A VARCHAR(20),
  X VARCHAR(10),
  PRIMARY KEY (A, X)
);
CREATE TABLE T2 (
  A VARCHAR(20),
  Y VARCHAR(10),
  PRIMARY KEY (A, Y)
);
INSERT INTO T1 VALUES ('a', 'm');
INSERT INTO T1 VALUES ('b', 'n');
INSERT INTO T1 VALUES ('c', 'o');
INSERT INTO T2 VALUES ('b', 'k');
SELECT A FROM T1 EXCEPT SELECT A FROM T2;
VACUUM;
SELECT A FROM T2 UNION SELECT A FROM (SELECT * FROM T2) AS sub;
SELECT COUNT(b) FILTER (WHERE b IS NOT NULL) OVER (PARTITION BY b ORDER BY b ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
PRAGMA query_only = ON;
DETACH DATABASE aux9;
VACUUM main;
```

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

```

```

