## 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
SAVEPOINT sp4002;
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
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
PRAGMA query_only;
ATTACH DATABASE ((':memory:' || '') || '') AS aux80;
.scanstats on
PRAGMA page_count;
SAVEPOINT sp1489;
PRAGMA parser_trace = FALSE;
PRAGMA wal_checkpoint('TRUNCATE');
PRAGMA cell_size_check = ON;
.eqp auto
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 JOIN agg2 ON t1.y=agg2.m WHERE t1.x IN (date(nan, 'start of month'),hex(12345678),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);
INSERT INTO t1 VALUES (NULL, NULL, NULL);
UPDATE t1 SET y = json_object('k', y) WHERE rowid = 1;
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) noT NULL,
  C DOUBLE PRECISION
);
INSERT INTO T VALUES ('a', 'p', -1.7976931348623157e+308);
INSERT INTO T VALUES ('b', 'q', -0.000000001);
INSERT INTO T VALUES ('c', 'r', 0.0);
INSERT INTO T VALUES ('d', 's', 3.14159265358979);
INSERT INTO T VALUES ('e', 't', 1.7976931348623157e+308);
INSERT INTO T VALUES ('f', 't', 750.25);
SELECT B, AVG(C) AS D, MIN(C) AS E, MAX(C) /* NTILE(4) */ AS F FROM T GROUP BY B;
RELEASE sp1489;
INSERT INTO t2 SELECT * FROM t2;
SELECT MAX(b) FROM t2;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
SELECT * FROM t2 AS a LEFT JOIN t2 AS b ON a.rowid = b.rowid;
SELECT C, (SELECT MAX(C) FROM T) AS max_val FROM T;
SELECT * FROM t2 WHERE a IN (SELECT a FROM t2 t2 WHERE t2.a = t2.a);
WITH cte AS (SELECT * FROM t2 WHERE a = (SELECT MAX(a) FROM t2)) SELECT * FROM cte;
ALTER TABLE T RENAME TO T_r974;
CREATE TEMP  VIEW IF NOT EXISTS v_T_9533 AS SELECT B FROM T;
DETACH DATABASE aux80;
INSERT INTO t920 VALUES (NULL);
ANALYZE t2;
UPDATE t1 SET x = x + 1 WHERE x BETWEEN 0 AND 100;
ANALYZE;
CREATE TRIGGER IF NOT EXISTS trg_T_7612 AFTER DELETE ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
UPDATE T SET C = json_object('k', C);
SELECT LAG(B, 2, B) OVER (ORDER BY B ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
SELECT MIN(y) FROM t1;
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
ALTER TABLE t920 RENAME TO t920_r731;
SELECT SUM(b) FROM t2;
SELECT NTILE(1) OVER (ORDER BY B ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM T;
VACUUM;
INSERT OR FAIL INTO t920 VALUES (-4);
SELECT TOTAL(b) FROM t2;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_6556 AS SELECT y FROM t1;
PRAGMA journal_mode = 'TRUNCATE';
CREATE  VIEW IF NOT EXISTS v_t920_142 AS SELECT x FROM t920;
ROLLBACK TRANSACTION TO SAVEPOINT sp4002;
RELEASE SAVEPOINT sp4002;
WITH cte AS (SELECT DISTINCT a FROM T) SELECT * FROM cte;
PRAGMA legacy_file_format;
SAVEPOINT sp4002;
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
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c INTEGER
);
INSERT INTO T VALUES (1,'a',NULL), (2,'b',1), (3,'c',2);
WITH RECURSIVE d(a,b,c,e) AS (
  SELECT *,1 FROM T WHERE c IS NULL
  UNION ALL
  SELECT T.a,T.b,T.c,d.e+1
  FROM T JOIN d ON T.c=d.a
)
SELECT * FROM d;
PRAGMA query_only;
ATTACH DATABASE ((':memory:' || '') || '') AS aux80;
.scanstats on
PRAGMA page_count;
SAVEPOINT sp1489;
PRAGMA parser_trace = FALSE;
PRAGMA wal_checkpoint('TRUNCATE');
PRAGMA cell_size_check = ON;
.eqp auto
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 JOIN agg2 ON t1.y=agg2.m WHERE t1.x IN (date(nan, 'start of month'),hex(12345678),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);
INSERT INTO t1 VALUES (NULL, NULL, NULL);
UPDATE t1 SET y = json_object('k', y) WHERE rowid = 1;
CREATE TABLE T (
  A VARCHAR(10) PRIMARY KEY,
  B VARCHAR(15) noT NULL,
  C DOUBLE PRECISION
);
INSERT INTO T VALUES ('a', 'p', -1.7976931348623157e+308);
INSERT INTO T VALUES ('b', 'q', -0.000000001);
INSERT INTO T VALUES ('c', 'r', 0.0);
INSERT INTO T VALUES ('d', 's', 3.14159265358979);
INSERT INTO T VALUES ('e', 't', 1.7976931348623157e+308);
INSERT INTO T VALUES ('f', 't', 750.25);
SELECT B, AVG(C) AS D, MIN(C) AS E, MAX(C) /* NTILE(4) */ AS F FROM T GROUP BY B;
RELEASE sp1489;
INSERT INTO t2 SELECT * FROM t2;
SELECT MAX(b) FROM t2;
SELECT * FROM t1 AS a INNER JOIN t2 AS b ON a.rowid = b.rowid;
SELECT * FROM t2 AS a LEFT JOIN t2 AS b ON a.rowid = b.rowid;
SELECT C, (SELECT MAX(C) FROM T) AS max_val FROM T;
SELECT * FROM t2 WHERE a IN (SELECT a FROM t2 t2 WHERE t2.a = t2.a);
WITH cte AS (SELECT * FROM t2 WHERE a = (SELECT MAX(a) FROM t2)) SELECT * FROM cte;
ALTER TABLE T RENAME TO T_r974;
CREATE TEMP  VIEW IF NOT EXISTS v_T_9533 AS SELECT B FROM T;
DETACH DATABASE aux80;
INSERT INTO t920 VALUES (NULL);
ANALYZE t2;
UPDATE t1 SET x = x + 1 WHERE x BETWEEN 0 AND 100;
ANALYZE;
CREATE TRIGGER IF NOT EXISTS trg_T_7612 AFTER DELETE ON T FOR EACH ROW BEGIN SELECT RAISE(FAIL, 'no'); END;
UPDATE T SET C = json_object('k', C);
SELECT LAG(B, 2, B) OVER (ORDER BY B ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE GROUP) FROM T;
SELECT MIN(y) FROM t1;
CREATE TABLE T (
  a INTEGER,
  b REAL
);
INSERT INTO T VALUES (1,1.5), (2,-7.25), (3,0.0);
SELECT a,b FROM T WHERE a >= 2 ORDER BY b;
ALTER TABLE t920 RENAME TO t920_r731;
SELECT SUM(b) FROM t2;
SELECT NTILE(1) OVER (ORDER BY B ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW EXCLUDE TIES) FROM T;
VACUUM;
INSERT OR FAIL INTO t920 VALUES (-4);
SELECT TOTAL(b) FROM t2;
CREATE TEMP  VIEW IF NOT EXISTS v_t1_6556 AS SELECT y FROM t1;
PRAGMA journal_mode = 'TRUNCATE';
CREATE  VIEW IF NOT EXISTS v_t920_142 AS SELECT x FROM t920;
ROLLBACK TRANSACTION TO SAVEPOINT sp4002;
RELEASE SAVEPOINT sp4002;
WITH cte AS (SELECT DISTINCT a FROM T) SELECT * FROM cte;
PRAGMA legacy_file_format;

CREATE  VIEW IF NOT EXISTS v_t1_4937 AS SELECT y FROM t1;
INSERT INTO t920 VALUES (NULL);
```

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

```

```

