• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/minidlna/sqlite-3.6.22/

Lines Matching defs:an

2 ** This file is an amalgamation of many separate C source files from SQLite
58 ** on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2
113 ** * Columns in an index
115 ** * Terms in the SET clause of an UPDATE statement
118 ** * Terms in the VALUES clause of an INSERT statement
142 ** The maximum depth of an expression tree. This is limited to
144 ** want to place more severe limits on the complexity of an
176 ** The maximum number of arguments to an SQL function.
215 ** incompatible with an SQLite library compiled with a different limit. If
217 ** crashes, then an instance of SQLite compiled with the default page-size
313 ** This macro is used to "hide" some ugliness in casting an int
347 ** Older versions of SQLite used an optional THREADSAFE macro.
430 ** option is set. Thus NDEBUG becomes an opt-in rather than an opt-out
614 ** ^(The [SQLITE_VERSION_NUMBER] C preprocessor macro resolves to an integer
627 ** string contains the date and time of the check-in (UTC) and an SHA1
661 ** sqlite3_libversion_number() function returns an integer equal to
692 ** This interface can be used by an application to make sure that the
715 ** Each open SQLite database is represented by a pointer to an instance of
716 ** the opaque structure named "sqlite3". It is useful to think of an sqlite3
717 ** pointer as an object. The [sqlite3_open()], [sqlite3_open16()], and
721 ** [sqlite3_busy_timeout()] to name but three) that are methods on an
781 ** pointer or an [sqlite3] object pointer obtained
801 ** that allows an application to run multiple statements of SQL
815 ** ^If an error occurs while evaluating the SQL statements passed into
827 ** ^If an sqlite3_exec() callback returns non-zero, the sqlite3_exec()
833 ** callback is an array of pointers to strings obtained as if from
834 ** [sqlite3_column_text()], one for each column. ^If an element of a
837 ** sqlite3_exec() callback is an array of pointers to strings where each
842 ** to an empty string, or a pointer that contains only whitespace and/or
870 ** Many SQLite functions return an integer result code from the set shown
882 #define SQLITE_ABORT 4 /* Callback routine requested an abort */
917 ** much information about problems as programmers might like. In an effort to
980 ** object returns an integer which is a vector of the these
988 ** are aligned to an address which is an integer multiple of
1013 ** of an [sqlite3_io_methods] object.
1024 ** When SQLite invokes the xSync() method of an
1042 ** An [sqlite3_file] object represents an open file in the
1046 ** for their own use. The pMethods entry is a pointer to an
1052 const struct sqlite3_io_methods *pMethods; /* Methods for an open file */
1058 ** Every file opened by the [sqlite3_vfs] xOpen method populates an
1060 ** [sqlite3_file] object) with a pointer to an instance of this object.
1091 ** VFS implementations to directly control an open file using the
1092 ** [sqlite3_file_control()] interface. The second "op" argument is an
1128 ** are aligned to an address which is an integer multiple of
1171 ** into an integer that the pArg argument points to. This capability
1183 ** The mutex module within SQLite defines [sqlite3_mutex] to be an
1185 ** at the internal representation of an [sqlite3_mutex]. It only
1259 ** change the way it deals with files. For example, an application
1283 ** be created, and that it is an error if it already exists.
1350 ** the xAccess method of an [sqlite3_vfs] object. They determine
1373 ** A call to sqlite3_initialize() is an "effective" call if it is
1376 ** following a call to sqlite3_shutdown(). ^(Only an effective call
1380 ** A call to sqlite3_shutdown() is an "effective" call if it is the first
1382 ** an effective call to sqlite3_shutdown() does any deinitialization.
1398 ** as a mutex) it returns an [error code] other than [SQLITE_OK].
1401 ** SQLite interfaces so that an application usually does not need to
1461 ** implementation of an application-defined [sqlite3_os_init()].
1463 ** The first argument to sqlite3_config() is an integer
1488 ** configuration verb - an integer code that indicates what
1507 ** A pointer to an instance of this object is the argument to
1510 ** By creating an instance of this object
1512 ** during configuration, an application can specify an alternative
1520 ** also used during testing of SQLite in order to specify an alternative
1566 ** SQLite will never invoke xInit() more than once without an intervening
1573 void *(*xRealloc)(void*,int); /* Resize an allocation */
1574 int (*xSize)(void*); /* Return the size of an allocation */
1638 ** <dd> ^(This option takes a single argument which is a pointer to an
1646 ** <dd> ^(This option takes a single argument which is a pointer to an
1671 ** scratch memory. There are three arguments: A pointer an 8-byte
1677 ** The first argument must be a pointer to an 8-byte aligned buffer
1689 ** This configuration should not be used if an application-define page
1698 ** argument should point to an allocation of at least sz*N bytes of memory.
1705 ** be aligned to an 8-byte boundary or subsequent behavior of SQLite
1720 ** The first pointer (the memory pointer) must be aligned to an 8-byte
1724 ** <dd> ^(This option takes a single argument which is a pointer to an
1736 ** <dd> ^(This option takes a single argument which is a pointer to an
1760 ** an [sqlite3_pcache_methods] object. This object specifies the interface
1765 ** <dd> ^(This option takes a single argument which is a pointer to an
1806 ** pointer to an memory buffer to use for lookaside memory.
1813 ** must be aligned to an 8-byte boundary. ^If the second argument to
1835 ** ^Each entry in an SQLite table has a unique 64-bit signed
1837 ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those
1847 ** ^(If an [INSERT] occurs within a trigger, then the [rowid] of the inserted
1862 ** ^For the purposes of this routine, an [INSERT] is considered to
1889 ** ^Changes to a view that are simulated by an [INSTEAD OF trigger]
1893 ** caused by an INSERT, DELETE, or UPDATE statement. Rows that
1941 ** count does not include rows of views that fire an [INSTEAD OF trigger],
1971 ** ^If an SQL operation is very nearly finished at the time when
1972 ** sqlite3_interrupt() is called, then it might not have an opportunity
1976 ** ^If the interrupted SQL operation is an INSERT, UPDATE, or DELETE
1977 ** that is inside an explicit transaction, then the entire transaction
2036 ** an attempt is made to open a database table that another thread
2059 ** to promote to an exclusive lock. The first process cannot proceed
2076 ** cache will be left in an inconsistent state and so the error
2079 ** forces an automatic rollback of the changes. See the
2108 ** ^Calling this routine with an argument less than or equal to zero
2130 ** A result table is an array of pointers to zero-terminated UTF-8 strings.
2141 ** As an example of the result table format, suppose a query result
2154 ** in an array names azResult. Then azResult holds this content:
2214 ** first two parameters is reversed from snprintf().)^ This is an
2246 ** One can use this text in an SQL statement as follows:
2268 ** This second example is an SQL syntax error. As a general rule you should
2337 ** is always aligned to at least an 8 byte boundary.
2425 ** rejected with an error. ^If the authorizer callback returns
2428 ** the authorizer will fail with an error message.
2433 ** authorizer will fail with an error message explaining that
2438 ** to the callback is an integer [SQLITE_COPY | action code] that specifies
2448 ** return can be used to deny an untrusted user access to individual
2455 ** SQL statements from an untrusted source, to ensure that the SQL statements
2458 ** example, an application may allow a user to enter arbitrary
2468 ** in addition to using an authorizer.
2506 #define SQLITE_DENY 1 /* Abort the SQL statement with an error */
2507 #define SQLITE_IGNORE 2 /* Don't allow access, but don't generate an error */
2514 ** second parameter to the callback is an integer code that specifies
2571 ** various times when an SQL statement is being run by [sqlite3_step()].
2580 ** the original statement text and an estimate of wall-clock time
2611 ** ^These routines open an SQLite database file whose name is given by the
2615 ** returned in *ppDb, even if an error occurs. The only exception is that
2619 ** [SQLITE_OK] is returned. Otherwise an [error code] is returned.)^ ^The
2621 ** an English language description of the error following a failure of any
2628 ** Whether or not an error occurs when it is opened, resources
2643 ** already exist, an error is returned.</dd>)^
2648 ** case the database must already exist, otherwise an error is returned.</dd>)^
2682 ** ^If the filename is an empty string, then a private, temporary
2741 ** If an interface fails with SQLITE_MISUSE, that means the interface
2805 ** created by an untrusted script can be contained using the
2826 ** <dd>The maximum length of an SQL statement, in bytes.</dd>)^
2830 ** result set of a [SELECT] or the maximum number of columns in an index
2831 ** or in an ORDER BY or GROUP BY clause.</dd>)^
2841 ** used to implement an SQL statement.</dd>)^
2854 ** <dd>The maximum number of variables in an SQL statement that can
2877 ** To execute an SQL query, it must first be compiled into a byte-code
2895 ** performance advantage to be gained by passing an nByte parameter that
2905 ** executed using [sqlite3_step()]. ^If there is an error, *ppStmt is set
2906 ** to NULL. ^If the input text contains no SQL (if the input is an empty
2913 ** otherwise an [error code] is returned.
2932 ** of the parsing error that results in an [SQLITE_SCHEMA] return.
2936 ** ^When an error occurs, [sqlite3_step()] will return one of the detailed
3002 ** will accept either a protected or an unprotected sqlite3_value.
3008 ** sqlite3_value object but no mutex is held for an unprotected
3033 ** The context in which an SQL function executes is stored in an
3034 ** sqlite3_context object. ^A pointer to an sqlite3_context object
3061 ** In the templates above, NNN represents an integer literal,
3062 ** and VVV represents an alphanumeric identifer.)^ ^The values of these
3071 ** ^The leftmost SQL parameter has an index of 1. ^When the same named
3099 ** (just an integer to hold its size) while it is being processed.
3115 ** ^The sqlite3_bind_* routines return [SQLITE_OK] on success or an
3166 ** ^The first host parameter has an index of 1, not 0.
3183 ** ^Return the index of an SQL parameter given its name. ^The
3209 ** [prepared statement]. ^This routine returns 0 if pStmt is an SQL
3210 ** statement that does not return data (for example an [UPDATE]).
3234 ** that column, if there is an AS clause. If there is no AS clause
3263 ** ^If the Nth column returned by the statement is an expression or
3296 ** returned result set of that [SELECT] is a table column (not an
3298 ** column is returned.)^ ^If the Nth column of the result set is an
3345 ** or occurs outside of an explicit transaction, then you can retry the
3480 ** value from sqlite3_column_blob() for a zero-length BLOB is an arbitrary
3487 ** ^The object returned by [sqlite3_column_value()] is an
3600 ** SQLITE_OK is returned. ^If execution of the statement failed then an
3606 ** encountering an error or an [sqlite3_interrupt | interrupt].
3631 ** [prepared statement] S indicated an error, then
3632 ** [sqlite3_reset(S)] returns an appropriate [error code].
3653 ** function is to be added. ^If an application uses more than one database
3683 ** ^(The fifth parameter is an arbitrary pointer. The implementation of the
3688 ** aggregate. ^A scalar SQL function requires an implementation of the xFunc
3690 ** parameters. ^An aggregate SQL function requires an implementation of xStep
3691 ** and xFinal and NULL should be passed for xFunc. ^To delete an existing
3711 ** prior application-defined functions that are an exact match for the
3782 ** The 4th parameter to these callbacks is an array of pointers to
3788 ** Any attempt to use these routines on an [unprotected sqlite3_value]
3793 ** pointer instead of a [sqlite3_stmt*] pointer and an integer column number.
3801 ** numeric affinity to the value. This means that an attempt is
3802 ** made to convert the value to an integer or floating point. If
3844 ** an aggregate query, the xStep() callback of the aggregate function
3973 ** an application-defined function to be the BLOB whose content is pointed
3982 ** an application-defined function to be a floating point value specified
3986 ** cause the implemented SQL function to throw an exception.
3989 ** as the text of an error message. ^SQLite interprets the error
4003 ** returned by SQLite as a result of an error in a function. ^By default,
4007 ** ^The sqlite3_result_toobig() interface causes SQLite to throw an error
4010 ** ^The sqlite3_result_nomem() interface causes SQLite to throw an error
4057 ** ^A [protected sqlite3_value] object may always be used where an
4118 ** except that it takes an extra argument which is a destructor for
4156 ** [database connection] to be invoked whenever an undefined collation
4189 ** Specify the key for an encrypted database. This routine should be
4201 ** Change the key on an open database. If the current database is not
4236 ** is a NULL pointer, then SQLite performs a search for an appropriate
4275 ** an error is to use this function.
4305 ** [sqlite3_next_stmt(D,S)] must refer to an open database
4347 ** rolled back if an explicit "ROLLBACK" statement is executed, or
4348 ** an error or constraint causes an implicit rollback to occur.
4378 ** ^In the case of an update, this is the [rowid] after the update takes place.
4384 ** is not invoked when duplication rows are deleted because of an
4420 ** ^Cache sharing is enabled and disabled for an entire process.
4446 ** pages to improve performance is an example of non-essential memory.
4457 ** ^If an internal allocation is requested that would exceed the
4478 ** is an upper bound on the total memory allocation for all threads. In
4493 ** (i.e. "main", "temp", or an attached database) containing the specified
4522 ** ^If the specified table is actually a view, an [error code] is returned.
4524 ** ^If the specified column is "rowid", "oid" or "_rowid_" and an
4538 ** ^(This function may load one or more schemas from database files. If an
4540 ** cannot be found, an [error code] is returned and an error message left
4561 ** ^This interface loads an SQLite extension library from the named file.
4563 ** ^The sqlite3_load_extension() interface attempts to load an
4571 ** ^If an error occurs and pzErrMsg is not 0, then the
4579 ** otherwise an error will be returned.
4613 ** in an array that is obtained from [sqlite3_malloc()]. That memory
4616 ** ^This function registers an extension entry point that is
4725 ** and makes other simplifications to the WHERE clause in an attempt to
4749 ** ^The estimatedCost value is an estimate of the cost of doing the
4799 ** parameter is an arbitrary client data pointer that is passed through
4836 ** ^Virtual tables methods can set an error message by assigning a
4896 ** of the new function always causes an exception to be thrown. So
4919 ** An instance of this object represents an open BLOB on which
4942 ** ^It is not possible to open a column that is part of an index or primary
4953 ** to *ppBlob. Otherwise an [error code] is returned and *ppBlob is set
4961 ** ^(If the row that a BLOB handle points to is modified by an
4967 ** a expired BLOB handle fail with an return code of [SQLITE_ABORT].
4979 ** to create an empty, zero-filled blob in which to read or write using
4998 ** ^Closes an open [BLOB handle].
5012 ** an error code, the BLOB is still closed.)^
5037 ** ^(This function is used to read data from an open [BLOB handle] into a
5047 ** ^An attempt to read from an expired [BLOB handle] fails with an
5051 ** Otherwise, an [error code] or an [extended error code] is returned.)^
5065 ** ^This function is used to write data into an open [BLOB handle] from a
5081 ** ^An attempt to write to an expired [BLOB handle] fails with an
5089 ** Otherwise, an [error code] or an [extended error code] is returned.)^
5103 ** A virtual filesystem (VFS) is an [sqlite3_vfs] object
5119 ** ^To make an existing VFS into the default VFS, register it again
5122 ** VFS is registered with a name that is NULL or an empty string,
5170 ** will unwind its stack and return an error. ^(The argument
5224 ** mutex must be exited an equal number of times before another thread
5233 ** sqlite3_mutex_try() as an optimization so this is acceptable behavior.)^
5264 ** creates and populates an instance of this structure to pass
5266 ** Additionally, an instance of this structure can be used as an
5301 ** (i.e. it is acceptable to provide an implementation that segfaults if
5337 ** never uses these routines except inside an assert() and applications
5418 ** an incorrect zDbName and an SQLITE_ERROR return from the underlying
5430 ** purposes. ^The first parameter is an operation code that determines
5476 ** highwater marks. ^The first argument is an integer code for
5643 ** an index.
5648 ** is an integer code for a specific [SQLITE_STMTSTATUS_SORT | counter]
5675 ** A non-zero value in this counter may indicate an opportunity to
5703 ** register an alternative page cache implementation by passing in an
5707 ** custom page cache using this API, an application can control more
5713 ** ^(The contents of the sqlite3_pcache_methods structure are copied to an
5734 ** ^SQLite will never invoke xInit() more than once without an intervening
5742 ** will the page size of the database file that is to be cached plus an
5750 ** false if it is used for an in-memory database. ^The cache implementation
5768 ** ^A 'page', in this context, is a buffer of szPage bytes aligned at an
5809 ** previously contains an entry associated with newKey, it should be
5844 ** The sqlite3_backup object records state information about an ongoing
5889 ** an [ATTACH] statement for an attached database.
5895 ** an error.
5897 ** ^If an error occurs within sqlite3_backup_init(D,N,S,M), then NULL is
5898 ** returned and an error code and error message are store3d in the
5903 ** ^A successful call to sqlite3_backup_init() returns a pointer to an
5918 ** ^If an error occurs while running sqlite3_backup_step(B,N),
5919 ** then an [error code] is returned. ^As well as [SQLITE_OK] and
5921 ** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an
5926 ** the destination is an in-memory database with a different page size
5946 ** ^The first call to sqlite3_backup_step() obtains an exclusive lock
5954 ** through the backup process. ^If the source database is modified by an
5977 ** ^If an out-of-memory condition or IO error occurred during any prior
6046 ** an [SQLITE_LOCKED] error if the required locks on the shared-cache or
6062 ** has locked the required resource is stored internally. ^After an
6063 ** application receives an SQLITE_LOCKED error, it may call the
6090 ** The unlock-notify callback is not reentrant. If an application invokes
6091 ** any sqlite3_xxx API functions from within an unlock-notify callback, a
6099 ** When an unlock-notify callback is registered, the application provides a
6102 ** it an array of void* context pointers. The first argument passed to
6103 ** an unlock-notify callback is a pointer to an array of void* pointers,
6107 ** more than one blocked connection that has registered for an unlock-notify
6111 ** specified by the blocked connections bundled together into an array.
6112 ** This gives the application an opportunity to prioritize any actions
6117 ** Assuming that after registering for an unlock-notify callback a
6129 ** a deadlocked state if connection A has registered for an unlock-notify
6131 ** B has itself registered for an unlock-notify callback when connection
6134 ** registered for an unlock-notify callback on the conclusion of connection
6148 ** or "DROP INDEX" query, an infinite loop might be the result.
6151 ** by an sqlite3_step() call. ^(If there is a blocking connection, then the
6213 /* A complete hash table is an instance of the following structure.
6244 /* Each element in the hash table is an instance of the following
6504 ** The "file format" number is an integer that is incremented whenever
6645 ** Assert that the pointer X is aligned to an 8-byte boundary. This
6696 ** an array.
6702 ** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT.
6737 ** implementation of an SQL aggregate step callback may not use the
6927 ** to constants so that the offset of the corresponding field in an
7063 ** or VDBE. The VDBE implements an abstract machine that runs a
7070 ** A single VDBE is an opaque structure named "Vdbe". Only routines
7085 ** A single instruction of the virtual machine has an opcode
7087 ** as an instance of the following structure:
7093 u8 p5; /* Fifth parameter is an unsigned character */
7159 #define P4_VTAB (-10) /* P4 is a pointer to an sqlite3_vtab structure */
7367 #define OPFLG_IN1 0x0004 /* in1: P1 is an input */
7368 #define OPFLG_IN2 0x0008 /* in2: P2 is an input */
7369 #define OPFLG_IN3 0x0010 /* in3: P3 is an input */
7370 #define OPFLG_OUT2 0x0020 /* out2: P2 is an output */
7371 #define OPFLG_OUT3 0x0040 /* out3: P3 is an output */
7509 ** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
7655 ** Every page in the cache is controlled by an instance of the following
7750 /* Increment the reference count of an existing page */
7949 ** process that requests an EXCLUSIVE lock may actually obtain a PENDING
7950 ** lock. This can be upgraded to an EXCLUSIVE lock by a subsequent call to
8003 ** is set high so that we don't have to allocate an unused page except
8085 ** to all source files. We break it out in an effort to keep the code
8148 ** Each database file to be accessed by the system is an instance
8263 ** Each database is an instance of the following structure.
8265 ** The sqlite.lastRowid records the last insert rowid generated by an
8379 ** tried to do recently failed with an SQLITE_LOCKED error due to locks
8446 ** Each SQL function is defined by an instance of the following
8487 ** Used to create an aggregate function definition implemented by
8534 ** Each SQLite module (virtual table definition) is defined by an
8546 ** information about each column of an SQL table is held in an instance
8564 ** A "Collating Sequence" is defined by an instance of the following
8575 ** The CollSeq.pUser member variable is an extra parameter that passed in
8581 ** collating sequence is undefined. Indices built on an undefined
8630 ** The SQLITE_AFF_MASK values masks off the significant bits of an
8636 ** Additional bit values that can be ORed with an affinity without
8664 ** When an sqlite3_prepare() operation is required to access the virtual
8669 ** When an in-memory Table object is deleted (for example when the
8677 ** Refer to comments above function sqlite3VtabUnlockList() for an
8678 ** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect
8694 ** Each SQL table is represented in memory by an instance of the
8702 ** pointer to an array of Column structures, one for each column.
8704 ** If the table has an INTEGER PRIMARY KEY, then Table.iPKey is the index of
8779 ** Each foreign key constraint is an instance of the following structure.
8793 ** Each REFERENCES clause generates an instance of the following structure
8821 ** the operation in progress stops and returns an error code. But prior
8863 u8 *aSortOrder; /* If defined an aSortOrder[i] is true, sort DESC */
8872 ** A record is an object that contains one or more fields of data.
8874 ** the key of an index. A blob encoding of a record is created by
8895 #define UNPACKED_INCRKEY 0x0008 /* Make this key an epsilon larger */
8900 ** Each SQL index is represented in memory by an
8914 ** first column to be indexed (c3) has an index of 2 in Ex1.aCol[].
8915 ** The second column to be indexed (c1) has an index of 0 in
8922 ** algorithm to employ whenever an attempt is made to insert a non-unique
8956 ** Each token coming out of the lexer is an instance of
8957 ** this structure. Tokens are also used as part of an expression.
9029 ** Each node of an expression in the parse tree is an instance
9033 ** as opcodes here. For example, the parser defines TK_GE to be an integer
9038 ** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB,
9041 ** variable name. Finally, if the expression is an SQL function (TK_FUNCTION),
9047 ** Expr.x.pList is a list of arguments if the expression is an SQL function,
9048 ** a CASE expression or an IN expression of the form "<lhs> IN (<y>, <z>...)".
9049 ** Expr.x.pSelect is used if the expression is a sub-select or an expression of
9058 ** expression is used as a result in an aggregate SELECT, then the
9062 ** If the expression is an unbound variable marker (a question mark
9066 ** If the expression is a subquery then Expr.iColumn holds an integer
9079 ** help reduce memory requirements, sometimes an Expr object will be
9085 ** an Expr object is truncated. When EP_Reduced is set, then all
9144 #define EP_InfixFunc 0x0080 /* True for an infix function: LIKE, GLOB, etc */
9162 ** flag on an expression structure. This flag is used for VV&A only. The
9183 ** struct, an Expr struct with the EP_Reduced flag set in Expr.flags
9184 ** and an Expr struct with the EP_TokenOnly flag set.
9200 ** list of "ID = expr" items in an UPDATE. A list of expressions can
9221 ** the parse tree for an expression and the span of input text for an
9239 ** column names after a table name in an INSERT statement. In the statement
9275 ** is modified by an INSERT, DELETE, or UPDATE statement. In standard SQL,
9396 #define WHERE_FORCE_TABLE 0x0040 /* Do not use an index-only search */
9510 #define SRT_Union 1 /* Store result as keys in an index */
9520 #define SRT_Set 7 /* Store results as keys in an index */
9521 #define SRT_Table 8 /* Store result as data with an automatic rowid */
9563 ** trigger that may be fired while parsing an INSERT, UPDATE or DELETE
9610 u8 checkSchema; /* Causes schema cookie check after an error */
9638 u8 mayAbort; /* True if statement may throw an ABORT exception */
9708 #define OPFLAG_ISUPDATE 0x04 /* This OP_Insert is an sql UPDATE */
9709 #define OPFLAG_APPEND 0x08 /* This is likely to be an append */
9714 * Each trigger present in the database schema is stored as an instance of
9734 IdList *pColumns; /* If this is an UPDATE OF <column-list> trigger,
9743 ** A trigger is either a BEFORE or an AFTER trigger. The following constants
9767 * pSelect -> If this is an INSERT INTO ... SELECT ... statement, then
9770 * pExprList -> If this is an INSERT INTO ... VALUES ... statement, then
9772 * pIdList -> If this is an INSERT INTO ... (<column-names>) VALUES ...
10676 ** Bit 0x40 is set if the character non-alphanumeric and can be used in an
10679 ** part of an identifier is 0x46.
10783 ** 0x40000000 results in an incompatible database file format!
10876 ** This implementation assumes that reading or writing an aligned
10877 ** 32-bit integer is an atomic operation. If that assumption is not true,
10979 ** already, check for an MSVC build environment that provides
11073 ** A missing specifier is not considered an error.
12224 ** ability to simulate a malloc failure, so that the handling of an
12344 ** abandons the current operation and returns an error code (usually
12539 ** Like realloc(). Resize an allocation previously obtained from
12764 ** Given an allocation, find the MemBlockHdr for that allocation.
12783 ** to rounding up to an 8 byte boundary to ensure
12950 ** Change the size of an existing memory allocation.
13155 ** the chunk. In this way, the first chunk has an index of 1.
13197 ** True if we are evaluating an out-of-memory callback.
13321 ** Called when we are unable to satisfy an allocation of nBytes.
13389 ** or same size hash. In other words, *pRoot is an entry in either
13457 ** Look for an entry of the correct size in either the small
13519 ** Free an outstanding memory allocation.
13561 ** Return the size of an outstanding allocation, in bytes. The
13607 ** Change the size of an existing memory allocation
13827 ** that an application can, at any time, verify this constraint.
13837 ** A minimum allocation is an instance of the following structure.
13838 ** Larger allocations are an array of these structures where the
13915 ** Assuming mem5.zPool is divided up into an array of Mem5Link
13975 ** Return the size of an outstanding allocation, in bytes. The
14074 ** Free an outstanding memory allocation.
14156 ** Change the size of an existing memory allocation.
14163 ** of two. If nBytes==0 that means that an oversize allocation
14164 ** (an allocation larger than 0x40000000) was requested and this
14376 ** and uninitialized so that we can assert() if there is an attempt to
14483 ** is not currently entered. If a NULL pointer is passed as an argument
14649 ** mutex must be exited an equal number of times before another thread
14722 ** Each recursive mutex is an instance of the following structure.
14743 ** SQLite will unwind its stack and return an error. The argument
14894 ** mutex must be exited an equal number of times before another thread
14995 ** Each recursive mutex is an instance of the following structure.
15017 ** not an atomic operation, then these routines might delivery
15047 ** will unwind its stack and return an error. The argument
15154 ** mutex must be exited an equal number of times before another thread
15318 ** Each recursive mutex is an instance of the following structure.
15331 ** Here is an interesting observation: Win95, Win98, and WinME lack
15423 ** will unwind its stack and return an error. The argument
15507 ** mutex must be exited an equal number of times before another thread
15522 ** is used it is merely an optimization. So it is OK for it to always
15845 ** signed integer value might cause an integer overflow inside of the
15875 ** case by setting scratchAllocOut to 1 when an allocation
15888 ** structures that would not normally fit on the stack of an
16040 ** Change the size of an existing memory allocation
16126 ** This is an important assumption. There are many places in the
16296 ** an historical reference. Most of the "enhancements" have been backed
16301 ** The following modules is an enhanced replacement for the "printf" subroutines
16309 ** * snprintf -- Works like sprintf, but has an extra argument
16328 ** * The %b field outputs an integer in binary notation.
16372 ** An "etByte" is an 8-bit unsigned value.
16378 ** by an instance of the following structure
17100 ** Reset an StrAccum string. Reclaim all malloced memory.
17159 ** to modify an existing string. For example:
17334 ** number generator) not as an encryption device.
17471 ** executed by a virtual machine. Each instruction is an instance
17488 ** Every cursor that the virtual machine has open is represented by an
17507 Bool isIndex; /* True if an index containing keys only - no data */
17517 /* Result of last sqlite3BtreeMoveto() done by an OP_NotExists or
17609 ** If the MEM_Null flag is set, then the value is an SQL NULL value.
17623 #define MEM_Int 0x0004 /* Value is an integer */
17638 #define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */
17639 #define MEM_Agg 0x2000 /* Mem.z points to an agg function context */
17674 ** The "context" argument for a installable function. A pointer to an
17712 ** is really a pointer to an instance of this structure.
17733 Mem *pResultSet; /* Pointer to an array of results */
17737 u8 errorAction; /* Recovery action to do in case of an error */
17768 FILE *trace; /* Write an execution trace here, if not NULL */
17977 ** * This routine accepts an infinite number of different UTF8 encodings
18027 ** desiredEnc. It is an error if the string is already of the desired
18264 ** NULL is returned if there is an allocation error.
18432 ** this implementation is provided as an alternative.
18440 ** which depend on an exact implementation of IEEE or ISO
18489 ** %d Insert an integer
18517 ** Add an error message to pParse->zErrMsg and increment pParse->nErr.
18522 ** %d Insert an integer
18527 ** compiling an SQL statement (i.e. within sqlite3_prepare()). The
18554 ** Convert an SQL-style quoted string into a normal string by removing
18626 ** contains the '.' character or an "E+000" style exponentiation suffix.
18629 ** an integer - it might be too big.
18660 ** The string z[] is an ASCII representation of a real number.
18824 ** the value of the integer into *pNum. If zNum is not an integer
18825 ** or is an integer that is too large to be expressed with 64 bits,
18869 ** The string zNum represents an unsigned integer. The zNum string
18889 assert( zNum[0]>='0' && zNum[0]<='9' ); /* zNum is an unsigned number */
18909 ** If zNum represents an integer that will fit in 32-bits, then set
19266 /* For following code (kept for historical record only) shows an
19346 ** Translate a single byte of Hex into an integer.
19388 ** Return an error (non-zero) if the magic was not SQLITE_MAGIC_OPEN
19391 ** This routine is called when entering an SQLite API. The SQLITE_MAGIC_OPEN
19401 ** But usually the problem will be seen. The result will be an
19427 ** Return an error (non-zero) if the magic was not SQLITE_MAGIC_BUSY
19456 ** used as an argument to sqlite3_errmsg() or sqlite3_close().
19615 /* This function (for internal use only) locates an element in an
19679 /* Attempt to locate an element of the hash table pH with a key
19699 /* Insert an element into the hash table pH. The key is pKey,nKey
19957 ** OS layer for an embedded system, if you use this file as an example,
20300 ** Truncate an open file to a specified size
20425 APIRET res = NO_ERROR; /* Result of an OS/2 lock call */
20506 /* Acquire an EXCLUSIVE lock
20777 ** This vector defines all the methods that can operate on an
21080 * symbol with an extra underscore, that might be needed depending
21356 ** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2
21433 ** structure are used to store the file descriptor while waiting for an
21936 ** A pointer to an instance of the following structure can be used as a
22020 /* Search for an existing entry that matching the canonical name.
22082 ** an exclusive lock on fd1, then try to get an exclusive lock
22107 ** The sqlite3_file structure for POSIX is no longer just an integer file
22115 ** file is unlocked. cnt==-1 means the file has an exclusive lock.
22121 ** a locked and an unlocked state.
22128 ** a pointer to an unixOpenCnt structure. There is one unixOpenCnt structure
22130 ** unixOpenCnt. When an attempt is made to close an unixFile, if there are
22153 ** lock. Hence there is an extra field in the key to the unixLockInfo
22161 ** Set or check the unixFile.tid field. This field is set when an unixFile
22205 ** tid is omitted if we compile without threading support or on an OS
22221 ** structure contains a pointer to an instance of this object and this
22236 ** inode. If a close is attempted against an inode that is holding
22426 ** return values might be uninitialized if an error occurs.
22431 ** Return an appropriate error code.
22462 /* On OS X on an msdos filesystem, the inode number is reported
22467 ** an ASCII 'S' character which also happens to be the first byte
22559 ** If the unixFile is locked and an ownership is wrong, then return
22604 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
22837 ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will
22895 /* We are trying for an exclusive lock but another thread in this
22963 ** Otherwise, if an error occurs, then successfully closed file descriptor
23080 /* Decrement the shared lock counter. Release the lock using an
23254 ** Nevertheless, a dotlock is an appropriate locking mode for use if no
23259 ** The existance of a lock file implies an EXCLUSIVE lock. All other lock
23273 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
23349 /* grab an exclusive lock */
23446 ** PENDING locks are the same thing as an EXCLUSIVE lock. SQLite
23459 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
23484 /* unlock failed with an error */
23556 /* grab an exclusive lock */
23600 /* shared can just be set because we always have an exclusive */
23658 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
23777 /* shared can just be set because we always have an exclusive */
23854 ** This is a utility for setting or clearing a bit-range lock on an
23903 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
24006 ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will
24064 /* Acquire an EXCLUSIVE lock */
24427 ** unix systems. The following procedure is an attempt to make
24433 ** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
24445 ** as far as SQLite is concerned, an fdatasync() is always adequate.
24487 /* If the FULLFSYNC failed, fall back to attempting an fsync().
24490 ** isn't supported for this file system. So, attempt an fsync
24584 ** Truncate an open file to a specified size
24649 ** Information and control of an open file handle.
25045 /* If an error occured in findLockInfo(), close the file descriptor
25152 ** SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
25153 ** or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
25202 /* It's odd to simulate an io-error here, but really this is just
25251 ** Search for an unused file descriptor that was opened on the database
25269 /* Do not search for an unused file descriptor on vxworks. Not because
25272 ** not to risk breaking vxworks support for the sake of such an obscure
25278 ** almost certain that an open() call on the same path will also fail.
25279 ** For this reason, if an error occurs in the stat() call here, it is
25281 ** descriptor on the same path, fail, and return an error to SQLite.
25620 /* It's odd to simulate an io-error here, but really this is just
25860 ** shared range is taken for an EXCLUSIVE lock):
25926 ** by taking an sqlite-style shared lock on the conch file, reading the
25932 ** host ID and/or proxy path, then the lock is escalated to an exclusive
25952 ** The shared lock and an open file descriptor are maintained until
26070 /* writes the host id path to path, path should be an pre-allocated buffer
26521 ** Takes an already filled in unix file and alters it so all file locking
26657 ** is set to SQLITE_OK unless an I/O error occurs during lock checking.
26793 ** The following macro defines an initializer for an sqlite3_vfs object.
26809 ** database file and tries to choose an locking method appropriate for
26925 ** OS layer for an embedded system, if you use this file as an example,
27192 BOOL bExclusive; /* Indicates an exclusive lock has been obtained */
27247 ** Here is an interesting observation: Win95, Win98, and WinME lack
27313 ** Convert an ansi string to microsoft unicode, based on the
27579 /* Wanting an exclusive lock? */
27643 /* Releasing a reader lock or an exclusive lock */
27645 /* Did we have an exclusive lock? */
27722 ** It is reported that an attempt to close a handle might sometimes
27727 ** giving up and returning an error.
27847 ** Truncate an open file to a specified size
28101 /* Acquire an EXCLUSIVE lock
28246 ** This vector defines all the methods that can operate on an
28568 ** up and returning an error.
28838 ** an Ansi string regardless of the _UNICODE setting */
28963 ** strerror_r() on unix). After an error is returned by an OS
28977 ** Not supplying an error message will have no adverse effect
28978 ** on SQLite. It is fine to have an implementation that never
28979 ** returns an error message:
28986 ** However if an error message is supplied, it will be incorporated
29043 ** This file implements an object that represents a fixed-length
29095 ** (an arbitrary prime)in the hash function provided
29103 ** A bitmap is an instance of the following structure.
29184 ** Set the i-th bit. Return 0 on success and an error code if
29189 ** that can go wrong with an insert, assuming p and i are valid.
29324 ** Let V[] be an array of unsigned characters sufficient to hold
29325 ** up to N bits. Let I be an integer between 0 and N. 0<=I<N.
29334 ** This routine runs an extensive test of the Bitvec code.
29336 ** The input is an array of integers that acts as a program
29359 ** an error is returned. If they are the same, zero is returned.
29457 ** A complete page cache is an instance of this structure.
29490 ** is not, either fail an assert or return zero. Otherwise, return
29566 ** being used for an in-memory database, this function is a no-op.
29966 ** Return the number of references to the page supplied as an argument.
30069 ** Each cache entry is represented by an instance of the following
30120 ** an argument and returns a pointer to the associated block of szPage
30142 ** verb to sqlite3_config(). Parameter pBuf points to an allocation large
30197 ** Free an allocated buffer obtained from pcache1Alloc().
30263 ** Free an allocated buffer obtained from sqlite3PageMalloc().
30347 ** Remove the page supplied as an argument from the hash table
30498 ** For a non-purgeable cache (a cache used as the storage for an in-memory
30546 /* Search the hash table for an existing entry. */
30626 /* It is an error to call this function if the page is already
30728 ** already provided an alternative.
30811 ** This module implements an object we call a "RowSet".
30814 ** are inserted into the RowSet in an arbitrary order. Inserts
30832 ** TEST checks to see if an element is already in the RowSet. SMALLEST
30836 ** allocated in chunks so most INSERTs do no allocation. There is an
30842 ** in the batch number. In other words, if an INSERT occurs between
30851 ** The cost of an INSERT is roughly constant. (Sometime new memory
30852 ** has to be allocated on an INSERT.) The cost of a TEST with a new
30858 ** There is an added cost of O(N) when switching between TEST and
30875 ** Each entry in a RowSet is an instance of the following object.
30895 ** A RowSet in an instance of the following structure.
30918 ** an assertion fault occurs.
30920 ** If N is larger than the minimum, use the surplus as an initial
31100 ** list contains too few elements, then construct an incomplete tree
31261 ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file
31306 ** called on an outstanding page which means that the pager must
31308 ** PAGER_RESERVED means that there is an open rollback journal.
31311 ** journal occurs with just PAGER_RESERVED. After an sqlite3PagerRollback()
31339 ** such a system. This is currently an undocumented limit.
31366 ** A open page cache is an instance of the following structure.
31387 ** truncated by an incremental-vacuum operation. The Pager.dbOrigSize variable
31401 ** can only happen if an exclusive lock is held on the database file.
31402 ** It is cleared (set to false) whenever an exclusive lock is
31438 ** then attempts to upgrade to an exclusive lock. If this attempt
31458 ** is opened as an in-memory journal file. If false, then in-memory
31487 u8 needSync; /* True if an fsync() is needed on the journal */
31561 ** file after power is restored. If an attempt is then made
31563 ** sanity checking data is an attempt to discover the garbage in the
31573 ** garbage data came from an obsolete journal file, the checksums might
31594 ** The macro MEMDB is true if we are dealing with an in-memory database.
31659 ** that is read in *pRes. Return SQLITE_OK if everything worked, or an
31680 ** on success or an error code is something goes wrong.
31722 ** an error to call this function if pPager is opened on an in-memory
31778 ** The CHECK_PAGE macro takes a PgHdr* as an argument. If SQLITE_CHECK_PAGES
31779 ** is defined, and NDEBUG is not defined, an assert() statement checks
31817 ** If an error occurs while reading from the journal file, an SQLite
31903 ** If an IO error occurs, abandon processing and return the IO error code.
32070 ** cannot be read from the journal file an error code is returned.
32097 ** SQLITE_DONE. If an IO error occurs, return an error code. Otherwise,
32112 ** of the transaction. Return an error code if anything goes wrong.
32223 ** an error occurs, return the error code to the caller.
32328 ** an open journal-file, then the next time a shared-lock is obtained
32376 ** This function should be called when an IOERR, CORRUPT or FULL error
32420 ** If the pager has not already entered the error state, but an IO or
32437 ** after rollback of a hot-journal, or if an error occurs while opening
32454 ** Journal file descriptor is simply closed. This destroys an
32481 ** SQLITE_OK is returned if no error occurs. If an error occurs during
32525 ** the database file, it will do so using an in-memory journal. */
32575 ** Each byte is interpreted as an 8-bit unsigned integer.
32577 ** Changing the formula used to compute this checksum results in an
32617 ** and played back, then SQLITE_OK is returned. If an IO error occurs
32631 ** allocated by this function. If this is the case and an allocation fails,
32658 ** file. Return an error code to the caller if an IO error occurs.
32698 ** and a page is moved during an incremental vacuum then the page may
32714 ** database file without an entry in the rollback journal that can
32758 ** The solution is to add an in-memory page to the cache containing
32774 ** of an internal error resulting in an automatic call to
32788 ** back as part of a savepoint (or statement) rollback from an
32851 ** If an IO error within this function, an error code is returned. This
32852 ** function allocates memory by calling sqlite3Malloc(). If an allocation
32958 ** If the main database file is not open, or an exclusive lock is not
32970 ** If successful, return SQLITE_OK. If an IO error occurs while modifying
33051 ** Each entry in the journal is an instance of the 8th item.
33074 ** If an I/O or malloc() error occurs, the journal-file is not deleted
33075 ** and an error code is returned.
33109 ** TODO: Technically the following is an error because it assumes that
33128 ** pager_playback_one_page() call returns SQLITE_DONE or an IO error
33227 /* If this playback is happening automatically as a result of an IO or
33413 ** that an inopertune power failure could leave the journal
33484 ** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE
33539 ** * the database is either not an in-memory database or it is
33540 ** an in-memory database that currently consists of zero pages.
33672 ** the query attempt returns an IO error, the IO error code is returned
33736 ** Return SQLITE_OK on success and an error code if we cannot obtain
33835 ** This function always succeeds. If a transaction is active an attempt
33836 ** is made to roll it back. If an error occurs during the rollback
33851 ** is not -1, then the unsynced portion of an open journal file may
33902 ** * If the journal file is an in-memory journal file, no action need
33928 ** page currently held in memory before returning SQLITE_OK. If an IO
33940 /* This block deals with an obscure problem. If the last connection
34027 ** be NULL, representing an empty list. In this case this function is
34032 ** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained,
34051 ** If everything is successful, SQLITE_OK is returned. If an IO error
34052 ** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
34063 ** database file. If there is already an EXCLUSIVE lock, the following
34067 ** through an intermediate state PENDING. A PENDING lock prevents new
34152 ** This function returns SQLITE_OK if everything is successful, an IO
34186 ** (cast as a void*). The pager is always 'purgeable' (not an in-memory
34197 ** SQLITE_OK returned. If an IO error occurs while trying to make the
34299 ** This can be used to implement an in-memory database.
34314 ** the new pager object. If an error occurs, *ppPager is set to NULL
34332 int memDb = 0; /* True if this is an in-memory file */
34344 ** is the maximum space required for an in-memory journal file handle
34356 /* Set the output variable to NULL in case an error occurs. */
34359 /* Compute and store the full pathname in an allocated buffer pointed
34486 ** This branch is also run for an in-memory database. An in-memory
34488 ** disk and uses an in-memory rollback journal.
34504 /* If an error occurred in either of the blocks above, free the
34584 ** exists, that is probably an old journal left over from a prior
34598 ** set to 0 and SQLITE_OK returned. If an IO error occurs while trying
34664 ** its has a zero header, that might be due to an I/O error, or
34669 ** with it under an EXCLUSIVE lock where we do not need to
34691 ** If an IO error occurs, then the IO error is returned to the caller.
34737 ** on the database file), then an attempt is made to obtain a
34747 ** then an attempt is made to clear the error state by discarding
34752 ** pager is in an error state other than SQLITE_FULL when this is called,
34756 ** Otherwise, if everything is successful, SQLITE_OK is returned. If an
34769 /* If this database is in an error-state, now is a chance to clear
34809 /* Get an EXCLUSIVE lock on the database file. At this point it is
34873 ** an inconsistent cache.
34901 ** detected. The chance of an undetected change is so small that
34962 ** choose not to allocate a new page object and may reuse an existing
34994 ** an appropriate error code is returned and *ppPage is set to NULL.
35000 ** has to go to disk, and could also playback an old journal if necessary.
35020 /* If the pager is in the error state, return an error immediately.
35029 /* Either the call to sqlite3PcacheFetch() returned an error or the
35039 /* In this case the pcache already contains an initialized copy of
35119 ** or if the pager is in an error state other than SQLITE_FULL.
35194 ** an IO error code if opening or writing the journal file fails.
35207 ** an error state. */
35275 ** an EXCLUSIVE lock. If such a lock is already held, no locking
35280 ** of the journal file is deferred until there is an actual need to
35287 ** within this transaction will be opened as an in-memory file. This
35291 ** sub-journal is implemented in-memory if pPager is an in-memory database,
35303 ** is true, then immediately upgrade this to an EXCLUSIVE lock. The
35365 /* If an error has been previously detected, we should not be
35405 /* The transaction journal now exists and we have a RESERVED or an
35437 /* Even if an IO or diskfull error occurred while journalling the
35441 ** in the database file. And if an IO error occurs while doing so,
35507 ** If an error occurs, SQLITE_NOMEM or an IO error code is returned
35532 ** an integer power of 2. It sets variable pg1 to the identifier
35650 ** by writing an updated version of page 1 using a call to the
35724 ** function returns SQLITE_OK. Otherwise, an IO error code is returned.
35756 ** passed to an sqlite3PagerCommitPhaseOne() call.
35774 ** is the appropriate response to an error, not COMMIT. Guard against
35782 /* If this is an in-memory db, or no pages have been written to, or this
35931 ** If an error occurs, an IO error code is returned and the pager
35989 ** * If in an error state other than SQLITE_FULL, then task (1) is
36041 /* If an error occurs during a ROLLBACK, we can no longer trust the pager
36094 ** Return true if this is an in-memory pager.
36106 ** If a memory allocation fails, SQLITE_NOMEM is returned. If an error
36107 ** occurs while opening the sub-journal file, then an IO error code is
36183 ** In any case, all savepoints with an index greater than iSavepoint
36188 ** or an IO error code if an IO error occurs while rolling back a
36317 ** This function may return SQLITE_NOMEM or an IO error code if an error
36328 /* In order to be able to rollback, an in-memory database must journal
36390 /* Do not discard pages from an in-memory database since we might
36440 ** For an in-memory database, make sure the original page continues
36550 ** uses it opaquely as an argument to sqlite3BackupRestart() and
36619 ** bytes are stored on overflow pages. The payload for an entry
36629 ** Each page can be either a btree page, a freelist page, an overflow
36675 ** payload is spilled to overflow pages. Once an overflow page is allocated,
36838 ** As each page of the file is loaded into memory, an instance of the following
36901 ** A database connection contains a pointer to an instance of
37009 u8 isExclusive; /* True if pWriter has an EXCLUSIVE lock on the db */
37033 ** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than
37073 u8 isIncrblobHandle; /* True if this cursor is an incr. io handle */
37100 ** A unrecoverable error (an I/O error or a malloc failure) has occurred
37102 ** cursor. The error has left the cache in an inconsistent state.
37152 ** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number
37183 ** within an expression that is an argument to another macro
37466 ** so an insertion sort is an adequate algorithm here.
37576 ** Including a description of file format and an overview of operation.
37652 **** This function is only used as part of an assert() statement. ***
37662 ** When writing to an index that resides in a sharable database, the
37676 int isIndex, /* True if iRoot is the root of an index b-tree */
37693 /* If the client is reading or writing an index and the schema is
37783 /* If requesting a write-lock, then the Btree must have an open write
37785 ** must be an open write transaction on the file itself.
37795 /* If some other connection is holding an exclusive lock, the
37866 /* First search the list for an existing lock on this table. */
37906 ** This function assumes that Btree p has an open read or write
38047 ** The BtShared.pHasContent bitvec exists to work around an obscure
38133 /* If this is an intKey table, then the above call to BtreeKeySize()
38135 ** all that is required. Otherwise, if pCur is not open on an intKey
38206 const void *pKey, /* Packed key if the btree is an index */
38264 ** This routine returns an error code if something goes wrong. The
38303 ** Write an entry into the pointer map.
38309 ** a no-op. If an error occurs, the appropriate error code is written
38357 ** Read an entry from the pointer map.
38487 ** way will result in an incompatible file format.
38530 ** cell. If SQLITE_DEBUG is defined, an assert() at the bottom of
38587 ** to an overflow page, insert an entry into the pointer-map
38691 ** an error code (usually SQLITE_CORRUPT).
39141 ** If an error occurs, then the value *ppPage is set to is undefined. It
39142 ** may remain unchanged, or it may be set to an invalid value.
39203 /* pPage might not be a btree page; it might be an overflow page
39230 ** If zFilename is ":memory:" then an in-memory database is created
39234 ** and we are in shared cache mode, then the open will fail with an
39254 /* Set the variable isMemdb to true for an in-memory database, or
39284 ** If this Btree is a candidate for shared cache, try to find an
39374 /* If the magic name ":memory:" will create an in-memory database, then
39512 ** Make sure pBt->pTmpSpace points to an allocation of
39530 ** Close an open database and invalidate all cursors.
39597 ** an abrupt power failure when synchronous is off, the database
39598 ** could be left in an inconsistent and unrecoverable state.
39868 ** 17 bytes long, 0 to N bytes of payload, and an optional 4 byte overflow
39906 ** If pBt points to an empty file then convert that empty file
39969 ** If an initial attempt to acquire the lock fails because of lock contention
40152 ** PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
40155 ** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
40248 ** If pDbPage is an overflow page, then the first 4 bytes may store a
40294 ** Perform a single step of an incremental-vacuum. If successful,
40304 ** it returns SQLITE_DONE or an error, and that nFin is the
40413 ** It performs a single unit of work towards an incremental vacuum.
40417 ** SQLITE_OK is returned. Otherwise an SQLite error code.
40437 ** is commited for an auto-vacuum database.
40700 ** in an error.
40715 ** trying to save cursor positions. If this is an automatic rollback (as
40761 ** A statement sub-transaction is implemented as an anonymous savepoint. The
40781 ** an index greater than all savepoints created explicitly using
40824 ** the caller is assumed to have an open write transaction.
40842 ** 4: There must be an active transaction.
40943 ** The cache is initialized to zero, indicating an invalid cache.
41091 ** to return an integer result code for historical reasons.
41102 ** Given the page number of an overflow page in the database (parameter
41107 ** If an error occurs an SQLite error code is returned. Otherwise:
41186 ** SQLITE_OK is returned on success, otherwise an error code.
41228 ** Once an overflow page-list cache has been allocated, it may be
41231 ** mode, the following events may invalidate an overflow page-list cache.
41235 ** * Creating a table (may require moving an overflow page).
41263 /* Trying to read or write past the end of the data is an error */
41377 ** Return SQLITE_OK on success or an error code if anything goes
41394 ** Return SQLITE_OK on success or an error code if anything goes
41426 ** This routine is an optimization. It is common for the entire key
41515 ** if an intkey page appears to be the parent of a non-intkey page, or
41546 ** Page pParent is an internal (non-leaf) tree page. This function
41606 ** structure the flags byte is set to 0x02 or 0x0A, indicating an index
41642 ** expected to open it on an index b-tree. Otherwise, if pKeyInfo is
41644 ** return an SQLITE_CORRUPT error. */
41794 /* Move the cursor so that it points to an entry near the key
41801 ** If an exact match is not found, then the cursor is always
41803 ** were present. The cursor might point to an entry that comes
41811 ** *pRes<0 The cursor is left pointing at an entry that
41815 ** *pRes==0 The cursor is left pointing at an entry that
41818 ** *pRes>0 The cursor is left pointing at an entry that
41910 ** the maximum number of record bytes stored on an index B-Tree
42000 ** Return TRUE if the cursor is not pointing at an entry of the table.
42008 ** have been deleted? This API will need to change to return an error code
42152 ** an error. *ppPage and *pPgno are undefined in the event of an error.
42153 ** Do not invoke sqlite3PagerUnref() on *ppPage if an error is returned.
42156 ** locate a page close to the page number "nearby". This can be used in an
42480 /* If the database supports auto-vacuum, write an entry in the pointer-map
42598 /* 0 is not a legal page number and page 1 cannot be an
42707 ** overflow page is being allocated, add an entry to the pointer-map
42839 ** nSkip is non-zero, then pCell may not point to an invalid memory location
42868 ** malformed cell from a leaf page to an interior page, if the cell size
42916 /* The cell may contain a pointer to an overflow page. If so, write
43035 /* If this is an auto-vacuum database, update the pointer map
43037 ** cell on the page to an overflow page. If either of these
43041 ** be marked as dirty. Returning an error code will cause a
43176 /* If this is an auto-vacuum database, update the pointer-map entries
43196 ** one or two in an effort to keep pages nearly full but not over full.
43218 ** size of a cell stored within an internal node is always less than 1/4
43478 ** This adjustment is more than an optimization. The packing above might
43652 ** Note that this can never happen in an SQLite data file, as all
43687 ** If this is an auto-vacuum database, the call to copyNodeContent()
43744 ** sibling page j. If the siblings are not leaf pages of an
43767 ** sibling page k. If the siblings are not leaf pages of an
43776 ** an overflow cell, or if the cell was located on a different sibling
43800 ** cause an assert() statement to fail. */
43832 ** page is then overwritten to make it an empty page with the right-child
43842 ** to call releasePage() on *ppChild exactly once. If an error occurs,
43843 ** an error code is returned and *ppChild is set to 0.
44018 ** For an INTKEY table, only the nKey value of the key is used. pKey is
44024 ** number if pCur points at an entry that is smaller than (pKey, nKey), or
44025 ** a positive value if pCur points at an etry that is larger than
44039 int appendBias, /* True if this is likely an append */
44062 ** expecting an index b-tree, then the caller should be inserting blob
44063 ** keys with no associated data. If the cursor was opened expecting an
44068 /* If this is an insert into a table b-tree, invalidate any incrblob
44134 /* If no error has occured and pPage has an overflow cell, call balance()
44146 ** multiple records into an intkey b-tree using a single cursor (as can
44147 ** happen while processing an "INSERT INTO ... SELECT" statement), it
44150 ** entry in the table, and the next row inserted has an integer key
44237 ** by the child-page of the cell that was just deleted from an internal
44264 ** Otherwise, if the entry deleted was on an internal node page, then
44319 /* Creating a new table may probably require moving an existing database
44321 ** out to be an overflow page, delete all overflow page-map caches
44353 ** the new table (assuming an error did not occur). But we were
44487 ** If pnChange is not NULL, then table iTable must be an intkey table. The
44541 ** root page. If an open cursor was using this page a problem would
44666 /* If auto-vacuum is disabled in this build and this is an auto-vacuum
44709 ** Otherwise, if an error is encountered (i.e. an IO error or database
44710 ** corruption) an SQLite error code is returned.
44717 /* Unless an error occurs, the following loop runs one iteration for each
44724 /* If this is a leaf page or the tree is not an int-key tree, then
44768 /* An error has occurred. Return an error code. */
44813 ** reference to the page, add an error message to pCheck->zErrMsg.
44835 ** page iParent, pointer type ptrType. If not, append an error message
44865 ** Check the integrity of the freelist or of an overflow page list.
45116 ** an array of pages numbers were each page number is the root page of
45123 ** allocation errors, an error message held in memory obtained from
45207 ** This is an internal consistency check; an integrity check
45312 ** btree as the argument handle holds an exclusive lock on the
45353 ** Argument pCsr must be a cursor opened for writing on an
45382 ** (e) the cursor points at a valid row of an intKey table.
45495 ** a NULL pointer and write an error message to pErrorDb.
45498 ** function. If an error occurs while doing so, return 0 and write an
45534 ** Create an sqlite3_backup process to copy the contents of zSrcDb from
45538 ** If an error occurs, NULL is returned and an error code and error message
45602 ** Argument rc is an SQLite error code. Return true if this error is
45630 /* Catch the case where the destination is an in-memory database and the
45673 ** Return SQLITE_OK if everything is successful, or an SQLite error
45674 ** code if an error occurs.
45885 ** Release all resources associated with an sqlite3_backup* handle.
45980 ** detects that the database has been modified by an external database
46012 /* Set up an sqlite3_backup object. sqlite3_backup.pDestDb must be set
46026 ** within a single call (unless an error occurs). The assert() statement
46028 ** or an error code.
46058 ** stores a single value in the VDBE. Mem is an opaque structure visible
46070 ** If pMem is an object with a valid string representation, this routine
46183 ** If the given Mem* has a zero-filled tail, turn it into an ordinary
46240 ** user and the later is an internal programming error.
46279 ** Memory cell pMem contains the context of an aggregate function.
46283 ** Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
46308 ** invoking an external callback, free it now. Calling this function
46335 ** Release any memory held by the Mem. This may leave the Mem in an
46353 ** there are reports that windows throws an expection
46374 ** a very large positive number to an integer results in a very large
46385 ** at representing the value that *pMem describes as an integer.
46386 ** If pMem is an integer, then the value is exact. If pMem is
46388 ** If pMem is a string or blob, then we make an attempt to convert
46389 ** it into a integer and return that. If pMem represents an
46390 ** an SQL-NULL value, return 0.
46420 ** double. If pMem is already a double or an integer, return its
46461 /* Only mark the value as an integer if
46590 ** Delete any previous value and set the value of pMem to be an
46632 ** Make an shallow copy of pFrom into pTo. Prior contents of
46675 ** pFrom contains an SQL NULL when this routine returns.
46718 /* If z is a NULL pointer, set pMem to contain an SQL NULL. */
46914 ** to read from the disk) then the pMem is left in an inconsistent state.
46970 ** If that is the case, then the result must be aligned on an even byte
47108 ** Change the string value of an sqlite3_value object
47121 ** Free an sqlite3_value object
47159 ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior
47250 ** If an out-of-memory error occurs while resizing the array, return
47278 ** Use the sqlite3VdbeResolveLabel() function to fix an address and
47326 ** Add an opcode that includes the p4 value as a pointer.
47343 ** Add an opcode that includes the p4 value as an integer.
47351 int p4 /* The P4 operand as an integer */
47359 ** Create a new symbolic label for an instruction that has yet to be
47361 ** label can be used as the P2 value of an operation. Later, when
47474 ** throw an ABORT exception (causing the statement, but not entire transaction
47485 ** Then check that the value of Parse.mayAbort is true if an
47488 ** part of an assert statement in the compiler. Similar to:
47531 ** to an OP_Function, OP_AggStep or OP_VFilter opcode. This is used by
47866 /* Note: this cast is safe, because the origin data point was an int
47960 ** an OP_Trace instruction is always inserted by sqlite3VdbeGet() as soon as
47986 ** Compute a string that describes the P4 parameter for an opcode.
48126 ** Release an array of N Mem elements
48136 /* This block is really an inlined version of sqlite3VdbeMemRelease()
48232 ** commandeer the 9th cell to use as storage for an array of pointers
48289 /* When an OP_Program opcode is encounter (the only opcode that has
48396 ** Print an IOTRACE message showing SQL content.
48515 ** an array to marshal SQL function arguments in. This is only done the
48706 ** be called on an SQL statement before sqlite3_step().
48766 int nTrans = 0; /* Number of databases with an active write-transaction */
48780 ** required, as an xSync() callback may add an attached database
48791 ** one database file has an open write transaction, a master journal
48792 ** file is required for an atomic commit.
48832 ** If one of the BtreeCommitPhaseOne() calls fails, this indicates an
48885 ** master journal file. If an error occurs at this point close
48926 ** an error occurs here, do not delete the master journal file.
48962 ** may be lying around. Returning an error code won't help matters.
48986 ** This is an internal self-check only - it is not an essential processing
49044 ** If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
49053 ** is that an IO error may have occured, causing an emergency rollback.
49095 ** that may be accessed by the VM passed as an argument. In doing so it
49121 ** handle associated with the VM passed as an argument is about to be
49127 ** an error message to it. Then return SQLITE_ERROR.
49151 ** Return an error code. If the commit could not complete because of
49170 ** Then the internal cache might have been left in an inconsistent
49238 ** or hit an 'OR FAIL' constraint and there are no deferred foreign
49271 ** do so. If this operation returns an error, and the current statement
49284 /* If this was an INSERT, UPDATE or DELETE and no statement transaction
49356 /* If the VM did not run to completion or if it encountered an
49426 ** Clean up and delete a VDBE after execution. Return an integer which is
49459 ** Delete an entire VDBE.
49488 ** was last positioned. Return an error code if an OOM fault or I/O error
49542 ** 'serial-type' and a blob of data. The serial type is an 8-byte unsigned
49545 ** In an SQLite index record, the serial type is stored directly before
49624 ** If we are on an architecture with mixed-endian floating
49631 ** on ARM7 is an issue with GCC, not with the ARM7 chip. It seems
49639 ** Developers using SQLite on an ARM7 should compile and run their
49950 ** an index key, and thus ends with a rowid value. The last byte
50059 ** pCur points at an index entry created using the OP_MakeRecord opcode.
50061 ** Return SQLITE_OK if everything works, or an error code otherwise.
50101 /* The last field of the index should be an integer - the ROWID.
50102 ** Verify that the last entry really is an integer. */
50201 ** sequences, or changing an authorization function are the types of
50219 ** Return a pointer to an sqlite3_value structure containing the value bound
50220 ** parameter iVar of VM v. Except, if the value is an SQL NULL, return
50277 ** Return TRUE (non-zero) of the statement supplied as an argument needs
50281 ** collating sequences are registered or if an authorizer function is
50292 ** the sqlite3_compile() routine. The integer returned is an SQLITE_
50318 ** Terminate the current execution of an SQL statement and reset it
50523 /* Force an SQLITE_TOOBIG error. */
50541 ** statement is completely executed or an error occurs.
50641 /* If this statement was prepared using sqlite3_prepare_v2(), and an
50669 /* This case occurs after failing to recompile an sql statement.
50711 ** The following is the implementation of an SQL function that always
50712 ** fails with an error message stating that the function is used in the
50873 ** value SQL NULL. Even though the Mem structure contains an element
50876 ** instead of an 8-byte one. This all works fine, except that when
50878 ** that a Mem structure is located on an 8-byte boundary. To prevent
50898 ** This function is called after invoking an sqlite3_value_XXX function on a
50899 ** column value (i.e. a value returned by evaluating an SQL expression in the
50918 /* If malloc() failed during an encoding conversion within an
51016 ** If the result is not a simple column reference (if it is an expression
51093 ** NULL is returned if the result column is an expression or constant or
51094 ** anything else which is not an unabiguous reference to a database column.
51109 ** NULL is returned if the result column is an expression or constant or
51110 ** anything else which is not an unabiguous reference to a database column.
51125 ** NULL is returned if the result column is an expression or constant or
51126 ** anything else which is not an unabiguous reference to a database column.
51220 ** Bind a blob value to an SQL statement variable.
51427 ** an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
51646 ** In the external interface, an "sqlite3_stmt*" is an opaque pointer
51652 ** a linear sequence of operations. Each operation has an opcode
51654 ** is a null-terminated string. Operand P5 is an unsigned character.
51659 ** either an integer, a null-terminated string, a floating point
51692 ** in an ordinary build.
51761 ** This routine converts an ephemeral string into a dynamically allocated
51763 ** converts an MEM_Ephem string into an MEM_Dyn string.
51889 ** Try to convert pRec to an integer representation or a
51890 ** floating-point representation if an integer representation
51893 ** an integer representation is more space efficient on disk.
51907 /* Only attempt the conversion to TEXT if there is an integer or real
51931 ** This is an EXPERIMENTAL api and is subject to change or removal.
52204 ** This function is only called from within an assert() expression. It
52233 ** If an attempt is made to open a locked database, then this routine
52237 ** If an error occurs, an error message is written to memory obtained
52261 u8 resetSchemaOnFault = 0; /* Reset schema after an error if true */
52375 } an;
52480 int res; /* Result of an sqlite3BtreeLast() */
52742 /* Check to see if we need to simulate an interrupt. This only happens
52779 ** an undefined integer. Opcodes will either fill in the integer
52833 ** opcode and the opcodes.c file is filled with an array of strings where
52937 ** If P4 is not null then it is an error message string.
52939 ** There is an implied "Halt 0 0 0" instruction inserted at the very end of
52955 ** an IGNORE exception. In this case jump to the address specified
53017 ** into an OP_String before it is executed for the first time.
53077 ** an OP_HexBlob opcode, with the hex string representation of
53078 ** the blob as P4. This opcode is transformed to an OP_Blob
53130 ** left holding a NULL. It is an error for register ranges
53205 ** with an SQLITE_ROW return code and it sets up the sqlite3_stmt
53252 ** and have an assigned type. The results are de-ephemeralized as
53382 ** -1 returns an integer too large to store in a 64-bit data-type. On
53531 ** user function may have called an sqlite3_result_XXX() function
53552 /* If the function returned an error, throw an exception */
53628 ** The result is always an integer.
53630 ** To force any register to be an integer, just add 0.
53641 ** Force the value in register P1 to be an integer. If the value
53642 ** in P1 is not an integer and cannot be converted into an integer
53644 ** raise an SQLITE_MISMATCH exception.
53664 ** If register P1 holds an integer convert it to a real value.
53727 ** Force the value in register P1 to be numeric (either an
53729 ** If the value is text or blob, try to convert it to an using the
53746 ** Force the value in register P1 be an integer. If
53748 ** If the value is text or blob, try to convert it to an integer using the
53765 ** If The value is currently an integer, convert it.
53766 ** If the value is text or blob, try to convert it to an integer using the
53789 ** The SQLITE_AFF_MASK portion of P5 must be an affinity character -
54088 ** Interpret the content of register P1 as an integer. Store the
54323 /* Make sure a corrupt database has not given us an oversize header.
54324 ** Do this now to avoid an oversize memory allocation.
54338 ** to get u.am.nField type values. u.am.offset is an upper bound on this. But
54470 #if 0 /* local variables moved into u.an */
54473 #endif /* local variables moved into u.an */
54475 u.an.zAffinity = pOp->p4.z;
54476 assert( u.an.zAffinity!=0 );
54477 assert( u.an.zAffinity[pOp->p2]==0 );
54479 while( (u.an.cAff = *(u.an.zAffinity++))!=0 ){
54482 applyAffinity(pIn1, u.an.cAff, encoding);
54492 ** in an index. The details of the format are irrelevant as long as
54624 ** Store the number of entries (an integer value) in the table or index
54648 ** on the value of P1. To open a new savepoint, P1==0. To release (commit) an
54649 ** existing savepoint, P1==1, or to rollback an existing savepoint P1==2.
54709 /* Find the named savepoint. If there is no such savepoint, then an
54710 ** an error is returned to the user. */
54821 ** still running, and a transaction is active, return an error indicating
54829 ** return an error indicating that the other VMs must complete first.
54873 ** transaction might also be rolled back if an error is encountered.
54885 ** database. If P2 is 2 or greater then an EXCLUSIVE lock is also obtained
54890 ** throw an ABORT exception), a statement transaction may also be opened.
54894 ** VDBE to be rolled back after an error without having to roll back the
54949 ** must be started or there must be an open cursor) before
54973 ** Write the content of register P3 (interpreted as an integer)
55023 ** Either a transaction needs to have been started or an OP_Open needs
55047 ** If virtual-tables are in use, this is not just an optimization.
55072 ** database. Give the new cursor an identifier of P1. The P1
55074 ** It is an error for P1 to be negative.
55079 ** There will be a read lock on the database whenever there is an
55085 ** to get a read lock but fails, the script terminates with an
55088 ** The P4 value may be either an integer (P4_INT32) or a pointer to
55091 ** sequence of the index being opened. Otherwise, if P4 is an integer
55102 ** The P4 value may be either an integer (P4_INT32) or a pointer to
55105 ** sequence of the index being opened. Otherwise, if P4 is an integer
55240 ** automatically created table with root-page 1 (an INTKEY table).
55267 ** register P2. In other words, cursor P1 becomes an alias for the
55307 ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys),
55309 ** to an SQL index, then P3 is the first in an array of P4 registers
55310 ** that are used as an unpacked index key.
55320 ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys),
55322 ** to an SQL index, then P3 is the first in an array of P4 registers
55323 ** that are used as an unpacked index key.
55333 ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys),
55335 ** to an SQL index, then P3 is the first in an array of P4 registers
55336 ** that are used as an unpacked index key.
55346 ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys),
55348 ** to an SQL index, then P3 is the first in an array of P4 registers
55349 ** that are used as an unpacked index key.
55383 ** blob, or NULL. But it needs to be an integer before we can do
55390 /* If the P3 value could not be converted into an integer without
55404 /* The P3 value is too large in magnitude to be expressed as an
55509 ** P1 is an open table cursor and P2 is a rowid integer. Arrange
55539 ** P4>0 then register P3 is the first of P4 registers that form an unpacked
55542 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
55549 ** P4>0 then register P3 is the first of P4 registers that form an unpacked
55552 ** Cursor P1 is on an index btree. If the record identified by P3 and P4
55554 ** does contain an entry whose prefix matches the P3/P4 record then control
55621 ** Cursor P1 is open on an index b-tree - that is to say, a btree which
55626 ** The P3 register contains an integer record number. Call this record
55628 ** that make up an unpacked index key that can be used with cursor P1.
55636 ** Otherwise, this instruction checks if cursor P1 contains an entry
55713 ** operation assumes the key is an integer and that P1 is a table whereas
55715 ** P1 is an index.
55750 /* This happens when an attempt to open a read cursor on the
55793 int res; /* Result of an sqlite3BtreeLast() */
55871 assert( (u.be.pMem->flags & MEM_Int)!=0 ); /* mem(P3) holds an integer */
55892 ** an AUTOINCREMENT table. */
55920 ** Write an entry into the table of cursor P1. A new entry is
55921 ** created if it doesn't already exist or the data for an existing
55936 ** has already positioned the cursor correctly. This is an optimization
55939 ** If the OPFLAG_ISUPDATE flag is set, then this opcode is part of an
55941 ** is part of an INSERT operation. The difference is only important to
56037 ** a record from within an Next loop.
56071 /* The OP_Delete opcode always follows an OP_NotExists or OP_Last or
56193 ** Store in register P2 an integer which is the key of the table entry that
56196 ** P1 can be either an ordinary table or a virtual table. There used to
56304 ** it increments an undocumented global variable used for testing.
56419 ** insert is likely to be an append.
56457 ** an unpacked index key. This opcode removes that entry from the
56491 ** Write into register P2 an integer which is the last entry in the record at
56528 ** The P4 register values beginning with P3 form an unpacked index
56535 ** If P5 is non-zero then the key value is increased by an epsilon
56542 ** The P4 register values beginning with P3 form an unpacked index
56549 ** If P5 is non-zero then the key value is increased by an epsilon prior
56591 ** Delete an entire database table or index whose root page in the database
56657 ** If the P3 value is non-zero, then the table referred to must be an
56658 ** intkey table (an SQL table, not an index). In this case the row change
56687 ** auxiliary database file if P1==1 or in an attached database if
56691 ** The difference between a table and an index is this: A table must
56693 ** has an arbitrary key but no data.
56700 ** auxiliary database file if P1==1 or in an attached database if
56835 ** the index named P4 in database P1. This is called after an index
56860 ** Do an analysis of the currently open database. Store in
56861 ** register P1 the text of an error message describing any problems.
56926 ** An assertion fails if P2 is not an integer.
57000 ** delete it now and initialize P1 with an empty rowset
57032 ** cell in an array of values used as arguments to the sub-program. P2
57033 ** contains the address to jump to if the sub-program throws an IGNORE
57213 ** This instruction throws an error if the memory cell is not initially
57214 ** an integer.
57242 ** not contain an integer. An assertion fault will result if you try.
57258 ** not contain an integer. An assertion fault will result if you try.
57271 ** The register P1 must contain an integer. Add literal P3 to the
57275 ** not contain an integer. An assertion fault will result if you try.
57289 ** Execute the step function for an aggregate. The
57344 ** Execute the finalizer function for an aggregate. P1 is
57416 ** fails with an error code of SQLITE_SCHEMA if it is ever executed
57444 ** used to generate an error message if the lock cannot be obtained.
57466 ** P4 may be a pointer to an sqlite3_vtab structure. If so, call the
57517 ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
57561 ** P1 is a cursor opened using VOpen. P2 is an address to jump to if
57683 ** do this regardless of whether or not an error occurred to ensure any
57727 ** underlying implementation to return an error if one occurs during
57728 ** xNext(). Instead, if an error occurs, true is returned (indicating that
57755 ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
57784 ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure.
57790 ** The xUpdate method will do a DELETE or an INSERT or both.
57956 ** an error of some kind.
57989 /* Jump to here for an SQLITE_MISUSE error.
58071 ** After seeking the cursor, the vdbe executes an OP_ResultRow.
58085 /* One of the following two instructions is replaced by an OP_Noop. */
58169 /* Check that the column is not part of an FK child key definition. It
58234 ** always return an SQL NULL. This is useful because it means
58430 ** the caller specifies a buffer size for an in-memory buffer to
58443 ** as an open file handle for journal files.
58660 ** This file contains code use to implement an in-memory rollback journal.
58705 ** is an instance of this class.
58840 ** Syncing an in-memory journal is a no-op. And, in fact, this routine
58890 ** Return true if the file-handle passed as an argument is
58891 ** an in-memory journal
58919 ** an SQL statement.
58924 ** Walk an expression tree. Invoke the callback once for each node
58963 ** an abort request is seen.
59022 ** there is an abort request.
59024 ** If the Walker does not have an xSelectCallback() then this routine
59061 ** Turn the pExpr expression into an alias for the iCol-th column of the
59065 ** makes an exact copy. But for any other kind of expression, this
59091 Expr *pExpr, /* Transform this into an alias to the result set */
59164 ** If the name cannot be resolved unambiguously, leave an error message
59329 ** might refer to an result-set alias. This happens, for example, when
59387 ** more matches. Either way, we have an error.
59444 ** Allocate and return a pointer to an expression to load the column iCol
59554 int is_agg = 0; /* True if is an aggregate function */
59649 ** a SELECT statement. pE is a term in an ORDER BY or GROUP BY clause.
59652 ** this routine return an integer between 1 and N where N is the number of
59681 ** pE is a pointer to an expression which is a single term in the
59686 ** ORDER BY term is not an integer index into the result set. That
59691 ** as an indication to the caller that it should sort by the i-th column.
59696 ** If there is no match, return 0. Return -1 if an error occurs.
59723 /* Try to match the ORDER BY expression against an expression
59724 ** in the result set. Return an 1-based index of the matching
59738 ** Generate an ORDER BY or GROUP BY term out-of-range error.
59756 ** ORDER BY terms that are already an integer between 1 and N are
59758 ** 1 through N generate an error. ORDER BY terms that are expressions
59853 ** If any errors are detected, add an error message to pParse and
59889 ** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
59893 ** This routine resolves each term of the clause into an expression.
59894 ** If the order-by term is an integer I between 1 and N (where N is the
59897 ** the order-by term is an identify that corresponds to the AS-name of
59903 ** an appropriate error message might be left in pParse. (OOM errors
59925 /* If an AS-name match is found, mark this ORDER BY column as being
59933 /* The ORDER BY term is an integer constant. Again, set the column
59944 /* Otherwise, treat the ORDER BY term as an ordinary expression */
59979 ** an expression, sqlite3ResolveExprNames() will be called without a
59999 ** are not allowed to refer to any names, so pass an empty NameContext.
60124 ** This routine walks an expression tree and resolves references to
60133 ** the symbolic name assigned to an ATTACH-ed database.
60150 ** size of an AS clause in the result-set of a SELECT. The Z expression
60163 ** If the function is an aggregate function, then the pNC->hasAgg is
60165 ** If an expression contains aggregate functions then the EP_Agg
60257 ** If pExpr is a column, a reference to a column via an 'AS' alias,
60263 ** have an affinity:
60357 ** pExpr is an operand of a comparison operator. aff2 is the
60407 ** idx_affinity is the affinity of an indexed column. Return true
60498 ** expression depth allowed. If it is not, leave an error message in
60551 ** Set the Expr.nHeight variable in the structure passed as an
60572 ** leave an error in pParse.
60581 ** by the select statement passed as an argument.
60709 ** Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed,
60725 ** Join two expressions using an AND operator. If either expression is
60760 ** Assign a variable number to an expression that encodes a wildcard
60768 ** the SQL statement comes from an external source.
60789 /* Wildcard of the form "?nnn". Convert "nnn" to an integer and
60843 ** Recursively delete an expression tree.
60877 ** to store a copy of an expression or expression tree. They differ in
61199 ** Add a new element to the end of an expression list. If pList is
61248 ** pList might be NULL following an OOM error. But pName should never be
61273 ** pList might be NULL following an OOM error. But pSpan should never be
61296 ** leave an error message in pParse.
61312 ** Delete an entire expression list.
61331 ** to an integer. These routines are checking an expression to see
61389 ** Walk an expression tree. Return 1 if the expression is constant
61401 ** Walk an expression tree. Return 1 if the expression is constant
61404 ** an ON or USING clause.
61411 ** Walk an expression tree. Return 1 if the expression is constant
61426 ** in *pValue. If the expression is not an integer or if it is too big
61471 ** This routine is used as an optimization, to skip OP_IsNull opcodes
61476 ** will likely result in an incorrect answer. So when in doubt, return
61496 ** Generate an OP_IsNull instruction that tests register iReg and jumps
61627 ** through the set members, skipping any duplicates. In this case an
61629 ** to be unique - either because it is an INTEGER PRIMARY KEY or it
61633 ** for fast set membership tests. In this case an epheremal table must
61634 ** be used unless <column> is an INTEGER PRIMARY KEY or an index can
61638 ** needs to know whether or not the structure contains an SQL NULL
61669 /* Check to see if an existing table or index can be used to
61682 /* Code an OP_VerifyCookie and OP_TableLock for <table>. */
61706 /* The collation sequence used by the comparison. If an index is to
61746 /* Could not found an existing table or index to use as the RHS b-tree.
61747 ** We will have to generate an ephemeral table to do the job.
61765 ** Generate code for scalar subqueries used as an expression
61778 ** to some integer key column of a table B-Tree. In this case, use an
61782 ** If rMayHaveNull is non-zero, that means that the operation is an IN
61795 ** result. For IN operators or if an error occurs, the return value is 0.
61814 ** * The right-hand side is an expression list containing variables
61840 /* Whether this is an 'x IN(SELECT...)' or an 'x IN(<exprlist>)'
61882 ** For each expression, build an index key from the evaluation and
61945 ** of the memory cell in iColumn. If this is an EXISTS, write
61946 ** an integer 0 (not exists) or 1 (exists) into a memory cell
61991 ** Generate code for an IN expression.
61997 ** is an array of zero or more values. The expression is true if the LHS is
62047 /* In this case, the RHS is an index b-tree.
62112 ** Duplicate an 8-byte value
62123 ** Generate an instruction that will put the floating point
62144 ** Generate an instruction that will put the integer describe by
62224 /* Find an empty slot and replace it */
62325 ** There must be an open cursor to pTab in iTable when this routine
62374 ** Record the fact that an affinity change has occurred on iCount
62430 ** If the last instruction coded is an ephemeral copy of any of
62451 ** the value of the alias. The value is stored in an auxiliary register
62950 ** The expression is implemented using an OP_Param opcode. The p1
62951 ** parameter is set to 0 for an old.rowid reference, or to (i+1)
62983 /* If the column has REAL affinity, it may currently be stored as an
63109 ** Generate code to evaluate an expression and store the results
63181 ** Return TRUE if pExpr is an constant expression that is appropriate
63192 ** We could factor them out, but then we would end up adding an
63222 ** up generating an OP_SCopy to move the value to the destination
63664 ** this routine is used, it does not hurt to get an extra FALSE - that
63666 ** an incorrect TRUE could lead to a malfunction.
63773 ** Make an entry for the column in pAggInfo->aCol[] if there
63774 ** is not an entry there already.
63812 /* There is now an entry for pExpr in pAggInfo->aCol[] (either
63903 ** Call sqlite3ExprAnalyzeAggregates() for every expression in an
63906 ** If an error is found, the analysis is cut short.
64037 /* Ran out of input before finding an opening bracket. Return NULL. */
64062 ** This C function implements an SQL user function that is used by SQL code
64293 ** pTab->zName if this function is being called to code part of an
64357 VTable *pVTab = 0; /* Non-zero if this is a v-tab with an xRename() */
64373 ** in database iDb. If so, this is an error.
64563 ** This function is called after an "ALTER TABLE ... ADD" statement
64604 ** for an SQL NULL default below.
64678 ** an "ALTER TABLE <table-name> ADD" statement is parsed. Argument
64714 /* Make sure this is not an attempt to ALTER a view. */
64725 ** the name by adding an "sqlite_altertab_" prefix. By adding this
64726 ** prefix, we insure that the name will not collide with an existing
64870 ** Generate code to do an analysis of all indices associated with
64886 int addr; /* The address of an instruction */
64983 ** initialized to contain an SQL NULL.
65041 ** below may be negative. Which causes an assert() to fail (or an
65106 ** Generate code that will do an analysis of an entire database
65128 ** Generate code that will do an analysis of a single table in
65148 ** when it recognizes an ANALYZE command.
65166 /* Read the database schema. If an error occurs, leave an error message
65298 ** If an OOM error occurs, this function always sets db->mallocFailed.
65441 ** Resolve an expression that was part of an ATTACH or DETACH statement. This
65476 ** An SQL user-function registered to do the work of an ATTACH statement. The
65477 ** three arguments to the function come directly from an attach statement:
65483 ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
65639 /* Return an error if we get here */
65648 ** An SQL user-function registered to do the work of an DETACH statement. The
65761 /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this
65796 ** Called by the parser to compile an ATTACH statement.
65849 ** These routines are used to make sure that an index, trigger, or
65853 ** to an object in a different database, an error message is added to
65974 ** API. This facility is an optional feature of the library. Embedded
66023 ** will return with an error. SQLITE_IGNORE means that the SQL statement
66044 ** Write an error message into pParse->zErrMsg that explains that the
66045 ** user-supplied authorization function returned an illegal value.
66054 ** table zTab in database zDb. This function assumes that an authorization
66058 ** to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE
66059 ** is treated as SQLITE_DENY. In this case an error is left in pParse.
66092 ** then generate an error.
66146 ** Do an authorization check using the code and arguments given. Return
66183 ** Push an authorization context. After this routine is called, the
66199 ** Pop an authorization context that was previously pushed
66306 ** Code an OP_TableLock instruction for each table locked by the
66334 ** Note that if an error occurred, it might be the case that
66495 ** database containing the table. Return NULL if not found. Also leave an
66499 ** routine leaves an error message in pParse->zErrMsg where
66510 /* Read the database schema. If an error occurs, leave an error message
66557 ** Reclaim the memory used by an index
66812 ** of a database ("main", "temp" or the name of an attached db). This
66833 ** "temp" or the name of an attached db). This routine returns the
67001 /* Make sure the new table name does not collide with an existing
67002 ** index or table name in the same database. Issue an error message if
67004 ** to an sqlite3_declare_vtab() call. In that case only the column names
67020 sqlite3ErrorMsg(pParse, "there is already an index named %s", zName);
67115 /* If an error occurs, we jump here */
67284 ** Default value expressions must be constant. Raise an exception if this
67321 ** a primary key (and this is the second primary key) then create an
67330 ** If the key is not an INTEGER PRIMARY KEY, then create a unique
67377 sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an "
67434 ** then an index may have been created on this column before the
67459 ** another error occurs, NULL is returned and an error message written into
67464 ** and generates an error message.
67528 ** The first parameter is a pointer to an output buffer. The second
67529 ** parameter is a pointer to an integer that contains the offset at
67536 ** characters, does not begin with a digit and is not an SQL keyword,
67803 /* Check to see if we need to create an sqlite_sequence table for
67888 ** there could not have been an error */
67936 ** of errors. If an error is seen leave an error message in pParse->zErrMsg.
68090 ** erasing iTable (this can happen with an auto-vacuum database).
68098 /* OP_Destroy stores an in integer r1. If this integer
68118 ** is also added (this can happen with an auto-vacuum database).
68133 ** to be destroyed is relocated by an earlier OP_Destroy. i.e. if the
68469 ** This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED
68488 ** content of an index in response to a REINDEX command.
68565 ** Create a new index for an SQL table. pName1.pName2 is the name of the index
68567 ** be NULL for a primary key or an index that is created to satisfy a
68598 Token nullId; /* Fake token for an empty ID list */
68725 /* Check for authorization to create an index.
68761 /* Either pColl!=0 or there was an OOM failure. But if an OOM
68808 ** load the column indices into the Index structure. Report an error
68814 ** same column more than once cannot be an error because that would
68835 ** must exist or else there must have been an OOM error. But if there
68836 ** was an OOM error, we would never reach this point. */
68862 /* This routine has been called to create an automatic index as a
68870 ** Either way, check to see if the table already has such an index. If
68905 ** ON CONFLICT clauses this is an error. Otherwise, use the
68974 /* A named index with an explicit CREATE INDEX statement */
68985 /* Add an entry in sqlite_master for this index
68997 /* Fill the index with data and reparse the schema. Code an OP_Expire
69009 /* When adding an index to the list of indices for a table, make
69049 ** Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the
69051 ** first column of the index. aiRowEst[2] is an estimate of the number
69080 ** This routine will drop an existing named index. This routine
69152 ** pArray is a pointer to an array of objects. Each object in the
69226 ** Delete an IdList.
69322 ** A SrcList is returned, or NULL if there is an OOM error. The returned
69324 ** a new one. If an OOM error does occurs, then the prior value of pList
69327 ** If pDatabase is not null, it means that the table has an optional
69403 ** Delete an entire SrcList including all its substructure.
69479 ** Add an INDEXED BY or NOT INDEXED clause to the most recently added
69501 ** Shifts all join operators from left to right for an entire FROM
69590 ** release or rollback an SQL savepoint.
69647 ** The first time this routine is called, we code an OP_Goto that
69687 ** Generate VDBE code that prepares for doing an operation that
69710 ** If an abort occurs after some of these writes have completed, then it will
69730 ** particular, it prevents us from writing an effective
69740 ** Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT
69836 /* Read the database schema. If an error occurs, leave an error message
69886 ** pointer. If an error occurs (out of memory or missing collation
70033 ** an equivalent collating sequence that uses a text encoding different
70054 ** Locate and return an entry from the db.aCollSeq hash table. If the entry
70058 ** Each pointer stored in the sqlite3.aCollSeq hash table contains an
70114 ** if necessary and generates an error message if the collating sequence
70292 /* If the createFlag parameter is true and the search did not reveal an
70388 ** add an error message to pParse->zErrMsg and return NULL. If all tables
70409 ** writable, generate an error message and return 1. If it is
70421 ** In either case leave an error message in pParse and return non-zero.
70445 ** Evaluate a view and store its result in an ephemeral table. The
70446 ** pWhere argument is an optional WHERE clause that restricts the
70484 ** Generate an expression tree to implement the WHERE, ORDER BY,
70507 /* Check that there isn't an ORDER BY without a LIMIT clause.
70616 ** put in an SrcList structure because some of the subroutines we
70618 ** an SrcList* parameter instead of just a Table* parameter.
70745 ** because deleting an item can change the scan order. */
70964 ** Generate code that will assemble an index key and put it in register
70965 ** regOut. The key with be for index pIdx which is an index on pTab.
71138 ** abs(X) throws an integer overflow error since there is no
71294 ** raise an SQLITE_TOOBIG exception and return NULL.
71694 ** Otherwise, return an error.
71767 ** EXPERIMENTAL - This is not an official function. The interface may
72162 ** SUM might return an integer if it never encounters a floating point
72163 ** value. TOTAL never fails, but SUM might through an exception if
72164 ** it overflows an integer.
72404 ** pExpr points to an expression which implements a function. If
72556 ** If an immediate foreign key constraint is violated, SQLITE_CONSTRAINT
72566 ** time a statement is executed that removes an existing violation from
72614 ** If a delete caused by OR REPLACE violates an FK constraint, an exception
72622 ** and the statement transaction is rolled back. An exception is an INSERT
72624 ** instead of using a counter, an exception is thrown immediately if the
72626 ** an INSERT does not open a statement transaction.
72635 ** Before coding an UPDATE or DELETE row operation, the code-generator
72641 ** coding an INSERT operation. The functions used by the UPDATE/DELETE
72653 ** sqlite3FkDelete() - Delete an FKey structure.
72679 ** If successful, zero is returned. If the parent key is an INTEGER PRIMARY
72685 ** Otherwise, it is set to point to an allocated array of size N, where
72710 ** into pParse. If an OOM error occurs, non-zero is returned and the
72741 ** 1) There is an INTEGER PRIMARY KEY column and the FK is implicitly
72776 ** map to an explicit list of columns in table pParent. Check if this
72822 ** child table of foreign key constraint pFKey. If an SQL UPDATE is executed
72884 /* Invoke MustBeInt to coerce the child key value to an integer (i.e.
72893 ** to increment the constraint-counter (i.e. this is an INSERT operation),
72919 ** to increment the constraint-counter (i.e. this is an INSERT operation),
72942 /* Special case: If this is an INSERT statement that will insert exactly
72965 ** code for an SQL UPDATE operation, this function may be called twice -
73013 /* Create an Expr object representing an SQL expression like:
73079 ** clause. If the constraint is not deferred, throw an exception for
73106 ** Calling this function with table "t1" as an argument returns a pointer
73180 ** violations, halt the VDBE and return an error at this point, before
73200 ** first register in an array of (pTab->nCol+1) registers containing the
73205 ** For an INSERT operation, regOld is passed zero and regNew is passed the
73206 ** first register of an array of (pTab->nCol+1) registers containing the new
73209 ** For an UPDATE operation, this function is called twice. Once before
73250 ** schema items cannot be located, set an error in pParse and return
73294 ** If the parent does not exist, removing the child row resolves an
73315 /* Inserting a single row into a parent table cannot cause an immediate
73342 ** on the parent table of this FK, then throw an exception
73387 ** parameter aChange is passed a NULL value. For an UPDATE, aChange points
73388 ** to an array of size N, where N is the number of columns in table pTab.
73411 /* This is an UPDATE. Foreign key processing is only required if the
73445 ** This function is called when an UPDATE or DELETE operation is being
73447 ** If the current operation is an UPDATE, then the pChanges parameter is
73669 ** refer to table pTab. If there is an action associated with the FK
73897 ** Locate or create an AutoincInfo structure associated with table pTab
73949 AutoincInfo *p; /* Information about an AUTOINCREMENT */
73982 ** Update the maximum rowid for an autoincrement calculation.
73998 ** Every statement that might do an INSERT into an autoincrement
74184 int appendFlag = 0; /* True if the insert is likely to be an append */
74283 /* If this is an AUTOINCREMENT table, look up the sequence number in the
74424 /* If the INSERT statement included an IDLIST term, then make sure
74428 ** If the table has an INTEGER PRIMARY KEY column and that column
74462 /* If there is no IDLIST term but the table has an integer primary
74537 /* build the NEW.* reference row. Note that if there is an INTEGER
74584 /* If this is an INSERT on a view with an INSTEAD OF INSERT trigger,
74603 ** except when the table has an INTEGER PRIMARY KEY column, in which
74788 ** Generate code to do constraint checks prior to an INSERT or an UPDATE.
74805 ** is false, indicating an INSERT statement, then a non-zero rowidChng
74808 ** computed automatically in an insert or that the rowid value is not
74809 ** modified by an update.
74839 ** the stack and there is an immediate jump
74849 ** CHECK REPLACE Illegal. The results in an exception.
74871 int ignoreDest, /* Jump to this label on an OE_Ignore resolution */
74954 /* If we have an INTEGER PRIMARY KEY, make sure the primary key
74956 ** is an UPDATE and the primary key is not changing, that is OK.
75044 /* Find out what action to take in case there is an indexing conflict */
75140 int appendBias, /* True if this is likely to be an append */
75251 ** for index pDest in an insert transfer optimization. The rules
75334 KeyInfo *pKey; /* Key information for an index */
75367 return 0; /* SELECT may not have an ORDER BY clause */
75370 ** there is no ORDER BY, we will get an error. */
75450 ** * We can always do the transfer if the table contains an
75451 ** an integer primary key
75467 /* If tables do not have an INTEGER PRIMARY KEY and there
75564 ** codes. Also write an error message into memory obtained from
75723 ** an SQLite instance. Shared libraries that intend to be loaded
75909 ** (part of the main SQLite library - not an extension) so that
76401 ** Attempt to load an SQLite extension library contained in the file
76408 ** If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
76643 ** If anything goes wrong, set an error in the database connection.
76701 ** 1 for ON or NORMAL and 2 for FULL. Return 1 for an empty or
76748 ** Interpret the given string as an auto-vacuum mode value.
76904 ** compiler (eg. count_changes). So add an opcode to expire all
77066 /* Malloc may fail when setting the page-size, as there is an internal
77271 ** as an auto-vacuum capable db.
77278 ** that this really is an auto-vacuum capable database.
77708 /* Pragma "quick_check" is an experimental reduced version of
77746 /* Do an integrity check on each database file */
77759 /* Do an integrity check of the B-Tree
77881 ** is created. If an existing main database file is opened, then the
78093 /* Code an OP_Expire at the end of each PRAGMA program to cause
78135 ** Fill the InitData structure with an error message that indicates
78217 /* If the SQL column is blank it means this is an index that
78226 /* This can occur if there exists an index on a TEMP table which
78370 ** For an attached db, it is an error if the encoding is not the same
78382 /* If opening an attached database, the encoding much match ENC(db) */
78474 /* Jump here for an error that occurs after successfully allocating
78475 ** curMain and calling sqlite3BtreeEnter(). For an error that occurs
78494 ** created using ATTACH statements. Return a success code. If an
78495 ** error occurs, write an error message into *pzErrMsg.
78879 ** and the statement is automatically recompiled if an schema change
78959 ** and the statement is automatically recompiled if an schema change
79097 ** type of join. Return an integer constant that expresses that type
79109 ** If an illegal or unsupported join type is seen, then still return
79110 ** a join type, but put an error in the pParse structure.
79232 int isOuterJoin, /* True if this is an OUTER join */
79263 ** The EP_FromJoin property is used on terms of an expression to tell
79332 "an ON or USING clause", 0);
79357 ** an AND operator.
79369 ** Report an error if any column mentioned in the USING clause is
79484 ** Generate an error message when a SELECT is used within a subexpression
79497 "a SELECT that is part of an expression");
79561 /* If the destination is an EXISTS(...) expression, the actual
79632 /* If we are creating a set for an "expr IN (SELECT ...)" construct,
79663 /* If this is a scalar select that is part of an expression, then
79717 assert( pOrderBy==0 ); /* If there is an ORDER BY, the call to
79724 ** Given an expression list, generate a KeyInfo structure that records
79727 ** If the ExprList is an ORDER BY or GROUP BY clause then the resulting
79735 ** freed. Add the KeyInfo structure to the P4 field of an opcode using
79873 ** declaration type for a ROWID field is INTEGER. Exactly when an expression
80064 /* If this is an EXPLAIN, skip this step */
80133 ** Given a an expression list (which is really the list of expressions
80164 /* Get an appropriate name for the column
80170 /* If the column contains an "AS <name>" phrase, use <name> as the name */
80307 ** If an error occurs, return NULL and leave a message in pParse.
80374 pParse->nMem++; /* Allocate an extra register for limit+offset */
80467 ** the last (right-most) SELECT in the series may have an ORDER BY or LIMIT.
80510 /* Compound SELECTs that have an ORDER BY clause are handled separately.
80781 ** Code an output subroutine for a coroutine implementation of a
80832 /* Suppress the the first OFFSET entries if there is an OFFSET clause
80855 /* If we are creating a set for an "expr IN (SELECT ...)" construct,
80872 #if 0 /* Never occurs on an ORDER BY query */
80882 /* If this is a scalar select that is part of an expression, then
80939 ** is an ORDER BY clause.
80985 ** In the AltB, AeqB, and AgtB subroutines, an EOF on A following nextA
80986 ** causes an immediate jump to EofA and an EOF on B following nextB causes
80987 ** an immediate jump to EofB. Within EofA and EofB, and EOF on entry or
81485 ** (2) The subquery is not an aggregate or the outer query is not a join.
81518 ** subquery does not have both an ORDER BY and a LIMIT clause.
81521 ** (16) The outer query is not an aggregate or the subquery does
81530 ** * is not an aggregate or DISTINCT query, and
81545 ** an ORDER BY clause. Ticket #3773. We could relax this constraint
81621 ** not used as the right operand of an outer join. Examples of why this
81644 ** effectively converts the OUTER JOIN into an INNER JOIN.
81930 ** Analyze the SELECT statement passed as an argument to see if it
81961 ** The select statement passed as the first argument is an aggregate query.
81995 ** If the source-list item passed as an argument was augmented with an
81998 ** SQLITE_ERROR and leave an error in pParse. Otherwise, populate
82067 ** an entry of the FROM clause is a subquery instead of a table or view,
82285 ** If anything goes wrong, an error message is written into pParse.
82388 ** intermediate results while calculating an aggregate. This
82436 ** Update the accumulator memory cells for an aggregate based on
82526 ** SRT_EphemTab Create an temporary table pDest->iParm and store
82544 ** encountered, then an appropriate error message is left in
82568 int addrSortIndex; /* Address of an OP_OpenEphemeral instruction */
82620 ** an exact limit.
82687 ** GROUP BY might use an index, DISTINCT never does.
82697 /* If there is an ORDER BY clause, then this sorting
82700 ** OP_OpenEphemeral instruction will be changed to an OP_Noop once
82750 ** into an OP_Noop.
82862 ** This might involve two separate loops with an OP_Sort in between, or
82863 ** it might be a single loop that uses an index to extract information
83037 ** is better to execute the op on an index, as indexes are almost
83051 ** there is such an index, and it has less columns than the table
83087 ** as if there was an "ORDER ON x" or "ORDER ON x DESC" clause.
83148 /* If there is an ORDER BY clause, then we need to sort the results
83164 /* Control jumps to here if an error is encountered above, or upon
83305 char *zErrMsg; /* Error message text, if an error occurs */
83340 /* If this is the first row, then generate an extra row containing
83558 IdList *pColumns, /* column list if this is an UPDATE OF trigger */
83622 ** drop so the trigger cannot be dropped. This results in an
83761 /* Make an entry in the sqlite_master table */
83822 ** If an OOM error occurs, NULL is returned and db->mallocFailed is set.
83843 ** Build a trigger step out of an INSERT statement. Return a pointer
83846 ** The parser calls this routine when it sees an INSERT inside the
83878 ** Construct a trigger step that implements an UPDATE statement and return
83880 ** sees an UPDATE statement inside the body of a CREATE TRIGGER.
84067 ** pEList is the SET clause of an UPDATE statement. Each entry
84069 ** in pEList have an <id> which matches an identifier in pIdList,
84086 ** one trigger that must be fired when an operation of type 'op' is
84087 ** performed on the table, and, if that operation is an UPDATE, if at
84094 ExprList *pChanges, /* Columns that change in an UPDATE statement */
84162 ** to fire had an explicit ON CONFLICT, then use it. Otherwise, use
84239 ** (trigger program). If an error has occurred, transfer error information
84276 ** are freed if an error occurs, link them into the Parse.pTriggerPrg
84335 /* Insert an OP_Halt at the end of the sub-program. */
84379 ** process of being coded). If this is the case, then an entry with
84381 ** in the Parse.pTriggerPrg list. Search for such an entry. */
84387 /* If an existing TriggerPrg could not be located, create a new one. */
84433 ** This is called to code the required FOR EACH ROW triggers for an operation
84436 ** BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then
84442 ** The reg argument is the address of the first in an array of registers
84462 ** are never accessed, and so are not allocated by the caller. So, for an
84470 ** raises an IGNORE exception.
84479 int reg, /* The first in an array of registers (see above) */
84514 ** old.* record into memory when executing an UPDATE or DELETE command.
84517 ** table may be accessed using an [old|new].<col> reference. Bit 1 is set if
84520 ** with an index greater than 32 may be accessed, 0xffffffff is returned.
84596 ** The most recently coded instruction was an OP_Column to retrieve the
84602 ** was created, or added later to the table definition by an ALTER TABLE
84609 ** Column definitions created by an ALTER TABLE command may only have
84620 ** If parameter iReg is not negative, code an OP_RealAffinity instruction
84621 ** on register iReg. This is used when an equivalent integer value is
84622 ** stored in place of an 8-byte floating point value in order to save
84647 ** Process an UPDATE statement.
84671 ** an expression for the i-th column of the table.
84955 /* If there are triggers on this table, populate an array of registers
85142 ** Generate code for an UPDATE of a virtual table.
85144 ** The strategy is that we create an ephemerial table that contains
85254 ** Execute zSql on database db. Return an error code.
85374 /* A VACUUM cannot change the pagesize of an encrypted database. */
85425 ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy
85481 ** are an increment to apply to the meta value after the vacuum.
85523 /* Currently there is an SQL level transaction open on the vacuum
85633 ** If an unlock is omitted, resources leaks will occur.
85699 ** above function sqlite3VtabUnlockList() for an explanation of why
85701 ** database connection that may have an entry in the p->pVTable list. */
85907 ** The VM register number pParse->regRowid holds the rowid of an
85935 ** the first time the virtual table is used in an SQL statement. This
85956 ** of an argument to the module name in a CREATE VIRTUAL TABLE statement.
85966 ** in an argument to the module name in a CREATE VIRTUAL TABLE statement.
86087 ** of the virtual table pTab. If an error occurs, an error code is returned
86088 ** and an error left in pParse.
86151 ** If an error occurs, *pzErr is set to point an an English language
86152 ** description of the error and an SQLITE_XXX error code is returned.
86169 ** invoke it now. If the module has not been registered, return an
86314 ** sqlite3DbFree() containing an error message, if one is available.
86410 ** table implementation have an opportunity to overload the function.
86481 ** array so that an OP_VBegin will get generated for it. Add pTab to the
86548 ** The query generator uses an array of instances of this structure to
86743 #define WHERE_INDEXED 0x000f0000 /* Anything that uses an index */
86744 #define WHERE_IN_ABLE 0x000f1000 /* Able to support an IN operator */
86888 ** Initialize an expression mask set (a WhereMaskSet object)
86921 ** This routine walks (recursively) an expression tree and generates
86977 ** allowed for an indexable WHERE clause term. The allowed operators are
87083 /* Figure out the collation sequence required from an index for
87157 ** be the name of an indexed column with TEXT affinity. */
87297 ** term that is an equivalent IN expression. In other words, if the term
87316 ** A subterm is also indexable if it is an AND of two or more
87322 ** potentially be used with an index if an appropriate index exists.
87446 ** that there is no possibility of transforming the OR clause into an
87454 ** might be possible to form an IN operator with either table1.column
87470 ** such table and column. Set okToChngToIN if an appropriate table
87487 ** or follwed by an inverted copy (t2.b==t1.a). Skip this term
87536 ** pTerm converted into an IN operator.
87578 ** The input to this routine is an WhereTerm structure with only the
87637 extraRight = x-1; /* ON clause terms may not be used with an index
87696 ** skipped. Or, if the children are satisfied by an index, the original
87723 ** an OR operator.
87827 ** an index for tables to the left of the join.
87857 ** pOrderBy is an ORDER BY clause from a SELECT statement. pTab is the
87859 ** the table has a cursor number of "base". pIdx is an index on pTab.
87891 ** or an index structure allocated on the stack by bestBtreeIndex() to
87913 /* Can not use an index sort on anything that is not a column in the
87936 /* If an index column that is constrained by == fails to match an
87944 /* If an index column fails to match and is not constrained by ==
88011 ** Two routines for printing the content of an sqlite3_index_info
88061 ** This routine attempts to find an scanning strategy that can be used
88062 ** to optimize an 'OR' expression that is part of a WHERE clause.
88120 /* If there is an ORDER BY clause, increase the scan cost to account
88145 ** Allocate and populate an sqlite3_index_info structure. It is the
88254 ** If an error occurs, pParse is populated with an error message and a
88258 ** Whether or not an error is returned, it is the responsibility of the
88289 "table %s: xBestIndex returned an invalid plan", pTab->zName);
88332 ** wsFlags in an uninitialized state, the caller may behave unpredictably.
88356 ** be a pointer to an sqlite3_vtab structure. Otherwise
88378 ** For each attempt at picking an index, the order of tables in the
88435 ** to optimize an OR expression within the WHERE clause.
88442 ** Argument pIdx is a pointer to an index structure that has an array of
88453 ** Or, if an OOM occurs while converting text values between encodings,
88537 ** an sqlite3_value structure containing the same value, with affinity
88543 ** is an SQL variable that currently has a non-NULL value bound to it,
88544 ** create an sqlite3_value structure containing this value, again with
88549 ** If an error occurs, return an error code. Otherwise, SQLITE_OK.
88559 ** expression involved in an comparison into a TK_REGISTER. */
88573 ** by scanning an index for a range of values. The range may have an upper
88600 ** The returned value is an integer between 1 and 100, inclusive. A return
88691 ** The lowest cost plan wins. The cost is an estimate of the amount of
88703 ** If there was an INDEXED BY clause (pSrc->pIndex) attached to the table in
88737 ** use an index to satisfy IS NULL constraints on that table. This is
88767 /* The aiRowEstPk[0] is an estimate of the total number of rows in the
88803 ** The "in-multiplier". This is an estimate of how many seek operations
88809 ** SQLite must perform 9 lookups on an index on (a, b), so nInMul is
88832 ** space to 1/3rd its original size. So an x>? constraint reduces
88836 ** Boolean. True if there is an ORDER BY clause that will require an
88845 ** the index (such an index is sometimes described as a covering index).
88906 /* If there is an ORDER BY clause and the index being considered will
88908 ** in wsFlags. Otherwise, if there is an ORDER BY clause but the index
88921 /* If currently calculating the cost of using an index (not the IPK
88944 ** Estimate the number of rows of output. For an IN operator,
88999 /* If there was an INDEXED BY clause, then only that one index is
89012 ** SQLite outputs rows in in the absence of an ORDER BY clause. */
89077 ** of the join. Disabling is an optimization. When terms are satisfied
89100 ** Code an OP_Affinity opcode to apply the column affinity string zAff
89103 ** As an optimization, SQLITE_AFF_NONE entries (which are no-ops) at the
89205 ** Generate code that will evaluate all == and IN constraints for an
89211 ** example, the third "c" value is an inequality. So only two
89225 ** this routine allocates an additional nEq memory cells for internal
89261 /* This module is only called on query plans that use an index. */
89354 ** When there is an IN operator, we also have a "addrNxt" label that
89417 /* Case 1: We can directly reference a single row using an
89436 /* Case 2: We have an inequality comparison against the ROWID field.
89507 /* Case 3: A scan using an index.
89514 ** the right-most column can be an inequality - the rest must
89535 ** constraints but an index is selected anyway, in order
89536 ** to force the output order to conform to an ORDER BY.
89554 int isMinQuery = 0; /* If this is an optimized SELECT min(x).. */
89604 ** and store the values of those terms in an array of registers
89612 /* If we are doing a reverse order scan on an ascending index, or
89816 ** equivalent to an empty rowset.
89823 ** fall through to the next instruction, just as an OP_Next does if
89824 ** called on an uninitialized cursor.
89976 ** The return value is a pointer to an opaque structure that contains
89981 ** If an error occurs, this routine returns NULL.
90017 ** entire tables. Thus a three-way join is an O(N^3) operation. But if
90051 ** is called from an UPDATE or DELETE statement, then ppOrderBy is NULL.
90053 ** If an index can be used so that the natural output order of the table
90055 ** *ppOrderBy is set to NULL. This is an optimization that prevents an
90056 ** unnecessary sort of the result set if an index appropriate for the
90101 ** and the WhereMaskSet structure. Since WhereClause contains an 8-byte
90102 ** field (type Bitmask) it must be aligned on an 8-byte boundary on
90124 ** subexpression is separated by an AND operator.
90227 ** this context an optimal scan is one that uses the same strategy
90308 /* Check that if the table scanned by this loop iteration had an
90311 ** Return an error.
90319 /* If an INDEXED BY clause is used, the bestIndex() function is
90321 ** if it find an index at all. */
90338 /* If the caller is an UPDATE or DELETE statement that is requesting
90573 /* If this scan uses an index, make code substitutions to read data
90715 /* Construct an expression node for a unary postfix operator
90740 /* Construct an expression node for a unary prefix operator
90857 ** functions that take a state number and lookahead value and return an
91378 ** the parse is retried before an error is thrown.
91473 /* The state of the parser is completely contained in an instance of
93254 /* When doing a nested parse, one can include terms in an expression
93873 ** <li> A pointer to the parser (an opaque structure.)
93892 int yyerrorhit = 0; /* True if yymajor has invoked an error */
93943 ** The response to an error depends upon whether or not the
93944 ** grammar defines an error token "ERROR".
94011 ** * Report an error message, and throw away the input token.
94048 ** This file contains C code that splits an SQL input string up into
94056 ** an upper-to-lower case map. On EBCDIC machines we also need
94087 ** The sqlite3KeywordCode function looks up an identifier to determine if
94106 ** or not a given identifier is really an SQL keyword. The same thing
94375 ** If X is a character that can be used in an identifier then
94379 ** allowed in an identifier. For 7-bit characters,
94689 ** passed in. An SQLITE_ status code is returned. If an error occurs
94690 ** then an and attempt is made to write an error message into
94702 int mxSqlLen; /* Max length of an SQL string */
94896 ** (1) START At the beginning or end of an SQL statement. This routine
94936 ** is look for a semicolon that is not part of an string or comment.
95355 ** the pInitMutex mutex. Return an error in either case. */
95496 /* Specify an alternative mutex implementation */
95509 /* Specify an alternative malloc implementation */
95540 /* Specify an alternative page cache implementation */
95570 ** ENABLE_MEMSYS5 is defined, return an error.
95670 ** Configuration settings for an individual database connection
95791 ** Close an existing SQLite database
95956 /* SQLITE_OK */ "not an error",
95995 ** an integer number of milliseconds passed in as the first
96040 ** This routine is called when an operation failed with a lock.
96042 ** returns 0, the operation aborts with an SQLITE_BUSY error.
96057 ** This routine sets the busy callback for an Sqlite database to the
96075 ** This routine sets the progress callback for an Sqlite database to the
96125 ** that if a malloc() fails in sqlite3_create_function(), an error code
96178 /* Check if an existing function is being overridden or deleted. If so,
96262 ** When virtual tables intend to provide an overloaded function, they
96425 ** deleted when the file is closed) or it an be held entirely in memory.
96460 ** open on an existing shared pager-cache, do not change the pager-cache
96543 ** Return the most recent error code generated by an SQLite routine. If NULL is
96598 /* Check if this call is removing or replacing an existing collation
96701 ** If an invalid limit index is supplied, report -1.
97118 ** This function is now an anachronism. It used to be used to recover from a
97232 ** 2. The table is not a view and the column name identified an
97254 ** to whatever their local counterparts contain. If an error did occur,
97379 ** is an array of integers that defines the test. Return -1 on a
97380 ** memory allocation error, 0 on success, or non-zero for an error.
97414 ** an incompatible database file format. Changing the PENDING byte
97658 ** Register an unlock-notify callback.
97661 ** but has received an SQLITE_LOCKED error because another connection
97801 ** This is a difficult situation to handle. Returning an error
97802 ** code to the caller is insufficient, as even if an error code
97806 ** indefinitely for an unlock-notify callback that will never
97851 ** This is called when the database connection passed as an argument is
97877 ** This is an SQLite module implementing full-text search.
97883 ** * The FTS3 module is being built as an extension
97890 /* TODO(shess) Consider exporting this comment to an HTML file or the
97945 ** memory. A "position" is an index of a token in the token stream
97946 ** generated by the tokenizer, while an "offset" is a byte offset,
97953 ** offset information, becoming an array of varint-encoded docids.
98009 ** SegmentWriter creates new leaf nodes, or when an interior node
98026 ** Here, optional { X } means an optional element, while array { X }
98055 ** This could be either a leaf node or an interior node. If the top
98127 ** write an empty doclist (varint(docid) varint(POS_END)), for updates
98200 ** an sqlite3_tokenizer_module containing pointers to the callback
98201 ** functions that make up an implementation.
98203 ** When an fts3 table is created, it passes any arguments passed to
98206 ** implementation. The xCreate() function in turn returns an
98210 ** To tokenize an input buffer, the sqlite3_tokenizer_module.xOpen()
98211 ** method is called. It returns an sqlite3_tokenizer_cursor object
98238 ** This method should return either SQLITE_OK (0), or an SQLite error
98251 ** Destroy an existing tokenizer. The fts3 module calls this method
98257 ** Create a tokenizer cursor to tokenize an input buffer. The caller
98268 ** Destroy an existing tokenizer cursor. The fts3 module calls this
98277 ** the end of the buffer has been reached, or an SQLite error code.
98349 /* A complete hash table is an instance of the following structure.
98369 /* Each element in the hash table is an instance of the following
98460 ** Macro to return the number of elements in an array. SQLite has a
98462 ** a collision when building an amalgamation with built-in FTS3.
98505 ** A connection to a fulltext index is an instance of the following
98506 ** structure. The xCreate and xConnect methods create an instance
98553 ** virtual table cursor (an instance of the following structure) using
98794 ** Convert an SQL-style quoted string into a normal string by removing
98898 ** Otherwise, return an SQLite error code.
99097 /* If this is an xCreate call, create the underlying tables in the
99160 /* By default use a full table scan. This is an expensive option,
99185 ** it would lead to an "unable to use function MATCH in the requested
99213 /* Allocate a buffer large enough for an Fts3Cursor structure. If the
99306 ** If an error occurs, an error code other than SQLITE_OK is returned.
99410 /* The end of a position list is marked by a zero encoded as an FTS3
99450 ** Value used to signify the end of an offset-list. This is safe because
99479 ** If parameter iCol is not 0, write an 0x01 byte followed by the value of
99895 ** A pointer to an instance of this structure is used as the context
100025 ** not reset here, then it may remain classified as an active statement
100129 ** so that it is safe to use pList as the output as well as an input
100388 /* This call is a request for the "docid" column. Since "docid" is an
100523 ** output variable *ppCsr and SQLITE_OK is returned. Otherwise, an error
100652 ** where 't' is the name of an FTS3 table.
100745 ** Implementation of FTS3 xRename method. Rename an fts3 table.
100794 ** This function is registered as the module destructor (called when an
100939 ** than an implicit AND. When using the new, both implicity and explicit
101000 ** is defined to accept an argument of type int, its behaviour when passed
101001 ** an integer that falls outside of the range of the unsigned char type
101003 ** is defined to accept an argument of type char, and always returns 0 for
101013 ** and other information (column names etc.) in pParse. Create an Fts3Expr
101082 ** Enlarge a memory allocation. If an out-of-memory allocation occurs,
101095 ** that appeared as part of an fts3 query expression. Neither quote character
101097 ** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE
101201 ** The output variable *ppExpr is populated with an allocated Fts3Expr
101204 ** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM
101206 ** If SQLITE_ERROR is returned, pContext is populated with an error message.
101234 /* Skip over any whitespace before checking for a keyword, an open or
101258 /* If this is a "NEAR" keyword, check for an explicit nearness. */
101270 ** the next byte must contain either whitespace, an open or close
101295 /* Check for an open bracket. */
101334 ** interface. Before doing so, figure out if there is an explicit
101339 ** an implementation artifact or an intentional decision when fts3 was
101362 ** The argument is an Fts3Expr structure for a binary operator (any type
101363 ** except an FTSQUERY_PHRASE). Return an integer value representing the
101424 ** returns either when the end of the buffer is reached or an unmatched
101456 /* Create an implicit NOT operator. */
101477 ** an expression contained in parenthesis is required. If a
101488 /* Insert an implicit AND operator. */
101510 ** Return an error in either case.
101575 ** an fts3 query expression, respectively. This function attempts to parse the
101578 ** of the parsed expression tree and SQLITE_OK is returned. If an error
101847 ** * The FTS3 module is being built as an extension
101960 ** with types "const void*" and "int" and returns an "int".
101986 /* Link an element into the hash table
102038 /* This function (for internal use only) locates an element in an
102121 ** Attempt to locate an element of the hash table pH with a key
102132 /* Insert an element into the hash table pH. The key is pKey,nKey
102227 ** * The FTS3 module is being built as an extension
102379 ** In prose: A word is an optional consonant followed by zero or
102380 ** vowel-consonant pairs followed by an optional vowel. "m" is the
102389 ** for an instance of of a consonant followed by a vowel.
102862 ** This is part of an SQLite module implementing full-text search.
102869 ** * The FTS3 module is being built as an extension
102896 ** an error is returned.
103241 ** in the README.tokenizer file as an example, so it is important to
103363 ** * The FTS3 module is being built as an extension
103723 ** This function is used to obtain an SQLite prepared statement handle
103726 ** Otherwise, an SQLite error code is returned and *pp is set to 0.
103728 ** If argument apVal is not NULL, then it must point to an array with
103817 ** Returns SQLITE_OK if the statement is successfully executed, or an
103873 ** return SQLITE_OK. If an error occurs while preparing the statement,
103874 ** return an SQLite error code.
103894 ** if successful, or an SQLite error code otherwise.
103944 ** If an OOM error occurs, *pRc is set to SQLITE_NOMEM before returning.
104005 ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code.
104097 ** This function is called by the xUpdate() method as part of an INSERT
104119 ** This function is called by the xUpdate() method for an INSERT operation.
104159 ** In FTS3, this is an error. It is an error to specify non-NULL values
104208 ** (an integer) of a row about to be deleted. Remove all terms from the
104254 ** returned. Otherwise, an SQLite error code is returned.
104291 ** SQLITE_DONE. Otherwise, an SQLite error code.
104387 /* Pointer p currently points at the first byte of an offset list. The
104531 ** an array of pending terms by term. This occurs as part of flushing
104549 ** This function is used to allocate an Fts3SegReader that iterates through
104644 ** in the segment and SQLITE_OK is returned. Otherwise, an SQLite error
104699 ** version, it is assumed that each SegReader points to an entry in
104749 ** Argument apSegment is an array of nSegment elements. It is known that
104990 ** blocks were written to the db). Otherwise, an SQLite error code is
105060 ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code.
105198 ** returned. Otherwise, an SQLite error code.
105245 ** The first value in the apVal[] array is assumed to contain an integer.
105251 ** document apVal[0], or false otherwise, and SQLITE_OK is returned. If an
105252 ** error occurs, an SQLite error code is returned.
105270 ** Return SQLITE_OK if successful, or an SQLite error code if not.
105291 ** Return SQLITE_OK if successful, or an SQLite error code if not.
105318 ** SQLITE_OK is returned if successful, otherwise an SQLite error code.
105438 ** The second argument is passed an array of pointers to SegReader objects
105477 ** comes about only when reading from an empty database.
105508 ** Similarly, if this is a search for an exact match, and the first term
105623 ** Otherwise, if successful, SQLITE_OK is returned. If an error occurs,
105624 ** an SQLite error code is returned.
105668 /* Allocate space for an array of pointers to segment iterators. */
105735 ** pending-terms table. If an error occurs, or if there are no terms
105829 int isRemove = 0; /* True for an UPDATE or DELETE */
105860 /* If this is an INSERT or UPDATE operation, insert the new record. */
106018 ** an argument.
106080 /* In this case the expression p is the root of an expression tree.
106223 ** is not near enough to an E).
106248 ** left-hand-side is either a phrase or an expression tree that is
106276 /* Snippet ii is an occurence of query term iLeft in the document.
106278 ** search for an instance of token (iLeft-1) somewhere in the
106427 ** iBreak is suggested spot in zDoc where we could begin or end an
106645 ** Iterate through all phrase nodes in an FTS3 query, except those that
107150 ** data is an array of 32-bit unsigned integers (C type u32).
107256 ** algorithms packaged as an SQLite virtual table module.
107262 ** This file contains an implementation of a couple of different variants
107379 ** If an R*-tree "Reinsert" operation is required, the same number of
107404 ** The argument is an RtreeCoord. Return the value stored within the RtreeCoord
107443 ** consists of a single 8-byte integer followed by an even number
107623 ** Obtain a reference to an r-tree node.
107799 ** an internal node, then the 64-bit integer is a child page number.
108209 ** *ppLeaf to 0 and return SQLITE_OK. If an error occurs, set *ppLeaf
108210 ** to zero and return an SQLite error code.
108352 /* We have an equality constraint on the rowid. Use strategy 1. */
108362 /* This strategy involves a two rowid lookups on an B-Tree structures
108363 ** and then a linear search of an R-Tree node. This should be
108365 ** sqlite uses an internal cost of 0.0).
109171 /* Allocate an array and populate it with a copy of pCell and
109599 /* If azData[0] is not an SQL NULL value, it is the rowid of a
109768 rtreeConnect, /* xConnect - connect to an existing table */
109863 ** *piPageSize and SQLITE_OK returned. Otherwise, and an SQLite error
109914 "Wrong number of columns for an rtree table", /* 1 */
109915 "Too few columns for an rtree table", /* 2 */
109916 "Too many columns for an rtree table" /* 3 */
110002 ** an r-tree node, and the number of dimensions the r-tree indexes.
110118 ** This file implements an integration between the ICU library
110119 ** ("International Components for Unicode", an open-source library
110191 ** 1. uPattern is an unescaped match-all character "%",
110192 ** 2. uPattern is an unescaped match-one character "_",
110193 ** 3. uPattern is an unescaped escape character, or
110194 ** 4. uPattern is to be handled as an ordinary character
110254 ** is implemented as like(B, A). If there is an escape character E,
110280 ** Otherwise, return an error.
110300 ** This function is called when an ICU function called from within
110301 ** the implementation of an SQL scalar function returns an error.
110304 ** loaded with an error message based on the following two args.
110330 ** argument is an SQL NULL, then NULL Is returned. Otherwise, the result
110391 ** leaving the regular expression object configured with an invalid
110417 ** of the locale to use. Passing an empty string ("") or SQL NULL value
110502 ** types to an SQLite database connection. It is intended to be called
110507 ** Where <locale> is a string containing an ICU locale identifier (i.e.