Lines Matching refs:pSchema
8813 Schema *pSchema; /* Pointer to database schema (possibly shared) */
8834 ** Db.pSchema->flags field.
8836 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))==(P))
8837 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->flags&(P))!=0)
8838 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->flags|=(P)
8839 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->flags&=~(P)
8842 ** Allowed values for the DB.pSchema->flags field.
9041 #define ENC(db) ((db)->aDb[0].pSchema->enc)
9422 Trigger *pTrigger; /* List of triggers stored in pSchema */
9423 Schema *pSchema; /* Schema that contains this table */
9610 Schema *pSchema; /* Schema containing this index */
10426 Schema *pSchema; /* Schema containing the trigger */
12552 Schema *pSchema = db->aDb[i].pSchema;
12553 if( ALWAYS(pSchema!=0) ){
12557 pSchema->tblHash.count
12558 + pSchema->trigHash.count
12559 + pSchema->idxHash.count
12560 + pSchema->fkeyHash.count
12562 nByte += sqlite3MallocSize(pSchema->tblHash.ht);
12563 nByte += sqlite3MallocSize(pSchema->trigHash.ht);
12564 nByte += sqlite3MallocSize(pSchema->idxHash.ht);
12565 nByte += sqlite3MallocSize(pSchema->fkeyHash.ht);
12567 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
12570 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
44758 ** The pSchema field may be set once under BtShared.mutex and
44803 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
44804 void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
45491 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
45510 if( isIndex && (!pSchema || (pSchema->flags&DB_SchemaLoaded)==0) ){
45520 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
47416 if( pBt->xFreeSchema && pBt->pSchema ){
47417 pBt->xFreeSchema(pBt->pSchema);
47419 sqlite3DbFree(0, pBt->pSchema);
53359 if( !pBt->pSchema && nBytes ){
53360 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
53364 return pBt->pSchema;
63313 u.au.pDb->pSchema->schema_cookie = (int)pIn3->u.i;
63317 u.au.pDb->pSchema->file_format = (u8)pIn3->u.i;
63373 if( db->aDb[pOp->p1].pSchema->schema_cookie!=u.av.iMeta ){
63461 if( u.aw.pDb->pSchema->file_format < p->minWriteFileFormat ){
63462 p->minWriteFileFormat = u.aw.pDb->pSchema->file_format;
66756 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
66767 sqlite3VdbeChangeP2(v, 1, pTab->pSchema->schema_cookie);
67744 Schema *pSchema = 0; /* Schema of the expression */
67769 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
67788 pSchema = pTab->pSchema;
67798 pSchema = pTab->pSchema;
67845 pSchema = pTab->pSchema;
67991 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
70260 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
72863 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
72870 if( pTab->pSchema!=pTempSchema ){
72873 if( pTrig->pSchema==pTempSchema ){
72905 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
72911 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
72965 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
73189 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
73326 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
73358 pNew->pSchema = db->aDb[iDb].pSchema;
73522 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
73545 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
73744 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
73754 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
73771 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
73959 for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
74200 aNew->pSchema = sqlite3SchemaGet(db, aNew->pBt);
74201 if( !aNew->pSchema ){
74203 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
74266 db->aDb[iDb].pSchema = 0;
74339 pDb->pSchema = 0;
74743 Schema *pSchema, /* The schema of the expression */
74754 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
75132 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
75193 Schema *pSchema = db->aDb[j].pSchema;
75194 assert( pSchema );
75196 p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
75222 Hash *pHash = &db->aDb[iDb].pSchema->idxHash;
75264 if( pDb->pSchema ){
75266 sqlite3SchemaFree(pDb->pSchema);
75350 assert( pIndex->pSchema==pTable->pSchema );
75354 &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0
75392 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName,
75662 pTable->pSchema = db->aDb[iDb].pSchema;
75674 pTable->pSchema->pSeqTab = pTable;
76134 sqlite3VdbeAddOp2(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, r1);
76298 iDb = sqlite3SchemaToIndex(db, p->pSchema);
76436 if( pDb->pSchema->pSeqTab==0 ){
76455 Schema *pSchema = p->pSchema;
76456 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName,
76516 iDb = sqlite3SchemaToIndex(db, p->pSchema);
76640 pTable->pSchema->flags |= DB_UnresetViews;
76661 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
76697 pHash = &pDb->pSchema->tblHash;
76704 pHash = &pDb->pSchema->idxHash;
76751 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
76785 assert( pIdx->pSchema==pTab->pSchema );
76793 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
76824 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
76909 assert( pTrigger->pSchema==pTab->pSchema ||
76910 pTrigger->pSchema==db->aDb[1].pSchema );
77070 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
77134 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
77266 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
77282 assert( db->aDb[iDb].pSchema==pTab->pSchema );
77287 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
77424 pIndex->pSchema = db->aDb[iDb].pSchema;
77428 if( pDb->pSchema->file_format>=4 ){
77554 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
77739 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
78261 assert( db->aDb[1].pSchema );
78310 pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
78413 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
78436 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
78961 Schema *pSchema = (Schema *)p;
78963 temp1 = pSchema->tblHash;
78964 temp2 = pSchema->trigHash;
78965 sqlite3HashInit(&pSchema->trigHash);
78966 sqlite3HashClear(&pSchema->idxHash);
78971 sqlite3HashInit(&pSchema->tblHash);
78977 sqlite3HashClear(&pSchema->fkeyHash);
78978 pSchema->pSeqTab = 0;
78979 pSchema->flags &= ~DB_SchemaLoaded;
79283 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
79354 assert( pIdx->pSchema==pTab->pSchema );
81819 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName, nName);
81939 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
82350 pTrigger->pSchema = pTab->pSchema;
82351 pTrigger->pTabSchema = pTab->pSchema;
82404 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p);
82668 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
82718 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
82921 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
83923 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
83929 assert( pIdx->pSchema==pTab->pSchema );
84177 iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
85868 pDb->pSchema->cache_size = size;
85869 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
86171 returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size);
86175 pDb->pSchema->cache_size = size;
86176 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
86591 pTbls = &db->aDb[i].pSchema->tblHash;
87159 assert( db->aDb[iDb].pSchema );
87236 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
87263 pDb->pSchema->enc = ENC(db);
87265 if( pDb->pSchema->cache_size==0 ){
87269 pDb->pSchema->cache_size = size;
87270 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
87279 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
87280 if( pDb->pSchema->file_format==0 ){
87281 pDb->pSchema->file_format = 1;
87283 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
87459 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
87477 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
87480 /* If pSchema is NULL, then return -1000000. This happens when code in
87491 if( pSchema ){
87493 if( db->aDb[i].pSchema==pSchema ){
88895 }else if( ALWAYS(pTab->pSchema) ){
88909 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
92035 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
92522 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
92529 if( pTmpSchema!=pTab->pSchema ){
92533 if( pTrig->pTabSchema==pTab->pSchema
92604 && pTab->pSchema==db->aDb[1].pSchema ){
92642 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),
92670 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
92702 pTrigger->pSchema = db->aDb[iDb].pSchema;
92703 pTrigger->pTabSchema = pTab->pSchema;
92743 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
92781 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
92785 }else if( pLink->pSchema==pLink->pTabSchema ){
92966 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
93001 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
93005 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
93054 Hash *pHash = &(db->aDb[iDb].pSchema->trigHash);
93058 if( pTrigger->pSchema==pTrigger->pTabSchema ){
93136 iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema);
93500 assert( p->pSchema!=0 );
93502 assert( p->pSchema==p->pTabSchema
93503 || p->pSchema==pParse->db->aDb[1].pSchema );
93715 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
94574 pDb->pSchema = 0;
94733 sqlite3BtreeHoldsMutex(db->aDb[sqlite3SchemaToIndex(db, p->pSchema)].pBt)
94865 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
94941 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
94970 Schema *pSchema = pTab->pSchema;
94973 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab);
99959 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
99996 assert( pIx->pSchema==pTab->pSchema );
105514 pDb->pSchema = 0;
105575 sqlite3DbFree(db, db->aDb[1].pSchema);
106691 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
106692 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);