Lines Matching refs:pNew

17653   void *pNew;  in sqlite3MemRealloc()  local
17657 pNew = sqlite3MemMalloc(nByte); in sqlite3MemRealloc()
17658 if( pNew ){ in sqlite3MemRealloc()
17659 memcpy(pNew, pPrior, (int)(nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize)); in sqlite3MemRealloc()
17661 randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize); in sqlite3MemRealloc()
17665 return pNew; in sqlite3MemRealloc()
19372 sqlite3_debug_mutex *pNew = 0; in debugMutexAlloc() local
19376 pNew = sqlite3Malloc(sizeof(*pNew)); in debugMutexAlloc()
19377 if( pNew ){ in debugMutexAlloc()
19378 pNew->id = id; in debugMutexAlloc()
19379 pNew->cnt = 0; in debugMutexAlloc()
19390 pNew = &aStatic[id-2]; in debugMutexAlloc()
19391 pNew->id = id; in debugMutexAlloc()
19395 return (sqlite3_mutex*)pNew; in debugMutexAlloc()
21061 void *pNew;
21081 pNew = pOld;
21090 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21091 if( pNew==0 && mem0.alarmCallback ){
21093 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21095 if( pNew ){
21096 nNew = sqlite3MallocSize(pNew);
21101 pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
21103 assert( EIGHT_BYTE_ALIGNMENT(pNew) ); /* IMP: R-11148-40995 */
21104 return pNew;
21212 void *pNew = 0;
21223 pNew = sqlite3DbMallocRaw(db, n);
21224 if( pNew ){
21225 memcpy(pNew, p, db->lookaside.sz);
21232 pNew = sqlite3_realloc64(p, n);
21233 if( !pNew ){
21236 sqlite3MemdebugSetType(pNew,
21240 return pNew;
21248 void *pNew;
21249 pNew = sqlite3DbRealloc(db, p, n);
21250 if( !pNew ){
21253 return pNew;
24826 SQLITE_PRIVATE void sqlite3HashInit(Hash *pNew){
24827 assert( pNew!=0 );
24828 pNew->first = 0;
24829 pNew->count = 0;
24830 pNew->htsize = 0;
24831 pNew->ht = 0;
24874 HashElem *pNew /* The element to be inserted */
24880 pEntry->chain = pNew;
24885 pNew->next = pHead;
24886 pNew->prev = pHead->prev;
24887 if( pHead->prev ){ pHead->prev->next = pNew; }
24888 else { pH->first = pNew; }
24889 pHead->prev = pNew;
24891 pNew->next = pH->first;
24892 if( pH->first ){ pH->first->prev = pNew; }
24893 pNew->prev = 0;
24894 pH->first = pNew;
26345 struct vxworksFileId *pNew; /* search key and new file ID */
26351 pNew = sqlite3_malloc64( sizeof(*pNew) + (n+1) );
26352 if( pNew==0 ) return 0;
26353 pNew->zCanonicalName = (char*)&pNew[1];
26354 memcpy(pNew->zCanonicalName, zAbsoluteName, n+1);
26355 n = vxworksSimplifyName(pNew->zCanonicalName, n);
26364 && memcmp(pCandidate->zCanonicalName, pNew->zCanonicalName, n)==0
26366 sqlite3_free(pNew);
26374 pNew->nRef = 1;
26375 pNew->nName = n;
26376 pNew->pNext = vxworksFileList;
26377 vxworksFileList = pNew;
26379 return pNew;
30208 u8 *pNew = 0; /* Location of new mapping */
30235 pNew = osMremap(pOrig, nReuse, nNew, MREMAP_MAYMOVE);
30238 pNew = osMmap(pReq, nNew-nReuse, flags, MAP_SHARED, h, nReuse);
30239 if( pNew!=MAP_FAILED ){
30240 if( pNew!=pReq ){
30241 osMunmap(pNew, nNew - nReuse);
30242 pNew = 0;
30244 pNew = pOrig;
30250 if( pNew==MAP_FAILED || pNew==0 ){
30256 if( pNew==0 ){
30257 pNew = osMmap(0, nNew, flags, MAP_SHARED, h, 0);
30260 if( pNew==MAP_FAILED ){
30261 pNew = 0;
30270 pFd->pMapRegion = (void *)pNew;
30586 unixFile *pNew /* open file object for the database file */
30627 if( osFcntl(pNew->h, F_GETLK, &lockInfo)!=-1 ) {
30650 unixFile *pNew /* the open file object */
30667 if( osFcntl(pNew->h, F_GETLK, &lockInfo)!=-1 ) {
30702 unixFile *pNew = (unixFile *)pId;
30705 assert( pNew->pInode==NULL );
30722 pNew->h = h;
30723 pNew->pVfs = pVfs;
30724 pNew->zPath = zFilename;
30725 pNew->ctrlFlags = (u8)ctrlFlags;
30727 pNew->mmapSizeMax = sqlite3GlobalConfig.szMmap;
30731 pNew->ctrlFlags |= UNIXFILE_PSOW;
30734 pNew->ctrlFlags |= UNIXFILE_EXCL;
30738 pNew->pId = vxworksFindFileId(zFilename);
30739 if( pNew->pId==0 ){
30748 pLockingStyle = (**(finder_type*)pVfs->pAppData)(zFilename, pNew);
30753 pNew->lockingContext = (void*)zFilename;
30763 rc = findInodeInfo(pNew, &pNew->pInode);
30783 robust_close(pNew, h, __LINE__);
30795 pNew->lockingContext = pCtx = sqlite3_malloc64( sizeof(*pCtx) );
30806 rc = findInodeInfo(pNew, &pNew->pInode);
30808 sqlite3_free(pNew->lockingContext);
30809 robust_close(pNew, h, __LINE__);
30831 pNew->lockingContext = zLockFile;
30840 rc = findInodeInfo(pNew, &pNew->pInode);
30841 if( (rc==SQLITE_OK) && (pNew->pInode->pSem==NULL) ){
30842 char *zSemName = pNew->pInode->aSemName;
30845 pNew->pId->zCanonicalName);
30848 pNew->pInode->pSem = sem_open(zSemName, O_CREAT, 0666, 1);
30849 if( pNew->pInode->pSem == SEM_FAILED ){
30851 pNew->pInode->aSemName[0] = '\0';
30858 storeLastErrno(pNew, 0);
30861 if( h>=0 ) robust_close(pNew, h, __LINE__);
30864 pNew->ctrlFlags |= UNIXFILE_DELETE;
30868 if( h>=0 ) robust_close(pNew, h, __LINE__);
30870 pNew->pMethod = pLockingStyle;
30872 verifyDbFile(pNew);
31977 unixFile *pNew;
32027 pNew = (unixFile *)sqlite3_malloc64(sizeof(*pNew));
32028 if( pNew==NULL ){
32032 memset(pNew, 0, sizeof(unixFile));
32033 pNew->openFlags = openFlags;
32039 pNew->pUnused = pUnused;
32041 rc = fillInUnixFile(&dummyVfs, fd, (sqlite3_file*)pNew, path, 0);
32043 *ppFile = pNew;
32047 robust_close(pNew, fd, __LINE__);
32048 sqlite3_free(pNew);
36794 struct winShmNode *pNew; /* Newly allocated winShmNode */
36805 pNew = sqlite3MallocZero( sizeof(*pShmNode) + nName + 17 );
36806 if( pNew==0 ){
36810 pNew->zFilename = (char*)&pNew[1];
36811 sqlite3_snprintf(nName+15, pNew->zFilename, "%s-shm", pDbFd->zPath);
36812 sqlite3FileSuffix3(pDbFd->zPath, pNew->zFilename);
36822 if( sqlite3StrICmp(pShmNode->zFilename, pNew->zFilename)==0 ) break;
36825 sqlite3_free(pNew);
36827 pShmNode = pNew;
36828 pNew = 0;
36892 sqlite3_free(pNew);
37296 void *pNew = 0;
37328 pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, (SIZE_T)nMap);
37330 pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
37332 if( pNew==NULL ){
37343 pFd->pMapRegion = pNew;
39446 sqlite3_pcache *pNew;
39447 pNew = sqlite3GlobalConfig.pcache2.xCreate(
39451 if( pNew==0 ) return SQLITE_NOMEM;
39452 sqlite3GlobalConfig.pcache2.xCachesize(pNew, numberOfCachePages(pCache));
39456 pCache->pCache = pNew;
41163 struct RowSetChunk *pNew;
41164 pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew));
41165 if( pNew==0 ){
41168 pNew->pNextChunk = p->pChunk;
41169 p->pChunk = pNew;
41170 p->pFresh = pNew->aEntry;
45253 char *pNew = NULL; /* New temp space */
45260 pNew = (char *)sqlite3PageMalloc(pageSize);
45261 if( !pNew ) rc = SQLITE_NOMEM;
45270 pPager->pTmpSpace = pNew;
45274 sqlite3PageFree(pNew);
59490 MemPage *pNew; /* Newly allocated page */
59505 rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0);
59514 assert( sqlite3PagerIswriteable(pNew->pDbPage) );
59516 zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF);
59517 rebuildPage(pNew, 1, &pCell, &szCell);
59518 pNew->nFree = pBt->usableSize - pNew->cellOffset - 2 - szCell;
59531 if( szCell>pNew->minLocal ){
59532 ptrmapPutOvflPtr(pNew, pCell, &rc);
59563 releasePage(pNew);
60043 MemPage *pNew;
60045 pNew = apNew[i] = apOld[i];
60047 rc = sqlite3PagerWrite(pNew->pDbPage);
60052 rc = allocateBtreePage(pBt, &pNew, &pgno, (bBulk ? 1 : pgno), 0);
60054 zeroPage(pNew, pageFlags);
60055 apNew[i] = pNew;
60061 ptrmapPut(pBt, pNew->pgno, PTRMAP_BTREE, pParent->pgno, &rc);
60155 MemPage *pNew = apNew[0];
60156 u8 *aOld = pNew->aData;
60157 int cntOldNext = pNew->nCell + pNew->nOverflow;
60170 pNew = apNew[++iNew];
60181 || pNew->pgno!=aPgno[iOld]
60186 ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
60188 if( szCell[i]>pNew->minLocal ){
60189 ptrmapPutOvflPtr(pNew, pCell, &rc);
60200 MemPage *pNew = apNew[i];
60207 if( !pNew->leaf ){
60208 memcpy(&pNew->aData[8], pCell, 4);
60217 btreeParseCellPtr(pNew, apCell[j], &info);
60242 insertCell(pParent, nxDiv+i, pCell, sz, pTemp, pNew->pgno, &rc);
64877 VdbeOp *pNew;
64896 pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
64897 if( pNew ){
64898 p->nOpAlloc = sqlite3DbMallocSize(p->db, pNew)/sizeof(Op);
64899 v->aOp = pNew;
64901 return (pNew ? SQLITE_OK : SQLITE_NOMEM);
65401 ScanStatus *pNew = &aNew[p->nScan++];
65402 pNew->addrExplain = addrExplain;
65403 pNew->addrLoop = addrLoop;
65404 pNew->addrVisit = addrVisit;
65405 pNew->nEst = nEst;
65406 pNew->zName = sqlite3DbStrDup(p->db, zName);
73604 Savepoint *pNew;
73645 pNew = sqlite3DbMallocRaw(db, sizeof(Savepoint)+nName+1);
73646 if( pNew ){
73647 pNew->zName = (char *)&pNew[1];
73648 memcpy(pNew->zName, zName, nName+1);
73660 pNew->pNext = db->pSavepoint;
73661 db->pSavepoint = pNew;
73662 pNew->nDeferredCons = db->nDeferredCons;
73663 pNew->nDeferredImmCons = db->nDeferredImmCons;
79065 MergeEngine *pNew; /* Pointer to allocated object to return */
79072 pNew = sqlite3FaultSim(100) ? 0 : (MergeEngine*)sqlite3MallocZero(nByte);
79073 if( pNew ){
79074 pNew->nTree = N;
79075 pNew->pTask = 0;
79076 pNew->aReadr = (PmaReader*)&pNew[1];
79077 pNew->aTree = (int*)&pNew->aReadr[N];
79079 return pNew;
79655 SorterRecord *pNew; /* New list element */
79732 pNew = (SorterRecord*)&pSorter->list.aMemory[pSorter->iMemory];
79734 pNew->u.iNext = (int)((u8*)(pSorter->list.pList) - pSorter->list.aMemory);
79736 pNew = (SorterRecord *)sqlite3Malloc(nReq);
79737 if( pNew==0 ){
79740 pNew->u.pNext = pSorter->list.pList;
79743 memcpy(SRVAL(pNew), pVal->z, pVal->n);
79744 pNew->nVal = pVal->n;
79745 pSorter->list.pList = pNew;
80184 MergeEngine *pNew; /* Merge engine to return */
80189 *ppOut = pNew = vdbeMergeEngineNew(nPMA);
80190 if( pNew==0 ) rc = SQLITE_NOMEM;
80194 PmaReader *pReadr = &pNew->aReadr[i];
80200 vdbeMergeEngineFree(pNew);
80259 MergeEngine *pNew = vdbeMergeEngineNew(SORTER_MAX_MERGE_COUNT);
80260 if( pNew==0 ){
80263 rc = vdbeIncrMergerNew(pTask, pNew, &pReadr->pIncr);
81017 FileChunk *pNew = sqlite3_malloc(sizeof(FileChunk));
81018 if( !pNew ){
81021 pNew->pNext = 0;
81024 pChunk->pNext = pNew;
81027 p->pFirst = pNew;
81029 p->endpoint.pChunk = pNew;
82284 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
82285 if( pNew==0 ) return 1;
82286 pNew->flags |= EP_IntValue;
82287 pNew->u.iValue = iCol;
82289 pItem->pExpr = pNew;
82295 pParent->pLeft = pNew;
82879 Expr *pNew = sqlite3ExprAlloc(pParse->db, TK_COLLATE, pCollName, dequote);
82880 if( pNew ){
82881 pNew->pLeft = pExpr;
82882 pNew->flags |= EP_Collate|EP_Skip;
82883 pExpr = pNew;
83256 Expr *pNew;
83267 pNew = sqlite3DbMallocZero(db, sizeof(Expr)+nExtra);
83268 if( pNew ){
83269 pNew->op = (u8)op;
83270 pNew->iAgg = -1;
83273 pNew->flags |= EP_IntValue;
83274 pNew->u.iValue = iValue;
83277 pNew->u.zToken = (char*)&pNew[1];
83279 if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
83280 pNew->u.zToken[pToken->n] = 0;
83283 sqlite3Dequote(pNew->u.zToken);
83284 if( c=='"' ) pNew->flags |= EP_DblQuoted;
83289 pNew->nHeight = 1;
83292 return pNew;
83412 Expr *pNew = sqlite3ExprAlloc(db, TK_AND, 0, 0);
83413 sqlite3ExprAttachSubtrees(db, pNew, pLeft, pRight);
83414 return pNew;
83423 Expr *pNew;
83426 pNew = sqlite3ExprAlloc(db, TK_FUNCTION, pToken, 1);
83427 if( pNew==0 ){
83431 pNew->x.pList = pList;
83432 assert( !ExprHasProperty(pNew, EP_xIsSelect) );
83433 sqlite3ExprSetHeightAndFlags(pParse, pNew);
83434 return pNew;
83658 Expr *pNew = 0; /* Value to return */
83673 pNew = (Expr *)zAlloc;
83675 if( pNew ){
83699 pNew->flags &= ~(EP_Reduced|EP_TokenOnly|EP_Static|EP_MemToken);
83700 pNew->flags |= nStructSize & (EP_Reduced|EP_TokenOnly);
83701 pNew->flags |= staticFlag;
83705 char *zToken = pNew->u.zToken = (char*)&zAlloc[nNewSize];
83709 if( 0==((p->flags|pNew->flags) & EP_TokenOnly) ){
83712 pNew->x.pSelect = sqlite3SelectDup(db, p->x.pSelect, isReduced);
83714 pNew->x.pList = sqlite3ExprListDup(db, p->x.pList, isReduced);
83719 if( ExprHasProperty(pNew, EP_Reduced|EP_TokenOnly) ){
83721 if( ExprHasProperty(pNew, EP_Reduced) ){
83722 pNew->pLeft = exprDup(db, p->pLeft, EXPRDUP_REDUCE, &zAlloc);
83723 pNew->pRight = exprDup(db, p->pRight, EXPRDUP_REDUCE, &zAlloc);
83730 pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
83731 pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
83737 return pNew;
83788 ExprList *pNew;
83792 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) );
83793 if( pNew==0 ) return 0;
83794 pNew->nExpr = i = p->nExpr;
83796 pNew->a = pItem = sqlite3DbMallocRaw(db, i*sizeof(p->a[0]) );
83798 sqlite3DbFree(db, pNew);
83812 return pNew;
83824 SrcList *pNew;
83829 pNew = sqlite3DbMallocRaw(db, nByte );
83830 if( pNew==0 ) return 0;
83831 pNew->nSrc = pNew->nAlloc = p->nSrc;
83833 struct SrcList_item *pNewItem = &pNew->a[i];
83859 return pNew;
83862 IdList *pNew;
83865 pNew = sqlite3DbMallocRaw(db, sizeof(*pNew) );
83866 if( pNew==0 ) return 0;
83867 pNew->nId = p->nId;
83868 pNew->a = sqlite3DbMallocRaw(db, p->nId*sizeof(p->a[0]) );
83869 if( pNew->a==0 ){
83870 sqlite3DbFree(db, pNew);
83877 struct IdList_item *pNewItem = &pNew->a[i];
83882 return pNew;
83885 Select *pNew, *pPrior;
83887 pNew = sqlite3DbMallocRaw(db, sizeof(*p) );
83888 if( pNew==0 ) return 0;
83889 pNew->pEList = sqlite3ExprListDup(db, p->pEList, flags);
83890 pNew->pSrc = sqlite3SrcListDup(db, p->pSrc, flags);
83891 pNew->pWhere = sqlite3ExprDup(db, p->pWhere, flags);
83892 pNew->pGroupBy = sqlite3ExprListDup(db, p->pGroupBy, flags);
83893 pNew->pHaving = sqlite3ExprDup(db, p->pHaving, flags);
83894 pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, flags);
83895 pNew->op = p->op;
83896 pNew->pPrior = pPrior = sqlite3SelectDup(db, p->pPrior, flags);
83897 if( pPrior ) pPrior->pNext = pNew;
83898 pNew->pNext = 0;
83899 pNew->pLimit = sqlite3ExprDup(db, p->pLimit, flags);
83900 pNew->pOffset = sqlite3ExprDup(db, p->pOffset, flags);
83901 pNew->iLimit = 0;
83902 pNew->iOffset = 0;
83903 pNew->selFlags = p->selFlags & ~SF_UsesEphemeral;
83904 pNew->addrOpenEphm[0] = -1;
83905 pNew->addrOpenEphm[1] = -1;
83906 pNew->nSelectRow = p->nSelectRow;
83907 pNew->pWith = withDup(db, p->pWith);
83908 sqlite3SelectSetName(pNew, p->zSelName);
83909 return pNew;
87854 Table *pNew; /* Copy of pParse->pNewTable */
87866 pNew = pParse->pNewTable;
87867 assert( pNew );
87870 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
87872 zTab = &pNew->zName[16]; /* Skip the "sqlite_altertab_" prefix on the name */
87873 pCol = &pNew->aCol[pNew->nCol-1];
87901 if( pNew->pIndex ){
87905 if( (db->flags&SQLITE_ForeignKeys) && pNew->pFKey && pDflt ){
87948 zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1,
87981 Table *pNew;
88022 pNew = (Table*)sqlite3DbMallocZero(db, sizeof(Table));
88023 if( !pNew ) goto exit_begin_add_column;
88024 pParse->pNewTable = pNew;
88025 pNew->nRef = 1;
88026 pNew->nCol = pTab->nCol;
88027 assert( pNew->nCol>0 );
88028 nAlloc = (((pNew->nCol-1)/8)*8)+8;
88029 assert( nAlloc>=pNew->nCol && nAlloc%8==0 && nAlloc-pNew->nCol<8 );
88030 pNew->aCol = (Column*)sqlite3DbMallocZero(db, sizeof(Column)*nAlloc);
88031 pNew->zName = sqlite3MPrintf(db, "sqlite_altertab_%s", pTab->zName);
88032 if( !pNew->aCol || !pNew->zName ){
88036 memcpy(pNew->aCol, pTab->aCol, sizeof(Column)*pNew->nCol);
88037 for(i=0; i<pNew->nCol; i++){
88038 Column *pCol = &pNew->aCol[i];
88045 pNew->pSchema = db->aDb[iDb].pSchema;
88046 pNew->addColOffset = pTab->addColOffset;
88047 pNew->nRef = 1;
88564 Stat4Sample *pNew,
88569 assert( pNew->iCol==pOld->iCol );
88570 for(i=pNew->iCol+1; i<nCol; i++){
88571 if( pNew->anEq[i]>pOld->anEq[i] ) return 1;
88572 if( pNew->anEq[i]<pOld->anEq[i] ) return 0;
88574 if( pNew->iHash>pOld->iHash ) return 1;
88588 Stat4Sample *pNew,
88591 tRowcnt nEqNew = pNew->anEq[pNew->iCol];
88594 assert( pOld->isPSample==0 && pNew->isPSample==0 );
88595 assert( IsStat4 || (pNew->iCol==0 && pOld->iCol==0) );
88600 if( pNew->iCol<pOld->iCol ) return 1;
88601 return (pNew->iCol==pOld->iCol && sampleIsBetterPost(pAccum, pNew, pOld));
88605 return (nEqNew==nEqOld && pNew->iHash>pOld->iHash);
88613 static void sampleInsert(Stat4Accum *p, Stat4Sample *pNew, int nEqZero){
88620 if( pNew->isPSample==0 ){
88622 assert( pNew->anEq[pNew->iCol]>0 );
88631 if( pOld->anEq[pNew->iCol]==0 ){
88633 assert( pOld->iCol>pNew->iCol );
88634 assert( sampleIsBetter(p, pNew, pOld) );
88641 pUpgrade->iCol = pNew->iCol;
88642 pUpgrade->anEq[pUpgrade->iCol] = pNew->anEq[pUpgrade->iCol];
88669 || pNew->anLt[p->nCol-1] > p->a[p->nSample-1].anLt[p->nCol-1] );
88674 sampleCopy(p, pSample, pNew);
94253 void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry);
94254 if( pNew==0 ){
94258 pArray = pNew;
94355 SrcList *pNew;
94358 pNew = sqlite3DbRealloc(db, pSrc,
94360 if( pNew==0 ){
94364 pSrc = pNew;
94365 nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
95048 With *pNew;
95065 pNew = sqlite3DbRealloc(db, pWith, nByte);
95067 pNew = sqlite3DbMallocZero(db, sizeof(*pWith));
95069 assert( zName!=0 || pNew==0 );
95070 assert( db->mallocFailed==0 || pNew==0 );
95072 if( pNew==0 ){
95076 pNew = pWith;
95078 pNew->a[pNew->nCte].pSelect = pQuery;
95079 pNew->a[pNew->nCte].pCols = pArglist;
95080 pNew->a[pNew->nCte].zName = zName;
95081 pNew->a[pNew->nCte].zErr = 0;
95082 pNew->nCte++;
95085 return pNew;
99454 Expr *pNew;
99456 pNew = sqlite3PExpr(pParse, TK_DOT,
99463 pNew = sqlite3ExprDup(db, pDflt, 0);
99465 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
99468 pNew = sqlite3PExpr(pParse, TK_NULL, 0, 0, 0);
99470 pList = sqlite3ExprListAppend(pParse, pList, pNew);
106317 sqlite3_stmt *pNew;
106326 rc = sqlite3LockAndPrepare(db, zSql, -1, 0, p, &pNew, 0);
106331 assert( pNew==0 );
106334 assert( pNew!=0 );
106336 sqlite3VdbeSwap((Vdbe*)pNew, p);
106337 sqlite3TransferBindings(pNew, (sqlite3_stmt*)p);
106338 sqlite3VdbeResetStepResult((Vdbe*)pNew);
106339 sqlite3VdbeFinalize((Vdbe*)pNew);
106577 Select *pNew;
106580 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
106581 if( pNew==0 ){
106583 pNew = &standin;
106584 memset(pNew, 0, sizeof(*pNew));
106589 pNew->pEList = pEList;
106591 pNew->pSrc = pSrc;
106592 pNew->pWhere = pWhere;
106593 pNew->pGroupBy = pGroupBy;
106594 pNew->pHaving = pHaving;
106595 pNew->pOrderBy = pOrderBy;
106596 pNew->selFlags = selFlags;
106597 pNew->op = TK_SELECT;
106598 pNew->pLimit = pLimit;
106599 pNew->pOffset = pOffset;
106601 pNew->addrOpenEphm[0] = -1;
106602 pNew->addrOpenEphm[1] = -1;
106604 clearSelect(db, pNew, pNew!=&standin);
106605 pNew = 0;
106607 assert( pNew->pSrc!=0 || pParse->nErr>0 );
106609 assert( pNew!=&standin );
106610 return pNew;
109309 Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
109310 if( pNew==0 ) return SQLITE_NOMEM;
109311 pNew->flags |= EP_IntValue;
109312 pNew->u.iValue = i;
109313 pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew);
109576 Expr *pNew;
109579 pNew = sqlite3ExprDup(db, pEList->a[pExpr->iColumn].pExpr, 0);
109581 pExpr = pNew;
109966 Select *pNew;
109976 pNew = sqlite3SelectDup(db, p, 0);
109977 sqlite3SelectSetName(pNew, pSub->zSelName);
109983 if( pNew==0 ){
109986 pNew->pPrior = pPrior;
109987 if( pPrior ) pPrior->pNext = pNew;
109988 pNew->pNext = p;
109989 p->pPrior = pNew;
109992 pNew->zSelName, pNew));
110318 Select *pNew;
110340 pNew = sqlite3DbMallocZero(db, sizeof(*pNew) );
110341 if( pNew==0 ) return WRC_Abort;
110343 pNewSrc = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&dummy,pNew,0,0);
110345 *pNew = *p;
110350 pNew->pGroupBy = 0;
110351 pNew->pHaving = 0;
110352 pNew->pOrderBy = 0;
110359 assert( pNew->pPrior!=0 );
110360 pNew->pPrior->pNext = pNew;
110361 pNew->pLimit = 0;
110362 pNew->pOffset = 0;
110708 ExprList *pNew = 0;
110727 pNew = sqlite3ExprListAppend(pParse, pNew, a[k].pExpr);
110728 if( pNew ){
110729 pNew->a[pNew->nExpr-1].zName = a[k].zName;
110730 pNew->a[pNew->nExpr-1].zSpan = a[k].zSpan;
110818 pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
110821 sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
110822 if( pNew && (p->selFlags & SF_NestedFrom)!=0 ){
110823 struct ExprList_item *pX = &pNew->a[pNew->nExpr-1];
110847 p->pEList = pNew;
115568 FuncDef *pNew;
115603 pNew = sqlite3DbMallocZero(db, sizeof(*pNew)
115605 if( pNew==0 ){
115608 *pNew = *pDef;
115609 pNew->zName = (char *)&pNew[1];
115610 memcpy(pNew->zName, pDef->zName, sqlite3Strlen30(pDef->zName)+1);
115611 pNew->xFunc = xFunc;
115612 pNew->pUserData = pArg;
115613 pNew->funcFlags |= SQLITE_FUNC_EPHEM;
115614 return pNew;
116103 WhereLoop *pNew; /* Template WhereLoop */
116991 Expr *pNew; /* New virtual expression */
117013 pNew = sqlite3ExprDup(db, pOne->pExpr, 0);
117014 if( pNew==0 ) return;
117016 pNew->op = op;
117017 idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC);
117320 Expr *pNew; /* The complete IN operator */
117333 pNew = sqlite3PExpr(pParse, TK_IN, pDup, 0, 0);
117334 if( pNew ){
117336 transferJoinMarkings(pNew, pExpr);
117337 assert( !ExprHasProperty(pNew, EP_xIsSelect) );
117338 pNew->x.pList = pList;
117339 idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC);
117432 WhereTerm *pNew;
117444 pNew = &pWC->a[idxNew];
117457 pNew = pTerm;
117461 pNew->leftCursor = pLeft->iTable;
117462 pNew->u.leftColumn = pLeft->iColumn;
117464 pNew->prereqRight = prereqLeft | extraRight;
117465 pNew->prereqAll = prereqAll;
117466 pNew->eOperator = (operatorMask(pDup->op) + eExtraOp) & opMask;
118752 Index *p = pBuilder->pNew->u.btree.pIndex;
118753 int nEq = pBuilder->pNew->u.btree.nEq;
118817 Index *p = pBuilder->pNew->u.btree.pIndex;
120873 WhereLoop *pNew; /* Template WhereLoop under construction */
120889 pNew = pBuilder->pNew;
120892 assert( (pNew->wsFlags & WHERE_VIRTUALTABLE)==0 );
120893 assert( (pNew->wsFlags & WHERE_TOP_LIMIT)==0 );
120894 if( pNew->wsFlags & WHERE_BTM_LIMIT ){
120903 assert( pNew->u.btree.nEq<pProbe->nColumn );
120904 iCol = pProbe->aiColumn[pNew->u.btree.nEq];
120908 saved_nEq = pNew->u.btree.nEq;
120909 saved_nSkip = pNew->nSkip;
120910 saved_nLTerm = pNew->nLTerm;
120911 saved_wsFlags = pNew->wsFlags;
120912 saved_prereq = pNew->prereq;
120913 saved_nOut = pNew->nOut;
120914 pNew->rSetup = 0;
120930 if( pTerm->prereqRight & pNew->maskSelf ) continue;
120936 pNew->wsFlags = saved_wsFlags;
120937 pNew->u.btree.nEq = saved_nEq;
120938 pNew->nLTerm = saved_nLTerm;
120939 if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
120940 pNew->aLTerm[pNew->nLTerm++] = pTerm;
120941 pNew->prereq = (saved_prereq | pTerm->prereqRight) & ~pNew->maskSelf;
120944 || (pNew->wsFlags & WHERE_COLUMN_NULL)!=0
120945 || (pNew->wsFlags & WHERE_COLUMN_IN)!=0
120946 || (pNew->wsFlags & WHERE_SKIPSCAN)!=0
120951 pNew->wsFlags |= WHERE_COLUMN_IN;
120963 pNew->wsFlags |= WHERE_COLUMN_EQ;
120964 if( iCol<0 || (nInMul==0 && pNew->u.btree.nEq==pProbe->nKeyCol-1) ){
120966 pNew->wsFlags |= WHERE_UNQ_WANTED;
120968 pNew->wsFlags |= WHERE_ONEROW;
120972 pNew->wsFlags |= WHERE_COLUMN_NULL;
120976 pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_BTM_LIMIT;
120986 if( whereLoopResize(db, pNew, pNew->nLTerm+1) ) break; /* OOM */
120987 pNew->aLTerm[pNew->nLTerm++] = pTop;
120988 pNew->wsFlags |= WHERE_TOP_LIMIT;
120994 pNew->wsFlags |= WHERE_COLUMN_RANGE|WHERE_TOP_LIMIT;
120996 pBtm = (pNew->wsFlags & WHERE_BTM_LIMIT)!=0 ?
120997 pNew->aLTerm[pNew->nLTerm-2] : 0;
121005 assert( pNew->nOut==saved_nOut );
121006 if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
121009 whereRangeScanEst(pParse, pBuilder, pBtm, pTop, pNew);
121011 int nEq = ++pNew->u.btree.nEq;
121014 assert( pNew->nOut==saved_nOut );
121018 pNew->nOut += pTerm->truthProb;
121019 pNew->nOut -= nIn;
121025 && pNew->u.btree.nEq<=pProbe->nSampleCol
121039 pNew->nOut = sqlite3LogEst(nOut);
121040 if( pNew->nOut>saved_nOut ) pNew->nOut = saved_nOut;
121041 pNew->nOut -= nIn;
121047 pNew->nOut += (pProbe->aiRowLogEst[nEq] - pProbe->aiRowLogEst[nEq-1]);
121052 pNew->nOut += 10;
121062 rCostIdx = pNew->nOut + 1 + (15*pProbe->szIdxRow)/pSrc->pTab->szTabRow;
121063 pNew->rRun = sqlite3LogEstAdd(rLogSize, rCostIdx);
121064 if( (pNew->wsFlags & (WHERE_IDX_ONLY|WHERE_IPK))==0 ){
121065 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, pNew->nOut + 16);
121067 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
121069 nOutUnadjusted = pNew->nOut;
121070 pNew->rRun += nInMul + nIn;
121071 pNew->nOut += nInMul + nIn;
121072 whereLoopOutputAdjust(pBuilder->pWC, pNew, rSize);
121073 rc = whereLoopInsert(pBuilder, pNew);
121075 if( pNew->wsFlags & WHERE_COLUMN_RANGE ){
121076 pNew->nOut = saved_nOut;
121078 pNew->nOut = nOutUnadjusted;
121081 if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
121082 && pNew->u.btree.nEq<pProbe->nColumn
121086 pNew->nOut = saved_nOut;
121091 pNew->prereq = saved_prereq;
121092 pNew->u.btree.nEq = saved_nEq;
121093 pNew->nSkip = saved_nSkip;
121094 pNew->wsFlags = saved_wsFlags;
121095 pNew->nOut = saved_nOut;
121096 pNew->nLTerm = saved_nLTerm;
121113 && (rc = whereLoopResize(db, pNew, pNew->nLTerm+1))==SQLITE_OK
121116 pNew->u.btree.nEq++;
121117 pNew->nSkip++;
121118 pNew->aLTerm[pNew->nLTerm++] = 0;
121119 pNew->wsFlags |= WHERE_SKIPSCAN;
121121 pNew->nOut -= nIter;
121126 pNew->nOut = saved_nOut;
121127 pNew->u.btree.nEq = saved_nEq;
121128 pNew->nSkip = saved_nSkip;
121129 pNew->wsFlags = saved_wsFlags;
121248 WhereLoop *pNew; /* Template WhereLoop object */
121257 pNew = pBuilder->pNew;
121260 pSrc = pTabList->a + pNew->iTab;
121313 if( pTerm->prereqRight & pNew->maskSelf ) continue;
121315 pNew->u.btree.nEq = 1;
121316 pNew->nSkip = 0;
121317 pNew->u.btree.pIndex = 0;
121318 pNew->nLTerm = 1;
121319 pNew->aLTerm[0] = pTerm;
121328 pNew->rSetup = rLogSize + rSize + 4;
121330 pNew->rSetup += 24;
121332 ApplyCostMultiplier(pNew->rSetup, pTab->costMult);
121337 pNew->nOut = 43; assert( 43==sqlite3LogEst(20) );
121338 pNew->rRun = sqlite3LogEstAdd(rLogSize,pNew->nOut);
121339 pNew->wsFlags = WHERE_AUTO_INDEX;
121340 pNew->prereq = mExtra | pTerm->prereqRight;
121341 rc = whereLoopInsert(pBuilder, pNew);
121352 testcase( pNew->iTab!=pSrc->iCursor ); /* See ticket [98d973b8f5] */
121356 pNew->u.btree.nEq = 0;
121357 pNew->nSkip = 0;
121358 pNew->nLTerm = 0;
121359 pNew->iSortIdx = 0;
121360 pNew->rSetup = 0;
121361 pNew->prereq = mExtra;
121362 pNew->nOut = rSize;
121363 pNew->u.btree.pIndex = pProbe;
121369 pNew->wsFlags = WHERE_IPK;
121372 pNew->iSortIdx = b ? iSortIdx : 0;
121374 pNew->rRun = rSize + 16;
121375 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
121376 whereLoopOutputAdjust(pWC, pNew, rSize);
121377 rc = whereLoopInsert(pBuilder, pNew);
121378 pNew->nOut = rSize;
121383 pNew->wsFlags = WHERE_IDX_ONLY | WHERE_INDEXED;
121387 pNew->wsFlags = (m==0) ? (WHERE_IDX_ONLY|WHERE_INDEXED) : WHERE_INDEXED;
121401 pNew->iSortIdx = b ? iSortIdx : 0;
121407 pNew->rRun = rSize + 1 + (15*pProbe->szIdxRow)/pTab->szTabRow;
121409 pNew->rRun = sqlite3LogEstAdd(pNew->rRun, rSize+16);
121411 ApplyCostMultiplier(pNew->rRun, pTab->costMult);
121412 whereLoopOutputAdjust(pWC, pNew, rSize);
121413 rc = whereLoopInsert(pBuilder, pNew);
121414 pNew->nOut = rSize;
121458 WhereLoop *pNew;
121465 pNew = pBuilder->pNew;
121466 pSrc = &pWInfo->pTabList->a[pNew->iTab];
121471 pNew->prereq = 0;
121472 pNew->rSetup = 0;
121473 pNew->wsFlags = WHERE_VIRTUALTABLE;
121474 pNew->nLTerm = 0;
121475 pNew->u.vtab.needFree = 0;
121478 if( whereLoopResize(db, pNew, nConstraint) ){
121530 pNew->prereq = mExtra;
121532 assert( pNew->nLSlot>=nConstraint );
121533 for(i=0; i<nConstraint; i++) pNew->aLTerm[i] = 0;
121534 pNew->u.vtab.omitMask = 0;
121541 || pNew->aLTerm[iTerm]!=0
121551 pNew->prereq |= pTerm->prereqRight;
121552 assert( iTerm<pNew->nLSlot );
121553 pNew->aLTerm[iTerm] = pTerm;
121557 if( iTerm<16 && pUsage[i].omit ) pNew->u.vtab.omitMask |= 1<<iTerm;
121576 pNew->nLTerm = mxTerm+1;
121577 assert( pNew->nLTerm<=pNew->nLSlot );
121578 pNew->u.vtab.idxNum = pIdxInfo->idxNum;
121579 pNew->u.vtab.needFree = pIdxInfo->needToFreeIdxStr;
121581 pNew->u.vtab.idxStr = pIdxInfo->idxStr;
121582 pNew->u.vtab.isOrdered = (i8)(pIdxInfo->orderByConsumed ?
121584 pNew->rSetup = 0;
121585 pNew->rRun = sqlite3LogEstFromDouble(pIdxInfo->estimatedCost);
121586 pNew->nOut = sqlite3LogEst(pIdxInfo->estimatedRows);
121587 whereLoopInsert(pBuilder, pNew);
121588 if( pNew->u.vtab.needFree ){
121589 sqlite3_free(pNew->u.vtab.idxStr);
121590 pNew->u.vtab.needFree = 0;
121609 WhereLoop *pNew;
121620 pNew = pBuilder->pNew;
121622 pItem = pWInfo->pTabList->a + pNew->iTab;
121627 && (pTerm->u.pOrInfo->indexable & pNew->maskSelf)!=0
121694 pNew->nLTerm = 1;
121695 pNew->aLTerm[0] = pTerm;
121696 pNew->wsFlags = WHERE_MULTI_OR;
121697 pNew->rSetup = 0;
121698 pNew->iSortIdx = 0;
121699 memset(&pNew->u, 0, sizeof(pNew->u));
121713 pNew->rRun = sSum.a[i].rRun + 1;
121714 pNew->nOut = sSum.a[i].nOut;
121715 pNew->prereq = sSum.a[i].prereq;
121716 rc = whereLoopInsert(pBuilder, pNew);
121738 WhereLoop *pNew;
121741 pNew = pBuilder->pNew;
121742 whereLoopInit(pNew);
121744 pNew->iTab = iTab;
121745 pNew->maskSelf = getMask(&pWInfo->sMaskSet, pItem->iCursor);
121758 mPrior |= pNew->maskSelf;
121761 whereLoopClear(db, pNew);
122478 pLoop = pBuilder->pNew;
122700 sWLB.pNew = (WhereLoop*)(((char*)pWInfo)+nByteWInfo);
122701 assert( EIGHT_BYTE_ALIGNMENT(sWLB.pNew) );
122702 whereLoopInit(sWLB.pNew);
122704 sWLB.pNew->cId = '*';
124565 yyStackEntry *pNew;
124568 pNew = realloc(p->yystack, newSize*sizeof(pNew[0]));
124569 if( pNew ){
124570 p->yystack = pNew;
125797 struct SrcList_item *pNew = &yygotominor.yy65->a[yygotominor.yy65->nSrc-1];
125799 pNew->zName = pOld->zName;
125800 pNew->zDatabase = pOld->zDatabase;
125801 pNew->pSelect = pOld->pSelect;
132033 void **pNew = (void **)sqlite3Malloc(nArg*sizeof(void *)*2);
132034 if( pNew ){
132035 memcpy(pNew, aArg, nArg*sizeof(void *));
132037 aDyn = aArg = pNew;
132676 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey);
135771 Fts3SegReader *pNew
135778 sqlite3Fts3SegReaderFree(pNew);
135783 pCsr->apSegment[pCsr->nSegment++] = pNew;
140023 Fts3Expr *pNew /* New binary node to insert into expression tree */
140026 while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){
140032 pSplit->pParent->pRight = pNew;
140033 pNew->pParent = pSplit->pParent;
140035 *ppHead = pNew;
140037 pNew->pLeft = pSplit;
140038 pSplit->pParent = pNew;
140783 SQLITE_PRIVATE void sqlite3Fts3HashInit(Fts3Hash *pNew, char keyClass, char copyKey){
140784 assert( pNew!=0 );
140786 pNew->keyClass = keyClass;
140787 pNew->copyKey = copyKey;
140788 pNew->first = 0;
140789 pNew->count = 0;
140790 pNew->htsize = 0;
140791 pNew->ht = 0;
140893 Fts3HashElem *pNew /* The element to be inserted */
140898 pNew->next = pHead;
140899 pNew->prev = pHead->prev;
140900 if( pHead->prev ){ pHead->prev->next = pNew; }
140901 else { pH->first = pNew; }
140902 pHead->prev = pNew;
140904 pNew->next = pH->first;
140905 if( pH->first ){ pH->first->prev = pNew; }
140906 pNew->prev = 0;
140907 pH->first = pNew;
140910 pEntry->chain = pNew;
141730 char *pNew;
141732 pNew = sqlite3_realloc(c->zToken, c->nAllocated);
141733 if( !pNew ) return SQLITE_NOMEM;
141734 c->zToken = pNew;
142453 char *pNew;
142455 pNew = sqlite3_realloc(c->pToken, c->nTokenAllocated);
142456 if( !pNew ) return SQLITE_NOMEM;
142457 c->pToken = pNew;
144949 SegmentNode *pNew;
145019 pNew = (SegmentNode *)sqlite3_malloc(sizeof(SegmentNode) + p->nNodeSize);
145020 if( !pNew ){
145023 memset(pNew, 0, sizeof(SegmentNode));
145024 pNew->nData = 1 + FTS3_VARINT_MAX;
145025 pNew->aData = (char *)&pNew[1];
145033 pTree->pRight = pNew;
145034 pNew->pLeftmost = pTree->pLeftmost;
145035 pNew->pParent = pParent;
145036 pNew->zMalloc = pTree->zMalloc;
145037 pNew->nMalloc = pTree->nMalloc;
145040 pNew->pLeftmost = pNew;
145041 rc = fts3NodeAddTerm(p, &pNew, isCopyTerm, zTerm, nTerm);
145044 *ppTree = pNew;
145574 char *pNew;
145576 pNew = (char *)sqlite3_realloc(pMsr->aBuffer, pMsr->nBuffer);
145577 if( !pNew ) return SQLITE_NOMEM;
145578 pMsr->aBuffer = pNew;
147460 Blob *pNew, /* OUT: Write new node image here */
147471 blobGrowBuffer(pNew, nNode, &rc);
147473 pNew->n = 0;
147480 if( pNew->n==0 ){
147483 fts3StartNode(pNew, (int)aNode[0], reader.iChild);
147487 pNew, &prev, reader.term.a, reader.term.n,
147492 if( pNew->n==0 ){
147493 fts3StartNode(pNew, (int)aNode[0], reader.iChild);
147496 assert( pNew->n<=pNew->nAlloc );
150431 unicode_tokenizer *pNew; /* New tokenizer object */
150435 pNew = (unicode_tokenizer *) sqlite3_malloc(sizeof(unicode_tokenizer));
150436 if( pNew==NULL ) return SQLITE_NOMEM;
150437 memset(pNew, 0, sizeof(unicode_tokenizer));
150438 pNew->bRemoveDiacritic = 1;
150445 pNew->bRemoveDiacritic = 1;
150448 pNew->bRemoveDiacritic = 0;
150451 rc = unicodeAddExceptions(pNew, 1, &z[11], n-11);
150454 rc = unicodeAddExceptions(pNew, 0, &z[11], n-11);
150463 unicodeDestroy((sqlite3_tokenizer *)pNew);
150464 pNew = 0;
150466 *pp = (sqlite3_tokenizer *)pNew;
152141 RtreeSearchPoint *pNew;
152144 pNew = sqlite3_realloc(pCur->aPoint, nNew*sizeof(pCur->aPoint[0]));
152145 if( pNew==0 ) return 0;
152146 pCur->aPoint = pNew;
152150 pNew = pCur->aPoint + i;
152151 pNew->rScore = rScore;
152152 pNew->iLevel = iLevel;
152158 if( rtreeSearchPointCompare(pNew, pParent)>=0 ) break;
152161 pNew = pParent;
152163 return pNew;
152175 RtreeSearchPoint *pNew, *pFirst;
152184 pNew = rtreeEnqueue(pCur, rScore, iLevel);
152185 if( pNew==0 ) return 0;
152186 ii = (int)(pNew - pCur->aPoint) + 1;
152194 *pNew = pCur->sPoint;
152572 RtreeSearchPoint *pNew;
152573 pNew = rtreeSearchPointNew(pCsr, RTREE_ZERO, pRtree->iDepth+1);
152574 if( pNew==0 ) return SQLITE_NOMEM;
152575 pNew->id = 1;
152576 pNew->iCell = 0;
152577 pNew->eWithin = PARTLY_WITHIN;