1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix some errors in the guttman versions (disabled by default) of the algorithms in rtree.c.

FossilOrigin-Name: 64bad00b4f6fbbc3e5e75966f9c3959ad3d542ef
This commit is contained in:
dan
2009-10-05 05:40:08 +00:00
parent 02470b20f3
commit 4ec56ff0ce
3 changed files with 14 additions and 11 deletions

View File

@ -1486,8 +1486,8 @@ static void LinearPickSeeds(
** variables iLeftSeek and iRightSeed.
*/
for(i=0; i<pRtree->nDim; i++){
float x1 = aCell[0].aCoord[i*2];
float x2 = aCell[0].aCoord[i*2+1];
float x1 = DCOORD(aCell[0].aCoord[i*2]);
float x2 = DCOORD(aCell[0].aCoord[i*2+1]);
float x3 = x1;
float x4 = x2;
int jj;
@ -1496,8 +1496,8 @@ static void LinearPickSeeds(
int iCellRight = 0;
for(jj=1; jj<nCell; jj++){
float left = aCell[jj].aCoord[i*2];
float right = aCell[jj].aCoord[i*2+1];
float left = DCOORD(aCell[jj].aCoord[i*2]);
float right = DCOORD(aCell[jj].aCoord[i*2+1]);
if( left<x1 ) x1 = left;
if( right>x4 ) x4 = right;
@ -1855,6 +1855,9 @@ static int splitNodeGuttman(
int i;
aiUsed = sqlite3_malloc(sizeof(int)*nCell);
if( !aiUsed ){
return SQLITE_NOMEM;
}
memset(aiUsed, 0, sizeof(int)*nCell);
PickSeeds(pRtree, aCell, nCell, &iLeftSeed, &iRightSeed);