Home | History | Annotate | Download | only in dist

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)){
51000 ** The pSchema field may be set once under BtShared.mutex and
51043 void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */
51044 void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */
51511 ** db->aDb[iDb].pSchema structure. The mutexes required for schema
51517 ** If pSchema is not NULL, then iDb is computed from pSchema and
51520 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
51523 if( pSchema ) iDb = sqlite3SchemaToIndex(db, pSchema);
51705 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
51724 if( isIndex && (!pSchema || (pSchema->schemaFlags&DB_SchemaLoaded)==0) ){
51734 for(p=sqliteHashFirst(&pSchema->idxHash); p; p=sqliteHashNext(p)){
53686 if( pBt->xFreeSchema && pBt->pSchema ){
53687 pBt->xFreeSchema(pBt->pSchema);
53689 sqlite3DbFree(0, pBt->pSchema);
59926 if( !pBt->pSchema && nBytes ){
59927 pBt->pSchema = sqlite3DbMallocZero(0, nBytes);
59931 return pBt->pSchema;
71109 iGen = db->aDb[pOp->p1].pSchema->iGeneration;
71130 if( db->aDb[pOp->p1].pSchema->schema_cookie!=iMeta ){
71194 pDb->pSchema->schema_cookie = (int)pIn3->u.i;
71198 pDb->pSchema->file_format = (u8)pIn3->u.i;
71321 if( pDb->pSchema->file_format < p->minWriteFileFormat ){
71322 p->minWriteFileFormat = pDb->pSchema->file_format;
74810 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
74814 pTab->pSchema->schema_cookie,
74815 pTab->pSchema->iGeneration);
75504 mxCache = db->aDb[0].pSchema->cache_size;
77015 Schema *pSchema = 0; /* Schema of the expression */
77030 ** schema. If not found, pSchema will remain NULL and nothing will match
77045 pSchema = db->aDb[i].pSchema;
77076 if( zDb && pTab->pSchema!=pSchema ){
77110 pSchema = pExpr->pTab->pSchema;
77133 pSchema = pTab->pSchema;
77292 sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
79246 pNewItem->pSchema = pOldItem->pSchema;
79863 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
82902 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
82909 if( pTab->pSchema!=pTempSchema ){
82912 if( pTrig->pSchema==pTempSchema ){
82944 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
82950 int iTrigDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
83020 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
83242 iDb = sqlite3SchemaToIndex(db, pNew->pSchema);
83382 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
83414 pNew->pSchema = db->aDb[iDb].pSchema;
84424 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
84507 assert( iDb==sqlite3SchemaToIndex(db, pIdx->pSchema) );
84718 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
84731 for(k=sqliteHashFirst(&pSchema->tblHash); k; k=sqliteHashNext(k)){
84749 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
85238 for(i=sqliteHashFirst(&db->aDb[iDb].pSchema->idxHash);i;i=sqliteHashNext(i)){
85429 aNew->pSchema = sqlite3SchemaGet(db, aNew->pBt);
85430 if( !aNew->pSchema ){
85432 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
85500 db->aDb[iDb].pSchema = 0;
85573 pDb->pSchema = 0;
85714 pFix->pSchema = db->aDb[iDb].pSchema;
85754 pItem->pSchema = pFix->pSchema;
85997 Schema *pSchema, /* The schema of the expression */
86008 iDb = sqlite3SchemaToIndex(pParse->db, pSchema);
86290 db->aDb[iDb].pSchema->iGeneration /* P4 */
86409 p = sqlite3HashFind(&db->aDb[j].pSchema->tblHash, zName, nName);
86457 ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
86467 assert( p->pSchema==0 || p->zDatabase==0 );
86468 if( p->pSchema ){
86469 int iDb = sqlite3SchemaToIndex(pParse->db, p->pSchema);
86497 Schema *pSchema = db->aDb[j].pSchema;
86498 assert( pSchema );
86501 p = sqlite3HashFind(&pSchema->idxHash, zName, nName);
86533 pHash = &db->aDb[iDb].pSchema->idxHash;
86596 assert( pDb->pSchema!=0 );
86597 sqlite3SchemaClear(pDb->pSchema);
86605 assert( pDb->pSchema!=0 );
86606 sqlite3SchemaClear(pDb->pSchema);
86620 if( pDb->pSchema ){
86621 sqlite3SchemaClear(pDb->pSchema);
86691 assert( pIndex->pSchema==pTable->pSchema );
86695 &pIndex->pSchema->idxHash, zName, sqlite3Strlen30(zName), 0
86697 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
86738 p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName,
87031 pTable->pSchema = db->aDb[iDb].pSchema;
87044 pTable->pSchema->pSeqTab = pTable;
87541 sqlite3VdbeAddOp2(v, OP_Integer, db->aDb[iDb].pSchema->schema_cookie+1, r1);
87917 iDb = sqlite3SchemaToIndex(db, p->pSchema);
88040 if( pDb->pSchema->pSeqTab==0 ){
88059 Schema *pSchema = p->pSchema;
88061 pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName,
88120 pSchema);
88243 assert( sqlite3SchemaMutexHeld(db, 0, pTable->pSchema) );
88244 pTable->pSchema->schemaFlags |= DB_UnresetViews;
88266 for(i=sqliteHashFirst(&db->aDb[idx].pSchema->tblHash); i;i=sqliteHashNext(i)){
88305 pHash = &pDb->pSchema->tblHash;
88312 pHash = &pDb->pSchema->idxHash;
88359 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
88393 assert( pIdx->pSchema==pTab->pSchema );
88401 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
88459 assert( pTrigger->pSchema==pTab->pSchema ||
88460 pTrigger->pSchema==db->aDb[1].pSchema );
88527 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
88710 assert( sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
88711 pNextTo = (FKey *)sqlite3HashInsert(&p->pSchema->fkeyHash,
88777 int iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
88954 if( pName2->n==0 && pTab && pTab->pSchema==db->aDb[1].pSchema ){
88969 if( iDb==1 && db->aDb[iDb].pSchema!=pTab->pSchema ){
88981 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
89108 pIndex->pSchema = db->aDb[iDb].pSchema;
89119 if( pDb->pSchema->file_format>=4 ){
89258 assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
89259 p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
89447 iDb = sqlite3SchemaToIndex(db, pIndex->pSchema);
89953 assert( db->aDb[1].pSchema );
89978 pToplevel->cookieValue[iDb] = db->aDb[iDb].pSchema->schema_cookie;
90156 int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
90180 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
90805 Schema *pSchema = (Schema *)p;
90807 temp1 = pSchema->tblHash;
90808 temp2 = pSchema->trigHash;
90809 sqlite3HashInit(&pSchema->trigHash);
90810 sqlite3HashClear(&pSchema->idxHash);
90815 sqlite3HashInit(&pSchema->tblHash);
90821 sqlite3HashClear(&pSchema->fkeyHash);
90822 pSchema->pSeqTab = 0;
90823 if( pSchema->schemaFlags & DB_SchemaLoaded ){
90824 pSchema->iGeneration++;
90825 pSchema->schemaFlags &= ~DB_SchemaLoaded;
90951 int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
91149 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
91224 assert( pIdx->pSchema==pTab->pSchema );
94103 return (FKey *)sqlite3HashFind(&pTab->pSchema->fkeyHash, pTab->zName, nName);
94294 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
94722 pTrigger->pSchema = pTab->pSchema;
94723 pTrigger->pTabSchema = pTab->pSchema;
94771 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema) );
94781 sqlite3HashInsert(&pTab->pSchema->fkeyHash, z, sqlite3Strlen30(z), p);
95064 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
95065 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenRead);
95116 assert( sqlite3SchemaMutexHeld(db, 0, pDb->pSchema) );
95117 sqlite3OpenTable(pParse, 0, p->iDb, pDb->pSchema->pSeqTab, OP_OpenWrite);
95314 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
96443 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
96457 assert( pIdx->pSchema==pTab->pSchema );
96732 iDbSrc = sqlite3SchemaToIndex(pParse->db, pSrc->pSchema);
99076 pDb->pSchema->cache_size = size;
99077 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
99371 returnSingleInt(pParse, "cache_size", pDb->pSchema->cache_size);
99374 pDb->pSchema->cache_size = size;
99375 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
99706 for(i=sqliteHashFirst(&pDb->pSchema->tblHash); i; i=sqliteHashNext(i)){
99887 k = sqliteHashFirst(&db->aDb[iDb].pSchema->tblHash);
100074 pTbls = &db->aDb[i].pSchema->tblHash;
100758 assert( db->aDb[iDb].pSchema );
100835 pDb->pSchema->schema_cookie = meta[BTREE_SCHEMA_VERSION-1];
100865 pDb->pSchema->enc = ENC(db);
100867 if( pDb->pSchema->cache_size==0 ){
100871 pDb->pSchema->cache_size = size;
100873 pDb->pSchema->cache_size = SQLITE_DEFAULT_CACHE_SIZE;
100875 sqlite3BtreeSetCacheSize(pDb->pBt, pDb->pSchema->cache_size);
100884 pDb->pSchema->file_format = (u8)meta[BTREE_FILE_FORMAT-1];
100885 if( pDb->pSchema->file_format==0 ){
100886 pDb->pSchema->file_format = 1;
100888 if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){
101065 if( cookie!=db->aDb[iDb].pSchema->schema_cookie ){
101084 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
101087 /* If pSchema is NULL, then return -1000000. This happens when code in
101098 if( pSchema ){
101100 if( db->aDb[i].pSchema==pSchema ){
102811 }else if( pTab->pSchema ){
102827 int iDb = sqlite3SchemaToIndex(pNC->pParse->db, pTab->pSchema);
105585 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
106626 const int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
107126 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
107133 if( pTmpSchema!=pTab->pSchema ){
107138 if( pTrig->pTabSchema==pTab->pSchema
107222 && pTab->pSchema==db->aDb[1].pSchema ){
107261 if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),
107292 iTabDb = sqlite3SchemaToIndex(db, pTab->pSchema);
107324 pTrigger->pSchema = db->aDb[iDb].pSchema;
107325 pTrigger->pTabSchema = pTab->pSchema;
107364 iDb = sqlite3SchemaToIndex(pParse->db, pTrig->pSchema);
107403 Hash *pHash = &db->aDb[iDb].pSchema->trigHash;
107408 }else if( pLink->pSchema==pLink->pTabSchema ){
107587 pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName);
107624 iDb = sqlite3SchemaToIndex(pParse->db, pTrigger->pSchema);
107628 assert( pTable->pSchema==pTrigger->pSchema || iDb==1 );
107682 pHash = &(db->aDb[iDb].pSchema->trigHash);
107685 if( pTrigger->pSchema==pTrigger->pTabSchema ){
107767 iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema);
108133 assert( p->pSchema!=0 );
108135 assert( p->pSchema==p->pTabSchema
108136 || p->pSchema==pParse->db->aDb[1].pSchema );
108359 iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
109338 pDb->pSchema = 0;
109514 assert( db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema) );
109671 iDb = sqlite3SchemaToIndex(db, pTable->pSchema);
109747 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
109776 Schema *pSchema = pTab->pSchema;
109779 assert( sqlite3SchemaMutexHeld(db, 0, pSchema) );
109780 pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab);
109848 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
117173 iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
117239 assert( pIx->pSchema==pTab->pSchema );
122976 Schema *pSchema = db->aDb[i].pSchema;
122977 if( db->aDb[i].pSchema ){
122979 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
123113 pDb->pSchema = 0;
123118 if( db->aDb[1].pSchema ){
123119 sqlite3SchemaClear(db->aDb[1].pSchema);
123179 sqlite3DbFree(db, db->aDb[1].pSchema);
124156 for(k=sqliteHashFirst(&pDb->pSchema->tblHash); k; k=sqliteHashNext(k)){
124742 db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt);
124743 db->aDb[1].pSchema = sqlite3SchemaGet(db, 0);