Lines Matching refs:SQLite
2 ** This file is an amalgamation of many separate C source files from SQLite
7 ** of 5% are more are commonly seen when SQLite is compiled as a single
10 ** This file is all you need to compile SQLite. To use SQLite in other
12 ** the programming interface to the SQLite library. (If you do not have
16 ** if you want a wrapper to interface SQLite with your choice of programming
18 ** separate file. This file contains only code for the core SQLite library.
40 ** Internal interface definitions for SQLite.
95 ** This file defines various limits of what SQLite can process.
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
238 ** Ordinarily, if no value is explicitly provided, SQLite creates databases
241 ** SQLite may choose a larger value. This constant is the maximum value
242 ** SQLite will choose on its own.
347 ** Older versions of SQLite used an optional THREADSAFE macro.
427 ** Many people are failing to set -DNDEBUG=1 when compiling SQLite.
488 ** of SQLite to unexpected behavior - to make the code "self-healing"
536 ** This header file defines the interface that the SQLite library
539 ** not a published API of SQLite, is subject to change without
540 ** notice, and should not be referenced by programs that use SQLite.
544 ** features recently added to SQLite. We do not anticipate changes
548 ** The official C-language API documentation for SQLite is derived
550 ** on how SQLite interfaces are suppose to operate.
552 ** The name of this file under configuration management is "sqlite.h.in".
611 ** evaluates to a string literal that is the SQLite version in the
617 ** The SQLITE_VERSION_NUMBER for any given release of SQLite will also
622 ** Since version 3.6.18, SQLite source code has been stored in the
625 ** a string which identifies a particular check-in of SQLite
677 ** SQLite was compiled mutexing code omitted due to the
680 ** SQLite can be compiled with or without mutexes. When
682 ** are enabled and SQLite is threadsafe. When the
685 ** to use SQLite concurrently from more than one thread.
693 ** version of SQLite that it is linking against was compiled with
697 ** of the [SQLITE_THREADSAFE] flag. If SQLite is compiled with
715 ** Each open SQLite database is represented by a pointer to an instance of
731 ** SQLite includes typedefs for 64-bit signed and unsigned integers.
870 ** Many SQLite functions return an integer result code from the set shown
873 ** New error codes may be added in future versions of SQLite.
880 #define SQLITE_INTERNAL 2 /* Internal logic error in SQLite */
914 ** In its default configuration, SQLite API routines return one of 26 integer
918 ** address this, newer versions of SQLite (version 3.3.8 and later) include
927 ** to see new result codes in future releases of SQLite.
1011 ** SQLite uses one of these integer values as the second
1024 ** When SQLite invokes the xSync() method of an
1098 ** about the status of a lock, or to break stale locks. The SQLite
1183 ** The mutex module within SQLite defines [sqlite3_mutex] to be an
1184 ** abstract type for a mutex object. The SQLite core never looks
1196 ** the SQLite core and the underlying operating system. The "vfs"
1200 ** future versions of SQLite. Additional fields may be appended to this
1203 ** SQLite version 3.5.9 and 3.6.0 and yet the iVersion field was not
1218 ** structure that SQLite will ever modify. SQLite will only access
1226 ** SQLite will guarantee that the zFilename parameter to xOpen
1228 ** from xFullPathname(). SQLite further guarantees that
1245 ** SQLite will also add one of the following flags to the xOpen()
1267 ** SQLite might also add one of the following flags to the xOpen method:
1287 ** At least szOsFile bytes of memory are allocated by SQLite
1293 ** this even if the open fails. SQLite expects that the sqlite3_file.pMethods
1303 ** SQLite will always allocate at least mxPathname+1 bytes for the
1307 ** handled as a fatal error by SQLite, vfs implementations should endeavor
1364 ** CAPI3REF: Initialize The SQLite Library
1367 ** SQLite library. ^The sqlite3_shutdown() routine
1371 ** SQLite normally do not need to invoke either of these routines.
1388 ** other SQLite resources must be deallocated prior to invoking
1401 ** SQLite interfaces so that an application usually does not need to
1403 ** calls sqlite3_initialize() so the SQLite library will be automatically
1405 ** already. ^However, if SQLite is compiled with the [SQLITE_OMIT_AUTOINIT]
1408 ** prior to using any other SQLite interface. For maximum portability,
1410 ** directly prior to using any other SQLite interface. Future releases
1411 ** of SQLite may require this. In other words, the behavior exhibited
1412 ** when SQLite is compiled with [SQLITE_OMIT_AUTOINIT] might become the
1413 ** default behavior in some future release of SQLite.
1416 ** initialization of the SQLite library. The sqlite3_os_end()
1429 ** are built into SQLite when it is compiled for Unix, Windows, or OS/2.
1444 ** CAPI3REF: Configuring The SQLite Library
1447 ** changes to SQLite in order to tune SQLite to the specific needs of
1453 ** must insure that no other SQLite interfaces are invoked by other
1464 ** what property of SQLite is to be configured. Subsequent arguments
1469 ** ^If the option is unknown or SQLite is unable to set the option
1490 ** New verbs are likely to be added in future releases of SQLite.
1502 ** An instance of this object defines the interface between SQLite
1505 ** This object is used in only one place in the SQLite interface.
1512 ** memory allocation subsystem for SQLite to use for all of its
1515 ** Note that SQLite comes with several [built-in memory allocators]
1519 ** also used during testing of SQLite in order to specify an alternative
1521 ** order to verify that SQLite recovers gracefully from such
1529 ** deallocation. ^SQLite guarantees that the second argument to
1554 ** SQLite holds the [SQLITE_MUTEX_STATIC_MASTER] mutex when it invokes
1557 ** not need to be threadsafe either. For all other methods, SQLite
1565 ** SQLite will never invoke xInit() more than once without an intervening
1587 ** New configuration options may be added in future releases of SQLite.
1598 ** all mutexing and puts SQLite into a mode where it can only be used
1599 ** by a single thread. ^If SQLite is compiled with
1612 ** are enabled so that SQLite will be safe to use in a multi-threaded
1614 ** [database connection] at the same time. ^If SQLite is compiled with
1625 ** In this mode (which is the default when SQLite is compiled with
1626 ** [SQLITE_THREADSAFE=1]) the SQLite library will itself serialize access
1630 ** ^If SQLite is compiled with
1640 ** the memory allocation routines built into SQLite.)^ ^SQLite makes
1656 ** following SQLite interfaces become non-operational:
1663 ** ^Memory allocation statistics are enabled by default unless SQLite is
1669 ** <dd> ^This option specifies a static memory buffer that SQLite can use for
1678 ** ^SQLite will use no more than one scratch buffer per thread. So
1679 ** N should be set to the expected maximum number of threads. ^SQLite will
1681 ** page size. ^If SQLite needs needs additional scratch memory beyond
1686 ** <dd> ^This option specifies a static memory buffer that SQLite can use for
1698 ** ^SQLite will use the memory provided by the first argument to satisfy its
1701 ** SQLite goes to [sqlite3_malloc()] for the additional storage space.
1704 ** be aligned to an 8-byte boundary or subsequent behavior of SQLite
1708 ** <dd> ^This option specifies a static memory buffer that SQLite will use
1713 ** ^If the first pointer (the memory pointer) is NULL, then SQLite reverts
1720 ** boundary or subsequent behavior of SQLite will be undefined.</dd>
1726 ** the mutex routines built into SQLite.)^ ^SQLite makes a copy of the
1728 ** [sqlite3_config()] returns. ^If SQLite is compiled with
1741 ** profiling or testing, for example. ^If SQLite is compiled with
1760 ** to a custom page cache implementation.)^ ^SQLite makes a copy of the
1765 ** [sqlite3_pcache_methods] object. SQLite copies of the current
1794 ** New configuration options may be added in future releases of SQLite.
1808 ** may be NULL in which case SQLite will allocate the
1827 ** [extended result codes] feature of SQLite. ^The extended result
1835 ** ^Each entry in an SQLite table has a unique 64-bit signed
2002 ** SQLite for parsing. ^These routines return 1 if the input string
2017 ** ^(If SQLite has not been initialized using [sqlite3_initialize()] prior
2053 ** when there is lock contention. ^If SQLite determines that invoking the busy
2063 ** SQLite returns [SQLITE_BUSY] for the first process, hoping that this
2070 ** when SQLite is in the middle of a large transaction where all the
2071 ** changes will not fit into the in-memory cache. SQLite will
2181 ** to any internal data structures of SQLite. It uses only the public
2296 ** The SQLite core uses these three routines for all of its own
2339 ** In SQLite version 3.5.0 and 3.5.1, it was possible to define
2346 ** filenames between the UTF-8 encoding used by SQLite
2368 ** SQLite provides these two interfaces for reporting on the status
2378 ** added by SQLite in its implementation of [sqlite3_malloc()],
2394 ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to
2502 ** to signal SQLite whether or not the action is permitted. See the
2611 ** ^These routines open an SQLite database file whose name is given by the
2616 ** if SQLite is unable to allocate memory to hold the [sqlite3] object,
2676 ** the database connection is closed. Future versions of SQLite might
2699 sqlite3 **ppDb /* OUT: SQLite db handle */
2703 sqlite3 **ppDb /* OUT: SQLite db handle */
2707 sqlite3 **ppDb, /* OUT: SQLite db handle */
2729 ** subsequent calls to other SQLite interface functions.)^
2819 ** Additional information is available at [limits | Limits in SQLite].
2995 ** SQLite uses the sqlite3_value object to represent all values
2996 ** that can be stored in a database table. SQLite uses dynamic typing
3009 ** sqlite3_value object. If SQLite is compiled to be single-threaded
3011 ** or if SQLite is run in one of reduced mutex modes
3090 ** string after SQLite has finished with it. ^If the fifth argument is
3091 ** the special value [SQLITE_STATIC], then SQLite assumes that the
3094 ** SQLite makes its own private copy of the data immediately, before
3236 ** one release of SQLite to the next.
3269 ** ^As with all other SQLite APIs, those whose names end with "16" return
3313 ** ^SQLite uses dynamic run-time typing. ^So just because a column
3315 ** data stored in that column is of the declared type. SQLite is
3402 ** ^(Every value in SQLite has one of five fundamental datatypes:
3414 ** Note that the SQLITE_TEXT constant was also used in SQLite version 2
3416 ** SQLite version 2 and SQLite version 3 should use SQLITE3_TEXT, not
3464 ** versions of SQLite may change the behavior of sqlite3_column_type()
3525 ** and atof(). SQLite does not really use these functions. It has its
3678 ** ^When multiple implementations of the same function are available, SQLite
3696 ** arguments or differing preferred text encodings. ^SQLite will use
3715 ** SQLite interfaces. However, such calls must not
3744 ** text encodings supported by SQLite.
3837 ** for a particular aggregate function, SQLite
3858 ** ^SQLite automatically frees the memory allocated by
3922 ** ^If it is not NULL, SQLite will invoke the destructor
3927 ** SQLite is free to call the destructor and drop metadata on any
3950 ** the near future and that SQLite should make its own private copy of
3987 ** ^SQLite uses the string pointed to by the
3989 ** as the text of an error message. ^SQLite interprets the error
3990 ** message string from sqlite3_result_error() as UTF-8. ^SQLite
3993 ** or sqlite3_result_error16() is negative then SQLite takes as the error
3996 ** sqlite3_result_error16() is non-negative then SQLite takes that many
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
4028 ** ^SQLite takes the text result from the application from
4031 ** is negative, then SQLite takes result text from the 2nd parameter
4038 ** or sqlite3_result_blob is a non-NULL pointer, then SQLite calls that
4042 ** sqlite3_result_blob is the special constant SQLITE_STATIC, then SQLite
4048 ** then SQLite makes a copy of the result into space obtained from
4105 ** sequence (so that SQLite cannot call it anymore).
4193 ** of SQLite.
4206 ** of SQLite.
4224 ** ^SQLite implements this interface by calling the xSleep()
4234 ** created by SQLite when using a built-in [sqlite3_vfs | VFS]
4236 ** is a NULL pointer, then SQLite performs a search for an appropriate
4244 ** as part of process initialization and before any SQLite interface
4274 ** find out whether SQLite automatically rolled back the transaction after
4388 ** release of SQLite.
4421 ** This is a change as of SQLite version 3.5.0. In prior versions of SQLite,
4433 ** future releases of SQLite. Applications that care about shared
4436 ** See Also: [SQLite Shared-Cache Mode]
4456 ** on the amount of heap memory that may be allocated by SQLite.
4469 ** ^(SQLite makes a best effort to honor the soft heap limit.
4474 ** Prior to SQLite version 3.5.0, this routine only constrained the memory
4476 ** runs. Beginning with SQLite version 3.5.0, the soft heap limit is
4520 ** call to any SQLite API function.
4561 ** ^This interface loads an SQLite extension library from the named file.
4564 ** SQLite extension library contained in the file zFile.
4738 ** virtual table and is not checked again by SQLite.)^
4804 ** is a pointer to a destructor for the pClientData. ^SQLite will
4805 ** invoke the destructor function (if it is not NULL) when SQLite
4811 sqlite3 *db, /* SQLite connection to register module with */
4817 sqlite3 *db, /* SQLite connection to register module with */
5104 ** that SQLite uses to interact
5105 ** with the underlying operating system. Most SQLite builds come with a
5136 ** The SQLite core uses these routines for thread
5138 ** use by SQLite, code that links against SQLite is
5141 ** The SQLite source code contains multiple implementations
5144 ** implementations are available in the SQLite core:
5159 ** ^(If SQLite is compiled with the SQLITE_MUTEX_APPDEF preprocessor
5169 ** that means that a mutex could not be allocated. ^SQLite
5190 ** not want to. ^SQLite will only request a recursive mutex in
5198 ** used by the current version of SQLite. Future versions of SQLite
5200 ** use by SQLite only. Applications that use SQLite mutexes should
5211 ** allocated dynamic mutex. ^SQLite is careful to deallocate every
5214 ** mutex results in undefined behavior. ^SQLite never deallocates
5227 ** SQLite will never exhibit
5232 ** will always return SQLITE_BUSY. The SQLite core only ever uses
5238 ** calling thread or is not currently allocated. SQLite will
5260 ** Usually, the default mutex implementations provided by SQLite are
5262 ** implementation for specialized deployments or systems for which SQLite
5272 ** ^The xMutexInit routine is calle by SQLite exactly once for each
5309 ** ^xMutexInit() must not use SQLite memory allocation ([sqlite3_malloc()]
5310 ** and its associates). ^Similarly, xMutexAlloc() must not use SQLite memory
5311 ** allocation for a static mutex. ^However xMutexAlloc() may use SQLite
5314 ** ^SQLite will invoke the xMutexEnd() method when [sqlite3_shutdown()] is
5336 ** are intended for use inside assert() statements. ^The SQLite core
5338 ** are advised to follow the lead of the core. ^The SQLite core only
5372 ** The set of static mutexes may change from one SQLite release to the
5429 ** state of SQLite and to inject faults into SQLite for testing
5434 ** for verifying the correct operation of the SQLite library. Depending
5435 ** on how the SQLite library is compiled, this interface might not exist.
5439 ** Unlike most of the SQLite API, this function is not guaranteed to
5471 ** CAPI3REF: SQLite Runtime Status
5475 ** about the preformance of SQLite, and optionally to reset various
5492 ** called while other threads are running the same or different SQLite
5494 ** *pHighwater reflect the status of SQLite at different points in time
5515 ** and internal memory usage by the SQLite library. Scratch memory
5575 ** meaningful if SQLite is compiled with [YYTRACKMAXSTACKDEPTH].</dd>)^
5599 ** Additional options will likely appear in future releases of SQLite.
5617 ** New verbs may be added in future releases of SQLite. Existing verbs
5668 ** <dd>^This is the number of times that SQLite has stepped forward in
5688 ** the pluggable module. The SQLite core has no knowledge of
5705 ** heap memory used by SQLite is used by the page cache to cache data read
5708 ** precisely the amount of memory consumed by SQLite, the way in which
5714 ** internal buffer by SQLite within the call to [sqlite3_config]. Hence
5728 ** ^SQLite holds a [SQLITE_MUTEX_RECURSIVE] mutex when it invokes
5734 ** ^SQLite will never invoke xInit() more than once without an intervening
5737 ** ^The xCreate() method is used to construct a new cache instance. SQLite
5743 ** increment (here called "R") of about 100 or 200. ^SQLite will use the
5746 ** on the SQLite version, the target platform, and how SQLite was compiled.
5747 ** ^R is constant for a particular build of SQLite. ^The second argument to
5752 ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will
5757 ** ^(The xCachesize() method may be called at any time by SQLite to set the
5760 ** the SQLite "[PRAGMA cache_size]" command.)^ ^As with the bPurgeable
5788 ** SQLite will normally invoke xFetch() with a createFlag of 0 or 1. If
5789 ** a call to xFetch() with createFlag==1 returns NULL, then SQLite will
5795 ** ^xUnpin() is called by SQLite with a pointer to a currently pinned page
5797 ** then the page should be evicted from the cache. In this case SQLite
5813 ** ^When SQLite calls the xTruncate() method, the cache must discard all
5821 ** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*]
5849 ** See Also: [Using the SQLite Online Backup API]
5861 ** See Also: [Using the SQLite Online Backup API]
6003 ** ^If SQLite is compiled and configured to support threadsafe database
6010 ** sqlite3_backup_finish(). SQLite does not currently check to see
6048 ** [SQLite Shared-Cache Mode] for a description of shared-cache locking.
6049 ** ^This API may be used to register a callback that SQLite will invoke
6054 ** See Also: [Using the SQLite Unlock Notification Feature].
6078 ** a read-lock on the same table, then SQLite arbitrarily selects one of
6101 ** However, the signature of the callback function allows SQLite to pass
6143 ** SQLite checks if there are any currently executing SELECT statements
6170 ** that SQLite uses internally when comparing identifiers.
6229 ** used in SQLite.
6687 ** callback for a given sqlite handle.
6689 ** The sqlite.busyHandler member of the sqlite struct contains the busy
6690 ** callback for the database handle. Each pager opened via the sqlite
6691 ** handle is passed a pointer to sqlite.busyHandler. The busy-handler
6736 ** throughout the SQLite code must become constants instead. The SQLITE_WSD
6839 ** This header file defines the interface that the sqlite B-Tree file
6953 ** SQLite database header may be found using the following formula:
7501 ** This header file defines the interface that the sqlite page cache
7535 ** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is
7671 ** This header file defines the interface that the sqlite page cache
7835 ** the SQLite library will work on both POSIX and windows systems.
7941 ** If sqlite is being embedded in another program, you may wish to change the
7947 ** Mcafee started using SQLite in their anti-virus product and it
7948 ** started putting files with the "sqlite" name in the c:/temp folder.
7950 ** Google search for "sqlite", find the telephone numbers of the
7952 ** For this reason, the default name prefix is changed to be "sqlite"
8176 ** in the sqlite.aDb[] array. aDb[0] is the main database file and
8291 ** The sqlite.lastRowid records the last insert rowid generated by an
8298 ** The sqlite.nChange does not count changes within triggers and keeps no
8300 ** The sqlite.lsChange represents the number of changes made by the last
8306 ** The sqlite.csChange keeps track of the number of current changes (since
8309 ** The member variables sqlite.errCode, sqlite.zErrMsg and sqlite.zErrMsg16
8462 ** Possible values for the sqlite.magic field.
8474 ** structure. A pointer to this structure is stored in the sqlite.aFunc
8561 ** Each SQLite module (virtual table definition) is defined by an
8598 ** native byte order. When a collation sequence is invoked, SQLite selects
8741 ** in sqlite.aDb[]. 0 is for the main database and 1 is for the file that
8842 ** SQLite supports many different ways to resolve a constraint
9303 ** such a table must be a simple name: ID. But in SQLite, the table can
9871 ** Structure containing global configuration data for the SQLite library.
9974 ** sqlite versions only work for ASCII characters, regardless of locale.
10635 ** SQLite only considers US-ASCII (or EBCDIC) characters. We do not
10637 ** involved are nearly as big or bigger than SQLite itself.
10687 ** SQLite identifier character 0x40
10697 ** array. tolower() is used more often than toupper() by SQLite.
10700 ** SQLite identifier. Identifiers are alphanumerics, "_", "$", and any
10704 ** SQLite's versions are identical to the standard versions assuming a
10751 ** the SQLite library.
10796 ** 1-gibabyte boundary) in a compatible database. SQLite never uses
10958 ** functions for SQLite.
10964 ** SQLite processes all times and dates as Julian Day numbers. The
11692 ** of SQLite.
12071 ** The default SQLite sqlite3_vfs implementations do not allocate
12100 ** of this would be completely automatic if SQLite were coded using
12368 ** Most malloc failures are non-benign. After they occur, SQLite
12419 ** This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that
12454 ** here always fail. SQLite will not operate with these drivers. These
12456 ** sqlite3_config() before SQLite will operate.
12514 ** SQLite will use the standard C-library malloc/realloc/free interface
12667 ** SQLite will use the standard C-library malloc/realloc/free interface
13135 ** allocation subsystem for use by SQLite.
13138 ** use of malloc(). The SQLite user supplies a block of memory
13142 ** the amount of memory available to SQLite is fixed and cannot
13824 ** allocation subsystem for use by SQLite.
13827 ** use of malloc(). The application gives SQLite a block of memory
13831 ** the amount of memory available to SQLite is fixed and cannot
14561 ** that use SQLite in a single thread. The routines defined
14704 ** is not currently allocated. SQLite will never do either.
14780 ** SQLite will unwind its stack and return an error. The argument
14796 ** not want to. But SQLite will only request a recursive mutex in
14803 ** used by the current version of SQLite. Future versions of SQLite
14805 ** use by SQLite only. Applications that use SQLite mutexes should
14847 sqlite3_snprintf( sizeof(name), name, "\\SEM32\\SQLITE%04x",
14881 ** SQLite is careful to deallocate every mutex that it allocates.
14969 ** is not currently allocated. SQLite will never do either.
15060 ** On those platforms where pthread_equal() is not atomic, SQLite
15083 ** that means that a mutex could not be allocated. SQLite
15103 ** not want to. But SQLite will only request a recursive mutex in
15110 ** used by the current version of SQLite. Future versions of SQLite
15112 ** use by SQLite only. Applications that use SQLite mutexes should
15174 ** allocated mutex. SQLite is careful to deallocate every
15287 ** is not currently allocated. SQLite will never do either.
15459 ** that means that a mutex could not be allocated. SQLite
15479 ** not want to. But SQLite will only request a recursive mutex in
15486 ** used by the current version of SQLite. Future versions of SQLite
15488 ** use by SQLite only. Applications that use SQLite mutexes should
15526 ** allocated mutex. SQLite is careful to deallocate every
15564 ** first doing some #defines that prevent SQLite from building on Win98.
15584 ** is not currently allocated. SQLite will never do either.
15630 ** Memory allocation functions used throughout sqlite.
15675 ** held by SQLite. An example of non-essential memory is memory used to
15814 ** Deprecated external interface. Internal/core SQLite code
15884 ** 255 bytes of overhead. SQLite itself will never use anything near
17246 ** current locale settings. This is important for SQLite because we
17350 ** generator (PRNG) for SQLite.
17376 ** implementations, SQLite uses this random number generator based
17405 ** Nothing in this file or anywhere else in SQLite does any kind of
17751 ** There is a typedef for this structure in sqlite.h. So all routines,
17752 ** even the public interface to SQLite, can use a pointer to this structure.
17792 ** malloc failure when SQLite is invoked recursively by a virtual table
18473 ** Utility functions used throughout sqlite.
18526 # error SQLite will not work correctly with the -ffast-math option of GCC.
18554 ** Set the most recent error code and error string for the sqlite
18570 ** To clear the most recent error for sqlite handle "db", sqlite3Error
19525 ** used in SQLite.
19970 ** the SQLite-wrappers sqlite3_malloc()/sqlite3_free(). Those wrappers
19980 ** could enhance SQLite to deal with simulated malloc failures within
20706 ** SQLite code assumes this function cannot fail. It also assumes that
20916 sqlite3_file *id, /* Write the SQLite file handle here */
21461 ** Sometimes, after a file handle is closed by SQLite, the file descriptor
22124 ** To work around the problem, SQLite has to manage file locks internally
22494 ** around this problem (we consider it a bug in OS X, not SQLite)
22498 ** in the header of every SQLite database. In this way, if there
22761 ** confusion with SQLite lock names). The algorithms are complicated
22820 ** (2) SQLite never explicitly requests a pendig lock.
23474 ** fine-grain locking levels supported by SQLite are collapsed into
23476 ** PENDING locks are the same thing as an EXCLUSIVE lock. SQLite
24107 /* Can't reestablish the shared lock. Sqlite can't deal, this is
24250 ** one system to another. Since SQLite does not define USE_PREAD
24466 ** SQLite sets the dataOnly flag if the size of the file is unchanged.
24475 ** as far as SQLite is concerned, an fdatasync() is always adequate.
24553 ** SQLite to access the file will not know that the journal exists (because
24717 ** SQLite code assumes this function cannot fail. It also assumes that
25233 ** using the io-error infrastructure to test that SQLite handles this
25311 ** descriptor on the same path, fail, and return an error to SQLite.
25341 ** Previously, the SQLite OS layer used three functions in place of this
25365 int *pOutFlags /* Output flags returned to SQLite core */
25651 ** using the io-error infrastructure to test that SQLite handles this
25687 ** SQLite calls this function immediately after a call to unixDlSym() or
25690 ** is available, zBufOut is left unmodified and SQLite uses a default
25853 ** during SQLite operation. But so far, none of that has been implemented
25881 ** The default locking schemes in SQLite use byte-range locks on the
25883 ** and writers [http://sqlite.org/lockingv3.html]. The five file locking
25905 ** [http://www.nabble.com/SQLite
25955 ** The conch file - to use a proxy file, sqlite must first "hold the conch"
25956 ** by taking an sqlite-style shared lock on the conch file, reading the
26115 /* get the host ID from a sqlite hostid file stored in the
26131 #ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */
26132 fprintf(stderr, "sqlite error creating host ID file %s: %s\n",
26140 #ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */
26142 fprintf(stderr, "sqlite error opening host ID file %s: %s\n",
26999 ** This routine is called once during SQLite initialization and by a
27050 ** by the SQLite core when the VFS is registered. So the following
27121 ** the SQLite-wrappers sqlite3_malloc()/sqlite3_free(). Those wrappers
27131 ** could enhance SQLite to deal with simulated malloc failures within
28440 ** SQLite code assumes this function cannot fail. It also assumes that
28629 sqlite3_file *id, /* Write the SQLite file handle here */
28672 ** created. SQLite doesn't use it to indicate "exclusive access"
29177 ** function, SQLite calls this function with zBuf pointing to
29191 ** on SQLite. It is fine to have an implementation that never
29200 ** by sqlite into the error message available to the user using
30465 ** Malloc function used by SQLite to obtain space from the buffer configured
30965 ** held by the pager system. Memory in use by any SQLite pager allocated
32032 ** If an error occurs while reading from the journal file, an SQLite
32203 ** reading the journal this value tells SQLite to assume that the
34166 ** transaction), then SQLite may become confused when doing the
36161 ** PAGER_RESERVED state. And indeed SQLite never does this. But it is
36859 ** 0 16 Header string: "SQLite format 3\000"
37036 ** SQLite database in order to identify the file as a real database.
37047 # define SQLITE_FILE_HEADER "SQLite format 3"
37255 ** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than
37803 ** SQLite database.
40645 ** SQLITE_OK is returned. Otherwise an SQLite error code.
41335 ** If an error occurs an SQLite error code is returned. Otherwise:
42744 ** coded. But due to a coding error in versions of SQLite prior to
42747 ** to maintain backwards compatibility with older versions of SQLite,
43315 ** This function does not contribute anything to the operation of SQLite.
43565 ** Unless SQLite is compiled in secure-delete mode. In this case,
43880 ** Note that this can never happen in an SQLite data file, as all
44367 ** Previous versions of SQLite called moveToRoot() to move the cursor
44938 ** corruption) an SQLite error code is returned.
45765 ** Depending on the SQLite configuration, the database handles and/or
45881 ** Argument rc is an SQLite error code. Return true if this error is
45952 ** Return SQLITE_OK if everything is successful, or an SQLite error
49374 ** If SQLite is compiled to support shared-cache mode and to be threadsafe,
49380 ** If SQLite is not threadsafe but does support shared-cache mode, then
49387 ** If SQLite is not threadsafe and does not support shared-cache mode, this
49820 ** encapsulate the code that serializes values for storage in SQLite
49825 ** In an SQLite index record, the serial type is stored directly before
49850 ** of SQLite will not understand those serial types.
49919 ** Developers using SQLite on an ARM7 should compile and run their
49925 ** and has send his findings to the SQLite developers. Frank
51182 ** running with SQLITE_DEBUG defined the SQLite code sometimes assert()s
51636 ** This routine is added to support DBD::SQLite.
51728 ** Deprecated external interface. Internal/core SQLite code
53135 ** The formatting of each case is important. The makefile for SQLite
55355 ** Often, v-tables store their data in other SQLite tables, which
55497 ** SQLite used to check if the root-page flags were sane at this point
57070 ** the sqlite3_exec() call below, SQLite will invoke
58696 ** by SQLite to create journal files if the atomic-write optimization
59001 /* SQLite never tries to read past the end of a rollback journal file */
59045 ** access writes are not required by sqlite.
59114 ** part of SQLite causes Sync to be called by mistake.
60527 ** for generating VDBE code that evaluates expressions in SQLite.
61341 ** by subsequent calls to sqlite*ListAppend() routines.
62475 ** for testing only - to verify that SQLite always gets the same answer
64711 ** SQLite tables) that are identified by the name of the virtual table.
66496 ** This file contains C code routines that are called by the SQLite parser
68321 ** used by SQLite when the btree layer moves a table root page. The
68595 /* Remove the table entry from SQLite's internal schema and modify
71292 ** functions of SQLite.
72005 ** of the SQLite library that is running.
72019 ** SQLite.
72331 /* IMP: R-25361-16150 This function is omitted from SQLite by default. It
72333 ** when SQLite is built.
72826 ** Foreign keys in SQLite come in two flavours: deferred and immediate.
73985 /* EV: R-30323-21917 Each foreign key constraint in SQLite is
74010 ** to handle INSERT statements in SQLite.
75826 ** Main file for the SQLite library. The routines in this file
75828 ** other files are for internal use by SQLite and should not be
75973 ** the SQLite library.
75992 ** This header file defines the SQLite interface for use by
75994 ** an SQLite instance. Shared libraries that intend to be loaded
75995 ** as extensions by SQLite should #include this file instead of
76004 ** The following structure holds pointers to all of the SQLite API
76010 ** versions of SQLite will not be able to load each others' shared
76180 ** (part of the main SQLite library - not an extension) so that
76366 ** excluded from a build of SQLite. Substitute a NULL pointer
76447 ** The following structure contains pointers to all SQLite API routines.
76449 ** loaded so that the extension can make calls back into the SQLite
76672 ** Attempt to load an SQLite extension library contained in the file
76699 ** applications that relink against newer versions of SQLite, the
78192 /* Only change the value of sqlite.enc if the database handle is not
78193 ** initialized. If the main database exists, the new sqlite.enc value
78228 ** The schema-cookie is usually only manipulated internally by SQLite. It
78229 ** is incremented by SQLite whenever the database schema is modified (by
78231 ** SQLite each time a query is executed to ensure that the internal cache
78238 ** The user-version is not used internally by SQLite. It may be used by
79254 ** to handle SELECT statements in SQLite.
80702 ** Notice that because of the way SQLite parses compound SELECTs, the
84299 ** Remove a trigger from the hash tables of the sqlite* pointer.
85562 ** In version 1.0.x of SQLite, the VACUUM command would call
85564 ** with 2.0.0, SQLite no longer uses GDBM so this command has
86843 ** in prereqRight and prereqAll. The default is 64 bits, hence SQLite
89050 ** SQLite must perform on the index in question. For example, if the
89055 ** SQLite must perform 9 lookups on an index on (a, b), so nInMul is
89258 ** SQLite outputs rows in in the absence of an ORDER BY clause. */
90483 ** Previous versions of SQLite performed only the second iteration -
90485 ** cost. However, this meant that SQLite could select the wrong plan
90871 ** This version of "lempar.c" is modified, slightly, for use by SQLite.
90875 ** specific grammar used by SQLite.
92335 ** empty in SQLite. */
92367 /* In SQLite, we never try to destroy a parser that was not successfully
92930 ** that it has not been previously stressed... (SQLite ticket #2172)
94349 ** sqlite/tool/mkkeywordhash.c
94633 ** SQLite will allow '$' in identifiers for compatibility.
95379 ** Main file for the SQLite library. The routines in this file
95381 ** other files are for internal use by SQLite and should not be
95516 ** Initialize SQLite.
95520 ** SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT
95557 /* If SQLite is already completely initialized, then this call
95567 ** there is not much SQLite is going to be able to do.
95649 /* The following is just a sanity check to make sure SQLite has
95674 ** while any part of SQLite is otherwise in use in any thread. This
95676 ** on when SQLite is already shut down. If SQLite is already shut down
95703 ** the SQLite library at run-time.
95715 ** the SQLite library is in use. */
95993 ** comparison". SQLite's knowledge of upper and lower case equivalents
96050 ** Close an existing SQLite database
96316 ** This routine sets the busy callback for an Sqlite database to the
96334 ** This routine sets the progress callback for an Sqlite database to the
96802 ** Return the most recent error code generated by an SQLite routine. If NULL is
97040 /* Allocate the sqlite data structure */
97249 sqlite3 **ppDb, /* OUT: SQLite db handle */
97399 ** malloc() failure, but SQLite now does this automatically.
97453 ** SQLite no longer uses thread-specific data so this routine is now a
97462 ** See comment in sqlite3.h (sqlite.h.in) for details.
97810 ** the SQLITE_N_KEYWORD macro is not defined in this file if SQLite
98173 ** This is an SQLite module implementing full-text search.
98183 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
98211 ** This is identical to how sqlite encodes varints (see util.c).
98386 ** merge traverses the underlying sqlite disk structures efficiently.
98534 ** This method should return either SQLITE_OK (0), or an SQLite error
98573 ** the end of the buffer has been reached, or an SQLite error code.
98634 ** used in SQLite. We've modified it slightly to serve as a standalone
98756 ** Macro to return the number of elements in an array. SQLite has a
98764 ** from that used by SQLite, so the maximum length is 10, not 9.
98781 ** Internal types used by SQLite.
98808 sqlite3_vtab base; /* Base class used by SQLite core */
98853 sqlite3_vtab_cursor base; /* Base class used by SQLite core */
99194 ** Otherwise, return an SQLite error code.
99217 /* Create the whole "CREATE TABLE" statement to pass to SQLite */
99294 sqlite3 *db, /* The SQLite database connection */
100322 ** by SQLite, which may lead to "DROP TABLE" or "DETACH" commands
100644 ** This is the xEof method of the virtual table. SQLite calls this
100652 ** This is the xRowid method. The SQLite core calls this routine to
100668 ** This is the xColumn method, called by SQLite to request a value from
100680 /* The column value supplied by SQLite must be in range. */
100707 ** FTS3 virtual tables. It is invoked by SQLite each time a row is to be
100749 ** hash-table. Any changes made to the database are reverted by SQLite.
100847 sqlite3_context *pContext, /* SQLite function call context */
100884 sqlite3_context *pContext, /* SQLite function call context */
100925 sqlite3_context *pContext, /* SQLite function call context */
100951 sqlite3_context *pContext, /* SQLite function call context */
100985 sqlite3_context *pContext, /* SQLite function call context */
101117 ** of the sqlite library, then this function is called directly by
101118 ** SQLite. If fts3 is built as a dynamically loadable extension, this
101166 ** module with sqlite.
101506 ** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM
102141 ** This is the implementation of generic hash-tables used in SQLite.
102153 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
102533 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
103164 ** This is part of an SQLite module implementing full-text search.
103175 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
103669 ** SQLite (in which case SQLITE_ENABLE_FTS3 is defined).
103885 ** This file is part of the SQLite FTS3 extension module. Specifically,
104025 ** This function is used to obtain an SQLite prepared statement handle
104028 ** Otherwise, an SQLite error code is returned and *pp is set to 0.
104120 ** SQLite error code otherwise.
104136 ** etc.) occurs, return the appropriate SQLite error code.
104176 ** return an SQLite error code.
104196 ** if successful, or an SQLite error code otherwise.
104307 ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code.
104423 ** SQLite to the xUpdate() method. i.e:
104556 ** returned. Otherwise, an SQLite error code is returned.
104593 ** SQLITE_DONE. Otherwise, an SQLite error code.
104946 ** in the segment and SQLITE_OK is returned. Otherwise, an SQLite error
105292 ** blocks were written to the db). Otherwise, an SQLite error code is
105362 ** If successful, SQLITE_OK is returned. Otherwise, an SQLite error code.
105500 ** returned. Otherwise, an SQLite error code.
105554 ** error occurs, an SQLite error code is returned.
105572 ** Return SQLITE_OK if successful, or an SQLite error code if not.
105593 ** Return SQLITE_OK if successful, or an SQLite error code if not.
105620 ** SQLITE_OK is returned if successful, otherwise an SQLite error code.
105926 ** an SQLite error code is returned.
106892 sqlite3_context *pCtx, /* SQLite function call context */
106911 sqlite3_context *pCtx, /* SQLite function call context */
107501 sqlite3_context *pCtx, /* SQLite function call context */
107558 SQLite virtual table module.
108512 ** to zero and return an SQLite error code.
108667 ** sqlite uses an internal cost of 0.0).
110165 ** *piPageSize and SQLITE_OK returned. Otherwise, and an SQLite error
110422 ** for handling unicode data) and SQLite. The integration uses
110423 ** ICU to provide the following to SQLite:
110431 ** * Integration of ICU and SQLite collation seqences.
110609 sqlite3_context *pCtx, /* SQLite scalar function context */
110629 ** Implementation of SQLite REGEXP operator. This scalar function takes
110635 ** SQLite maps the regexp() function to the regexp() operator such
110804 ** types to an SQLite database connection. It is intended to be called