Home | History | Annotate | Download | only in dist

Lines Matching refs:Schema

895 #define SQLITE_SCHEMA      17   /* The database schema changed */
2482 ** schema change. Hence, the application should ensure that the
2489 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
2925 ** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
2927 ** statement and try to run it again. ^If the schema has changed in
2947 ** automatically recompiled (as if there had been a schema change) on the first
3302 ** ^(For example, given the database schema:
4416 ** and schema data structures between [database connection | connections]
4874 ** CAPI3REF: Declare The Schema Of A Virtual Table
6710 ** The name of the schema table.
6782 typedef struct Schema Schema;
8180 Schema *pSchema; /* Pointer to database schema (possibly shared) */
8184 ** An instance of the following structure stores a database schema.
8186 ** If there are no virtual tables configured in this schema, the
8187 ** Schema.db variable is set to NULL. After the first virtual table
8190 ** added to the Schema structure and the Schema.db variable populated,
8191 ** only that database connection may use the Schema to prepare
8194 struct Schema {
8195 int schema_cookie; /* Database schema version number for this file */
8201 u8 file_format; /* Schema format version for this file */
8203 u16 flags; /* Flags associated with this schema */
8222 ** The DB_SchemaLoaded flag is set after the database schema has been
8226 ** have been filled out. If the schema changes, these column names might
8229 #define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
8253 ** with a particular database connection. Hence, schema information cannot
8254 ** be stored in lookaside because in shared cache mode the schema information
8256 ** schema information, the Lookaside.bEnabled flag is cleared so that
8257 ** lookaside allocations are not used to construct the schema objects.
8439 #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */
8667 ** the database schema.
8669 ** If the database schema is shared, then there is one instance of this
8671 ** schema. This is because each database connection requires its own unique
8675 ** schema is shared, as the implementation often stores the database
8684 ** database schema are initially stored in a linked-list pointed to by
8692 ** schema is being reloaded for some reason), the VTable objects are not
8771 Schema *pSchema; /* Schema that contains this table */
8958 Schema *pSchema; /* Schema containing this index */
9100 ** Expr objects can use a lot of memory space in database schema. To
9632 u8 checkSchema; /* Causes schema cookie check after an error */
9658 u32 cookieMask; /* Bitmask of schema verified databases */
9693 Token sNameToken; /* Token with unqualified schema object name */
9736 * Each trigger present in the database schema is stored as an instance of
9758 Schema *pSchema; /* Schema containing the trigger */
9759 Schema *pTabSchema; /* Schema containing the table */
10288 SQLITE_PRIVATE void sqlite3AuthRead(Parse*,Expr*,Schema*,SrcList*);
10419 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
10420 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
36868 ** 40 4 Schema cookie
36869 ** 44 4 File format of schema layer
37128 ** schema associated with the database file are all contained within
37833 ** Enable or disable the shared pager and schema features.
37884 ** function has to search through the database schema.
37887 ** hold a write-lock on the schema table (root page 1). This is also
37896 Schema *pSchema = (Schema *)pBtree->pBt->pSchema;
37910 /* If the client is reading or writing an index and the schema is
37936 ** write-lock on the schema table, or (if the client is reading) a
44868 ** The schema layer numbers meta values differently. At the schema
45550 ** purposes (for example, to store a high-level schema associated with
45711 u32 iDestSchema; /* Original schema cookie in destination */
46040 /* Update the schema version field in the destination database. This
46041 ** is to make sure that the schema-version really does change in
46043 ** same schema version.
49566 /* Rollback or commit any schema changes that occurred. */
50840 ** schema change has occurred. That detail is handled by the
50941 ** sqlite3Step() to do most of the work. If a schema error occurs,
52559 u8 resetSchemaOnFault = 0; /* Reset schema after an error if true */
55239 ** P3==1 is the schema version. P3==2 is the database format.
55270 ** into cookie number P2 of database P1. P2==1 is the schema version.
55291 /* When the schema cookie changes, record the new cookie internally */
55300 ** schema is changed. Ticket #1644 */
55310 ** schema version) and make sure it is equal to P2.
55315 ** The cookie changes its value whenever the database schema changes.
55317 ** and that the current process needs to reread the schema.
55338 p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed");
55339 /* If the schema-cookie from the database file matches the cookie
55340 ** stored with the in-memory representation of the schema, do
55341 ** not reload the schema from the database file.
55347 ** discard the database schema, as the user code implementing the
57029 ** no-op if the schema is not currently loaded. In other words, if P2
57031 ** schema is already loaded into the symbol table.
57050 ** does this if the corresponding in-memory schema is currently
57052 ** with the rest of the schema when it is required.
57058 ** the schema of u.bu.iDb is loaded. This is because, at the start of
57063 ** schema of database u.bu.iDb before the SQL statement runs. The schema
57066 ** database schema" error being returned to the user.
57117 ** schema consistent with what is on disk.
57129 ** schema consistent with what is on disk.
57141 ** schema consistent with what is on disk.
58353 {OP_VerifyCookie, 0, 0, 0}, /* 1: Check the schema cookie */
59442 Schema *pSchema = 0; /* Schema of the expression */
61337 ** part of the in-memory representation of the database schema.
62325 ** of a "NOT NULL" constraint in the database schema.
64535 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
64539 ** that is not part of the temp-db schema, add a clause to the WHERE
64556 ** Argument zName is the name of the table in the database schema at
64576 /* Drop any table triggers from the internal schema. */
64584 /* Drop the table and index from the internal schema. */
64686 ** Then modify the schema cookie (since the ALTER TABLE modifies the
64687 ** schema). Open a statement transaction if the table is a virtual
64793 /* Drop and reload the internal table schema. */
64937 /* Reload the schema of the modified table. */
65023 /* Begin a transaction and increment the schema cookie. */
65375 Schema *pSchema = db->aDb[iDb].pSchema; /* Schema of database iDb */
65431 /* Read the database schema. If an error occurs, leave an error message
65790 /* Allocate the new entry in the db->aDb[] array and initialise the schema
65806 ** it to obtain the database schema. At this point the schema may
65867 /* If the file was opened successfully, read the schema for the new database.
66358 Schema *pSchema, /* The schema of the expression */
66619 ** transaction on each used database and to verify the schema cookie
66771 /* Read the database schema. If an error occurs, leave an error message
66808 Schema *pSchema = db->aDb[j].pSchema;
66879 ** Erase all schema information from the in-memory hash tables of
66882 ** if there were schema changes during the transaction or if a
66883 ** schema-cookie mismatch occurs.
66885 ** If iDb==0 then reset the internal schema tables for all database
66886 ** files. If iDb>=1 then reset the internal schema for only the
66912 ** schema hash tables and therefore do not have to make any changes
67155 ** unqualified name for a new schema object (table, index, view or
67748 ** Generate code that will increment the schema cookie.
67750 ** The schema cookie is used to determine when the schema for the
67751 ** database changes. After each schema change, the cookie value
67752 ** changes. When a process first reads the schema it records the
67754 ** it checks the cookie to make sure the schema has not changed
67758 ** the schema to change multiple times and for the cookie to be
67759 ** set back to prior value. But schema changes are infrequent
68007 ** as a schema-lock must have already been obtained to create it. Since
68008 ** a schema-lock excludes all other database users, the write-lock would
68088 Schema *pSchema = p->pSchema;
68309 ** This function is called by the VDBE to adjust the internal schema
68349 ** Also write code to modify the sqlite_master table and internal schema
68377 ** Code to update the sqlite_master tables and internal schema definitions
68584 /* Remove the table entry from SQLite's internal schema and modify
68585 ** the schema cookie.
68895 ** if initialising a database schema.
68949 ** sqlite_master table (because some other process changed the schema) and
69257 /* Fill the index with data and reparse the schema. Code an OP_Expire
69899 ** Generate VDBE code that will verify the schema cookie and start
69902 ** It is important that all schema cookies be verified and all
69909 ** record every database that needs its schema verified in the
69917 ** schema on any databases. This can be used to position the OP_Goto
70096 /* Read the database schema. If an error occurs, leave an error message
70573 ** Free all resources held by the schema structure. The void* argument points
70574 ** at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
70576 ** of the schema hash tables).
70578 ** The Schema.cache_size variable is not cleared.
70584 Schema *pSchema = (Schema *)p;
70607 ** Find and return the schema associated with a BTree. Create
70610 SQLITE_PRIVATE Schema *sqlite3SchemaGet(sqlite3 *db, Btree *pBt){
70611 Schema * p;
70613 p = (Schema *)sqlite3BtreeSchema(pBt, sizeof(Schema), sqlite3SchemaFree);
70615 p = (Schema *)sqlite3MallocZero(sizeof(Schema));
72937 ** search the schema a unique index on the parent key columns.
73361 ** given the following schema:
73441 ** any modifications to the schema are made. This is because statement
73442 ** transactions are not able to rollback schema changes. */
73510 ** schema items cannot be located, set an error in pParse and return
73718 ** the following schema:
73947 ** table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
77065 ** If the TEMP database is open, close it and mark the database schema
78183 ** will be overwritten when the schema is next loaded. If it does not
78213 ** the value of the schema-version and user-version, respectively. Both
78214 ** the schema-version and the user-version are 32-bit signed integers
78217 ** The schema-cookie is usually only manipulated internally by SQLite. It
78218 ** is incremented by SQLite whenever the database schema is modified (by
78219 ** creating or dropping a table or index). The schema version is used by
78221 ** of the schema used when compiling the SQL query matches the schema of
78224 ** the schema-version is potentially dangerous and may lead to program
78234 int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
78385 ** interface, and routines that contribute to loading the database schema
78402 "malformed database schema (%s)", zObj);
78495 ** Attempt to read the database schema and initialize internal
78546 /* zMasterSchema and zInitScript are set to point at the master schema
78557 /* Construct the schema tables. */
78602 ** meta[0] Schema cookie. Changes with each schema change.
78603 ** meta[1] File format of schema layer.
78681 /* Read the schema information out of the schema tables
78714 ** the schema loaded, even if errors occurred. In this situation the
78717 ** of the schema was loaded before the error occurred. The primary
78767 /* Once all the other databases have been initialised, load the schema
78769 ** schema may contain references to objects in other databases.
78790 ** This routine is a no-op if the database schema is already initialised.
78791 ** Otherwise, the schema is loaded. An error code is returned.
78809 ** Check schema cookies in all databases. If any cookie is out
78810 ** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
78838 /* Read the schema cookie from the database. If it does not match the
78839 ** value stored as part of the in-memory schema representation,
78854 ** Convert a schema pointer into the iDb index that indicates
78855 ** which database file in db->aDb[] the schema refers to.
78860 SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *pSchema){
78917 ** to the schema.
78920 ** schema changes and if those schema changes are subsequently rolled
78922 ** prepared statement goes to run the schema cookie would fail to detect
78923 ** the schema change. Disaster would follow.
78927 ** is not possible for another thread to start a new schema change
78929 ** locks on the schema, we just need to make sure nobody else is
78933 ** but it does *not* override schema lock detection, so this all still
78943 sqlite3Error(db, rc, "database schema is locked: %s", zDb);
79078 ** Rerun the compilation of a statement after a schema change.
79117 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
79119 ** and the statement is automatically recompiled if an schema change
79197 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
79199 ** and the statement is automatically recompiled if an schema change
80274 ** column specific strings, in case the schema is reset before this
83752 ** triggers on pTab in the TEMP schema. This routine prepends all
83761 Schema * const pTmpSchema = pParse->db->aDb[1].pSchema;
84177 ** This function is called to drop a trigger from the database schema.
84731 /* Sanity checking: The schema for the trigger and for the table are
84732 ** always defined. The trigger must be in the same schema as the table
85586 ** restored before returning. Then set the writable-schema flag, and
85626 ** to read the schema was concluded. Unlock it here so that this doesn't
85664 /* Query the schema of the main database. Create a mirror schema
85739 ** The increment is used to increase the schema cookie so that other
85740 ** connections to the same database will know to reread the schema.
85743 BTREE_SCHEMA_VERSION, 1, /* Add one to the old schema cookie */
86018 ** structure is associated with a single sqlite3* user of the schema.
86184 ** allows a schema that contains virtual tables to be loaded before
86188 Schema *pSchema = pTab->pSchema;
86280 const char *zFormat = "vtable constructor did not declare schema: %s";
86435 ** This function is used to set the schema of a virtual table. It is only
89045 ** set to 9. Given the same schema and either of the following WHERE
96144 /* The temp-database schema is allocated differently from the other schema
96146 ** So it needs to be freed here. Todo: Why not roll the temp schema into
96219 /* SQLITE_SCHEMA */ "database schema has changed",
97124 ** database schema yet. This is delayed until the first time the database
97454 /* Ensure the database schema has been loaded */
99167 ** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table
103559 ** comment above struct HashTableVtab) to the database schema. Both
110222 /* Create/Connect to the underlying relational database schema. If
110224 ** the r-tree table schema.