Home | History | Annotate | Download | only in orig

Lines Matching defs:pTable

11161   Table *pTable;           /* The SQL table being indexed */
51717 iTab = pIdx->pTable->tnum;
84590 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
84787 analyzeTable(pParse, pIdx->pTable, pIdx);
84802 analyzeTable(pParse, pIdx->pTable, pIdx);
84878 pIndex->pTable->costMult = sqlite3LogEst(sqlite3Atoi(z+9));
84900 Table *pTable;
84909 pTable = sqlite3FindTable(pInfo->db, argv[0], pInfo->zDatabase);
84910 if( pTable==0 ){
84916 pIndex = sqlite3PrimaryKeyIndex(pTable);
84925 if( pIndex->pPartIdxWhere==0 ) pTable->nRowLogEst = pIndex->aiRowLogEst[0];
84928 fakeIdx.szIdxRow = pTable->szTabRow;
84930 fakeIdx.pTable = pTable;
84932 decodeIntArray((char*)z, 1, 0, &pTable->nRowLogEst, &fakeIdx);
84933 pTable->szTabRow = fakeIdx.szIdxRow;
85080 assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 );
85081 if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){
86517 if( pIndex->pTable->pIndex==pIndex ){
86518 pIndex->pTable->pIndex = pIndex->pNext;
86523 p = pIndex->pTable->pIndex;
86621 static void sqliteDeleteColumnNames(sqlite3 *db, Table *pTable){
86624 assert( pTable!=0 );
86625 if( (pCol = pTable->aCol)!=0 ){
86626 for(i=0; i<pTable->nCol; i++, pCol++){
86633 sqlite3DbFree(db, pTable->aCol);
86652 SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *db, Table *pTable){
86656 assert( !pTable || pTable->nRef>0 );
86659 if( !pTable ) return;
86660 if( ((!db || db->pnBytesFreed==0) && (--pTable->nRef)>0) ) return;
86665 TESTONLY( nLookaside = (db && (pTable->tabFlags & TF_Ephemeral)==0) ?
86669 for(pIndex = pTable->pIndex; pIndex; pIndex=pNext){
86671 assert( pIndex->pSchema==pTable->pSchema );
86684 sqlite3FkDelete(db, pTable);
86688 sqliteDeleteColumnNames(db, pTable);
86689 sqlite3DbFree(db, pTable->zName);
86690 sqlite3DbFree(db, pTable->zColAff);
86691 sqlite3SelectDelete(db, pTable->pSelect);
86693 sqlite3ExprListDelete(db, pTable->pCheck);
86696 sqlite3VtabClear(db, pTable);
86698 sqlite3DbFree(db, pTable);
86906 Table *pTable;
86986 pTable = sqlite3FindTable(db, zName, zDb);
86987 if( pTable ){
87002 pTable = sqlite3DbMallocZero(db, sizeof(Table));
87003 if( pTable==0 ){
87009 pTable->zName = zName;
87010 pTable->iPKey = -1;
87011 pTable->pSchema = db->aDb[iDb].pSchema;
87012 pTable->nRef = 1;
87013 pTable->nRowLogEst = 200; assert( 200==sqlite3LogEst(1048576) );
87015 pParse->pNewTable = pTable;
87024 pTable->pSchema->pSeqTab = pTable;
87692 const Column *aCol = pIdx->pTable->aCol;
87695 assert( x<pIdx->pTable->nCol );
88143 ** The Table structure pTable is really a VIEW. Fill in the names of
88144 ** the columns of the view in the pTable structure. Return the number
88147 SQLITE_PRIVATE int sqlite3ViewGetColumnNames(Parse *pParse, Table *pTable){
88155 assert( pTable );
88158 if( sqlite3VtabCallConnect(pParse, pTable) ){
88161 if( IsVirtual(pTable) ) return 0;
88168 if( pTable->nCol>0 ) return 0;
88185 if( pTable->nCol<0 ){
88186 sqlite3ErrorMsg(pParse, "view %s is circularly defined", pTable->zName);
88189 assert( pTable->nCol>=0 );
88198 assert( pTable->pSelect );
88199 pSel = sqlite3SelectDup(db, pTable->pSelect, 0);
88204 pTable->nCol = -1;
88217 assert( pTable->aCol==0 );
88218 pTable->nCol = pSelTab->nCol;
88219 pTable->aCol = pSelTab->aCol;
88223 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
88224 pTable->pSchema->schemaFlags |= DB_UnresetViews;
88226 pTable->nCol = 0;
88745 Table *pTab = pIndex->pTable; /* The table that is indexed */
88862 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
88892 DbFixer sFix; /* For assigning database names to pTable */
89084 pIndex->pTable = pTab;
89380 a[0] = pIdx->pTable->nRowLogEst;
89431 Table *pTab = pIndex->pTable;
89626 ** need be. A new entry is created in the SrcList even if pTable is NULL.
89635 ** points to the table name and the pTable points to the database name.
89637 ** come from pTable (if pDatabase is NULL) or from pDatabase.
89638 ** SrcList.a[].zDatabase is filled with the database name from pTable,
89655 ** Both pTable and pDatabase are assumed to be quoted. They are dequoted
89661 Token *pTable, /* Table to append */
89665 assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
89682 pDatabase = pTable;
89683 pTable = pTemp;
89685 pItem->zName = sqlite3NameFromToken(db, pTable);
89732 ** if this is the first term of the FROM clause. pTable and pDatabase
89737 ** SELECT statement that the subquery encodes. The pTable and
89747 Token *pTable, /* Name of the table to add to the FROM clause */
89748 Token *pDatabase, /* Name of the database containing pTable */
89762 p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
90066 Table *pTab = pIdx->pTable;
91622 Table *pTab = pIdx->pTable;
93971 assert( pIdx==0 || pIdx->pTable==pTab );
94868 Table *pTab = pIdx->pTable;
96492 assert( pDest->pTable!=pSrc->pTable );
99713 pTab = pIdx->pTable;
107599 Table *pTable;
107606 pTable = tableOfTrigger(pTrigger);
107607 assert( pTable );
107608 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
107615 if( sqlite3AuthCheck(pParse, code, pTrigger->zName, pTable->zName, zDb) ||
107624 assert( pTable!=0 );
109604 ** Add a new module argument to pTable->azModuleArg[].
109609 static void addModuleArgument(sqlite3 *db, Table *pTable, char *zArg){
109610 int i = pTable->nModuleArg++;
109611 int nBytes = sizeof(char *)*(1+pTable->nModuleArg);
109613 azModuleArg = sqlite3DbRealloc(db, pTable->azModuleArg, nBytes);
109617 sqlite3DbFree(db, pTable->azModuleArg[j]);
109620 sqlite3DbFree(db, pTable->azModuleArg);
109621 pTable->nModuleArg = 0;
109626 pTable->azModuleArg = azModuleArg;
109642 Table *pTable; /* The new virtual table */
109646 pTable = pParse->pNewTable;
109647 if( pTable==0 ) return;
109648 assert( 0==pTable->pIndex );
109651 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
109654 pTable->tabFlags |= TF_Virtual;
109655 pTable->nModuleArg = 0;
109656 addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName));
109657 addModuleArgument(db, pTable, 0);
109658 addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName));
109667 if( pTable->azModuleArg ){
109668 sqlite3AuthCheck(pParse, SQLITE_CREATE_VTABLE, pTable->zName,
109669 pTable->azModuleArg[0], pParse->db->aDb[iDb].zName);
109677 ** virtual table currently under construction in pParse->pTable.
111439 pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
112481 Table *pTable; /* The table being indexed */
112503 pTable = pSrc->pTab;
112515 "automatic index on %s(%s)", pTable->zName,
112516 pTable->aCol[iCol].zName);
112540 mxBitCol = (pTable->nCol >= BMS-1) ? BMS-1 : pTable->nCol;
112541 testcase( pTable->nCol==BMS-1 );
112542 testcase( pTable->nCol==BMS-2 );
112547 nKeyCol += pTable->nCol - BMS + 1;
112556 pIdx->pTable = pTable;
112587 for(i=BMS-1; i<pTable->nCol; i++){
112602 VdbeComment((v, "for %s", pTable->zName));
112945 u8 aff = iCol>=0 ? p->pTable->aCol[iCol].affinity : SQLITE_AFF_INTEGER;
113091 aff = p->pTable->aCol[p->aiColumn[nEq]].affinity;
113230 aff = p->pTable->aCol[p->aiColumn[nEq-1]].affinity;
113554 VdbeComment((v, "%s", pIdx->pTable->aCol[pIdx->aiColumn[j]].zName));
114105 && pIdx->pTable->aCol[j].notNull==0
114228 }else if( HasRowid(pIdx->pTable) ){
114234 Index *pPk = sqlite3PrimaryKeyIndex(pIdx->pTable);
115365 ApplyCostMultiplier(pNew->rRun, pProbe->pTable->costMult);
115539 sPk.pTable = pTab;
116126 assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) );
116127 assert( pIndex->aiColumn[nColumn-1]==(-1) || !HasRowid(pIndex->pTable));
116157 if( iColumn==pIndex->pTable->iPKey ) iColumn = -1;
116169 && pIndex->pTable->aCol[iColumn].notNull==0
117422 assert( pIdx->pTable==pTab );