## Summary **No review yet** ## Minimized query ```sql 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 TEXT, 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; ``` ## Actual output ```sql Number of output columns: 0 Memory Used: 79920 (max 79920) bytes Number of Outstanding Allocations: 158 (max 158) Number of Pcache Overflow Bytes: 16928 (max 16928) bytes Largest Allocation: 48000 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 40 (max 80) Successful lookaside attempts: 143 Lookaside failures due to size: 0 Lookaside failures due to OOM: 0 Pager Heap Usage: 18496 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(): 5192 Read() system calls: 13 Write() system calls: 184 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 Number of output columns: 0 Memory Used: 92136 (max 92136) bytes Number of Outstanding Allocations: 175 (max 175) Number of Pcache Overflow Bytes: 25392 (max 25392) bytes Largest Allocation: 48000 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 41 (max 81) Successful lookaside attempts: 200 Lookaside failures due to size: 0 Lookaside failures due to OOM: 0 Pager Heap Usage: 27744 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(): 10509 Bytes sent to write(): 7245 Read() system calls: 15 Write() system calls: 210 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 Number of output columns: 0 Memory Used: 92136 (max 92136) bytes Number of Outstanding Allocations: 175 (max 175) Number of Pcache Overflow Bytes: 25392 (max 25392) bytes Largest Allocation: 48000 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 38 (max 81) Successful lookaside attempts: 205 Lookaside failures due to size: 0 Lookaside failures due to OOM: 0 Pager Heap Usage: 27744 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(): 10609 Bytes sent to write(): 8582 Read() system calls: 17 Write() system calls: 211 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 Number of output columns: 0 Memory Used: 103352 (max 104904) bytes Number of Outstanding Allocations: 197 (max 211) Number of Pcache Overflow Bytes: 33856 (max 33856) bytes Largest Allocation: 48000 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 35 (max 91) Successful lookaside attempts: 280 Lookaside failures due to size: 0 Lookaside failures due to OOM: 0 Pager Heap Usage: 32088 bytes Page cache hits: 4 Page cache misses: 0 Page cache writes: 0 Page cache spills: 0 Schema Heap Usage: 1784 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(): 10965 Bytes sent to write(): 12303 Read() system calls: 20 Write() system calls: 300 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: TEXT 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: 108072 (max 210816) bytes Number of Outstanding Allocations: 187 (max 211) Number of Pcache Overflow Bytes: 33856 (max 42064) bytes Largest Allocation: 87200 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 76 (max 123) Successful lookaside attempts: 434 Lookaside failures due to size: 2 Lookaside failures due to OOM: 0 Pager Heap Usage: 32088 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(): 11066 Bytes sent to write(): 15325 Read() system calls: 22 Write() system calls: 359 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 Number of output columns: 0 Memory Used: 100920 (max 210816) bytes Number of Outstanding Allocations: 185 (max 211) Number of Pcache Overflow Bytes: 33856 (max 42064) bytes Largest Allocation: 87200 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 40 (max 123) Successful lookaside attempts: 437 Lookaside failures due to size: 2 Lookaside failures due to OOM: 0 Pager Heap Usage: 32088 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(): 11167 Bytes sent to write(): 17050 Read() system calls: 24 Write() system calls: 362 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 Number of output columns: 0 Memory Used: 100920 (max 210816) bytes Number of Outstanding Allocations: 185 (max 211) Number of Pcache Overflow Bytes: 33856 (max 42064) bytes Largest Allocation: 87200 bytes Largest Pcache Allocation: 4360 bytes Lookaside Slots Used: 40 (max 123) Successful lookaside attempts: 442 Lookaside failures due to size: 2 Lookaside failures due to OOM: 0 Pager Heap Usage: 32088 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(): 11268 Bytes sent to write(): 18391 Read() system calls: 26 Write() system calls: 363 Bytes read from storage: 0 Bytes written to storage: 0 Cancelled write bytes: 0 ``` ## Expectation ```sql ``` ## Flag ``` -memtrace ```