Home | History | Annotate | Download | only in dist

Lines Matching defs:pTable

16040   Table *pTable;           /* The SQL table being indexed */
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 );
103785 ** The Table structure pTable is really a VIEW. Fill in the names of
103786 ** the columns of the view in the pTable structure. Return the number
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 ){
103867 ** arglist which is stored in pTable->pCheck. The pCheck field
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 */
104524 ** UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable
104550 DbFixer sFix; /* For assigning database names to pTable */
104758 pIndex->pTable = pTab;
105103 a[0] = pIdx->pTable->nRowLogEst;
105155 Table *pTab = pIndex->pTable;
105350 ** need be. A new entry is created in the SrcList even if pTable is NULL.
105359 ** points to the table name and the pTable points to the database name.
105361 ** come from pTable (if pDatabase is NULL) or from pDatabase.
105362 ** SrcList.a[].zDatabase is filled with the database name from pTable,
105379 ** Both pTable and pDatabase are assumed to be quoted. They are dequoted
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);
105462 ** if this is the first term of the FROM clause. pTable and pDatabase
105467 ** SELECT statement that the subquery encodes. The pTable and
105477 Token *pTable, /* Name of the table to add to the FROM clause */
105478 Token *pDatabase, /* Name of the database containing pTable */
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 );
127675 ** Add a new module argument to pTable->azModuleArg[].
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);
127746 ** virtual table currently under construction in pParse->pTable.
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 );
178846 SessionTable *pTable; /* List of attached tables */
178898 ** stored in a linked list starting at sqlite3_session.pTable.
180059 for(pRet=pSession->pTable; pRet; pRet=pRet->pNext){
180071 for(pRet=pSession->pTable; pRet->pNext; pRet=pRet->pNext);
180509 sessionDeleteTable(pSession->pTable);
180552 for(pTab=pSession->pTable; pTab; pTab=pTab->pNext){
180571 for(ppTab=&pSession->pTable; *ppTab; ppTab=&(*ppTab)->pNext);
181142 for(pTab=pSession->pTable; rc==SQLITE_OK && pTab; pTab=pTab->pNext){
181321 for(pTab=pSession->pTable; pTab && ret==0; pTab=pTab->pNext){