Lines Matching refs:pTable
16040 Table *pTable; /* The SQL table being indexed */ member
60631 iTab = pIdx->pTable->tnum;
95990 sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
100067 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
100273 analyzeTable(pParse, pIdx->pTable, pIdx);
100352 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
100375 Table *pTable;
100384 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
100385 if( pTable==0 ){
100391 pIndex = sqlite3PrimaryKeyIndex(pTable);
100414 pTable->nRowLogEst = pIndex->aiRowLogEst[0];
100415 pTable->tabFlags |= TF_HasStat1;
100419 fakeIdx.szIdxRow = pTable->szTabRow;
100421 fakeIdx.pTable = pTable;
100423 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
100424 pTable->szTabRow = fakeIdx.szIdxRow;
100425 pTable->tabFlags |= TF_HasStat1;
100586 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
100587 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
102102 if( pIndex->pTable->pIndex==pIndex ){
102103 pIndex->pTable->pIndex = pIndex->pNext;
102108 p = pIndex->pTable->pIndex;
102204 SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
102207 assert( pTable!=0 );
102208 if( (pCol = pTable->aCol)!=0 ){
102209 for(i=0; i<pTable->nCol; i++, pCol++){
102214 sqlite3DbFree(db, pTable->aCol);
102233 static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
102241 if( db && (pTable->tabFlags & TF_Ephemeral)==0 ){
102247 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
102249 assert( pIndex->pSchema==pTable->pSchema
102250 || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF) );
102251 if( (db==0 || db->pnBytesFreed==0) && !IsVirtual(pTable) ){
102263 sqlite3FkDelete(db, pTable);
102267 sqlite3DeleteColumnNames(db, pTable);
102268 sqlite3DbFree(db, pTable->zName);
102269 sqlite3DbFree(db, pTable->zColAff);
102270 sqlite3SelectDelete(db, pTable->pSelect);
102271 sqlite3ExprListDelete(db, pTable->pCheck);
102273 sqlite3VtabClear(db, pTable);
102275 sqlite3DbFree(db, pTable);
102280 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
102282 if( !pTable ) return;
102283 if( ((!db || db->pnBytesFreed==0) && (--pTable->nTabRef)>0) ) return;
102284 deleteTable(db, pTable);
102488 Table *pTable;
102552 pTable = sqlite3FindTable(db, zName, zDb);
102553 if( pTable ){
102568 pTable = sqlite3DbMallocZero(db, sizeof(Table));
102569 if( pTable==0 ){
102575 pTable->zName = zName;
102576 pTable->iPKey = -1;
102577 pTable->pSchema = db->aDb[iDb].pSchema;
102578 pTable->nTabRef = 1;
102580 pTable->nRowLogEst = sqlite3LogEst(SQLITE_DEFAULT_ROWEST);
102582 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
102585 pParse->pNewTable = pTable;
102594 pTable->pSchema->pSeqTab = pTable;
103288 const Column *aCol = pIdx->pTable->aCol;
103291 assert( x<pIdx->pTable->nCol );
103789 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
103802 assert( pTable );
103806 rc = sqlite3VtabCallConnect(pParse, pTable);
103811 if( IsVirtual(pTable) ) return 0;
103818 if( pTable->nCol>0 ) return 0;
103835 if( pTable->nCol<0 ){
103836 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
103839 assert( pTable->nCol>=0 );
103848 assert( pTable->pSelect );
103849 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
103853 pTable->nCol = -1;
103864 if( pTable->pCheck ){
103871 sqlite3ColumnsFromExprList(pParse, pTable->pCheck,
103872 &pTable->nCol, &pTable->aCol);
103875 && pTable->nCol==pSel->pEList->nExpr
103877 sqlite3SelectAddColumnTypeAndCollation(pParse, pTable, pSel);
103883 assert( pTable->aCol==0 );
103884 pTable->nCol = pSelTab->nCol;
103885 pTable->aCol = pSelTab->aCol;
103888 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
103890 pTable->nCol = 0;
103899 pTable->pSchema->schemaFlags |= DB_UnresetViews;
104406 Table *pTab = pIndex->pTable; /* The table that is indexed */
104758 pIndex->pTable = pTab;
105103 a[0] = pIdx->pTable->nRowLogEst;
105155 Table *pTab = pIndex->pTable;
105385 Token *pTable, /* Table to append */
105389 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
105411 pItem->zDatabase = sqlite3NameFromToken(db, pTable);
105413 pItem->zName = sqlite3NameFromToken(db, pTable);
105477 Token *pTable, /* Name of the table to add to the FROM clause */
105492 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
105804 Table *pTab = pIdx->pTable;
107507 if( pIdx->pTable->pSelect ){
109985 assert( pIdx==0 || pIdx->pTable==pTab );
110936 Table *pTab = pIdx->pTable;
112383 if( pIdx->idxType==2 ) sqlite3SetMakeRecordP5(v, pIdx->pTable);
112742 assert( pDest->pTable!=pSrc->pTable );
116473 pTab = pIdx->pTable;
125515 Table *pTable;
125522 pTable = tableOfTrigger(pTrigger);
125523 assert( pTable );
125524 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
125531 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
125540 assert( pTable!=0 );
127680 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
127681 int nBytes = sizeof(char *)*(2+pTable->nModuleArg);
127683 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
127687 int i = pTable->nModuleArg++;
127690 pTable->azModuleArg = azModuleArg;
127707 Table *pTable; /* The new virtual table */
127711 pTable = pParse->pNewTable;
127712 if( pTable==0 ) return;
127713 assert( 0==pTable->pIndex );
127716 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
127719 assert( pTable->nModuleArg==0 );
127720 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
127721 addModuleArgument(db, pTable, 0);
127722 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
127736 if( pTable->azModuleArg ){
127737 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
127738 pTable->azModuleArg[0], pParse->db->aDb[iDb].zDbSName);
128168 pIdx->pTable = pTab;
129216 return pIdx->pTable->aCol[i].zName;
130232 Table *pTab = pIdx->pTable;
130760 if( (j>=0 && pIdx->pTable->aCol[j].notNull==0) || j==XN_EXPR ){
130900 }else if( HasRowid(pIdx->pTable) ){
130914 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
133252 }else if( iColumn==pIdx->pTable->iPKey ){
133255 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
133364 return pIdx->pTable->aCol[j].notNull;
133588 Table *pTable; /* The table being indexed */
133615 pTable = pSrc->pTab;
133638 "automatic index on %s(%s)", pTable->zName,
133639 pTable->aCol[iCol].zName);
133665 mxBitCol = MIN(BMS-1,pTable->nCol);
133666 testcase( pTable->nCol==BMS-1 );
133667 testcase( pTable->nCol==BMS-2 );
133672 nKeyCol += pTable->nCol - BMS + 1;
133680 pIdx->pTable = pTable;
133711 for(i=BMS-1; i<pTable->nCol; i++){
133726 VdbeComment((v, "for %s", pTable->zName));
135240 idxaff = sqlite3TableColumnAffinity(pIdx->pTable, pLhs->iColumn);
135518 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
135750 sPk.pTable = pTab;
136568 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
136570 || !HasRowid(pIndex->pTable));
136624 if( iColumn==pIndex->pTable->iPKey ) iColumn = XN_ROWID;
136636 && pIndex->pTable->aCol[iColumn].notNull==0
138082 && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
138096 assert( pIdx->pTable==pTab );
178851 SessionTable *pTable; /* List of attached tables */
180064 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
180076 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
180514 sessionDeleteTable(pSession->pTable);
180557 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
180576 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
181147 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
181326 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){