Home | History | Annotate | Download | only in dist

Lines Matching refs:Schema

629 #define SQLITE_SCHEMA      17   /* The database schema changed */
2793 ** schema change. Hence, the application should ensure that the
2800 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
3468 ** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
3487 ** a schema change, on the first [sqlite3_step()] call following any change
3944 ** ^(For example, given the database schema:
5339 ** and schema data structures between [database connection | connections]
5530 ** any errors are encountered while loading the schema.
5924 ** CAPI3REF: Declare The Schema Of A Virtual Table
6780 ** memory used to store the schema for all databases associated
6783 ** schema memory is shared with other database connections due to
9216 ** The name of the schema table.
9296 typedef struct Schema Schema;
9600 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*);
10867 Schema *pSchema; /* Pointer to database schema (possibly shared) */
10871 ** An instance of the following structure stores a database schema.
10873 ** Most Schema objects are associated with a Btree. The exception is
10874 ** the Schema for the TEMP databaes (sqlite3.aDb[1]) which is free-standing.
10875 ** In shared cache mode, a single Schema object can be shared by multiple
10878 ** Schema objects are automatically deallocated when the last Btree that
10879 ** references them is destroyed. The TEMP Schema is manually freed by
10883 ** to access Schema content. This implies that the thread must also be
10885 ** For a TEMP Schema, only the connection mutex is required.
10887 struct Schema {
10888 int schema_cookie; /* Database schema version number for this file */
10895 u8 file_format; /* Schema format version for this file */
10897 u16 schemaFlags; /* Flags associated with this schema */
10913 ** The DB_SchemaLoaded flag is set after the database schema has been
10917 ** have been filled out. If the schema changes, these column names might
10920 #define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
10944 ** with a particular database connection. Hence, schema information cannot
10945 ** be stored in lookaside because in shared cache mode the schema information
10947 ** schema information, the Lookaside.bEnabled flag is cleared so that
10948 ** lookaside allocations are not used to construct the schema objects.
11160 #define SQLITE_RecoveryMode 0x00010000 /* Ignore schema errors */
11451 ** the database schema.
11453 ** If the database schema is shared, then there is one instance of this
11455 ** schema. This is because each database connection requires its own unique
11459 ** schema is shared, as the implementation often stores the database
11468 ** database schema are initially stored in a linked-list pointed to by
11476 ** schema is being reloaded for some reason), the VTable objects are not
11502 ** The schema for each SQL table and view is represented in memory
11535 Schema *pSchema; /* Schema that contains this table */
11599 ** is held in Schema.fkeyHash with a hash key of Z.
11738 Schema *pSchema; /* Schema containing this index */
11912 ** Expr objects can use a lot of memory space in database schema. To
12147 Schema *pSchema; /* Schema to which this item is fixed */
12505 u8 checkSchema; /* Causes schema cookie check after an error */
12539 yDbMask cookieMask; /* Bitmask of schema verified databases */
12594 Token sNameToken; /* Token with unqualified schema object name */
12640 * Each trigger present in the database schema is stored as an instance of
12662 Schema *pSchema; /* Schema containing the trigger */
12663 Schema *pTabSchema; /* Schema containing the table */
12737 Schema *pSchema; /* Fix items to this schema */
13349 SQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,Schema*,SrcList*);
13495 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
13496 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
15217 ** to store the schema for all databases (main, temp, and any ATTACHed
15227 Schema *pSchema = db->aDb[i].pSchema;
52172 ** 40 4 Schema cookie
52173 ** 44 4 File format of schema layer
52437 ** schema associated with the database file are all contained within
53021 ** db->aDb[iDb].pSchema structure. The mutexes required for schema
53030 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
53152 ** Enable or disable the shared pager and schema features.
53203 ** function has to search through the database schema.
53206 ** hold a write-lock on the schema table (root page 1). This is also
53215 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
53229 /* If the client is reading or writing an index and the schema is
53261 ** write-lock on the schema table, or (if the client is reading) a
55901 ** consisting of a single page and no schema objects). Return SQLITE_OK
56686 ** rolled back modified the database schema. In this case b-tree root
61279 ** The schema layer numbers meta values differently. At the schema
62118 ** purposes (for example, to store a high-level schema associated with
62340 u32 iDestSchema; /* Original schema cookie in destination */
62757 /* Update the schema version field in the destination database. This
62758 ** is to make sure that the schema-version really does change in
62760 ** same schema version.
69422 ** schema change has occurred. That detail is handled by the
69554 ** sqlite3Step() to do most of the work. If a schema error occurs,
70163 ** as if there had been a schema change, on the first sqlite3_step() call
71398 u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */
73887 ** If P5!=0 then this opcode also checks the schema cookie against P3
73888 ** and the schema generation counter against P4.
73889 ** The cookie changes its value whenever the database schema changes.
73891 ** and that the current process needs to reread the schema. If the schema
73892 ** cookie in P3 differs from the schema cookie in the database header or
73893 ** if the schema generation counter in P4 differs from the current
73946 /* Gather the schema version number for checking:
73947 ** IMPLEMENTATION-OF: R-32195-19465 The schema version is used by SQLite
73949 ** schema used when compiling the SQL query matches the schema of the
73960 p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed");
73961 /* If the schema-cookie from the database file matches the cookie
73962 ** stored with the in-memory representation of the schema, do
73963 ** not reload the schema from the database file.
73969 ** discard the database schema, as the user code implementing the
73986 ** P3==1 is the schema version. P3==2 is the database format.
74017 ** into cookie number P2 of database P1. P2==1 is the schema version.
74038 /* When the schema cookie changes, record the new cookie internally */
74047 ** schema is changed. Ticket #1644 */
76039 ** schema consistent with what is on disk.
76052 ** schema consistent with what is on disk.
76065 ** schema consistent with what is on disk.
81541 Schema *pSchema = 0; /* Schema of the expression */
81555 /* Translate the schema name in zDb into a pointer to the corresponding
81556 ** schema. If not found, pSchema will remain NULL and nothing will match
83800 ** part of the in-memory representation of the database schema.
84100 ** an existing schema and 4 when processing a new statement. A bound
84105 ** malformed schema error.
84997 ** of a "NOT NULL" constraint in the database schema.
87548 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
87552 ** that is not part of the temp-db schema, add a clause to the WHERE
87574 ** Argument zName is the name of the table in the database schema at
87594 /* Drop any table triggers from the internal schema. */
87602 /* Drop the table and index from the internal schema. */
87720 ** Then modify the schema cookie (since the ALTER TABLE modifies the
87721 ** schema). Open a statement transaction if the table is a virtual
87827 /* Drop and reload the internal table schema. */
87979 /* Reload the schema of the modified table. */
88067 /* Begin a transaction and increment the schema cookie. */
89373 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
89439 /* Read the database schema. If an error occurs, leave an error message
90081 /* Allocate the new entry in the db->aDb[] array and initialize the schema
90097 ** it to obtain the database schema. At this point the schema may
90175 /* If the file was opened successfully, read the schema for the new database.
90703 Schema *pSchema, /* The schema of the expression */
90996 ** transaction on each used database and to verify the schema cookie
91134 /* All mutexes are required for schema access. Make sure we hold them. */
91171 /* Read the database schema. If an error occurs, leave an error message
91201 ** the search to schema (p->pSchema) if it is not NULL. p->pSchema may be
91236 /* All mutexes are required for schema access. Make sure we hold them. */
91240 Schema *pSchema = db->aDb[j].pSchema;
91329 ** Reset the schema for the database at index iDb. Also reset the
91330 ** TEMP schema.
91336 /* Case 1: Reset the single schema identified by iDb */
91355 ** Erase all schema information from all attached databases (including
91410 ** contains lookaside memory. (Table objects in the schema do not use
91417 TESTONLY( int nLookaside; ) /* Used to verify lookaside not used for schema */
91425 /* Record the number of outstanding lookaside allocations in schema Tables
91426 ** prior to doing any free() operations. Since schema Tables do not use
91463 /* Verify that no lookaside memory was used by schema tables */
91605 ** unqualified name for a new schema object (table, index, view or
92262 ** Generate code that will increment the schema cookie.
92264 ** The schema cookie is used to determine when the schema for the
92265 ** database changes. After each schema change, the cookie value
92266 ** changes. When a process first reads the schema it records the
92268 ** it checks the cookie to make sure the schema has not changed
92272 ** the schema to change multiple times and for the cookie to be
92273 ** set back to prior value. But schema changes are infrequent
92472 ** internal schema data structures and the generated VDBE code so that they
92483 ** schema to the rootpage from the main table.
92484 ** (4) Set all columns of the PRIMARY KEY schema object to be NOT NULL.
92732 ** as a schema-lock must have already been obtained to create it. Since
92733 ** a schema-lock excludes all other database users, the write-lock would
92816 Schema *pSchema = p->pSchema;
93037 ** This function is called by the VDBE to adjust the internal schema
93080 ** Also write code to modify the sqlite_master table and internal schema
93108 ** Code to update the sqlite_master tables and internal schema definitions
93249 /* Remove the table entry from SQLite's internal schema and modify
93250 ** the schema cookie.
93707 ** if initialising a database schema.
93771 ** sqlite_master table (because some other process changed the schema) and
94039 ** table to parse the schema, or if this index is the PRIMARY KEY index
94088 /* Fill the index with data and reparse the schema. Code an OP_Expire
94723 ** Record the fact that the schema cookie will need to be verified
94724 ** for database iDb. The code to actually verify the schema cookie
94936 assert( sqlite3BtreeHoldsAllMutexes(db) ); /* Needed for schema access */
94971 /* Read the database schema. If an error occurs, leave an error message
95544 ** Free all resources held by the schema structure. The void* argument points
95545 ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
95547 ** of the schema hash tables).
95549 ** The Schema.cache_size variable is not cleared.
95555 Schema *pSchema = (Schema *)p;
95580 ** Find and return the schema associated with a BTree. Create
95583 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){
95584 Schema * p;
95586 p = (Schema *)sqlite3BtreeSchema(pBt, sizeof(Schema), sqlite3SchemaClear);
95588 p = (Schema *)sqlite3DbMallocZero(0, sizeof(Schema));
98392 ** search the schema for a unique index on the parent key columns.
98895 ** given the following schema:
98974 ** any modifications to the schema are made. This is because statement
98975 ** transactions are not able to rollback schema changes.
99139 ** schema items cannot be located, set an error in pParse and return
99377 ** the following schema:
99607 ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
103754 ** If the TEMP database is open, close it and mark the database schema
103983 /* Make sure the database schema is loaded if the pragma requires that */
104580 /* Do not allow non-admin users to modify the schema arbitrarily */
104862 HashElem *k; /* Loop counter: Next table in schema */
105279 ** will be overwritten when the schema is next loaded. If it does not
105316 ** the value of the schema-version and user-version, respectively. Both
105317 ** the schema-version and the user-version are 32-bit signed integers
105320 ** The schema-cookie is usually only manipulated internally by SQLite. It
105321 ** is incremented by SQLite whenever the database schema is modified (by
105322 ** creating or dropping a table or index). The schema version is used by
105324 ** of the schema used when compiling the SQL query matches the schema of
105327 ** the schema-version is potentially dangerous and may lead to program
105604 ** interface, and routines that contribute to loading the database schema
105621 "malformed database schema (%s)", zObj);
105717 ** Attempt to read the database schema and initialize internal
105770 /* zMasterSchema and zInitScript are set to point at the master schema
105781 /* Construct the schema tables. */
105826 ** meta[0] Schema cookie. Changes with each schema change.
105827 ** meta[1] File format of schema layer.
105911 /* Read the schema information out of the schema tables
105944 ** the schema loaded, even if errors occurred. In this situation the
105947 ** of the schema was loaded before the error occurred. The primary
106000 /* Once all the other databases have been initialized, load the schema
106002 ** schema may contain references to objects in other databases.
106023 ** This routine is a no-op if the database schema is already initialized.
106024 ** Otherwise, the schema is loaded. An error code is returned.
106042 ** Check schema cookies in all databases. If any cookie is out
106043 ** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
106071 /* Read the schema cookie from the database. If it does not match the
106072 ** value stored as part of the in-memory schema representation,
106089 ** Convert a schema pointer into the iDb index that indicates
106090 ** which database file in db->aDb[] the schema refers to.
106095 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
106163 ** to the schema.
106166 ** schema changes and if those schema changes are subsequently rolled
106168 ** prepared statement goes to run the schema cookie would fail to detect
106169 ** the schema change. Disaster would follow.
106173 ** is not possible for another thread to start a new schema change
106175 ** locks on the schema, we just need to make sure nobody else is
106179 ** but it does *not* override schema lock detection, so this all still
106189 sqlite3ErrorWithMsg(db, rc, "database schema is locked: %s", zDb);
106326 ** Rerun the compilation of a statement after a schema change.
106365 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
106367 ** and the statement is automatically recompiled if an schema change
106453 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
106455 ** and the statement is automatically recompiled if an schema change
107966 ** column specific strings, in case the schema is reset before this
112334 ** triggers on pTab in the TEMP schema. This routine prepends all
112343 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
112772 ** This function is called to drop a trigger from the database schema.
113342 /* Sanity checking: The schema for the trigger and for the table are
113343 ** always defined. The trigger must be in the same schema as the table
114331 ** restored before returning. Then set the writable-schema flag, and
114374 ** to read the schema was concluded. Unlock it here so that this doesn't
114422 /* Query the schema of the main database. Create a mirror schema
114499 ** The increment is used to increase the schema cookie so that other
114500 ** connections to the same database will know to reread the schema.
114503 BTREE_SCHEMA_VERSION, 1, /* Add one to the old schema cookie */
114764 ** objects without disturbing the rest of the Schema object (which may
114829 ** structure is associated with a single sqlite3* user of the schema.
115004 ** allows a schema that contains virtual tables to be loaded before
115008 Schema *pSchema = pTab->pSchema;
115122 const char *zFormat = "vtable constructor did not declare schema: %s";
115293 ** This function is used to set the schema of a virtual table. It is only
121344 ** those objects, since there is no opportunity to add schema
128944 Schema *pSchema = db->aDb[i].pSchema;
129068 ** the pager rollback and schema reset an atomic operation. */
129085 /* Clear the TEMP schema separately and last */
129145 /* The temp-database schema is allocated differently from the other schema
129147 ** So it needs to be freed here. Todo: Why not roll the temp schema into
129178 ** modified the database schema. If the b-tree mutexes are not taken
129180 ** the database rollback and schema reset, which can cause false
129346 /* SQLITE_SCHEMA */ "database schema has changed",
130838 ** database schema yet. This is delayed until the first time the database
131212 /* Ensure the database schema has been loaded */
131670 ** Enable imposter mode only when the schema has already been parsed. Then
131672 ** the parsed schema. Then turn imposter mode back off again.
131674 schema for all databases, causing
131675 ** the schema to be reparsed the next time it is needed. This has the
133587 ** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table
134467 /* Declare the table schema to SQLite. */
138965 ** Schema of the terms table.
142247 ** comment above struct HashTableVtab) to the database schema. Both
142554 ** The table created has the following schema:
142677 ** Schema of the tokenizer table.
148479 ** tables. The schema of the virtual table being:
154210 /* Create/Connect to the underlying relational database schema. If
154212 ** the r-tree table schema.