line |
true |
false |
branch |
163
|
0 |
0 |
for(p=pCur->pTree->pCursors; p; p=p->pShared){ |
164
|
0 |
0 |
if( p!=pCur ){ |
165
|
0 |
0 |
if( p->wrFlag==0 ) return SQLITE_LOCKED; |
185
|
0 |
0 |
if( mcmp == 0){ |
186
|
0 |
0 |
if( nKey1 == nKey2 ) return 0; |
187
|
0 |
0 |
return ((nKey1 < nKey2)?-1:1); |
189
|
0 |
0 |
return ((mcmp>0)?1:-1); |
213
|
0 |
0 |
if( pX->pParent ){ |
214
|
0 |
0 |
if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; |
220
|
0 |
0 |
if( pb ) pb->pParent = pX; |
221
|
0 |
0 |
if( pTree->pHead == pX ) pTree->pHead = pY; |
245
|
0 |
0 |
if( pX->pParent ){ |
246
|
0 |
0 |
if( pX->pParent->pLeft == pX ) pX->pParent->pLeft = pY; |
252
|
0 |
0 |
if( pb ) pb->pParent = pX; |
253
|
0 |
0 |
if( pTree->pHead == pX ) pTree->pHead = pY; |
264
|
0 |
0 |
if( !orig ){ |
284
|
0 |
0 |
for( i=0; i
|
291
|
0 |
0 |
if( pNode ){ |
293
|
0 |
0 |
if( pNode->isBlack ){ |
338
|
0 |
0 |
while( pNode ){ |
341
|
0 |
0 |
if( pNode->pLeft ){ |
348
|
0 |
0 |
if( pNode->pRight ){ |
357
|
0 |
0 |
if( !pNode->isBlack && |
|
0 |
0 |
if( !pNode->isBlack && |
358
|
0 |
0 |
( (pNode->pLeft && !pNode->pLeft->isBlack) || |
|
0 |
0 |
( (pNode->pLeft && !pNode->pLeft->isBlack) || |
359
|
0 |
0 |
(pNode->pRight && !pNode->pRight->isBlack) ) |
372
|
0 |
0 |
if( pNode->pLeft ){ |
376
|
0 |
0 |
if( pNode->pRight ){ |
380
|
0 |
0 |
if( leftHeight != rightHeight ){ |
390
|
0 |
0 |
if( pNode->pParent ){ |
391
|
0 |
0 |
if( pNode == pNode->pParent->pLeft ) prev_step = 1; |
417
|
0 |
0 |
while( pX != pTree->pHead && !pX->pParent->isBlack ){ |
|
0 |
0 |
while( pX != pTree->pHead && !pX->pParent->isBlack ){ |
427
|
0 |
0 |
if( pX->pParent == pGrandparent->pLeft ) |
443
|
0 |
0 |
if( pUncle && !pUncle->isBlack ){ |
|
0 |
0 |
if( pUncle && !pUncle->isBlack ){ |
450
|
0 |
0 |
if( pX->pParent == pGrandparent->pLeft ){ |
451
|
0 |
0 |
if( pX == pX->pParent->pRight ){ |
484
|
0 |
0 |
if( pX == pX->pParent->pLeft ){ |
519
|
0 |
0 |
while( pX != pTree->pHead && (!pX || pX->isBlack) ){ |
|
0 |
0 |
while( pX != pTree->pHead && (!pX || pX->isBlack) ){ |
|
0 |
0 |
while( pX != pTree->pHead && (!pX || pX->isBlack) ){ |
520
|
0 |
0 |
if( pX == pParent->pLeft ){ |
522
|
0 |
0 |
if( pSib && !(pSib->isBlack) ){ |
|
0 |
0 |
if( pSib && !(pSib->isBlack) ){ |
528
|
0 |
0 |
if( !pSib ){ |
530
|
0 |
0 |
}else if( |
531
|
0 |
0 |
(!pSib->pLeft || pSib->pLeft->isBlack) && |
|
0 |
0 |
(!pSib->pLeft || pSib->pLeft->isBlack) && |
532
|
0 |
0 |
(!pSib->pRight || pSib->pRight->isBlack) ) { |
536
|
0 |
0 |
if( (!pSib->pRight || pSib->pRight->isBlack) ){ |
|
0 |
0 |
if( (!pSib->pRight || pSib->pRight->isBlack) ){ |
537
|
0 |
0 |
if( pSib->pLeft ) pSib->pLeft->isBlack = 1; |
544
|
0 |
0 |
if( pSib->pRight ) pSib->pRight->isBlack = 1; |
550
|
0 |
0 |
if( pSib && !(pSib->isBlack) ){ |
|
0 |
0 |
if( pSib && !(pSib->isBlack) ){ |
556
|
0 |
0 |
if( !pSib ){ |
558
|
0 |
0 |
}else if( |
559
|
0 |
0 |
(!pSib->pLeft || pSib->pLeft->isBlack) && |
|
0 |
0 |
(!pSib->pLeft || pSib->pLeft->isBlack) && |
560
|
0 |
0 |
(!pSib->pRight || pSib->pRight->isBlack) ){ |
564
|
0 |
0 |
if( (!pSib->pLeft || pSib->pLeft->isBlack) ){ |
|
0 |
0 |
if( (!pSib->pLeft || pSib->pLeft->isBlack) ){ |
565
|
0 |
0 |
if( pSib->pRight ) pSib->pRight->isBlack = 1; |
572
|
0 |
0 |
if( pSib->pLeft ) pSib->pLeft->isBlack = 1; |
579
|
0 |
0 |
if( pX ) pX->isBlack = 1; |
599
|
0 |
0 |
if( pRbtree->eTransState == TRANS_INTRANSACTION ){ |
603
|
0 |
0 |
if( pRbtree->eTransState == TRANS_INCHECKPOINT ){ |
604
|
0 |
0 |
if( !pRbtree->pCheckRollback ){ |
620
|
0 |
0 |
if( sqlite_malloc_failed ) goto open_no_mem; |
625
|
0 |
0 |
if( sqlite_malloc_failed ) goto open_no_mem; |
650
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
654
|
0 |
0 |
if( tree->eTransState != TRANS_ROLLBACK ){ |
656
|
0 |
0 |
if( pRollbackOp==0 ) return SQLITE_NOMEM; |
679
|
0 |
0 |
if( tree->eTransState != TRANS_ROLLBACK ){ |
681
|
0 |
0 |
if( pRollbackOp==0 ) return SQLITE_NOMEM; |
695
|
0 |
0 |
if( !pCur->pNode ) { |
698
|
0 |
0 |
if( (pCur->pNode->nKey - nIgnore) < 0 ){ |
723
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
760
|
0 |
0 |
if( checkReadLocks(pCur) ){ |
767
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
782
|
0 |
0 |
if( match ){ |
784
|
0 |
0 |
if( pNode==0 ) return SQLITE_NOMEM; |
787
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
791
|
0 |
0 |
if( pCur->pNode ){ |
817
|
0 |
0 |
if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ |
819
|
0 |
0 |
if( pOp==0 ) return SQLITE_NOMEM; |
824
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
834
|
0 |
0 |
if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ |
836
|
0 |
0 |
if( pOp==0 ) return SQLITE_NOMEM; |
840
|
0 |
0 |
if( sqlite_malloc_failed ) return SQLITE_NOMEM; |
881
|
0 |
0 |
while( pCur->pNode && *pRes ) { |
|
0 |
0 |
while( pCur->pNode && *pRes ) { |
899
|
0 |
0 |
if( !pCur->pNode ) pCur->pNode = pTmp; |
930
|
0 |
0 |
if( checkReadLocks(pCur) ){ |
935
|
0 |
0 |
if( !pZ ){ |
941
|
0 |
0 |
if( pCur->pRbtree->eTransState != TRANS_ROLLBACK ){ |
943
|
0 |
0 |
if( pOp==0 ) return SQLITE_NOMEM; |
959
|
0 |
0 |
if( pZ->pLeft && pZ->pRight ){ |
|
0 |
0 |
if( pZ->pLeft && pZ->pRight ){ |
965
|
0 |
0 |
if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ |
982
|
0 |
0 |
if( res ){ |
987
|
0 |
0 |
if( pCur->pRbtree->eTransState == TRANS_ROLLBACK ){ |
998
|
0 |
0 |
pChild = ((pZ->pLeft)?pZ->pLeft:pZ->pRight); |
999
|
0 |
0 |
if( pZ->pParent ){ |
1002
|
0 |
0 |
?&pZ->pParent->pLeft:&pZ->pParent->pRight); |
1007
|
0 |
0 |
if( pChild ) pChild->pParent = pZ->pParent; |
1015
|
0 |
0 |
if( pZ->isBlack ){ |
1035
|
0 |
0 |
while( pNode ){ |
1036
|
0 |
0 |
if( pNode->pLeft ){ |
1039
|
0 |
0 |
else if( pNode->pRight ){ |
1044
|
0 |
0 |
if( tree->eTransState == TRANS_ROLLBACK ){ |
1049
|
0 |
0 |
if( pRollbackOp==0 ) return SQLITE_NOMEM; |
1059
|
0 |
0 |
if( pTmp ){ |
1060
|
0 |
0 |
if( pTmp->pLeft == pNode ) pTmp->pLeft = 0; |
1061
|
0 |
0 |
else if( pTmp->pRight == pNode ) pTmp->pRight = 0; |
1073
|
0 |
0 |
if( pCur->pTree->pHead ){ |
1075
|
0 |
0 |
while( pCur->pNode->pLeft ){ |
1079
|
0 |
0 |
if( pCur->pNode ){ |
1090
|
0 |
0 |
if( pCur->pTree->pHead ){ |
1092
|
0 |
0 |
while( pCur->pNode->pRight ){ |
1096
|
0 |
0 |
if( pCur->pNode ){ |
1113
|
0 |
0 |
if( pCur->pNode && pCur->eSkip != SKIP_NEXT ){ |
|
0 |
0 |
if( pCur->pNode && pCur->eSkip != SKIP_NEXT ){ |
1114
|
0 |
0 |
if( pCur->pNode->pRight ){ |
1116
|
0 |
0 |
while( pCur->pNode->pLeft ) |
1121
|
0 |
0 |
while( pCur->pNode && (pCur->pNode->pRight == pX) ){ |
|
0 |
0 |
while( pCur->pNode && (pCur->pNode->pRight == pX) ){ |
1129
|
0 |
0 |
if( !pCur->pNode ){ |
1140
|
0 |
0 |
if( pCur->pNode && pCur->eSkip != SKIP_PREV ){ |
|
0 |
0 |
if( pCur->pNode && pCur->eSkip != SKIP_PREV ){ |
1141
|
0 |
0 |
if( pCur->pNode->pLeft ){ |
1143
|
0 |
0 |
while( pCur->pNode->pRight ) |
1148
|
0 |
0 |
while( pCur->pNode && (pCur->pNode->pLeft == pX) ){ |
|
0 |
0 |
while( pCur->pNode && (pCur->pNode->pLeft == pX) ){ |
1156
|
0 |
0 |
if( !pCur->pNode ){ |
1167
|
0 |
0 |
if( pCur->pNode ){ |
1177
|
0 |
0 |
if( !pCur->pNode ) return 0; |
1178
|
0 |
0 |
if( !pCur->pNode->pKey || ((amt + offset) <= pCur->pNode->nKey) ){ |
|
0 |
0 |
if( !pCur->pNode->pKey || ((amt + offset) <= pCur->pNode->nKey) ){ |
1189
|
0 |
0 |
if( pCur->pNode ){ |
1199
|
0 |
0 |
if( !pCur->pNode ) return 0; |
1200
|
0 |
0 |
if( (amt + offset) <= pCur->pNode->nData ){ |
1211
|
0 |
0 |
if( pCur->pTree->pCursors==pCur ){ |
1215
|
0 |
0 |
while( p && p->pShared!=pCur ){ p = p->pShared; } |
|
0 |
0 |
while( p && p->pShared!=pCur ){ p = p->pShared; } |
1217
|
0 |
0 |
if( p ){ |
1247
|
0 |
0 |
for(p=sqliteHashFirst(&tree->tblHash); p; p=sqliteHashNext(p)){ |
1266
|
0 |
0 |
if( tree->eTransState != TRANS_NONE ) |
1278
|
0 |
0 |
while( pOp ){ |
1305
|
0 |
0 |
while( (p=sqliteHashFirst(&tree->tblHash))!=0 ){ |
1325
|
0 |
0 |
while( pList ){ |
1375
|
0 |
0 |
if( tree->eTransState != TRANS_INTRANSACTION ) |
1386
|
0 |
0 |
if( tree->eTransState == TRANS_INCHECKPOINT ){ |
1387
|
0 |
0 |
if( tree->pCheckRollback ){ |
1400
|
0 |
0 |
if( tree->eTransState != TRANS_INCHECKPOINT ) return SQLITE_OK; |