Lines Matching refs:pTable
14885 Table *pTable; /* The SQL table being indexed */ member
59142 iTab = pIdx->pTable->tnum;
93924 sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
97892 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
98092 analyzeTable(pParse, pIdx->pTable, pIdx);
98171 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
98194 Table *pTable;
98203 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
98204 if( pTable==0 ){
98210 pIndex = sqlite3PrimaryKeyIndex(pTable);
98233 pTable->nRowLogEst = pIndex->aiRowLogEst[0];
98234 pTable->tabFlags |= TF_HasStat1;
98238 fakeIdx.szIdxRow = pTable->szTabRow;
98240 fakeIdx.pTable = pTable;
98242 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
98243 pTable->szTabRow = fakeIdx.szIdxRow;
98244 pTable->tabFlags |= TF_HasStat1;
98405 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
98406 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
99922 if( pIndex->pTable->pIndex==pIndex ){
99923 pIndex->pTable->pIndex = pIndex->pNext;
99928 p = pIndex->pTable->pIndex;
100025 SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
100028 assert( pTable!=0 );
100029 if( (pCol = pTable->aCol)!=0 ){
100030 for(i=0; i<pTable->nCol; i++, pCol++){
100035 sqlite3DbFree(db, pTable->aCol);
100054 static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
100061 TESTONLY( nLookaside = (db && (pTable->tabFlags & TF_Ephemeral)==0) ?
100065 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
100067 assert( pIndex->pSchema==pTable->pSchema
100068 || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) );
100069 if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){
100081 sqlite3FkDelete(db, pTable);
100085 sqlite3DeleteColumnNames(db, pTable);
100086 sqlite3DbFree(db, pTable->zName);
100087 sqlite3DbFree(db, pTable->zColAff);
100088 sqlite3SelectDelete(db, pTable->pSelect);
100089 sqlite3ExprListDelete(db, pTable->pCheck);
100091 sqlite3VtabClear(db, pTable);
100093 sqlite3DbFree(db, pTable);
100098 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
100100 if( !pTable ) return;
100101 if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return;
100102 deleteTable(db, pTable);
100305 Table *pTable;
100369 pTable = sqlite3FindTable(db, zName, zDb);
100370 if( pTable ){
100385 pTable = sqlite3DbMallocZero(db, sizeof(Table));
100386 if( pTable==0 ){
100392 pTable->zName = zName;
100393 pTable->iPKey = -1;
100394 pTable->pSchema = db->aDb[iDb].pSchema;
100395 pTable->nTabRef = 1;
100396 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
100398 pParse->pNewTable = pTable;
100407 pTable->pSchema->pSeqTab = pTable;
101099 const Column *aCol = pIdx->pTable->aCol;
101102 assert( x<pIdx->pTable->nCol );
101601 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
101611 assert( pTable );
101614 if( sqlite3VtabCallConnect(pParse, pTable) ){
101617 if( IsVirtual(pTable) ) return 0;
101624 if( pTable->nCol>0 ) return 0;
101641 if( pTable->nCol<0 ){
101642 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
101645 assert( pTable->nCol>=0 );
101654 assert( pTable->pSelect );
101655 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
101659 pTable->nCol = -1;
101670 if( pTable->pCheck ){
101677 sqlite3ColumnsFromExprList(pParse, pTable->pCheck,
101678 &pTable->nCol, &pTable->aCol);
101681 && pTable->nCol==pSel->pEList->nExpr
101683 sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel);
101689 assert( pTable->aCol==0 );
101690 pTable->nCol = pSelTab->nCol;
101691 pTable->aCol = pSelTab->aCol;
101694 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
101696 pTable->nCol = 0;
101705 pTable->pSchema->schemaFlags |= DB_UnresetViews;
102221 Table *pTab = pIndex->pTable; /* The table that is indexed */
102573 pIndex->pTable = pTab;
102918 a[0] = pIdx->pTable->nRowLogEst;
102970 Table *pTab = pIndex->pTable;
103200 Token *pTable, /* Table to append */
103204 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
103226 pDatabase = pTable;
103227 pTable = pTemp;
103229 pItem->zName = sqlite3NameFromToken(db, pTable);
103292 Token *pTable, /* Name of the table to add to the FROM clause */
103307 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
103627 Table *pTab = pIdx->pTable;
105269 if( pIdx->pTable->pSelect ){
107720 assert( pIdx==0 || pIdx->pTable==pTab );
108654 Table *pTab = pIdx->pTable;
110102 if( pIdx->idxType==2 ) sqlite3SetMakeRecordP5(v, pIdx->pTable);
110459 assert( pDest->pTable!=pSrc->pTable );
114124 pTab = pIdx->pTable;
122718 Table *pTable;
122725 pTable = tableOfTrigger(pTrigger);
122726 assert( pTable );
122727 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
122734 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
122743 assert( pTable!=0 );
124831 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
124832 int nBytes = sizeof(char *)*(2+pTable->nModuleArg);
124834 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
124838 int i = pTable->nModuleArg++;
124841 pTable->azModuleArg = azModuleArg;
124858 Table *pTable; /* The new virtual table */
124862 pTable = pParse->pNewTable;
124863 if( pTable==0 ) return;
124864 assert( 0==pTable->pIndex );
124867 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
124870 assert( pTable->nModuleArg==0 );
124871 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
124872 addModuleArgument(db, pTable, 0);
124873 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
124887 if( pTable->azModuleArg ){
124888 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
124889 pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName);
125315 pIdx->pTable = pTab;
126362 return pIdx->pTable->aCol[i].zName;
127326 Table *pTab = pIdx->pTable;
127790 if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){
127929 }else if( HasRowid(pIdx->pTable) ){
127943 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
130150 }else if( iColumn==pIdx->pTable->iPKey ){
130153 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
130262 return pIdx->pTable->aCol[j].notNull;
130477 Table *pTable; /* The table being indexed */
130504 pTable = pSrc->pTab;
130527 "automatic index on %s(%s)", pTable->zName,
130528 pTable->aCol[iCol].zName);
130554 mxBitCol = MIN(BMS-1,pTable->nCol);
130555 testcase( pTable->nCol==BMS-1 );
130556 testcase( pTable->nCol==BMS-2 );
130561 nKeyCol += pTable->nCol - BMS + 1;
130569 pIdx->pTable = pTable;
130600 for(i=BMS-1; i<pTable->nCol; i++){
130615 VdbeComment((v, "for %s", pTable->zName));
132112 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
132390 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
132620 sPk.pTable = pTab;
133420 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
133422 || !HasRowid(pIndex->pTable));
133476 if( iColumn==pIndex->pTable->iPKey ) iColumn = -1;
133488 && pIndex->pTable->aCol[iColumn].notNull==0
134788 && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
134798 assert( pIdx->pTable==pTab );
174225 SessionTable *pTable; /* List of attached tables */
175358 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
175370 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
175808 sessionDeleteTable(pSession->pTable);
175851 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
175870 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
176428 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
176607 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){