summaryrefslogtreecommitdiffstats
path: root/ext/rtree/rtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/rtree/rtree.c')
-rw-r--r--ext/rtree/rtree.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c
index 02127fa..299b5b5 100644
--- a/ext/rtree/rtree.c
+++ b/ext/rtree/rtree.c
@@ -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.
*/
@@ -1870,7 +1872,8 @@ static int rtreeFilter(
i64 iNode = 0;
int eType = sqlite3_value_numeric_type(argv[0]);
if( eType==SQLITE_INTEGER
- || (eType==SQLITE_FLOAT && sqlite3_value_double(argv[0])==iRowid)
+ || (eType==SQLITE_FLOAT
+ && 0==sqlite3IntFloatCompare(iRowid,sqlite3_value_double(argv[0])))
){
rc = findLeafNode(pRtree, iRowid, &pLeaf, &iNode);
}else{
@@ -3225,6 +3228,7 @@ constraint:
*/
static int rtreeBeginTransaction(sqlite3_vtab *pVtab){
Rtree *pRtree = (Rtree *)pVtab;
+ assert( pRtree->inWrTrans==0 );
pRtree->inWrTrans = 1;
return SQLITE_OK;
}