Lines Matching refs:pTable

10127   Table *pTable;   /* The SQL table being indexed */
48418 iTab = pIdx->pTable->tnum;
78075 analyzeTable(pParse, pIdx->pTable, pIdx);
78090 analyzeTable(pParse, pIdx->pTable, pIdx);
78124 Table *pTable;
78135 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
78136 if( pTable==0 ){
78152 if( i==0 ) pTable->nRowEst = v;
79515 if( pIndex->pTable->pIndex==pIndex ){
79516 pIndex->pTable->pIndex = pIndex->pNext;
79521 p = pIndex->pTable->pIndex;
79617 static void sqliteDeleteColumnNames(sqlite3 *db, Table *pTable){
79620 assert( pTable!=0 );
79621 if( (pCol = pTable->aCol)!=0 ){
79622 for(i=0; i<pTable->nCol; i++, pCol++){
79629 sqlite3DbFree(db, pTable->aCol);
79642 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
79645 assert( !pTable || pTable->nRef>0 );
79648 if( !pTable ) return;
79649 if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return;
79652 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
79654 assert( pIndex->pSchema==pTable->pSchema );
79667 sqlite3FkDelete(db, pTable);
79671 sqliteDeleteColumnNames(db, pTable);
79672 sqlite3DbFree(db, pTable->zName);
79673 sqlite3DbFree(db, pTable->zColAff);
79674 sqlite3SelectDelete(db, pTable->pSelect);
79676 sqlite3ExprDelete(db, pTable->pCheck);
79679 sqlite3VtabClear(db, pTable);
79681 sqlite3DbFree(db, pTable);
79866 Table *pTable;
79946 pTable = sqlite3FindTable(db, zName, zDb);
79947 if( pTable ){
79962 pTable = sqlite3DbMallocZero(db, sizeof(Table));
79963 if( pTable==0 ){
79969 pTable->zName = zName;
79970 pTable->iPKey = -1;
79971 pTable->pSchema = db->aDb[iDb].pSchema;
79972 pTable->nRef = 1;
79973 pTable->nRowEst = 1000000;
79975 pParse->pNewTable = pTable;
79984 pTable->pSchema->pSeqTab = pTable;
80873 ** The Table structure pTable is really a VIEW. Fill in the names of
80874 ** the columns of the view in the pTable structure. Return the number
80877 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
80885 assert( pTable );
80888 if( sqlite3VtabCallConnect(pParse, pTable) ){
80891 if( IsVirtual(pTable) ) return 0;
80898 if( pTable->nCol>0 ) return 0;
80915 if( pTable->nCol<0 ){
80916 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
80919 assert( pTable->nCol>=0 );
80928 assert( pTable->pSelect );
80929 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
80934 pTable->nCol = -1;
80947 assert( pTable->aCol==0 );
80948 pTable->nCol = pSelTab->nCol;
80949 pTable->aCol = pSelTab->aCol;
80953 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
80954 pTable->pSchema->flags |= DB_UnresetViews;
80956 pTable->nCol = 0;
81460 Table *pTab = pIndex->pTable; /* The table that is indexed */
81567 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
81598 DbFixer sFix; /* For assigning database names to pTable */
81795 pIndex->pTable = pTab;
82072 a[0] = pIdx->pTable->nRowEst;
82121 Table *pTab = pIndex->pTable;
82321 ** need be. A new entry is created in the SrcList even if pTable is NULL.
82330 ** points to the table name and the pTable points to the database name.
82332 ** come from pTable (if pDatabase is NULL) or from pDatabase.
82333 ** SrcList.a[].zDatabase is filled with the database name from pTable,
82350 ** Both pTable and pDatabase are assumed to be quoted. They are dequoted
82356 Token *pTable, /* Table to append */
82360 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
82377 pDatabase = pTable;
82378 pTable = pTemp;
82380 pItem->zName = sqlite3NameFromToken(db, pTable);
82427 ** if this is the first term of the FROM clause. pTable and pDatabase
82432 ** SELECT statement that the subquery encodes. The pTable and
82442 Token *pTable, /* Name of the table to add to the FROM clause */
82443 Token *pDatabase, /* Name of the database containing pTable */
82457 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
84016 int iCur, /* Cursor number for the pIdx->pTable table */
84022 Table *pTab = pIdx->pTable;
86147 assert( !pIdx || pIdx->pTable==pTab );
86948 Table *pTab = pIdx->pTable;
88433 assert( pDest->pTable!=pSrc->pTable );
90869 pTab = pIdx->pTable;
97677 Table *pTable;
97684 pTable = tableOfTrigger(pTrigger);
97685 assert( pTable );
97686 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
97693 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
97702 assert( pTable!=0 );
99524 ** Add a new module argument to pTable->azModuleArg[].
99529 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
99530 int i = pTable->nModuleArg++;
99531 int nBytes = sizeof(char *)*(1+pTable->nModuleArg);
99533 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
99537 sqlite3DbFree(db, pTable->azModuleArg[j]);
99540 sqlite3DbFree(db, pTable->azModuleArg);
99541 pTable->nModuleArg = 0;
99546 pTable->azModuleArg = azModuleArg;
99561 Table *pTable; /* The new virtual table */
99565 pTable = pParse->pNewTable;
99566 if( pTable==0 ) return;
99567 assert( 0==pTable->pIndex );
99570 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
99573 pTable->tabFlags |= TF_Virtual;
99574 pTable->nModuleArg = 0;
99575 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
99576 addModuleArgument(db, pTable, sqlite3DbStrDup(db, db->aDb[iDb].zName));
99577 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
99586 if( pTable->azModuleArg ){
99587 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
99588 pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
99596 ** virtual table currently under construction in pParse->pTable.
100945 idxaff = pIdx->pTable->aCol[iColumn].affinity;
101986 if( iColumn==pIdx->pTable->iPKey ){
102260 Table *pTable; /* Table tht might be indexed */
102284 pTable = pSrc->pTab;
102285 nTableRow = pTable->nRowEst;
102334 Table *pTable; /* The table being indexed */
102355 pTable = pSrc->pTab;
102382 mxBitCol = (pTable->nCol >= BMS-1) ? BMS-1 : pTable->nCol;
102383 testcase( pTable->nCol==BMS-1 );
102384 testcase( pTable->nCol==BMS-2 );
102389 nColumn += pTable->nCol - BMS + 1;
102406 pIdx->pTable = pTable;
102435 for(i=BMS-1; i<pTable->nCol; i++){
102448 VdbeComment((v, "for %s", pTable->zName));
102984 u8 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
103073 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
103136 aff = p->pTable->aCol[p->aiColumn[0]].affinity;
103258 sPk.pTable = pSrc->pTab;