Home | History | Annotate | Download | only in dist

Lines Matching refs:pNew

5067 ** encrypted, this routine will encrypt it.  If pNew==0 or nNew==0, the
18417 void *pNew;
18421 pNew = sqlite3MemMalloc(nByte);
18422 if( pNew ){
18423 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize));
18425 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize);
18429 return pNew;
20155 sqlite3_debug_mutex *pNew = 0;
20159 pNew = sqlite3Malloc(sizeof(*pNew));
20160 if( pNew ){
20161 pNew->id = id;
20162 pNew->cnt = 0;
20173 pNew = &aStatic[id-2];
20174 pNew->id = id;
20178 return (sqlite3_mutex*)pNew;
21841 void *pNew;
21861 pNew = pOld;
21870 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21871 if( pNew==0 && mem0.alarmThreshold>0 ){
21873 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21875 if( pNew ){
21876 nNew = sqlite3MallocSize(pNew);
21881 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21883 assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-11148-40995 */
21884 return pNew;
21992 void *pNew = 0;
22003 pNew = sqlite3DbMallocRaw(db, n);
22004 if( pNew ){
22005 memcpy(pNew, p, db->lookaside.sz);
22012 pNew = sqlite3_realloc64(p, n);
22013 if( !pNew ){
22016 sqlite3MemdebugSetType(pNew,
22020 return pNew;
22028 void *pNew;
22029 pNew = sqlite3DbRealloc(db, p, n);
22030 if( !pNew ){
22033 return pNew;
25998 ** "pNew" is a pointer to the hash table that is to be initialized.
26000 SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew){
26001 assert( pNew!=0 );
26002 pNew->first = 0;
26003 pNew->count = 0;
26004 pNew->htsize = 0;
26005 pNew->ht = 0;
26042 /* Link pNew element into the hash table pH. If pEntry!=0 then also
26043 ** insert pNew into the pEntry hash bucket.
26047 struct _ht *pEntry, /* The entry into which pNew is inserted */
26048 HashElem *pNew /* The element to be inserted */
26054 pEntry->chain = pNew;
26059 pNew->next = pHead;
26060 pNew->prev = pHead->prev;
26061 if( pHead->prev ){ pHead->prev->next = pNew; }
26062 else { pH->first = pNew; }
26063 pHead->prev = pNew;
26065 pNew->next = pH->first;
26066 if( pH->first ){ pH->first->prev = pNew; }
26067 pNew->prev = 0;
26068 pH->first = pNew;
27541 struct vxworksFileId *pNew; /* search key and new file ID */
27547 pNew = sqlite3_malloc64( sizeof(*pNew) + (n+1) );
27548 if( pNew==0 ) return 0;
27549 pNew->zCanonicalName = (char*)&pNew[1];
27550 memcpy(pNew->zCanonicalName, zAbsoluteName, n+1);
27551 n = vxworksSimplifyName(pNew->zCanonicalName, n);
27560 && memcmp(pCandidate->zCanonicalName, pNew->zCanonicalName, n)==0
27562 sqlite3_free(pNew);
27570 pNew->nRef = 1;
27571 pNew->nName = n;
27572 pNew->pNext = vxworksFileList;
27573 vxworksFileList = pNew;
27575 return pNew;
31404 u8 *pNew = 0; /* Location of new mapping */
31431 pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
31434 pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse);
31435 if( pNew!=MAP_FAILED ){
31436 if( pNew!=pReq ){
31437 osMunmap(pNew, nNew - nReuse);
31438 pNew = 0;
31440 pNew = pOrig;
31446 if( pNew==MAP_FAILED || pNew==0 ){
31451 /* If pNew is still NULL, try to create an entirely new mapping. */
31452 if( pNew==0 ){
31453 pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0);
31456 if( pNew==MAP_FAILED ){
31457 pNew = 0;
31466 pFd->pMapRegion = (void *)pNew;
31782 unixFile *pNew /* open file object for the database file */
31823 if( osFcntl(pNew->h, F_GETLK, &lockInfo)!=-1 ) {
31846 unixFile *pNew /* the open file object */
31863 if( osFcntl(pNew->h, F_GETLK, &lockInfo)!=-1 ) {
31898 unixFile *pNew = (unixFile *)pId;
31901 assert( pNew->pInode==NULL );
31918 pNew->h = h;
31919 pNew->pVfs = pVfs;
31920 pNew->zPath = zFilename;
31921 pNew->ctrlFlags = (u8)ctrlFlags;
31923 pNew->mmapSizeMax = sqlite3GlobalConfig.szMmap;
31927 pNew->ctrlFlags |= UNIXFILE_PSOW;
31930 pNew->ctrlFlags |= UNIXFILE_EXCL;
31934 pNew->pId = vxworksFindFileId(zFilename);
31935 if( pNew->pId==0 ){
31944 pLockingStyle = (**(finder_type*)pVfs->pAppData)(zFilename, pNew);
31949 pNew->lockingContext = (void*)zFilename;
31959 rc = findInodeInfo(pNew, &pNew->pInode);
31979 robust_close(pNew, h, __LINE__);
31991 pNew->lockingContext = pCtx = sqlite3_malloc64( sizeof(*pCtx) );
32002 rc = findInodeInfo(pNew, &pNew->pInode);
32004 sqlite3_free(pNew->lockingContext);
32005 robust_close(pNew, h, __LINE__);
32027 pNew->lockingContext = zLockFile;
32036 rc = findInodeInfo(pNew, &pNew->pInode);
32037 if( (rc==SQLITE_OK) && (pNew->pInode->pSem==NULL) ){
32038 char *zSemName = pNew->pInode->aSemName;
32041 pNew->pId->zCanonicalName);
32044 pNew->pInode->pSem = sem_open(zSemName, O_CREAT, 0666, 1);
32045 if( pNew->pInode->pSem == SEM_FAILED ){
32047 pNew->pInode->aSemName[0] = '\0';
32054 storeLastErrno(pNew, 0);
32057 if( h>=0 ) robust_close(pNew, h, __LINE__);
32060 pNew->ctrlFlags |= UNIXFILE_DELETE;
32064 if( h>=0 ) robust_close(pNew, h, __LINE__);
32066 pNew->pMethod = pLockingStyle;
32068 verifyDbFile(pNew);
33173 unixFile *pNew;
33223 pNew = (unixFile *)sqlite3_malloc64(sizeof(*pNew));
33224 if( pNew==NULL ){
33228 memset(pNew, 0, sizeof(unixFile));
33229 pNew->openFlags = openFlags;
33235 pNew->pUnused = pUnused;
33237 rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0);
33239 *ppFile = pNew;
33243 robust_close(pNew, fd, __LINE__);
33244 sqlite3_free(pNew);
37998 struct winShmNode *pNew; /* Newly allocated winShmNode */
38009 pNew = sqlite3MallocZero( sizeof(*pShmNode) + nName + 17 );
38010 if( pNew==0 ){
38014 pNew->zFilename = (char*)&pNew[1];
38015 sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath);
38016 sqlite3FileSuffix3(pDbFd->zPath, pNew->zFilename);
38026 if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break;
38029 sqlite3_free(pNew);
38031 pShmNode = pNew;
38032 pNew = 0;
38096 sqlite3_free(pNew);
38500 void *pNew = 0;
38532 pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, (SIZE_T)nMap);
38534 pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
38536 if( pNew==NULL ){
38547 pFd->pMapRegion = pNew;
40651 sqlite3_pcache *pNew;
40652 pNew = sqlite3GlobalConfig.pcache2.xCreate(
40656 if( pNew==0 ) return SQLITE_NOMEM;
40657 sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
40661 pCache->pCache = pNew;
42557 struct RowSetChunk *pNew;
42558 pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew));
42559 if( pNew==0 ){
42562 pNew->pNextChunk = p->pChunk;
42563 p->pChunk = pNew;
42564 p->pFresh = pNew->aEntry;
46665 char *pNew = NULL; /* New temp space */
46672 pNew = (char *)sqlite3PageMalloc(pageSize);
46673 if( !pNew ) rc = SQLITE_NOMEM;
46682 pPager->pTmpSpace = pNew;
46686 sqlite3PageFree(pNew);
61239 MemPage *pNew; /* Newly allocated page */
61241 Pgno pgnoNew; /* Page number of pNew */
61254 rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0);
61263 assert( sqlite3PagerIswriteable(pNew->pDbPage) );
61265 zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF);
61266 rc = rebuildPage(pNew, 1, &pCell, &szCell);
61268 pNew->nFree = pBt->usableSize - pNew->cellOffset - 2 - szCell;
61281 if( szCell>pNew->minLocal ){
61282 ptrmapPutOvflPtr(pNew, pCell, &rc);
61313 releasePage(pNew);
61867 MemPage *pNew;
61869 pNew = apNew[i] = apOld[i];
61871 rc = sqlite3PagerWrite(pNew->pDbPage);
61876 rc = allocateBtreePage(pBt, &pNew, &pgno, (bBulk ? 1 : pgno), 0);
61878 zeroPage(pNew, pageFlags);
61879 apNew[i] = pNew;
61885 ptrmapPut(pBt, pNew->pgno, PTRMAP_BTREE, pParent->pgno, &rc);
61979 MemPage *pNew = apNew[0];
61980 u8 *aOld = pNew->aData;
61981 int cntOldNext = pNew->nCell + pNew->nOverflow;
61994 pNew = apNew[++iNew];
61998 /* Cell pCell is destined for new sibling page pNew. Originally, it
62001 ** if sibling page iOld had the same page number as pNew, and if
62005 || pNew->pgno!=aPgno[iOld]
62010 ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
62012 if( cachedCellSize(&b,i)>pNew->minLocal ){
62013 ptrmapPutOvflPtr(pNew, pCell, &rc);
62025 MemPage *pNew = apNew[i];
62033 if( !pNew->leaf ){
62034 memcpy(&pNew->aData[8], pCell, 4);
62043 pNew->xParseCell(pNew, b.apCell[j], &info);
62068 pNew->pgno, &rc);
66806 VdbeOp *pNew;
66825 pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
66826 if( pNew ){
66827 p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
66828 v->aOp = pNew;
66830 return (pNew ? SQLITE_OK : SQLITE_NOMEM);
67390 ScanStatus *pNew = &aNew[p->nScan++];
67391 pNew->addrExplain = addrExplain;
67392 pNew->addrLoop = addrLoop;
67393 pNew->addrVisit = addrVisit;
67394 pNew->nEst = nEst;
67395 pNew->zName = sqlite3DbStrDup(p->db, zName);
71218 sqlite3_value *pNew;
71220 pNew = sqlite3_malloc( sizeof(*pNew) );
71221 if( pNew==0 ) return 0;
71222 memset(pNew, 0, sizeof(*pNew));
71223 memcpy(pNew, pOrig, MEMCELLSIZE);
71224 pNew->flags &= ~MEM_Dyn;
71225 pNew->db = 0;
71226 if( pNew->flags&(MEM_Str|MEM_Blob) ){
71227 pNew->flags &= ~(MEM_Static|MEM_Dyn);
71228 pNew->flags |= MEM_Ephem;
71229 if( sqlite3VdbeMemMakeWriteable(pNew)!=SQLITE_OK ){
71230 sqlite3ValueFree(pNew);
71231 pNew = 0;
71234 return pNew;
75725 Savepoint *pNew;
75765 pNew = sqlite3DbMallocRaw(db, sizeof(Savepoint)+nName+1);
75766 if( pNew ){
75767 pNew->zName = (char *)&pNew[1];
75768 memcpy(pNew->zName, zName, nName+1);
75780 pNew->pNext = db->pSavepoint;
75781 db->pSavepoint = pNew;
75782 pNew->nDeferredCons = db->nDeferredCons;
75783 pNew->nDeferredImmCons = db->nDeferredImmCons;
81263 MergeEngine *pNew; /* Pointer to allocated object to return */
81270 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
81271 if( pNew ){
81272 pNew->nTree = N;
81273 pNew->pTask = 0;
81274 pNew->aReadr = (PmaReader*)&pNew[1];
81275 pNew->aTree = (int*)&pNew->aReadr[N];
81277 return pNew;
81853 SorterRecord *pNew; /* New list element */
81930 pNew = (SorterRecord*)&pSorter->list.aMemory[pSorter->iMemory];
81932 pNew->u.iNext = (int)((u8*)(pSorter->list.pList) - pSorter->list.aMemory);
81934 pNew = (SorterRecord *)sqlite3Malloc(nReq);
81935 if( pNew==0 ){
81938 pNew->u.pNext = pSorter->list.pList;
81941 memcpy(SRVAL(pNew), pVal->z, pVal->n);
81942 pNew->nVal = pVal->n;
81943 pSorter->list.pList = pNew;
82382 MergeEngine *pNew; /* Merge engine to return */
82387 *ppOut = pNew = vdbeMergeEngineNew(nPMA);
82388 if( pNew==0 ) rc = SQLITE_NOMEM;
82392 PmaReader *pReadr = &pNew->aReadr[i];
82398 vdbeMergeEngineFree(pNew);
82457 MergeEngine *pNew = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
82458 if( pNew==0 ){
82461 rc = vdbeIncrMergerNew(pTask, pNew, &pReadr->pIncr);
83217 FileChunk *pNew = sqlite3_malloc(sizeof(FileChunk));
83218 if( !pNew ){
83221 pNew->pNext = 0;
83224 pChunk->pNext = pNew;
83227 p->pFirst = pNew;
83229 p->endpoint.pChunk = pNew;
84462 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
84463 if( pNew==0 ) return 1;
84464 pNew->flags |= EP_IntValue;
84465 pNew->u.iValue = iCol;
84467 pItem->pExpr = pNew;
84473 pParent->pLeft = pNew;
85076 Expr *pNew = sqlite3ExprAlloc(pParse->db, TK_COLLATE, pCollName, dequote);
85077 if( pNew ){
85078 pNew->pLeft = pExpr;
85079 pNew->flags |= EP_Collate|EP_Skip;
85080 pExpr = pNew;
85453 Expr *pNew;
85464 pNew = sqlite3DbMallocZero(db, sizeof(Expr)+nExtra);
85465 if( pNew ){
85466 pNew->op = (u8)op;
85467 pNew->iAgg = -1;
85470 pNew->flags |= EP_IntValue;
85471 pNew->u.iValue = iValue;
85474 pNew->u.zToken = (char*)&pNew[1];
85476 if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
85477 pNew->u.zToken[pToken->n] = 0;
85480 sqlite3Dequote(pNew->u.zToken);
85481 if( c=='"' ) pNew->flags |= EP_DblQuoted;
85486 pNew->nHeight = 1;
85489 return pNew;
85609 Expr *pNew = sqlite3ExprAlloc(db, TK_AND, 0, 0);
85610 sqlite3ExprAttachSubtrees(db, pNew, pLeft, pRight);
85611 return pNew;
85620 Expr *pNew;
85623 pNew = sqlite3ExprAlloc(db, TK_FUNCTION, pToken, 1);
85624 if( pNew==0 ){
85628 pNew->x.pList = pList;
85629 assert( !ExprHasProperty(pNew, EP_xIsSelect) );
85630 sqlite3ExprSetHeightAndFlags(pParse, pNew);
85631 return pNew;
85855 Expr *pNew = 0; /* Value to return */
85870 pNew = (Expr *)zAlloc;
85872 if( pNew ){
85874 ** by pNew. This is either EXPR_FULLSIZE, EXPR_REDUCEDSIZE or
85896 pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static|EP_MemToken);
85897 pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
85898 pNew->flags |= staticFlag;
85902 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
85906 if( 0==((p->flags|pNew->flags) & EP_TokenOnly) ){
85907 /* Fill in the pNew->x.pSelect or pNew->x.pList member. */
85909 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, isReduced);
85911 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, isReduced);
85915 /* Fill in pNew->pLeft and pNew->pRight. */
85916 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
85918 if( ExprHasProperty(pNew, EP_Reduced) ){
85919 pNew->pLeft = exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc);
85920 pNew->pRight = exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc);
85927 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
85928 pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
85934 return pNew;
85985 ExprList *pNew;
85989 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) );
85990 if( pNew==0 ) return 0;
85991 pNew->nExpr = i = p->nExpr;
85993 pNew->a = pItem = sqlite3DbMallocRaw(db, i*sizeof(p->a[0]) );
85995 sqlite3DbFree(db, pNew);
86009 return pNew;
86021 SrcList *pNew;
86026 pNew = sqlite3DbMallocRaw(db, nByte );
86027 if( pNew==0 ) return 0;
86028 pNew->nSrc = pNew->nAlloc = p->nSrc;
86030 struct SrcList_item *pNewItem = &pNew->a[i];
86058 return pNew;
86061 IdList *pNew;
86064 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) );
86065 if( pNew==0 ) return 0;
86066 pNew->nId = p->nId;
86067 pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) );
86068 if( pNew->a==0 ){
86069 sqlite3DbFree(db, pNew);
86076 struct IdList_item *pNewItem = &pNew->a[i];
86081 return pNew;
86084 Select *pNew, *pPrior;
86086 pNew = sqlite3DbMallocRaw(db, sizeof(*p) );
86087 if( pNew==0 ) return 0;
86088 pNew->pEList = sqlite3ExprListDup(db, p->pEList, flags);
86089 pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
86090 pNew->pWhere = sqlite3ExprDup(db, p->pWhere, flags);
86091 pNew->pGroupBy = sqlite3ExprListDup(db, p->pGroupBy, flags);
86092 pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags);
86093 pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags);
86094 pNew->op = p->op;
86095 pNew->pPrior = pPrior = sqlite3SelectDup(db, p->pPrior, flags);
86096 if( pPrior ) pPrior->pNext = pNew;
86097 pNew->pNext = 0;
86098 pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags);
86099 pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags);
86100 pNew->iLimit = 0;
86101 pNew->iOffset = 0;
86102 pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
86103 pNew->addrOpenEphm[0] = -1;
86104 pNew->addrOpenEphm[1] = -1;
86105 pNew->nSelectRow = p->nSelectRow;
86106 pNew->pWith = withDup(db, p->pWith);
86107 sqlite3SelectSetName(pNew, p->zSelName);
86108 return pNew;
89830 Table *pNew; /* Copy of pParse->pNewTable */
89842 pNew = pParse->pNewTable;
89843 assert( pNew );
89846 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
89848 zTab = &pNew->zName[16]; /* Skip the "sqlite_altertab_" prefix on the name */
89849 pCol = &pNew->aCol[pNew->nCol-1];
89877 if( pNew->pIndex ){
89881 if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){
89924 zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1,
89957 Table *pNew;
89998 pNew = (Table*)sqlite3DbMallocZero(db, sizeof(Table));
89999 if( !pNew ) goto exit_begin_add_column;
90000 pParse->pNewTable = pNew;
90001 pNew->nRef = 1;
90002 pNew->nCol = pTab->nCol;
90003 assert( pNew->nCol>0 );
90004 nAlloc = (((pNew->nCol-1)/8)*8)+8;
90005 assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 );
90006 pNew->aCol = (Column*)sqlite3DbMallocZero(db, sizeof(Column)*nAlloc);
90007 pNew->zName = sqlite3MPrintf(db, "sqlite_altertab_%s", pTab->zName);
90008 if( !pNew->aCol || !pNew->zName ){
90012 memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol);
90013 for(i=0; i<pNew->nCol; i++){
90014 Column *pCol = &pNew->aCol[i];
90021 pNew->pSchema = db->aDb[iDb].pSchema;
90022 pNew->addColOffset = pTab->addColOffset;
90023 pNew->nRef = 1;
90529 ** pNew and pOld are both candidate non-periodic samples selected for
90530 ** the same column (pNew->iCol==pOld->iCol). Ignoring this column and
90532 ** function returns true if sample pNew is to be preferred over pOld.
90534 ** column for pNew and pOld are equal, is pNew to be preferred over pOld.
90541 Stat4Sample *pNew,
90546 assert( pNew->iCol==pOld->iCol );
90547 for(i=pNew->iCol+1; i<nCol; i++){
90548 if( pNew->anEq[i]>pOld->anEq[i] ) return 1;
90549 if( pNew->anEq[i]<pOld->anEq[i] ) return 0;
90551 if( pNew->iHash>pOld->iHash ) return 1;
90558 ** Return true if pNew is to be preferred over pOld.
90565 Stat4Sample *pNew,
90568 tRowcnt nEqNew = pNew->anEq[pNew->iCol];
90571 assert( pOld->isPSample==0 && pNew->isPSample==0 );
90572 assert( IsStat4 || (pNew->iCol==0 && pOld->iCol==0) );
90577 if( pNew->iCol<pOld->iCol ) return 1;
90578 return (pNew->iCol==pOld->iCol && sampleIsBetterPost(pAccum, pNew, pOld));
90582 return (nEqNew==nEqOld && pNew->iHash>pOld->iHash);
90587 ** Copy the contents of sample *pNew into the p->a[] array. If necessary,
90590 static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
90597 if( pNew->isPSample==0 ){
90599 assert( pNew->anEq[pNew->iCol]>0 );
90608 if( pOld->anEq[pNew->iCol]==0 ){
90610 assert( pOld->iCol>pNew->iCol );
90611 assert( sampleIsBetter(p, pNew, pOld) );
90618 pUpgrade->iCol = pNew->iCol;
90619 pUpgrade->anEq[pUpgrade->iCol] = pNew->anEq[pUpgrade->iCol];
90646 || pNew->anLt[p->nCol-1] > p->a[p->nSample-1].anLt[p->nCol-1] );
90651 sampleCopy(p, pSample, pNew);
96337 void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry);
96338 if( pNew==0 ){
96342 pArray = pNew;
96439 SrcList *pNew;
96442 pNew = sqlite3DbRealloc(db, pSrc,
96444 if( pNew==0 ){
96448 pSrc = pNew;
96449 nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
97157 With *pNew;
97174 pNew = sqlite3DbRealloc(db, pWith, nByte);
97176 pNew
97178 assert( zName!=0 || pNew==0 );
97179 assert( db->mallocFailed==0 || pNew==0 );
97181 if( pNew==0 ){
97185 pNew = pWith;
97187 pNew->a[pNew->nCte].pSelect = pQuery;
97188 pNew->a[pNew->nCte].pCols = pArglist;
97189 pNew->a[pNew->nCte].zName = zName;
97190 pNew->a[pNew->nCte].zCteErr = 0;
97191 pNew->nCte++;
97194 return pNew;
101625 Expr *pNew;
101627 pNew = sqlite3PExpr(pParse, TK_DOT,
101634 pNew = sqlite3ExprDup(db, pDflt, 0);
101636 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
101639 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
101641 pList = sqlite3ExprListAppend(pParse, pList, pNew);
108504 sqlite3_stmt *pNew;
108513 rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0);
108518 assert( pNew==0 );
108521 assert( pNew!=0 );
108523 sqlite3VdbeSwap((Vdbe*)pNew, p);
108524 sqlite3TransferBindings(pNew, (sqlite3_stmt*)p);
108525 sqlite3VdbeResetStepResult((Vdbe*)pNew);
108526 sqlite3VdbeFinalize((Vdbe*)pNew);
108766 Select *pNew;
108769 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
108770 if( pNew==0 ){
108772 pNew = &standin;
108773 memset(pNew, 0, sizeof(*pNew));
108778 pNew->pEList = pEList;
108780 pNew->pSrc = pSrc;
108781 pNew->pWhere = pWhere;
108782 pNew->pGroupBy = pGroupBy;
108783 pNew->pHaving = pHaving;
108784 pNew->pOrderBy = pOrderBy;
108785 pNew->selFlags = selFlags;
108786 pNew->op = TK_SELECT;
108787 pNew->pLimit = pLimit;
108788 pNew->pOffset = pOffset;
108790 pNew->addrOpenEphm[0] = -1;
108791 pNew->addrOpenEphm[1] = -1;
108793 clearSelect(db, pNew, pNew!=&standin);
108794 pNew = 0;
108796 assert( pNew->pSrc!=0 || pParse->nErr>0 );
108798 assert( pNew!=&standin );
108799 return pNew;
111501 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
111502 if( pNew==0 ) return SQLITE_NOMEM;
111503 pNew->flags |= EP_IntValue;
111504 pNew->u.iValue = i;
111505 pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew);
111766 Expr *pNew;
111769 pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0);
111771 pExpr = pNew;
112159 Select *pNew;
112169 pNew = sqlite3SelectDup(db, p, 0);
112170 sqlite3SelectSetName(pNew, pSub->zSelName);
112176 if( pNew==0 ){
112179 pNew->pPrior = pPrior;
112180 if( pPrior ) pPrior->pNext = pNew;
112181 pNew->pNext = p;
112182 p->pPrior = pNew;
112185 pNew->zSelName, pNew));
112420 Expr *pNew;
112437 pNew = sqlite3ExprDup(db, pWhere, 0);
112438 pNew = substExpr(db, pNew, iCursor, pSubq->pEList);
112439 pSubq->pWhere = sqlite3ExprAnd(db, pSubq->pWhere, pNew);
112570 Select *pNew;
112592 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
112593 if( pNew==0 ) return WRC_Abort;
112595 pNewSrc = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&dummy,pNew,0,0);
112597 *pNew = *p;
112602 pNew->pGroupBy = 0;
112603 pNew->pHaving = 0;
112604 pNew->pOrderBy = 0;
112611 assert( pNew->pPrior!=0 );
112612 pNew->pPrior->pNext = pNew;
112613 pNew->pLimit = 0;
112614 pNew->pOffset = 0;
112959 ExprList *pNew = 0;
112971 pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr);
112972 if( pNew ){
112973 pNew->a[pNew->nExpr-1].zName = a[k].zName;
112974 pNew->a[pNew->nExpr-1].zSpan = a[k].zSpan;
113062 pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
113065 sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
113066 if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){
113067 struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
113091 p->pEList = pNew;
117806 FuncDef *pNew;
117841 pNew = sqlite3DbMallocZero(db, sizeof(*pNew)
117843 if( pNew==0 ){
117846 *pNew = *pDef;
117847 pNew->zName = (char *)&pNew[1];
117848 memcpy(pNew->zName, pDef->zName, sqlite3Strlen30(pDef->zName)+1);
117849 pNew->xFunc = xFunc;
117850 pNew->pUserData = pArg;
117851 pNew->funcFlags |= SQLITE_FUNC_EPHEM;
117852 return pNew;
118408 WhereLoop *pNew; /* Template WhereLoop */
120422 Expr *pNew; /* New virtual expression */
120444 pNew = sqlite3ExprDup(db, pOne->pExpr, 0);
120445 if( pNew==0 ) return;
120447 pNew->op = op;
120448 idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC);
120752 Expr *pNew; /* The complete IN operator */
120765 pNew = sqlite3PExpr(pParse, TK_IN, pDup, 0, 0);
120766 if( pNew ){
120768 transferJoinMarkings(pNew, pExpr);
120769 assert( !ExprHasProperty(pNew, EP_xIsSelect) );
120770 pNew->x.pList = pList;
120771 idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC);
120979 WhereTerm *pNew;
120981 u16 eExtraOp = 0; /* Extra bits for pNew->eOperator */
120991 pNew = &pWC->a[idxNew];
120993 if( op==TK_IS ) pNew->wtFlags |= TERM_IS;
121003 pNew = pTerm;
121006 pNew->leftCursor = iCur;
121007 pNew->u.leftColumn = iColumn;
121009 pNew->prereqRight = prereqLeft | extraRight;
121010 pNew->prereqAll = prereqAll;
121011 pNew->eOperator = (operatorMask(pDup->op) + eExtraOp) & opMask;
122712 ** The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
122918 Index *p = pBuilder->pNew->u.btree.pIndex;
122919 int nEq = pBuilder->pNew->u.btree.nEq;
122983 Index *p = pBuilder->pNew->u.btree.pIndex;
123545 ** We have so far matched pBuilder->pNew->u.btree.nEq terms of the
123548 ** When this function is called, pBuilder->pNew->nOut contains the
123565 WhereLoop *pNew; /* Template WhereLoop under construction */
123569 Bitmask saved_prereq; /* Original value of pNew->prereq */
123570 u16 saved_nLTerm; /* Original value of pNew->nLTerm */
123571 u16 saved_nEq; /* Original value of pNew->u.btree.nEq */
123572 u16 saved_nSkip; /* Original value of pNew->nSkip */
123573 u32 saved_wsFlags; /* Original value of pNew->wsFlags */
123574 LogEst saved_nOut; /* Original value of pNew->nOut */
123580 pNew = pBuilder->pNew;
123583 assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
123584 assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
123585 if( pNew->wsFlags & WHERE_BTM_LIMIT ){
123594 assert( pNew->u.btree.nEq<pProbe->nColumn );
123596 saved_nEq = pNew->u.btree.nEq;
123597 saved_nSkip = pNew->nSkip;
123598 saved_nLTerm = pNew->nLTerm;
123599 saved_wsFlags = pNew->wsFlags;
123600 saved_prereq = pNew->prereq;
123601 saved_nOut = pNew->nOut;
123604 pNew->rSetup = 0;
123620 if( pTerm->prereqRight & pNew->maskSelf ) continue;
123626 pNew
123627 pNew->u.btree.nEq = saved_nEq;
123628 pNew->nLTerm = saved_nLTerm;
123629 if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
123630 pNew->aLTerm[pNew->nLTerm++] = pTerm;
123631 pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf;
123634 || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0
123635 || (pNew->wsFlags & WHERE_COLUMN_IN)!=0
123636 || (pNew->wsFlags & WHERE_SKIPSCAN)!=0
123641 pNew->wsFlags |= WHERE_COLUMN_IN;
123654 pNew->wsFlags |= WHERE_COLUMN_EQ;
123655 assert( saved_nEq==pNew->u.btree.nEq );
123660 pNew->wsFlags |= WHERE_UNQ_WANTED;
123662 pNew->wsFlags |= WHERE_ONEROW;
123666 pNew->wsFlags |= WHERE_COLUMN_NULL;
123670 pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_BTM_LIMIT;
123680 if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
123681 pNew->aLTerm[pNew->nLTerm++] = pTop;
123682 pNew->wsFlags |= WHERE_TOP_LIMIT;
123688 pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_TOP_LIMIT;
123690 pBtm = (pNew->wsFlags & WHERE_BTM_LIMIT)!=0 ?
123691 pNew->aLTerm[pNew->nLTerm-2] : 0;
123694 /* At this point pNew->nOut is set to the number of rows expected to
123698 ** the value of pNew->nOut to account for pTerm (but not nIn/nInMul). */
123699 assert( pNew->nOut==saved_nOut );
123700 if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
123703 whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew);
123705 int nEq = ++pNew->u.btree.nEq;
123708 assert( pNew->nOut==saved_nOut );
123712 pNew->nOut += pTerm->truthProb;
123713 pNew->nOut -= nIn;
123719 && pNew->u.btree.nEq<=pProbe->nSampleCol
123734 pNew->nOut = sqlite3LogEst(nOut);
123735 if( pNew->nOut>saved_nOut ) pNew->nOut = saved_nOut;
123736 pNew->nOut -= nIn;
123742 pNew->nOut += (pProbe->aiRowLogEst[nEq] - pProbe->aiRowLogEst[nEq-1]);
123747 pNew->nOut += 10;
123754 ** it to pNew->rRun, which is currently set to the cost of the index
123757 rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
123758 pNew->rRun = sqlite3LogEstAdd(rLogSize, rCostIdx);
123759 if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
123760 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, pNew->nOut + 16);
123762 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
123764 nOutUnadjusted = pNew->nOut;
123765 pNew->rRun += nInMul + nIn;
123766 pNew->nOut += nInMul + nIn;
123767 whereLoopOutputAdjust(pBuilder->pWC, pNew, rSize);
123768 rc = whereLoopInsert(pBuilder, pNew);
123770 if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
123771 pNew->nOut = saved_nOut;
123773 pNew->nOut = nOutUnadjusted;
123776 if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
123777 && pNew->u.btree.nEq<pProbe->nColumn
123781 pNew->nOut = saved_nOut;
123786 pNew->prereq = saved_prereq;
123787 pNew->u.btree.nEq = saved_nEq;
123788 pNew->nSkip = saved_nSkip;
123789 pNew->wsFlags = saved_wsFlags;
123790 pNew->nOut = saved_nOut;
123791 pNew->nLTerm = saved_nLTerm;
123808 && (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
123811 pNew->u.btree.nEq++;
123812 pNew->nSkip++;
123813 pNew->aLTerm[pNew->nLTerm++] = 0;
123814 pNew->wsFlags |= WHERE_SKIPSCAN;
123816 pNew->nOut -= nIter;
123821 pNew->nOut = saved_nOut;
123822 pNew->u.btree.nEq = saved_nEq;
123823 pNew->nSkip = saved_nSkip;
123824 pNew->wsFlags = saved_wsFlags;
123909 ** is idenfied by pBuilder->pNew->iTab. That table is guaranteed to be
123954 WhereLoop *pNew; /* Template WhereLoop object */
123963 pNew = pBuilder->pNew;
123966 pSrc = pTabList->a + pNew->iTab;
124018 if( pTerm->prereqRight & pNew->maskSelf ) continue;
124020 pNew->u.btree.nEq = 1;
124021 pNew->nSkip = 0;
124022 pNew->u.btree.pIndex = 0;
124023 pNew->nLTerm = 1;
124024 pNew->aLTerm[0] = pTerm;
124033 pNew->rSetup = rLogSize + rSize + 4;
124035 pNew->rSetup += 24;
124037 ApplyCostMultiplier(pNew->rSetup, pTab->costMult);
124042 pNew->nOut = 43; assert( 43==sqlite3LogEst(20) );
124043 pNew->rRun = sqlite3LogEstAdd(rLogSize,pNew->nOut);
124044 pNew->wsFlags = WHERE_AUTO_INDEX;
124045 pNew
124046 rc = whereLoopInsert(pBuilder, pNew);
124057 testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
124061 pNew->u.btree.nEq = 0;
124062 pNew->nSkip = 0;
124063 pNew->nLTerm = 0;
124064 pNew->iSortIdx = 0;
124065 pNew->rSetup = 0;
124066 pNew->prereq = mExtra;
124067 pNew->nOut = rSize;
124068 pNew->u.btree.pIndex = pProbe;
124074 pNew->wsFlags = WHERE_IPK;
124077 pNew->iSortIdx = b ? iSortIdx : 0;
124079 pNew->rRun = rSize + 16;
124080 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
124081 whereLoopOutputAdjust(pWC, pNew, rSize);
124082 rc = whereLoopInsert(pBuilder, pNew);
124083 pNew->nOut = rSize;
124088 pNew->wsFlags = WHERE_IDX_ONLY | WHERE_INDEXED;
124092 pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED;
124106 pNew->iSortIdx = b ? iSortIdx : 0;
124112 pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
124114 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, rSize+16);
124116 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
124117 whereLoopOutputAdjust(pWC, pNew, rSize);
124118 rc = whereLoopInsert(pBuilder, pNew);
124119 pNew->nOut = rSize;
124141 ** pBuilder->pNew->iTab. That table is guaranteed to be a virtual table.
124185 WhereLoop *pNew;
124193 pNew = pBuilder->pNew;
124194 pSrc = &pWInfo->pTabList->a[pNew->iTab];
124199 pNew->prereq = 0;
124200 pNew->rSetup = 0;
124201 pNew->wsFlags = WHERE_VIRTUALTABLE;
124202 pNew->nLTerm = 0;
124203 pNew->u.vtab.needFree = 0;
124206 if( whereLoopResize(db, pNew, nConstraint) ){
124259 pNew->prereq = mExtra;
124261 assert( pNew->nLSlot>=nConstraint );
124262 for(i=0; i<nConstraint; i++) pNew->aLTerm[i] = 0;
124263 pNew->u.vtab.omitMask = 0;
124270 || pNew->aLTerm[iTerm]!=0
124280 pNew->prereq |= pTerm->prereqRight;
124281 assert( iTerm<pNew->nLSlot );
124282 pNew->aLTerm[iTerm] = pTerm;
124286 if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<<iTerm;
124306 pNew->nLTerm = mxTerm+1;
124307 assert( pNew->nLTerm<=pNew->nLSlot );
124308 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
124309 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
124311 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
124312 pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ?
124314 pNew->rSetup = 0;
124315 pNew->rRun = sqlite3LogEstFromDouble(pIdxInfo->estimatedCost);
124316 pNew->nOut = sqlite3LogEst(pIdxInfo->estimatedRows);
124321 pNew->wsFlags |= WHERE_ONEROW;
124323 pNew->wsFlags &= ~WHERE_ONEROW;
124325 whereLoopInsert(pBuilder, pNew);
124326 if( pNew->u.vtab.needFree ){
124327 sqlite3_free(pNew->u.vtab.idxStr);
124328 pNew->u.vtab.needFree = 0;
124351 WhereLoop *pNew;
124362 pNew = pBuilder->pNew;
124364 pItem = pWInfo->pTabList->a + pNew->iTab;
124369 && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0
124436 pNew->nLTerm = 1;
124437 pNew->aLTerm[0] = pTerm;
124438 pNew->wsFlags = WHERE_MULTI_OR;
124439 pNew->rSetup = 0;
124440 pNew->iSortIdx = 0;
124441 memset(&pNew->u, 0, sizeof(pNew->u));
124455 pNew->rRun = sSum.a[i].rRun + 1;
124456 pNew->nOut = sSum.a[i].nOut;
124457 pNew->prereq = sSum.a[i].prereq;
124458 rc = whereLoopInsert(pBuilder, pNew);
124479 WhereLoop *pNew;
124483 pNew = pBuilder->pNew;
124484 whereLoopInit(pNew);
124487 pNew->iTab = iTab;
124488 pNew->maskSelf = sqlite3WhereGetMask(&pWInfo->sMaskSet, pItem->iCursor);
124509 mPrior |= pNew->maskSelf;
124513 whereLoopClear(db, pNew);
125238 pLoop = pBuilder->pNew;
125469 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
125470 assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) );
125471 whereLoopInit(sWLB.pNew);
125473 sWLB.pNew->cId = '*';
127364 yyStackEntry *pNew;
127367 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
127368 if( pNew ){
127369 p->yystack = pNew;
128622 struct SrcList_item *pNew = &yygotominor.yy65->a[yygotominor.yy65->nSrc-1];
128624 pNew->zName = pOld->zName;
128625 pNew->zDatabase = pOld->zDatabase;
128626 pNew->pSelect = pOld->pSelect;
134438 /* sqlite3_test_control(SQLITE_TESTCTRL_SCRATCHMALLOC, sz, &pNew, pFree);
134441 ** If sz>0 then allocate a scratch buffer into pNew.
134901 void **pNew = (void **)sqlite3Malloc(nArg*sizeof(void *)*2);
134902 if( pNew ){
134903 memcpy(pNew, aArg, nArg*sizeof(void *));
134905 aDyn = aArg = pNew;
135547 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey);
138661 ** Append SegReader object pNew to the end of the pCsr->apSegment[] array.
138665 Fts3SegReader *pNew
138672 sqlite3Fts3SegReaderFree(pNew);
138677 pCsr->apSegment[pCsr->nSegment++] = pNew;
142938 ** inserted into the tree. This function adds pNew, which is always a binary
142940 ** of pNew and the existing nodes of the tree. This may result in the head
142946 Fts3Expr *pNew /* New binary node to insert into expression tree */
142949 while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){
142955 pSplit->pParent->pRight = pNew;
142956 pNew->pParent = pSplit->pParent;
142958 *ppHead = pNew;
142960 pNew->pLeft = pSplit;
142961 pSplit->pParent = pNew;
143727 ** "pNew" is a pointer to the hash table that is to be initialized.
143734 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){
143735 assert( pNew!=0 );
143737 pNew->keyClass = keyClass;
143738 pNew->copyKey = copyKey;
143739 pNew->first = 0;
143740 pNew->count = 0;
143741 pNew->htsize = 0;
143742 pNew->ht = 0;
143843 struct _fts3ht *pEntry, /* The entry into which pNew is inserted */
143844 Fts3HashElem *pNew /* The element to be inserted */
143849 pNew->next = pHead;
143850 pNew->prev = pHead->prev;
143851 if( pHead->prev ){ pHead->prev->next = pNew; }
143852 else { pH->first = pNew; }
143853 pHead->prev = pNew;
143855 pNew->next = pH->first;
143856 if( pH->first ){ pH->first->prev = pNew; }
143857 pNew->prev = 0;
143858 pH->first = pNew;
143861 pEntry->chain = pNew;
144683 char *pNew;
144685 pNew = sqlite3_realloc(c->zToken, c->nAllocated);
144686 if( !pNew ) return SQLITE_NOMEM;
144687 c->zToken = pNew;
145409 char *pNew;
145411 pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated);
145412 if( !pNew ) return SQLITE_NOMEM;
145413 c->pToken = pNew;
147919 SegmentNode *pNew;
147989 pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize);
147990 if( !pNew ){
147993 memset(pNew, 0, sizeof(SegmentNode));
147994 pNew->nData = 1 + FTS3_VARINT_MAX;
147995 pNew->aData = (char *)&pNew[1];
148003 pTree->pRight = pNew;
148004 pNew->pLeftmost = pTree->pLeftmost;
148005 pNew->pParent = pParent;
148006 pNew->zMalloc = pTree->zMalloc;
148007 pNew->nMalloc = pTree->nMalloc;
148010 pNew->pLeftmost = pNew;
148011 rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm);
148014 *ppTree = pNew;
148544 char *pNew;
148546 pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer);
148547 if( !pNew ) return SQLITE_NOMEM;
148548 pMsr->aBuffer = pNew;
150423 ** This function creates a new node image in blob object *pNew by copying
150430 Blob *pNew, /* OUT: Write new node image here */
150441 blobGrowBuffer(pNew, nNode, &rc);
150443 pNew->n = 0;
150450 if( pNew->n==0 ){
150453 fts3StartNode(pNew, (int)aNode[0], reader.iChild);
150457 pNew, &prev, reader.term.a, reader.term.n,
150462 if( pNew->n==0 ){
150463 fts3StartNode(pNew, (int)aNode[0], reader.iChild);
150466 assert( pNew->n<=pNew->nAlloc );
153528 unicode_tokenizer *pNew; /* New tokenizer object */
153532 pNew = (unicode_tokenizer *) sqlite3_malloc(sizeof(unicode_tokenizer));
153533 if( pNew==NULL ) return SQLITE_NOMEM;
153534 memset(pNew, 0, sizeof(unicode_tokenizer));
153535 pNew->bRemoveDiacritic = 1;
153542 pNew->bRemoveDiacritic = 1;
153545 pNew->bRemoveDiacritic = 0;
153548 rc = unicodeAddExceptions(pNew, 1, &z[11], n-11);
153551 rc = unicodeAddExceptions(pNew, 0, &z[11], n-11);
153560 unicodeDestroy((sqlite3_tokenizer *)pNew);
153561 pNew = 0;
153563 *pp = (sqlite3_tokenizer *)pNew;
155241 RtreeSearchPoint *pNew;
155244 pNew = sqlite3_realloc(pCur->aPoint, nNew*sizeof(pCur->aPoint[0]));
155245 if( pNew==0 ) return 0;
155246 pCur->aPoint = pNew;
155250 pNew = pCur->aPoint + i;
155251 pNew->rScore = rScore;
155252 pNew->iLevel = iLevel;
155258 if( rtreeSearchPointCompare(pNew, pParent)>=0 ) break;
155261 pNew = pParent;
155263 return pNew;
155275 RtreeSearchPoint *pNew, *pFirst;
155284 pNew = rtreeEnqueue(pCur, rScore, iLevel);
155285 if( pNew==0 ) return 0;
155286 ii = (int)(pNew - pCur->aPoint) + 1;
155294 *pNew = pCur->sPoint;
155672 RtreeSearchPoint *pNew;
155673 pNew = rtreeSearchPointNew(pCsr, RTREE_ZERO, pRtree->iDepth+1);
155674 if( pNew==0 ) return SQLITE_NOMEM;
155675 pNew->id = 1;
155676 pNew->iCell = 0;
155677 pNew->eWithin = PARTLY_WITHIN;
162466 char *pNew = (char*)sqlite3_malloc(szRegion);
162467 if( pNew==0 ){
162470 memset(pNew, 0, szRegion);
162471 p->apShm[iRegion] = pNew;
162831 rbu_vfs *pNew = 0; /* Newly allocated VFS */
162838 pNew = (rbu_vfs*)sqlite3_malloc(nByte);
162839 if( pNew==0 ){
162843 memset(pNew, 0, nByte);
162849 memcpy(&pNew->base, &vfs_template, sizeof(sqlite3_vfs));
162850 pNew->base.mxPathname = pParent->mxPathname;
162851 pNew->base.szOsFile = sizeof(rbu_file) + pParent->szOsFile;
162852 pNew->pRealVfs = pParent;
162853 pNew->base.zName = (const char*)(zSpace = (char*)&pNew[1]);
162857 pNew->mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_RECURSIVE);
162858 if( pNew->mutex==0 ){
162861 rc = sqlite3_vfs_register(&pNew->base, 0);
162866 sqlite3_mutex_free(pNew->mutex);
162867 sqlite3_free(pNew);
164222 JsonNode *pNew;
164226 pNew = sqlite3_realloc(pParse->aNode, sizeof(JsonNode)*nNew);
164227 if( pNew==0 ){
164232 pParse->aNode = pNew;
165126 sqlite3_vtab *pNew;
165149 pNew = *ppVtab = sqlite3_malloc( sizeof(*pNew) );
165150 if( pNew==0 ) return SQLITE_NOMEM;
165151 memset(pNew, 0, sizeof(*pNew));
167271 fts5yyStackEntry *pNew;
167274 pNew = realloc(p->fts5yystack, newSize*sizeof(pNew[0]));
167275 if( pNew ){
167276 p->fts5yystack = pNew;
168643 u8 *pNew;
168652 pNew = sqlite3_realloc(pBuf->p, nNew);
168653 if( pNew==0 ){
168658 pBuf->p = pNew;
170009 Fts5Expr *pNew;
170026 *ppNew = pNew = sqlite3_malloc(sizeof(Fts5Expr));
170027 if( pNew==0 ){
170031 pNew->pRoot = sParse.pExpr;
170032 pNew->pIndex = 0;
170033 pNew->apExprPhrase = sParse.apPhrase;
170034 pNew->nPhrase = sParse.nPhrase;
171239 Fts5ExprPhrase *pNew;
171242 pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase,
171245 if( pNew==0 ){
171248 if( pPhrase==0 ) memset(pNew, 0, sizeof(Fts5ExprPhrase));
171249 pCtx->pPhrase = pPhrase = pNew;
171250 pNew->nTerm = nNew - SZALLOC;
171363 Fts5Expr *pNew = 0; /* Expression to return via *ppNew */
171370 pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr));
171372 pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc,
171376 pNew->pRoot = (Fts5ExprNode*)sqlite3Fts5MallocZero(&rc,
171380 pNew->pRoot->pNear = (Fts5ExprNearset*)sqlite3Fts5MallocZero(&rc,
171399 pNew->pIndex = pExpr->pIndex;
171400 pNew->nPhrase = 1;
171401 pNew->apExprPhrase[0] = sCtx.pPhrase;
171402 pNew->pRoot->pNear->apPhrase[0] = sCtx.pPhrase;
171403 pNew->pRoot->pNear->nPhrase = 1;
171404 sCtx.pPhrase->pNode = pNew->pRoot;
171407 pNew->pRoot->eType = FTS5_TERM;
171409 pNew->pRoot->eType = FTS5_STRING;
171412 sqlite3Fts5ExprFree(pNew);
171414 pNew = 0;
171417 *ppNew = pNew;
171474 Fts5Colset *pNew; /* New colset object to return */
171479 pNew = sqlite3_realloc(p, sizeof(Fts5Colset) + sizeof(int)*nCol);
171480 if( pNew==0 ){
171483 int *aiCol = pNew->aiCol;
171486 if( aiCol[i]==iCol ) return pNew;
171493 pNew->nCol = nCol+1;
171497 for(i=1; i<pNew->nCol; i++) assert( pNew->aiCol[i]>pNew->aiCol[i-1] );
171501 return pNew;
172115 Fts5Hash *pNew;
172117 *ppNew = pNew = (Fts5Hash*)sqlite3_malloc(sizeof(Fts5Hash));
172118 if( pNew==0 ){
172122 memset(pNew, 0, sizeof(Fts5Hash));
172123 pNew->pnByte = pnByte;
172125 pNew->nSlot = 1024;
172126 nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
172127 pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc(nByte);
172128 if( pNew->aSlot==0 ){
172129 sqlite3_free(pNew);
172133 memset(pNew->aSlot, 0, nByte);
172301 Fts5HashEntry *pNew;
172303 pNew = (Fts5HashEntry*)sqlite3_realloc(p, nNew);
172304 if( pNew==0 ) return SQLITE_NOMEM;
172305 pNew->nAlloc = nNew;
172307 *pp = pNew;
172308 p = pNew;
173879 Fts5DlidxIter *pNew;
173881 pNew = (Fts5DlidxIter*)sqlite3_realloc(pIter, nByte);
173882 if( pNew==0 ){
173886 Fts5DlidxLvl *pLvl = &pNew->aLvl[i];
173887 pIter = pNew;
174157 Fts5Data *pNew;
174159 pNew = fts5DataRead(p, FTS5_SEGMENT_ROWID(
174162 if( pNew ){
174167 && pIter->iTermLeafOffset<pNew->szLeaf
174169 pIter->pLeaf = pNew;
174173 iRowidOff = fts5LeafFirstRowidOff(pNew);
174175 pIter->pLeaf = pNew;
174185 fts5DataRelease(pNew);
174376 Fts5Data *pNew = fts5DataRead(p, iAbs);
174377 if( pNew ){
174379 iRowid = fts5LeafFirstRowidOff(pNew);
174380 bTermless = fts5LeafIsTermless(pNew);
174382 SWAPVAL(Fts5Data*, pNew, pLast);
174385 fts5DataRelease(pNew);
175015 Fts5SegIter *pNew = &pIter->aSeg[iChanged];
175017 if( pNew->iRowid==pIter->iSwitchRowid
175018 || (pNew->iRowid<pIter->iSwitchRowid)==pIter->bRev
175026 assert( pNew->pLeaf );
175030 if( pNew->iRowid==pOther->iRowid ){
175032 }else if( (pOther->iRowid>pNew->iRowid)==pIter->bRev ){
175034 pNew = pOther;
175039 pRes->iFirst = (pNew - pIter->aSeg);
175101 Fts5IndexIter *pNew;
175105 pNew = fts5IdxMalloc(p,
175106 sizeof(Fts5IndexIter) + /* pNew */
175107 sizeof(Fts5SegIter) * (nSlot-1) + /* pNew->aSeg[] */
175108 sizeof(Fts5CResult) * nSlot /* pNew->aFirst[] */
175110 if( pNew ){
175111 pNew->nSeg = nSlot;
175112 pNew->aFirst = (Fts5CResult*)&pNew->aSeg[nSlot];
175113 pNew->pIndex = p;
175115 return pNew;
175144 Fts5IndexIter *pNew;
175158 *ppOut = pNew = fts5MultiIterAlloc(p, nSeg);
175159 if( pNew==0 ) return;
175160 pNew->bRev = (0!=(flags & FTS5INDEX_QUERY_DESC));
175161 pNew->bSkipEmpty = bSkipEmpty;
175162 pNew->pStruct = pStruct;
175170 Fts5SegIter *pIter = &pNew->aSeg[iIter++];
175176 Fts5SegIter *pIter = &pNew->aSeg[iIter++];
175187 fts5SegIterInit(p, &pLvl->aSeg[iSeg], &pNew->aSeg[iIter++]);
175197 for(iIter=pNew->nSeg-1; iIter>0; iIter--){
175199 if( (iEq = fts5MultiIterDoCompare(pNew, iIter)) ){
175200 fts5SegIterNext(p, &pNew->aSeg[iEq], 0);
175201 fts5MultiIterAdvanced(p, pNew, iEq, iIter);
175204 fts5MultiIterSetEof(pNew);
175205 fts5AssertMultiIterSetup(p, pNew);
175207 if( pNew->bSkipEmpty && fts5MultiIterIsEmpty(p, pNew) ){
175208 fts5MultiIterNext(p, pNew, 0, 0);
175211 fts5MultiIterFree(p, pNew);
175227 Fts5IndexIter *pNew;
175228 pNew = fts5MultiIterAlloc(p, 2);
175229 if( pNew ){
175230 Fts5SegIter *pIter = &pNew->aSeg[1];
175232 pNew->bFiltered = 1;
175238 pNew->aFirst[1].iFirst = 1;
175240 pNew->bRev = 1;
175248 pNew->bEof = 1;
175251 *ppOut = pNew;
175392 ** Return the size of the prefix, in bytes, that buffer (nNew/pNew) shares
175397 int nNew, const u8 *pNew
175400 assert( fts5BlobCompare(pOld, nOld, pNew, nNew)<0 );
175402 if( pOld[i]!=pNew[i] ) break;
176373 Fts5Structure *pNew = 0;
176386 pNew = (Fts5Structure*)sqlite3Fts5MallocZero(&p->rc, nByte);
176389 if( pNew ){
176392 pNew->nLevel = pStruct->nLevel+1;
176393 pNew->nRef = 1;
176394 pNew->nWriteCounter = pStruct->nWriteCounter;
176395 pLvl = &pNew->aLevel[pStruct->nLevel];
176406 pNew->nSegment = pLvl->nSeg = nSeg;
176408 sqlite3_free(pNew);
176409 pNew = 0;
176413 if( pNew ){
176414 int iLvl = pNew->nLevel-1;
176415 while( p->rc==SQLITE_OK && pNew->aLevel[iLvl].nSeg>0 ){
176417 fts5IndexMergeLevel(p, &pNew, iLvl, &nRem);
176420 fts5StructureWrite(p, pNew);
176421 fts5StructureRelease(pNew);
180180 Fts5Cursor *pNew = 0;
180182 rc = fts5OpenMethod(pCsr->base.pVtab, (sqlite3_vtab_cursor**)&pNew);
180185 pNew->ePlan = FTS5_PLAN_MATCH;
180186 pNew->iFirstRowid = SMALLEST_INT64;
180187 pNew->iLastRowid = LARGEST_INT64;
180188 pNew->base.pVtab = (sqlite3_vtab*)pTab;
180189 rc = sqlite3Fts5ExprClonePhrase(pConf, pCsr->pExpr, iPhrase, &pNew->pExpr);
180193 for(rc = fts5CursorFirst(pTab, pNew, 0);
180194 rc==SQLITE_OK && CsrFlagTest(pNew, FTS5CSR_EOF)==0;
180195 rc = fts5NextMethod((sqlite3_vtab_cursor*)pNew)
180197 rc = xCallback(&sFts5Api, (Fts5Context*)pNew, pUserData);
180205 fts5CloseMethod((sqlite3_vtab_cursor*)pNew);
180492 Fts5TokenizerModule *pNew;
180499 pNew = (Fts5TokenizerModule*)sqlite3_malloc(nByte);
180500 if( pNew ){
180501 memset(pNew, 0, nByte);
180502 pNew->zName = (char*)&pNew[1];
180503 memcpy(pNew->zName, zName, nName);
180504 pNew->pUserData = pUserData;
180505 pNew->x = *pTokenizer;
180506 pNew->xDestroy = xDestroy;
180507 pNew->pNext = pGlobal->pTok;
180508 pGlobal->pTok = pNew;
180509 if( pNew->pNext==0 ){
180510 pGlobal->pDfltTok = pNew;