482 lines
19 KiB
Markdown
482 lines
19 KiB
Markdown
## 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 temp_store = 'MEMORY';
|
|
PRAGMA read_uncommitted;
|
|
PRAGMA user_version = -1.0;
|
|
.stats stmt
|
|
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
|
|
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1);
|
|
INSERT INTO t1 VALUES(1,'apple'),(2,'fig'),(3,'pear');
|
|
INSERT INTO t2 VALUES(1,1.0,2.0),(2,2.0,3.0),(3,1.5,3.5);
|
|
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN
|
|
DELETE FROM t2 WHERE id = OLD.a;
|
|
END;
|
|
ALTER TABLE t1 RENAME TO t3;
|
|
UPDATE t3 SET b='peach' WHERE a=2;
|
|
|
|
```
|
|
|
|
## Actual output
|
|
|
|
```sql
|
|
0
|
|
Number of output columns: 0
|
|
Memory Used: 78896 (max 84576) 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: 125
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 13592 bytes
|
|
Page cache hits: 6
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 1008 bytes
|
|
Statement Heap/Lookaside Usage: 2448 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: 2448
|
|
Bytes received by read(): 7014
|
|
Bytes sent to write(): 2
|
|
Read() system calls: 14
|
|
Write() system calls: 1
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 107344 (max 114664) bytes
|
|
Number of Outstanding Allocations: 264 (max 279)
|
|
Number of Pcache Overflow Bytes: 30008 (max 30008) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 34 (max 92)
|
|
Successful lookaside attempts: 463
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26624 bytes
|
|
Page cache hits: 14
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2304 bytes
|
|
Statement Heap/Lookaside Usage: 15448 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 31
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 2736
|
|
Bytes received by read(): 7108
|
|
Bytes sent to write(): 1334
|
|
Read() system calls: 16
|
|
Write() system calls: 2
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 104632 (max 114664) bytes
|
|
Number of Outstanding Allocations: 253 (max 279)
|
|
Number of Pcache Overflow Bytes: 30008 (max 30008) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 46 (max 92)
|
|
Successful lookaside attempts: 496
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26624 bytes
|
|
Page cache hits: 2
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2328 bytes
|
|
Statement Heap/Lookaside Usage: 17464 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 47
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 4752
|
|
Bytes received by read(): 7205
|
|
Bytes sent to write(): 2673
|
|
Read() system calls: 18
|
|
Write() system calls: 3
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 104632 (max 115312) bytes
|
|
Number of Outstanding Allocations: 253 (max 279)
|
|
Number of Pcache Overflow Bytes: 30008 (max 30008) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 45 (max 92)
|
|
Successful lookaside attempts: 550
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26624 bytes
|
|
Page cache hits: 13
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2328 bytes
|
|
Statement Heap/Lookaside Usage: 17336 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 35
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 4624
|
|
Bytes received by read(): 7302
|
|
Bytes sent to write(): 4011
|
|
Read() system calls: 20
|
|
Write() system calls: 4
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 106808 (max 115312) bytes
|
|
Number of Outstanding Allocations: 271 (max 281)
|
|
Number of Pcache Overflow Bytes: 30008 (max 30008) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 34 (max 92)
|
|
Successful lookaside attempts: 624
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26624 bytes
|
|
Page cache hits: 3
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2792 bytes
|
|
Statement Heap/Lookaside Usage: 14416 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 15
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 1704
|
|
Bytes received by read(): 7399
|
|
Bytes sent to write(): 5350
|
|
Read() system calls: 22
|
|
Write() system calls: 5
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 137168 (max 196992) bytes
|
|
Number of Outstanding Allocations: 306 (max 374)
|
|
Number of Pcache Overflow Bytes: 42576 (max 80280) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 102 (max 123)
|
|
Successful lookaside attempts: 950
|
|
Lookaside failures due to size: 3
|
|
Lookaside failures due to OOM: 184
|
|
Pager Heap Usage: 35840 bytes
|
|
Page cache hits: 11
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2752 bytes
|
|
Statement Heap/Lookaside Usage: 60328 bytes
|
|
Fullscan Steps: 15
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 323
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 47616
|
|
Bytes received by read(): 7496
|
|
Bytes sent to write(): 6688
|
|
Read() system calls: 24
|
|
Write() system calls: 6
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 120920 (max 196992) bytes
|
|
Number of Outstanding Allocations: 269 (max 374)
|
|
Number of Pcache Overflow Bytes: 42576 (max 80280) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4360 bytes
|
|
Lookaside Slots Used: 51 (max 123)
|
|
Successful lookaside attempts: 1009
|
|
Lookaside failures due to size: 3
|
|
Lookaside failures due to OOM: 184
|
|
Pager Heap Usage: 35840 bytes
|
|
Page cache hits: 7
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Schema Heap Usage: 2776 bytes
|
|
Statement Heap/Lookaside Usage: 19304 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 33
|
|
Reprepare operations: 0
|
|
Number of times run: 2
|
|
Memory used by prepared stmt: 6592
|
|
Bytes received by read(): 7593
|
|
Bytes sent to write(): 8034
|
|
Read() system calls: 26
|
|
Write() system calls: 7
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
```
|
|
|
|
## Expectation
|
|
|
|
```sql
|
|
0
|
|
Number of output columns: 0
|
|
Memory Used: 79424 (max 85056) 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: 134
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 13608 bytes
|
|
Page cache hits: 6
|
|
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: 2320 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: 2320
|
|
Bytes received by read(): 7534
|
|
Bytes sent to write(): 2
|
|
Read() system calls: 14
|
|
Write() system calls: 1
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 107400 (max 114552) bytes
|
|
Number of Outstanding Allocations: 273 (max 288)
|
|
Number of Pcache Overflow Bytes: 30040 (max 30040) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 50 (max 101)
|
|
Successful lookaside attempts: 444
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26664 bytes
|
|
Page cache hits: 14
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Temporary data spilled to disk: 0
|
|
Schema Heap Usage: 2136 bytes
|
|
Statement Heap/Lookaside Usage: 14880 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 31
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 2600
|
|
Bytes received by read(): 7628
|
|
Bytes sent to write(): 1372
|
|
Read() system calls: 16
|
|
Write() system calls: 2
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 104808 (max 114552) bytes
|
|
Number of Outstanding Allocations: 262 (max 288)
|
|
Number of Pcache Overflow Bytes: 30040 (max 30040) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 62 (max 101)
|
|
Successful lookaside attempts: 480
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26664 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: 2144 bytes
|
|
Statement Heap/Lookaside Usage: 17032 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 47
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 4752
|
|
Bytes received by read(): 7725
|
|
Bytes sent to write(): 2751
|
|
Read() system calls: 18
|
|
Write() system calls: 3
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 104808 (max 115400) bytes
|
|
Number of Outstanding Allocations: 262 (max 288)
|
|
Number of Pcache Overflow Bytes: 30040 (max 30040) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 61 (max 101)
|
|
Successful lookaside attempts: 537
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26664 bytes
|
|
Page cache hits: 13
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Temporary data spilled to disk: 0
|
|
Schema Heap Usage: 2144 bytes
|
|
Statement Heap/Lookaside Usage: 16904 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 35
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 4624
|
|
Bytes received by read(): 7822
|
|
Bytes sent to write(): 4129
|
|
Read() system calls: 20
|
|
Write() system calls: 4
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 106848 (max 115400) bytes
|
|
Number of Outstanding Allocations: 280 (max 290)
|
|
Number of Pcache Overflow Bytes: 30040 (max 30040) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 50 (max 101)
|
|
Successful lookaside attempts: 604
|
|
Lookaside failures due to size: 0
|
|
Lookaside failures due to OOM: 0
|
|
Pager Heap Usage: 26664 bytes
|
|
Page cache hits: 3
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Temporary data spilled to disk: 0
|
|
Schema Heap Usage: 2576 bytes
|
|
Statement Heap/Lookaside Usage: 13888 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 15
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 1608
|
|
Bytes received by read(): 7919
|
|
Bytes sent to write(): 5508
|
|
Read() system calls: 22
|
|
Write() system calls: 5
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 136600 (max 195320) bytes
|
|
Number of Outstanding Allocations: 290 (max 367)
|
|
Number of Pcache Overflow Bytes: 42608 (max 80312) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 98 (max 123)
|
|
Successful lookaside attempts: 923
|
|
Lookaside failures due to size: 3
|
|
Lookaside failures due to OOM: 142
|
|
Pager Heap Usage: 35896 bytes
|
|
Page cache hits: 11
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Temporary data spilled to disk: 0
|
|
Schema Heap Usage: 2560 bytes
|
|
Statement Heap/Lookaside Usage: 49104 bytes
|
|
Fullscan Steps: 15
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 323
|
|
Reprepare operations: 0
|
|
Number of times run: 1
|
|
Memory used by prepared stmt: 36824
|
|
Bytes received by read(): 8016
|
|
Bytes sent to write(): 6886
|
|
Read() system calls: 24
|
|
Write() system calls: 6
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
Number of output columns: 0
|
|
Memory Used: 121064 (max 195320) bytes
|
|
Number of Outstanding Allocations: 277 (max 367)
|
|
Number of Pcache Overflow Bytes: 42608 (max 80312) bytes
|
|
Largest Allocation: 48000 bytes
|
|
Largest Pcache Allocation: 4368 bytes
|
|
Lookaside Slots Used: 67 (max 123)
|
|
Successful lookaside attempts: 982
|
|
Lookaside failures due to size: 3
|
|
Lookaside failures due to OOM: 142
|
|
Pager Heap Usage: 35896 bytes
|
|
Page cache hits: 7
|
|
Page cache misses: 0
|
|
Page cache writes: 0
|
|
Page cache spills: 0
|
|
Temporary data spilled to disk: 0
|
|
Schema Heap Usage: 2568 bytes
|
|
Statement Heap/Lookaside Usage: 18872 bytes
|
|
Fullscan Steps: 0
|
|
Sort Operations: 0
|
|
Autoindex Inserts: 0
|
|
Virtual Machine Steps: 33
|
|
Reprepare operations: 0
|
|
Number of times run: 2
|
|
Memory used by prepared stmt: 6592
|
|
Bytes received by read(): 8113
|
|
Bytes sent to write(): 8270
|
|
Read() system calls: 26
|
|
Write() system calls: 7
|
|
Bytes read from storage: 0
|
|
Bytes written to storage: 0
|
|
Cancelled write bytes: 0
|
|
```
|
|
|
|
## Flag
|
|
|
|
```
|
|
|
|
```
|
|
|