## 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
.stats on
CREATE TABLE `T` (
  a TEXT,
  b REAL
);
INSERT INTO T VALUES ('' || ('a'),power(100.0, 100.0)), ('b',-200.5), ('c',9e999);
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
SELECT a,b,
LEAD(b,1) OVER (ORDER BY b DESC) AS c,
NTILE(2) OVER (ORDER BY b DESC) AS d FROM T;
PRAGMA query_only;
INSERT INTO T VALUES (1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;

SELECT COUNT(*) FROM t1;
SELECT * FROM T;

SELECT COUNT(*) FROM t1;
ANALYZE;
ALTER TABLE T RENAME TO T_r9134;
SELECT MIN(a) FILTER (WHERE a IS NOT NULL) OVER (ORDER BY a GROUPS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) FROM T;
INSERT INTO T SELECT * FROM T;
ANALYZE T;

SELECT COUNT(*) FROM T;
```

## Actual output

```sql
Memory Used:                         78896 (max 80448) bytes
Number of Outstanding Allocations:   162 (max 176)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                32 (max 88)
Successful lookaside attempts:       107
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1008 bytes
Statement Heap/Lookaside Usage:      2432 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               30
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2432
Bytes received by read():            7557
Bytes sent to write():               0
Read() system calls:                 14
Write() system calls:                0
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         76488 (max 82168) bytes
Number of Outstanding Allocations:   151 (max 176)
Number of Pcache Overflow Bytes:     16928 (max 16928) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                48 (max 88)
Successful lookaside attempts:       158
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13592 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1032 bytes
Statement Heap/Lookaside Usage:      5264 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               38
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        5264
Bytes received by read():            7651
Bytes sent to write():               1293
Read() system calls:                 16
Write() system calls:                1
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         83664 (max 89344) bytes
Number of Outstanding Allocations:   172 (max 187)
Number of Pcache Overflow Bytes:     21288 (max 21288) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                32 (max 88)
Successful lookaside attempts:       233
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17936 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1360 bytes
Statement Heap/Lookaside Usage:      2480 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               28
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2480
Bytes received by read():            7748
Bytes sent to write():               2589
Read() system calls:                 18
Write() system calls:                2
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81208 (max 89344) bytes
Number of Outstanding Allocations:   161 (max 187)
Number of Pcache Overflow Bytes:     21288 (max 21288) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                41 (max 88)
Successful lookaside attempts:       255
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17936 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1384 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            7845
Bytes sent to write():               3885
Read() system calls:                 20
Write() system calls:                3
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81208 (max 89344) bytes
Number of Outstanding Allocations:   161 (max 187)
Number of Pcache Overflow Bytes:     21288 (max 21288) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                41 (max 88)
Successful lookaside attempts:       277
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17936 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1384 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            7942
Bytes sent to write():               5181
Read() system calls:                 22
Write() system calls:                4
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81208 (max 89344) bytes
Number of Outstanding Allocations:   161 (max 187)
Number of Pcache Overflow Bytes:     21288 (max 21288) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                41 (max 88)
Successful lookaside attempts:       299
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17936 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1384 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            8039
Bytes sent to write():               6477
Read() system calls:                 24
Write() system calls:                5
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         88616 (max 98408) bytes
Number of Outstanding Allocations:   181 (max 193)
Number of Pcache Overflow Bytes:     25648 (max 25648) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                32 (max 92)
Successful lookaside attempts:       379
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22280 bytes
Page cache hits:                     5
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1584 bytes
Statement Heap/Lookaside Usage:      2768 bytes
Fullscan Steps:                      0
Sort Operations:                     1
Autoindex Inserts:                   0
Virtual Machine Steps:               56
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2768
Bytes received by read():            8136
Bytes sent to write():               7773
Read() system calls:                 26
Write() system calls:                6
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         85776 (max 98408) bytes
Number of Outstanding Allocations:   164 (max 193)
Number of Pcache Overflow Bytes:     25648 (max 25648) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                35 (max 92)
Successful lookaside attempts:       384
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22280 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   1584 bytes
Statement Heap/Lookaside Usage:      2528 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               4
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2528
Bytes received by read():            8233
Bytes sent to write():               9069
Read() system calls:                 28
Write() system calls:                7
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               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!
Braun|30|3
Wernher|10|1
von|20|2
Memory Used:                         86336 (max 98408) bytes
Number of Outstanding Allocations:   174 (max 193)
Number of Pcache Overflow Bytes:     25648 (max 25648) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                45 (max 97)
Successful lookaside attempts:       507
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22280 bytes
Page cache hits:                     5
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   2128 bytes
Statement Heap/Lookaside Usage:      4752 bytes
Fullscan Steps:                      2
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               21
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        4752
Bytes received by read():            8330
Bytes sent to write():               10515
Read() system calls:                 30
Write() system calls:                9
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Braun|30
Wernher|10
von|20
Memory Used:                         86360 (max 98408) bytes
Number of Outstanding Allocations:   175 (max 193)
Number of Pcache Overflow Bytes:     25648 (max 25648) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4360 bytes
Lookaside Slots Used:                45 (max 97)
Successful lookaside attempts:       546
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22280 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Schema Heap Usage:                   2152 bytes
Statement Heap/Lookaside Usage:      4752 bytes
Fullscan Steps:                      2
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               19
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        4752
Bytes received by read():            8428
Bytes sent to write():               11845
Read() system calls:                 32
Write() system calls:                10
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Expectation

```sql
Memory Used:                         79416 (max 80952) bytes
Number of Outstanding Allocations:   172 (max 186)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                48 (max 97)
Successful lookaside attempts:       116
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   856 bytes
Statement Heap/Lookaside Usage:      2312 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               30
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2312
Bytes received by read():            8077
Bytes sent to write():               0
Read() system calls:                 14
Write() system calls:                0
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         77112 (max 82744) bytes
Number of Outstanding Allocations:   161 (max 186)
Number of Pcache Overflow Bytes:     16936 (max 16936) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                64 (max 97)
Successful lookaside attempts:       170
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    13608 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   864 bytes
Statement Heap/Lookaside Usage:      5264 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               38
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        5264
Bytes received by read():            8171
Bytes sent to write():               1331
Read() system calls:                 16
Write() system calls:                1
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         84096 (max 89728) bytes
Number of Outstanding Allocations:   182 (max 197)
Number of Pcache Overflow Bytes:     21304 (max 21304) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                48 (max 97)
Successful lookaside attempts:       238
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17960 bytes
Page cache hits:                     4
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1128 bytes
Statement Heap/Lookaside Usage:      2352 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               28
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2352
Bytes received by read():            8268
Bytes sent to write():               2665
Read() system calls:                 18
Write() system calls:                2
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81752 (max 89728) bytes
Number of Outstanding Allocations:   171 (max 197)
Number of Pcache Overflow Bytes:     21304 (max 21304) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                57 (max 97)
Successful lookaside attempts:       260
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17960 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1136 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            8365
Bytes sent to write():               4000
Read() system calls:                 20
Write() system calls:                3
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81752 (max 89728) bytes
Number of Outstanding Allocations:   171 (max 197)
Number of Pcache Overflow Bytes:     21304 (max 21304) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                57 (max 97)
Successful lookaside attempts:       282
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17960 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1136 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            8462
Bytes sent to write():               5335
Read() system calls:                 22
Write() system calls:                4
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         81752 (max 89728) bytes
Number of Outstanding Allocations:   171 (max 197)
Number of Pcache Overflow Bytes:     21304 (max 21304) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                57 (max 97)
Successful lookaside attempts:       304
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    17960 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1136 bytes
Statement Heap/Lookaside Usage:      3296 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               16
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        3296
Bytes received by read():            8559
Bytes sent to write():               6670
Read() system calls:                 24
Write() system calls:                5
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         88968 (max 98696) bytes
Number of Outstanding Allocations:   189 (max 201)
Number of Pcache Overflow Bytes:     25672 (max 25672) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                48 (max 101)
Successful lookaside attempts:       377
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22312 bytes
Page cache hits:                     5
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1344 bytes
Statement Heap/Lookaside Usage:      2576 bytes
Fullscan Steps:                      0
Sort Operations:                     1
Autoindex Inserts:                   0
Virtual Machine Steps:               56
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2576
Bytes received by read():            8656
Bytes sent to write():               8005
Read() system calls:                 26
Write() system calls:                6
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Memory Used:                         86328 (max 98696) bytes
Number of Outstanding Allocations:   174 (max 201)
Number of Pcache Overflow Bytes:     25672 (max 25672) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                51 (max 101)
Successful lookaside attempts:       382
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22312 bytes
Page cache hits:                     0
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1344 bytes
Statement Heap/Lookaside Usage:      2528 bytes
Fullscan Steps:                      0
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               5
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        2528
Bytes received by read():            8753
Bytes sent to write():               9341
Read() system calls:                 28
Write() system calls:                7
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
CREATE TABLE "t2"("b","c","_ROWID_",PRIMARY KEY("b","c","_ROWID_"))WITHOUT ROWID;
Braun|30|3
Wernher|10|1
von|20|2
Memory Used:                         86808 (max 98696) bytes
Number of Outstanding Allocations:   184 (max 201)
Number of Pcache Overflow Bytes:     25672 (max 25672) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                58 (max 102)
Successful lookaside attempts:       495
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22312 bytes
Page cache hits:                     5
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1824 bytes
Statement Heap/Lookaside Usage:      4368 bytes
Fullscan Steps:                      2
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               21
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        4368
Bytes received by read():            8850
Bytes sent to write():               10758
Read() system calls:                 30
Write() system calls:                9
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
Braun|30
Wernher|10
von|20
Memory Used:                         86816 (max 98696) bytes
Number of Outstanding Allocations:   185 (max 201)
Number of Pcache Overflow Bytes:     25672 (max 25672) bytes
Largest Allocation:                  48000 bytes
Largest Pcache Allocation:           4368 bytes
Lookaside Slots Used:                59 (max 102)
Successful lookaside attempts:       532
Lookaside failures due to size:      0
Lookaside failures due to OOM:       0
Pager Heap Usage:                    22312 bytes
Page cache hits:                     2
Page cache misses:                   0
Page cache writes:                   0
Page cache spills:                   0
Temporary data spilled to disk:      0
Schema Heap Usage:                   1832 bytes
Statement Heap/Lookaside Usage:      4496 bytes
Fullscan Steps:                      2
Sort Operations:                     0
Autoindex Inserts:                   0
Virtual Machine Steps:               19
Reprepare operations:                0
Number of times run:                 1
Memory used by prepared stmt:        4496
Bytes received by read():            8948
Bytes sent to write():               12128
Read() system calls:                 32
Write() system calls:                10
Bytes read from storage:             0
Bytes written to storage:            0
Cancelled write bytes:               0
```

## Flag

```

```

