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

Must use sqlite3IntFloatCompare() for accurate comparisons between very large

integer and floating point values in RTREE.  Otherwise the comparison does
not work on all platforms.  Further fix to [027e5336acc26f57].

FossilOrigin-Name: 820f106acff5f2cd01da0e95a0e6f2bcc087705bf8c08b730b1fdb08db5679c8
This commit is contained in:
drh
2024-03-08 03:24:09 +00:00
parent 67fc3e0ac2
commit f10de5360a
3 changed files with 13 additions and 12 deletions

View File

@ -1841,6 +1841,8 @@ static int deserializeGeometry(sqlite3_value *pValue, RtreeConstraint *pCons){
return SQLITE_OK;
}
int sqlite3IntFloatCompare(i64,double);
/*
** Rtree virtual table module xFilter method.
*/
@ -1871,8 +1873,7 @@ static int rtreeFilter(
int eType = sqlite3_value_numeric_type(argv[0]);
if( eType==SQLITE_INTEGER
|| (eType==SQLITE_FLOAT
&& (i64)(sqlite3_value_double(argv[0]))==iRowid
&& (double)iRowid==sqlite3_value_double(argv[0]))
&& 0==sqlite3IntFloatCompare(iRowid,sqlite3_value_double(argv[0])))
){
rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
}else{