Lines Matching refs:pSchema

16583   Schema *pSchema;     /* Pointer to database schema (possibly shared) */  member
16621 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))==(P))
16622 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))!=0)
16623 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags|=(P)
16624 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags&=~(P)
16930 #define SCHEMA_ENC(db) ((db)->aDb[0].pSchema->enc)
17489 Schema *pSchema; /* Schema that contains this table */ member
17756 Schema *pSchema; /* Schema containing this index */ member
18224 Schema *pSchema; /* Schema to which this item is fixed */ member
18840 Schema *pSchema; /* Schema containing the trigger */ member
18917 Schema *pSchema; /* Fix items to this schema */ member
21556 Schema *pSchema = db->aDb[i].pSchema; in sqlite3_db_status() local
21557 if( ALWAYS(pSchema!=0) ){ in sqlite3_db_status()
21561 pSchema->tblHash.count in sqlite3_db_status()
21562 + pSchema->trigHash.count in sqlite3_db_status()
21563 + pSchema->idxHash.count in sqlite3_db_status()
21564 + pSchema->fkeyHash.count in sqlite3_db_status()
21566 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
21567 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
21568 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
21569 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
21571 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
21574 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
63749 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
64267 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
64270 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
64500 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
64519 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
64529 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
67070 if( pBt->xFreeSchema && pBt->pSchema ){
67071 pBt->xFreeSchema(pBt->pSchema);
67073 sqlite3DbFree(0, pBt->pSchema);
74672 if( !pBt->pSchema && nBytes ){
74673 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
74677 return pBt->pSchema;
88674 || db->aDb[pOp->p1].pSchema->iGeneration!=pOp->p4.i)
88696 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
88762 pDb->pSchema->schema_cookie = pOp->p3;
88766 pDb->pSchema->file_format = pOp->p3;
88907 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
88908 p->minWriteFileFormat = pDb->pSchema->file_format;
91216 sqlite3SchemaClear(db->aDb[iDb].pSchema);
93332 pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
93419 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
93423 pTab->pSchema->schema_cookie,
93424 pTab->pSchema->iGeneration);
94651 mxCache = db->aDb[0].pSchema->cache_size;
96626 Schema *pSchema;
96631 pSchema = db->aDb[iDb].pSchema;
96633 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
96642 for(k=sqliteHashFirst(&pSchema->idxHash); k; k=sqliteHashNext(k)){
97776 Schema *pSchema = 0; /* Schema of the expression */
97806 pSchema = db->aDb[i].pSchema;
97813 pSchema = db->aDb[0].pSchema;
97845 if( zDb && pTab->pSchema!=pSchema ){
97888 pSchema = pExpr->y.pTab->pSchema;
97925 pSchema = pTab->pSchema;
98153 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
99469 if( pTab->pSchema!=pParse->db->aDb[1].pSchema ){
101003 pNewItem->pSchema = pOldItem->pSchema;
102049 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
105602 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
105791 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
105950 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
105981 pNew->pSchema = db->aDb[iDb].pSchema;
106052 iSchema = sqlite3SchemaToIndex(db, pTab->pSchema);
107102 && sCtx.pTab->pSchema==pTrigger->pTabSchema
108233 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
108328 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
108562 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
108575 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
108593 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
109086 Schema *pSchema = db->aDb[iDb].pSchema;
109093 for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){
109097 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
109122 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
109134 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
109264 pNew->pSchema = 0;
109328 pNew->pSchema = sqlite3SchemaGet(db, pNew->pBt);
109329 if( !pNew->pSchema ){
109331 }else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){
109384 db->aDb[iDb].pSchema = 0;
109454 assert( db->aDb[1].pSchema );
109455 pEntry = sqliteHashFirst(&db->aDb[1].pSchema->trigHash);
109458 if( pTrig->pTabSchema==pDb->pSchema ){
109459 pTrig->pTabSchema = pTrig->pSchema;
109466 pDb->pSchema = 0;
109602 pFix->pSchema = db->aDb[iDb].pSchema;
109643 pItem->pSchema = pFix->pSchema;
109915 Schema *pSchema, /* The schema of the expression */
109928 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
110225 Schema *pSchema;
110228 pSchema = db->aDb[iDb].pSchema;
110233 pSchema->schema_cookie, /* P3 */
110234 pSchema->iGeneration /* P4 */
110376 p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110379 p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, TEMP_MASTER_NAME);
110383 p = sqlite3HashFind(&db->aDb[1].pSchema->tblHash, zName);
110386 p = sqlite3HashFind(&db->aDb[0].pSchema->tblHash, zName);
110391 p = sqlite3HashFind(&db->aDb[i].pSchema->tblHash, zName);
110474 assert( p->pSchema==0 || p->zDatabase==0 );
110475 if( p->pSchema ){
110476 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
110503 Schema *pSchema = db->aDb[j].pSchema;
110504 assert( pSchema );
110507 p = sqlite3HashFind(&pSchema->idxHash, zName);
110541 pHash = &db->aDb[iDb].pSchema->idxHash;
110610 sqlite3SchemaClear(db->aDb[i].pSchema);
110625 if( pDb->pSchema ){
110627 sqlite3SchemaClear(pDb->pSchema);
110702 assert( pIndex->pSchema==pTable->pSchema
110707 &pIndex->pSchema->idxHash, zName, 0
110709 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
110755 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, 0);
111155 pTable->pSchema = db->aDb[iDb].pSchema;
111172 pTable->pSchema->pSeqTab = pTable;
111771 (int)(1+(unsigned)db->aDb[iDb].pSchema->schema_cookie));
112350 iDb = sqlite3SchemaToIndex(db, p->pSchema);
112533 if( pDb->pSchema->pSeqTab==0 ){
112551 Schema *pSchema = p->pSchema;
112553 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p);
112608 iDb = sqlite3SchemaToIndex(db, p->pSchema);
112769 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
112781 pTable->pSchema->schemaFlags |= DB_UnresetViews;
112800 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
112839 pHash = &pDb->pSchema->tblHash;
112846 pHash = &pDb->pSchema->idxHash;
112920 assert( pIdx->pSchema==pTab->pSchema );
112928 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
112985 assert( pTrigger->pSchema==pTab->pSchema ||
112986 pTrigger->pSchema==db->aDb[1].pSchema );
113087 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
113280 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
113281 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
113347 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
113565 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
113580 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
113592 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
113744 pIndex->pSchema = db->aDb[iDb].pSchema;
113755 if( pDb->pSchema->file_format>=4 ){
113951 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
113960 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
114158 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
114714 assert( db->aDb[1].pSchema );
114922 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
114947 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
115630 Schema *pSchema = (Schema *)p;
115632 temp1 = pSchema->tblHash;
115633 temp2 = pSchema->trigHash;
115634 sqlite3HashInit(&pSchema->trigHash);
115635 sqlite3HashClear(&pSchema->idxHash);
115640 sqlite3HashInit(&pSchema->tblHash);
115646 sqlite3HashClear(&pSchema->fkeyHash);
115647 pSchema->pSeqTab = 0;
115648 if( pSchema->schemaFlags & DB_SchemaLoaded ){
115649 pSchema->iGeneration++;
115651 pSchema->schemaFlags &= ~(DB_SchemaLoaded|DB_ResetWanted);
115792 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
116006 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
116100 assert( pIdx->pSchema==pTab->pSchema );
119378 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName);
119589 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
120064 pTrigger->pSchema = pTab->pSchema;
120065 pTrigger->pTabSchema = pTab->pSchema;
120114 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
120124 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
120496 assert( pParse->db->aDb[iDb].pSchema!=0 );
120502 Table *pSeqTab = pParse->db->aDb[iDb].pSchema->pSeqTab;
120571 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
120572 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
120634 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
120637 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
120839 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
122416 if( pTab->pSchema->file_format<2 ) return;
122556 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
122570 assert( pIdx->pSchema==pTab->pSchema );
122761 if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
122856 if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
122892 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
125871 pDb->pSchema->cache_size = size;
125872 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
126169 returnSingleInt(v, pDb->pSchema->cache_size);
126172 pDb->pSchema->cache_size = size;
126173 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
126484 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
126534 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
126569 int iIdxDb = sqlite3SchemaToIndex(db, pIdx->pSchema);
126606 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
126697 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
126745 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
126756 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
126916 pTbls = &db->aDb[i].pSchema->tblHash;
127387 Schema *pSchema; /* The current schema */
127404 pSchema = db->aDb[iDb].pSchema;
127405 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
128091 assert( db->aDb[iDb].pSchema );
128168 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
128196 pDb->pSchema->enc = ENC(db);
128198 if( pDb->pSchema->cache_size==0 ){
128202 pDb->pSchema->cache_size = size;
128204 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
128206 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
128215 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
128216 if( pDb->pSchema->file_format==0 ){
128217 pDb->pSchema->file_format = 1;
128219 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
128392 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
128411 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
128425 if( pSchema ){
128428 if( db->aDb[i].pSchema==pSchema ){
130308 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
130579 if( pNC->pParse && pTab->pSchema ){
130580 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
133966 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
134455 if( pItem->pTab->pSchema!=pThis->pTab->pSchema ) continue;
134458 if( pItem->pTab->pSchema==0 && pThis->pSelect->selId!=pS1->selId ){
135494 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
135893 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
135900 if( pTmpSchema!=pTab->pSchema ){
135905 if( pTrig->pTabSchema==pTab->pSchema
135988 && pTab->pSchema==db->aDb[1].pSchema ){
136032 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){
136065 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
136094 pTrigger->pSchema = db->aDb[iDb].pSchema;
136095 pTrigger->pTabSchema = pTab->pSchema;
136141 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
136188 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
136194 }else if( pLink->pSchema==pLink->pTabSchema ){
136428 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName);
136464 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
136467 assert( (pTable && pTable->pSchema==pTrigger->pSchema) || iDb==1 );
136501 pHash = &(db->aDb[iDb].pSchema->trigHash);
136504 if( pTrigger->pSchema==pTrigger->pTabSchema ){
136593 iDb = sqlite3SchemaToIndex(db, pStep->pTrig->pSchema);
136972 assert( p->pSchema!=0 );
136974 assert( p->pSchema==p->pTabSchema
136975 || p->pSchema==pParse->db->aDb[1].pSchema );
137260 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
138620 sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
138776 pDb->pSchema = 0;
139028 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
139201 int iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
139265 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
139296 Schema *pSchema = pTab->pSchema;
139298 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
139299 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, pTab);
139381 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
140009 pTab->pSchema = db->aDb[0].pSchema;
149910 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
149993 assert( pIx->pSchema==pTab->pSchema );
161321 Schema *pSchema = db->aDb[i].pSchema;
161322 if( pSchema ){
161323 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
161466 pDb->pSchema = 0;
161471 if( db->aDb[1].pSchema ){
161472 sqlite3SchemaClear(db->aDb[1].pSchema);
161533 sqlite3DbFree(db, db->aDb[1].pSchema);
163453 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
163458 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);
164054 assert( db==0 || db->aDb[0].pSchema!=0 );
164055 if( db && (y = db->aDb[0].pSchema->schema_cookie)!=0 ){ x = y; }