mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Convert an assert() in R-Tree into a database corruption detection case.
FossilOrigin-Name: 48b518eb6f76fb0beb161d1ebcf3b793efc36262d6d77a1ad5906b6501138e28
This commit is contained in:
@ -669,7 +669,6 @@ static int nodeAcquire(
|
||||
** increase its reference count and return it.
|
||||
*/
|
||||
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
|
||||
assert( !pParent || !pNode->pParent || pNode->pParent==pParent );
|
||||
if( pParent && !pNode->pParent ){
|
||||
if( nodeInParentChain(pNode, pParent) ){
|
||||
RTREE_IS_CORRUPT(pRtree);
|
||||
@ -677,6 +676,9 @@ static int nodeAcquire(
|
||||
}
|
||||
pParent->nRef++;
|
||||
pNode->pParent = pParent;
|
||||
}else if( pParent && pNode->pParent && pParent!=pNode->pParent ){
|
||||
RTREE_IS_CORRUPT(pRtree);
|
||||
return SQLITE_CORRUPT_VTAB;
|
||||
}
|
||||
pNode->nRef++;
|
||||
*ppNode = pNode;
|
||||
|
Reference in New Issue
Block a user