• Home
  • Raw
  • Download

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()
59835 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
60344 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
60347 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
60577 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
60596 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
60606 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
63070 if( pBt->xFreeSchema && pBt->pSchema ){
63071 pBt->xFreeSchema(pBt->pSchema);
63073 sqlite3DbFree(0, pBt->pSchema);
70197 if( !pBt->pSchema && nBytes ){
70198 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
70202 return pBt->pSchema;
83214 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
83235 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
83299 pDb->pSchema->schema_cookie = pOp->p3;
83303 pDb->pSchema->file_format = pOp->p3;
83425 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
83426 p->minWriteFileFormat = pDb->pSchema->file_format;
87477 pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
87564 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
87568 pTab->pSchema->schema_cookie,
87569 pTab->pSchema->iGeneration);
88793 mxCache = db->aDb[0].pSchema->cache_size;
91346 Schema *pSchema = 0; /* Schema of the expression */
91377 pSchema = db->aDb[i].pSchema;
91409 if( zDb && pTab->pSchema!=pSchema ){
91448 pSchema = pExpr->pTab->pSchema;
91471 pSchema = pTab->pSchema;
91639 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
94080 pNewItem->pSchema = pOldItem->pSchema;
94972 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
98316 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
98323 if( pTab->pSchema!=pTempSchema ){
98326 if( pTrig->pSchema==pTempSchema ){
98358 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
98364 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
98434 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
98632 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
98783 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
98813 pNew->pSchema = db->aDb[iDb].pSchema;
99853 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
99948 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
100166 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
100179 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
100197 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
100704 Schema *pSchema = db->aDb[iDb].pSchema;
100711 for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){
100715 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100740 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100752 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
100912 pNew->pSchema = sqlite3SchemaGet(db, pNew->pBt);
100913 if( !pNew->pSchema ){
100915 }else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){
100995 db->aDb[iDb].pSchema = 0;
101063 pDb->pSchema = 0;
101200 pFix->pSchema = db->aDb[iDb].pSchema;
101240 pItem->pSchema = pFix->pSchema;
101487 Schema *pSchema, /* The schema of the expression */
101498 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
101795 Schema *pSchema;
101798 pSchema = db->aDb[iDb].pSchema;
101803 pSchema->schema_cookie, /* P3 */
101804 pSchema->iGeneration /* P4 */
101934 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
102016 assert( p->pSchema==0 || p->zDatabase==0 );
102017 if( p->pSchema ){
102018 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
102045 Schema *pSchema = db->aDb[j].pSchema;
102046 assert( pSchema );
102049 p = sqlite3HashFind(&pSchema->idxHash, zName);
102083 pHash = &db->aDb[iDb].pSchema->idxHash;
102151 sqlite3SchemaClear(db->aDb[i].pSchema);
102167 if( pDb->pSchema ){
102168 sqlite3SchemaClear(pDb->pSchema);
102233 assert( pIndex->pSchema==pTable->pSchema
102238 &pIndex->pSchema->idxHash, zName, 0
102240 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
102286 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, 0);
102561 pTable->pSchema = db->aDb[iDb].pSchema;
102578 pTable->pSchema->pSeqTab = pTable;
103103 db->aDb[iDb].pSchema->schema_cookie+1);
103508 iDb = sqlite3SchemaToIndex(db, p->pSchema);
103652 if( pDb->pSchema->pSeqTab==0 ){
103671 Schema *pSchema = p->pSchema;
103673 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p);
103728 iDb = sqlite3SchemaToIndex(db, p->pSchema);
103872 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
103883 pTable->pSchema->schemaFlags |= DB_UnresetViews;
103897 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
103936 pHash = &pDb->pSchema->tblHash;
103943 pHash = &pDb->pSchema->idxHash;
104017 assert( pIdx->pSchema==pTab->pSchema );
104025 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
104082 assert( pTrigger->pSchema==pTab->pSchema ||
104083 pTrigger->pSchema==db->aDb[1].pSchema );
104152 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
104335 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
104336 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
104402 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
104577 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
104592 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
104604 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
104746 pIndex->pSchema = db->aDb[iDb].pSchema;
104757 if( pDb->pSchema->file_format>=4 ){
104938 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
104939 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
105135 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
105657 assert( db->aDb[1].pSchema );
105863 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
105887 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
106519 Schema *pSchema = (Schema *)p;
106521 temp1 = pSchema->tblHash;
106522 temp2 = pSchema->trigHash;
106523 sqlite3HashInit(&pSchema->trigHash);
106524 sqlite3HashClear(&pSchema->idxHash);
106529 sqlite3HashInit(&pSchema->tblHash);
106535 sqlite3HashClear(&pSchema->fkeyHash);
106536 pSchema->pSeqTab = 0;
106537 if( pSchema->schemaFlags & DB_SchemaLoaded ){
106538 pSchema->iGeneration++;
106540 pSchema->schemaFlags &= ~(DB_SchemaLoaded|DB_ResetWanted);
106668 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
106882 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
106973 assert( pIdx->pSchema==pTab->pSchema );
110079 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName);
110288 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
110752 pTrigger->pSchema = pTab->pSchema;
110753 pTrigger->pTabSchema = pTab->pSchema;
110802 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
110812 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
111123 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
111124 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
111182 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
111183 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
111383 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
112524 if( pTab->pSchema->file_format<2 ) return;
112669 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
112683 assert( pIdx->pSchema==pTab->pSchema );
112964 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
115774 pDb->pSchema->cache_size = size;
115775 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
116067 returnSingleInt(v, pDb->pSchema->cache_size);
116070 pDb->pSchema->cache_size = size;
116071 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
116420 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
116619 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
116798 pTbls = &db->aDb[i].pSchema->tblHash;
117272 Schema *pSchema; /* The current schema */
117289 pSchema = db->aDb[iDb].pSchema;
117290 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
117933 assert( db->aDb[iDb].pSchema );
118002 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
118032 pDb->pSchema->enc = ENC(db);
118034 if( pDb->pSchema->cache_size==0 ){
118038 pDb->pSchema->cache_size = size;
118040 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
118042 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
118051 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
118052 if( pDb->pSchema->file_format==0 ){
118053 pDb->pSchema->file_format = 1;
118055 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
118226 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
118245 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
118259 if( pSchema ){
118262 if( db->aDb[i].pSchema==pSchema ){
120145 if( pNC->pParse && pTab->pSchema ){
120146 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
123181 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
124616 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
124987 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
124994 if( pTmpSchema!=pTab->pSchema ){
124999 if( pTrig->pTabSchema==pTab->pSchema
125082 && pTab->pSchema==db->aDb[1].pSchema ){
125121 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){
125153 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
125182 pTrigger->pSchema = db->aDb[iDb].pSchema;
125183 pTrigger->pTabSchema = pTab->pSchema;
125222 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
125261 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
125266 }else if( pLink->pSchema==pLink->pTabSchema ){
125468 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName);
125504 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
125508 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
125543 pHash = &(db->aDb[iDb].pSchema->trigHash);
125546 if( pTrigger->pSchema==pTrigger->pTabSchema ){
125629 iDb = sqlite3SchemaToIndex(db, pStep->pTrig->pSchema);
126006 assert( p->pSchema!=0 );
126008 assert( p->pSchema==p->pTabSchema
126009 || p->pSchema==pParse->db->aDb[1].pSchema );
126240 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
127196 sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
127346 pDb->pSchema = 0;
127549 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
127700 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
127781 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
127812 Schema *pSchema = pTab->pSchema;
127814 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
127815 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, pTab);
127896 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
128514 pTab->pSchema = db->aDb[0].pSchema;
137758 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
137835 assert( pIx->pSchema==pTab->pSchema );
144381 Schema *pSchema = db->aDb[i].pSchema;
144382 if( db->aDb[i].pSchema ){
144383 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
144526 pDb->pSchema = 0;
144531 if( db->aDb[1].pSchema ){
144532 sqlite3SchemaClear(db->aDb[1].pSchema);
144596 sqlite3DbFree(db, db->aDb[1].pSchema);
146354 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
146357 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);