## 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 cache_spill = NO;
.eqp full
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0
AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;
CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT);
INSERT INTO t1 VALUES (if(-CAST(1 AS CLOB), 1, 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
INSERT INTO t1 DEFAULT VALUES;
SELECT COUNT(a) FROM t1;
SELECT COUNT(*) FILTER (WHERE b IS NOT NULL), SUM(rowid) FILTER (WHERE b > 0), COUNT(*) FILTER (WHERE 1=0), COUNT(*) FILTER (WHERE 1=1), COUNT(*) FILTER (WHERE NULL), AVG(b) FILTER (WHERE b > 0 AND b < 100), COUNT(*) FILTER (WHERE typeof(b) = "text") FROM t1;
SELECT GROUP_CONCAT(a, '.') FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING) FROM t1;
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 t1;

UPDATE t1 SET d = json_object('k', d) WHERE d IS NOT NULL RETURNING *;
ALTER TABLE t1 RENAME TO t1_r6356;
ANALYZE;
SELECT * FROM t1;
ANALYZE;
INSERT OR IGNORE INTO t1 VALUES ('x', 0, '', '');
SELECT LAG(d, 2) OVER (PARTITION BY d ORDER BY d GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM t1;
ALTER TABLE t1 RENAME COLUMN b TO b_r6680;
REINDEX t1;
DELETE FROM t1 WHERE 0;
INSERT INTO t1 SELECT * FROM t1;
PRAGMA short_column_names = TRUE;
WITH RECURSIVE tree(id, parent, depth) AS (VALUES(1, NULL, 0) UNION ALL SELECT id+1, id, depth+1 FROM tree WHERE depth<62) SELECT * FROM tree;
CREATE TEMPORARY  VIEW IF NOT EXISTS v_t1_8626 AS SELECT c FROM t1;
```

## Actual output

```sql
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     28    0                    0   Start at 28
1     ReadCookie     0     3     2                    0   
2     If             3     5     0                    0   
3     SetCookie      0     2     4                    0   
4     SetCookie      0     5     1                    0   
5     CreateBtree    0     2     1                    0   r[2]=root iDb=0 flags=1
6     OpenWrite      0     1     0     5              0   root=1 iDb=0
7     NewRowid       0     1     0                    0   r[1]=rowid
8     Blob           6     3     0                   0   r[3]= (len=6)
9     Insert         0     3     1                    8   intkey=r[1] data=r[3]
10    Close          0     0     0                    0   
11    Close          0     0     0                    0   
12    Null           0     4     5                    0   r[4..5]=NULL
13    Noop           2     0     4                    0   
14    OpenWrite      1     1     0     5              0   root=1 iDb=0; sqlite_master
15    SeekRowid      1     17    1                    0   intkey=r[1]
16    Rowid          1     5     0                    0   r[5]=[P2]=PX rowid of P1
17    IsNull         5     25    0                    0   if r[5]==NULL goto 25
18    String8        0     6     0     table          0   r[6]='table'
19    String8        0     7     0     t1             0   r[7]='t1'
20    String8        0     8     0     t1             0   r[8]='t1'
21    SCopy          2     9     0                    0   r[9]=r[2]
22    String8        0     10    0     CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT)  0   r[10]='CREATE TABLE t1(a INTEGER PRIMARY KEY, b TEXT, c INT, d INT)'
23    MakeRecord     6     5     4     BBBDB          0   r[4]=mkrec(r[6..10])
24    Insert         1     4     5                    0   intkey=r[5] data=r[4]
25    SetCookie      0     1     1                    0   
26    ParseSchema    0     0     0     tbl_name='t1' AND type!='trigger'  0   
27    Halt           0     0     0                    0   
28    Transaction    0     1     0     0              1   usesStmtJournal=1
29    Goto           0     1     0                    0   
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     16    0                    0   Start at 16
1     OpenWrite      0     2     0     4              0   root=2 iDb=0; t1
2     SoftNull       2     0     0                    0   r[2]=NULL
3     String8        0     3     0     von            0   r[3]='von'
4     Integer        20    4     0                    0   r[4]=20
5     Integer        200   5     0                    0   r[5]=200
6     Integer        2     1     0                    0   r[1]=2
7     NotNull        1     9     0                    0   if r[1]!=NULL goto 9
8     NewRowid       0     1     0                    0   r[1]=rowid
9     MustBeInt      1     0     0                    0   
10    Noop           0     0     0                    0   uniqueness check for ROWID
11    NotExists      0     13    1                    0   intkey=r[1]
12    Halt           1555  2     0     t1.a           2   
13    MakeRecord     2     4     6     DBDD           0   r[6]=mkrec(r[2..5])
14    Insert         0     6     1     t1             49  intkey=r[1] data=r[6]
15    Halt           0     0     0                    0   
16    Transaction    0     1     1     0              1   usesStmtJournal=0
17    Goto           0     1     0                    0   
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     16    0                    0   Start at 16
1     OpenWrite      0     2     0     4              0   root=2 iDb=0; t1
2     SoftNull       2     0     0                    0   r[2]=NULL
3     String8        0     3     0     Braun          0   r[3]='Braun'
4     Integer        30    4     0                    0   r[4]=30
5     Integer        300   5     0                    0   r[5]=300
6     Integer        3     1     0                    0   r[1]=3
7     NotNull        1     9     0                    0   if r[1]!=NULL goto 9
8     NewRowid       0     1     0                    0   r[1]=rowid
9     MustBeInt      1     0     0                    0   
10    Noop           0     0     0                    0   uniqueness check for ROWID
11    NotExists      0     13    1                    0   intkey=r[1]
12    Halt           1555  2     0     t1.a           2   
13    MakeRecord     2     4     6     DBDD           0   r[6]=mkrec(r[2..5])
14    Insert         0     6     1     t1             49  intkey=r[1] data=r[6]
15    Halt           0     0     0                    0   
16    Transaction    0     1     1     0              1   usesStmtJournal=0
17    Goto           0     1     0                    0   
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     34    0                    0   Start at 34
1     Noop           0     33    0                    0   
2     CreateBtree    0     1     2                    0   r[1]=root iDb=0 flags=2
3     OpenWrite      0     1     0     5              0   root=1 iDb=0; sqlite_master
4     String8        0     3     0     index          0   r[3]='index'
5     String8        0     4     0     t1bc           0   r[4]='t1bc'
6     String8        0     5     0     t1             0   r[5]='t1'
7     SCopy          1     6     0                    0   r[6]=r[1]
8     String8        0     7     0     CREATE INDEX t1bc ON t1(b, c)  0   r[7]='CREATE INDEX t1bc ON t1(b, c)'
9     NewRowid       0     2     0                    0   r[2]=rowid
10    MakeRecord     3     5     8     BBBDB          0   r[8]=mkrec(r[3..7])
11    Insert         0     8     2                    24  intkey=r[2] data=r[8]
12    SorterOpen     3     0     2     k(3,,,)        0   
13    OpenRead       1     2     0     4              0   root=2 iDb=0; t1
14    Rewind         1     21    0                    0   
15      Column         1     1     10                   0   r[10]=t1.b
16      Column         1     2     11                   0   r[11]=t1.c
17      Rowid          1     12    0                    0   r[12]=t1.rowid
18      MakeRecord     10    3     9                    0   r[9]=mkrec(r[10..12])
19      SorterInsert   3     9     0                    0   key=r[9]
20    Next           1     15    0                    0   
21    OpenWrite      2     1     0     k(3,,,)        17  root=1 iDb=0
22    SorterSort     3     27    0                    0   
23      SorterData     3     9     2                    0   r[9]=data
24      SeekEnd        2     0     0                    0   
25      IdxInsert      2     9     0                    16  key=r[9]
26    SorterNext     3     23    0                    0   
27    Close          1     0     0                    0   
28    Close          2     0     0                    0   
29    Close          3     0     0                    0   
30    SetCookie      0     1     2                    0   
31    ParseSchema    0     0     0     name='t1bc' AND type='index'  0   
32    Expire         0     1     0                    0   
33    Halt           0     0     0                    0   
34    Transaction    0     1     1     0              1   usesStmtJournal=1
35    Goto           0     1     0                    0   
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     1     0                    0   Start at 1
1     Expire         1     1     0                    0   
2     Expire         0     0     0                    0   
3     Halt           0     0     0                    0   
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
WARNING: writing to an imposter table will corrupt the "t1bc" index!
QUERY PLAN
`--SCAN t2
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     9     0                    0   Start at 9
1     OpenRead       1     3     0     k(3,,,)        0   root=3 iDb=0; sqlite_autoindex_t2_1
2     Rewind         1     8     1     0              0   
3       Column         1     0     1                    0   r[1]=t2.b
4       Column         1     1     2                    0   r[2]=t2.c
5       Column         1     2     3                    0   r[3]=t2._ROWID_
6       ResultRow      1     3     0                    0   output=r[1..3]
7     Next           1     3     0                    1   
8     Halt           0     0     0                    0   
9     Transaction    0     0     2     0              1   usesStmtJournal=0
10    Goto           0     1     0                    0   
Braun	30	3
von	20	2
QUERY PLAN
`--SCAN t1 USING COVERING INDEX t1bc
addr  opcode         p1    p2    p3    p4             p5  comment      
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     9     0                    0   Start at 9
1     Noop           1     5     0                    0   
2     OpenRead       2     3     0     k(3,,,)        0   root=3 iDb=0; t1bc
3     Rewind         2     8     1     0              0   
4       Column         2     0     1                    0   r[1]=t1.b
5       Column         2     1     2                    0   r[2]=t1.c
6       ResultRow      1     2     0                    0   output=r[1..2]
7     Next           2     4     0                    1   
8     Halt           0     0     0                    0   
9     Transaction    0     0     2     0              1   usesStmtJournal=0
10    Goto           0     1     0                    0   
Braun	30
von	20
```

## Expectation

```sql

```

## Flag

```
-tabs
```

