## 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 IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((timediff(cosh(3478141930399736400), 1) - 0), '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 foreign_keys = NO;
CREATE TABLE main.t1(a);
INSERT INTO t1 VALUES(json_remove(replace(log(6.283185307179586), 'a', ''), '$.key', '$[0]'));
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;

ANALYZE t1;
SELECT LAG(a, 0, 'default') OVER (ORDER BY a) FROM t1;
DROP TRIGGER IF EXISTS t1;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT * FROM t1 AS a FULL OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM t1 WHERE a IS NULL RETURNING *;

SELECT COUNT(*) FROM t1;
VACUUM;
UPDATE t1 SET a = a + 1 WHERE 1 RETURNING *;
CREATE /**/ INDEX IF NOT EXISTS idx_t1_5174 ON t1(a) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_2103 BEFORE UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA vdbe_listing = NO;
VACUUM;
ROLLBACK;
INSERT OR FAIL INTO t1 VALUES ('x');
CREATE TRIGGER IF NOT EXISTS trg_t1_1650 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((timediff(cosh(1), 1) - 0), '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 foreign_keys = NO;
CREATE TABLE main.t1(a);
INSERT INTO t1 VALUES(json_remove(replace(log(6.283185307179586), 'a', ''), '$.key', '$[0]'));
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;

ANALYZE t1;
SELECT LAG(a, 0, 'default') OVER (ORDER BY a) FROM t1;
DROP TRIGGER IF EXISTS t1;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT * FROM t1 AS a FULL OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM t1 WHERE a IS NULL RETURNING *;

SELECT COUNT(*) FROM t1;
VACUUM;
UPDATE t1 SET a = a + 1 WHERE 1 RETURNING *;
CREATE /**/ INDEX IF NOT EXISTS idx_t1_5174 ON t1(a) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_2103 BEFORE UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA vdbe_listing = NO;
VACUUM;
ROLLBACK;
INSERT OR FAIL INTO t1 VALUES ('x');
CREATE TRIGGER IF NOT EXISTS trg_t1_1650 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((timediff(cosh(1), 1) - 0), '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 foreign_keys = NO;
CREATE TABLE main.t1(a);
INSERT INTO t1 VALUES(json_remove(replace(log(6.283185307179586), 'a', ''), '$.key', '$[0]'));
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;

ANALYZE t1;
SELECT LAG(a, 0, 'default') OVER (ORDER BY a) FROM t1;
DROP TRIGGER IF EXISTS t1;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT * FROM t1 AS a FULL OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM t1 WHERE a IS NULL RETURNING *;

SELECT COUNT(*) FROM t1;
VACUUM;
UPDATE t1 SET a = a + 1 WHERE 1 RETURNING *;
CREATE /**/ INDEX IF NOT EXISTS idx_t1_5174 ON t1(a) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_2103 BEFORE UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA vdbe_listing = NO;
VACUUM;
ROLLBACK;
INSERT OR FAIL INTO t1 VALUES ('x');
CREATE TRIGGER IF NOT EXISTS trg_t1_1650 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((timediff(cosh(1), 1) - 0), '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 foreign_keys = NO;
CREATE TABLE main.t1(a);
INSERT INTO t1 VALUES(json_remove(replace(log(6.283185307179586), 'a', ''), '$.key', '$[0]'));
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;

ANALYZE t1;
SELECT LAG(a, 0, 'default') OVER (ORDER BY a) FROM t1;
DROP TRIGGER IF EXISTS t1;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT * FROM t1 AS a FULL OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM t1 WHERE a IS NULL RETURNING *;

SELECT COUNT(*) FROM t1;
VACUUM;
UPDATE t1 SET a = a + 1 WHERE 1 RETURNING *;
CREATE /**/ INDEX IF NOT EXISTS idx_t1_5174 ON t1(a) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_2103 BEFORE UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA vdbe_listing = NO;
VACUUM;
ROLLBACK;
INSERT OR FAIL INTO t1 VALUES ('x');
CREATE TRIGGER IF NOT EXISTS trg_t1_1650 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;
BEGIN IMMEDIATE;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES ((timediff(cosh(1), 1) - 0), '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 foreign_keys = NO;
CREATE TABLE main.t1(a);
INSERT INTO t1 VALUES(json_remove(replace(log(6.283185307179586), 'a', ''), '$.key', '$[0]'));
ALTER TABLE t1 ADD COLUMN b TEXT DEFAULT -123.0;
SELECT b, typeof(b) FROM t1;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT -123.5;
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'hello';
SELECT c, typeof(c) FROM t1;

ANALYZE t1;
SELECT LAG(a, 0, 'default') OVER (ORDER BY a) FROM t1;
DROP TRIGGER IF EXISTS t1;
SELECT SUM(a) FILTER (WHERE a > 0) OVER (ORDER BY a RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING EXCLUDE NO OTHERS) FROM t1;
SELECT * FROM t1 AS a FULL OUTER JOIN t1 AS b ON a.rowid = b.rowid;
DELETE FROM t1 WHERE a IS NULL RETURNING *;

SELECT COUNT(*) FROM t1;
VACUUM;
UPDATE t1 SET a = a + 1 WHERE 1 RETURNING *;
CREATE /**/ INDEX IF NOT EXISTS idx_t1_5174 ON t1(a) WHERE a IS NOT NULL;
CREATE TRIGGER IF NOT EXISTS trg_t1_2103 BEFORE UPDATE OF a ON t1 BEGIN SELECT RAISE(ABORT, 'abort'); END;
PRAGMA vdbe_listing = NO;
VACUUM;
ROLLBACK;
INSERT OR FAIL INTO t1 VALUES ('x');
CREATE TRIGGER IF NOT EXISTS trg_t1_1650 BEFORE DELETE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(a) VALUES (NULL); END;
CREATE VIRTUAL TABLE t0 USING fts4("x", "y", "z");
DROP TABLE t0;

WITH cte AS (SELECT a, LAG(a) OVER (ORDER BY a) AS prev FROM t1) 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
von|20|2
Braun|30
von|20
```

## Expectation

```sql

```

## Flag

```

```

