## 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
PRAGMA wal_checkpoint('RESTART');
.progress
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
((ATTACH)) DATABASE ':memory:' AS aux0;
CREATE TABLE t1(a int);
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text';
ALTER TABLE t1 RENAME TO t2;
ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD';

DETACH DATABASE aux0;
SELECT STRING_AGG(a, '|') FROM t1;
INSERT INTO t1 VALUES (NULL);
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
DROP TRIGGER IF EXISTS t1;
CREATE  INDEX IF NOT EXISTS idx_t1_3560 ON t1((c + 1)) WHERE c IS NOT NULL;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT * FROM t1;
ALTER TABLE t1 ADD COLUMN extra_4679 SMALLINT DEFAULT (random());
INSERT INTO t1 DEFAULT VALUES;
SELECT GROUP_CONCAT(c, '|') FROM t1;
PRAGMA wal_checkpoint('RESTART');
.progress
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
((ATTACH)) DATABASE ':memory:' AS aux0;
CREATE TABLE t1(a int);
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text';
ALTER TABLE t1 RENAME TO t2;
ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD';

DETACH DATABASE aux0;
SELECT STRING_AGG(a, '|') FROM t1;
INSERT INTO t1 VALUES (NULL);
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
DROP TRIGGER IF EXISTS t1;
CREATE  INDEX IF NOT EXISTS idx_t1_3560 ON t1((c + 1)) WHERE c IS NOT NULL;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT * FROM t1;
ALTER TABLE t1 ADD COLUMN extra_4679 SMALLINT DEFAULT (random());
INSERT INTO t1 DEFAULT VALUES;
SELECT GROUP_CONCAT(c, '|') FROM t1;
PRAGMA wal_checkpoint('RESTART');
.progress
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
((ATTACH)) DATABASE ':memory:' AS aux0;
CREATE TABLE t1(a int);
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text';
ALTER TABLE t1 RENAME TO t2;
ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD';

DETACH DATABASE aux0;
SELECT STRING_AGG(a, '|') FROM t1;
INSERT INTO t1 VALUES (NULL);
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
DROP TRIGGER IF EXISTS t1;
CREATE  INDEX IF NOT EXISTS idx_t1_3560 ON t1((c + 1)) WHERE c IS NOT NULL;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT * FROM t1;
ALTER TABLE t1 ADD COLUMN extra_4679 SMALLINT DEFAULT (random());
INSERT INTO t1 DEFAULT VALUES;
SELECT GROUP_CONCAT(c, '|') FROM t1;
PRAGMA wal_checkpoint('RESTART');
.progress
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
((ATTACH)) DATABASE ':memory:' AS aux0;
CREATE TABLE t1(a int);
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL;
ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text';
ALTER TABLE t1 RENAME TO t2;
ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD';

DETACH DATABASE aux0;
SELECT STRING_AGG(a, '|') FROM t1;
INSERT INTO t1 VALUES (NULL);
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
DROP TRIGGER IF EXISTS t1;
CREATE  INDEX IF NOT EXISTS idx_t1_3560 ON t1((c + 1)) WHERE c IS NOT NULL;
SELECT * FROM (SELECT * FROM t1) AS sub;
SELECT * FROM t1;
ALTER TABLE t1 ADD COLUMN extra_4679 SMALLINT DEFAULT (random());
INSERT INTO t1 DEFAULT VALUES;
SELECT GROUP_CONCAT(c, '|') FROM t1;

```

## Actual output

```sql
0,-1,-1
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
0,-1,-1
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

```
-quote
```

