Lines Matching refs:pSchema
15049 Schema *pSchema; /* Pointer to database schema (possibly shared) */ member
15087 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))==(P))
15088 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))!=0)
15089 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags|=(P)
15090 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags&=~(P)
15343 #define SCHEMA_ENC(db) ((db)->aDb[0].pSchema->enc)
15793 Schema *pSchema; /* Schema that contains this table */ member
16043 Schema *pSchema; /* Schema containing this index */ member
16461 Schema *pSchema; /* Schema to which this item is fixed */ member
17028 Schema *pSchema; /* Schema containing the trigger */ member
17104 Schema *pSchema; /* Fix items to this schema */ member
19460 Schema *pSchema = db->aDb[i].pSchema; in sqlite3_db_status() local
19461 if( ALWAYS(pSchema!=0) ){ in sqlite3_db_status()
19465 pSchema->tblHash.count in sqlite3_db_status()
19466 + pSchema->trigHash.count in sqlite3_db_status()
19467 + pSchema->idxHash.count in sqlite3_db_status()
19468 + pSchema->fkeyHash.count in sqlite3_db_status()
19470 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
19471 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
19472 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
19473 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
19475 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
19478 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
59851 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
60360 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
60363 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
60593 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
60612 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
60622 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
63086 if( pBt->xFreeSchema && pBt->pSchema ){
63087 pBt->xFreeSchema(pBt->pSchema);
63089 sqlite3DbFree(0, pBt->pSchema);
70213 if( !pBt->pSchema && nBytes ){
70214 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
70218 return pBt->pSchema;
83230 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
83251 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
83315 pDb->pSchema->schema_cookie = pOp->p3;
83319 pDb->pSchema->file_format = pOp->p3;
83441 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
83442 p->minWriteFileFormat = pDb->pSchema->file_format;
87493 pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
87580 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
87584 pTab->pSchema->schema_cookie,
87585 pTab->pSchema->iGeneration);
88809 mxCache = db->aDb[0].pSchema->cache_size;
91362 Schema *pSchema = 0; /* Schema of the expression */
91393 pSchema = db->aDb[i].pSchema;
91425 if( zDb && pTab->pSchema!=pSchema ){
91464 pSchema = pExpr->pTab->pSchema;
91487 pSchema = pTab->pSchema;
91655 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
94096 pNewItem->pSchema = pOldItem->pSchema;
94988 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
98332 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
98339 if( pTab->pSchema!=pTempSchema ){
98342 if( pTrig->pSchema==pTempSchema ){
98374 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
98380 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
98450 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
98648 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
98799 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
98829 pNew->pSchema = db->aDb[iDb].pSchema;
99869 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
99964 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
100182 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
100195 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
100213 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
100720 Schema *pSchema = db->aDb[iDb].pSchema;
100727 for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){
100731 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100756 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100768 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100928 pNew->pSchema = sqlite3SchemaGet(db, pNew->pBt);
100929 if( !pNew->pSchema ){
100931 }else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){
101011 db->aDb[iDb].pSchema = 0;
101079 pDb->pSchema = 0;
101216 pFix->pSchema = db->aDb[iDb].pSchema;
101256 pItem->pSchema = pFix->pSchema;
101503 Schema *pSchema, /* The schema of the expression */
101514 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
101811 Schema *pSchema;
101814 pSchema = db->aDb[iDb].pSchema;
101819 pSchema->schema_cookie, /* P3 */
101820 pSchema->iGeneration /* P4 */
101950 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
102032 assert( p->pSchema==0 || p->zDatabase==0 );
102033 if( p->pSchema ){
102034 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
102061 Schema *pSchema = db->aDb[j].pSchema;
102062 assert( pSchema );
102065 p = sqlite3HashFind(&pSchema->idxHash, zName);
102099 pHash = &db->aDb[iDb].pSchema->idxHash;
102167 sqlite3SchemaClear(db->aDb[i].pSchema);
102183 if( pDb->pSchema ){
102184 sqlite3SchemaClear(pDb->pSchema);
102249 assert( pIndex->pSchema==pTable->pSchema
102254 &pIndex->pSchema->idxHash, zName, 0
102256 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
102302 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, 0);
102577 pTable->pSchema = db->aDb[iDb].pSchema;
102594 pTable->pSchema->pSeqTab = pTable;
103119 db->aDb[iDb].pSchema->schema_cookie+1);
103524 iDb = sqlite3SchemaToIndex(db, p->pSchema);
103668 if( pDb->pSchema->pSeqTab==0 ){
103687 Schema *pSchema = p->pSchema;
103689 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p);
103744 iDb = sqlite3SchemaToIndex(db, p->pSchema);
103888 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
103899 pTable->pSchema->schemaFlags |= DB_UnresetViews;
103913 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
103952 pHash = &pDb->pSchema->tblHash;
103959 pHash = &pDb->pSchema->idxHash;
104033 assert( pIdx->pSchema==pTab->pSchema );
104041 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
104098 assert( pTrigger->pSchema==pTab->pSchema ||
104099 pTrigger->pSchema==db->aDb[1].pSchema );
104168 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
104351 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
104352 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
104418 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
104593 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
104608 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
104620 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
104762 pIndex->pSchema = db->aDb[iDb].pSchema;
104773 if( pDb->pSchema->file_format>=4 ){
104954 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
104955 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
105151 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
105673 assert( db->aDb[1].pSchema );
105879 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
105903 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
106535 Schema *pSchema = (Schema *)p;
106537 temp1 = pSchema->tblHash;
106538 temp2 = pSchema->trigHash;
106539 sqlite3HashInit(&pSchema->trigHash);
106540 sqlite3HashClear(&pSchema->idxHash);
106545 sqlite3HashInit(&pSchema->tblHash);
106551 sqlite3HashClear(&pSchema->fkeyHash);
106552 pSchema->pSeqTab = 0;
106553 if( pSchema->schemaFlags & DB_SchemaLoaded ){
106554 pSchema->iGeneration++;
106556 pSchema->schemaFlags &= ~(DB_SchemaLoaded|DB_ResetWanted);
106684 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
106898 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
106989 assert( pIdx->pSchema==pTab->pSchema );
110095 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName);
110304 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
110768 pTrigger->pSchema = pTab->pSchema;
110769 pTrigger->pTabSchema = pTab->pSchema;
110818 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
110828 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
111139 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
111140 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
111198 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
111199 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
111399 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
112540 if( pTab->pSchema->file_format<2 ) return;
112685 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
112699 assert( pIdx->pSchema==pTab->pSchema );
112980 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
115790 pDb->pSchema->cache_size = size;
115791 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
116083 returnSingleInt(v, pDb->pSchema->cache_size);
116086 pDb->pSchema->cache_size = size;
116087 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
116436 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
116635 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
116814 pTbls = &db->aDb[i].pSchema->tblHash;
117288 Schema *pSchema; /* The current schema */
117305 pSchema = db->aDb[iDb].pSchema;
117306 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
117949 assert( db->aDb[iDb].pSchema );
118018 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
118048 pDb->pSchema->enc = ENC(db);
118050 if( pDb->pSchema->cache_size==0 ){
118054 pDb->pSchema->cache_size = size;
118056 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
118058 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
118067 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
118068 if( pDb->pSchema->file_format==0 ){
118069 pDb->pSchema->file_format = 1;
118071 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
118242 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
118261 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
118275 if( pSchema ){
118278 if( db->aDb[i].pSchema==pSchema ){
120161 if( pNC->pParse && pTab->pSchema ){
120162 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
123197 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
124632 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
125003 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
125010 if( pTmpSchema!=pTab->pSchema ){
125015 if( pTrig->pTabSchema==pTab->pSchema
125098 && pTab->pSchema==db->aDb[1].pSchema ){
125137 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){
125169 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
125198 pTrigger->pSchema = db->aDb[iDb].pSchema;
125199 pTrigger->pTabSchema = pTab->pSchema;
125238 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
125277 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
125282 }else if( pLink->pSchema==pLink->pTabSchema ){
125484 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName);
125520 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
125524 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
125559 pHash = &(db->aDb[iDb].pSchema->trigHash);
125562 if( pTrigger->pSchema==pTrigger->pTabSchema ){
125645 iDb = sqlite3SchemaToIndex(db, pStep->pTrig->pSchema);
126022 assert( p->pSchema!=0 );
126024 assert( p->pSchema==p->pTabSchema
126025 || p->pSchema==pParse->db->aDb[1].pSchema );
126256 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
127212 sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
127362 pDb->pSchema = 0;
127565 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
127716 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
127797 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
127828 Schema *pSchema = pTab->pSchema;
127830 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
127831 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, pTab);
127912 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
128530 pTab->pSchema = db->aDb[0].pSchema;
137774 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
137851 assert( pIx->pSchema==pTab->pSchema );
144397 Schema *pSchema = db->aDb[i].pSchema;
144398 if( db->aDb[i].pSchema ){
144399 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
144542 pDb->pSchema = 0;
144547 if( db->aDb[1].pSchema ){
144548 sqlite3SchemaClear(db->aDb[1].pSchema);
144612 sqlite3DbFree(db, db->aDb[1].pSchema);
146370 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
146373 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);