Lines Matching refs:pSchema

16127   Schema *pSchema;     /* Pointer to database schema (possibly shared) */  member
16165 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))==(P))
16166 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))!=0)
16167 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags|=(P)
16168 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags&=~(P)
16430 #define SCHEMA_ENC(db) ((db)->aDb[0].pSchema->enc)
16911 Schema *pSchema; /* Schema that contains this table */ member
17161 Schema *pSchema; /* Schema containing this index */ member
17580 Schema *pSchema; /* Schema to which this item is fixed */ member
18188 Schema *pSchema; /* Schema containing the trigger */ member
18265 Schema *pSchema; /* Fix items to this schema */ member
20816 Schema *pSchema = db->aDb[i].pSchema; in sqlite3_db_status() local
20817 if( ALWAYS(pSchema!=0) ){ in sqlite3_db_status()
20821 pSchema->tblHash.count in sqlite3_db_status()
20822 + pSchema->trigHash.count in sqlite3_db_status()
20823 + pSchema->idxHash.count in sqlite3_db_status()
20824 + pSchema->fkeyHash.count in sqlite3_db_status()
20826 nByte += sqlite3_msize(pSchema->tblHash.ht); in sqlite3_db_status()
20827 nByte += sqlite3_msize(pSchema->trigHash.ht); in sqlite3_db_status()
20828 nByte += sqlite3_msize(pSchema->idxHash.ht); in sqlite3_db_status()
20829 nByte += sqlite3_msize(pSchema->fkeyHash.ht); in sqlite3_db_status()
20831 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
20834 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
62613 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
63129 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
63132 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
63362 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
63381 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
63391 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
65920 if( pBt->xFreeSchema && pBt->pSchema ){
65921 pBt->xFreeSchema(pBt->pSchema);
65923 sqlite3DbFree(0, pBt->pSchema);
73428 if( !pBt->pSchema && nBytes ){
73429 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
73433 return pBt->pSchema;
86888 || db->aDb[pOp->p1].pSchema->iGeneration!=pOp->p4.i)
86910 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
86976 pDb->pSchema->schema_cookie = pOp->p3;
86980 pDb->pSchema->file_format = pOp->p3;
87121 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
87122 p->minWriteFileFormat = pDb->pSchema->file_format;
89348 sqlite3SchemaClear(db->aDb[iDb].pSchema);
91397 pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
91484 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
91488 pTab->pSchema->schema_cookie,
91489 pTab->pSchema->iGeneration);
92713 mxCache = db->aDb[0].pSchema->cache_size;
95307 Schema *pSchema = 0; /* Schema of the expression */
95337 pSchema = db->aDb[i].pSchema;
95369 if( zDb && pTab->pSchema!=pSchema ){
95411 pSchema = pExpr->y.pTab->pSchema;
95447 pSchema = pTab->pSchema;
95667 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
98348 pNewItem->pSchema = pOldItem->pSchema;
99301 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
102463 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
102632 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
102785 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
102815 pNew->pSchema = db->aDb[iDb].pSchema;
102886 iSchema = sqlite3SchemaToIndex(db, pTab->pSchema);
103864 && sCtx.pTab->pSchema==pTrigger->pTabSchema
105018 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
105113 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
105328 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
105341 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
105359 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
105866 Schema *pSchema = db->aDb[iDb].pSchema;
105873 for(i=sqliteHashFirst(&pSchema->tblHash); i; i=sqliteHashNext(i)){
105877 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
105902 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
105914 for(i=sqliteHashFirst(&pSchema->idxHash); i; i=sqliteHashNext(i)){
106033 pNew->pSchema = 0;
106098 pNew->pSchema = sqlite3SchemaGet(db, pNew->pBt);
106099 if( !pNew->pSchema ){
106101 }else if( pNew->pSchema->file_format && pNew->pSchema->enc!=ENC(db) ){
106190 db->aDb[iDb].pSchema = 0;
106259 pDb->pSchema = 0;
106398 pFix->pSchema = db->aDb[iDb].pSchema;
106438 pItem->pSchema = pFix->pSchema;
106708 Schema *pSchema, /* The schema of the expression */
106721 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
107018 Schema *pSchema;
107021 pSchema = db->aDb[iDb].pSchema;
107026 pSchema->schema_cookie, /* P3 */
107027 pSchema->iGeneration /* P4 */
107161 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName);
107250 assert( p->pSchema==0 || p->zDatabase==0 );
107251 if( p->pSchema ){
107252 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
107279 Schema *pSchema = db->aDb[j].pSchema;
107280 assert( pSchema );
107283 p = sqlite3HashFind(&pSchema->idxHash, zName);
107317 pHash = &db->aDb[iDb].pSchema->idxHash;
107386 sqlite3SchemaClear(db->aDb[i].pSchema);
107401 if( pDb->pSchema ){
107403 sqlite3SchemaClear(pDb->pSchema);
107473 assert( pIndex->pSchema==pTable->pSchema
107478 &pIndex->pSchema->idxHash, zName, 0
107480 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
107526 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, 0);
107818 pTable->pSchema = db->aDb[iDb].pSchema;
107835 pTable->pSchema->pSeqTab = pTable;
108392 (int)(1+(unsigned)db->aDb[iDb].pSchema->schema_cookie));
108861 iDb = sqlite3SchemaToIndex(db, p->pSchema);
109005 if( pDb->pSchema->pSeqTab==0 ){
109024 Schema *pSchema = p->pSchema;
109026 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, p);
109081 iDb = sqlite3SchemaToIndex(db, p->pSchema);
109237 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
109251 pTable->pSchema->schemaFlags |= DB_UnresetViews;
109270 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
109309 pHash = &pDb->pSchema->tblHash;
109316 pHash = &pDb->pSchema->idxHash;
109390 assert( pIdx->pSchema==pTab->pSchema );
109398 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
109455 assert( pTrigger->pSchema==pTab->pSchema ||
109456 pTrigger->pSchema==db->aDb[1].pSchema );
109526 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
109720 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
109721 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
109787 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
109964 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
109979 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
109991 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
110143 pIndex->pSchema = db->aDb[iDb].pSchema;
110154 if( pDb->pSchema->file_format>=4 ){
110344 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
110353 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
110552 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
111108 assert( db->aDb[1].pSchema );
111316 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
111341 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
111975 Schema *pSchema = (Schema *)p;
111977 temp1 = pSchema->tblHash;
111978 temp2 = pSchema->trigHash;
111979 sqlite3HashInit(&pSchema->trigHash);
111980 sqlite3HashClear(&pSchema->idxHash);
111985 sqlite3HashInit(&pSchema->tblHash);
111991 sqlite3HashClear(&pSchema->fkeyHash);
111992 pSchema->pSeqTab = 0;
111993 if( pSchema->schemaFlags & DB_SchemaLoaded ){
111994 pSchema->iGeneration++;
111996 pSchema->schemaFlags &= ~(DB_SchemaLoaded|DB_ResetWanted);
112141 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
112355 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
112449 assert( pIdx->pSchema==pTab->pSchema );
115693 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName);
115904 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
116368 pTrigger->pSchema = pTab->pSchema;
116369 pTrigger->pTabSchema = pTab->pSchema;
116418 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
116428 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, p);
116683 assert( pParse->db->aDb[iDb].pSchema!=0 );
116689 Table *pSeqTab = pParse->db->aDb[iDb].pSchema->pSeqTab;
116758 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
116759 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
116821 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
116824 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
117025 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
118317 if( pTab->pSchema->file_format<2 ) return;
118464 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
118478 assert( pIdx->pSchema==pTab->pSchema );
118669 if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
118731 if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema
118767 iDbSrc = sqlite3SchemaToIndex(db, pSrc->pSchema);
121672 pDb->pSchema->cache_size = size;
121673 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
121965 returnSingleInt(v, pDb->pSchema->cache_size);
121968 pDb->pSchema->cache_size = size;
121969 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
122280 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
122321 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
122347 int iIdxDb = sqlite3SchemaToIndex(db, pIdx->pSchema);
122384 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
122475 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
122523 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
122534 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
122692 pTbls = &db->aDb[i].pSchema->tblHash;
123165 Schema *pSchema; /* The current schema */
123182 pSchema = db->aDb[iDb].pSchema;
123183 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
123858 assert( db->aDb[iDb].pSchema );
123932 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
123962 pDb->pSchema->enc = ENC(db);
123964 if( pDb->pSchema->cache_size==0 ){
123968 pDb->pSchema->cache_size = size;
123970 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
123972 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
123981 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
123982 if( pDb->pSchema->file_format==0 ){
123983 pDb->pSchema->file_format = 1;
123985 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
124159 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
124178 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
124192 if( pSchema ){
124195 if( db->aDb[i].pSchema==pSchema ){
126069 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
126342 if( pNC->pParse && pTab->pSchema ){
126343 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
129613 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
131100 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
131494 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
131501 if( pTmpSchema!=pTab->pSchema ){
131506 if( pTrig->pTabSchema==pTab->pSchema
131589 && pTab->pSchema==db->aDb[1].pSchema ){
131629 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),zName) ){
131662 int iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
131691 pTrigger->pSchema = db->aDb[iDb].pSchema;
131692 pTrigger->pTabSchema = pTab->pSchema;
131738 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
131785 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
131790 }else if( pLink->pSchema==pLink->pTabSchema ){
132021 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName);
132057 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
132061 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
132096 pHash = &(db->aDb[iDb].pSchema->trigHash);
132099 if( pTrigger->pSchema==pTrigger->pTabSchema ){
132182 iDb = sqlite3SchemaToIndex(db, pStep->pTrig->pSchema);
132561 assert( p->pSchema!=0 );
132563 assert( p->pSchema==p->pTabSchema
132564 || p->pSchema==pParse->db->aDb[1].pSchema );
132847 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
134128 sqlite3BtreeSetCacheSize(pTemp, db->aDb[iDb].pSchema->cache_size);
134284 pDb->pSchema = 0;
134487 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
134660 int iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
134722 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
134753 Schema *pSchema = pTab->pSchema;
134755 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
134756 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, pTab);
134837 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
135461 pTab->pSchema = db->aDb[0].pSchema;
144996 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
145073 assert( pIx->pSchema==pTab->pSchema );
155667 Schema *pSchema = db->aDb[i].pSchema;
155668 if( pSchema ){
155669 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
155812 pDb->pSchema = 0;
155817 if( db->aDb[1].pSchema ){
155818 sqlite3SchemaClear(db->aDb[1].pSchema);
155882 sqlite3DbFree(db, db->aDb[1].pSchema);
157798 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
157801 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);