## 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 aux78;
ATTACH DATABASE ':memory:' AS aux16;
ATTACH DATABASE ':memory:' AS aux83;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a DATE PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((-(-(jsonb_array(-(-(2147483646))))) + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
CREATE TABLE main.T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',1.25), (2,'b',-3.5), (3,'c',0.0);
SELECT * FROM T WHERE c < 2.0 ORDER BY c;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',5.0), ('a','c',5.0), ('b','d',-8.25);
SELECT a,b,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
DETACH DATABASE aux83;
UPDATE t1 SET a = CURRENT_TIMESTAMP WHERE a IS NOT NULL;
REINDEX T;
DELETE FROM t1 WHERE 1;
CREATE TRIGGER IF NOT EXISTS trg_T_4302 AFTER UPDATE OF c ON T BEGIN INSERT INTO T(c) VALUES (NULL); END;
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 T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_8442 ON t1(a) WHERE a IS NOT NULL;
ATTACH DATABASE ':memory:' AS aux83;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a DATE PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((-(-(jsonb_array(2147483646))) + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
CREATE TABLE T (
  a INTEGER,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES (1,'a',1.25), (2,'b',-3.5), (3,'c',0.0);
SELECT * FROM T WHERE c < 2.0 ORDER BY c;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
CREATE TABLE T (
  a TEXT,
  b TEXT,
  c REAL
);
INSERT INTO T VALUES ('a','b',5.0), ('a','c',5.0), ('b','d',-8.25);
SELECT a,b,c,
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
PRAGMA short_column_names = OFF;
SAVEPOINT sp7579;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((0 + 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
ALTER TABLE t1 RENAME COLUMN d TO d_r9880;
ROLLBACK TO sp7579;
RELEASE sp7579;
INSERT AND ABORT INTO t1 VALUES /**/ ('', '', 'x', 0);
INSERT INTO t1 SELECT * FROM t1;
DETACH DATABASE aux83;
UPDATE t1 SET a = CURRENT_TIMESTAMP WHERE a IS NOT NULL;
REINDEX T;
DELETE FROM t1 WHERE 1;
CREATE TRIGGER IF NOT EXISTS trg_T_4302 AFTER UPDATE OF c ON T BEGIN INSERT INTO T(c) VALUES (NULL); END;
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 T;
CREATE UNIQUE  INDEX IF NOT EXISTS idx_t1_8442 ON t1(a) WHERE a IS NOT NULL;
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;
DETACH DATABASE aux16;
DELETE FROM T WHERE 1;
WITH RECURSIVE vals(x) AS (SELECT a FROM t1 WHERE a IS NOT NULL UNION ALL SELECT a FROM t1 WHERE a IS NOT NULL LIMIT 10) SELECT * FROM vals;
SELECT * FROM T WHERE EXISTS (SELECT 1 FROM T WHERE 1 = 0);
DETACH DATABASE aux78;
DROP TRIGGER IF EXISTS t1;
SELECT * FROM T;
SELECT COUNT(*) FROM T;
SELECT a FROM T WHERE a = (SELECT MAX(a) FROM T);
INSERT INTO T DEFAULT VALUES;
SELECT * FROM T;
REINDEX t1;
```

## 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|2
von|20|1
Braun|30
von|20
```

## Expectation

```sql

```

## Flag

```

```

