Home | History | Annotate | Download | only in orig

Lines Matching defs:pSchema

10323   Schema *pSchema;     /* Pointer to database schema (possibly shared) */
10359 ** Db.pSchema->flags field.
10361 #define DbHasProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))==(P))
10362 #define DbHasAnyProperty(D,I,P) (((D)->aDb[I].pSchema->schemaFlags&(P))!=0)
10363 #define DbSetProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags|=(P)
10364 #define DbClearProperty(D,I,P) (D)->aDb[I].pSchema->schemaFlags&=~(P)
10367 ** Allowed values for the DB.pSchema->flags field.
10547 #define ENC(db) ((db)->aDb[0].pSchema->enc)
10967 Trigger *pTrigger; /* List of triggers stored in pSchema */
10968 Schema *pSchema; /* Schema that contains this table */
11164 Schema *pSchema; /* Schema containing this index */
11564 Schema *pSchema; /* Schema to which this item is fixed */
12065 Schema *pSchema; /* Schema containing the trigger */
12140 Schema *pSchema; /* Fix items to this schema */
14499 Schema *pSchema = db->aDb[i].pSchema;
14500 if( ALWAYS(pSchema!=0) ){
14504 pSchema->tblHash.count
14505 + pSchema->trigHash.count
14506 + pSchema->idxHash.count
14507 + pSchema->fkeyHash.count
14509 nByte += sqlite3MallocSize(pSchema->tblHash.ht);
14510 nByte += sqlite3MallocSize(pSchema->trigHash.ht);
14511 nByte += sqlite3MallocSize(pSchema->idxHash.ht);
14512 nByte += sqlite3MallocSize(pSchema->fkeyHash.ht);
14514 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
14517 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
50980 ** The pSchema field may be set once under BtShared.mutex and
51023 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
51024 void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
51491 ** db->aDb[iDb].pSchema structure. The mutexes required for schema
51497 ** If pSchema is not NULL, then iDb is computed from pSchema and
51500 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
51503 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
51685 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
51704 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
51714 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
53666 if( pBt->xFreeSchema && pBt->pSchema ){
53667 pBt->xFreeSchema(pBt->pSchema);
53669 sqlite3DbFree(0, pBt->pSchema);
59906 if( !pBt->pSchema && nBytes ){
59907 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
59911 return pBt->pSchema;
71089 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
71110 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
71174 pDb->pSchema->schema_cookie = (int)pIn3->u.i;
71178 pDb->pSchema->file_format = (u8)pIn3->u.i;
71301 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
71302 p->minWriteFileFormat = pDb->pSchema->file_format;
74790 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
74794 pTab->pSchema->schema_cookie,
74795 pTab->pSchema->iGeneration);
75484 mxCache = db->aDb[0].pSchema->cache_size;
76995 Schema *pSchema = 0; /* Schema of the expression */
77010 ** schema. If not found, pSchema will remain NULL and nothing will match
77025 pSchema = db->aDb[i].pSchema;
77056 if( zDb && pTab->pSchema!=pSchema ){
77090 pSchema = pExpr->pTab->pSchema;
77113 pSchema = pTab->pSchema;
77272 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
79226 pNewItem->pSchema = pOldItem->pSchema;
79843 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
82882 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
82889 if( pTab->pSchema!=pTempSchema ){
82892 if( pTrig->pSchema==pTempSchema ){
82924 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
82930 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
83000 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
83222 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
83362 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
83394 pNew->pSchema = db->aDb[iDb].pSchema;
84404 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
84487 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
84698 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
84711 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
84729 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
85218 for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
85409 aNew->pSchema = sqlite3SchemaGet(db, aNew->pBt);
85410 if( !aNew->pSchema ){
85412 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
85480 db->aDb[iDb].pSchema = 0;
85553 pDb->pSchema = 0;
85694 pFix->pSchema = db->aDb[iDb].pSchema;
85734 pItem->pSchema = pFix->pSchema;
85977 Schema *pSchema, /* The schema of the expression */
85988 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
86270 db->aDb[iDb].pSchema->iGeneration /* P4 */
86389 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
86437 ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
86447 assert( p->pSchema==0 || p->zDatabase==0 );
86448 if( p->pSchema ){
86449 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
86477 Schema *pSchema = db->aDb[j].pSchema;
86478 assert( pSchema );
86481 p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
86513 pHash = &db->aDb[iDb].pSchema->idxHash;
86576 assert( pDb->pSchema!=0 );
86577 sqlite3SchemaClear(pDb->pSchema);
86585 assert( pDb->pSchema!=0 );
86586 sqlite3SchemaClear(pDb->pSchema);
86600 if( pDb->pSchema ){
86601 sqlite3SchemaClear(pDb->pSchema);
86671 assert( pIndex->pSchema==pTable->pSchema );
86675 &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0
86677 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
86718 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName,
87011 pTable->pSchema = db->aDb[iDb].pSchema;
87024 pTable->pSchema->pSeqTab = pTable;
87521 sqlite3VdbeAddOp2(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, r1);
87897 iDb = sqlite3SchemaToIndex(db, p->pSchema);
88020 if( pDb->pSchema->pSeqTab==0 ){
88039 Schema *pSchema = p->pSchema;
88041 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName,
88100 iDb = sqlite3SchemaToIndex(db, p->pSchema);
88223 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
88224 pTable->pSchema->schemaFlags |= DB_UnresetViews;
88246 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
88285 pHash = &pDb->pSchema->tblHash;
88292 pHash = &pDb->pSchema->idxHash;
88339 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
88373 assert( pIdx->pSchema==pTab->pSchema );
88381 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
88439 assert( pTrigger->pSchema==pTab->pSchema ||
88440 pTrigger->pSchema==db->aDb[1].pSchema );
88507 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
88690 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
88691 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
88757 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
88934 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
88949 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
88961 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
89088 pIndex->pSchema = db->aDb[iDb].pSchema;
89099 if( pDb->pSchema->file_format>=4 ){
89238 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
89239 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
89427 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
89933 assert( db->aDb[1].pSchema );
89958 pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
90136 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
90160 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
90785 Schema *pSchema = (Schema *)p;
90787 temp1 = pSchema->tblHash;
90788 temp2 = pSchema->trigHash;
90789 sqlite3HashInit(&pSchema->trigHash);
90790 sqlite3HashClear(&pSchema->idxHash);
90795 sqlite3HashInit(&pSchema->tblHash);
90801 sqlite3HashClear(&pSchema->fkeyHash);
90802 pSchema->pSeqTab = 0;
90803 if( pSchema->schemaFlags & DB_SchemaLoaded ){
90804 pSchema->iGeneration++;
90805 pSchema->schemaFlags &= ~DB_SchemaLoaded;
90931 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
91129 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
91204 assert( pIdx->pSchema==pTab->pSchema );
94083 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName, nName);
94274 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
94702 pTrigger->pSchema = pTab->pSchema;
94703 pTrigger->pTabSchema = pTab->pSchema;
94751 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
94761 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p);
95044 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
95045 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
95096 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
95097 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
95294 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
96423 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
96437 assert( pIdx->pSchema==pTab->pSchema );
96712 iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
99056 pDb->pSchema->cache_size = size;
99057 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
99351 returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size);
99354 pDb->pSchema->cache_size = size;
99355 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
99686 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
99867 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
100054 pTbls = &db->aDb[i].pSchema->tblHash;
100738 assert( db->aDb[iDb].pSchema );
100815 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
100845 pDb->pSchema->enc = ENC(db);
100847 if( pDb->pSchema->cache_size==0 ){
100851 pDb->pSchema->cache_size = size;
100853 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
100855 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
100864 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
100865 if( pDb->pSchema->file_format==0 ){
100866 pDb->pSchema->file_format = 1;
100868 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
101045 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
101064 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
101067 /* If pSchema is NULL, then return -1000000. This happens when code in
101078 if( pSchema ){
101080 if( db->aDb[i].pSchema==pSchema ){
102791 }else if( pTab->pSchema ){
102807 pSchema);
105565 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
106606 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
107106 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
107113 if( pTmpSchema!=pTab->pSchema ){
107118 if( pTrig->pTabSchema==pTab->pSchema
107202 && pTab->pSchema==db->aDb[1].pSchema ){
107241 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),
107272 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
107304 pTrigger->pSchema = db->aDb[iDb].pSchema;
107305 pTrigger->pTabSchema = pTab->pSchema;
107344 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
107383 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
107388 }else if( pLink->pSchema==pLink->pTabSchema ){
107567 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
107604 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
107608 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
107662 pHash = &(db->aDb[iDb].pSchema->trigHash);
107665 if( pTrigger->pSchema==pTrigger->pTabSchema ){
107747 iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema);
108113 assert( p->pSchema!=0 );
108115 assert( p->pSchema==p->pTabSchema
108116 || p->pSchema==pParse->db->aDb[1].pSchema );
108339 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
109318 pDb->pSchema = 0;
109494 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
109651 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
109727 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
109756 Schema *pSchema = pTab->pSchema;
109759 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
109760 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab);
109828 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
117153 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
117219 assert( pIx->pSchema==pTab->pSchema );
122956 Schema *pSchema = db->aDb[i].pSchema;
122957 if( db->aDb[i].pSchema ){
122959 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
123093 pDb->pSchema = 0;
123098 if( db->aDb[1].pSchema ){
123099 sqlite3SchemaClear(db->aDb[1].pSchema);
123159 sqlite3DbFree(db, db->aDb[1].pSchema);
124136 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
124722 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
124723 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);