---
This commit is contained in:
@@ -0,0 +1,393 @@
|
||||
## 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
|
||||
.separator >_<
|
||||
PRAGMA vdbe_addoptrace = FALSE;
|
||||
.stats stmt
|
||||
ATTACH DATABASE ':memory:' AS aux56;
|
||||
ATTACH DATABASE ':memory:' AS aux27;
|
||||
.timeout -'' || ('(TRUE,FALSE,TRUE)')
|
||||
PRAGMA writable_schema = OFF;
|
||||
CREATE TABLE T (
|
||||
a NCHAR(55),
|
||||
b INTEGER,
|
||||
c REAL
|
||||
);
|
||||
INSERT INTO T VALUES (('a' || ''),tanh(CAST(-if(json_object(), tanh((ifnull(-6319771376691463085, 923705717145647826) + 0)), 0, 2963755845960712660, 0, 2963755845960712660) AS INT8)),2.0), ('a',2,-3.0), ('b',1,4.5);
|
||||
SELECT a,b,c,
|
||||
SUM(c) OVER (
|
||||
PARTITION BY a
|
||||
ORDER BY b
|
||||
) AS d
|
||||
FROM T;
|
||||
.vfsname
|
||||
BEGIN;
|
||||
PRAGMA short_column_names = OFF;
|
||||
.exit
|
||||
ATTACH DATABASE ':memory:' AS aux62;
|
||||
SAVEPOINT sp6973;
|
||||
-- LEAD({c}, 1)
|
||||
|
||||
DROP TABLE IF EXISTS [t1];
|
||||
CREATE TABLE `t1`(a int, b int);
|
||||
INSERT INTO t1 VALUES(-(-((-(-(atan(x''))) + x'a40e787b7f72951e0f6dd7b5d643c6'))),1.7976931348623157e+308),(1,18),(2,19);
|
||||
SELECT x, y FROM (SELECT 98 AS x, 99 AS y unIOn SELECT a AS x, sum(b) AS y FROM t1 GROup BY a) AS w WHERE +y>=20 ORDER BY +x;
|
||||
SELECT x, y FROM (SELECT a AS x, sum(b) AS y FROM t1 /* PRAGMA table_list("users"); */ GROUP BY a UNION SELECT 98 AS x, 99 AS y) AS w WHERE y>=20 ORDER BY +x;
|
||||
|
||||
CREATE TABLE T (
|
||||
a INTEGER,
|
||||
b TEXT,
|
||||
c REAL
|
||||
);
|
||||
INSERT INTO T VALUES (1,'a',3.14), (1,'b',-7.75), (2,'c',-9e999);
|
||||
SELECT b,a,c,
|
||||
RANK() OVER (PARTITION BY a ORDER BY c DESC) AS d FROM T;
|
||||
ROLLBACK TRANSACTION TO SAVEPOINT sp6973;
|
||||
RELEASE SAVEPOINT sp6973;
|
||||
VACUUM;
|
||||
DELETE FROM T WHERE c IS NULL;
|
||||
DETACH DATABASE aux62;
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_T_838 ON T((c + 1));
|
||||
ALTER TABLE T RENAME COLUMN b TO b_r1344;
|
||||
UPDATE t1 SET b = b + 1;
|
||||
END TRANSACTION;
|
||||
CREATE TRIGGER IF NOT EXISTS trg_T_3819 AFTER INSERT ON T BEGIN SELECT RAISE(IGNORE); END;
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_t1_3293 ON t1(lower(b));
|
||||
INSERT INTO t1 VALUES (NULL, NULL);
|
||||
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 OR a < 100), COUNT(*) FILTER (WHERE typeof(a) = "text") FROM t1;
|
||||
SELECT * FROM (SELECT * FROM t1) AS sub;
|
||||
SELECT MAX(b) FROM t1;
|
||||
REINDEX;
|
||||
INSERT OR FAIL INTO t1 VALUES (0, -2);
|
||||
INSERT OR ROLLBACK INTO t1 VALUES (8, -5);
|
||||
SELECT COUNT(*) FROM T;
|
||||
CREATE TRIGGER IF NOT EXISTS trg_t1_4965 BEFORE INSERT ON t1 FOR EACH ROW BEGIN SELECT RAISE(IGNORE); END;
|
||||
SELECT COUNT(*) FROM t1;
|
||||
ALTER TABLE T ADD COLUMN extra_8976 BIGINT UNIQUE;
|
||||
REINDEX;
|
||||
CREATE INDEX IF NOT EXISTS idx_t1_3226 ON t1((b + 1));
|
||||
SELECT SUM(a) OVER (PARTITION BY a ORDER BY a) FROM T;
|
||||
INSERT INTO T DEFAULT VALUES;
|
||||
ALTER TABLE t1 ADD COLUMN extra_4827 TEXT DEFAULT 0;
|
||||
REINDEX;
|
||||
INSERT INTO t1 VALUES (1, NULL) ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
|
||||
SELECT * FROM T WHERE c > ALL (SELECT c FROM T);
|
||||
DELETE FROM t1 WHERE a > (SELECT AVG(a) FROM t1) RETURNING *;
|
||||
SELECT * FROM T AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
|
||||
SELECT TOTAL(b) FROM T;
|
||||
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
|
||||
DROP TRIGGER IF EXISTS T;
|
||||
CREATE TABLE T (
|
||||
a INTEGER,
|
||||
b TEXT,
|
||||
c REAL,
|
||||
d REAL
|
||||
);
|
||||
INSERT INTO T VALUES (1,'a',40.5,-70.0), (2,'b',-10.25,20.5), (3,'c',9e999,-9e999);
|
||||
SELECT b FROM T WHERE ABS(c) > 5 AND ABS(d) > 5;
|
||||
SELECT * FROM T NATURAL JOIN t1;
|
||||
ALTER TABLE T ADD COLUMN extra_337 NUMERIC UNIQUE;
|
||||
|
||||
SELECT COUNT(*) FROM t1;
|
||||
REINDEX T;
|
||||
INSERT INTO t1 VALUES (NULL, 'x') ON CONFLICT(a) DO UPDATE SET a = excluded.a, b = excluded.b;
|
||||
ALTER TABLE T DROP COLUMN d;
|
||||
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;
|
||||
ALTER TABLE t1 RENAME TO t1_r2448;
|
||||
DETACH DATABASE aux27;
|
||||
ALTER TABLE t1 ADD COLUMN extra_3451 DOUBLE PRECISION DEFAULT CURRENT_TIMESTAMP;
|
||||
ALTER TABLE t1 RENAME COLUMN a TO a_r2483;
|
||||
CREATE TABLE T (
|
||||
A VARCHAR(20),
|
||||
B VARCHAR(30),
|
||||
C VARCHAR(30),
|
||||
PRIMARY KEY (A, B),
|
||||
UNIQUE (A, C)
|
||||
);
|
||||
INSERT INTO T VALUES ('a', 'p', 'x');
|
||||
INSERT INTO T VALUES ('a', 'q', 'y');
|
||||
INSERT INTO T VALUES ('b', 'p', 'z');
|
||||
INSERT INTO T VALUES ('c', 'r', 'w');
|
||||
INSERT INTO T VALUES ('d', 's', 'v');
|
||||
SELECT A, COUNT(DISTINCT B) AS D FROM T GROUP BY A HAVING COUNT(DISTINCT B) >= 1;
|
||||
INSERT INTO t1 DEFAULT VALUES;
|
||||
SELECT * FROM t1 AS a LEFT OUTER JOIN t1 AS b ON a.rowid = b.rowid;
|
||||
ANALYZE;
|
||||
SELECT * FROM t1;
|
||||
ANALYZE;
|
||||
SELECT TOTAL(a) FROM t1;
|
||||
VACUUM main;
|
||||
|
||||
SELECT COUNT(*) FROM T;
|
||||
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;
|
||||
ALTER TABLE T RENAME TO T_r9755;
|
||||
SELECT * FROM T WHERE A IN (SELECT A FROM T WHERE A IS NULL);
|
||||
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 COUNT(*) FROM T;
|
||||
SELECT A, (SELECT MAX(A) FROM T) AS max_val FROM T;
|
||||
DETACH DATABASE aux56;
|
||||
SELECT * FROM t1 WHERE a > (SELECT COUNT(*) FROM t1);
|
||||
CREATE TRIGGER IF NOT EXISTS trg_t1_9637 AFTER UPDATE OF b ON t1 BEGIN SELECT RAISE(FAIL, 'no'); END;
|
||||
CREATE TRIGGER IF NOT EXISTS trg_t1_8499 BEFORE UPDATE ON t1 FOR EACH ROW BEGIN INSERT INTO t1(b) VALUES (NULL); END;
|
||||
DROP TRIGGER IF EXISTS t1;
|
||||
ANALYZE T;
|
||||
ALTER TABLE t1 ADD COLUMN extra_9877 UNSIGNED BIG INT DEFAULT 0;
|
||||
|
||||
SELECT COUNT(*) FROM T;
|
||||
SELECT * FROM T;
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_T_6459 ON T(lower(B)) WHERE B > 0;
|
||||
DELETE FROM t1 WHERE 1 RETURNING *;
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SELECT A FROM T EXCEPT SELECT A FROM (SELECT * FROM T) AS sub;
|
||||
SELECT COUNT(*) OVER (PARTITION BY B ORDER BY B ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING EXCLUDE CURRENT ROW) FROM T;
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_t1_4113 ON t1(a COLLATE NOCASE);
|
||||
SELECT * FROM t1 AS a RIGHT JOIN T AS b ON a.rowid = b.rowid;
|
||||
```
|
||||
|
||||
## Actual output
|
||||
|
||||
```sql
|
||||
Number of output columns: 0
|
||||
Memory Used: 162824 (max 162824) bytes
|
||||
Number of Outstanding Allocations: 159 (max 159)
|
||||
Number of Pcache Overflow Bytes: 12568 (max 12568) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 40 (max 80)
|
||||
Successful lookaside attempts: 151
|
||||
Lookaside failures due to size: 0
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 18480 bytes
|
||||
Page cache hits: 0
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1104 bytes
|
||||
Statement Heap/Lookaside Usage: 2912 bytes
|
||||
Fullscan Steps: 0
|
||||
Sort Operations: 0
|
||||
Autoindex Inserts: 0
|
||||
Virtual Machine Steps: 7
|
||||
Reprepare operations: 0
|
||||
Number of times run: 1
|
||||
Memory used by prepared stmt: 2912
|
||||
Bytes received by read(): 10409
|
||||
Bytes sent to write(): 0
|
||||
Read() system calls: 13
|
||||
Write() system calls: 0
|
||||
Bytes read from storage: 0
|
||||
Bytes written to storage: 0
|
||||
Cancelled write bytes: 0
|
||||
Number of output columns: 0
|
||||
Memory Used: 175040 (max 175040) bytes
|
||||
Number of Outstanding Allocations: 176 (max 176)
|
||||
Number of Pcache Overflow Bytes: 21032 (max 21032) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 41 (max 81)
|
||||
Successful lookaside attempts: 208
|
||||
Lookaside failures due to size: 0
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 27728 bytes
|
||||
Page cache hits: 0
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1472 bytes
|
||||
Statement Heap/Lookaside Usage: 2912 bytes
|
||||
Fullscan Steps: 0
|
||||
Sort Operations: 0
|
||||
Autoindex Inserts: 0
|
||||
Virtual Machine Steps: 7
|
||||
Reprepare operations: 0
|
||||
Number of times run: 1
|
||||
Memory used by prepared stmt: 2912
|
||||
Bytes received by read(): 10504
|
||||
Bytes sent to write(): 1334
|
||||
Read() system calls: 15
|
||||
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: 175040 (max 175040) bytes
|
||||
Number of Outstanding Allocations: 176 (max 176)
|
||||
Number of Pcache Overflow Bytes: 21032 (max 21032) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 38 (max 81)
|
||||
Successful lookaside attempts: 213
|
||||
Lookaside failures due to size: 0
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 27728 bytes
|
||||
Page cache hits: 0
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1472 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(): 10602
|
||||
Bytes sent to write(): 2671
|
||||
Read() system calls: 17
|
||||
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: 190112 (max 191664) bytes
|
||||
Number of Outstanding Allocations: 198 (max 212)
|
||||
Number of Pcache Overflow Bytes: 25136 (max 25136) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 35 (max 91)
|
||||
Successful lookaside attempts: 288
|
||||
Lookaside failures due to size: 0
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 32072 bytes
|
||||
Page cache hits: 5
|
||||
Page cache misses: 0
|
||||
Page cache writes: 2
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1784 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(): 10956
|
||||
Bytes sent to write(): 4008
|
||||
Read() system calls: 20
|
||||
Write() system calls: 3
|
||||
Bytes read from storage: 0
|
||||
Bytes written to storage: 0
|
||||
Cancelled write bytes: 0
|
||||
Number of output columns: 4
|
||||
Column 0 name: a
|
||||
Column 0 declared type: NCHAR(55)
|
||||
Column 1 name: b
|
||||
Column 1 declared type: INTEGER
|
||||
Column 2 name: c
|
||||
Column 2 declared type: REAL
|
||||
Column 3 name: d
|
||||
Column 3 declared type: (null)
|
||||
Memory Used: 194816 (max 297560) bytes
|
||||
Number of Outstanding Allocations: 188 (max 212)
|
||||
Number of Pcache Overflow Bytes: 25136 (max 33344) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 76 (max 123)
|
||||
Successful lookaside attempts: 442
|
||||
Lookaside failures due to size: 2
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 32072 bytes
|
||||
Page cache hits: 2
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1784 bytes
|
||||
Statement Heap/Lookaside Usage: 28400 bytes
|
||||
Fullscan Steps: 0
|
||||
Sort Operations: 1
|
||||
Autoindex Inserts: 0
|
||||
Virtual Machine Steps: 25
|
||||
Reprepare operations: 0
|
||||
Number of times run: 1
|
||||
Memory used by prepared stmt: 28400
|
||||
Bytes received by read(): 11054
|
||||
Bytes sent to write(): 5523
|
||||
Read() system calls: 22
|
||||
Write() system calls: 6
|
||||
Bytes read from storage: 0
|
||||
Bytes written to storage: 0
|
||||
Cancelled write bytes: 0
|
||||
memdb(55953895C8A0,8192)
|
||||
Number of output columns: 0
|
||||
Memory Used: 187664 (max 297560) bytes
|
||||
Number of Outstanding Allocations: 186 (max 212)
|
||||
Number of Pcache Overflow Bytes: 25136 (max 33344) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 40 (max 123)
|
||||
Successful lookaside attempts: 445
|
||||
Lookaside failures due to size: 2
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 32072 bytes
|
||||
Page cache hits: 0
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1784 bytes
|
||||
Statement Heap/Lookaside Usage: 2528 bytes
|
||||
Fullscan Steps: 0
|
||||
Sort Operations: 0
|
||||
Autoindex Inserts: 0
|
||||
Virtual Machine Steps: 2
|
||||
Reprepare operations: 0
|
||||
Number of times run: 1
|
||||
Memory used by prepared stmt: 2528
|
||||
Bytes received by read(): 11152
|
||||
Bytes sent to write(): 7223
|
||||
Read() system calls: 24
|
||||
Write() system calls: 8
|
||||
Bytes read from storage: 0
|
||||
Bytes written to storage: 0
|
||||
Cancelled write bytes: 0
|
||||
Number of output columns: 0
|
||||
Memory Used: 187664 (max 297560) bytes
|
||||
Number of Outstanding Allocations: 186 (max 212)
|
||||
Number of Pcache Overflow Bytes: 25136 (max 33344) bytes
|
||||
Largest Allocation: 87200 bytes
|
||||
Largest Pcache Allocation: 4360 bytes
|
||||
Lookaside Slots Used: 40 (max 123)
|
||||
Successful lookaside attempts: 450
|
||||
Lookaside failures due to size: 2
|
||||
Lookaside failures due to OOM: 0
|
||||
Pager Heap Usage: 32072 bytes
|
||||
Page cache hits: 0
|
||||
Page cache misses: 0
|
||||
Page cache writes: 0
|
||||
Page cache spills: 0
|
||||
Schema Heap Usage: 1784 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(): 11250
|
||||
Bytes sent to write(): 8561
|
||||
Read() system calls: 26
|
||||
Write() system calls: 9
|
||||
Bytes read from storage: 0
|
||||
Bytes written to storage: 0
|
||||
Cancelled write bytes: 0
|
||||
```
|
||||
|
||||
## Expectation
|
||||
|
||||
```sql
|
||||
|
||||
```
|
||||
|
||||
## Flag
|
||||
|
||||
```
|
||||
-deserialize
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user