Lines Matching refs:schema

952 #define SQLITE_SCHEMA      17   /* The database schema changed */
2788 ** schema change. Hence, the application should ensure that the
2795 ** sqlite3_prepare_v2() to reprepare a statement after a schema change.
3383 ** ^If the database schema changes, instead of returning [SQLITE_SCHEMA] as it
3401 ** a schema change, on the first [sqlite3_step()] call following any change
3800 ** ^(For example, given the database schema:
5022 ** and schema data structures between [database connection | connections]
6358 ** memory used to store the schema for all databases associated
6361 ** schema memory is shared with other database connections due to
7805 ** The name of the schema table.
9313 Schema *pSchema; /* Pointer to database schema (possibly shared) */
9317 ** An instance of the following structure stores a database schema.
9334 int schema_cookie; /* Database schema version number for this file */
9343 u16 flags; /* Flags associated with this schema */
9359 ** The DB_SchemaLoaded flag is set after the database schema has been
9363 ** have been filled out. If the schema changes, these column names might
9366 #define DB_SchemaLoaded 0x0001 /* The schema has been loaded */
9390 ** with a particular database connection. Hence, schema information cannot
9391 ** be stored in lookaside because in shared cache mode the schema information
9393 ** schema information, the Lookaside.bEnabled flag is cleared so that
9394 ** lookaside allocations are not used to construct the schema objects.
9583 #define SQLITE_RecoveryMode 0x00800000 /* Ignore schema errors */
9840 ** the database schema.
9842 ** If the database schema is shared, then there is one instance of this
9844 ** schema. This is because each database connection requires its own unique
9848 ** schema is shared, as the implementation often stores the database
9857 ** database schema are initially stored in a linked-list pointed to by
9865 ** schema is being reloaded for some reason), the VTable objects are not
10277 ** Expr objects can use a lot of memory space in database schema. To
10835 u8 checkSchema; /* Causes schema cookie check after an error */
10861 yDbMask cookieMask; /* Bitmask of schema verified databases */
10896 Token sNameToken; /* Token with unqualified schema object name */
10944 * Each trigger present in the database schema is stored as an instance of
13137 ** to store the schema for all databases (main, temp, and any ATTACHed
47416 ** 44 4 File format of schema layer
47675 ** schema associated with the database file are all contained within
48211 ** db->aDb[iDb].pSchema structure. The mutexes required for schema
48323 ** Enable or disable the shared pager and schema features.
48374 ** function has to search through the database schema.
48377 ** hold a write-lock on the schema table (root page 1). This is also
48400 /* If the client is reading or writing an index and the schema is
48426 ** write-lock on the schema table, or (if the client is reading) a
55567 ** The schema layer numbers meta values differently. At the schema
56280 ** purposes (for example, to store a high-level schema associated with
56475 u32 iDestSchema; /* Original schema cookie in destination */
56853 /* Update the schema version field in the destination database. This
56854 ** is to make sure that the schema-version really does change in
56856 ** same schema version.
60572 /* Rollback or commit any schema changes that occurred. */
61882 ** schema change has occurred. That detail is handled by the
62016 ** sqlite3Step() to do most of the work. If a schema error occurs,
62562 ** as if there had been a schema change, on the first sqlite3_step() call
63656 u8 resetSchemaOnFault = 0; /* Reset schema after an error if positive */
66452 ** P3==1 is the schema version. P3==2 is the database format.
66483 ** into cookie number P2 of database P1. P2==1 is the schema version.
66505 /* When the schema cookie changes, record the new cookie internally */
66514 ** schema is changed. Ticket #1644 */
66524 ** schema version) and make sure it is equal to P2 and that the
66525 ** generation counter on the local schema parse equals P3.
66531 ** The cookie changes its value whenever the database schema changes.
66533 ** and that the current process needs to reread the schema.
66558 p->zErrMsg = sqlite3DbStrDup(db, "database schema has changed");
66559 /* If the schema-cookie from the database file matches the cookie
66560 ** stored with the in-memory representation of the schema, do
66561 ** not reload the schema from the database file.
66567 ** discard the database schema, as the user code implementing the
68468 ** schema consistent with what is on disk.
68480 ** schema consistent with what is on disk.
68492 ** schema consistent with what is on disk.
69944 {OP_VerifyCookie, 0, 0, 0}, /* 1: Check the schema cookie */
73865 ** part of the in-memory representation of the database schema.
74876 ** of a "NOT NULL" constraint in the database schema.
77078 const Schema *pTempSchema = pParse->db->aDb[1].pSchema; /* Temp db schema */
77082 ** that is not part of the temp-db schema, add a clause to the WHERE
77104 ** Argument zName is the name of the table in the database schema at
77124 /* Drop any table triggers from the internal schema. */
77132 /* Drop the table and index from the internal schema. */
77250 ** Then modify the schema cookie (since the ALTER TABLE modifies the
77251 ** schema). Open a statement transaction if the table is a virtual
77357 /* Drop and reload the internal table schema. */
77505 /* Reload the schema of the modified table. */
77593 /* Begin a transaction and increment the schema cookie. */
78052 /* Read the database schema. If an error occurs, leave an error message
78438 /* Allocate the new entry in the db->aDb[] array and initialise the schema
78454 ** it to obtain the database schema. At this point the schema may
78527 /* If the file was opened successfully, read the schema for the new database.
79022 Schema *pSchema, /* The schema of the expression */
79283 ** transaction on each used database and to verify the schema cookie
79409 /* All mutexes are required for schema access. Make sure we hold them. */
79439 /* Read the database schema. If an error occurs, leave an error message
79474 /* All mutexes are required for schema access. Make sure we hold them. */
79533 ** Erase all schema information from the in-memory hash tables of
79536 ** if there were schema changes during the transaction or if a
79537 ** schema-cookie mismatch occurs.
79539 ** If iDb<0 then reset the internal schema tables for all database
79540 ** files. If iDb>=0 then reset the internal schema for only the
79548 /* Case 1: Reset the single schema identified by iDb */
79582 ** schema hash tables and therefore do not have to make any changes
79826 ** unqualified name for a new schema object (table, index, view or
80425 ** Generate code that will increment the schema cookie.
80427 ** The schema cookie is used to determine when the schema for the
80428 ** database changes. After each schema change, the cookie value
80429 ** changes. When a process first reads the schema it records the
80431 ** it checks the cookie to make sure the schema has not changed
80435 ** the schema to change multiple times and for the cookie to be
80436 ** set back to prior value. But schema changes are infrequent
80685 ** as a schema-lock must have already been obtained to create it. Since
80686 ** a schema-lock excludes all other database users, the write-lock would
80991 ** This function is called by the VDBE to adjust the internal schema
81034 ** Also write code to modify the sqlite_master table and internal schema
81062 ** Code to update the sqlite_master tables and internal schema definitions
81286 /* Remove the table entry from SQLite's internal schema and modify
81287 ** the schema cookie.
81634 ** if initialising a database schema.
81688 ** sqlite_master table (because some other process changed the schema) and
82002 /* Fill the index with data and reparse the schema. Code an OP_Expire
82644 ** Generate VDBE code that will verify the schema cookie and start
82647 ** It is important that all schema cookies be verified and all
82654 ** record every database that needs its schema verified in the
82662 ** schema on any databases. This can be used to position the OP_Goto
82823 assert( sqlite3BtreeHoldsAllMutexes(db) ); /* Needed for schema access */
82858 /* Read the database schema. If an error occurs, leave an error message
83340 ** Free all resources held by the schema structure. The void* argument points
83343 ** of the schema hash tables).
83376 ** Find and return the schema associated with a BTree. Create
85805 ** search the schema a unique index on the parent key columns.
86242 ** given the following schema:
86322 ** any modifications to the schema are made. This is because statement
86323 ** transactions are not able to rollback schema changes. */
86389 ** schema items cannot be located, set an error in pParse and return
86614 ** the following schema:
90087 ** If the TEMP database is open, close it and mark the database schema
90495 /* Force the schema to be loaded on all databases. This cases all
91235 ** will be overwritten when the schema is next loaded. If it does not
91265 ** the value of the schema-version and user-version, respectively. Both
91266 ** the schema-version and the user-version are 32-bit signed integers
91269 ** The schema-cookie is usually only manipulated internally by SQLite. It
91270 ** is incremented by SQLite whenever the database schema is modified (by
91271 ** creating or dropping a table or index). The schema version is used by
91273 ** of the schema used when compiling the SQL query matches the schema of
91276 ** the schema-version is potentially dangerous and may lead to program
91286 int iCookie; /* Cookie index. 1 for schema-cookie, 6 for user-cookie. */
91501 ** interface, and routines that contribute to loading the database schema
91518 "malformed database schema (%s)", zObj);
91614 ** Attempt to read the database schema and initialize internal
91665 /* zMasterSchema and zInitScript are set to point at the master schema
91676 /* Construct the schema tables. */
91721 ** meta[0] Schema cookie. Changes with each schema change.
91722 ** meta[1] File format of schema layer.
91799 /* Read the schema information out of the schema tables
91832 ** the schema loaded, even if errors occurred. In this situation the
91835 ** of the schema was loaded before the error occurred. The primary
91885 /* Once all the other databases have been initialised, load the schema
91887 ** schema may contain references to objects in other databases.
91908 ** This routine is a no-op if the database schema is already initialised.
91909 ** Otherwise, the schema is loaded. An error code is returned.
91927 ** Check schema cookies in all databases. If any cookie is out
91928 ** of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
91956 /* Read the schema cookie from the database. If it does not match the
91957 ** value stored as part of the in-memory schema representation,
91974 ** Convert a schema pointer into the iDb index that indicates
91975 ** which database file in db->aDb[] the schema refers to.
92037 ** to the schema.
92040 ** schema changes and if those schema changes are subsequently rolled
92042 ** prepared statement goes to run the schema cookie would fail to detect
92043 ** the schema change. Disaster would follow.
92047 ** is not possible for another thread to start a new schema change
92049 ** locks on the schema, we just need to make sure nobody else is
92053 ** but it does *not* override schema lock detection, so this all still
92063 sqlite3Error(db, rc, "database schema is locked: %s", zDb);
92196 ** Rerun the compilation of a statement after a schema change.
92235 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
92237 ** and the statement is automatically recompiled if an schema change
92315 ** and so if a schema change occurs, SQLITE_SCHEMA is returned by
92317 ** and the statement is automatically recompiled if an schema change
93495 ** column specific strings, in case the schema is reset before this
97173 ** triggers on pTab in the TEMP schema. This routine prepends all
97616 ** This function is called to drop a trigger from the database schema.
98185 /* Sanity checking: The schema for the trigger and for the table are
98186 ** always defined. The trigger must be in the same schema as the table
99049 ** restored before returning. Then set the writable-schema flag, and
99092 ** to read the schema was concluded. Unlock it here so that this doesn't
99136 /* Query the schema of the main database. Create a mirror schema
99211 ** The increment is used to increase the schema cookie so that other
99212 ** connections to the same database will know to reread the schema.
99215 BTREE_SCHEMA_VERSION, 1, /* Add one to the old schema cookie */
99505 ** structure is associated with a single sqlite3* user of the schema.
99671 ** allows a schema that contains virtual tables to be loaded before
99770 const char *zFormat = "vtable constructor did not declare schema: %s";
99934 ** This function is used to set the schema of a virtual table. It is only
103303 ** set to 9. Given the same schema and either of the following WHERE
110944 /* The temp-database schema is allocated differently from the other schema
110946 ** So it needs to be freed here. Todo: Why not roll the temp schema into
111019 /* SQLITE_SCHEMA */ "database schema has changed",
112357 ** database schema yet. This is delayed until the first time the database
112693 /* Ensure the database schema has been loaded */
114747 ** Invoke sqlite3_declare_vtab() to declare the schema for the FTS3 table
115381 /* Declare the table schema to SQLite. */
121971 ** comment above struct HashTableVtab) to the database schema. Both
130103 /* Create/Connect to the underlying relational database schema. If
130105 ** the r-tree table schema.