Lines Matching refs:pTable

17955   Table *pTable;           /* The SQL table being indexed */
65180 iTab = pIdx->pTable->tnum;
104184 sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
109738 VdbeComment((v,"%s.%s", pIdx->zName, pIdx->pTable->aCol[i].zName));
110001 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
110214 analyzeTable(pParse, pIdx->pTable, pIdx);
110295 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
110318 Table *pTable;
110327 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
110328 if( pTable==0 ){
110334 pIndex = sqlite3PrimaryKeyIndex(pTable);
110357 pTable->nRowLogEst = pIndex->aiRowLogEst[0];
110358 pTable->tabFlags |= TF_HasStat1;
110362 fakeIdx.szIdxRow = pTable->szTabRow;
110364 fakeIdx.pTable = pTable;
110366 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
110367 pTable->szTabRow = fakeIdx.szIdxRow;
110368 pTable->tabFlags |= TF_HasStat1;
110524 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
110525 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
110542 pIdx->pTable->tabFlags |= TF_HasStat4;
112133 if( pIndex->pTable->pIndex==pIndex ){
112134 pIndex->pTable->pIndex = pIndex->pNext;
112139 p = pIndex->pTable->pIndex;
112241 SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
112244 assert( pTable!=0 );
112245 if( (pCol = pTable->aCol)!=0 ){
112246 for(i=0; i<pTable->nCol; i++, pCol++){
112252 sqlite3DbFree(db, pTable->aCol);
112271 static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
112283 if( db && !db->mallocFailed && (pTable->tabFlags & TF_Ephemeral)==0 ){
112289 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
112291 assert( pIndex->pSchema==pTable->pSchema
112292 || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) );
112293 if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){
112305 sqlite3FkDelete(db, pTable);
112309 sqlite3DeleteColumnNames(db, pTable);
112310 sqlite3DbFree(db, pTable->zName);
112311 sqlite3DbFree(db, pTable->zColAff);
112312 sqlite3SelectDelete(db, pTable->pSelect);
112313 sqlite3ExprListDelete(db, pTable->pCheck);
112315 sqlite3VtabClear(db, pTable);
112317 sqlite3DbFree(db, pTable);
112322 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
112324 if( !pTable ) return;
112325 if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return;
112326 deleteTable(db, pTable);
112653 Table *pTable;
112720 pTable = sqlite3FindTable(db, zName, zDb);
112721 if( pTable ){
112736 pTable = sqlite3DbMallocZero(db, sizeof(Table));
112737 if( pTable==0 ){
112743 pTable->zName = zName;
112744 pTable->iPKey = -1;
112745 pTable->pSchema = db->aDb[iDb].pSchema;
112746 pTable->nTabRef = 1;
112748 pTable->nRowLogEst = sqlite3LogEst(SQLITE_DEFAULT_ROWEST);
112750 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
112753 pParse->pNewTable = pTable;
112762 pTable->pSchema->pSeqTab = pTable;
113619 const Column *aCol = pIdx->pTable->aCol;
113622 assert( x<pIdx->pTable->nCol );
113660 assert( pPk->pTable->tabFlags & TF_WithoutRowid );
113661 assert( pPk->pTable==pIdx->pTable );
113697 Table *pTab = pIdx->pTable;
114335 ** The Table structure pTable is really a VIEW. Fill in the names of
114336 ** the columns of the view in the pTable structure. Return the number
114339 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
114352 assert( pTable );
114356 rc = sqlite3VtabCallConnect(pParse, pTable);
114361 if( IsVirtual(pTable) ) return 0;
114368 if( pTable->nCol>0 ) return 0;
114385 if( pTable->nCol<0 ){
114386 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
114389 assert( pTable->nCol>=0 );
114398 assert( pTable->pSelect );
114399 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
114405 pTable->nCol = -1;
114417 pTable->nCol = 0;
114419 }else if( pTable->pCheck ){
114422 ** arglist which is stored in pTable->pCheck. The pCheck field
114426 sqlite3ColumnsFromExprList(pParse, pTable->pCheck,
114427 &pTable->nCol, &pTable->aCol);
114430 && pTable->nCol==pSel->pEList->nExpr
114432 sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel,
114439 assert( pTable->aCol==0 );
114440 pTable->nCol = pSelTab->nCol;
114441 pTable->aCol = pSelTab->aCol;
114442 pTable->tabFlags |= (pSelTab->tabFlags & COLFLAG_NOINSERT);
114445 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
114447 pTable->nNVCol = pTable->nCol;
114455 pTable->pSchema->schemaFlags |= DB_UnresetViews;
114457 sqlite3DeleteColumnNames(db, pTable);
114458 pTable->aCol = 0;
114459 pTable->nCol = 0;
115011 Table *pTab = pIndex->pTable; /* The table that is indexed */
115169 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
115195 DbFixer sFix; /* For assigning database names to pTable */
115413 pIndex->pTable = pTab;
115805 x = pIdx->pTable->nRowLogEst;
115808 pIdx->pTable->nRowLogEst = x = 99;
115861 Table *pTab = pIndex->pTable;
116078 ** need be. A new entry is created in the SrcList even if pTable is NULL.
116088 ** points to the table name and the pTable points to the database name.
116090 ** come from pTable (if pDatabase is NULL) or from pDatabase.
116091 ** SrcList.a[].zDatabase is filled with the database name from pTable,
116108 ** Both pTable and pDatabase are assumed to be quoted. They are dequoted
116114 Token *pTable, /* Table to append */
116119 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
116145 pItem->zDatabase = sqlite3NameFromToken(db, pTable);
116147 pItem->zName = sqlite3NameFromToken(db, pTable);
116196 ** if this is the first term of the FROM clause. pTable and pDatabase
116201 ** SELECT statement that the subquery encodes. The pTable and
116211 Token *pTable, /* Name of the table to add to the FROM clause */
116212 Token *pDatabase, /* Name of the database containing pTable */
116226 p = sqlite3SrcListAppend(pParse, p, pTable, pDatabase);
116232 assert( (pTable==0)==(pDatabase==0) );
116235 Token *pToken = (ALWAYS(pDatabase) && pDatabase->z) ? pDatabase : pTable;
116577 Table *pTab = pIdx->pTable;
121130 iParent += sqlite3TableColumnToStorage(pIdx->pTable,
121281 assert( pIdx==0 || pIdx->pTable==pTab );
122252 Table *pTab = pIdx->pTable;
124290 sqlite3SetMakeRecordP5(v, pIdx->pTable);
124788 assert( pDest->pTable!=pSrc->pTable );
128793 pTab = pIdx->pTable;
130200 for(p=pIndex->pTable->pIndex; p; p=p->pNext){
139162 Table *pTable;
139169 pTable = tableOfTrigger(pTrigger);
139170 assert( (pTable && pTable->pSchema==pTrigger->pSchema) || iDb==1 );
139172 if( pTable ){
139177 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
142323 ** Add a new module argument to pTable->azModuleArg[].
142328 static void addModuleArgument(Parse *pParse, Table *pTable, char *zArg){
142329 sqlite3_int64 nBytes = sizeof(char *)*(2+pTable->nModuleArg);
142332 if( pTable->nModuleArg+3>=db->aLimit[SQLITE_LIMIT_COLUMN] ){
142333 sqlite3ErrorMsg(pParse, "too many columns on %s", pTable->zName);
142335 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
142339 int i = pTable->nModuleArg++;
142342 pTable->azModuleArg = azModuleArg;
142358 Table *pTable; /* The new virtual table */
142362 pTable = pParse->pNewTable;
142363 if( pTable==0 ) return;
142364 assert( 0==pTable->pIndex );
142368 assert( pTable->nModuleArg==0 );
142369 addModuleArgument(pParse, pTable, sqlite3NameFromToken(db, pModuleName));
142370 addModuleArgument(pParse, pTable, 0);
142371 addModuleArgument(pParse, pTable, sqlite3DbStrDup(db, pTable->zName));
142385 if( pTable->azModuleArg ){
142386 int iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
142388 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
142389 pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName);
142397 ** virtual table currently under construction in pParse->pTable.
142825 pIdx->pTable = pTab;
143939 return pIdx->pTable->aCol[i].zName;
144971 Table *pTab = pIdx->pTable;
145120 pTab = pIdx->pTable;
145612 if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){
145850 }else if( HasRowid(pIdx->pTable) ){
145853 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
148718 }else if( iColumn==pIdx->pTable->iPKey ){
148721 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
148826 return pIdx->pTable->aCol[j].notNull;
149049 Table *pTable; /* The table being indexed */
149076 pTable = pSrc->pTab;
149099 "automatic index on %s(%s)", pTable->zName,
149100 pTable->aCol[iCol].zName);
149126 mxBitCol = MIN(BMS-1,pTable->nCol);
149127 testcase( pTable->nCol==BMS-1 );
149128 testcase( pTable->nCol==BMS-2 );
149133 nKeyCol += pTable->nCol - BMS + 1;
149141 pIdx->pTable = pTable;
149173 for(i=BMS-1; i<pTable->nCol; i++){
149188 VdbeComment((v, "for %s", pTable->zName));
150722 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
150783 pProbe->pTable->zName,pProbe->zName,
151057 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
151128 pProbe->pTable->zName, pProbe->zName, saved_nEq, rc));
151282 sPk.pTable = pTab;
152170 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
152172 || !HasRowid(pIndex->pTable));
152233 if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
152245 && pIndex->pTable->aCol[iColumn].notNull==0
153858 if( pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable) ){
153886 assert( pIdx->pTable==pTab );
205627 SessionTable *pTable; /* List of attached tables */
205681 ** stored in a linked list starting at sqlite3_session.pTable.
206905 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
206917 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
207357 sessionDeleteTable(pSession, pSession->pTable);
207402 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
207422 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
207994 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
208173 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){