SQLite Forum

Incorrect query results
Login

Incorrect query results

(1) By xiangwei on 2023-05-22 07:34:02 [source]

I.PoC

CREATE VIRTUAL TABLE v0 USING rtree ( c1, c2, c3 );  
INSERT INTO v0 VALUES ( 127, 9223372036854775807, 9223372036854775800); 
SELECT COUNT ( * ) FROM v0 WHERE c2 > 9223372036854775807; 
SELECT sum(c2 > 9223372036854775807) AS 'total' FROM v0;

II.Results

SELECT COUNT ( * ) FROM v0 WHERE c2 > 9223372036854775807;
--- result: 0

SELECT sum(c2 > 9223372036854775807) AS 'total' FROM v0;
--- result: 1

III. Reproduce

SQLite version:         3.43.0 2023-05-19 18:23:53
(a6ab50bc42c09e373efb441916fb2793c6fe8054)
Build platform: 	Ubuntu 22.04.2 LTS
Build steps:            ./configure & make