Lines Matching refs:pTable

12423   Table *pTable;           /* The SQL table being indexed */
54687 iTab = pIdx->pTable->tnum;
87434 sqlite3ExprCodeGetColumnOfTable(pParse->pVdbe, pIdx->pTable, iTabCur,
91204 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
91402 analyzeTable(pParse, pIdx->pTable, pIdx);
91417 analyzeTable(pParse, pIdx->pTable, pIdx);
91495 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
91518 Table *pTable;
91527 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
91528 if( pTable==0 ){
91534 pIndex = sqlite3PrimaryKeyIndex(pTable);
91555 if( pIndex->pPartIdxWhere==0 ) pTable->nRowLogEst = pIndex->aiRowLogEst[0];
91558 fakeIdx.szIdxRow = pTable->szTabRow;
91560 fakeIdx.pTable = pTable;
91562 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
91563 pTable->szTabRow = fakeIdx.szIdxRow;
91724 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
91725 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
93237 if( pIndex->pTable->pIndex==pIndex ){
93238 pIndex->pTable->pIndex = pIndex->pNext;
93243 p = pIndex->pTable->pIndex;
93341 SQLITE_PRIVATE void sqlite3DeleteColumnNames(sqlite3 *db, Table *pTable){
93344 assert( pTable!=0 );
93345 if( (pCol = pTable->aCol)!=0 ){
93346 for(i=0; i<pTable->nCol; i++, pCol++){
93353 sqlite3DbFree(db, pTable->aCol);
93372 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
93376 assert( !pTable || pTable->nRef>0 );
93379 if( !pTable ) return;
93380 if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return;
93385 TESTONLY( nLookaside = (db && (pTable->tabFlags & TF_Ephemeral)==0) ?
93389 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
93391 assert( pIndex->pSchema==pTable->pSchema );
93404 sqlite3FkDelete(db, pTable);
93408 sqlite3DeleteColumnNames(db, pTable);
93409 sqlite3DbFree(db, pTable->zName);
93410 sqlite3DbFree(db, pTable->zColAff);
93411 sqlite3SelectDelete(db, pTable->pSelect);
93412 sqlite3ExprListDelete(db, pTable->pCheck);
93414 sqlite3VtabClear(db, pTable);
93416 sqlite3DbFree(db, pTable);
93621 Table *pTable;
93701 pTable = sqlite3FindTable(db, zName, zDb);
93702 if( pTable ){
93717 pTable = sqlite3DbMallocZero(db, sizeof(Table));
93718 if( pTable==0 ){
93724 pTable->zName = zName;
93725 pTable->iPKey = -1;
93726 pTable->pSchema = db->aDb[iDb].pSchema;
93727 pTable->nRef = 1;
93728 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
93730 pParse->pNewTable = pTable;
93739 pTable->pSchema->pSeqTab = pTable;
94437 const Column *aCol = pIdx->pTable->aCol;
94440 assert( x<pIdx->pTable->nCol );
94923 ** The Table structure pTable is really a VIEW. Fill in the names of
94924 ** the columns of the view in the pTable structure. Return the number
94927 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
94936 assert( pTable );
94939 if( sqlite3VtabCallConnect(pParse, pTable) ){
94942 if( IsVirtual(pTable) ) return 0;
94949 if( pTable->nCol>0 ) return 0;
94966 if( pTable->nCol<0 ){
94967 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
94970 assert( pTable->nCol>=0 );
94979 assert( pTable->pSelect );
94981 if( pTable->pCheck ){
94983 sqlite3ColumnsFromExprList(pParse, pTable->pCheck,
94984 &pTable->nCol, &pTable->aCol);
94986 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
94990 pTable->nCol = -1;
95002 assert( pTable->aCol==0 );
95003 pTable->nCol = pSelTab->nCol;
95004 pTable->aCol = pSelTab->aCol;
95008 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
95010 pTable->nCol = 0;
95019 pTable->pSchema->schemaFlags |= DB_UnresetViews;
95533 Table *pTab = pIndex->pTable; /* The table that is indexed */
95651 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
95681 DbFixer sFix; /* For assigning database names to pTable */
95880 pIndex->pTable = pTab;
96209 a[0] = pIdx->pTable->nRowLogEst;
96260 Table *pTab = pIndex->pTable;
96455 ** need be. A new entry is created in the SrcList even if pTable is NULL.
96464 ** points to the table name and the pTable points to the database name.
96466 ** come from pTable (if pDatabase is NULL) or from pDatabase.
96467 ** SrcList.a[].zDatabase is filled with the database name from pTable,
96484 ** Both pTable and pDatabase are assumed to be quoted. They are dequoted
96490 Token *pTable, /* Table to append */
96494 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
96511 pDatabase = pTable;
96512 pTable = pTemp;
96514 pItem->zName = sqlite3NameFromToken(db, pTable);
96562 ** if this is the first term of the FROM clause. pTable and pDatabase
96567 ** SELECT statement that the subquery encodes. The pTable and
96577 Token *pTable, /* Name of the table to add to the FROM clause */
96578 Token *pDatabase, /* Name of the database containing pTable */
96592 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
96915 Table *pTab = pIdx->pTable;
100929 assert( pIdx==0 || pIdx->pTable==pTab );
101867 Table *pTab = pIdx->pTable;
103524 assert( pDest->pTable!=pSrc->pTable );
106904 pTab = pIdx->pTable;
114994 Table *pTable;
115001 pTable = tableOfTrigger(pTrigger);
115002 assert( pTable );
115003 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
115010 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
115019 assert( pTable!=0 );
117050 ** Add a new module argument to pTable->azModuleArg[].
117055 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
117056 int nBytes = sizeof(char *)*(2+pTable->nModuleArg);
117058 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
117062 int i = pTable->nModuleArg++;
117065 pTable->azModuleArg = azModuleArg;
117082 Table *pTable; /* The new virtual table */
117086 pTable = pParse->pNewTable;
117087 if( pTable==0 ) return;
117088 assert( 0==pTable->pIndex );
117091 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
117094 pTable->tabFlags |= TF_Virtual;
117095 pTable->nModuleArg = 0;
117096 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
117097 addModuleArgument(db, pTable, 0);
117098 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
117112 if( pTable->azModuleArg ){
117113 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
117114 pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
117122 ** virtual table currently under construction in pParse->pTable.
118569 return pIdx->pTable->aCol[i].zName;
119461 && pIdx->pTable->aCol[j].notNull==0
119586 }else if( HasRowid(pIdx->pTable) ){
119597 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
121668 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
121776 return pIdx->pTable->aCol[j].notNull;
121989 Table *pTable; /* The table being indexed */
122016 pTable = pSrc->pTab;
122039 "automatic index on %s(%s)", pTable->zName,
122040 pTable->aCol[iCol].zName);
122066 mxBitCol = MIN(BMS-1,pTable->nCol);
122067 testcase( pTable->nCol==BMS-1 );
122068 testcase( pTable->nCol==BMS-2 );
122073 nKeyCol += pTable->nCol - BMS + 1;
122081 pIdx->pTable = pTable;
122112 for(i=BMS-1; i<pTable->nCol; i++){
122127 VdbeComment((v, "for %s", pTable->zName));
123744 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
123970 sPk.pTable = pTab;
124627 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
124629 || !HasRowid(pIndex->pTable));
124659 if( iColumn==pIndex->pTable->iPKey ) iColumn = -1;
124671 && pIndex->pTable->aCol[iColumn].notNull==0
125947 && (pWInfo->eOnePass==ONEPASS_OFF || !HasRowid(pIdx->pTable))
125957 assert( pIdx->pTable==pTab );