summaryrefslogtreecommitdiffstats
path: root/ext/rtree
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:16:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 05:16:44 +0000
commit62a67b10ff9f9eea6a4695649fb8252d2a4bc74d (patch)
tree7b54cadc082d323cda5fd24248e85b7d2ea664a3 /ext/rtree
parentAdding debian version 3.45.3-1. (diff)
downloadsqlite3-62a67b10ff9f9eea6a4695649fb8252d2a4bc74d.tar.xz
sqlite3-62a67b10ff9f9eea6a4695649fb8252d2a4bc74d.zip
Merging upstream version 3.46.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ext/rtree')
-rw-r--r--ext/rtree/rtree.c6
-rw-r--r--ext/rtree/rtree1.test18
2 files changed, 23 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;
}
diff --git a/ext/rtree/rtree1.test b/ext/rtree/rtree1.test
index 61664e1..e596df7 100644
--- a/ext/rtree/rtree1.test
+++ b/ext/rtree/rtree1.test
@@ -797,4 +797,22 @@ do_test 23.0 {
db eval {PRAGMA integrity_check;}
} {ok}
+reset_db
+do_execsql_test 24.0 {
+ CREATE VIRTUAL TABLE rt1 USING rtree_i32(rid, c1, c2);
+ INSERT INTO rt1(rid, c1, c2) VALUES (9223372036854775807, 10, 18);
+}
+
+do_execsql_test 24.1 {
+ SELECT (rid = (CAST (9223372036854775807 AS REAL)))
+ FROM rt1 WHERE
+ (rid = (CAST (9223372036854775807 AS REAL)));
+}
+
+do_execsql_test 24.2 {
+ DELETE FROM rt1;
+ INSERT INTO rt1(rid, c1, c2) VALUES(1,2,3);
+ SELECT * FROM rt1 WHERE rid=1.005;
+} {}
+
finish_test