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:
@ -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{
|
||||
|
Reference in New Issue
Block a user