1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Simplify some of the corrupt shadow-table detection logic in rtree.

FossilOrigin-Name: 0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc
This commit is contained in:
drh
2021-09-15 13:09:55 +00:00
parent b01f1389f2
commit 83569e2e9e
3 changed files with 9 additions and 28 deletions

View File

@ -666,18 +666,6 @@ static void nodeBlobReset(Rtree *pRtree){
}
}
/*
** Check to see if pNode is the same as pParent or any of the parents
** of pParent.
*/
static int nodeInParentChain(const RtreeNode *pNode, const RtreeNode *pParent){
do{
if( pNode==pParent ) return 1;
pParent = pParent->pParent;
}while( pParent );
return 0;
}
/*
** Obtain a reference to an r-tree node.
*/
@ -694,14 +682,7 @@ static int nodeAcquire(
** increase its reference count and return it.
*/
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
if( pParent && !pNode->pParent ){
if( nodeInParentChain(pNode, pParent) ){
RTREE_IS_CORRUPT(pRtree);
return SQLITE_CORRUPT_VTAB;
}
pParent->nRef++;
pNode->pParent = pParent;
}else if( pParent && pNode->pParent && pParent!=pNode->pParent ){
if( pParent && pParent!=pNode->pParent ){
RTREE_IS_CORRUPT(pRtree);
return SQLITE_CORRUPT_VTAB;
}

View File

@ -1,5 +1,5 @@
C Squelch\sneedless\snarrowing\swarning.
D 2021-09-15T11:15:03.010
C Simplify\ssome\sof\sthe\scorrupt\sshadow-table\sdetection\slogic\sin\srtree.
D 2021-09-15T13:09:55.282
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 0d1ef309e2bfbe469e3ee363ff9ea0420d5f7b9fcf15b5d9abb9d48a789c26f5
F ext/rtree/rtree.c 494767ec24dd29582037a813e977a67738cfb6c83501c5e8cc9187f0427e5e84
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 42dff223470e9c096b8486ef232ac41b70d0875d8ae07630bfaaea1515ffa8d0
R cd2321accfa2a1c1c2cbd5bcccd763fe
U larrybr
Z 203491c4b5ae5f0ef9b8da4470751daa
P 5540e6abc1a2a8540113ec9bfebe1fb78d6a044f45396dd1926b65ff17ff236b
R e97145a8fdfc31275c7c5f207f632c01
U drh
Z 1c8b00346da6638e920bab0d18b60999

View File

@ -1 +1 @@
5540e6abc1a2a8540113ec9bfebe1fb78d6a044f45396dd1926b65ff17ff236b
0c4f37aa475bd4bd17c20c02ab2d9f63d0a6a08b0e2bbfa559f7b972ece6f4fc