Hi,
I ran the sqlite3 test suite on ARM Linux (Ubuntu) and got a set of
failures in the
rtree2 set of tests, including the following set:
rtree2-rtree_i32.1.3 rtree2-rtree_i32.1.5.0.2
rtree2-rtree_i32.1.5.10.2 rtree2-rtree_i32.1.5.20.2
rtree2-rtree_i32.1.5.30.2 rtree2-rtree_i32.1.5.40.2
rtree2-rtree_i32.1.5.50.2
the errors all had the form of one of either:
rtree.rtree2-rtree_i32.1.3...
Error: No such node: -1094175624
and some of:
rtree.rtree2-rtree_i32.1.5.60.2...Node 1: t1_rowid entry for cell -1094175624 is
Expected: [0]
Got: [1]
(The full list is on the Ubuntu bug report I filed
https://bugs.launchpad.net/ubuntu/+source/sqlite3/+bug/725052 )
I tracked this down to ext/rtree/rtree.c rtreenode() line at line 3136:
sqlite3_snprintf(512-nCell,&zCell[nCell],"%d", cell.iRowid);
iRowid is 64bit, and that %d isn't.
I'm not familiar with the sqlite3 source, but I think that's possibly
the private sprintf code and
hence will need that changing to a %lld (rather than one of the nicer
portable macros)
--- sqlite3-3.7.4/ext/rtree/rtree.c 2010-12-07 16:24:21.000000000 +0000
+++ sqlite3-3.7.4.good/ext/rtree/rtree.c 2011-03-01 14:29:31.000000000
+0000
@@ -3133,7 +3133,7 @@
int jj;
nodeGetCell(&tree, &node, ii, &cell);
- sqlite3_snprintf(512-nCell,&zCell[nCell],"%d", cell.iRowid);
+ sqlite3_snprintf(512-nCell,&zCell[nCell],"%lld", cell.iRowid);
nCell = strlen(zCell);
for(jj=0; jj<tree.nDim*2; jj++){
sqlite3_snprintf(512-nCell,&zCell[nCell],"
%f",(double)cell.aCoord[jj].f);
That's against 3.7.4 but it looks like it's the same in the trunk.
With that change the test suite passes. However, that %f looks a bit
odd a few lines below
and is probably worth thinking about.
Dave
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users