Lines Matching refs:pTable
16040 Table *pTable; /* The SQL table being indexed */ member
60615 iTab = pIdx->pTable->tnum;
95974 sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
100051 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
100257 analyzeTable(pParse, pIdx->pTable, pIdx);
100336 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
100359 Table *pTable;
100368 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
100369 if( pTable==0 ){
100375 pIndex = sqlite3PrimaryKeyIndex(pTable);
100398 pTable->nRowLogEst = pIndex->aiRowLogEst[0];
100399 pTable->tabFlags |= TF_HasStat1;
100403 fakeIdx.szIdxRow = pTable->szTabRow;
100405 fakeIdx.pTable = pTable;
100407 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
100408 pTable->szTabRow = fakeIdx.szIdxRow;
100409 pTable->tabFlags |= TF_HasStat1;
100570 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
100571 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
102086 if( pIndex->pTable->pIndex==pIndex ){
102087 pIndex->pTable->pIndex = pIndex->pNext;
102092 p = pIndex->pTable->pIndex;
102188 SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
102191 assert( pTable!=0 );
102192 if( (pCol = pTable->aCol)!=0 ){
102193 for(i=0; i<pTable->nCol; i++, pCol++){
102198 sqlite3DbFree(db, pTable->aCol);
102217 static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
102225 if( db && (pTable->tabFlags & TF_Ephemeral)==0 ){
102231 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
102233 assert( pIndex->pSchema==pTable->pSchema
102234 || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) );
102235 if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){
102247 sqlite3FkDelete(db, pTable);
102251 sqlite3DeleteColumnNames(db, pTable);
102252 sqlite3DbFree(db, pTable->zName);
102253 sqlite3DbFree(db, pTable->zColAff);
102254 sqlite3SelectDelete(db, pTable->pSelect);
102255 sqlite3ExprListDelete(db, pTable->pCheck);
102257 sqlite3VtabClear(db, pTable);
102259 sqlite3DbFree(db, pTable);
102264 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
102266 if( !pTable ) return;
102267 if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return;
102268 deleteTable(db, pTable);
102472 Table *pTable;
102536 pTable = sqlite3FindTable(db, zName, zDb);
102537 if( pTable ){
102552 pTable = sqlite3DbMallocZero(db, sizeof(Table));
102553 if( pTable==0 ){
102559 pTable->zName = zName;
102560 pTable->iPKey = -1;
102561 pTable->pSchema = db->aDb[iDb].pSchema;
102562 pTable->nTabRef = 1;
102564 pTable->nRowLogEst = sqlite3LogEst(SQLITE_DEFAULT_ROWEST);
102566 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
102569 pParse->pNewTable = pTable;
102578 pTable->pSchema->pSeqTab = pTable;
103272 const Column *aCol = pIdx->pTable->aCol;
103275 assert( x<pIdx->pTable->nCol );
103773 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
103786 assert( pTable );
103790 rc = sqlite3VtabCallConnect(pParse, pTable);
103795 if( IsVirtual(pTable) ) return 0;
103802 if( pTable->nCol>0 ) return 0;
103819 if( pTable->nCol<0 ){
103820 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
103823 assert( pTable->nCol>=0 );
103832 assert( pTable->pSelect );
103833 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
103837 pTable->nCol = -1;
103848 if( pTable->pCheck ){
103855 sqlite3ColumnsFromExprList(pParse, pTable->pCheck,
103856 &pTable->nCol, &pTable->aCol);
103859 && pTable->nCol==pSel->pEList->nExpr
103861 sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel);
103867 assert( pTable->aCol==0 );
103868 pTable->nCol = pSelTab->nCol;
103869 pTable->aCol = pSelTab->aCol;
103872 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
103874 pTable->nCol = 0;
103883 pTable->pSchema->schemaFlags |= DB_UnresetViews;
104390 Table *pTab = pIndex->pTable; /* The table that is indexed */
104742 pIndex->pTable = pTab;
105087 a[0] = pIdx->pTable->nRowLogEst;
105139 Table *pTab = pIndex->pTable;
105369 Token *pTable, /* Table to append */
105373 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
105395 pItem->zDatabase = sqlite3NameFromToken(db, pTable);
105397 pItem->zName = sqlite3NameFromToken(db, pTable);
105461 Token *pTable, /* Name of the table to add to the FROM clause */
105476 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
105788 Table *pTab = pIdx->pTable;
107491 if( pIdx->pTable->pSelect ){
109969 assert( pIdx==0 || pIdx->pTable==pTab );
110920 Table *pTab = pIdx->pTable;
112367 if( pIdx->idxType==2 ) sqlite3SetMakeRecordP5(v, pIdx->pTable);
112726 assert( pDest->pTable!=pSrc->pTable );
116457 pTab = pIdx->pTable;
125499 Table *pTable;
125506 pTable = tableOfTrigger(pTrigger);
125507 assert( pTable );
125508 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
125515 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
125524 assert( pTable!=0 );
127664 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
127665 int nBytes = sizeof(char *)*(2+pTable->nModuleArg);
127667 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
127671 int i = pTable->nModuleArg++;
127674 pTable->azModuleArg = azModuleArg;
127691 Table *pTable; /* The new virtual table */
127695 pTable = pParse->pNewTable;
127696 if( pTable==0 ) return;
127697 assert( 0==pTable->pIndex );
127700 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
127703 assert( pTable->nModuleArg==0 );
127704 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
127705 addModuleArgument(db, pTable, 0);
127706 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
127720 if( pTable->azModuleArg ){
127721 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
127722 pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName);
128152 pIdx->pTable = pTab;
129200 return pIdx->pTable->aCol[i].zName;
130216 Table *pTab = pIdx->pTable;
130744 if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){
130884 }else if( HasRowid(pIdx->pTable) ){
130898 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
133236 }else if( iColumn==pIdx->pTable->iPKey ){
133239 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
133348 return pIdx->pTable->aCol[j].notNull;
133572 Table *pTable; /* The table being indexed */
133599 pTable = pSrc->pTab;
133622 "automatic index on %s(%s)", pTable->zName,
133623 pTable->aCol[iCol].zName);
133649 mxBitCol = MIN(BMS-1,pTable->nCol);
133650 testcase( pTable->nCol==BMS-1 );
133651 testcase( pTable->nCol==BMS-2 );
133656 nKeyCol += pTable->nCol - BMS + 1;
133664 pIdx->pTable = pTable;
133695 for(i=BMS-1; i<pTable->nCol; i++){
133710 VdbeComment((v, "for %s", pTable->zName));
135224 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
135502 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
135734 sPk.pTable = pTab;
136552 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
136554 || !HasRowid(pIndex->pTable));
136608 if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
136620 && pIndex->pTable->aCol[iColumn].notNull==0
138066 && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
138080 assert( pIdx->pTable==pTab );
178823 SessionTable *pTable; /* List of attached tables */
180036 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
180048 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
180486 sessionDeleteTable(pSession->pTable);
180529 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
180548 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
181119 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
181298 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){