Lines Matching refs:pSchema
9313 Schema *pSchema; /* Pointer to database schema (possibly shared) */ member
9351 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))==(P))
9352 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))!=0)
9353 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->flags|=(P)
9354 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->flags&=~(P)
9559 #define ENC(db) ((db)->aDb[0].pSchema->enc)
9946 Schema *pSchema; /* Schema that contains this table */ member
10134 Schema *pSchema; /* Schema containing this index */ member
10966 Schema *pSchema; /* Schema containing the trigger */ member
13147 Schema *pSchema = db->aDb[i].pSchema; in sqlite3_db_status() local
13148 if( ALWAYS(pSchema!=0) ){ in sqlite3_db_status()
13152 pSchema->tblHash.count in sqlite3_db_status()
13153 + pSchema->trigHash.count in sqlite3_db_status()
13154 + pSchema->idxHash.count in sqlite3_db_status()
13155 + pSchema->fkeyHash.count in sqlite3_db_status()
13157 nByte += sqlite3MallocSize(pSchema->tblHash.ht); in sqlite3_db_status()
13158 nByte += sqlite3MallocSize(pSchema->trigHash.ht); in sqlite3_db_status()
13159 nByte += sqlite3MallocSize(pSchema->idxHash.ht); in sqlite3_db_status()
13160 nByte += sqlite3MallocSize(pSchema->fkeyHash.ht); in sqlite3_db_status()
13162 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
13165 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){ in sqlite3_db_status()
47769 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
48220 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
48223 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
48386 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
48405 if( isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0) ){
48415 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
50317 if( pBt->xFreeSchema && pBt->pSchema ){
50318 pBt->xFreeSchema(pBt->pSchema);
50320 sqlite3DbFree(0, pBt->pSchema);
56300 if( !pBt->pSchema && nBytes ){
56301 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
56305 return pBt->pSchema;
66506 u.au.pDb->pSchema->schema_cookie = (int)pIn3->u.i;
66510 u.au.pDb->pSchema->file_format = (u8)pIn3->u.i;
66552 u.av.iGen = db->aDb[pOp->p1].pSchema->iGeneration;
66572 if( db->aDb[pOp->p1].pSchema->schema_cookie!=u.av.iMeta ){
66661 if( u.aw.pDb->pSchema->file_format < p->minWriteFileFormat ){
66662 p->minWriteFileFormat = u.aw.pDb->pSchema->file_format;
70064 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
70075 sqlite3VdbeChangeP2(v, 1, pTab->pSchema->schema_cookie);
70076 sqlite3VdbeChangeP3(v, 1, pTab->pSchema->iGeneration);
70682 mxCache = db->aDb[0].pSchema->cache_size;
71943 Schema *pSchema = 0; /* Schema of the expression */
71968 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
71987 pSchema = pTab->pSchema;
71997 pSchema = pTab->pSchema;
72044 pSchema = pTab->pSchema;
72190 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
74472 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77078 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
77085 if( pTab->pSchema!=pTempSchema ){
77088 if( pTrig->pSchema==pTempSchema ){
77120 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
77126 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
77196 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
77417 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
77557 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77589 pNew->pSchema = db->aDb[iDb].pSchema;
77755 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77782 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
77989 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
78000 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
78018 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
78217 for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
78475 aNew->pSchema = sqlite3SchemaGet(db, aNew->pBt);
78476 if( !aNew->pSchema ){
78478 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
78543 db->aDb[iDb].pSchema = 0;
78616 pDb->pSchema = 0;
79022 Schema *pSchema, /* The schema of the expression */
79033 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
79298 db->aDb[iDb].pSchema->iGeneration);
79415 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
79478 Schema *pSchema = db->aDb[j].pSchema;
79479 assert( pSchema );
79482 p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
79511 pHash = &db->aDb[iDb].pSchema->idxHash;
79551 assert( pDb->pSchema!=0 );
79552 sqlite3SchemaClear(pDb->pSchema);
79560 assert( pDb->pSchema!=0 );
79561 sqlite3SchemaClear(pDb->pSchema);
79571 if( pDb->pSchema ){
79572 sqlite3SchemaClear(pDb->pSchema);
79654 assert( pIndex->pSchema==pTable->pSchema );
79658 &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0
79660 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
79698 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName,
79971 pTable->pSchema = db->aDb[iDb].pSchema;
79984 pTable->pSchema->pSeqTab = pTable;
80445 sqlite3VdbeAddOp2(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, r1);
80609 iDb = sqlite3SchemaToIndex(db, p->pSchema);
80748 if( pDb->pSchema->pSeqTab==0 ){
80767 Schema *pSchema = p->pSchema;
80769 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName,
80829 iDb = sqlite3SchemaToIndex(db, p->pSchema);
80953 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
80954 pTable->pSchema->flags |= DB_UnresetViews;
80976 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
81015 pHash = &pDb->pSchema->tblHash;
81022 pHash = &pDb->pSchema->idxHash;
81069 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
81103 assert( pIdx->pSchema==pTab->pSchema );
81111 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
81166 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
81251 assert( pTrigger->pSchema==pTab->pSchema ||
81252 pTrigger->pSchema==db->aDb[1].pSchema );
81405 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
81406 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
81472 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
81638 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
81654 assert( db->aDb[iDb].pSchema==pTab->pSchema );
81659 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
81799 pIndex->pSchema = db->aDb[iDb].pSchema;
81804 if( pDb->pSchema->file_format>=4 ){
81930 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
81931 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
82117 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
82634 assert( db->aDb[1].pSchema );
82684 pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
82802 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
82826 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
83351 Schema *pSchema = (Schema *)p;
83353 temp1 = pSchema->tblHash;
83354 temp2 = pSchema->trigHash;
83355 sqlite3HashInit(&pSchema->trigHash);
83356 sqlite3HashClear(&pSchema->idxHash);
83361 sqlite3HashInit(&pSchema->tblHash);
83367 sqlite3HashClear(&pSchema->fkeyHash);
83368 pSchema->pSeqTab = 0;
83369 if( pSchema->flags & DB_SchemaLoaded ){
83370 pSchema->iGeneration++;
83371 pSchema->flags &= ~DB_SchemaLoaded;
83685 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
83756 assert( pIdx->pSchema==pTab->pSchema );
86255 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName, nName);
86373 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
86801 pTrigger->pSchema = pTab->pSchema;
86802 pTrigger->pTabSchema = pTab->pSchema;
86846 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
86856 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p);
87120 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
87121 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
87171 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
87172 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
87374 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
88376 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
88382 assert( pIdx->pSchema==pTab->pSchema );
88642 iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
90353 pDb->pSchema->cache_size = size;
90354 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
90657 returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size);
90660 pDb->pSchema->cache_size = size;
90661 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
91077 pTbls = &db->aDb[i].pSchema->tblHash;
91661 assert( db->aDb[iDb].pSchema );
91738 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
91765 pDb->pSchema->enc = ENC(db);
91767 if( pDb->pSchema->cache_size==0 ){
91770 pDb->pSchema->cache_size = size;
91771 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
91780 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
91781 if( pDb->pSchema->file_format==0 ){
91782 pDb->pSchema->file_format = 1;
91784 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
91961 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
91980 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
91994 if( pSchema ){
91996 if( db->aDb[i].pSchema==pSchema ){
93422 }else if( ALWAYS(pTab->pSchema) ){
93436 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
96690 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
97182 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
97189 if( pTmpSchema!=pTab->pSchema ){
97194 if( pTrig->pTabSchema==pTab->pSchema
97278 && pTab->pSchema==db->aDb[1].pSchema ){
97317 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),
97348 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
97380 pTrigger->pSchema = db->aDb[iDb].pSchema;
97381 pTrigger->pTabSchema = pTab->pSchema;
97420 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
97457 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
97462 }else if( pLink->pSchema==pLink->pTabSchema ){
97645 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
97682 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
97686 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
97739 pHash = &(db->aDb[iDb].pSchema->trigHash);
97742 if( pTrigger->pSchema==pTrigger->pTabSchema ){
97824 iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema);
98188 assert( p->pSchema!=0 );
98190 assert( p->pSchema==p->pTabSchema
98191 || p->pSchema==pParse->db->aDb[1].pSchema );
98403 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
99265 pDb->pSchema = 0;
99439 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
99570 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
99646 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
99675 Schema *pSchema = pTab->pSchema;
99678 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
99679 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab);
105287 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
105324 assert( pIx->pSchema==pTab->pSchema );
110889 pDb->pSchema = 0;
110950 sqlite3DbFree(db, db->aDb[1].pSchema);
112339 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
112340 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);