From: drh <> Date: Thu, 16 Sep 2021 20:16:39 +0000 (+0000) Subject: Minor changes to rtree.c so that we can get full branch coverage even when X-Git-Tag: version-3.37.0~221 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e4616c2808f6ef36cb65c534d6683ac00a7092e;p=thirdparty%2Fsqlite.git Minor changes to rtree.c so that we can get full branch coverage even when it is compiled without geopoly. FossilOrigin-Name: f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13 --- diff --git a/ext/rtree/rtree.c b/ext/rtree/rtree.c index 6d67cc8234..f79759a97a 100644 --- a/ext/rtree/rtree.c +++ b/ext/rtree/rtree.c @@ -149,7 +149,9 @@ struct Rtree { u8 nBytesPerCell; /* Bytes consumed per cell */ u8 inWrTrans; /* True if inside write transaction */ u8 nAux; /* # of auxiliary columns in %_rowid */ +#ifdef SQLITE_ENABLE_GEOPOLY u8 nAuxNotNull; /* Number of initial not-null aux columns */ +#endif #ifdef SQLITE_DEBUG u8 bCorrupt; /* Shadow table corruption detected */ #endif @@ -754,7 +756,7 @@ static int nodeAcquire( ** are the leaves, and so on. If the depth as specified on the root node ** is greater than RTREE_MAX_DEPTH, the r-tree structure must be corrupt. */ - if( pNode && rc==SQLITE_OK && iNode==1 ){ + if( rc==SQLITE_OK && pNode && iNode==1 ){ pRtree->iDepth = readInt16(pNode->zData); if( pRtree->iDepth>RTREE_MAX_DEPTH ){ rc = SQLITE_CORRUPT_VTAB; @@ -3585,9 +3587,12 @@ static int rtreeSqlInit( sqlite3_str_appendf(p, "UPDATE \"%w\".\"%w_rowid\"SET ", zDb, zPrefix); for(ii=0; iinAux; ii++){ if( ii ) sqlite3_str_append(p, ",", 1); +#ifdef SQLITE_ENABLE_GEOPOLY if( iinAuxNotNull ){ sqlite3_str_appendf(p,"a%d=coalesce(?%d,a%d)",ii,ii+2,ii); - }else{ + }else +#endif + { sqlite3_str_appendf(p,"a%d=?%d",ii,ii+2); } } @@ -4526,7 +4531,10 @@ int sqlite3_rtree_query_callback( /* Allocate and populate the context object. */ pGeomCtx = (RtreeGeomCallback *)sqlite3_malloc(sizeof(RtreeGeomCallback)); - if( !pGeomCtx ) return SQLITE_NOMEM; + if( !pGeomCtx ){ + if( xDestructor ) xDestructor(pContext); + return SQLITE_NOMEM; + } pGeomCtx->xGeom = 0; pGeomCtx->xQueryFunc = xQueryFunc; pGeomCtx->xDestructor = xDestructor; diff --git a/manifest b/manifest index 63815faf16..8a4f34bf3c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\stests\sto\srtreedoc.test. -D 2021-09-16T19:50:54.219 +C Minor\schanges\sto\srtree.c\sso\sthat\swe\scan\sget\sfull\sbranch\scoverage\seven\swhen\nit\sis\scompiled\swithout\sgeopoly. +D 2021-09-16T20:16:39.322 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -393,7 +393,7 @@ F ext/repair/test/checkindex01.test b530f141413b587c9eb78ff734de6bb79bc3515c3350 F ext/repair/test/test.tcl 686d76d888dffd021f64260abf29a55c57b2cedfa7fc69150b42b1d6119aac3c F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 F ext/rtree/geopoly.c 98d45533989e908bf65b43f36ff6eaad95a9ffe6f3b6b8658fbd47d45c58b10b -F ext/rtree/rtree.c c9e2c4b76254948c71843e97409f3b6f10a7f7b275d3a28cbd68a81eba9fcfe1 +F ext/rtree/rtree.c 6355ecf9a7c2f03501b654ce4dab0051407fc89fb952eec62cd0269287bd9076 F ext/rtree/rtree.h 4a690463901cb5e6127cf05eb8e642f127012fd5003830dbc974eca5802d9412 F ext/rtree/rtree1.test 00792b030a4e188ff1b22e8530e8aa0452bb5dd81c2b18cb004afc7dc63e040e F ext/rtree/rtree2.test 9d9deddbb16fd0c30c36e6b4fdc3ee3132d765567f0f9432ee71e1303d32603d @@ -1923,7 +1923,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 778e4499cdf2083d5431738099dedf0aade9271f661e09ca3278e0109bb1e720 -R 92f596b0c2b55c4ff0e3043aa7947d4f -U dan -Z 5c7af90e72a7c8251816ff925369f022 +P b18c6ec46079520e0db8b42586ce9370a4038d0b4f719cfb98488037883e2537 +R 2ef66f05e1dd549dbc74c3eeb808a314 +U drh +Z a0503148f3351d6802e79a654b59f6d6 diff --git a/manifest.uuid b/manifest.uuid index 19fdc7ffff..fd4160bac2 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b18c6ec46079520e0db8b42586ce9370a4038d0b4f719cfb98488037883e2537 \ No newline at end of file +f05ae9b5864459493154037d2c902d203c4a43007b5d61bd4beb1eed56e06d13 \ No newline at end of file