Home | History | Annotate | Download | only in dist

Lines Matching defs:Schema

949 #define SQLITE_SCHEMA      17   /* The database schema changed */
2859 ** schema change. Hence, the application should ensure that the
2866 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
3479 ** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
3497 ** a schema change, on the first [sqlite3_step()] call following any change
3922 ** ^(For example, given the database schema:
5182 ** and schema data structures between [database connection | connections]
5714 ** CAPI3REF: Declare The Schema Of A Virtual Table
6534 ** memory used to store the schema for all databases associated
6537 ** schema memory is shared with other database connections due to
8056 ** The name of the schema table.
8131 typedef struct Schema Schema;
8398 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3*,int,Schema*);
9602 Schema *pSchema; /* Pointer to database schema (possibly shared) */
9606 ** An instance of the following structure stores a database schema.
9608 ** Most Schema objects are associated with a Btree. The exception is
9609 ** the Schema for the TEMP databaes (sqlite3.aDb[1]) which is free-standing.
9610 ** In shared cache mode, a single Schema object can be shared by multiple
9613 ** Schema objects are automatically deallocated when the last Btree that
9614 ** references them is destroyed. The TEMP Schema is manually freed by
9618 ** to access Schema content. This implies that the thread must also be
9620 ** For a TEMP Schema, only the connection mutex is required.
9622 struct Schema {
9623 int schema_cookie; /* Database schema version number for this file */
9630 u8 file_format; /* Schema format version for this file */
9632 u16 flags; /* Flags associated with this schema */
9648 ** The DB_SchemaLoaded flag is set after the database schema has been
9652 ** have been filled out. If the schema changes, these column names might
9655 #define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
9679 ** with a particular database connection. Hence, schema information cannot
9680 ** be stored in lookaside because in shared cache mode the schema information
9682 ** schema information, the Lookaside.bEnabled flag is cleared so that
9683 ** lookaside allocations are not used to construct the schema objects.
9847 #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */
10094 ** the database schema.
10096 ** If the database schema is shared, then there is one instance of this
10098 ** schema. This is because each database connection requires its own unique
10102 ** schema is shared, as the implementation often stores the database
10111 ** database schema are initially stored in a linked-list pointed to by
10119 ** schema is being reloaded for some reason), the VTable objects are not
10200 Schema *pSchema; /* Schema that contains this table */
10378 Schema *pSchema; /* Schema containing this index */
10533 ** Expr objects can use a lot of memory space in database schema. To
11089 u8 checkSchema; /* Causes schema cookie check after an error */
11117 yDbMask cookieMask; /* Bitmask of schema verified databases */
11162 Token sNameToken; /* Token with unqualified schema object name */
11201 * Each trigger present in the database schema is stored as an instance of
11223 Schema *pSchema; /* Schema containing the trigger */
11224 Schema *pTabSchema; /* Schema containing the table */
11799 SQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,Schema*,SrcList*);
11943 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
11944 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
13446 ** to store the schema for all databases (main, temp, and any ATTACHed
13456 Schema *pSchema = db->aDb[i].pSchema;
48538 ** 40 4 Schema cookie
48539 ** 44 4 File format of schema layer
48800 ** schema associated with the database file are all contained within
49344 ** db->aDb[iDb].pSchema structure. The mutexes required for schema
49353 SQLITE_PRIVATE int sqlite3SchemaMutexHeld(sqlite3 *db, int iDb, Schema *pSchema){
49456 ** Enable or disable the shared pager and schema features.
49507 ** function has to search through the database schema.
49510 ** hold a write-lock on the schema table (root page 1). This is also
49519 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
49533 /* If the client is reading or writing an index and the schema is
49559 ** write-lock on the schema table, or (if the client is reading) a
56780 ** The schema layer numbers meta values differently. At the schema
57495 ** purposes (for example, to store a high-level schema associated with
57692 u32 iDestSchema; /* Original schema cookie in destination */
58070 /* Update the schema version field in the destination database. This
58071 ** is to make sure that the schema-version really does change in
58073 ** same schema version.
63113 ** schema change has occurred. That detail is handled by the
63247 ** sqlite3Step() to do most of the work. If a schema error occurs,
63793 ** as if there had been a schema change, on the first sqlite3_step() call
65006 u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */
67830 ** P3==1 is the schema version. P3==2 is the database format.
67861 ** into cookie number P2 of database P1. P2==1 is the schema version.
67883 /* When the schema cookie changes, record the new cookie internally */
67892 ** schema is changed. Ticket #1644 */
67902 ** schema version) and make sure it is equal to P2 and that the
67903 ** generation counter on the local schema parse equals P3.
67909 ** The cookie changes its value whenever the database schema changes.
67911 ** and that the current process needs to reread the schema.
67936 p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed");
67937 /* If the schema-cookie from the database file matches the cookie
67938 ** stored with the in-memory representation of the schema, do
67939 ** not reload the schema from the database file.
67945 ** discard the database schema, as the user code implementing the
69846 ** schema consistent with what is on disk.
69858 ** schema consistent with what is on disk.
69870 ** schema consistent with what is on disk.
71338 {OP_VerifyCookie, 0, 0, 0}, /* 1: Check the schema cookie */
73363 Schema *pSchema = 0; /* Schema of the expression */
75273 ** part of the in-memory representation of the database schema.
76304 ** of a "NOT NULL" constraint in the database schema.
78768 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
78772 ** that is not part of the temp-db schema, add a clause to the WHERE
78794 ** Argument zName is the name of the table in the database schema at
78814 /* Drop any table triggers from the internal schema. */
78822 /* Drop the table and index from the internal schema. */
78940 ** Then modify the schema cookie (since the ALTER TABLE modifies the
78941 ** schema). Open a statement transaction if the table is a virtual
79047 /* Drop and reload the internal table schema. */
79195 /* Reload the schema of the modified table. */
79283 /* Begin a transaction and increment the schema cookie. */
80015 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
80078 /* Read the database schema. If an error occurs, leave an error message
80534 /* Allocate the new entry in the db->aDb[] array and initialise the schema
80550 ** it to obtain the database schema. At this point the schema may
80623 /* If the file was opened successfully, read the schema for the new database.
81118 Schema *pSchema, /* The schema of the expression */
81379 ** transaction on each used database and to verify the schema cookie
81505 /* All mutexes are required for schema access. Make sure we hold them. */
81535 /* Read the database schema. If an error occurs, leave an error message
81570 /* All mutexes are required for schema access. Make sure we hold them. */
81574 Schema *pSchema = db->aDb[j].pSchema;
81629 ** Erase all schema information from the in-memory hash tables of
81632 ** if there were schema changes during the transaction or if a
81633 ** schema-cookie mismatch occurs.
81635 ** If iDb<0 then reset the internal schema tables for all database
81636 ** files. If iDb>=0 then reset the internal schema for only the
81644 /* Case 1: Reset the single schema identified by iDb */
81678 ** schema hash tables and therefore do not have to make any changes
81922 ** unqualified name for a new schema object (table, index, view or
82521 ** Generate code that will increment the schema cookie.
82523 ** The schema cookie is used to determine when the schema for the
82524 ** database changes. After each schema change, the cookie value
82525 ** changes. When a process first reads the schema it records the
82527 ** it checks the cookie to make sure the schema has not changed
82531 ** the schema to change multiple times and for the cookie to be
82532 ** set back to prior value. But schema changes are infrequent
82781 ** as a schema-lock must have already been obtained to create it. Since
82782 ** a schema-lock excludes all other database users, the write-lock would
82863 Schema *pSchema = p->pSchema;
83086 ** This function is called by the VDBE to adjust the internal schema
83129 ** Also write code to modify the sqlite_master table and internal schema
83157 ** Code to update the sqlite_master tables and internal schema definitions
83297 /* Remove the table entry from SQLite's internal schema and modify
83298 ** the schema cookie.
83750 ** if initialising a database schema.
83805 ** sqlite_master table (because some other process changed the schema) and
84124 /* Fill the index with data and reparse the schema. Code an OP_Expire
84753 ** Generate VDBE code that will verify the schema cookie and start
84756 ** It is important that all schema cookies be verified and all
84763 ** record every database that needs its schema verified in the
84771 ** schema on any databases. This can be used to position the OP_Goto
84932 assert( sqlite3BtreeHoldsAllMutexes(db) ); /* Needed for schema access */
84967 /* Read the database schema. If an error occurs, leave an error message
85449 ** Free all resources held by the schema structure. The void* argument points
85450 ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
85452 ** of the schema hash tables).
85454 ** The Schema.cache_size variable is not cleared.
85460 Schema *pSchema = (Schema *)p;
85485 ** Find and return the schema associated with a BTree. Create
85488 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){
85489 Schema * p;
85491 p = (Schema *)sqlite3BtreeSchema(pBt, sizeof(Schema), sqlite3SchemaClear);
85493 p = (Schema *)sqlite3DbMallocZero(0, sizeof(Schema));
87922 ** search the schema a unique index on the parent key columns.
88359 ** given the following schema:
88439 ** any modifications to the schema are made. This is because statement
88440 ** transactions are not able to rollback schema changes. */
88506 ** schema items cannot be located, set an error in pParse and return
88731 ** the following schema:
88957 ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
92228 ** If the TEMP database is open, close it and mark the database schema
92673 /* Force the schema to be loaded on all databases. This causes all
93411 ** will be overwritten when the schema is next loaded. If it does not
93441 ** the value of the schema-version and user-version, respectively. Both
93442 ** the schema-version and the user-version are 32-bit signed integers
93445 ** The schema-cookie is usually only manipulated internally by SQLite. It
93446 ** is incremented by SQLite whenever the database schema is modified (by
93447 ** creating or dropping a table or index). The schema version is used by
93449 ** of the schema used when compiling the SQL query matches the schema of
93452 ** the schema-version is potentially dangerous and may lead to program
93462 int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
93687 ** interface, and routines that contribute to loading the database schema
93704 "malformed database schema (%s)", zObj);
93800 ** Attempt to read the database schema and initialize internal
93851 /* zMasterSchema and zInitScript are set to point at the master schema
93862 /* Construct the schema tables. */
93907 ** meta[0] Schema cookie. Changes with each schema change.
93908 ** meta[1] File format of schema layer.
93989 /* Read the schema information out of the schema tables
94022 ** the schema loaded, even if errors occurred. In this situation the
94025 ** of the schema was loaded before the error occurred. The primary
94075 /* Once all the other databases have been initialised, load the schema
94077 ** schema may contain references to objects in other databases.
94098 ** This routine is a no-op if the database schema is already initialised.
94099 ** Otherwise, the schema is loaded. An error code is returned.
94117 ** Check schema cookies in all databases. If any cookie is out
94118 ** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
94146 /* Read the schema cookie from the database. If it does not match the
94147 ** value stored as part of the in-memory schema representation,
94164 ** Convert a schema pointer into the iDb index that indicates
94165 ** which database file in db->aDb[] the schema refers to.
94170 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
94227 ** to the schema.
94230 ** schema changes and if those schema changes are subsequently rolled
94232 ** prepared statement goes to run the schema cookie would fail to detect
94233 ** the schema change. Disaster would follow.
94237 ** is not possible for another thread to start a new schema change
94239 ** locks on the schema, we just need to make sure nobody else is
94243 ** but it does *not* override schema lock detection, so this all still
94253 sqlite3Error(db, rc, "database schema is locked: %s", zDb);
94386 ** Rerun the compilation of a statement after a schema change.
94425 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
94427 ** and the statement is automatically recompiled if an schema change
94505 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
94507 ** and the statement is automatically recompiled if an schema change
95688 ** column specific strings, in case the schema is reset before this
99389 ** triggers on pTab in the TEMP schema. This routine prepends all
99398 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
99832 ** This function is called to drop a trigger from the database schema.
100402 /* Sanity checking: The schema for the trigger and for the table are
100403 ** always defined. The trigger must be in the same schema as the table
101269 ** restored before returning. Then set the writable-schema flag, and
101312 ** to read the schema was concluded. Unlock it here so that this doesn't
101360 /* Query the schema of the main database. Create a mirror schema
101433 ** The increment is used to increase the schema cookie so that other
101434 ** connections to the same database will know to reread the schema.
101437 BTREE_SCHEMA_VERSION, 1, /* Add one to the old schema cookie */
101727 ** structure is associated with a single sqlite3* user of the schema.
101894 ** allows a schema that contains virtual tables to be loaded before
101898 Schema *pSchema = pTab->pSchema;
101993 const char *zFormat = "vtable constructor did not declare schema: %s";
102157 ** This function is used to set the schema of a virtual table. It is only
105537 ** set to 9. Given the same schema and either of the following WHERE
113305 /* The temp-database schema is allocated differently from the other schema
113307 ** So it needs to be freed here. Todo: Why not roll the temp schema into
113384 /* SQLITE_SCHEMA */ "database schema has changed",
114723 ** database schema yet. This is delayed until the first time the database
115063 /* Ensure the database schema has been loaded */
117202 ** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table
118007 /* Declare the table schema to SQLite. */
121902 ** Schema of the terms table.
124814 ** comment above struct HashTableVtab) to the database schema. Both
128487 ** tables. The schema of the virtual table being:
133238 /* Create/Connect to the underlying relational database schema. If
133240 ** the r-tree table schema.