1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

When a floating-point RTREE is presented with large integer constraints -

integers that are too big to be represented exactly by a float - then take
extra steps to ensure that all possibly relevant entries in the RTREE are
returned, even in boundary cases.  Fix for the problem identified by
[forum:/forumpost/da70ee0d0d|forum post da70ee0d0d].

FossilOrigin-Name: bfd8d9100015f3e3fb011698963d670bd89b64ec8a8ab931e0c6c3076b029377
This commit is contained in:
drh
2023-05-22 16:35:21 +00:00
parent b838a229be
commit 0503cd6d11
4 changed files with 42 additions and 14 deletions

View File

@ -770,4 +770,18 @@ do_execsql_test 21.1 {
SELECT x1=9223372036854775807 FROM t1;
} {0}
# 2023-05-22 https://sqlite.org/forum/forumpost/da70ee0d0d
# Round-off error associated with using large integer constraints on
# a rtree search.
#
reset_db
do_execsql_test 22.0 {
CREATE VIRTUAL TABLE t1 USING rtree ( id, x0, x1 );
INSERT INTO t1 VALUES (123, 9223372036854775799, 9223372036854775800);
SELECT id FROM t1 WHERE x0 > 9223372036854775807;
} {123}
do_execsql_test 22.1 {
SELECT id, x0 > 9223372036854775807 AS 'a0' FROM t1;
} {123 1}
finish_test