Lines Matching defs:pRoot

4194   MemPage *pRoot;
4241 pRoot = pCur->apPage[0];
4242 assert( pRoot->pgno==pCur->pgnoRoot );
4243 assert( pRoot->isInit && (pCur->pKeyInfo==0)==pRoot->intKey );
4250 if( pRoot->nCell==0 && !pRoot->leaf ){
4252 if( pRoot->pgno!=1 ) return SQLITE_CORRUPT_BKPT;
4253 subpage = get4byte(&pRoot->aData[pRoot->hdrOffset+8]);
4257 pCur->eState = ((pRoot->nCell>0)?CURSOR_VALID:CURSOR_INVALID);
6451 static int balance_deeper(MemPage *pRoot, MemPage **ppChild){
6455 BtShared *pBt = pRoot->pBt; /* The BTree */
6457 assert( pRoot->nOverflow>0 );
6460 /* Make pRoot, the root page of the b-tree, writable. Allocate a new
6462 ** of the node stored on pRoot into the new child page.
6464 rc = sqlite3PagerWrite(pRoot->pDbPage);
6466 rc = allocateBtreePage(pBt,&pChild,&pgnoChild,pRoot->pgno,0);
6467 copyNodeContent(pRoot, pChild, &rc);
6469 ptrmapPut(pBt, pgnoChild, PTRMAP_BTREE, pRoot->pgno, &rc);
6478 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
6479 assert( pChild->nCell==pRoot->nCell );
6481 TRACE(("BALANCE: copy root %d into %d\n", pRoot->pgno, pChild->pgno));
6483 /* Copy the overflow cells from pRoot to pChild */
6484 memcpy(pChild->aOvfl, pRoot->aOvfl, pRoot->nOverflow*sizeof(pRoot->aOvfl[0]));
6485 pChild->nOverflow = pRoot->nOverflow;
6487 /* Zero the contents of pRoot. Then install pChild as the right-child. */
6488 zeroPage(pRoot, pChild->aData[0] & ~PTF_LEAF);
6489 put4byte(&pRoot->aData[pRoot->hdrOffset+8], pgnoChild);
6907 MemPage *pRoot;
6917 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
6971 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
6980 releasePage(pRoot);
6985 rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0);
6986 releasePage(pRoot);
6992 rc = btreeGetPage(pBt, pgnoRoot, &pRoot, 0);
6996 rc = sqlite3PagerWrite(pRoot->pDbPage);
6998 releasePage(pRoot);
7002 pRoot = pPageMove;
7008 releasePage(pRoot);
7019 releasePage(pRoot);
7024 rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0);
7028 assert( sqlite3PagerIswriteable(pRoot->pDbPage) );
7034 zeroPage(pRoot, ptfFlags);
7035 sqlite3PagerUnref(pRoot->pDbPage);