| /sqlite-3.40.0/ext/rbu/ |
| H A D | sqlite3rbu.c | 1341 if( p->rc ) return p->rc; in rbuObjIterCacheTableInfo() 2774 assert( p->rc || (p->dbMain==0 && p->dbRbu==0) ); in rbuOpenDatabase() 2775 assert( p->rc || rbuIsVacuum(p) || p->zTarget!=0 ); in rbuOpenDatabase() 2779 p->dbRbu = rbuOpenDbhandle(p, p->zRbu, 1); in rbuOpenDatabase() 2854 if( bOpen ) p->dbMain = rbuOpenDbhandle(p, p->zRbu, p->nRbu<=1); in rbuOpenDatabase() 2860 p->dbMain = rbuOpenDbhandle(p, p->zTarget, 1); in rbuOpenDatabase() 3054 p->aBuf = rbuMalloc(p, p->pgsz); in rbuSetupCheckpoint() 3246 p->rc = p->xRename(p->pRenameArg, zOal, zWal); in rbuMoveOalFile() 3887 sqlite3 *db = (rbuIsVacuum(p) ? p->dbRbu : p->dbMain); in rbuIndexCntFunc() 4070 p->rc = rbuObjIterFirst(p, &p->objiter); in openRbuHandle() [all …]
|
| /sqlite-3.40.0/ext/recover/ |
| H A D | sqlite3recover.c | 849 return recoverExec(p, p->dbOut, in recoverCacheSchema() 1011 recoverExec(p, p->dbOut, zSql); in recoverOpenRecovery() 1012 recoverExec(p, p->dbOut, in recoverOpenRecovery() 1147 pSelect = recoverPrepare(p, p->dbOut, in recoverWriteSchema1() 1194 recoverDbError(p, p->dbOut); in recoverWriteSchema1() 1221 pSelect = recoverPrepare(p, p->dbOut, in recoverWriteSchema2() 1237 recoverDbError(p, p->dbOut); in recoverWriteSchema2() 1378 pProbe = recoverPrepare(p, p->dbOut, in recoverLostAndFoundCreate() 1419 recoverExec(p, p->dbOut, zSql); in recoverLostAndFoundCreate() 1855 p, p->dbOut, in recoverLostAndFound1Init() [all …]
|
| /sqlite-3.40.0/src/ |
| H A D | btmutex.c | 33 p->pBt->db = p->db; in lockBtreeMutex() 76 assert( p->pNext==0 || p->pNext->pBt>p->pBt ); in sqlite3BtreeEnter() 77 assert( p->pPrev==0 || p->pPrev->pBt<p->pBt ); in sqlite3BtreeEnter() 78 assert( p->pNext==0 || p->pNext->db==p->db ); in sqlite3BtreeEnter() 79 assert( p->pPrev==0 || p->pPrev->db==p->db ); in sqlite3BtreeEnter() 80 assert( p->sharable || (p->pNext==0 && p->pPrev==0) ); in sqlite3BtreeEnter() 91 assert( (p->locked==0 && p->sharable) || p->pBt->db==p->db ); in sqlite3BtreeEnter() 113 p->pBt->db = p->db; in btreeLockCarefully() 163 assert( p->sharable==0 || p->locked==0 || p->db==p->pBt->db ); in sqlite3BtreeHoldsMutex() 278 p->pBt->db = p->db; in sqlite3BtreeEnter() [all …]
|
| H A D | pcache.c | 110 for(p=pCache->pDirty; p; p=p->pDirtyNext){ in pageOnDirtyList() 212 assert( p->bPurgeable || p->eCreate==2 ); in pcacheManageDirtyList() 275 n = ((-1024*(i64)p->szCache)/(p->szPage+p->szExtra)); in numberOfCachePages() 630 for(p=pCache->pDirty; p; p=p->pDirtyNext){ in sqlite3PcacheClearWritable() 641 for(p=pCache->pDirty; p; p=p->pDirtyNext){ in sqlite3PcacheClearSyncFlags() 687 for(p=pCache->pDirty; p; p=pNext){ in sqlite3PcacheTruncate() 782 p = pcacheMergeDirtyList(a[i], p); in pcacheSortDirtyList() 796 p = p ? pcacheMergeDirtyList(p, a[i]) : a[i]; in pcacheSortDirtyList() 806 for(p=pCache->pDirty; p; p=p->pDirtyNext){ in sqlite3PcacheDirtyList() 807 p->pDirty = p->pDirtyNext; in sqlite3PcacheDirtyList() [all …]
|
| H A D | date.c | 233 p->validTZ = (p->tz!=0)?1:0; in parseHhMmSs() 241 memset(p, 0, sizeof(*p)); in datetimeError() 279 p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000 + 0.5); in computeJD() 281 p->iJD -= p->tz*60000; in computeJD() 459 p->s += s - p->m*60; in computeHMS() 708 if( p->validJD && p->rawS ){ in parseModifier() 768 memset(p, 0, sizeof(*p)); in parseModifier() 810 if( !p->validJD && !p->validYMD && !p->validHMS ) break; in parseModifier() 814 p->h = p->m = 0; in parseModifier() 895 x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; in parseModifier() [all …]
|
| H A D | rowset.c | 131 RowSet *p = sqlite3DbMallocRawNN(db, sizeof(*p)); in sqlite3RowSetInit() local 132 if( p ){ in sqlite3RowSetInit() 139 p->pFresh = (struct RowSetEntry*)(ROUND8(sizeof(*p)) + (char*)p); in sqlite3RowSetInit() 367 p->pLeft = p->pRight = 0; in rowSetNDeepTree() 384 p->pLeft = p->pRight = 0; in rowSetListToTree() 415 p->pEntry = rowSetEntrySort(p->pEntry); in sqlite3RowSetNext() 423 p->pEntry = p->pEntry->pRight; in sqlite3RowSetNext() 457 p = rowSetEntrySort(p); in sqlite3RowSetTest() 468 p = rowSetEntryMerge(pAux, p); in sqlite3RowSetTest() 493 p = p->pRight; in sqlite3RowSetTest() [all …]
|
| H A D | vdbeaux.c | 61 sqlite3DbFree(p->db, p->zErrMsg); in sqlite3VdbeError() 563 p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, in resizeResolveLabel() 647 if( p->iSub<=p->nSub ){ in opIterNext() 817 pOp = &p->aOp[p->nOp-1]; in resolveP2Values() 1155 if( p->nOp>0 ) p->aOp[p->nOp-1].p5 = p5; in sqlite3VdbeChangeP5() 1332 if( p->nOp>0 && p->aOp[p->nOp-1].opcode==op ){ in sqlite3VdbeDeletePriorOpcode() 1491 assert( p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->pParse->nErr>0 ); in vdbeVComment() 1494 sqlite3DbFree(p->db, p->aOp[p->nOp-1].zComment); in vdbeVComment() 2023 assert( (&p[1])==pEnd || p[0].db==p[1].db ); in releaseMemArray() 3037 p = p->pVNext; in checkActiveVdbeCnt() [all …]
|
| H A D | backup.c | 170 p = 0; in sqlite3_backup_init() 183 if( p ){ in sqlite3_backup_init() 191 if( 0==p->pSrc || 0==p->pDest in sqlite3_backup_init() 203 if( p ){ in sqlite3_backup_init() 209 return p; in sqlite3_backup_init() 313 *pp = p; in attachBackupObject() 407 p->nRemaining = nSrcPage+1-p->iNext; in sqlite3_backup_step() 606 rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; in sqlite3_backup_finish() 672 if( !isFatalError(p->rc) && iPage<p->iNext ){ in backupUpdate() 687 }while( (p = p->pNext)!=0 ); in backupUpdate() [all …]
|
| H A D | mutex_unix.c | 171 p = sqlite3MallocZero( sizeof(*p) ); in pthreadMutexAlloc() 192 p = sqlite3MallocZero( sizeof(*p) ); in pthreadMutexAlloc() 213 assert( p==0 || p->id==iType ); in pthreadMutexAlloc() 215 return p; in pthreadMutexAlloc() 267 if( p->nRef>0 && pthread_equal(p->owner, self) ){ in pthreadMutexEnter() 281 assert( p->nRef>0 || p->owner==0 ); in pthreadMutexEnter() 289 printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef); in pthreadMutexEnter() 310 if( p->nRef>0 && pthread_equal(p->owner, self) ){ in pthreadMutexTry() 338 printf("enter mutex %p (%d) with nRef=%d\n", p, p->trace, p->nRef); in pthreadMutexTry() 354 if( p->nRef==0 ) p->owner = 0; in pthreadMutexLeave() [all …]
|
| H A D | test_pcache.c | 123 p->iRand = (p->iRand*69069 + 5); in testpcacheRandom() 140 testpcache *p; in testpcacheCreate() local 151 p->nPinned = 0; in testpcacheCreate() 206 assert( p->nPinned <= TESTPCACHE_NPAGE - p->nFree ); in testpcacheFetch() 246 memset(p->a[j].page.pBuf, 0, p->szPage); in testpcacheFetch() 247 memset(p->a[j].page.pExtra, 0, p->szExtra); in testpcacheFetch() 250 assert( p->nPinned <= TESTPCACHE_NPAGE - p->nFree ); in testpcacheFetch() 270 if( p->a[j].key>0 && p->a[j].isPinned==0 ){ in testpcacheFetch() 273 memset(p->a[j].page.pBuf, 0, p->szPage); in testpcacheFetch() 274 memset(p->a[j].page.pExtra, 0, p->szExtra); in testpcacheFetch() [all …]
|
| H A D | memdb.c | 32 #define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData)) argument 234 p->nRef--; in memdbClose() 261 if( iOfst<p->sz ) memcpy(zBuf, p->aData+iOfst, p->sz - iOfst); in memdbRead() 282 if( newSz>p->szMax ) newSz = p->szMax; in memdbEnlarge() 315 if( iOfst>p->sz ) memset(p->aData+p->sz, 0, iOfst-p->sz); in memdbWrite() 527 p = sqlite3Malloc( sizeof(*p) + szName + 3 ); in memdbOpen() 541 memset(p, 0, sizeof(*p)); in memdbOpen() 544 p->zFName = (char*)&p[1]; in memdbOpen() 561 p = sqlite3Malloc( sizeof(*p) ); in memdbOpen() 565 memset(p, 0, sizeof(*p)); in memdbOpen() [all …]
|
| H A D | threads.c | 65 p = sqlite3Malloc(sizeof(*p)); in sqlite3ThreadCreate() 67 memset(p, 0, sizeof(*p)); in sqlite3ThreadCreate() 69 p->pIn = pIn; in sqlite3ThreadCreate() 139 p->pResult = p->xTask(p->pIn); in sqlite3ThreadProc() 156 p = sqlite3Malloc(sizeof(*p)); in sqlite3ThreadCreate() 164 memset(p, 0, sizeof(*p)); in sqlite3ThreadCreate() 168 p->tid = (void*)_beginthreadex(0, 0, sqlite3ThreadProc, p, 0, &p->id); in sqlite3ThreadCreate() 170 memset(p, 0, sizeof(*p)); in sqlite3ThreadCreate() 195 assert( p->id!=0 && p->id!=GetCurrentThreadId() ); in sqlite3ThreadJoin() 236 p = sqlite3Malloc(sizeof(*p)); in sqlite3ThreadCreate() [all …]
|
| H A D | mutex_w32.c | 67 return p->nRef!=0 && p->owner==GetCurrentThreadId(); in winMutexHeld() 71 return p->nRef==0 || p->owner!=tid; in winMutexNotheld2() 218 p = sqlite3MallocZero( sizeof(*p) ); in winMutexAlloc() 250 assert( p==0 || p->id==iType ); in winMutexAlloc() 251 return p; in winMutexAlloc() 262 assert( p->nRef==0 && p->owner==0 ); in winMutexFree() 297 assert( p->nRef>0 || p->owner==0 ); in winMutexEnter() 302 tid, p->id, p, p->trace, p->nRef)); in winMutexEnter() 345 tid, p->id, p, p->trace, p->owner, p->nRef, sqlite3ErrName(rc))); in winMutexTry() 366 if( p->nRef==0 ) p->owner = 0; in winMutexLeave() [all …]
|
| H A D | test_osinst.c | 137 #define REALVFS(p) (((VfslogVfs *)(p))->pVfs) argument 494 p->pReal = (sqlite3_file *)&p[1]; in vfslogOpen() 633 p->pLog->pMethods->xWrite(p->pLog, p->aBuf, p->nBuf, p->iOffset); in vfslog_flush() 634 p->iOffset += p->nBuf; in vfslog_flush() 663 if( (24+p->nBuf)>sizeof(p->aBuf) ){ in vfslog_call() 694 p->pLog->pMethods->xClose(p->pLog); in vfslog_finalize() 734 p->pLog = (sqlite3_file *)&p[1]; in sqlite3_vfslog_new() 831 return (p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]; in get32bits() 884 p->pFd = (sqlite3_file *)&p[1]; in vlogConnect() 900 p->pFd->pMethods->xFileSize(p->pFd, &p->nByte); in vlogConnect() [all …]
|
| /sqlite-3.40.0/ext/lsm1/lsm-test/ |
| H A D | lsmtest_tdb4.c | 191 p->nSectorSize = p->pBt->pVfs->xSectorSize(p->pFile); in btSaveSectors() 258 rc = p->pVfs->xSync(p->pFile); in btVfsSync() 271 if( p->nRef<=0 ) testFree(p); in btDeref() 284 rc = p->pVfs->xClose(p->pFile); in btVfsClose() 585 while( *p==' ' ) p++; in testParseOption() 587 while( *p && *p!='=' ) p++; in testParseOption() 598 while( *p && *p!=' ' ) p++; in testParseOption() 614 while( *p>='0' && *p<='9' ){ in testParseInt() 618 if( *p=='K' || *p=='k' ){ in testParseInt() 621 }else if( *p=='M' || *p=='m' ){ in testParseInt() [all …]
|
| /sqlite-3.40.0/test/ |
| H A D | threadtest4.c | 226 run_sql(p, "DELETE FROM t1 WHERE tid=%d", p->tid); in worker_delete_all_content() 227 run_sql(p, "DELETE FROM t2 WHERE tid=%d", p->tid); in worker_delete_all_content() 228 run_sql(p, "DELETE FROM t3 WHERE tid=%d", p->tid); in worker_delete_all_content() 234 run_sql(p, "DELETE FROM t1 WHERE tid=%d", p->tid); in worker_delete_all_content() 238 run_sql(p, "DELETE FROM t2 WHERE tid=%d", p->tid); in worker_delete_all_content() 242 run_sql(p, "DELETE FROM t3 WHERE tid=%d", p->tid); in worker_delete_all_content() 259 run_sql(p, in worker_add_content() 266 p->nTest++; in worker_add_content() 274 p->nErr++; in worker_error() 338 ,p->tid, p->tid, p->tid); in worker_thread() [all …]
|
| /sqlite-3.40.0/ext/misc/ |
| H A D | regexp.c | 178 c = p->z[p->i++]; in re_next_char() 180 if( (c&0xe0)==0xc0 && p->i<p->mx && (p->z[p->i]&0xc0)==0x80 ){ in re_next_char() 183 }else if( (c&0xf0)==0xe0 && p->i+1<p->mx && (p->z[p->i]&0xc0)==0x80 in re_next_char() 185 c = (c&0x0f)<<12 | ((p->z[p->i]&0x3f)<<6) | (p->z[p->i+1]&0x3f); in re_next_char() 188 }else if( (c&0xf8)==0xf0 && p->i+3<p->mx && (p->z[p->i]&0xc0)==0x80 in re_next_char() 189 && (p->z[p->i+1]&0xc0)==0x80 && (p->z[p->i+2]&0xc0)==0x80 ){ in re_next_char() 393 if( p->nAlloc<=p->nState && re_resize(p, p->nAlloc*2) ) return 0; in re_insert() 414 if( p->nState+N>=p->nAlloc && re_resize(p, p->nAlloc*2+N) ) return; in re_copy() 415 memcpy(&p->aOp[p->nState], &p->aOp[iStart], N*sizeof(p->aOp[0])); in re_copy() 416 memcpy(&p->aArg[p->nState], &p->aArg[iStart], N*sizeof(p->aArg[0])); in re_copy() [all …]
|
| H A D | scrub.c | 88 if( p->rcErr==0 ) p->rcErr = SQLITE_ERROR; in scrubBackupErr() 113 rc = p->pSrc->pMethods->xRead(p->pSrc, pOut, p->szPage, iOff); in scrubBackupRead() 129 rc = p->pDest->pMethods->xWrite(p->pDest, pData, p->szPage, iOff); in scrubBackupWrite() 134 if( (u32)pgno>p->iLastPage ) p->iLastPage = pgno; in scrubBackupWrite() 161 p->rcErr = sqlite3_open_v2(p->zSrcFile, &p->dbSrc, in scrubBackupOpenSrc() 183 pStmt = scrubBackupPrepare(p, p->dbSrc, "PRAGMA page_size"); in scrubBackupOpenSrc() 193 pStmt = scrubBackupPrepare(p, p->dbSrc, "PRAGMA page_count"); in scrubBackupOpenSrc() 203 if( p->pSrc==0 || p->pSrc->pMethods==0 ){ in scrubBackupOpenSrc() 215 p->rcErr = sqlite3_open_v2(p->zDestFile, &p->dbDest, in scrubBackupOpenDest() 228 p->rcErr = sqlite3_exec(p->dbDest, zSql, 0, 0, 0); in scrubBackupOpenDest() [all …]
|
| H A D | dbdump.c | 79 memset(p, 0, sizeof(*p)); in initText() 107 if( p->n+len>=p->nAlloc ){ in appendText() 119 char *zCsr = p->z+p->n; in appendText() 126 p->n = (int)(zCsr - p->z); in appendText() 131 p->z[p->n] = '\0'; in appendText() 288 p->xCallback(z, p->pArg); in output_formatted() 343 p->xCallback("'", p->pArg); in output_quoted_escaped_string() 363 p->xCallback(zCR, p->pArg); in output_quoted_escaped_string() 365 p->xCallback("'", p->pArg); in output_quoted_escaped_string() 418 p->xCallback(";\n", p->pArg); in dump_callback() [all …]
|
| H A D | decimal.c | 74 p = sqlite3_malloc( sizeof(*p) ); in decimal_new() 107 p->a[p->nDigit++] = c - '0'; in decimal_new() 109 p->nFrac = p->nDigit + 1; in decimal_new() 132 p->nFrac = p->nDigit - (p->nFrac - 1); in decimal_new() 145 p->a = sqlite3_realloc64(p->a, p->nDigit + iExp + 1 ); in decimal_new() 164 p->a = sqlite3_realloc64(p->a, p->nDigit + iExp + 1 ); in decimal_new() 166 memmove(p->a+iExp, p->a, p->nDigit); in decimal_new() 187 if( p==0 || p->oom ){ in decimal_result() 201 if( p->nDigit==0 || (p->nDigit==1 && p->a[0]==0) ){ in decimal_result() 208 n = p->nDigit - p->nFrac; in decimal_result() [all …]
|
| /sqlite-3.40.0/tool/ |
| H A D | offsets.c | 135 p->nStack--; in ofstPopPage() 136 sqlite3_free(p->aStack[p->nStack]); in ofstPopPage() 137 p->pgno = p->aPgno[p->nStack-1]; in ofstPopPage() 138 p->aPage = p->aStack[p->nStack-1]; in ofstPopPage() 149 if( p->nStack >= ArraySize(p->aStack) ){ in ofstPushPage() 153 p->aPgno[p->nStack] = pgno; in ofstPushPage() 154 p->aStack[p->nStack] = pPage = sqlite3_malloc( p->szPg ); in ofstPushPage() 162 fseek(p->f, (pgno-1)*p->szPg, SEEK_SET); in ofstPushPage() 163 got = fread(pPage, 1, p->szPg, p->f); in ofstPushPage() 207 return p->szPg*(p->pgno-1) + ofst; in ofstInFile() [all …]
|
| /sqlite-3.40.0/ext/fts5/ |
| H A D | fts5_hash.c | 79 #define fts5EntryKey(p) ( ((char *)(&(p)[1])) ) argument 211 assert( p->bDel==0 || p->bDel==1 ); in fts5HashAddPoslistSize() 259 for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ in sqlite3Fts5HashWrite() 300 p->nData += sqlite3Fts5PutVarint(&((u8*)p)[p->nData], iRowid); in sqlite3Fts5HashWrite() 303 p->iSzPoslist = p->nData; in sqlite3Fts5HashWrite() 321 if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){ in sqlite3Fts5HashWrite() 346 p->iSzPoslist = p->nData; in sqlite3Fts5HashWrite() 374 p->nData += sqlite3Fts5PutVarint(&pPtr[p->nData], iPos - p->iPos + 2); in sqlite3Fts5HashWrite() 498 for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){ in sqlite3Fts5HashQuery() 504 if( p ){ in sqlite3Fts5HashQuery() [all …]
|
| H A D | fts5_index.c | 761 p->rc = sqlite3_reset(p->pWriter); in fts5DataWrite() 785 p->rc = sqlite3_reset(p->pDeleter); in fts5DataDelete() 805 p->rc = sqlite3_reset(p->pIdxDeleter); in fts5DataRemoveSegment() 1067 p->rc = fts5IndexPrepareStmt(p, &p->pDataVersion, in fts5IndexDataVersion() 1076 p->rc = sqlite3_reset(p->pDataVersion); in fts5IndexDataVersion() 3243 while( p<pEnd && *p!=0x01 ){ in fts5IndexExtractColset() 3635 return p->term.p; in fts5MultiIterTerm() 3817 p->rc = sqlite3_reset(p->pIdxWriter); in fts5WriteFlushBtree() 5063 sqlite3Fts5PoslistNext64((p)->aPos,(p)->iter.nPoslist,&(p)->iOff,&(p)->iPos) in fts5MergePrefixLists() 5342 p->rc = sqlite3Fts5HashNew(p->pConfig, &p->pHash, &p->nPendingData); in sqlite3Fts5IndexBeginWrite() [all …]
|
| H A D | fts5_config.c | 57 if( p==pIn ) p = 0; in fts5ConfigSkipBareword() 72 p = &p[4]; in fts5ConfigSkipLiteral() 82 while( (*p>='a' && *p<='f') in fts5ConfigSkipLiteral() 83 || (*p>='A' && *p<='F') in fts5ConfigSkipLiteral() 84 || (*p>='0' && *p<='9') in fts5ConfigSkipLiteral() 106 if( *p==0 ) p = 0; in fts5ConfigSkipLiteral() 112 if( *p=='+' || *p=='-' ) p++; in fts5ConfigSkipLiteral() 122 if( p==pIn ) p = 0; in fts5ConfigSkipLiteral() 256 while( p[0]==' ' ) p++; in fts5ConfigParseSpecial() 259 while( p[0]==' ' ) p++; in fts5ConfigParseSpecial() [all …]
|
| /sqlite-3.40.0/ext/lsm1/ |
| H A D | lsm_unix.c | 182 prc = msync(p->pMap, p->nMap, MS_SYNC); in lsmPosixOsSync() 214 munmap(p->pMap, p->nMap); in lsmPosixOsRemap() 458 if( p->pMap ) munmap(p->pMap, p->nMap); in lsmPosixOsClose() 460 lsm_free(p->pEnv, p->apShm); in lsmPosixOsClose() 461 lsm_free(p->pEnv, p); in lsmPosixOsClose() 488 if(p){ in lsmPosixOsFree() 665 if( p ) p->pEnv = pEnv; in lsmPosixOsMutexNew() 671 assert( p->bStatic==0 && p->pEnv ); in lsmPosixOsMutexDel() 672 lsmFree(p->pEnv, p); in lsmPosixOsMutexDel() 693 return p ? p->bHeld : 1; in lsmPosixOsMutexHeld() [all …]
|