Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
sqlite3.h File Reference
#include <stdarg.h>

Go to the source code of this file.

Data Structures

struct  sqlite3_file
 
struct  sqlite3_io_methods
 
struct  sqlite3_vfs
 
struct  sqlite3_mem_methods
 
struct  sqlite3_module
 
struct  sqlite3_index_info
 
struct  sqlite3_index_info::sqlite3_index_constraint
 
struct  sqlite3_index_info::sqlite3_index_orderby
 
struct  sqlite3_index_info::sqlite3_index_constraint_usage
 
struct  sqlite3_vtab
 
struct  sqlite3_vtab_cursor
 
struct  sqlite3_mutex_methods
 
struct  sqlite3_pcache_page
 
struct  sqlite3_pcache_methods2
 
struct  sqlite3_pcache_methods
 
struct  sqlite3_snapshot
 
struct  sqlite3_rtree_geometry
 
struct  sqlite3_rtree_query_info
 
struct  Fts5PhraseIter
 
struct  Fts5ExtensionApi
 
struct  fts5_tokenizer
 
struct  fts5_api
 

Macros

#define SQLITE_EXTERN   extern
 
#define SQLITE_API
 
#define SQLITE_CDECL
 
#define SQLITE_APICALL
 
#define SQLITE_STDCALL   SQLITE_APICALL
 
#define SQLITE_CALLBACK
 
#define SQLITE_SYSAPI
 
#define SQLITE_DEPRECATED
 
#define SQLITE_EXPERIMENTAL
 
#define SQLITE_VERSION   "3.33.0"
 
#define SQLITE_VERSION_NUMBER   3033000
 
#define SQLITE_SOURCE_ID   "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"
 
#define SQLITE_OK   0 /* Successful result */
 
#define SQLITE_ERROR   1 /* Generic error */
 
#define SQLITE_INTERNAL   2 /* Internal logic error in SQLite */
 
#define SQLITE_PERM   3 /* Access permission denied */
 
#define SQLITE_ABORT   4 /* Callback routine requested an abort */
 
#define SQLITE_BUSY   5 /* The database file is locked */
 
#define SQLITE_LOCKED   6 /* A table in the database is locked */
 
#define SQLITE_NOMEM   7 /* A malloc() failed */
 
#define SQLITE_READONLY   8 /* Attempt to write a readonly database */
 
#define SQLITE_INTERRUPT   9 /* Operation terminated by sqlite3_interrupt()*/
 
#define SQLITE_IOERR   10 /* Some kind of disk I/O error occurred */
 
#define SQLITE_CORRUPT   11 /* The database disk image is malformed */
 
#define SQLITE_NOTFOUND   12 /* Unknown opcode in sqlite3_file_control() */
 
#define SQLITE_FULL   13 /* Insertion failed because database is full */
 
#define SQLITE_CANTOPEN   14 /* Unable to open the database file */
 
#define SQLITE_PROTOCOL   15 /* Database lock protocol error */
 
#define SQLITE_EMPTY   16 /* Internal use only */
 
#define SQLITE_SCHEMA   17 /* The database schema changed */
 
#define SQLITE_TOOBIG   18 /* String or BLOB exceeds size limit */
 
#define SQLITE_CONSTRAINT   19 /* Abort due to constraint violation */
 
#define SQLITE_MISMATCH   20 /* Data type mismatch */
 
#define SQLITE_MISUSE   21 /* Library used incorrectly */
 
#define SQLITE_NOLFS   22 /* Uses OS features not supported on host */
 
#define SQLITE_AUTH   23 /* Authorization denied */
 
#define SQLITE_FORMAT   24 /* Not used */
 
#define SQLITE_RANGE   25 /* 2nd parameter to sqlite3_bind out of range */
 
#define SQLITE_NOTADB   26 /* File opened that is not a database file */
 
#define SQLITE_NOTICE   27 /* Notifications from sqlite3_log() */
 
#define SQLITE_WARNING   28 /* Warnings from sqlite3_log() */
 
#define SQLITE_ROW   100 /* sqlite3_step() has another row ready */
 
#define SQLITE_DONE   101 /* sqlite3_step() has finished executing */
 
#define SQLITE_ERROR_MISSING_COLLSEQ   (SQLITE_ERROR | (1<<8))
 
#define SQLITE_ERROR_RETRY   (SQLITE_ERROR | (2<<8))
 
#define SQLITE_ERROR_SNAPSHOT   (SQLITE_ERROR | (3<<8))
 
#define SQLITE_IOERR_READ   (SQLITE_IOERR | (1<<8))
 
#define SQLITE_IOERR_SHORT_READ   (SQLITE_IOERR | (2<<8))
 
#define SQLITE_IOERR_WRITE   (SQLITE_IOERR | (3<<8))
 
#define SQLITE_IOERR_FSYNC   (SQLITE_IOERR | (4<<8))
 
#define SQLITE_IOERR_DIR_FSYNC   (SQLITE_IOERR | (5<<8))
 
#define SQLITE_IOERR_TRUNCATE   (SQLITE_IOERR | (6<<8))
 
#define SQLITE_IOERR_FSTAT   (SQLITE_IOERR | (7<<8))
 
#define SQLITE_IOERR_UNLOCK   (SQLITE_IOERR | (8<<8))
 
#define SQLITE_IOERR_RDLOCK   (SQLITE_IOERR | (9<<8))
 
#define SQLITE_IOERR_DELETE   (SQLITE_IOERR | (10<<8))
 
#define SQLITE_IOERR_BLOCKED   (SQLITE_IOERR | (11<<8))
 
#define SQLITE_IOERR_NOMEM   (SQLITE_IOERR | (12<<8))
 
#define SQLITE_IOERR_ACCESS   (SQLITE_IOERR | (13<<8))
 
#define SQLITE_IOERR_CHECKRESERVEDLOCK   (SQLITE_IOERR | (14<<8))
 
#define SQLITE_IOERR_LOCK   (SQLITE_IOERR | (15<<8))
 
#define SQLITE_IOERR_CLOSE   (SQLITE_IOERR | (16<<8))
 
#define SQLITE_IOERR_DIR_CLOSE   (SQLITE_IOERR | (17<<8))
 
#define SQLITE_IOERR_SHMOPEN   (SQLITE_IOERR | (18<<8))
 
#define SQLITE_IOERR_SHMSIZE   (SQLITE_IOERR | (19<<8))
 
#define SQLITE_IOERR_SHMLOCK   (SQLITE_IOERR | (20<<8))
 
#define SQLITE_IOERR_SHMMAP   (SQLITE_IOERR | (21<<8))
 
#define SQLITE_IOERR_SEEK   (SQLITE_IOERR | (22<<8))
 
#define SQLITE_IOERR_DELETE_NOENT   (SQLITE_IOERR | (23<<8))
 
#define SQLITE_IOERR_MMAP   (SQLITE_IOERR | (24<<8))
 
#define SQLITE_IOERR_GETTEMPPATH   (SQLITE_IOERR | (25<<8))
 
#define SQLITE_IOERR_CONVPATH   (SQLITE_IOERR | (26<<8))
 
#define SQLITE_IOERR_VNODE   (SQLITE_IOERR | (27<<8))
 
#define SQLITE_IOERR_AUTH   (SQLITE_IOERR | (28<<8))
 
#define SQLITE_IOERR_BEGIN_ATOMIC   (SQLITE_IOERR | (29<<8))
 
#define SQLITE_IOERR_COMMIT_ATOMIC   (SQLITE_IOERR | (30<<8))
 
#define SQLITE_IOERR_ROLLBACK_ATOMIC   (SQLITE_IOERR | (31<<8))
 
#define SQLITE_IOERR_DATA   (SQLITE_IOERR | (32<<8))
 
#define SQLITE_LOCKED_SHAREDCACHE   (SQLITE_LOCKED | (1<<8))
 
#define SQLITE_LOCKED_VTAB   (SQLITE_LOCKED | (2<<8))
 
#define SQLITE_BUSY_RECOVERY   (SQLITE_BUSY | (1<<8))
 
#define SQLITE_BUSY_SNAPSHOT   (SQLITE_BUSY | (2<<8))
 
#define SQLITE_BUSY_TIMEOUT   (SQLITE_BUSY | (3<<8))
 
#define SQLITE_CANTOPEN_NOTEMPDIR   (SQLITE_CANTOPEN | (1<<8))
 
#define SQLITE_CANTOPEN_ISDIR   (SQLITE_CANTOPEN | (2<<8))
 
#define SQLITE_CANTOPEN_FULLPATH   (SQLITE_CANTOPEN | (3<<8))
 
#define SQLITE_CANTOPEN_CONVPATH   (SQLITE_CANTOPEN | (4<<8))
 
#define SQLITE_CANTOPEN_DIRTYWAL   (SQLITE_CANTOPEN | (5<<8)) /* Not Used */
 
#define SQLITE_CANTOPEN_SYMLINK   (SQLITE_CANTOPEN | (6<<8))
 
#define SQLITE_CORRUPT_VTAB   (SQLITE_CORRUPT | (1<<8))
 
#define SQLITE_CORRUPT_SEQUENCE   (SQLITE_CORRUPT | (2<<8))
 
#define SQLITE_CORRUPT_INDEX   (SQLITE_CORRUPT | (3<<8))
 
#define SQLITE_READONLY_RECOVERY   (SQLITE_READONLY | (1<<8))
 
#define SQLITE_READONLY_CANTLOCK   (SQLITE_READONLY | (2<<8))
 
#define SQLITE_READONLY_ROLLBACK   (SQLITE_READONLY | (3<<8))
 
#define SQLITE_READONLY_DBMOVED   (SQLITE_READONLY | (4<<8))
 
#define SQLITE_READONLY_CANTINIT   (SQLITE_READONLY | (5<<8))
 
#define SQLITE_READONLY_DIRECTORY   (SQLITE_READONLY | (6<<8))
 
#define SQLITE_ABORT_ROLLBACK   (SQLITE_ABORT | (2<<8))
 
#define SQLITE_CONSTRAINT_CHECK   (SQLITE_CONSTRAINT | (1<<8))
 
#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))
 
#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))
 
#define SQLITE_CONSTRAINT_FUNCTION   (SQLITE_CONSTRAINT | (4<<8))
 
#define SQLITE_CONSTRAINT_NOTNULL   (SQLITE_CONSTRAINT | (5<<8))
 
#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))
 
#define SQLITE_CONSTRAINT_TRIGGER   (SQLITE_CONSTRAINT | (7<<8))
 
#define SQLITE_CONSTRAINT_UNIQUE   (SQLITE_CONSTRAINT | (8<<8))
 
#define SQLITE_CONSTRAINT_VTAB   (SQLITE_CONSTRAINT | (9<<8))
 
#define SQLITE_CONSTRAINT_ROWID   (SQLITE_CONSTRAINT |(10<<8))
 
#define SQLITE_CONSTRAINT_PINNED   (SQLITE_CONSTRAINT |(11<<8))
 
#define SQLITE_NOTICE_RECOVER_WAL   (SQLITE_NOTICE | (1<<8))
 
#define SQLITE_NOTICE_RECOVER_ROLLBACK   (SQLITE_NOTICE | (2<<8))
 
#define SQLITE_WARNING_AUTOINDEX   (SQLITE_WARNING | (1<<8))
 
#define SQLITE_AUTH_USER   (SQLITE_AUTH | (1<<8))
 
#define SQLITE_OK_LOAD_PERMANENTLY   (SQLITE_OK | (1<<8))
 
#define SQLITE_OK_SYMLINK   (SQLITE_OK | (2<<8))
 
#define SQLITE_OPEN_READONLY   0x00000001 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_READWRITE   0x00000002 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_CREATE   0x00000004 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_DELETEONCLOSE   0x00000008 /* VFS only */
 
#define SQLITE_OPEN_EXCLUSIVE   0x00000010 /* VFS only */
 
#define SQLITE_OPEN_AUTOPROXY   0x00000020 /* VFS only */
 
#define SQLITE_OPEN_URI   0x00000040 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_MEMORY   0x00000080 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_MAIN_DB   0x00000100 /* VFS only */
 
#define SQLITE_OPEN_TEMP_DB   0x00000200 /* VFS only */
 
#define SQLITE_OPEN_TRANSIENT_DB   0x00000400 /* VFS only */
 
#define SQLITE_OPEN_MAIN_JOURNAL   0x00000800 /* VFS only */
 
#define SQLITE_OPEN_TEMP_JOURNAL   0x00001000 /* VFS only */
 
#define SQLITE_OPEN_SUBJOURNAL   0x00002000 /* VFS only */
 
#define SQLITE_OPEN_SUPER_JOURNAL   0x00004000 /* VFS only */
 
#define SQLITE_OPEN_NOMUTEX   0x00008000 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_FULLMUTEX   0x00010000 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_SHAREDCACHE   0x00020000 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_PRIVATECACHE   0x00040000 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_WAL   0x00080000 /* VFS only */
 
#define SQLITE_OPEN_NOFOLLOW   0x01000000 /* Ok for sqlite3_open_v2() */
 
#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000 /* VFS only */
 
#define SQLITE_IOCAP_ATOMIC   0x00000001
 
#define SQLITE_IOCAP_ATOMIC512   0x00000002
 
#define SQLITE_IOCAP_ATOMIC1K   0x00000004
 
#define SQLITE_IOCAP_ATOMIC2K   0x00000008
 
#define SQLITE_IOCAP_ATOMIC4K   0x00000010
 
#define SQLITE_IOCAP_ATOMIC8K   0x00000020
 
#define SQLITE_IOCAP_ATOMIC16K   0x00000040
 
#define SQLITE_IOCAP_ATOMIC32K   0x00000080
 
#define SQLITE_IOCAP_ATOMIC64K   0x00000100
 
#define SQLITE_IOCAP_SAFE_APPEND   0x00000200
 
#define SQLITE_IOCAP_SEQUENTIAL   0x00000400
 
#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN   0x00000800
 
#define SQLITE_IOCAP_POWERSAFE_OVERWRITE   0x00001000
 
#define SQLITE_IOCAP_IMMUTABLE   0x00002000
 
#define SQLITE_IOCAP_BATCH_ATOMIC   0x00004000
 
#define SQLITE_LOCK_NONE   0
 
#define SQLITE_LOCK_SHARED   1
 
#define SQLITE_LOCK_RESERVED   2
 
#define SQLITE_LOCK_PENDING   3
 
#define SQLITE_LOCK_EXCLUSIVE   4
 
#define SQLITE_SYNC_NORMAL   0x00002
 
#define SQLITE_SYNC_FULL   0x00003
 
#define SQLITE_SYNC_DATAONLY   0x00010
 
#define SQLITE_FCNTL_LOCKSTATE   1
 
#define SQLITE_FCNTL_GET_LOCKPROXYFILE   2
 
#define SQLITE_FCNTL_SET_LOCKPROXYFILE   3
 
#define SQLITE_FCNTL_LAST_ERRNO   4
 
#define SQLITE_FCNTL_SIZE_HINT   5
 
#define SQLITE_FCNTL_CHUNK_SIZE   6
 
#define SQLITE_FCNTL_FILE_POINTER   7
 
#define SQLITE_FCNTL_SYNC_OMITTED   8
 
#define SQLITE_FCNTL_WIN32_AV_RETRY   9
 
#define SQLITE_FCNTL_PERSIST_WAL   10
 
#define SQLITE_FCNTL_OVERWRITE   11
 
#define SQLITE_FCNTL_VFSNAME   12
 
#define SQLITE_FCNTL_POWERSAFE_OVERWRITE   13
 
#define SQLITE_FCNTL_PRAGMA   14
 
#define SQLITE_FCNTL_BUSYHANDLER   15
 
#define SQLITE_FCNTL_TEMPFILENAME   16
 
#define SQLITE_FCNTL_MMAP_SIZE   18
 
#define SQLITE_FCNTL_TRACE   19
 
#define SQLITE_FCNTL_HAS_MOVED   20
 
#define SQLITE_FCNTL_SYNC   21
 
#define SQLITE_FCNTL_COMMIT_PHASETWO   22
 
#define SQLITE_FCNTL_WIN32_SET_HANDLE   23
 
#define SQLITE_FCNTL_WAL_BLOCK   24
 
#define SQLITE_FCNTL_ZIPVFS   25
 
#define SQLITE_FCNTL_RBU   26
 
#define SQLITE_FCNTL_VFS_POINTER   27
 
#define SQLITE_FCNTL_JOURNAL_POINTER   28
 
#define SQLITE_FCNTL_WIN32_GET_HANDLE   29
 
#define SQLITE_FCNTL_PDB   30
 
#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE   31
 
#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE   32
 
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE   33
 
#define SQLITE_FCNTL_LOCK_TIMEOUT   34
 
#define SQLITE_FCNTL_DATA_VERSION   35
 
#define SQLITE_FCNTL_SIZE_LIMIT   36
 
#define SQLITE_FCNTL_CKPT_DONE   37
 
#define SQLITE_FCNTL_RESERVE_BYTES   38
 
#define SQLITE_FCNTL_CKPT_START   39
 
#define SQLITE_GET_LOCKPROXYFILE   SQLITE_FCNTL_GET_LOCKPROXYFILE
 
#define SQLITE_SET_LOCKPROXYFILE   SQLITE_FCNTL_SET_LOCKPROXYFILE
 
#define SQLITE_LAST_ERRNO   SQLITE_FCNTL_LAST_ERRNO
 
#define SQLITE_ACCESS_EXISTS   0
 
#define SQLITE_ACCESS_READWRITE   1 /* Used by PRAGMA temp_store_directory */
 
#define SQLITE_ACCESS_READ   2 /* Unused */
 
#define SQLITE_SHM_UNLOCK   1
 
#define SQLITE_SHM_LOCK   2
 
#define SQLITE_SHM_SHARED   4
 
#define SQLITE_SHM_EXCLUSIVE   8
 
#define SQLITE_SHM_NLOCK   8
 
#define SQLITE_CONFIG_SINGLETHREAD   1 /* nil */
 
#define SQLITE_CONFIG_MULTITHREAD   2 /* nil */
 
#define SQLITE_CONFIG_SERIALIZED   3 /* nil */
 
#define SQLITE_CONFIG_MALLOC   4 /* sqlite3_mem_methods* */
 
#define SQLITE_CONFIG_GETMALLOC   5 /* sqlite3_mem_methods* */
 
#define SQLITE_CONFIG_SCRATCH   6 /* No longer used */
 
#define SQLITE_CONFIG_PAGECACHE   7 /* void*, int sz, int N */
 
#define SQLITE_CONFIG_HEAP   8 /* void*, int nByte, int min */
 
#define SQLITE_CONFIG_MEMSTATUS   9 /* boolean */
 
#define SQLITE_CONFIG_MUTEX   10 /* sqlite3_mutex_methods* */
 
#define SQLITE_CONFIG_GETMUTEX   11 /* sqlite3_mutex_methods* */
 
#define SQLITE_CONFIG_LOOKASIDE   13 /* int int */
 
#define SQLITE_CONFIG_PCACHE   14 /* no-op */
 
#define SQLITE_CONFIG_GETPCACHE   15 /* no-op */
 
#define SQLITE_CONFIG_LOG   16 /* xFunc, void* */
 
#define SQLITE_CONFIG_URI   17 /* int */
 
#define SQLITE_CONFIG_PCACHE2   18 /* sqlite3_pcache_methods2* */
 
#define SQLITE_CONFIG_GETPCACHE2   19 /* sqlite3_pcache_methods2* */
 
#define SQLITE_CONFIG_COVERING_INDEX_SCAN   20 /* int */
 
#define SQLITE_CONFIG_SQLLOG   21 /* xSqllog, void* */
 
#define SQLITE_CONFIG_MMAP_SIZE   22 /* sqlite3_int64, sqlite3_int64 */
 
#define SQLITE_CONFIG_WIN32_HEAPSIZE   23 /* int nByte */
 
#define SQLITE_CONFIG_PCACHE_HDRSZ   24 /* int *psz */
 
#define SQLITE_CONFIG_PMASZ   25 /* unsigned int szPma */
 
#define SQLITE_CONFIG_STMTJRNL_SPILL   26 /* int nByte */
 
#define SQLITE_CONFIG_SMALL_MALLOC   27 /* boolean */
 
#define SQLITE_CONFIG_SORTERREF_SIZE   28 /* int nByte */
 
#define SQLITE_CONFIG_MEMDB_MAXSIZE   29 /* sqlite3_int64 */
 
#define SQLITE_DBCONFIG_MAINDBNAME   1000 /* const char* */
 
#define SQLITE_DBCONFIG_LOOKASIDE   1001 /* void* int int */
 
#define SQLITE_DBCONFIG_ENABLE_FKEY   1002 /* int int* */
 
#define SQLITE_DBCONFIG_ENABLE_TRIGGER   1003 /* int int* */
 
#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER   1004 /* int int* */
 
#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION   1005 /* int int* */
 
#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE   1006 /* int int* */
 
#define SQLITE_DBCONFIG_ENABLE_QPSG   1007 /* int int* */
 
#define SQLITE_DBCONFIG_TRIGGER_EQP   1008 /* int int* */
 
#define SQLITE_DBCONFIG_RESET_DATABASE   1009 /* int int* */
 
#define SQLITE_DBCONFIG_DEFENSIVE   1010 /* int int* */
 
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA   1011 /* int int* */
 
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE   1012 /* int int* */
 
#define SQLITE_DBCONFIG_DQS_DML   1013 /* int int* */
 
#define SQLITE_DBCONFIG_DQS_DDL   1014 /* int int* */
 
#define SQLITE_DBCONFIG_ENABLE_VIEW   1015 /* int int* */
 
#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT   1016 /* int int* */
 
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA   1017 /* int int* */
 
#define SQLITE_DBCONFIG_MAX   1017 /* Largest DBCONFIG */
 
#define SQLITE_DENY   1 /* Abort the SQL statement with an error */
 
#define SQLITE_IGNORE   2 /* Don't allow access, but don't generate an error */
 
#define SQLITE_CREATE_INDEX   1 /* Index Name Table Name */
 
#define SQLITE_CREATE_TABLE   2 /* Table Name NULL */
 
#define SQLITE_CREATE_TEMP_INDEX   3 /* Index Name Table Name */
 
#define SQLITE_CREATE_TEMP_TABLE   4 /* Table Name NULL */
 
#define SQLITE_CREATE_TEMP_TRIGGER   5 /* Trigger Name Table Name */
 
#define SQLITE_CREATE_TEMP_VIEW   6 /* View Name NULL */
 
#define SQLITE_CREATE_TRIGGER   7 /* Trigger Name Table Name */
 
#define SQLITE_CREATE_VIEW   8 /* View Name NULL */
 
#define SQLITE_DELETE   9 /* Table Name NULL */
 
#define SQLITE_DROP_INDEX   10 /* Index Name Table Name */
 
#define SQLITE_DROP_TABLE   11 /* Table Name NULL */
 
#define SQLITE_DROP_TEMP_INDEX   12 /* Index Name Table Name */
 
#define SQLITE_DROP_TEMP_TABLE   13 /* Table Name NULL */
 
#define SQLITE_DROP_TEMP_TRIGGER   14 /* Trigger Name Table Name */
 
#define SQLITE_DROP_TEMP_VIEW   15 /* View Name NULL */
 
#define SQLITE_DROP_TRIGGER   16 /* Trigger Name Table Name */
 
#define SQLITE_DROP_VIEW   17 /* View Name NULL */
 
#define SQLITE_INSERT   18 /* Table Name NULL */
 
#define SQLITE_PRAGMA   19 /* Pragma Name 1st arg or NULL */
 
#define SQLITE_READ   20 /* Table Name Column Name */
 
#define SQLITE_SELECT   21 /* NULL NULL */
 
#define SQLITE_TRANSACTION   22 /* Operation NULL */
 
#define SQLITE_UPDATE   23 /* Table Name Column Name */
 
#define SQLITE_ATTACH   24 /* Filename NULL */
 
#define SQLITE_DETACH   25 /* Database Name NULL */
 
#define SQLITE_ALTER_TABLE   26 /* Database Name Table Name */
 
#define SQLITE_REINDEX   27 /* Index Name NULL */
 
#define SQLITE_ANALYZE   28 /* Table Name NULL */
 
#define SQLITE_CREATE_VTABLE   29 /* Table Name Module Name */
 
#define SQLITE_DROP_VTABLE   30 /* Table Name Module Name */
 
#define SQLITE_FUNCTION   31 /* NULL Function Name */
 
#define SQLITE_SAVEPOINT   32 /* Operation Savepoint Name */
 
#define SQLITE_COPY   0 /* No longer used */
 
#define SQLITE_RECURSIVE   33 /* NULL NULL */
 
#define SQLITE_TRACE_STMT   0x01
 
#define SQLITE_TRACE_PROFILE   0x02
 
#define SQLITE_TRACE_ROW   0x04
 
#define SQLITE_TRACE_CLOSE   0x08
 
#define SQLITE_LIMIT_LENGTH   0
 
#define SQLITE_LIMIT_SQL_LENGTH   1
 
#define SQLITE_LIMIT_COLUMN   2
 
#define SQLITE_LIMIT_EXPR_DEPTH   3
 
#define SQLITE_LIMIT_COMPOUND_SELECT   4
 
#define SQLITE_LIMIT_VDBE_OP   5
 
#define SQLITE_LIMIT_FUNCTION_ARG   6
 
#define SQLITE_LIMIT_ATTACHED   7
 
#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH   8
 
#define SQLITE_LIMIT_VARIABLE_NUMBER   9
 
#define SQLITE_LIMIT_TRIGGER_DEPTH   10
 
#define SQLITE_LIMIT_WORKER_THREADS   11
 
#define SQLITE_PREPARE_PERSISTENT   0x01
 
#define SQLITE_PREPARE_NORMALIZE   0x02
 
#define SQLITE_PREPARE_NO_VTAB   0x04
 
#define SQLITE_INTEGER   1
 
#define SQLITE_FLOAT   2
 
#define SQLITE_BLOB   4
 
#define SQLITE_NULL   5
 
#define SQLITE_TEXT   3
 
#define SQLITE3_TEXT   3
 
#define SQLITE_UTF8   1 /* IMP: R-37514-35566 */
 
#define SQLITE_UTF16LE   2 /* IMP: R-03371-37637 */
 
#define SQLITE_UTF16BE   3 /* IMP: R-51971-34154 */
 
#define SQLITE_UTF16   4 /* Use native byte order */
 
#define SQLITE_ANY   5 /* Deprecated */
 
#define SQLITE_UTF16_ALIGNED   8 /* sqlite3_create_collation only */
 
#define SQLITE_DETERMINISTIC   0x000000800
 
#define SQLITE_DIRECTONLY   0x000080000
 
#define SQLITE_SUBTYPE   0x000100000
 
#define SQLITE_INNOCUOUS   0x000200000
 
#define SQLITE_STATIC   ((sqlite3_destructor_type)0)
 
#define SQLITE_TRANSIENT   ((sqlite3_destructor_type)-1)
 
#define SQLITE_WIN32_DATA_DIRECTORY_TYPE   1
 
#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE   2
 
#define SQLITE_INDEX_SCAN_UNIQUE   1 /* Scan visits at most 1 row */
 
#define SQLITE_INDEX_CONSTRAINT_EQ   2
 
#define SQLITE_INDEX_CONSTRAINT_GT   4
 
#define SQLITE_INDEX_CONSTRAINT_LE   8
 
#define SQLITE_INDEX_CONSTRAINT_LT   16
 
#define SQLITE_INDEX_CONSTRAINT_GE   32
 
#define SQLITE_INDEX_CONSTRAINT_MATCH   64
 
#define SQLITE_INDEX_CONSTRAINT_LIKE   65
 
#define SQLITE_INDEX_CONSTRAINT_GLOB   66
 
#define SQLITE_INDEX_CONSTRAINT_REGEXP   67
 
#define SQLITE_INDEX_CONSTRAINT_NE   68
 
#define SQLITE_INDEX_CONSTRAINT_ISNOT   69
 
#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL   70
 
#define SQLITE_INDEX_CONSTRAINT_ISNULL   71
 
#define SQLITE_INDEX_CONSTRAINT_IS   72
 
#define SQLITE_INDEX_CONSTRAINT_FUNCTION   150
 
#define SQLITE_MUTEX_FAST   0
 
#define SQLITE_MUTEX_RECURSIVE   1
 
#define SQLITE_MUTEX_STATIC_MAIN   2
 
#define SQLITE_MUTEX_STATIC_MEM   3 /* sqlite3_malloc() */
 
#define SQLITE_MUTEX_STATIC_MEM2   4 /* NOT USED */
 
#define SQLITE_MUTEX_STATIC_OPEN   4 /* sqlite3BtreeOpen() */
 
#define SQLITE_MUTEX_STATIC_PRNG   5 /* sqlite3_randomness() */
 
#define SQLITE_MUTEX_STATIC_LRU   6 /* lru page list */
 
#define SQLITE_MUTEX_STATIC_LRU2   7 /* NOT USED */
 
#define SQLITE_MUTEX_STATIC_PMEM   7 /* sqlite3PageMalloc() */
 
#define SQLITE_MUTEX_STATIC_APP1   8 /* For use by application */
 
#define SQLITE_MUTEX_STATIC_APP2   9 /* For use by application */
 
#define SQLITE_MUTEX_STATIC_APP3   10 /* For use by application */
 
#define SQLITE_MUTEX_STATIC_VFS1   11 /* For use by built-in VFS */
 
#define SQLITE_MUTEX_STATIC_VFS2   12 /* For use by extension VFS */
 
#define SQLITE_MUTEX_STATIC_VFS3   13 /* For use by application VFS */
 
#define SQLITE_MUTEX_STATIC_MASTER   2
 
#define SQLITE_TESTCTRL_FIRST   5
 
#define SQLITE_TESTCTRL_PRNG_SAVE   5
 
#define SQLITE_TESTCTRL_PRNG_RESTORE   6
 
#define SQLITE_TESTCTRL_PRNG_RESET   7 /* NOT USED */
 
#define SQLITE_TESTCTRL_BITVEC_TEST   8
 
#define SQLITE_TESTCTRL_FAULT_INSTALL   9
 
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   10
 
#define SQLITE_TESTCTRL_PENDING_BYTE   11
 
#define SQLITE_TESTCTRL_ASSERT   12
 
#define SQLITE_TESTCTRL_ALWAYS   13
 
#define SQLITE_TESTCTRL_RESERVE   14 /* NOT USED */
 
#define SQLITE_TESTCTRL_OPTIMIZATIONS   15
 
#define SQLITE_TESTCTRL_ISKEYWORD   16 /* NOT USED */
 
#define SQLITE_TESTCTRL_SCRATCHMALLOC   17 /* NOT USED */
 
#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS   17
 
#define SQLITE_TESTCTRL_LOCALTIME_FAULT   18
 
#define SQLITE_TESTCTRL_EXPLAIN_STMT   19 /* NOT USED */
 
#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD   19
 
#define SQLITE_TESTCTRL_NEVER_CORRUPT   20
 
#define SQLITE_TESTCTRL_VDBE_COVERAGE   21
 
#define SQLITE_TESTCTRL_BYTEORDER   22
 
#define SQLITE_TESTCTRL_ISINIT   23
 
#define SQLITE_TESTCTRL_SORTER_MMAP   24
 
#define SQLITE_TESTCTRL_IMPOSTER   25
 
#define SQLITE_TESTCTRL_PARSER_COVERAGE   26
 
#define SQLITE_TESTCTRL_RESULT_INTREAL   27
 
#define SQLITE_TESTCTRL_PRNG_SEED   28
 
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS   29
 
#define SQLITE_TESTCTRL_LAST   29 /* Largest TESTCTRL */
 
#define SQLITE_STATUS_MEMORY_USED   0
 
#define SQLITE_STATUS_PAGECACHE_USED   1
 
#define SQLITE_STATUS_PAGECACHE_OVERFLOW   2
 
#define SQLITE_STATUS_SCRATCH_USED   3 /* NOT USED */
 
#define SQLITE_STATUS_SCRATCH_OVERFLOW   4 /* NOT USED */
 
#define SQLITE_STATUS_MALLOC_SIZE   5
 
#define SQLITE_STATUS_PARSER_STACK   6
 
#define SQLITE_STATUS_PAGECACHE_SIZE   7
 
#define SQLITE_STATUS_SCRATCH_SIZE   8 /* NOT USED */
 
#define SQLITE_STATUS_MALLOC_COUNT   9
 
#define SQLITE_DBSTATUS_LOOKASIDE_USED   0
 
#define SQLITE_DBSTATUS_CACHE_USED   1
 
#define SQLITE_DBSTATUS_SCHEMA_USED   2
 
#define SQLITE_DBSTATUS_STMT_USED   3
 
#define SQLITE_DBSTATUS_LOOKASIDE_HIT   4
 
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   5
 
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   6
 
#define SQLITE_DBSTATUS_CACHE_HIT   7
 
#define SQLITE_DBSTATUS_CACHE_MISS   8
 
#define SQLITE_DBSTATUS_CACHE_WRITE   9
 
#define SQLITE_DBSTATUS_DEFERRED_FKS   10
 
#define SQLITE_DBSTATUS_CACHE_USED_SHARED   11
 
#define SQLITE_DBSTATUS_CACHE_SPILL   12
 
#define SQLITE_DBSTATUS_MAX   12 /* Largest defined DBSTATUS */
 
#define SQLITE_STMTSTATUS_FULLSCAN_STEP   1
 
#define SQLITE_STMTSTATUS_SORT   2
 
#define SQLITE_STMTSTATUS_AUTOINDEX   3
 
#define SQLITE_STMTSTATUS_VM_STEP   4
 
#define SQLITE_STMTSTATUS_REPREPARE   5
 
#define SQLITE_STMTSTATUS_RUN   6
 
#define SQLITE_STMTSTATUS_MEMUSED   99
 
#define SQLITE_CHECKPOINT_PASSIVE   0 /* Do as much as possible w/o blocking */
 
#define SQLITE_CHECKPOINT_FULL   1 /* Wait for writers, then checkpoint */
 
#define SQLITE_CHECKPOINT_RESTART   2 /* Like FULL but wait for for readers */
 
#define SQLITE_CHECKPOINT_TRUNCATE   3 /* Like RESTART but also truncate WAL */
 
#define SQLITE_VTAB_CONSTRAINT_SUPPORT   1
 
#define SQLITE_VTAB_INNOCUOUS   2
 
#define SQLITE_VTAB_DIRECTONLY   3
 
#define SQLITE_ROLLBACK   1
 
#define SQLITE_FAIL   3
 
#define SQLITE_REPLACE   5
 
#define SQLITE_SCANSTAT_NLOOP   0
 
#define SQLITE_SCANSTAT_NVISIT   1
 
#define SQLITE_SCANSTAT_EST   2
 
#define SQLITE_SCANSTAT_NAME   3
 
#define SQLITE_SCANSTAT_EXPLAIN   4
 
#define SQLITE_SCANSTAT_SELECTID   5
 
#define SQLITE_SERIALIZE_NOCOPY   0x001 /* Do no memory allocations */
 
#define SQLITE_DESERIALIZE_FREEONCLOSE   1 /* Call sqlite3_free() on close */
 
#define SQLITE_DESERIALIZE_RESIZEABLE   2 /* Resize using sqlite3_realloc64() */
 
#define SQLITE_DESERIALIZE_READONLY   4 /* Database is read-only */
 
#define _SQLITE3RTREE_H_
 
#define NOT_WITHIN   0 /* Object completely outside of query region */
 
#define PARTLY_WITHIN   1 /* Object partially overlaps query region */
 
#define FULLY_WITHIN   2 /* Object fully contained within query region */
 
#define _FTS5_H
 
#define FTS5_TOKENIZE_QUERY   0x0001
 
#define FTS5_TOKENIZE_PREFIX   0x0002
 
#define FTS5_TOKENIZE_DOCUMENT   0x0004
 
#define FTS5_TOKENIZE_AUX   0x0008
 
#define FTS5_TOKEN_COLOCATED   0x0001 /* Same position as prev. token */
 

Typedefs

typedef struct sqlite3 sqlite3
 
typedef long long int sqlite_int64
 
typedef unsigned long long int sqlite_uint64
 
typedef sqlite_int64 sqlite3_int64
 
typedef sqlite_uint64 sqlite3_uint64
 
typedef int(* sqlite3_callback) (void *, int, char **, char **)
 
typedef struct sqlite3_file sqlite3_file
 
typedef struct sqlite3_io_methods sqlite3_io_methods
 
typedef struct sqlite3_mutex sqlite3_mutex
 
typedef struct sqlite3_api_routines sqlite3_api_routines
 
typedef struct sqlite3_vfs sqlite3_vfs
 
typedef void(* sqlite3_syscall_ptr) (void)
 
typedef struct sqlite3_mem_methods sqlite3_mem_methods
 
typedef struct sqlite3_stmt sqlite3_stmt
 
typedef struct sqlite3_value sqlite3_value
 
typedef struct sqlite3_context sqlite3_context
 
typedef void(* sqlite3_destructor_type) (void *)
 
typedef struct sqlite3_vtab sqlite3_vtab
 
typedef struct sqlite3_index_info sqlite3_index_info
 
typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor
 
typedef struct sqlite3_module sqlite3_module
 
typedef struct sqlite3_blob sqlite3_blob
 
typedef struct sqlite3_mutex_methods sqlite3_mutex_methods
 
typedef struct sqlite3_str sqlite3_str
 
typedef struct sqlite3_pcache sqlite3_pcache
 
typedef struct sqlite3_pcache_page sqlite3_pcache_page
 
typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2
 
typedef struct sqlite3_pcache_methods sqlite3_pcache_methods
 
typedef struct sqlite3_backup sqlite3_backup
 
typedef struct sqlite3_snapshot sqlite3_snapshot
 
typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry
 
typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info
 
typedef double sqlite3_rtree_dbl
 
typedef struct Fts5ExtensionApi Fts5ExtensionApi
 
typedef struct Fts5Context Fts5Context
 
typedef struct Fts5PhraseIter Fts5PhraseIter
 
typedef void(* fts5_extension_function) (const Fts5ExtensionApi *pApi, Fts5Context *pFts, sqlite3_context *pCtx, int nVal, sqlite3_value **apVal)
 
typedef struct Fts5Tokenizer Fts5Tokenizer
 
typedef struct fts5_tokenizer fts5_tokenizer
 
typedef struct fts5_api fts5_api
 

Functions

SQLITE_API const char * sqlite3_libversion (void)
 
SQLITE_API const char * sqlite3_sourceid (void)
 
SQLITE_API int sqlite3_libversion_number (void)
 
SQLITE_API int sqlite3_compileoption_used (const char *zOptName)
 
SQLITE_API const char * sqlite3_compileoption_get (int N)
 
SQLITE_API int sqlite3_threadsafe (void)
 
SQLITE_API int sqlite3_close (sqlite3 *)
 
SQLITE_API int sqlite3_close_v2 (sqlite3 *)
 
SQLITE_API int sqlite3_exec (sqlite3 *, const char *sql, int(*callback)(void *, int, char **, char **), void *, char **errmsg)
 
SQLITE_API int sqlite3_initialize (void)
 
SQLITE_API int sqlite3_shutdown (void)
 
SQLITE_API int sqlite3_os_init (void)
 
SQLITE_API int sqlite3_os_end (void)
 
SQLITE_API int sqlite3_config (int,...)
 
SQLITE_API int sqlite3_db_config (sqlite3 *, int op,...)
 
SQLITE_API int sqlite3_extended_result_codes (sqlite3 *, int onoff)
 
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid (sqlite3 *)
 
SQLITE_API void sqlite3_set_last_insert_rowid (sqlite3 *, sqlite3_int64)
 
SQLITE_API int sqlite3_changes (sqlite3 *)
 
SQLITE_API int sqlite3_total_changes (sqlite3 *)
 
SQLITE_API void sqlite3_interrupt (sqlite3 *)
 
SQLITE_API int sqlite3_complete (const char *sql)
 
SQLITE_API int sqlite3_complete16 (const void *sql)
 
SQLITE_API int sqlite3_busy_handler (sqlite3 *, int(*)(void *, int), void *)
 
SQLITE_API int sqlite3_busy_timeout (sqlite3 *, int ms)
 
SQLITE_API int sqlite3_get_table (sqlite3 *db, const char *zSql, char ***pazResult, int *pnRow, int *pnColumn, char **pzErrmsg)
 
SQLITE_API void sqlite3_free_table (char **result)
 
SQLITE_API char * sqlite3_mprintf (const char *,...)
 
SQLITE_API char * sqlite3_vmprintf (const char *, va_list)
 
SQLITE_API char * sqlite3_snprintf (int, char *, const char *,...)
 
SQLITE_API char * sqlite3_vsnprintf (int, char *, const char *, va_list)
 
SQLITE_API void * sqlite3_malloc (int)
 
SQLITE_API void * sqlite3_malloc64 (sqlite3_uint64)
 
SQLITE_API void * sqlite3_realloc (void *, int)
 
SQLITE_API void * sqlite3_realloc64 (void *, sqlite3_uint64)
 
SQLITE_API void sqlite3_free (void *)
 
SQLITE_API sqlite3_uint64 sqlite3_msize (void *)
 
SQLITE_API sqlite3_int64 sqlite3_memory_used (void)
 
SQLITE_API sqlite3_int64 sqlite3_memory_highwater (int resetFlag)
 
SQLITE_API void sqlite3_randomness (int N, void *P)
 
SQLITE_API int sqlite3_set_authorizer (sqlite3 *, int(*xAuth)(void *, int, const char *, const char *, const char *, const char *), void *pUserData)
 
SQLITE_API SQLITE_DEPRECATED void * sqlite3_trace (sqlite3 *, void(*xTrace)(void *, const char *), void *)
 
SQLITE_API SQLITE_DEPRECATED void * sqlite3_profile (sqlite3 *, void(*xProfile)(void *, const char *, sqlite3_uint64), void *)
 
SQLITE_API int sqlite3_trace_v2 (sqlite3 *, unsigned uMask, int(*xCallback)(unsigned, void *, void *, void *), void *pCtx)
 
SQLITE_API void sqlite3_progress_handler (sqlite3 *, int, int(*)(void *), void *)
 
SQLITE_API int sqlite3_open (const char *filename, sqlite3 **ppDb)
 
SQLITE_API int sqlite3_open16 (const void *filename, sqlite3 **ppDb)
 
SQLITE_API int sqlite3_open_v2 (const char *filename, sqlite3 **ppDb, int flags, const char *zVfs)
 
SQLITE_API const char * sqlite3_uri_parameter (const char *zFilename, const char *zParam)
 
SQLITE_API int sqlite3_uri_boolean (const char *zFile, const char *zParam, int bDefault)
 
SQLITE_API sqlite3_int64 sqlite3_uri_int64 (const char *, const char *, sqlite3_int64)
 
SQLITE_API const char * sqlite3_uri_key (const char *zFilename, int N)
 
SQLITE_API const char * sqlite3_filename_database (const char *)
 
SQLITE_API const char * sqlite3_filename_journal (const char *)
 
SQLITE_API const char * sqlite3_filename_wal (const char *)
 
SQLITE_API sqlite3_filesqlite3_database_file_object (const char *)
 
SQLITE_API char * sqlite3_create_filename (const char *zDatabase, const char *zJournal, const char *zWal, int nParam, const char **azParam)
 
SQLITE_API void sqlite3_free_filename (char *)
 
SQLITE_API int sqlite3_errcode (sqlite3 *db)
 
SQLITE_API int sqlite3_extended_errcode (sqlite3 *db)
 
SQLITE_API const char * sqlite3_errmsg (sqlite3 *)
 
SQLITE_API const void * sqlite3_errmsg16 (sqlite3 *)
 
SQLITE_API const char * sqlite3_errstr (int)
 
SQLITE_API int sqlite3_limit (sqlite3 *, int id, int newVal)
 
SQLITE_API int sqlite3_prepare (sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
 
SQLITE_API int sqlite3_prepare_v2 (sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
 
SQLITE_API int sqlite3_prepare_v3 (sqlite3 *db, const char *zSql, int nByte, unsigned int prepFlags, sqlite3_stmt **ppStmt, const char **pzTail)
 
SQLITE_API int sqlite3_prepare16 (sqlite3 *db, const void *zSql, int nByte, sqlite3_stmt **ppStmt, const void **pzTail)
 
SQLITE_API int sqlite3_prepare16_v2 (sqlite3 *db, const void *zSql, int nByte, sqlite3_stmt **ppStmt, const void **pzTail)
 
SQLITE_API int sqlite3_prepare16_v3 (sqlite3 *db, const void *zSql, int nByte, unsigned int prepFlags, sqlite3_stmt **ppStmt, const void **pzTail)
 
SQLITE_API const char * sqlite3_sql (sqlite3_stmt *pStmt)
 
SQLITE_API char * sqlite3_expanded_sql (sqlite3_stmt *pStmt)
 
SQLITE_API const char * sqlite3_normalized_sql (sqlite3_stmt *pStmt)
 
SQLITE_API int sqlite3_stmt_readonly (sqlite3_stmt *pStmt)
 
SQLITE_API int sqlite3_stmt_isexplain (sqlite3_stmt *pStmt)
 
SQLITE_API int sqlite3_stmt_busy (sqlite3_stmt *)
 
SQLITE_API int sqlite3_bind_blob (sqlite3_stmt *, int, const void *, int n, void(*)(void *))
 
SQLITE_API int sqlite3_bind_blob64 (sqlite3_stmt *, int, const void *, sqlite3_uint64, void(*)(void *))
 
SQLITE_API int sqlite3_bind_double (sqlite3_stmt *, int, double)
 
SQLITE_API int sqlite3_bind_int (sqlite3_stmt *, int, int)
 
SQLITE_API int sqlite3_bind_int64 (sqlite3_stmt *, int, sqlite3_int64)
 
SQLITE_API int sqlite3_bind_null (sqlite3_stmt *, int)
 
SQLITE_API int sqlite3_bind_text (sqlite3_stmt *, int, const char *, int, void(*)(void *))
 
SQLITE_API int sqlite3_bind_text16 (sqlite3_stmt *, int, const void *, int, void(*)(void *))
 
SQLITE_API int sqlite3_bind_text64 (sqlite3_stmt *, int, const char *, sqlite3_uint64, void(*)(void *), unsigned char encoding)
 
SQLITE_API int sqlite3_bind_value (sqlite3_stmt *, int, const sqlite3_value *)
 
SQLITE_API int sqlite3_bind_pointer (sqlite3_stmt *, int, void *, const char *, void(*)(void *))
 
SQLITE_API int sqlite3_bind_zeroblob (sqlite3_stmt *, int, int n)
 
SQLITE_API int sqlite3_bind_zeroblob64 (sqlite3_stmt *, int, sqlite3_uint64)
 
SQLITE_API int sqlite3_bind_parameter_count (sqlite3_stmt *)
 
SQLITE_API const char * sqlite3_bind_parameter_name (sqlite3_stmt *, int)
 
SQLITE_API int sqlite3_bind_parameter_index (sqlite3_stmt *, const char *zName)
 
SQLITE_API int sqlite3_clear_bindings (sqlite3_stmt *)
 
SQLITE_API int sqlite3_column_count (sqlite3_stmt *pStmt)
 
SQLITE_API const char * sqlite3_column_name (sqlite3_stmt *, int N)
 
SQLITE_API const void * sqlite3_column_name16 (sqlite3_stmt *, int N)
 
SQLITE_API const char * sqlite3_column_database_name (sqlite3_stmt *, int)
 
SQLITE_API const void * sqlite3_column_database_name16 (sqlite3_stmt *, int)
 
SQLITE_API const char * sqlite3_column_table_name (sqlite3_stmt *, int)
 
SQLITE_API const void * sqlite3_column_table_name16 (sqlite3_stmt *, int)
 
SQLITE_API const char * sqlite3_column_origin_name (sqlite3_stmt *, int)
 
SQLITE_API const void * sqlite3_column_origin_name16 (sqlite3_stmt *, int)
 
SQLITE_API const char * sqlite3_column_decltype (sqlite3_stmt *, int)
 
SQLITE_API const void * sqlite3_column_decltype16 (sqlite3_stmt *, int)
 
SQLITE_API int sqlite3_step (sqlite3_stmt *)
 
SQLITE_API int sqlite3_data_count (sqlite3_stmt *pStmt)
 
SQLITE_API const void * sqlite3_column_blob (sqlite3_stmt *, int iCol)
 
SQLITE_API double sqlite3_column_double (sqlite3_stmt *, int iCol)
 
SQLITE_API int sqlite3_column_int (sqlite3_stmt *, int iCol)
 
SQLITE_API sqlite3_int64 sqlite3_column_int64 (sqlite3_stmt *, int iCol)
 
SQLITE_API const unsigned char * sqlite3_column_text (sqlite3_stmt *, int iCol)
 
SQLITE_API const void * sqlite3_column_text16 (sqlite3_stmt *, int iCol)
 
SQLITE_API sqlite3_valuesqlite3_column_value (sqlite3_stmt *, int iCol)
 
SQLITE_API int sqlite3_column_bytes (sqlite3_stmt *, int iCol)
 
SQLITE_API int sqlite3_column_bytes16 (sqlite3_stmt *, int iCol)
 
SQLITE_API int sqlite3_column_type (sqlite3_stmt *, int iCol)
 
SQLITE_API int sqlite3_finalize (sqlite3_stmt *pStmt)
 
SQLITE_API int sqlite3_reset (sqlite3_stmt *pStmt)
 
SQLITE_API int sqlite3_create_function (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
 
SQLITE_API int sqlite3_create_function16 (sqlite3 *db, const void *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
 
SQLITE_API int sqlite3_create_function_v2 (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xDestroy)(void *))
 
SQLITE_API int sqlite3_create_window_function (sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xValue)(sqlite3_context *), void(*xInverse)(sqlite3_context *, int, sqlite3_value **), void(*xDestroy)(void *))
 
SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count (sqlite3_context *)
 
SQLITE_API SQLITE_DEPRECATED int sqlite3_expired (sqlite3_stmt *)
 
SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings (sqlite3_stmt *, sqlite3_stmt *)
 
SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover (void)
 
SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup (void)
 
SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm (void(*)(void *, sqlite3_int64, int), void *, sqlite3_int64)
 
SQLITE_API const void * sqlite3_value_blob (sqlite3_value *)
 
SQLITE_API double sqlite3_value_double (sqlite3_value *)
 
SQLITE_API int sqlite3_value_int (sqlite3_value *)
 
SQLITE_API sqlite3_int64 sqlite3_value_int64 (sqlite3_value *)
 
SQLITE_API void * sqlite3_value_pointer (sqlite3_value *, const char *)
 
SQLITE_API const unsigned char * sqlite3_value_text (sqlite3_value *)
 
SQLITE_API const void * sqlite3_value_text16 (sqlite3_value *)
 
SQLITE_API const void * sqlite3_value_text16le (sqlite3_value *)
 
SQLITE_API const void * sqlite3_value_text16be (sqlite3_value *)
 
SQLITE_API int sqlite3_value_bytes (sqlite3_value *)
 
SQLITE_API int sqlite3_value_bytes16 (sqlite3_value *)
 
SQLITE_API int sqlite3_value_type (sqlite3_value *)
 
SQLITE_API int sqlite3_value_numeric_type (sqlite3_value *)
 
SQLITE_API int sqlite3_value_nochange (sqlite3_value *)
 
SQLITE_API int sqlite3_value_frombind (sqlite3_value *)
 
SQLITE_API unsigned int sqlite3_value_subtype (sqlite3_value *)
 
SQLITE_API sqlite3_valuesqlite3_value_dup (const sqlite3_value *)
 
SQLITE_API void sqlite3_value_free (sqlite3_value *)
 
SQLITE_API void * sqlite3_aggregate_context (sqlite3_context *, int nBytes)
 
SQLITE_API void * sqlite3_user_data (sqlite3_context *)
 
SQLITE_API sqlite3sqlite3_context_db_handle (sqlite3_context *)
 
SQLITE_API void * sqlite3_get_auxdata (sqlite3_context *, int N)
 
SQLITE_API void sqlite3_set_auxdata (sqlite3_context *, int N, void *, void(*)(void *))
 
SQLITE_API void sqlite3_result_blob (sqlite3_context *, const void *, int, void(*)(void *))
 
SQLITE_API void sqlite3_result_blob64 (sqlite3_context *, const void *, sqlite3_uint64, void(*)(void *))
 
SQLITE_API void sqlite3_result_double (sqlite3_context *, double)
 
SQLITE_API void sqlite3_result_error (sqlite3_context *, const char *, int)
 
SQLITE_API void sqlite3_result_error16 (sqlite3_context *, const void *, int)
 
SQLITE_API void sqlite3_result_error_toobig (sqlite3_context *)
 
SQLITE_API void sqlite3_result_error_nomem (sqlite3_context *)
 
SQLITE_API void sqlite3_result_error_code (sqlite3_context *, int)
 
SQLITE_API void sqlite3_result_int (sqlite3_context *, int)
 
SQLITE_API void sqlite3_result_int64 (sqlite3_context *, sqlite3_int64)
 
SQLITE_API void sqlite3_result_null (sqlite3_context *)
 
SQLITE_API void sqlite3_result_text (sqlite3_context *, const char *, int, void(*)(void *))
 
SQLITE_API void sqlite3_result_text64 (sqlite3_context *, const char *, sqlite3_uint64, void(*)(void *), unsigned char encoding)
 
SQLITE_API void sqlite3_result_text16 (sqlite3_context *, const void *, int, void(*)(void *))
 
SQLITE_API void sqlite3_result_text16le (sqlite3_context *, const void *, int, void(*)(void *))
 
SQLITE_API void sqlite3_result_text16be (sqlite3_context *, const void *, int, void(*)(void *))
 
SQLITE_API void sqlite3_result_value (sqlite3_context *, sqlite3_value *)
 
SQLITE_API void sqlite3_result_pointer (sqlite3_context *, void *, const char *, void(*)(void *))
 
SQLITE_API void sqlite3_result_zeroblob (sqlite3_context *, int n)
 
SQLITE_API int sqlite3_result_zeroblob64 (sqlite3_context *, sqlite3_uint64 n)
 
SQLITE_API void sqlite3_result_subtype (sqlite3_context *, unsigned int)
 
SQLITE_API int sqlite3_create_collation (sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))
 
SQLITE_API int sqlite3_create_collation_v2 (sqlite3 *, const char *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *), void(*xDestroy)(void *))
 
SQLITE_API int sqlite3_create_collation16 (sqlite3 *, const void *zName, int eTextRep, void *pArg, int(*xCompare)(void *, int, const void *, int, const void *))
 
SQLITE_API int sqlite3_collation_needed (sqlite3 *, void *, void(*)(void *, sqlite3 *, int eTextRep, const char *))
 
SQLITE_API int sqlite3_collation_needed16 (sqlite3 *, void *, void(*)(void *, sqlite3 *, int eTextRep, const void *))
 
SQLITE_API int sqlite3_sleep (int)
 
SQLITE_API int sqlite3_win32_set_directory (unsigned long type, void *zValue)
 
SQLITE_API int sqlite3_win32_set_directory8 (unsigned long type, const char *zValue)
 
SQLITE_API int sqlite3_win32_set_directory16 (unsigned long type, const void *zValue)
 
SQLITE_API int sqlite3_get_autocommit (sqlite3 *)
 
SQLITE_API sqlite3sqlite3_db_handle (sqlite3_stmt *)
 
SQLITE_API const char * sqlite3_db_filename (sqlite3 *db, const char *zDbName)
 
SQLITE_API int sqlite3_db_readonly (sqlite3 *db, const char *zDbName)
 
SQLITE_API sqlite3_stmtsqlite3_next_stmt (sqlite3 *pDb, sqlite3_stmt *pStmt)
 
SQLITE_API void * sqlite3_commit_hook (sqlite3 *, int(*)(void *), void *)
 
SQLITE_API void * sqlite3_rollback_hook (sqlite3 *, void(*)(void *), void *)
 
SQLITE_API void * sqlite3_update_hook (sqlite3 *, void(*)(void *, int, char const *, char const *, sqlite3_int64), void *)
 
SQLITE_API int sqlite3_enable_shared_cache (int)
 
SQLITE_API int sqlite3_release_memory (int)
 
SQLITE_API int sqlite3_db_release_memory (sqlite3 *)
 
SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64 (sqlite3_int64 N)
 
SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64 (sqlite3_int64 N)
 
SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit (int N)
 
SQLITE_API int sqlite3_table_column_metadata (sqlite3 *db, const char *zDbName, const char *zTableName, const char *zColumnName, char const **pzDataType, char const **pzCollSeq, int *pNotNull, int *pPrimaryKey, int *pAutoinc)
 
SQLITE_API int sqlite3_load_extension (sqlite3 *db, const char *zFile, const char *zProc, char **pzErrMsg)
 
SQLITE_API int sqlite3_enable_load_extension (sqlite3 *db, int onoff)
 
SQLITE_API int sqlite3_auto_extension (void(*xEntryPoint)(void))
 
SQLITE_API int sqlite3_cancel_auto_extension (void(*xEntryPoint)(void))
 
SQLITE_API void sqlite3_reset_auto_extension (void)
 
SQLITE_API int sqlite3_create_module (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData)
 
SQLITE_API int sqlite3_create_module_v2 (sqlite3 *db, const char *zName, const sqlite3_module *p, void *pClientData, void(*xDestroy)(void *))
 
SQLITE_API int sqlite3_drop_modules (sqlite3 *db, const char **azKeep)
 
SQLITE_API int sqlite3_declare_vtab (sqlite3 *, const char *zSQL)
 
SQLITE_API int sqlite3_overload_function (sqlite3 *, const char *zFuncName, int nArg)
 
SQLITE_API int sqlite3_blob_open (sqlite3 *, const char *zDb, const char *zTable, const char *zColumn, sqlite3_int64 iRow, int flags, sqlite3_blob **ppBlob)
 
SQLITE_API int sqlite3_blob_reopen (sqlite3_blob *, sqlite3_int64)
 
SQLITE_API int sqlite3_blob_close (sqlite3_blob *)
 
SQLITE_API int sqlite3_blob_bytes (sqlite3_blob *)
 
SQLITE_API int sqlite3_blob_read (sqlite3_blob *, void *Z, int N, int iOffset)
 
SQLITE_API int sqlite3_blob_write (sqlite3_blob *, const void *z, int n, int iOffset)
 
SQLITE_API sqlite3_vfssqlite3_vfs_find (const char *zVfsName)
 
SQLITE_API int sqlite3_vfs_register (sqlite3_vfs *, int makeDflt)
 
SQLITE_API int sqlite3_vfs_unregister (sqlite3_vfs *)
 
SQLITE_API sqlite3_mutexsqlite3_mutex_alloc (int)
 
SQLITE_API void sqlite3_mutex_free (sqlite3_mutex *)
 
SQLITE_API void sqlite3_mutex_enter (sqlite3_mutex *)
 
SQLITE_API int sqlite3_mutex_try (sqlite3_mutex *)
 
SQLITE_API void sqlite3_mutex_leave (sqlite3_mutex *)
 
SQLITE_API int sqlite3_mutex_held (sqlite3_mutex *)
 
SQLITE_API int sqlite3_mutex_notheld (sqlite3_mutex *)
 
SQLITE_API sqlite3_mutexsqlite3_db_mutex (sqlite3 *)
 
SQLITE_API int sqlite3_file_control (sqlite3 *, const char *zDbName, int op, void *)
 
SQLITE_API int sqlite3_test_control (int op,...)
 
SQLITE_API int sqlite3_keyword_count (void)
 
SQLITE_API int sqlite3_keyword_name (int, const char **, int *)
 
SQLITE_API int sqlite3_keyword_check (const char *, int)
 
SQLITE_API sqlite3_strsqlite3_str_new (sqlite3 *)
 
SQLITE_API char * sqlite3_str_finish (sqlite3_str *)
 
SQLITE_API void sqlite3_str_appendf (sqlite3_str *, const char *zFormat,...)
 
SQLITE_API void sqlite3_str_vappendf (sqlite3_str *, const char *zFormat, va_list)
 
SQLITE_API void sqlite3_str_append (sqlite3_str *, const char *zIn, int N)
 
SQLITE_API void sqlite3_str_appendall (sqlite3_str *, const char *zIn)
 
SQLITE_API void sqlite3_str_appendchar (sqlite3_str *, int N, char C)
 
SQLITE_API void sqlite3_str_reset (sqlite3_str *)
 
SQLITE_API int sqlite3_str_errcode (sqlite3_str *)
 
SQLITE_API int sqlite3_str_length (sqlite3_str *)
 
SQLITE_API char * sqlite3_str_value (sqlite3_str *)
 
SQLITE_API int sqlite3_status (int op, int *pCurrent, int *pHighwater, int resetFlag)
 
SQLITE_API int sqlite3_status64 (int op, sqlite3_int64 *pCurrent, sqlite3_int64 *pHighwater, int resetFlag)
 
SQLITE_API int sqlite3_db_status (sqlite3 *, int op, int *pCur, int *pHiwtr, int resetFlg)
 
SQLITE_API int sqlite3_stmt_status (sqlite3_stmt *, int op, int resetFlg)
 
SQLITE_API sqlite3_backupsqlite3_backup_init (sqlite3 *pDest, const char *zDestName, sqlite3 *pSource, const char *zSourceName)
 
SQLITE_API int sqlite3_backup_step (sqlite3_backup *p, int nPage)
 
SQLITE_API int sqlite3_backup_finish (sqlite3_backup *p)
 
SQLITE_API int sqlite3_backup_remaining (sqlite3_backup *p)
 
SQLITE_API int sqlite3_backup_pagecount (sqlite3_backup *p)
 
SQLITE_API int sqlite3_unlock_notify (sqlite3 *pBlocked, void(*xNotify)(void **apArg, int nArg), void *pNotifyArg)
 
SQLITE_API int sqlite3_stricmp (const char *, const char *)
 
SQLITE_API int sqlite3_strnicmp (const char *, const char *, int)
 
SQLITE_API int sqlite3_strglob (const char *zGlob, const char *zStr)
 
SQLITE_API int sqlite3_strlike (const char *zGlob, const char *zStr, unsigned int cEsc)
 
SQLITE_API void sqlite3_log (int iErrCode, const char *zFormat,...)
 
SQLITE_API void * sqlite3_wal_hook (sqlite3 *, int(*)(void *, sqlite3 *, const char *, int), void *)
 
SQLITE_API int sqlite3_wal_autocheckpoint (sqlite3 *db, int N)
 
SQLITE_API int sqlite3_wal_checkpoint (sqlite3 *db, const char *zDb)
 
SQLITE_API int sqlite3_wal_checkpoint_v2 (sqlite3 *db, const char *zDb, int eMode, int *pnLog, int *pnCkpt)
 
SQLITE_API int sqlite3_vtab_config (sqlite3 *, int op,...)
 
SQLITE_API int sqlite3_vtab_on_conflict (sqlite3 *)
 
SQLITE_API int sqlite3_vtab_nochange (sqlite3_context *)
 
SQLITE_API SQLITE_EXPERIMENTAL const char * sqlite3_vtab_collation (sqlite3_index_info *, int)
 
SQLITE_API int sqlite3_stmt_scanstatus (sqlite3_stmt *pStmt, int idx, int iScanStatusOp, void *pOut)
 
SQLITE_API void sqlite3_stmt_scanstatus_reset (sqlite3_stmt *)
 
SQLITE_API int sqlite3_db_cacheflush (sqlite3 *)
 
SQLITE_API int sqlite3_system_errno (sqlite3 *)
 
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get (sqlite3 *db, const char *zSchema, sqlite3_snapshot **ppSnapshot)
 
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open (sqlite3 *db, const char *zSchema, sqlite3_snapshot *pSnapshot)
 
SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free (sqlite3_snapshot *)
 
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp (sqlite3_snapshot *p1, sqlite3_snapshot *p2)
 
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover (sqlite3 *db, const char *zDb)
 
SQLITE_API unsigned char * sqlite3_serialize (sqlite3 *db, const char *zSchema, sqlite3_int64 *piSize, unsigned int mFlags)
 
SQLITE_API int sqlite3_deserialize (sqlite3 *db, const char *zSchema, unsigned char *pData, sqlite3_int64 szDb, sqlite3_int64 szBuf, unsigned mFlags)
 
SQLITE_API int sqlite3_rtree_geometry_callback (sqlite3 *db, const char *zGeom, int(*xGeom)(sqlite3_rtree_geometry *, int, sqlite3_rtree_dbl *, int *), void *pContext)
 
SQLITE_API int sqlite3_rtree_query_callback (sqlite3 *db, const char *zQueryFunc, int(*xQueryFunc)(sqlite3_rtree_query_info *), void *pContext, void(*xDestructor)(void *))
 

Variables

SQLITE_API SQLITE_EXTERN const char sqlite3_version []
 
SQLITE_API SQLITE_EXTERN char * sqlite3_temp_directory
 
SQLITE_API SQLITE_EXTERN char * sqlite3_data_directory
 

Macro Definition Documentation

◆ _FTS5_H

#define _FTS5_H

Definition at line 11620 of file sqlite3.h.

◆ _SQLITE3RTREE_H_

#define _SQLITE3RTREE_H_

Definition at line 9832 of file sqlite3.h.

◆ FTS5_TOKEN_COLOCATED

#define FTS5_TOKEN_COLOCATED   0x0001 /* Same position as prev. token */

Definition at line 12124 of file sqlite3.h.

◆ FTS5_TOKENIZE_AUX

#define FTS5_TOKENIZE_AUX   0x0008

Definition at line 12120 of file sqlite3.h.

◆ FTS5_TOKENIZE_DOCUMENT

#define FTS5_TOKENIZE_DOCUMENT   0x0004

Definition at line 12119 of file sqlite3.h.

◆ FTS5_TOKENIZE_PREFIX

#define FTS5_TOKENIZE_PREFIX   0x0002

Definition at line 12118 of file sqlite3.h.

◆ FTS5_TOKENIZE_QUERY

#define FTS5_TOKENIZE_QUERY   0x0001

Definition at line 12117 of file sqlite3.h.

◆ FULLY_WITHIN

#define FULLY_WITHIN   2 /* Object fully contained within query region */

Definition at line 9926 of file sqlite3.h.

◆ NOT_WITHIN

#define NOT_WITHIN   0 /* Object completely outside of query region */

Definition at line 9924 of file sqlite3.h.

◆ PARTLY_WITHIN

#define PARTLY_WITHIN   1 /* Object partially overlaps query region */

Definition at line 9925 of file sqlite3.h.

◆ SQLITE3_TEXT

#define SQLITE3_TEXT   3

Definition at line 4752 of file sqlite3.h.

◆ SQLITE_ABORT

#define SQLITE_ABORT   4 /* Callback routine requested an abort */

Definition at line 426 of file sqlite3.h.

◆ SQLITE_ABORT_ROLLBACK

#define SQLITE_ABORT_ROLLBACK   (SQLITE_ABORT | (2<<8))

Definition at line 527 of file sqlite3.h.

◆ SQLITE_ACCESS_EXISTS

#define SQLITE_ACCESS_EXISTS   0

Definition at line 1428 of file sqlite3.h.

◆ SQLITE_ACCESS_READ

#define SQLITE_ACCESS_READ   2 /* Unused */

Definition at line 1430 of file sqlite3.h.

◆ SQLITE_ACCESS_READWRITE

#define SQLITE_ACCESS_READWRITE   1 /* Used by PRAGMA temp_store_directory */

Definition at line 1429 of file sqlite3.h.

◆ SQLITE_ALTER_TABLE

#define SQLITE_ALTER_TABLE   26 /* Database Name Table Name */

Definition at line 3097 of file sqlite3.h.

◆ SQLITE_ANALYZE

#define SQLITE_ANALYZE   28 /* Table Name NULL */

Definition at line 3099 of file sqlite3.h.

◆ SQLITE_ANY

#define SQLITE_ANY   5 /* Deprecated */

Definition at line 5208 of file sqlite3.h.

◆ SQLITE_API

#define SQLITE_API

Definition at line 52 of file sqlite3.h.

◆ SQLITE_APICALL

#define SQLITE_APICALL

Definition at line 58 of file sqlite3.h.

◆ SQLITE_ATTACH

#define SQLITE_ATTACH   24 /* Filename NULL */

Definition at line 3095 of file sqlite3.h.

◆ SQLITE_AUTH

#define SQLITE_AUTH   23 /* Authorization denied */

Definition at line 445 of file sqlite3.h.

◆ SQLITE_AUTH_USER

#define SQLITE_AUTH_USER   (SQLITE_AUTH | (1<<8))

Definition at line 542 of file sqlite3.h.

◆ SQLITE_BLOB

#define SQLITE_BLOB   4

Definition at line 4745 of file sqlite3.h.

◆ SQLITE_BUSY

#define SQLITE_BUSY   5 /* The database file is locked */

Definition at line 427 of file sqlite3.h.

◆ SQLITE_BUSY_RECOVERY

#define SQLITE_BUSY_RECOVERY   (SQLITE_BUSY | (1<<8))

Definition at line 509 of file sqlite3.h.

◆ SQLITE_BUSY_SNAPSHOT

#define SQLITE_BUSY_SNAPSHOT   (SQLITE_BUSY | (2<<8))

Definition at line 510 of file sqlite3.h.

◆ SQLITE_BUSY_TIMEOUT

#define SQLITE_BUSY_TIMEOUT   (SQLITE_BUSY | (3<<8))

Definition at line 511 of file sqlite3.h.

◆ SQLITE_CALLBACK

#define SQLITE_CALLBACK

Definition at line 64 of file sqlite3.h.

◆ SQLITE_CANTOPEN

#define SQLITE_CANTOPEN   14 /* Unable to open the database file */

Definition at line 436 of file sqlite3.h.

◆ SQLITE_CANTOPEN_CONVPATH

#define SQLITE_CANTOPEN_CONVPATH   (SQLITE_CANTOPEN | (4<<8))

Definition at line 515 of file sqlite3.h.

◆ SQLITE_CANTOPEN_DIRTYWAL

#define SQLITE_CANTOPEN_DIRTYWAL   (SQLITE_CANTOPEN | (5<<8)) /* Not Used */

Definition at line 516 of file sqlite3.h.

◆ SQLITE_CANTOPEN_FULLPATH

#define SQLITE_CANTOPEN_FULLPATH   (SQLITE_CANTOPEN | (3<<8))

Definition at line 514 of file sqlite3.h.

◆ SQLITE_CANTOPEN_ISDIR

#define SQLITE_CANTOPEN_ISDIR   (SQLITE_CANTOPEN | (2<<8))

Definition at line 513 of file sqlite3.h.

◆ SQLITE_CANTOPEN_NOTEMPDIR

#define SQLITE_CANTOPEN_NOTEMPDIR   (SQLITE_CANTOPEN | (1<<8))

Definition at line 512 of file sqlite3.h.

◆ SQLITE_CANTOPEN_SYMLINK

#define SQLITE_CANTOPEN_SYMLINK   (SQLITE_CANTOPEN | (6<<8))

Definition at line 517 of file sqlite3.h.

◆ SQLITE_CDECL

#define SQLITE_CDECL

Definition at line 55 of file sqlite3.h.

◆ SQLITE_CHECKPOINT_FULL

#define SQLITE_CHECKPOINT_FULL   1 /* Wait for writers, then checkpoint */

Definition at line 9089 of file sqlite3.h.

◆ SQLITE_CHECKPOINT_PASSIVE

#define SQLITE_CHECKPOINT_PASSIVE   0 /* Do as much as possible w/o blocking */

Definition at line 9088 of file sqlite3.h.

◆ SQLITE_CHECKPOINT_RESTART

#define SQLITE_CHECKPOINT_RESTART   2 /* Like FULL but wait for for readers */

Definition at line 9090 of file sqlite3.h.

◆ SQLITE_CHECKPOINT_TRUNCATE

#define SQLITE_CHECKPOINT_TRUNCATE   3 /* Like RESTART but also truncate WAL */

Definition at line 9091 of file sqlite3.h.

◆ SQLITE_CONFIG_COVERING_INDEX_SCAN

#define SQLITE_CONFIG_COVERING_INDEX_SCAN   20 /* int */

Definition at line 2049 of file sqlite3.h.

◆ SQLITE_CONFIG_GETMALLOC

#define SQLITE_CONFIG_GETMALLOC   5 /* sqlite3_mem_methods* */

Definition at line 2034 of file sqlite3.h.

◆ SQLITE_CONFIG_GETMUTEX

#define SQLITE_CONFIG_GETMUTEX   11 /* sqlite3_mutex_methods* */

Definition at line 2040 of file sqlite3.h.

◆ SQLITE_CONFIG_GETPCACHE

#define SQLITE_CONFIG_GETPCACHE   15 /* no-op */

Definition at line 2044 of file sqlite3.h.

◆ SQLITE_CONFIG_GETPCACHE2

#define SQLITE_CONFIG_GETPCACHE2   19 /* sqlite3_pcache_methods2* */

Definition at line 2048 of file sqlite3.h.

◆ SQLITE_CONFIG_HEAP

#define SQLITE_CONFIG_HEAP   8 /* void*, int nByte, int min */

Definition at line 2037 of file sqlite3.h.

◆ SQLITE_CONFIG_LOG

#define SQLITE_CONFIG_LOG   16 /* xFunc, void* */

Definition at line 2045 of file sqlite3.h.

◆ SQLITE_CONFIG_LOOKASIDE

#define SQLITE_CONFIG_LOOKASIDE   13 /* int int */

Definition at line 2042 of file sqlite3.h.

◆ SQLITE_CONFIG_MALLOC

#define SQLITE_CONFIG_MALLOC   4 /* sqlite3_mem_methods* */

Definition at line 2033 of file sqlite3.h.

◆ SQLITE_CONFIG_MEMDB_MAXSIZE

#define SQLITE_CONFIG_MEMDB_MAXSIZE   29 /* sqlite3_int64 */

Definition at line 2058 of file sqlite3.h.

◆ SQLITE_CONFIG_MEMSTATUS

#define SQLITE_CONFIG_MEMSTATUS   9 /* boolean */

Definition at line 2038 of file sqlite3.h.

◆ SQLITE_CONFIG_MMAP_SIZE

#define SQLITE_CONFIG_MMAP_SIZE   22 /* sqlite3_int64, sqlite3_int64 */

Definition at line 2051 of file sqlite3.h.

◆ SQLITE_CONFIG_MULTITHREAD

#define SQLITE_CONFIG_MULTITHREAD   2 /* nil */

Definition at line 2031 of file sqlite3.h.

◆ SQLITE_CONFIG_MUTEX

#define SQLITE_CONFIG_MUTEX   10 /* sqlite3_mutex_methods* */

Definition at line 2039 of file sqlite3.h.

◆ SQLITE_CONFIG_PAGECACHE

#define SQLITE_CONFIG_PAGECACHE   7 /* void*, int sz, int N */

Definition at line 2036 of file sqlite3.h.

◆ SQLITE_CONFIG_PCACHE

#define SQLITE_CONFIG_PCACHE   14 /* no-op */

Definition at line 2043 of file sqlite3.h.

◆ SQLITE_CONFIG_PCACHE2

#define SQLITE_CONFIG_PCACHE2   18 /* sqlite3_pcache_methods2* */

Definition at line 2047 of file sqlite3.h.

◆ SQLITE_CONFIG_PCACHE_HDRSZ

#define SQLITE_CONFIG_PCACHE_HDRSZ   24 /* int *psz */

Definition at line 2053 of file sqlite3.h.

◆ SQLITE_CONFIG_PMASZ

#define SQLITE_CONFIG_PMASZ   25 /* unsigned int szPma */

Definition at line 2054 of file sqlite3.h.

◆ SQLITE_CONFIG_SCRATCH

#define SQLITE_CONFIG_SCRATCH   6 /* No longer used */

Definition at line 2035 of file sqlite3.h.

◆ SQLITE_CONFIG_SERIALIZED

#define SQLITE_CONFIG_SERIALIZED   3 /* nil */

Definition at line 2032 of file sqlite3.h.

◆ SQLITE_CONFIG_SINGLETHREAD

#define SQLITE_CONFIG_SINGLETHREAD   1 /* nil */

Definition at line 2030 of file sqlite3.h.

◆ SQLITE_CONFIG_SMALL_MALLOC

#define SQLITE_CONFIG_SMALL_MALLOC   27 /* boolean */

Definition at line 2056 of file sqlite3.h.

◆ SQLITE_CONFIG_SORTERREF_SIZE

#define SQLITE_CONFIG_SORTERREF_SIZE   28 /* int nByte */

Definition at line 2057 of file sqlite3.h.

◆ SQLITE_CONFIG_SQLLOG

#define SQLITE_CONFIG_SQLLOG   21 /* xSqllog, void* */

Definition at line 2050 of file sqlite3.h.

◆ SQLITE_CONFIG_STMTJRNL_SPILL

#define SQLITE_CONFIG_STMTJRNL_SPILL   26 /* int nByte */

Definition at line 2055 of file sqlite3.h.

◆ SQLITE_CONFIG_URI

#define SQLITE_CONFIG_URI   17 /* int */

Definition at line 2046 of file sqlite3.h.

◆ SQLITE_CONFIG_WIN32_HEAPSIZE

#define SQLITE_CONFIG_WIN32_HEAPSIZE   23 /* int nByte */

Definition at line 2052 of file sqlite3.h.

◆ SQLITE_CONSTRAINT

#define SQLITE_CONSTRAINT   19 /* Abort due to constraint violation */

Definition at line 441 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_CHECK

#define SQLITE_CONSTRAINT_CHECK   (SQLITE_CONSTRAINT | (1<<8))

Definition at line 528 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_COMMITHOOK

#define SQLITE_CONSTRAINT_COMMITHOOK   (SQLITE_CONSTRAINT | (2<<8))

Definition at line 529 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_FOREIGNKEY

#define SQLITE_CONSTRAINT_FOREIGNKEY   (SQLITE_CONSTRAINT | (3<<8))

Definition at line 530 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_FUNCTION

#define SQLITE_CONSTRAINT_FUNCTION   (SQLITE_CONSTRAINT | (4<<8))

Definition at line 531 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_NOTNULL

#define SQLITE_CONSTRAINT_NOTNULL   (SQLITE_CONSTRAINT | (5<<8))

Definition at line 532 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_PINNED

#define SQLITE_CONSTRAINT_PINNED   (SQLITE_CONSTRAINT |(11<<8))

Definition at line 538 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_PRIMARYKEY

#define SQLITE_CONSTRAINT_PRIMARYKEY   (SQLITE_CONSTRAINT | (6<<8))

Definition at line 533 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_ROWID

#define SQLITE_CONSTRAINT_ROWID   (SQLITE_CONSTRAINT |(10<<8))

Definition at line 537 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_TRIGGER

#define SQLITE_CONSTRAINT_TRIGGER   (SQLITE_CONSTRAINT | (7<<8))

Definition at line 534 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_UNIQUE

#define SQLITE_CONSTRAINT_UNIQUE   (SQLITE_CONSTRAINT | (8<<8))

Definition at line 535 of file sqlite3.h.

◆ SQLITE_CONSTRAINT_VTAB

#define SQLITE_CONSTRAINT_VTAB   (SQLITE_CONSTRAINT | (9<<8))

Definition at line 536 of file sqlite3.h.

◆ SQLITE_COPY

#define SQLITE_COPY   0 /* No longer used */

Definition at line 3104 of file sqlite3.h.

◆ SQLITE_CORRUPT

#define SQLITE_CORRUPT   11 /* The database disk image is malformed */

Definition at line 433 of file sqlite3.h.

◆ SQLITE_CORRUPT_INDEX

#define SQLITE_CORRUPT_INDEX   (SQLITE_CORRUPT | (3<<8))

Definition at line 520 of file sqlite3.h.

◆ SQLITE_CORRUPT_SEQUENCE

#define SQLITE_CORRUPT_SEQUENCE   (SQLITE_CORRUPT | (2<<8))

Definition at line 519 of file sqlite3.h.

◆ SQLITE_CORRUPT_VTAB

#define SQLITE_CORRUPT_VTAB   (SQLITE_CORRUPT | (1<<8))

Definition at line 518 of file sqlite3.h.

◆ SQLITE_CREATE_INDEX

#define SQLITE_CREATE_INDEX   1 /* Index Name Table Name */

Definition at line 3072 of file sqlite3.h.

◆ SQLITE_CREATE_TABLE

#define SQLITE_CREATE_TABLE   2 /* Table Name NULL */

Definition at line 3073 of file sqlite3.h.

◆ SQLITE_CREATE_TEMP_INDEX

#define SQLITE_CREATE_TEMP_INDEX   3 /* Index Name Table Name */

Definition at line 3074 of file sqlite3.h.

◆ SQLITE_CREATE_TEMP_TABLE

#define SQLITE_CREATE_TEMP_TABLE   4 /* Table Name NULL */

Definition at line 3075 of file sqlite3.h.

◆ SQLITE_CREATE_TEMP_TRIGGER

#define SQLITE_CREATE_TEMP_TRIGGER   5 /* Trigger Name Table Name */

Definition at line 3076 of file sqlite3.h.

◆ SQLITE_CREATE_TEMP_VIEW

#define SQLITE_CREATE_TEMP_VIEW   6 /* View Name NULL */

Definition at line 3077 of file sqlite3.h.

◆ SQLITE_CREATE_TRIGGER

#define SQLITE_CREATE_TRIGGER   7 /* Trigger Name Table Name */

Definition at line 3078 of file sqlite3.h.

◆ SQLITE_CREATE_VIEW

#define SQLITE_CREATE_VIEW   8 /* View Name NULL */

Definition at line 3079 of file sqlite3.h.

◆ SQLITE_CREATE_VTABLE

#define SQLITE_CREATE_VTABLE   29 /* Table Name Module Name */

Definition at line 3100 of file sqlite3.h.

◆ SQLITE_DBCONFIG_DEFENSIVE

#define SQLITE_DBCONFIG_DEFENSIVE   1010 /* int int* */

Definition at line 2339 of file sqlite3.h.

◆ SQLITE_DBCONFIG_DQS_DDL

#define SQLITE_DBCONFIG_DQS_DDL   1014 /* int int* */

Definition at line 2343 of file sqlite3.h.

◆ SQLITE_DBCONFIG_DQS_DML

#define SQLITE_DBCONFIG_DQS_DML   1013 /* int int* */

Definition at line 2342 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_FKEY

#define SQLITE_DBCONFIG_ENABLE_FKEY   1002 /* int int* */

Definition at line 2331 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER

#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER   1004 /* int int* */

Definition at line 2333 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION

#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION   1005 /* int int* */

Definition at line 2334 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_QPSG

#define SQLITE_DBCONFIG_ENABLE_QPSG   1007 /* int int* */

Definition at line 2336 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_TRIGGER

#define SQLITE_DBCONFIG_ENABLE_TRIGGER   1003 /* int int* */

Definition at line 2332 of file sqlite3.h.

◆ SQLITE_DBCONFIG_ENABLE_VIEW

#define SQLITE_DBCONFIG_ENABLE_VIEW   1015 /* int int* */

Definition at line 2344 of file sqlite3.h.

◆ SQLITE_DBCONFIG_LEGACY_ALTER_TABLE

#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE   1012 /* int int* */

Definition at line 2341 of file sqlite3.h.

◆ SQLITE_DBCONFIG_LEGACY_FILE_FORMAT

#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT   1016 /* int int* */

Definition at line 2345 of file sqlite3.h.

◆ SQLITE_DBCONFIG_LOOKASIDE

#define SQLITE_DBCONFIG_LOOKASIDE   1001 /* void* int int */

Definition at line 2330 of file sqlite3.h.

◆ SQLITE_DBCONFIG_MAINDBNAME

#define SQLITE_DBCONFIG_MAINDBNAME   1000 /* const char* */

Definition at line 2329 of file sqlite3.h.

◆ SQLITE_DBCONFIG_MAX

#define SQLITE_DBCONFIG_MAX   1017 /* Largest DBCONFIG */

Definition at line 2347 of file sqlite3.h.

◆ SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE

#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE   1006 /* int int* */

Definition at line 2335 of file sqlite3.h.

◆ SQLITE_DBCONFIG_RESET_DATABASE

#define SQLITE_DBCONFIG_RESET_DATABASE   1009 /* int int* */

Definition at line 2338 of file sqlite3.h.

◆ SQLITE_DBCONFIG_TRIGGER_EQP

#define SQLITE_DBCONFIG_TRIGGER_EQP   1008 /* int int* */

Definition at line 2337 of file sqlite3.h.

◆ SQLITE_DBCONFIG_TRUSTED_SCHEMA

#define SQLITE_DBCONFIG_TRUSTED_SCHEMA   1017 /* int int* */

Definition at line 2346 of file sqlite3.h.

◆ SQLITE_DBCONFIG_WRITABLE_SCHEMA

#define SQLITE_DBCONFIG_WRITABLE_SCHEMA   1011 /* int int* */

Definition at line 2340 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_HIT

#define SQLITE_DBSTATUS_CACHE_HIT   7

Definition at line 8156 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_MISS

#define SQLITE_DBSTATUS_CACHE_MISS   8

Definition at line 8157 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_SPILL

#define SQLITE_DBSTATUS_CACHE_SPILL   12

Definition at line 8161 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_USED

#define SQLITE_DBSTATUS_CACHE_USED   1

Definition at line 8150 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_USED_SHARED

#define SQLITE_DBSTATUS_CACHE_USED_SHARED   11

Definition at line 8160 of file sqlite3.h.

◆ SQLITE_DBSTATUS_CACHE_WRITE

#define SQLITE_DBSTATUS_CACHE_WRITE   9

Definition at line 8158 of file sqlite3.h.

◆ SQLITE_DBSTATUS_DEFERRED_FKS

#define SQLITE_DBSTATUS_DEFERRED_FKS   10

Definition at line 8159 of file sqlite3.h.

◆ SQLITE_DBSTATUS_LOOKASIDE_HIT

#define SQLITE_DBSTATUS_LOOKASIDE_HIT   4

Definition at line 8153 of file sqlite3.h.

◆ SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL

#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   6

Definition at line 8155 of file sqlite3.h.

◆ SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE

#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   5

Definition at line 8154 of file sqlite3.h.

◆ SQLITE_DBSTATUS_LOOKASIDE_USED

#define SQLITE_DBSTATUS_LOOKASIDE_USED   0

Definition at line 8149 of file sqlite3.h.

◆ SQLITE_DBSTATUS_MAX

#define SQLITE_DBSTATUS_MAX   12 /* Largest defined DBSTATUS */

Definition at line 8162 of file sqlite3.h.

◆ SQLITE_DBSTATUS_SCHEMA_USED

#define SQLITE_DBSTATUS_SCHEMA_USED   2

Definition at line 8151 of file sqlite3.h.

◆ SQLITE_DBSTATUS_STMT_USED

#define SQLITE_DBSTATUS_STMT_USED   3

Definition at line 8152 of file sqlite3.h.

◆ SQLITE_DELETE

#define SQLITE_DELETE   9 /* Table Name NULL */

Definition at line 3080 of file sqlite3.h.

◆ SQLITE_DENY

#define SQLITE_DENY   1 /* Abort the SQL statement with an error */

Definition at line 3049 of file sqlite3.h.

◆ SQLITE_DEPRECATED

#define SQLITE_DEPRECATED

Definition at line 83 of file sqlite3.h.

◆ SQLITE_DESERIALIZE_FREEONCLOSE

#define SQLITE_DESERIALIZE_FREEONCLOSE   1 /* Call sqlite3_free() on close */

Definition at line 9800 of file sqlite3.h.

◆ SQLITE_DESERIALIZE_READONLY

#define SQLITE_DESERIALIZE_READONLY   4 /* Database is read-only */

Definition at line 9802 of file sqlite3.h.

◆ SQLITE_DESERIALIZE_RESIZEABLE

#define SQLITE_DESERIALIZE_RESIZEABLE   2 /* Resize using sqlite3_realloc64() */

Definition at line 9801 of file sqlite3.h.

◆ SQLITE_DETACH

#define SQLITE_DETACH   25 /* Database Name NULL */

Definition at line 3096 of file sqlite3.h.

◆ SQLITE_DETERMINISTIC

#define SQLITE_DETERMINISTIC   0x000000800

Definition at line 5276 of file sqlite3.h.

◆ SQLITE_DIRECTONLY

#define SQLITE_DIRECTONLY   0x000080000

Definition at line 5277 of file sqlite3.h.

◆ SQLITE_DONE

#define SQLITE_DONE   101 /* sqlite3_step() has finished executing */

Definition at line 452 of file sqlite3.h.

◆ SQLITE_DROP_INDEX

#define SQLITE_DROP_INDEX   10 /* Index Name Table Name */

Definition at line 3081 of file sqlite3.h.

◆ SQLITE_DROP_TABLE

#define SQLITE_DROP_TABLE   11 /* Table Name NULL */

Definition at line 3082 of file sqlite3.h.

◆ SQLITE_DROP_TEMP_INDEX

#define SQLITE_DROP_TEMP_INDEX   12 /* Index Name Table Name */

Definition at line 3083 of file sqlite3.h.

◆ SQLITE_DROP_TEMP_TABLE

#define SQLITE_DROP_TEMP_TABLE   13 /* Table Name NULL */

Definition at line 3084 of file sqlite3.h.

◆ SQLITE_DROP_TEMP_TRIGGER

#define SQLITE_DROP_TEMP_TRIGGER   14 /* Trigger Name Table Name */

Definition at line 3085 of file sqlite3.h.

◆ SQLITE_DROP_TEMP_VIEW

#define SQLITE_DROP_TEMP_VIEW   15 /* View Name NULL */

Definition at line 3086 of file sqlite3.h.

◆ SQLITE_DROP_TRIGGER

#define SQLITE_DROP_TRIGGER   16 /* Trigger Name Table Name */

Definition at line 3087 of file sqlite3.h.

◆ SQLITE_DROP_VIEW

#define SQLITE_DROP_VIEW   17 /* View Name NULL */

Definition at line 3088 of file sqlite3.h.

◆ SQLITE_DROP_VTABLE

#define SQLITE_DROP_VTABLE   30 /* Table Name Module Name */

Definition at line 3101 of file sqlite3.h.

◆ SQLITE_EMPTY

#define SQLITE_EMPTY   16 /* Internal use only */

Definition at line 438 of file sqlite3.h.

◆ SQLITE_ERROR

#define SQLITE_ERROR   1 /* Generic error */

Definition at line 423 of file sqlite3.h.

◆ SQLITE_ERROR_MISSING_COLLSEQ

#define SQLITE_ERROR_MISSING_COLLSEQ   (SQLITE_ERROR | (1<<8))

Definition at line 472 of file sqlite3.h.

◆ SQLITE_ERROR_RETRY

#define SQLITE_ERROR_RETRY   (SQLITE_ERROR | (2<<8))

Definition at line 473 of file sqlite3.h.

◆ SQLITE_ERROR_SNAPSHOT

#define SQLITE_ERROR_SNAPSHOT   (SQLITE_ERROR | (3<<8))

Definition at line 474 of file sqlite3.h.

◆ SQLITE_EXPERIMENTAL

#define SQLITE_EXPERIMENTAL

Definition at line 84 of file sqlite3.h.

◆ SQLITE_EXTERN

#define SQLITE_EXTERN   extern

Definition at line 49 of file sqlite3.h.

◆ SQLITE_FAIL

#define SQLITE_FAIL   3

Definition at line 9239 of file sqlite3.h.

◆ SQLITE_FCNTL_BEGIN_ATOMIC_WRITE

#define SQLITE_FCNTL_BEGIN_ATOMIC_WRITE   31

Definition at line 1160 of file sqlite3.h.

◆ SQLITE_FCNTL_BUSYHANDLER

#define SQLITE_FCNTL_BUSYHANDLER   15

Definition at line 1145 of file sqlite3.h.

◆ SQLITE_FCNTL_CHUNK_SIZE

#define SQLITE_FCNTL_CHUNK_SIZE   6

Definition at line 1136 of file sqlite3.h.

◆ SQLITE_FCNTL_CKPT_DONE

#define SQLITE_FCNTL_CKPT_DONE   37

Definition at line 1166 of file sqlite3.h.

◆ SQLITE_FCNTL_CKPT_START

#define SQLITE_FCNTL_CKPT_START   39

Definition at line 1168 of file sqlite3.h.

◆ SQLITE_FCNTL_COMMIT_ATOMIC_WRITE

#define SQLITE_FCNTL_COMMIT_ATOMIC_WRITE   32

Definition at line 1161 of file sqlite3.h.

◆ SQLITE_FCNTL_COMMIT_PHASETWO

#define SQLITE_FCNTL_COMMIT_PHASETWO   22

Definition at line 1151 of file sqlite3.h.

◆ SQLITE_FCNTL_DATA_VERSION

#define SQLITE_FCNTL_DATA_VERSION   35

Definition at line 1164 of file sqlite3.h.

◆ SQLITE_FCNTL_FILE_POINTER

#define SQLITE_FCNTL_FILE_POINTER   7

Definition at line 1137 of file sqlite3.h.

◆ SQLITE_FCNTL_GET_LOCKPROXYFILE

#define SQLITE_FCNTL_GET_LOCKPROXYFILE   2

Definition at line 1132 of file sqlite3.h.

◆ SQLITE_FCNTL_HAS_MOVED

#define SQLITE_FCNTL_HAS_MOVED   20

Definition at line 1149 of file sqlite3.h.

◆ SQLITE_FCNTL_JOURNAL_POINTER

#define SQLITE_FCNTL_JOURNAL_POINTER   28

Definition at line 1157 of file sqlite3.h.

◆ SQLITE_FCNTL_LAST_ERRNO

#define SQLITE_FCNTL_LAST_ERRNO   4

Definition at line 1134 of file sqlite3.h.

◆ SQLITE_FCNTL_LOCK_TIMEOUT

#define SQLITE_FCNTL_LOCK_TIMEOUT   34

Definition at line 1163 of file sqlite3.h.

◆ SQLITE_FCNTL_LOCKSTATE

#define SQLITE_FCNTL_LOCKSTATE   1

Definition at line 1131 of file sqlite3.h.

◆ SQLITE_FCNTL_MMAP_SIZE

#define SQLITE_FCNTL_MMAP_SIZE   18

Definition at line 1147 of file sqlite3.h.

◆ SQLITE_FCNTL_OVERWRITE

#define SQLITE_FCNTL_OVERWRITE   11

Definition at line 1141 of file sqlite3.h.

◆ SQLITE_FCNTL_PDB

#define SQLITE_FCNTL_PDB   30

Definition at line 1159 of file sqlite3.h.

◆ SQLITE_FCNTL_PERSIST_WAL

#define SQLITE_FCNTL_PERSIST_WAL   10

Definition at line 1140 of file sqlite3.h.

◆ SQLITE_FCNTL_POWERSAFE_OVERWRITE

#define SQLITE_FCNTL_POWERSAFE_OVERWRITE   13

Definition at line 1143 of file sqlite3.h.

◆ SQLITE_FCNTL_PRAGMA

#define SQLITE_FCNTL_PRAGMA   14

Definition at line 1144 of file sqlite3.h.

◆ SQLITE_FCNTL_RBU

#define SQLITE_FCNTL_RBU   26

Definition at line 1155 of file sqlite3.h.

◆ SQLITE_FCNTL_RESERVE_BYTES

#define SQLITE_FCNTL_RESERVE_BYTES   38

Definition at line 1167 of file sqlite3.h.

◆ SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE

#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE   33

Definition at line 1162 of file sqlite3.h.

◆ SQLITE_FCNTL_SET_LOCKPROXYFILE

#define SQLITE_FCNTL_SET_LOCKPROXYFILE   3

Definition at line 1133 of file sqlite3.h.

◆ SQLITE_FCNTL_SIZE_HINT

#define SQLITE_FCNTL_SIZE_HINT   5

Definition at line 1135 of file sqlite3.h.

◆ SQLITE_FCNTL_SIZE_LIMIT

#define SQLITE_FCNTL_SIZE_LIMIT   36

Definition at line 1165 of file sqlite3.h.

◆ SQLITE_FCNTL_SYNC

#define SQLITE_FCNTL_SYNC   21

Definition at line 1150 of file sqlite3.h.

◆ SQLITE_FCNTL_SYNC_OMITTED

#define SQLITE_FCNTL_SYNC_OMITTED   8

Definition at line 1138 of file sqlite3.h.

◆ SQLITE_FCNTL_TEMPFILENAME

#define SQLITE_FCNTL_TEMPFILENAME   16

Definition at line 1146 of file sqlite3.h.

◆ SQLITE_FCNTL_TRACE

#define SQLITE_FCNTL_TRACE   19

Definition at line 1148 of file sqlite3.h.

◆ SQLITE_FCNTL_VFS_POINTER

#define SQLITE_FCNTL_VFS_POINTER   27

Definition at line 1156 of file sqlite3.h.

◆ SQLITE_FCNTL_VFSNAME

#define SQLITE_FCNTL_VFSNAME   12

Definition at line 1142 of file sqlite3.h.

◆ SQLITE_FCNTL_WAL_BLOCK

#define SQLITE_FCNTL_WAL_BLOCK   24

Definition at line 1153 of file sqlite3.h.

◆ SQLITE_FCNTL_WIN32_AV_RETRY

#define SQLITE_FCNTL_WIN32_AV_RETRY   9

Definition at line 1139 of file sqlite3.h.

◆ SQLITE_FCNTL_WIN32_GET_HANDLE

#define SQLITE_FCNTL_WIN32_GET_HANDLE   29

Definition at line 1158 of file sqlite3.h.

◆ SQLITE_FCNTL_WIN32_SET_HANDLE

#define SQLITE_FCNTL_WIN32_SET_HANDLE   23

Definition at line 1152 of file sqlite3.h.

◆ SQLITE_FCNTL_ZIPVFS

#define SQLITE_FCNTL_ZIPVFS   25

Definition at line 1154 of file sqlite3.h.

◆ SQLITE_FLOAT

#define SQLITE_FLOAT   2

Definition at line 4744 of file sqlite3.h.

◆ SQLITE_FORMAT

#define SQLITE_FORMAT   24 /* Not used */

Definition at line 446 of file sqlite3.h.

◆ SQLITE_FULL

#define SQLITE_FULL   13 /* Insertion failed because database is full */

Definition at line 435 of file sqlite3.h.

◆ SQLITE_FUNCTION

#define SQLITE_FUNCTION   31 /* NULL Function Name */

Definition at line 3102 of file sqlite3.h.

◆ SQLITE_GET_LOCKPROXYFILE

#define SQLITE_GET_LOCKPROXYFILE   SQLITE_FCNTL_GET_LOCKPROXYFILE

Definition at line 1171 of file sqlite3.h.

◆ SQLITE_IGNORE

#define SQLITE_IGNORE   2 /* Don't allow access, but don't generate an error */

Definition at line 3050 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_EQ

#define SQLITE_INDEX_CONSTRAINT_EQ   2

Definition at line 6899 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_FUNCTION

#define SQLITE_INDEX_CONSTRAINT_FUNCTION   150

Definition at line 6913 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_GE

#define SQLITE_INDEX_CONSTRAINT_GE   32

Definition at line 6903 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_GLOB

#define SQLITE_INDEX_CONSTRAINT_GLOB   66

Definition at line 6906 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_GT

#define SQLITE_INDEX_CONSTRAINT_GT   4

Definition at line 6900 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_IS

#define SQLITE_INDEX_CONSTRAINT_IS   72

Definition at line 6912 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_ISNOT

#define SQLITE_INDEX_CONSTRAINT_ISNOT   69

Definition at line 6909 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_ISNOTNULL

#define SQLITE_INDEX_CONSTRAINT_ISNOTNULL   70

Definition at line 6910 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_ISNULL

#define SQLITE_INDEX_CONSTRAINT_ISNULL   71

Definition at line 6911 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_LE

#define SQLITE_INDEX_CONSTRAINT_LE   8

Definition at line 6901 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_LIKE

#define SQLITE_INDEX_CONSTRAINT_LIKE   65

Definition at line 6905 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_LT

#define SQLITE_INDEX_CONSTRAINT_LT   16

Definition at line 6902 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_MATCH

#define SQLITE_INDEX_CONSTRAINT_MATCH   64

Definition at line 6904 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_NE

#define SQLITE_INDEX_CONSTRAINT_NE   68

Definition at line 6908 of file sqlite3.h.

◆ SQLITE_INDEX_CONSTRAINT_REGEXP

#define SQLITE_INDEX_CONSTRAINT_REGEXP   67

Definition at line 6907 of file sqlite3.h.

◆ SQLITE_INDEX_SCAN_UNIQUE

#define SQLITE_INDEX_SCAN_UNIQUE   1 /* Scan visits at most 1 row */

Definition at line 6889 of file sqlite3.h.

◆ SQLITE_INNOCUOUS

#define SQLITE_INNOCUOUS   0x000200000

Definition at line 5279 of file sqlite3.h.

◆ SQLITE_INSERT

#define SQLITE_INSERT   18 /* Table Name NULL */

Definition at line 3089 of file sqlite3.h.

◆ SQLITE_INTEGER

#define SQLITE_INTEGER   1

Definition at line 4743 of file sqlite3.h.

◆ SQLITE_INTERNAL

#define SQLITE_INTERNAL   2 /* Internal logic error in SQLite */

Definition at line 424 of file sqlite3.h.

◆ SQLITE_INTERRUPT

#define SQLITE_INTERRUPT   9 /* Operation terminated by sqlite3_interrupt()*/

Definition at line 431 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC

#define SQLITE_IOCAP_ATOMIC   0x00000001

Definition at line 613 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC16K

#define SQLITE_IOCAP_ATOMIC16K   0x00000040

Definition at line 619 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC1K

#define SQLITE_IOCAP_ATOMIC1K   0x00000004

Definition at line 615 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC2K

#define SQLITE_IOCAP_ATOMIC2K   0x00000008

Definition at line 616 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC32K

#define SQLITE_IOCAP_ATOMIC32K   0x00000080

Definition at line 620 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC4K

#define SQLITE_IOCAP_ATOMIC4K   0x00000010

Definition at line 617 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC512

#define SQLITE_IOCAP_ATOMIC512   0x00000002

Definition at line 614 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC64K

#define SQLITE_IOCAP_ATOMIC64K   0x00000100

Definition at line 621 of file sqlite3.h.

◆ SQLITE_IOCAP_ATOMIC8K

#define SQLITE_IOCAP_ATOMIC8K   0x00000020

Definition at line 618 of file sqlite3.h.

◆ SQLITE_IOCAP_BATCH_ATOMIC

#define SQLITE_IOCAP_BATCH_ATOMIC   0x00004000

Definition at line 627 of file sqlite3.h.

◆ SQLITE_IOCAP_IMMUTABLE

#define SQLITE_IOCAP_IMMUTABLE   0x00002000

Definition at line 626 of file sqlite3.h.

◆ SQLITE_IOCAP_POWERSAFE_OVERWRITE

#define SQLITE_IOCAP_POWERSAFE_OVERWRITE   0x00001000

Definition at line 625 of file sqlite3.h.

◆ SQLITE_IOCAP_SAFE_APPEND

#define SQLITE_IOCAP_SAFE_APPEND   0x00000200

Definition at line 622 of file sqlite3.h.

◆ SQLITE_IOCAP_SEQUENTIAL

#define SQLITE_IOCAP_SEQUENTIAL   0x00000400

Definition at line 623 of file sqlite3.h.

◆ SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN

#define SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN   0x00000800

Definition at line 624 of file sqlite3.h.

◆ SQLITE_IOERR

#define SQLITE_IOERR   10 /* Some kind of disk I/O error occurred */

Definition at line 432 of file sqlite3.h.

◆ SQLITE_IOERR_ACCESS

#define SQLITE_IOERR_ACCESS   (SQLITE_IOERR | (13<<8))

Definition at line 487 of file sqlite3.h.

◆ SQLITE_IOERR_AUTH

#define SQLITE_IOERR_AUTH   (SQLITE_IOERR | (28<<8))

Definition at line 502 of file sqlite3.h.

◆ SQLITE_IOERR_BEGIN_ATOMIC

#define SQLITE_IOERR_BEGIN_ATOMIC   (SQLITE_IOERR | (29<<8))

Definition at line 503 of file sqlite3.h.

◆ SQLITE_IOERR_BLOCKED

#define SQLITE_IOERR_BLOCKED   (SQLITE_IOERR | (11<<8))

Definition at line 485 of file sqlite3.h.

◆ SQLITE_IOERR_CHECKRESERVEDLOCK

#define SQLITE_IOERR_CHECKRESERVEDLOCK   (SQLITE_IOERR | (14<<8))

Definition at line 488 of file sqlite3.h.

◆ SQLITE_IOERR_CLOSE

#define SQLITE_IOERR_CLOSE   (SQLITE_IOERR | (16<<8))

Definition at line 490 of file sqlite3.h.

◆ SQLITE_IOERR_COMMIT_ATOMIC

#define SQLITE_IOERR_COMMIT_ATOMIC   (SQLITE_IOERR | (30<<8))

Definition at line 504 of file sqlite3.h.

◆ SQLITE_IOERR_CONVPATH

#define SQLITE_IOERR_CONVPATH   (SQLITE_IOERR | (26<<8))

Definition at line 500 of file sqlite3.h.

◆ SQLITE_IOERR_DATA

#define SQLITE_IOERR_DATA   (SQLITE_IOERR | (32<<8))

Definition at line 506 of file sqlite3.h.

◆ SQLITE_IOERR_DELETE

#define SQLITE_IOERR_DELETE   (SQLITE_IOERR | (10<<8))

Definition at line 484 of file sqlite3.h.

◆ SQLITE_IOERR_DELETE_NOENT

#define SQLITE_IOERR_DELETE_NOENT   (SQLITE_IOERR | (23<<8))

Definition at line 497 of file sqlite3.h.

◆ SQLITE_IOERR_DIR_CLOSE

#define SQLITE_IOERR_DIR_CLOSE   (SQLITE_IOERR | (17<<8))

Definition at line 491 of file sqlite3.h.

◆ SQLITE_IOERR_DIR_FSYNC

#define SQLITE_IOERR_DIR_FSYNC   (SQLITE_IOERR | (5<<8))

Definition at line 479 of file sqlite3.h.

◆ SQLITE_IOERR_FSTAT

#define SQLITE_IOERR_FSTAT   (SQLITE_IOERR | (7<<8))

Definition at line 481 of file sqlite3.h.

◆ SQLITE_IOERR_FSYNC

#define SQLITE_IOERR_FSYNC   (SQLITE_IOERR | (4<<8))

Definition at line 478 of file sqlite3.h.

◆ SQLITE_IOERR_GETTEMPPATH

#define SQLITE_IOERR_GETTEMPPATH   (SQLITE_IOERR | (25<<8))

Definition at line 499 of file sqlite3.h.

◆ SQLITE_IOERR_LOCK

#define SQLITE_IOERR_LOCK   (SQLITE_IOERR | (15<<8))

Definition at line 489 of file sqlite3.h.

◆ SQLITE_IOERR_MMAP

#define SQLITE_IOERR_MMAP   (SQLITE_IOERR | (24<<8))

Definition at line 498 of file sqlite3.h.

◆ SQLITE_IOERR_NOMEM

#define SQLITE_IOERR_NOMEM   (SQLITE_IOERR | (12<<8))

Definition at line 486 of file sqlite3.h.

◆ SQLITE_IOERR_RDLOCK

#define SQLITE_IOERR_RDLOCK   (SQLITE_IOERR | (9<<8))

Definition at line 483 of file sqlite3.h.

◆ SQLITE_IOERR_READ

#define SQLITE_IOERR_READ   (SQLITE_IOERR | (1<<8))

Definition at line 475 of file sqlite3.h.

◆ SQLITE_IOERR_ROLLBACK_ATOMIC

#define SQLITE_IOERR_ROLLBACK_ATOMIC   (SQLITE_IOERR | (31<<8))

Definition at line 505 of file sqlite3.h.

◆ SQLITE_IOERR_SEEK

#define SQLITE_IOERR_SEEK   (SQLITE_IOERR | (22<<8))

Definition at line 496 of file sqlite3.h.

◆ SQLITE_IOERR_SHMLOCK

#define SQLITE_IOERR_SHMLOCK   (SQLITE_IOERR | (20<<8))

Definition at line 494 of file sqlite3.h.

◆ SQLITE_IOERR_SHMMAP

#define SQLITE_IOERR_SHMMAP   (SQLITE_IOERR | (21<<8))

Definition at line 495 of file sqlite3.h.

◆ SQLITE_IOERR_SHMOPEN

#define SQLITE_IOERR_SHMOPEN   (SQLITE_IOERR | (18<<8))

Definition at line 492 of file sqlite3.h.

◆ SQLITE_IOERR_SHMSIZE

#define SQLITE_IOERR_SHMSIZE   (SQLITE_IOERR | (19<<8))

Definition at line 493 of file sqlite3.h.

◆ SQLITE_IOERR_SHORT_READ

#define SQLITE_IOERR_SHORT_READ   (SQLITE_IOERR | (2<<8))

Definition at line 476 of file sqlite3.h.

◆ SQLITE_IOERR_TRUNCATE

#define SQLITE_IOERR_TRUNCATE   (SQLITE_IOERR | (6<<8))

Definition at line 480 of file sqlite3.h.

◆ SQLITE_IOERR_UNLOCK

#define SQLITE_IOERR_UNLOCK   (SQLITE_IOERR | (8<<8))

Definition at line 482 of file sqlite3.h.

◆ SQLITE_IOERR_VNODE

#define SQLITE_IOERR_VNODE   (SQLITE_IOERR | (27<<8))

Definition at line 501 of file sqlite3.h.

◆ SQLITE_IOERR_WRITE

#define SQLITE_IOERR_WRITE   (SQLITE_IOERR | (3<<8))

Definition at line 477 of file sqlite3.h.

◆ SQLITE_LAST_ERRNO

#define SQLITE_LAST_ERRNO   SQLITE_FCNTL_LAST_ERRNO

Definition at line 1173 of file sqlite3.h.

◆ SQLITE_LIMIT_ATTACHED

#define SQLITE_LIMIT_ATTACHED   7

Definition at line 3903 of file sqlite3.h.

◆ SQLITE_LIMIT_COLUMN

#define SQLITE_LIMIT_COLUMN   2

Definition at line 3898 of file sqlite3.h.

◆ SQLITE_LIMIT_COMPOUND_SELECT

#define SQLITE_LIMIT_COMPOUND_SELECT   4

Definition at line 3900 of file sqlite3.h.

◆ SQLITE_LIMIT_EXPR_DEPTH

#define SQLITE_LIMIT_EXPR_DEPTH   3

Definition at line 3899 of file sqlite3.h.

◆ SQLITE_LIMIT_FUNCTION_ARG

#define SQLITE_LIMIT_FUNCTION_ARG   6

Definition at line 3902 of file sqlite3.h.

◆ SQLITE_LIMIT_LENGTH

#define SQLITE_LIMIT_LENGTH   0

Definition at line 3896 of file sqlite3.h.

◆ SQLITE_LIMIT_LIKE_PATTERN_LENGTH

#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH   8

Definition at line 3904 of file sqlite3.h.

◆ SQLITE_LIMIT_SQL_LENGTH

#define SQLITE_LIMIT_SQL_LENGTH   1

Definition at line 3897 of file sqlite3.h.

◆ SQLITE_LIMIT_TRIGGER_DEPTH

#define SQLITE_LIMIT_TRIGGER_DEPTH   10

Definition at line 3906 of file sqlite3.h.

◆ SQLITE_LIMIT_VARIABLE_NUMBER

#define SQLITE_LIMIT_VARIABLE_NUMBER   9

Definition at line 3905 of file sqlite3.h.

◆ SQLITE_LIMIT_VDBE_OP

#define SQLITE_LIMIT_VDBE_OP   5

Definition at line 3901 of file sqlite3.h.

◆ SQLITE_LIMIT_WORKER_THREADS

#define SQLITE_LIMIT_WORKER_THREADS   11

Definition at line 3907 of file sqlite3.h.

◆ SQLITE_LOCK_EXCLUSIVE

#define SQLITE_LOCK_EXCLUSIVE   4

Definition at line 640 of file sqlite3.h.

◆ SQLITE_LOCK_NONE

#define SQLITE_LOCK_NONE   0

Definition at line 636 of file sqlite3.h.

◆ SQLITE_LOCK_PENDING

#define SQLITE_LOCK_PENDING   3

Definition at line 639 of file sqlite3.h.

◆ SQLITE_LOCK_RESERVED

#define SQLITE_LOCK_RESERVED   2

Definition at line 638 of file sqlite3.h.

◆ SQLITE_LOCK_SHARED

#define SQLITE_LOCK_SHARED   1

Definition at line 637 of file sqlite3.h.

◆ SQLITE_LOCKED

#define SQLITE_LOCKED   6 /* A table in the database is locked */

Definition at line 428 of file sqlite3.h.

◆ SQLITE_LOCKED_SHAREDCACHE

#define SQLITE_LOCKED_SHAREDCACHE   (SQLITE_LOCKED | (1<<8))

Definition at line 507 of file sqlite3.h.

◆ SQLITE_LOCKED_VTAB

#define SQLITE_LOCKED_VTAB   (SQLITE_LOCKED | (2<<8))

Definition at line 508 of file sqlite3.h.

◆ SQLITE_MISMATCH

#define SQLITE_MISMATCH   20 /* Data type mismatch */

Definition at line 442 of file sqlite3.h.

◆ SQLITE_MISUSE

#define SQLITE_MISUSE   21 /* Library used incorrectly */

Definition at line 443 of file sqlite3.h.

◆ SQLITE_MUTEX_FAST

#define SQLITE_MUTEX_FAST   0

Definition at line 7581 of file sqlite3.h.

◆ SQLITE_MUTEX_RECURSIVE

#define SQLITE_MUTEX_RECURSIVE   1

Definition at line 7582 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_APP1

#define SQLITE_MUTEX_STATIC_APP1   8 /* For use by application */

Definition at line 7591 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_APP2

#define SQLITE_MUTEX_STATIC_APP2   9 /* For use by application */

Definition at line 7592 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_APP3

#define SQLITE_MUTEX_STATIC_APP3   10 /* For use by application */

Definition at line 7593 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_LRU

#define SQLITE_MUTEX_STATIC_LRU   6 /* lru page list */

Definition at line 7588 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_LRU2

#define SQLITE_MUTEX_STATIC_LRU2   7 /* NOT USED */

Definition at line 7589 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_MAIN

#define SQLITE_MUTEX_STATIC_MAIN   2

Definition at line 7583 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_MASTER

#define SQLITE_MUTEX_STATIC_MASTER   2

Definition at line 7599 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_MEM

#define SQLITE_MUTEX_STATIC_MEM   3 /* sqlite3_malloc() */

Definition at line 7584 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_MEM2

#define SQLITE_MUTEX_STATIC_MEM2   4 /* NOT USED */

Definition at line 7585 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_OPEN

#define SQLITE_MUTEX_STATIC_OPEN   4 /* sqlite3BtreeOpen() */

Definition at line 7586 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_PMEM

#define SQLITE_MUTEX_STATIC_PMEM   7 /* sqlite3PageMalloc() */

Definition at line 7590 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_PRNG

#define SQLITE_MUTEX_STATIC_PRNG   5 /* sqlite3_randomness() */

Definition at line 7587 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_VFS1

#define SQLITE_MUTEX_STATIC_VFS1   11 /* For use by built-in VFS */

Definition at line 7594 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_VFS2

#define SQLITE_MUTEX_STATIC_VFS2   12 /* For use by extension VFS */

Definition at line 7595 of file sqlite3.h.

◆ SQLITE_MUTEX_STATIC_VFS3

#define SQLITE_MUTEX_STATIC_VFS3   13 /* For use by application VFS */

Definition at line 7596 of file sqlite3.h.

◆ SQLITE_NOLFS

#define SQLITE_NOLFS   22 /* Uses OS features not supported on host */

Definition at line 444 of file sqlite3.h.

◆ SQLITE_NOMEM

#define SQLITE_NOMEM   7 /* A malloc() failed */

Definition at line 429 of file sqlite3.h.

◆ SQLITE_NOTADB

#define SQLITE_NOTADB   26 /* File opened that is not a database file */

Definition at line 448 of file sqlite3.h.

◆ SQLITE_NOTFOUND

#define SQLITE_NOTFOUND   12 /* Unknown opcode in sqlite3_file_control() */

Definition at line 434 of file sqlite3.h.

◆ SQLITE_NOTICE

#define SQLITE_NOTICE   27 /* Notifications from sqlite3_log() */

Definition at line 449 of file sqlite3.h.

◆ SQLITE_NOTICE_RECOVER_ROLLBACK

#define SQLITE_NOTICE_RECOVER_ROLLBACK   (SQLITE_NOTICE | (2<<8))

Definition at line 540 of file sqlite3.h.

◆ SQLITE_NOTICE_RECOVER_WAL

#define SQLITE_NOTICE_RECOVER_WAL   (SQLITE_NOTICE | (1<<8))

Definition at line 539 of file sqlite3.h.

◆ SQLITE_NULL

#define SQLITE_NULL   5

Definition at line 4746 of file sqlite3.h.

◆ SQLITE_OK

#define SQLITE_OK   0 /* Successful result */

Definition at line 421 of file sqlite3.h.

◆ SQLITE_OK_LOAD_PERMANENTLY

#define SQLITE_OK_LOAD_PERMANENTLY   (SQLITE_OK | (1<<8))

Definition at line 543 of file sqlite3.h.

◆ SQLITE_OK_SYMLINK

#define SQLITE_OK_SYMLINK   (SQLITE_OK | (2<<8))

Definition at line 544 of file sqlite3.h.

◆ SQLITE_OPEN_AUTOPROXY

#define SQLITE_OPEN_AUTOPROXY   0x00000020 /* VFS only */

Definition at line 558 of file sqlite3.h.

◆ SQLITE_OPEN_CREATE

#define SQLITE_OPEN_CREATE   0x00000004 /* Ok for sqlite3_open_v2() */

Definition at line 555 of file sqlite3.h.

◆ SQLITE_OPEN_DELETEONCLOSE

#define SQLITE_OPEN_DELETEONCLOSE   0x00000008 /* VFS only */

Definition at line 556 of file sqlite3.h.

◆ SQLITE_OPEN_EXCLUSIVE

#define SQLITE_OPEN_EXCLUSIVE   0x00000010 /* VFS only */

Definition at line 557 of file sqlite3.h.

◆ SQLITE_OPEN_FULLMUTEX

#define SQLITE_OPEN_FULLMUTEX   0x00010000 /* Ok for sqlite3_open_v2() */

Definition at line 569 of file sqlite3.h.

◆ SQLITE_OPEN_MAIN_DB

#define SQLITE_OPEN_MAIN_DB   0x00000100 /* VFS only */

Definition at line 561 of file sqlite3.h.

◆ SQLITE_OPEN_MAIN_JOURNAL

#define SQLITE_OPEN_MAIN_JOURNAL   0x00000800 /* VFS only */

Definition at line 564 of file sqlite3.h.

◆ SQLITE_OPEN_MASTER_JOURNAL

#define SQLITE_OPEN_MASTER_JOURNAL   0x00004000 /* VFS only */

Definition at line 577 of file sqlite3.h.

◆ SQLITE_OPEN_MEMORY

#define SQLITE_OPEN_MEMORY   0x00000080 /* Ok for sqlite3_open_v2() */

Definition at line 560 of file sqlite3.h.

◆ SQLITE_OPEN_NOFOLLOW

#define SQLITE_OPEN_NOFOLLOW   0x01000000 /* Ok for sqlite3_open_v2() */

Definition at line 573 of file sqlite3.h.

◆ SQLITE_OPEN_NOMUTEX

#define SQLITE_OPEN_NOMUTEX   0x00008000 /* Ok for sqlite3_open_v2() */

Definition at line 568 of file sqlite3.h.

◆ SQLITE_OPEN_PRIVATECACHE

#define SQLITE_OPEN_PRIVATECACHE   0x00040000 /* Ok for sqlite3_open_v2() */

Definition at line 571 of file sqlite3.h.

◆ SQLITE_OPEN_READONLY

#define SQLITE_OPEN_READONLY   0x00000001 /* Ok for sqlite3_open_v2() */

Definition at line 553 of file sqlite3.h.

◆ SQLITE_OPEN_READWRITE

#define SQLITE_OPEN_READWRITE   0x00000002 /* Ok for sqlite3_open_v2() */

Definition at line 554 of file sqlite3.h.

◆ SQLITE_OPEN_SHAREDCACHE

#define SQLITE_OPEN_SHAREDCACHE   0x00020000 /* Ok for sqlite3_open_v2() */

Definition at line 570 of file sqlite3.h.

◆ SQLITE_OPEN_SUBJOURNAL

#define SQLITE_OPEN_SUBJOURNAL   0x00002000 /* VFS only */

Definition at line 566 of file sqlite3.h.

◆ SQLITE_OPEN_SUPER_JOURNAL

#define SQLITE_OPEN_SUPER_JOURNAL   0x00004000 /* VFS only */

Definition at line 567 of file sqlite3.h.

◆ SQLITE_OPEN_TEMP_DB

#define SQLITE_OPEN_TEMP_DB   0x00000200 /* VFS only */

Definition at line 562 of file sqlite3.h.

◆ SQLITE_OPEN_TEMP_JOURNAL

#define SQLITE_OPEN_TEMP_JOURNAL   0x00001000 /* VFS only */

Definition at line 565 of file sqlite3.h.

◆ SQLITE_OPEN_TRANSIENT_DB

#define SQLITE_OPEN_TRANSIENT_DB   0x00000400 /* VFS only */

Definition at line 563 of file sqlite3.h.

◆ SQLITE_OPEN_URI

#define SQLITE_OPEN_URI   0x00000040 /* Ok for sqlite3_open_v2() */

Definition at line 559 of file sqlite3.h.

◆ SQLITE_OPEN_WAL

#define SQLITE_OPEN_WAL   0x00080000 /* VFS only */

Definition at line 572 of file sqlite3.h.

◆ SQLITE_PERM

#define SQLITE_PERM   3 /* Access permission denied */

Definition at line 425 of file sqlite3.h.

◆ SQLITE_PRAGMA

#define SQLITE_PRAGMA   19 /* Pragma Name 1st arg or NULL */

Definition at line 3090 of file sqlite3.h.

◆ SQLITE_PREPARE_NO_VTAB

#define SQLITE_PREPARE_NO_VTAB   0x04

Definition at line 3946 of file sqlite3.h.

◆ SQLITE_PREPARE_NORMALIZE

#define SQLITE_PREPARE_NORMALIZE   0x02

Definition at line 3945 of file sqlite3.h.

◆ SQLITE_PREPARE_PERSISTENT

#define SQLITE_PREPARE_PERSISTENT   0x01

Definition at line 3944 of file sqlite3.h.

◆ SQLITE_PROTOCOL

#define SQLITE_PROTOCOL   15 /* Database lock protocol error */

Definition at line 437 of file sqlite3.h.

◆ SQLITE_RANGE

#define SQLITE_RANGE   25 /* 2nd parameter to sqlite3_bind out of range */

Definition at line 447 of file sqlite3.h.

◆ SQLITE_READ

#define SQLITE_READ   20 /* Table Name Column Name */

Definition at line 3091 of file sqlite3.h.

◆ SQLITE_READONLY

#define SQLITE_READONLY   8 /* Attempt to write a readonly database */

Definition at line 430 of file sqlite3.h.

◆ SQLITE_READONLY_CANTINIT

#define SQLITE_READONLY_CANTINIT   (SQLITE_READONLY | (5<<8))

Definition at line 525 of file sqlite3.h.

◆ SQLITE_READONLY_CANTLOCK

#define SQLITE_READONLY_CANTLOCK   (SQLITE_READONLY | (2<<8))

Definition at line 522 of file sqlite3.h.

◆ SQLITE_READONLY_DBMOVED

#define SQLITE_READONLY_DBMOVED   (SQLITE_READONLY | (4<<8))

Definition at line 524 of file sqlite3.h.

◆ SQLITE_READONLY_DIRECTORY

#define SQLITE_READONLY_DIRECTORY   (SQLITE_READONLY | (6<<8))

Definition at line 526 of file sqlite3.h.

◆ SQLITE_READONLY_RECOVERY

#define SQLITE_READONLY_RECOVERY   (SQLITE_READONLY | (1<<8))

Definition at line 521 of file sqlite3.h.

◆ SQLITE_READONLY_ROLLBACK

#define SQLITE_READONLY_ROLLBACK   (SQLITE_READONLY | (3<<8))

Definition at line 523 of file sqlite3.h.

◆ SQLITE_RECURSIVE

#define SQLITE_RECURSIVE   33 /* NULL NULL */

Definition at line 3105 of file sqlite3.h.

◆ SQLITE_REINDEX

#define SQLITE_REINDEX   27 /* Index Name NULL */

Definition at line 3098 of file sqlite3.h.

◆ SQLITE_REPLACE

#define SQLITE_REPLACE   5

Definition at line 9241 of file sqlite3.h.

◆ SQLITE_ROLLBACK

#define SQLITE_ROLLBACK   1

Definition at line 9237 of file sqlite3.h.

◆ SQLITE_ROW

#define SQLITE_ROW   100 /* sqlite3_step() has another row ready */

Definition at line 451 of file sqlite3.h.

◆ SQLITE_SAVEPOINT

#define SQLITE_SAVEPOINT   32 /* Operation Savepoint Name */

Definition at line 3103 of file sqlite3.h.

◆ SQLITE_SCANSTAT_EST

#define SQLITE_SCANSTAT_EST   2

Definition at line 9292 of file sqlite3.h.

◆ SQLITE_SCANSTAT_EXPLAIN

#define SQLITE_SCANSTAT_EXPLAIN   4

Definition at line 9294 of file sqlite3.h.

◆ SQLITE_SCANSTAT_NAME

#define SQLITE_SCANSTAT_NAME   3

Definition at line 9293 of file sqlite3.h.

◆ SQLITE_SCANSTAT_NLOOP

#define SQLITE_SCANSTAT_NLOOP   0

Definition at line 9290 of file sqlite3.h.

◆ SQLITE_SCANSTAT_NVISIT

#define SQLITE_SCANSTAT_NVISIT   1

Definition at line 9291 of file sqlite3.h.

◆ SQLITE_SCANSTAT_SELECTID

#define SQLITE_SCANSTAT_SELECTID   5

Definition at line 9295 of file sqlite3.h.

◆ SQLITE_SCHEMA

#define SQLITE_SCHEMA   17 /* The database schema changed */

Definition at line 439 of file sqlite3.h.

◆ SQLITE_SELECT

#define SQLITE_SELECT   21 /* NULL NULL */

Definition at line 3092 of file sqlite3.h.

◆ SQLITE_SERIALIZE_NOCOPY

#define SQLITE_SERIALIZE_NOCOPY   0x001 /* Do no memory allocations */

Definition at line 9739 of file sqlite3.h.

◆ SQLITE_SET_LOCKPROXYFILE

#define SQLITE_SET_LOCKPROXYFILE   SQLITE_FCNTL_SET_LOCKPROXYFILE

Definition at line 1172 of file sqlite3.h.

◆ SQLITE_SHM_EXCLUSIVE

#define SQLITE_SHM_EXCLUSIVE   8

Definition at line 1457 of file sqlite3.h.

◆ SQLITE_SHM_LOCK

#define SQLITE_SHM_LOCK   2

Definition at line 1455 of file sqlite3.h.

◆ SQLITE_SHM_NLOCK

#define SQLITE_SHM_NLOCK   8

Definition at line 1467 of file sqlite3.h.

◆ SQLITE_SHM_SHARED

#define SQLITE_SHM_SHARED   4

Definition at line 1456 of file sqlite3.h.

◆ SQLITE_SHM_UNLOCK

#define SQLITE_SHM_UNLOCK   1

Definition at line 1454 of file sqlite3.h.

◆ SQLITE_SOURCE_ID

#define SQLITE_SOURCE_ID   "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"

Definition at line 128 of file sqlite3.h.

◆ SQLITE_STATIC

#define SQLITE_STATIC   ((sqlite3_destructor_type)0)

Definition at line 5622 of file sqlite3.h.

◆ SQLITE_STATUS_MALLOC_COUNT

#define SQLITE_STATUS_MALLOC_COUNT   9

Definition at line 8011 of file sqlite3.h.

◆ SQLITE_STATUS_MALLOC_SIZE

#define SQLITE_STATUS_MALLOC_SIZE   5

Definition at line 8007 of file sqlite3.h.

◆ SQLITE_STATUS_MEMORY_USED

#define SQLITE_STATUS_MEMORY_USED   0

Definition at line 8002 of file sqlite3.h.

◆ SQLITE_STATUS_PAGECACHE_OVERFLOW

#define SQLITE_STATUS_PAGECACHE_OVERFLOW   2

Definition at line 8004 of file sqlite3.h.

◆ SQLITE_STATUS_PAGECACHE_SIZE

#define SQLITE_STATUS_PAGECACHE_SIZE   7

Definition at line 8009 of file sqlite3.h.

◆ SQLITE_STATUS_PAGECACHE_USED

#define SQLITE_STATUS_PAGECACHE_USED   1

Definition at line 8003 of file sqlite3.h.

◆ SQLITE_STATUS_PARSER_STACK

#define SQLITE_STATUS_PARSER_STACK   6

Definition at line 8008 of file sqlite3.h.

◆ SQLITE_STATUS_SCRATCH_OVERFLOW

#define SQLITE_STATUS_SCRATCH_OVERFLOW   4 /* NOT USED */

Definition at line 8006 of file sqlite3.h.

◆ SQLITE_STATUS_SCRATCH_SIZE

#define SQLITE_STATUS_SCRATCH_SIZE   8 /* NOT USED */

Definition at line 8010 of file sqlite3.h.

◆ SQLITE_STATUS_SCRATCH_USED

#define SQLITE_STATUS_SCRATCH_USED   3 /* NOT USED */

Definition at line 8005 of file sqlite3.h.

◆ SQLITE_STDCALL

#define SQLITE_STDCALL   SQLITE_APICALL

Definition at line 61 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_AUTOINDEX

#define SQLITE_STMTSTATUS_AUTOINDEX   3

Definition at line 8248 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_FULLSCAN_STEP

#define SQLITE_STMTSTATUS_FULLSCAN_STEP   1

Definition at line 8246 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_MEMUSED

#define SQLITE_STMTSTATUS_MEMUSED   99

Definition at line 8252 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_REPREPARE

#define SQLITE_STMTSTATUS_REPREPARE   5

Definition at line 8250 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_RUN

#define SQLITE_STMTSTATUS_RUN   6

Definition at line 8251 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_SORT

#define SQLITE_STMTSTATUS_SORT   2

Definition at line 8247 of file sqlite3.h.

◆ SQLITE_STMTSTATUS_VM_STEP

#define SQLITE_STMTSTATUS_VM_STEP   4

Definition at line 8249 of file sqlite3.h.

◆ SQLITE_SUBTYPE

#define SQLITE_SUBTYPE   0x000100000

Definition at line 5278 of file sqlite3.h.

◆ SQLITE_SYNC_DATAONLY

#define SQLITE_SYNC_DATAONLY   0x00010

Definition at line 670 of file sqlite3.h.

◆ SQLITE_SYNC_FULL

#define SQLITE_SYNC_FULL   0x00003

Definition at line 669 of file sqlite3.h.

◆ SQLITE_SYNC_NORMAL

#define SQLITE_SYNC_NORMAL   0x00002

Definition at line 668 of file sqlite3.h.

◆ SQLITE_SYSAPI

#define SQLITE_SYSAPI

Definition at line 67 of file sqlite3.h.

◆ SQLITE_TESTCTRL_ALWAYS

#define SQLITE_TESTCTRL_ALWAYS   13

Definition at line 7696 of file sqlite3.h.

◆ SQLITE_TESTCTRL_ASSERT

#define SQLITE_TESTCTRL_ASSERT   12

Definition at line 7695 of file sqlite3.h.

◆ SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS

#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   10

Definition at line 7693 of file sqlite3.h.

◆ SQLITE_TESTCTRL_BITVEC_TEST

#define SQLITE_TESTCTRL_BITVEC_TEST   8

Definition at line 7691 of file sqlite3.h.

◆ SQLITE_TESTCTRL_BYTEORDER

#define SQLITE_TESTCTRL_BYTEORDER   22

Definition at line 7707 of file sqlite3.h.

◆ SQLITE_TESTCTRL_EXPLAIN_STMT

#define SQLITE_TESTCTRL_EXPLAIN_STMT   19 /* NOT USED */

Definition at line 7703 of file sqlite3.h.

◆ SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS

#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS   29

Definition at line 7714 of file sqlite3.h.

◆ SQLITE_TESTCTRL_FAULT_INSTALL

#define SQLITE_TESTCTRL_FAULT_INSTALL   9

Definition at line 7692 of file sqlite3.h.

◆ SQLITE_TESTCTRL_FIRST

#define SQLITE_TESTCTRL_FIRST   5

Definition at line 7687 of file sqlite3.h.

◆ SQLITE_TESTCTRL_IMPOSTER

#define SQLITE_TESTCTRL_IMPOSTER   25

Definition at line 7710 of file sqlite3.h.

◆ SQLITE_TESTCTRL_INTERNAL_FUNCTIONS

#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS   17

Definition at line 7701 of file sqlite3.h.

◆ SQLITE_TESTCTRL_ISINIT

#define SQLITE_TESTCTRL_ISINIT   23

Definition at line 7708 of file sqlite3.h.

◆ SQLITE_TESTCTRL_ISKEYWORD

#define SQLITE_TESTCTRL_ISKEYWORD   16 /* NOT USED */

Definition at line 7699 of file sqlite3.h.

◆ SQLITE_TESTCTRL_LAST

#define SQLITE_TESTCTRL_LAST   29 /* Largest TESTCTRL */

Definition at line 7715 of file sqlite3.h.

◆ SQLITE_TESTCTRL_LOCALTIME_FAULT

#define SQLITE_TESTCTRL_LOCALTIME_FAULT   18

Definition at line 7702 of file sqlite3.h.

◆ SQLITE_TESTCTRL_NEVER_CORRUPT

#define SQLITE_TESTCTRL_NEVER_CORRUPT   20

Definition at line 7705 of file sqlite3.h.

◆ SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD

#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD   19

Definition at line 7704 of file sqlite3.h.

◆ SQLITE_TESTCTRL_OPTIMIZATIONS

#define SQLITE_TESTCTRL_OPTIMIZATIONS   15

Definition at line 7698 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PARSER_COVERAGE

#define SQLITE_TESTCTRL_PARSER_COVERAGE   26

Definition at line 7711 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PENDING_BYTE

#define SQLITE_TESTCTRL_PENDING_BYTE   11

Definition at line 7694 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PRNG_RESET

#define SQLITE_TESTCTRL_PRNG_RESET   7 /* NOT USED */

Definition at line 7690 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PRNG_RESTORE

#define SQLITE_TESTCTRL_PRNG_RESTORE   6

Definition at line 7689 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PRNG_SAVE

#define SQLITE_TESTCTRL_PRNG_SAVE   5

Definition at line 7688 of file sqlite3.h.

◆ SQLITE_TESTCTRL_PRNG_SEED

#define SQLITE_TESTCTRL_PRNG_SEED   28

Definition at line 7713 of file sqlite3.h.

◆ SQLITE_TESTCTRL_RESERVE

#define SQLITE_TESTCTRL_RESERVE   14 /* NOT USED */

Definition at line 7697 of file sqlite3.h.

◆ SQLITE_TESTCTRL_RESULT_INTREAL

#define SQLITE_TESTCTRL_RESULT_INTREAL   27

Definition at line 7712 of file sqlite3.h.

◆ SQLITE_TESTCTRL_SCRATCHMALLOC

#define SQLITE_TESTCTRL_SCRATCHMALLOC   17 /* NOT USED */

Definition at line 7700 of file sqlite3.h.

◆ SQLITE_TESTCTRL_SORTER_MMAP

#define SQLITE_TESTCTRL_SORTER_MMAP   24

Definition at line 7709 of file sqlite3.h.

◆ SQLITE_TESTCTRL_VDBE_COVERAGE

#define SQLITE_TESTCTRL_VDBE_COVERAGE   21

Definition at line 7706 of file sqlite3.h.

◆ SQLITE_TEXT

#define SQLITE_TEXT   3

Definition at line 4750 of file sqlite3.h.

◆ SQLITE_TOOBIG

#define SQLITE_TOOBIG   18 /* String or BLOB exceeds size limit */

Definition at line 440 of file sqlite3.h.

◆ SQLITE_TRACE_CLOSE

#define SQLITE_TRACE_CLOSE   0x08

Definition at line 3199 of file sqlite3.h.

◆ SQLITE_TRACE_PROFILE

#define SQLITE_TRACE_PROFILE   0x02

Definition at line 3197 of file sqlite3.h.

◆ SQLITE_TRACE_ROW

#define SQLITE_TRACE_ROW   0x04

Definition at line 3198 of file sqlite3.h.

◆ SQLITE_TRACE_STMT

#define SQLITE_TRACE_STMT   0x01

Definition at line 3196 of file sqlite3.h.

◆ SQLITE_TRANSACTION

#define SQLITE_TRANSACTION   22 /* Operation NULL */

Definition at line 3093 of file sqlite3.h.

◆ SQLITE_TRANSIENT

#define SQLITE_TRANSIENT   ((sqlite3_destructor_type)-1)

Definition at line 5623 of file sqlite3.h.

◆ SQLITE_UPDATE

#define SQLITE_UPDATE   23 /* Table Name Column Name */

Definition at line 3094 of file sqlite3.h.

◆ SQLITE_UTF16

#define SQLITE_UTF16   4 /* Use native byte order */

Definition at line 5207 of file sqlite3.h.

◆ SQLITE_UTF16_ALIGNED

#define SQLITE_UTF16_ALIGNED   8 /* sqlite3_create_collation only */

Definition at line 5209 of file sqlite3.h.

◆ SQLITE_UTF16BE

#define SQLITE_UTF16BE   3 /* IMP: R-51971-34154 */

Definition at line 5206 of file sqlite3.h.

◆ SQLITE_UTF16LE

#define SQLITE_UTF16LE   2 /* IMP: R-03371-37637 */

Definition at line 5205 of file sqlite3.h.

◆ SQLITE_UTF8

#define SQLITE_UTF8   1 /* IMP: R-37514-35566 */

Definition at line 5204 of file sqlite3.h.

◆ SQLITE_VERSION

#define SQLITE_VERSION   "3.33.0"

Definition at line 126 of file sqlite3.h.

◆ SQLITE_VERSION_NUMBER

#define SQLITE_VERSION_NUMBER   3033000

Definition at line 127 of file sqlite3.h.

◆ SQLITE_VTAB_CONSTRAINT_SUPPORT

#define SQLITE_VTAB_CONSTRAINT_SUPPORT   1

Definition at line 9175 of file sqlite3.h.

◆ SQLITE_VTAB_DIRECTONLY

#define SQLITE_VTAB_DIRECTONLY   3

Definition at line 9177 of file sqlite3.h.

◆ SQLITE_VTAB_INNOCUOUS

#define SQLITE_VTAB_INNOCUOUS   2

Definition at line 9176 of file sqlite3.h.

◆ SQLITE_WARNING

#define SQLITE_WARNING   28 /* Warnings from sqlite3_log() */

Definition at line 450 of file sqlite3.h.

◆ SQLITE_WARNING_AUTOINDEX

#define SQLITE_WARNING_AUTOINDEX   (SQLITE_WARNING | (1<<8))

Definition at line 541 of file sqlite3.h.

◆ SQLITE_WIN32_DATA_DIRECTORY_TYPE

#define SQLITE_WIN32_DATA_DIRECTORY_TYPE   1

Definition at line 6107 of file sqlite3.h.

◆ SQLITE_WIN32_TEMP_DIRECTORY_TYPE

#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE   2

Definition at line 6108 of file sqlite3.h.

Typedef Documentation

◆ fts5_api

typedef struct fts5_api fts5_api

Definition at line 12133 of file sqlite3.h.

◆ fts5_extension_function

typedef void(* fts5_extension_function) (const Fts5ExtensionApi *pApi, Fts5Context *pFts, sqlite3_context *pCtx, int nVal, sqlite3_value **apVal)

Definition at line 11638 of file sqlite3.h.

◆ fts5_tokenizer

typedef struct fts5_tokenizer fts5_tokenizer

Definition at line 12097 of file sqlite3.h.

◆ Fts5Context

typedef struct Fts5Context Fts5Context

Definition at line 11635 of file sqlite3.h.

◆ Fts5ExtensionApi

typedef struct Fts5ExtensionApi Fts5ExtensionApi

Definition at line 11634 of file sqlite3.h.

◆ Fts5PhraseIter

typedef struct Fts5PhraseIter Fts5PhraseIter

Definition at line 11636 of file sqlite3.h.

◆ Fts5Tokenizer

typedef struct Fts5Tokenizer Fts5Tokenizer

Definition at line 12096 of file sqlite3.h.

◆ sqlite3

typedef struct sqlite3 sqlite3

Definition at line 249 of file sqlite3.h.

◆ sqlite3_api_routines

typedef struct sqlite3_api_routines sqlite3_api_routines

Definition at line 1196 of file sqlite3.h.

◆ sqlite3_backup

typedef struct sqlite3_backup sqlite3_backup

Definition at line 8491 of file sqlite3.h.

◆ sqlite3_blob

typedef struct sqlite3_blob sqlite3_blob

Definition at line 7076 of file sqlite3.h.

◆ sqlite3_callback

typedef int(* sqlite3_callback) (void *, int, char **, char **)

Definition at line 338 of file sqlite3.h.

◆ sqlite3_context

typedef struct sqlite3_context sqlite3_context

Definition at line 4258 of file sqlite3.h.

◆ sqlite3_destructor_type

typedef void(* sqlite3_destructor_type) (void *)

Definition at line 5621 of file sqlite3.h.

◆ sqlite3_file

typedef struct sqlite3_file sqlite3_file

Definition at line 683 of file sqlite3.h.

◆ sqlite3_index_info

typedef struct sqlite3_index_info sqlite3_index_info

Definition at line 6690 of file sqlite3.h.

◆ sqlite3_int64

Definition at line 281 of file sqlite3.h.

◆ sqlite3_io_methods

typedef struct sqlite3_io_methods sqlite3_io_methods

Definition at line 782 of file sqlite3.h.

◆ sqlite3_mem_methods

typedef struct sqlite3_mem_methods sqlite3_mem_methods

Definition at line 1665 of file sqlite3.h.

◆ sqlite3_module

typedef struct sqlite3_module sqlite3_module

Definition at line 6692 of file sqlite3.h.

◆ sqlite3_mutex

typedef struct sqlite3_mutex sqlite3_mutex

Definition at line 1186 of file sqlite3.h.

◆ sqlite3_mutex_methods

typedef struct sqlite3_mutex_methods sqlite3_mutex_methods

Definition at line 7524 of file sqlite3.h.

◆ sqlite3_pcache

Definition at line 8265 of file sqlite3.h.

◆ sqlite3_pcache_methods

typedef struct sqlite3_pcache_methods sqlite3_pcache_methods

Definition at line 8465 of file sqlite3.h.

◆ sqlite3_pcache_methods2

typedef struct sqlite3_pcache_methods2 sqlite3_pcache_methods2

Definition at line 8442 of file sqlite3.h.

◆ sqlite3_pcache_page

typedef struct sqlite3_pcache_page sqlite3_pcache_page

Definition at line 8277 of file sqlite3.h.

◆ sqlite3_rtree_dbl

typedef double sqlite3_rtree_dbl

Definition at line 9848 of file sqlite3.h.

◆ sqlite3_rtree_geometry

typedef struct sqlite3_rtree_geometry sqlite3_rtree_geometry

Definition at line 9839 of file sqlite3.h.

◆ sqlite3_rtree_query_info

typedef struct sqlite3_rtree_query_info sqlite3_rtree_query_info

Definition at line 9840 of file sqlite3.h.

◆ sqlite3_snapshot

typedef struct sqlite3_snapshot sqlite3_snapshot

◆ sqlite3_stmt

typedef struct sqlite3_stmt sqlite3_stmt

Definition at line 3796 of file sqlite3.h.

◆ sqlite3_str

typedef struct sqlite3_str sqlite3_str

Definition at line 7784 of file sqlite3.h.

◆ sqlite3_syscall_ptr

typedef void(* sqlite3_syscall_ptr) (void)

Definition at line 1368 of file sqlite3.h.

◆ sqlite3_uint64

Definition at line 282 of file sqlite3.h.

◆ sqlite3_value

typedef struct sqlite3_value sqlite3_value

Definition at line 4244 of file sqlite3.h.

◆ sqlite3_vfs

typedef struct sqlite3_vfs sqlite3_vfs

Definition at line 1367 of file sqlite3.h.

◆ sqlite3_vtab

typedef struct sqlite3_vtab sqlite3_vtab

Definition at line 6689 of file sqlite3.h.

◆ sqlite3_vtab_cursor

typedef struct sqlite3_vtab_cursor sqlite3_vtab_cursor

Definition at line 6691 of file sqlite3.h.

◆ sqlite_int64

typedef long long int sqlite_int64

Definition at line 278 of file sqlite3.h.

◆ sqlite_uint64

typedef unsigned long long int sqlite_uint64

Definition at line 279 of file sqlite3.h.

Function Documentation

◆ sqlite3_aggregate_context()

SQLITE_API void * sqlite3_aggregate_context ( sqlite3_context * p,
int nBytes )

Definition at line 83867 of file sqlite3.c.

83873 {
83874 assert( p && p->pFunc && p->pFunc->xFinalize );
83875 assert( sqlite3_mutex_held(p->pOut->db->mutex) );
83876 testcase( nByte<0 );
#define testcase(X)
Definition sqlite3.c:13686
SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *)
void(* xFinalize)(sqlite3_context *)
Definition sqlite3.c:17100
FuncDef * pFunc
Definition sqlite3.c:21035
sqlite3 * db
Definition sqlite3.c:20921
sqlite3_mutex * mutex
Definition sqlite3.c:16823

References createAggContext(), sqlite3_value::db, sqlite3_value::flags, MEM_Agg, sqlite3::mutex, sqlite3_context::pFunc, sqlite3_context::pMem, sqlite3_context::pOut, sqlite3_mutex_held(), testcase, FuncDef::xFinalize, and sqlite3_value::z.

Referenced by countInverse(), db_sql_finalize_function(), db_sql_normal_function(), minmaxStep(), ntileStepFunc(), rankStepFunc(), row_numberValueFunc(), and sumStep().

◆ sqlite3_aggregate_count()

SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count ( sqlite3_context * p)

◆ sqlite3_auto_extension()

SQLITE_API int sqlite3_auto_extension ( void(*)(void) xEntryPoint)

Definition at line 124953 of file sqlite3.c.

124961 {
124962 int rc = SQLITE_OK;
124963#ifndef SQLITE_OMIT_AUTOINIT
124964 rc = sqlite3_initialize();
124965 if( rc ){
124966 return rc;
124967 }else
124968#endif
124969 {
124970 u32 i;
124971#if SQLITE_THREADSAFE
124973#endif
124976 for(i=0; i<wsdAutoext.nExt; i++){
124977 if( wsdAutoext.aExt[i]==xInit ) break;
124978 }
124979 if( i==wsdAutoext.nExt ){
124980 u64 nByte = (wsdAutoext.nExt+1)*sizeof(wsdAutoext.aExt[0]);
124981 void (**aNew)(void);
124982 aNew = sqlite3_realloc64(wsdAutoext.aExt, nByte);
124983 if( aNew==0 ){
124984 rc = SQLITE_NOMEM_BKPT;
124985 }else{
124986 wsdAutoext.aExt = aNew;
124987 wsdAutoext.aExt[wsdAutoext.nExt] = xInit;
124988 wsdAutoext.nExt++;
124989 }
GStaticMutex mutex
UINT32_TYPE u32
Definition sqlite3.c:14331
sqlite_uint64 u64
Definition sqlite3.c:14330
SQLITE_PRIVATE sqlite3_mutex * sqlite3MutexAlloc(int)
Definition sqlite3.c:25931
SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *)
Definition sqlite3.c:25954
SQLITE_API void * sqlite3_realloc64(void *, sqlite3_uint64)
Definition sqlite3.c:27826
#define SQLITE_NOMEM_BKPT
Definition sqlite3.c:19276
#define SQLITE_OK
Definition sqlite3.c:1469
SQLITE_API int sqlite3_initialize(void)
Definition sqlite3.c:161196
#define wsdAutoext
Definition sqlite3.c:124945
#define SQLITE_MUTEX_STATIC_MAIN
Definition sqlite3.c:8631
#define wsdAutoextInit
Definition sqlite3.c:124944

References mutex, sqlite3_initialize(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3_realloc64(), sqlite3MutexAlloc(), SQLITE_MUTEX_STATIC_MAIN, SQLITE_NOMEM_BKPT, SQLITE_OK, wsdAutoext, and wsdAutoextInit.

◆ sqlite3_backup_finish()

SQLITE_API int sqlite3_backup_finish ( sqlite3_backup * p)

Definition at line 75625 of file sqlite3.c.

75631 {
75632 sqlite3_backup **pp; /* Ptr to head of pagers backup list */
75633 sqlite3 *pSrcDb; /* Source database connection */
75634 int rc; /* Value to return */
75635
75636 /* Enter the mutexes */
75637 if( p==0 ) return SQLITE_OK;
75638 pSrcDb = p->pSrcDb;
75639 sqlite3_mutex_enter(pSrcDb->mutex);
75641 if( p->pDestDb ){
75643 }
75644
75645 /* Detach this backup from the source pager. */
75646 if( p->pDestDb ){
75647 p->pSrc->nBackup--;
75648 }
75649 if( p->isAttached ){
75651 assert( pp!=0 );
75652 while( *pp!=p ){
75653 pp = &(*pp)->pNext;
75654 assert( pp!=0 );
75655 }
75656 *pp = p->pNext;
75657 }
75658
75659 /* If a transaction is still open on the Btree, roll it back. */
75661
75662 /* Set the error code of the destination database handle. */
75663 rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc;
75664 if( p->pDestDb ){
75665 sqlite3Error(p->pDestDb, rc);
75666
75667 /* Exit the mutexes and free the backup context structure. */
75669 }
75671 if( p->pDestDb ){
75672 /* EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a
75673 ** call to sqlite3_backup_init() and is destroyed by a call to
SQLITE_PRIVATE void sqlite3BtreeLeave(Btree *)
Definition sqlite3.c:64309
SQLITE_PRIVATE void sqlite3Error(sqlite3 *, int)
Definition sqlite3.c:31291
SQLITE_PRIVATE sqlite3_backup ** sqlite3PagerBackupPtr(Pager *)
Definition sqlite3.c:59073
SQLITE_PRIVATE struct Pager * sqlite3BtreePager(Btree *)
Definition sqlite3.c:74095
SQLITE_PRIVATE int sqlite3BtreeRollback(Btree *, int, int)
Definition sqlite3.c:68682
SQLITE_PRIVATE void sqlite3BtreeEnter(Btree *)
Definition sqlite3.c:64237
#define SQLITE_DONE
Definition sqlite3.c:1500
SQLITE_PRIVATE void sqlite3LeaveMutexAndCloseZombie(sqlite3 *)
Definition sqlite3.c:162258
int nBackup
Definition sqlite3.c:63821
sqlite3 * pSrcDb
Definition sqlite3.c:75078
sqlite3_backup * pNext
Definition sqlite3.c:75090
Btree * pDest
Definition sqlite3.c:75073
sqlite3 * pDestDb
Definition sqlite3.c:75072

Referenced by cleanupbu(), and sqlite3BtreeCopyFile().

◆ sqlite3_backup_init()

SQLITE_API sqlite3_backup * sqlite3_backup_init ( sqlite3 * pDest,
const char * zDestName,
sqlite3 * pSource,
const char * zSourceName )

Definition at line 75191 of file sqlite3.c.

75202 {
75203 sqlite3_backup *p; /* Value to return */
75204
75205#ifdef SQLITE_ENABLE_API_ARMOR
75206 if( !sqlite3SafetyCheckOk(pSrcDb)||!sqlite3SafetyCheckOk(pDestDb) ){
75207 (void)SQLITE_MISUSE_BKPT;
75208 return 0;
75209 }
75210#endif
75211
75212 /* Lock the source database handle. The destination database
75213 ** handle is not locked in this routine, but it is locked in
75214 ** sqlite3_backup_step(). The user is required to ensure that no
75215 ** other thread accesses the destination handle for the duration
75216 ** of the backup operation. Any attempt to use the destination
75217 ** database connection while a backup is in progress may cause
75218 ** a malfunction or a deadlock.
75219 */
75220 sqlite3_mutex_enter(pSrcDb->mutex);
75221 sqlite3_mutex_enter(pDestDb->mutex);
75222
75223 if( pSrcDb==pDestDb ){
75225 pDestDb, SQLITE_ERROR, "source and destination must be distinct"
75226 );
75227 p = 0;
75228 }else {
75229 /* Allocate space for a new sqlite3_backup object...
75230 ** EVIDENCE-OF: R-64852-21591 The sqlite3_backup object is created by a
75231 ** call to sqlite3_backup_init() and is destroyed by a call to
75232 ** sqlite3_backup_finish(). */
75234 if( !p ){
75236 }
75237 }
75238
75239 /* If the allocation succeeded, populate the new object. */
75240 if( p ){
75241 p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb);
75242 p->pDest = findBtree(pDestDb, pDestDb, zDestDb);
75243 p->pDestDb = pDestDb;
75244 p->pSrcDb = pSrcDb;
75245 p->iNext = 1;
75246 p->isAttached = 0;
75247
75248 if( 0==p->pSrc || 0==p->pDest
75249 || checkReadTransaction(pDestDb, p->pDest)!=SQLITE_OK
75250 ){
75251 /* One (or both) of the named databases did not exist or an OOM
75252 ** error was hit. Or there is a transaction open on the destination
75253 ** database. The error has already been written into the pDestDb
75254 ** handle. All that is left to do here is free the sqlite3_backup
75255 ** structure. */
75256 sqlite3_free(p);
75257 p = 0;
75258 }
75259 }
75260 if( p ){
75261 p->pSrc->nBackup++;
SQLITE_PRIVATE void sqlite3ErrorWithMsg(sqlite3 *, int, const char *,...)
Definition sqlite3.c:31330
SQLITE_API void sqlite3_free(void *)
Definition sqlite3.c:27692
static Btree * findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb)
Definition sqlite3.c:75132
SQLITE_PRIVATE int sqlite3SafetyCheckOk(sqlite3 *)
Definition sqlite3.c:32542
SQLITE_PRIVATE void * sqlite3MallocZero(u64)
Definition sqlite3.c:27837
#define SQLITE_MISUSE_BKPT
Definition sqlite3.c:19268
static int checkReadTransaction(sqlite3 *db, Btree *p)
Definition sqlite3.c:75175
#define SQLITE_ERROR
Definition sqlite3.c:1471

References checkReadTransaction(), findBtree(), sqlite3_backup::iNext, sqlite3_backup::isAttached, sqlite3::mutex, Btree::nBackup, sqlite3_backup::pDest, sqlite3_backup::pDestDb, sqlite3_backup::pSrc, sqlite3_backup::pSrcDb, sqlite3_free(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3Error(), sqlite3ErrorWithMsg(), sqlite3MallocZero(), sqlite3SafetyCheckOk(), SQLITE_ERROR, SQLITE_MISUSE_BKPT, SQLITE_NOMEM_BKPT, and SQLITE_OK.

Referenced by lsqlite_backup_init().

◆ sqlite3_backup_pagecount()

SQLITE_API int sqlite3_backup_pagecount ( sqlite3_backup * p)

Definition at line 75693 of file sqlite3.c.

75699 {
75700#ifdef SQLITE_ENABLE_API_ARMOR
75701 if( p==0 ){

Referenced by dbbu_pagecount().

◆ sqlite3_backup_remaining()

SQLITE_API int sqlite3_backup_remaining ( sqlite3_backup * p)

Definition at line 75679 of file sqlite3.c.

75685 {
75686#ifdef SQLITE_ENABLE_API_ARMOR
75687 if( p==0 ){

Referenced by dbbu_remaining().

◆ sqlite3_backup_step()

SQLITE_API int sqlite3_backup_step ( sqlite3_backup * p,
int nPage )

Definition at line 75371 of file sqlite3.c.

75377 {
75378 int rc;
75379 int destMode; /* Destination journal mode */
75380 int pgszSrc = 0; /* Source page size */
75381 int pgszDest = 0; /* Destination page size */
75382
75383#ifdef SQLITE_ENABLE_API_ARMOR
75384 if( p==0 ) return SQLITE_MISUSE_BKPT;
75385#endif
75388 if( p->pDestDb ){
75390 }
75391
75392 rc = p->rc;
75393 if( !isFatalError(rc) ){
75394 Pager * const pSrcPager = sqlite3BtreePager(p->pSrc); /* Source pager */
75395 Pager * const pDestPager = sqlite3BtreePager(p->pDest); /* Dest pager */
75396 int ii; /* Iterator variable */
75397 int nSrcPage = -1; /* Size of source db in pages */
75398 int bCloseTrans = 0; /* True if src db requires unlocking */
75399
75400 /* If the source pager is currently in a write-transaction, return
75401 ** SQLITE_BUSY immediately.
75402 */
75403 if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){
75404 rc = SQLITE_BUSY;
75405 }else{
75406 rc = SQLITE_OK;
75407 }
75408
75409 /* If there is no open read-transaction on the source database, open
75410 ** one now. If a transaction is opened here, then it will be closed
75411 ** before this function exits.
75412 */
75413 if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){
75414 rc = sqlite3BtreeBeginTrans(p->pSrc, 0, 0);
75415 bCloseTrans = 1;
75416 }
75417
75418 /* If the destination database has not yet been locked (i.e. if this
75419 ** is the first call to backup_step() for the current backup operation),
75420 ** try to set its page size to the same as the source database. This
75421 ** is especially important on ZipVFS systems, as in that case it is
75422 ** not possible to create a database file that uses one page size by
75423 ** writing to it with another. */
75424 if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){
75425 rc = SQLITE_NOMEM;
75426 }
75427
75428 /* Lock the destination database, if it is not locked already. */
75429 if( SQLITE_OK==rc && p->bDestLocked==0
75430 && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2,
75431 (int*)&p->iDestSchema))
75432 ){
75433 p->bDestLocked = 1;
75434 }
75435
75436 /* Do not allow backup if the destination database is in WAL mode
75437 ** and the page sizes are different between source and destination */
75438 pgszSrc = sqlite3BtreeGetPageSize(p->pSrc);
75439 pgszDest = sqlite3BtreeGetPageSize(p->pDest);
75441 if( SQLITE_OK==rc && destMode==PAGER_JOURNALMODE_WAL && pgszSrc!=pgszDest ){
75442 rc = SQLITE_READONLY;
75443 }
75444
75445 /* Now that there is a read-lock on the source database, query the
75446 ** source pager for the number of pages in the database.
75447 */
75448 nSrcPage = (int)sqlite3BtreeLastPage(p->pSrc);
75449 assert( nSrcPage>=0 );
75450 for(ii=0; (nPage<0 || ii<nPage) && p->iNext<=(Pgno)nSrcPage && !rc; ii++){
75451 const Pgno iSrcPg = p->iNext; /* Source page number */
75452 if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){
75453 DbPage *pSrcPg; /* Source page object */
75454 rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg,PAGER_GET_READONLY);
75455 if( rc==SQLITE_OK ){
75456 rc = backupOnePage(p, iSrcPg, sqlite3PagerGetData(pSrcPg), 0);
75457 sqlite3PagerUnref(pSrcPg);
75458 }
75459 }
75460 p->iNext++;
75461 }
75462 if( rc==SQLITE_OK ){
75463 p->nPagecount = nSrcPage;
75464 p->nRemaining = nSrcPage+1-p->iNext;
75465 if( p->iNext>(Pgno)nSrcPage ){
75466 rc = SQLITE_DONE;
75467 }else if( !p->isAttached ){
75469 }
75470 }
75471
75472 /* Update the schema version field in the destination database. This
75473 ** is to make sure that the schema-version really does change in
75474 ** the case where the source and destination databases have the
75475 ** same schema version.
75476 */
75477 if( rc==SQLITE_DONE ){
75478 if( nSrcPage==0 ){
75479 rc = sqlite3BtreeNewDb(p->pDest);
75480 nSrcPage = 1;
75481 }
75482 if( rc==SQLITE_OK || rc==SQLITE_DONE ){
75484 }
75485 if( rc==SQLITE_OK ){
75486 if( p->pDestDb ){
75488 }
75489 if( destMode==PAGER_JOURNALMODE_WAL ){
75490 rc = sqlite3BtreeSetVersion(p->pDest, 2);
75491 }
75492 }
75493 if( rc==SQLITE_OK ){
75494 int nDestTruncate;
75495 /* Set nDestTruncate to the final number of pages in the destination
75496 ** database. The complication here is that the destination page
75497 ** size may be different to the source page size.
75498 **
75499 ** If the source page size is smaller than the destination page size,
75500 ** round up. In this case the call to sqlite3OsTruncate() below will
75501 ** fix the size of the file. However it is important to call
75502 ** sqlite3PagerTruncateImage() here so that any pages in the
75503 ** destination file that lie beyond the nDestTruncate page mark are
75504 ** journalled by PagerCommitPhaseOne() before they are destroyed
75505 ** by the file truncation.
75506 */
75507 assert( pgszSrc==sqlite3BtreeGetPageSize(p->pSrc) );
75508 assert( pgszDest==sqlite3BtreeGetPageSize(p->pDest) );
75509 if( pgszSrc<pgszDest ){
75510 int ratio = pgszDest/pgszSrc;
75511 nDestTruncate = (nSrcPage+ratio-1)/ratio;
75512 if( nDestTruncate==(int)PENDING_BYTE_PAGE(p->pDest->pBt) ){
75513 nDestTruncate--;
75514 }
75515 }else{
75516 nDestTruncate = nSrcPage * (pgszSrc/pgszDest);
75517 }
75518 assert( nDestTruncate>0 );
75519
75520 if( pgszSrc<pgszDest ){
75521 /* If the source page-size is smaller than the destination page-size,
75522 ** two extra things may need to happen:
75523 **
75524 ** * The destination may need to be truncated, and
75525 **
75526 ** * Data stored on the pages immediately following the
75527 ** pending-byte page in the source database may need to be
75528 ** copied into the destination database.
75529 */
75530 const i64 iSize = (i64)pgszSrc * (i64)nSrcPage;
75531 sqlite3_file * const pFile = sqlite3PagerFile(pDestPager);
75532 Pgno iPg;
75533 int nDstPage;
75534 i64 iOff;
75535 i64 iEnd;
75536
75537 assert( pFile );
75538 assert( nDestTruncate==0
75539 || (i64)nDestTruncate*(i64)pgszDest >= iSize || (
75540 nDestTruncate==(int)(PENDING_BYTE_PAGE(p->pDest->pBt)-1)
75541 && iSize>=PENDING_BYTE && iSize<=PENDING_BYTE+pgszDest
75542 ));
75543
75544 /* This block ensures that all data required to recreate the original
75545 ** database has been stored in the journal for pDestPager and the
75546 ** journal synced to disk. So at this point we may safely modify
75547 ** the database file in any way, knowing that if a power failure
75548 ** occurs, the original database will be reconstructed from the
75549 ** journal file. */
75550 sqlite3PagerPagecount(pDestPager, &nDstPage);
75551 for(iPg=nDestTruncate; rc==SQLITE_OK && iPg<=(Pgno)nDstPage; iPg++){
75552 if( iPg!=PENDING_BYTE_PAGE(p->pDest->pBt) ){
75553 DbPage *pPg;
75554 rc = sqlite3PagerGet(pDestPager, iPg, &pPg, 0);
75555 if( rc==SQLITE_OK ){
75556 rc = sqlite3PagerWrite(pPg);
75557 sqlite3PagerUnref(pPg);
75558 }
75559 }
75560 }
75561 if( rc==SQLITE_OK ){
75562 rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1);
75563 }
75564
75565 /* Write the extra pages and truncate the database file as required */
75566 iEnd = MIN(PENDING_BYTE + pgszDest, iSize);
75567 for(
75568 iOff=PENDING_BYTE+pgszSrc;
75569 rc==SQLITE_OK && iOff<iEnd;
75570 iOff+=pgszSrc
75571 ){
75572 PgHdr *pSrcPg = 0;
75573 const Pgno iSrcPg = (Pgno)((iOff/pgszSrc)+1);
75574 rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg, 0);
75575 if( rc==SQLITE_OK ){
75576 u8 *zData = sqlite3PagerGetData(pSrcPg);
75577 rc = sqlite3OsWrite(pFile, zData, pgszSrc, iOff);
75578 }
75579 sqlite3PagerUnref(pSrcPg);
75580 }
75581 if( rc==SQLITE_OK ){
75582 rc = backupTruncateFile(pFile, iSize);
75583 }
75584
75585 /* Sync the database file to disk. */
75586 if( rc==SQLITE_OK ){
75587 rc = sqlite3PagerSync(pDestPager, 0);
75588 }
75589 }else{
75590 sqlite3PagerTruncateImage(pDestPager, nDestTruncate);
75591 rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 0);
75592 }
75593
75594 /* Finish committing the transaction to the destination database. */
75595 if( SQLITE_OK==rc
75597 ){
75598 rc = SQLITE_DONE;
75599 }
75600 }
75601 }
75602
75603 /* If bCloseTrans is true, then this function opened a read transaction
75604 ** on the source database. Close the read transaction here. There is
75605 ** no need to check the return values of the btree methods here, as
75606 ** "committing" a read-only transaction cannot fail.
75607 */
75608 if( bCloseTrans ){
75609 TESTONLY( int rc2 );
75610 TESTONLY( rc2 = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0);
75611 TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc, 0);
75612 assert( rc2==SQLITE_OK );
75613 }
75614
75615 if( rc==SQLITE_IOERR_NOMEM ){
75616 rc = SQLITE_NOMEM_BKPT;
75617 }
75618 p->rc = rc;
75619 }
75620 if( p->pDestDb ){
SQLITE_PRIVATE int sqlite3BtreeIsInReadTrans(Btree *)
Definition sqlite3.c:74825
static int isFatalError(int rc)
Definition sqlite3.c:75268
SQLITE_PRIVATE int sqlite3BtreeNewDb(Btree *p)
Definition sqlite3.c:67806
SQLITE_PRIVATE int sqlite3BtreeCommitPhaseOne(Btree *, const char *)
Definition sqlite3.c:68473
static int backupTruncateFile(sqlite3_file *pFile, i64 iSize)
Definition sqlite3.c:75346
#define SQLITE_READONLY
Definition sqlite3.c:1478
SQLITE_PRIVATE int sqlite3OsWrite(sqlite3_file *, const void *, int amt, i64 offset)
Definition sqlite3.c:23053
#define PAGER_JOURNALMODE_WAL
Definition sqlite3.c:14833
#define SQLITE_BUSY
Definition sqlite3.c:1475
SQLITE_PRIVATE Pgno sqlite3BtreeLastPage(Btree *)
Definition sqlite3.c:66621
sqlite_int64 i64
Definition sqlite3.c:14329
SQLITE_PRIVATE int sqlite3BtreeSetVersion(Btree *pBt, int iVersion)
Definition sqlite3.c:74979
SQLITE_PRIVATE void sqlite3ResetAllSchemasOfConnection(sqlite3 *)
Definition sqlite3.c:110989
#define TRANS_WRITE
Definition sqlite3.c:63839
SQLITE_PRIVATE sqlite3_file * sqlite3PagerFile(Pager *)
Definition sqlite3.c:58694
static void attachBackupObject(sqlite3_backup *p)
Definition sqlite3.c:75359
#define SQLITE_IOERR_NOMEM
Definition sqlite3.c:1534
#define TESTONLY(X)
Definition sqlite3.c:13697
SQLITE_PRIVATE int sqlite3BtreeUpdateMeta(Btree *, int idx, u32 value)
Definition sqlite3.c:73994
UINT8_TYPE u8
Definition sqlite3.c:14334
static int backupOnePage(sqlite3_backup *p, Pgno iSrcPg, const u8 *zSrcData, int bUpdate)
Definition sqlite3.c:75277
SQLITE_PRIVATE int sqlite3BtreeCommitPhaseTwo(Btree *, int)
Definition sqlite3.c:68562
#define PENDING_BYTE
Definition sqlite3.c:16423
SQLITE_PRIVATE int sqlite3BtreeGetPageSize(Btree *)
Definition sqlite3.c:67365
SQLITE_PRIVATE void * sqlite3PagerGetData(DbPage *)
Definition sqlite3.c:58890
#define SQLITE_NOMEM
Definition sqlite3.c:1477
SQLITE_PRIVATE void sqlite3PagerUnref(DbPage *)
Definition sqlite3.c:57397
SQLITE_PRIVATE int sqlite3PagerSync(Pager *pPager, const char *zSuper)
Definition sqlite3.c:57999
#define PAGER_GET_READONLY
Definition sqlite3.c:14839
SQLITE_PRIVATE void sqlite3PagerTruncateImage(Pager *, Pgno)
Definition sqlite3.c:55627
static int setDestPgsz(sqlite3_backup *p)
Definition sqlite3.c:75163
SQLITE_PRIVATE int sqlite3PagerCommitPhaseOne(Pager *, const char *zSuper, int)
Definition sqlite3.c:58064
SQLITE_PRIVATE int sqlite3PagerWrite(DbPage *)
Definition sqlite3.c:57833
SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *, int, int *)
Definition sqlite3.c:67850
#define MIN(A, B)
Definition sqlite3.c:14263
SQLITE_PRIVATE void sqlite3PagerPagecount(Pager *, int *)
Definition sqlite3.c:55542
#define PENDING_BYTE_PAGE(pBt)
Definition sqlite3.c:64053
u32 Pgno
Definition sqlite3.c:14783
SQLITE_PRIVATE int sqlite3PagerGet(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag)
Definition sqlite3.c:57342
SQLITE_PRIVATE int sqlite3PagerGetJournalMode(Pager *)
Definition sqlite3.c:59037
u8 inTransaction
Definition sqlite3.c:63887
BtShared * pBt
Definition sqlite3.c:63815

Referenced by dbbu_step(), and sqlite3BtreeCopyFile().

◆ sqlite3_bind_blob()

SQLITE_API int sqlite3_bind_blob ( sqlite3_stmt * pStmt,
int i,
const void * zData,
int n,
void(*)(void *) xDel )

Definition at line 84390 of file sqlite3.c.

Referenced by dbvm_bind_blob().

◆ sqlite3_bind_blob64()

SQLITE_API int sqlite3_bind_blob64 ( sqlite3_stmt * pStmt,
int i,
const void * zData,
sqlite3_uint64 nData,
void(*)(void *) xDel )

Definition at line 84402 of file sqlite3.c.

84402 {
84403#ifdef SQLITE_ENABLE_API_ARMOR
84404 if( nData<0 ) return SQLITE_MISUSE_BKPT;
84405#endif
84406 return bindText(pStmt, i, zData, nData, xDel, 0);
84407}
84409 sqlite3_stmt *pStmt,
84410 int i,
84411 const void *zData,
84412 sqlite3_uint64 nData,
84413 void (*xDel)(void*)
84414){
84415 assert( xDel!=SQLITE_DYNAMIC );
#define SQLITE_API
Definition sqlite3.c:1100
sqlite_uint64 sqlite3_uint64
Definition sqlite3.c:1330
#define SQLITE_DYNAMIC
Definition sqlite3.c:14609
SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt *, int, const void *, sqlite3_uint64, void(*)(void *))
Definition sqlite3.c:84402
static int bindText(sqlite3_stmt *pStmt, int i, const void *zData, int nData, void(*xDel)(void *), u8 encoding)
Definition sqlite3.c:84354
struct sqlite3_stmt sqlite3_stmt
Definition sqlite3.c:4844

References bindText(), and SQLITE_MISUSE_BKPT.

◆ sqlite3_bind_double()

SQLITE_API int sqlite3_bind_double ( sqlite3_stmt * pStmt,
int i,
double rValue )

Definition at line 84416 of file sqlite3.c.

84416 {
84417 return invokeValueDestructor(zData, xDel, 0);
84418 }else{
84419 return bindText(pStmt, i, zData, (int)nData, xDel, 0);
84420 }
84421}
84422SQLITE_API int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
84423 int rc;
84424 Vdbe *p = (Vdbe *)pStmt;
84425 rc = vdbeUnbind(p, i);
SQLITE_API int sqlite3_bind_double(sqlite3_stmt *, int, double)
Definition sqlite3.c:84416
static int invokeValueDestructor(const void *p, void(*xDel)(void *), sqlite3_context *pCtx)
Definition sqlite3.c:83363
static int vdbeUnbind(Vdbe *p, int i)
Definition sqlite3.c:84311

References invokeValueDestructor().

Referenced by dbvm_bind_index().

◆ sqlite3_bind_int()

SQLITE_API int sqlite3_bind_int ( sqlite3_stmt * p,
int i,
int iValue )

Definition at line 84426 of file sqlite3.c.

84426 {
84427 sqlite3VdbeMemSetDouble(&p->aVar[i-1], rValue);
84428 sqlite3_mutex_leave(p->db->mutex);
SQLITE_PRIVATE void sqlite3VdbeMemSetDouble(Mem *, double)
Definition sqlite3.c:76721
SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *)
Definition sqlite3.c:25980

References Vdbe::aVar, Vdbe::db, sqlite3::mutex, sqlite3_mutex_leave(), and sqlite3VdbeMemSetDouble().

Referenced by dbvm_bind_index().

◆ sqlite3_bind_int64()

SQLITE_API int sqlite3_bind_int64 ( sqlite3_stmt * pStmt,
int i,
sqlite3_int64 iValue )

Definition at line 84429 of file sqlite3.c.

84432 {
84433 return sqlite3_bind_int64(p, i, (i64)iValue);
84434}
84435SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *pStmt, int i, sqlite_int64 iValue){
84436 int rc;
84437 Vdbe *p = (Vdbe *)pStmt;
84438 rc = vdbeUnbind(p, i);
long long int sqlite_int64
Definition sqlite3.c:1326
SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *, int, sqlite3_int64)
Definition sqlite3.c:84429

Referenced by dbvm_bind_index().

◆ sqlite3_bind_null()

SQLITE_API int sqlite3_bind_null ( sqlite3_stmt * pStmt,
int i )

Definition at line 84439 of file sqlite3.c.

84439 {
84440 sqlite3VdbeMemSetInt64(&p->aVar[i-1], iValue);
84441 sqlite3_mutex_leave(p->db->mutex);
84442 }
84443 return rc;
84444}
84445SQLITE_API int sqlite3_bind_null(sqlite3_stmt *pStmt, int i){
84446 int rc;
84447 Vdbe *p = (Vdbe*)pStmt;
SQLITE_PRIVATE void sqlite3VdbeMemSetInt64(Mem *, i64)
Definition sqlite3.c:76686
SQLITE_API int sqlite3_bind_null(sqlite3_stmt *, int)
Definition sqlite3.c:84439

References Vdbe::aVar, Vdbe::db, sqlite3::mutex, sqlite3_mutex_leave(), and sqlite3VdbeMemSetInt64().

Referenced by dbvm_bind_index().

◆ sqlite3_bind_parameter_count()

SQLITE_API int sqlite3_bind_parameter_count ( sqlite3_stmt * pStmt)

◆ sqlite3_bind_parameter_index()

SQLITE_API int sqlite3_bind_parameter_index ( sqlite3_stmt * pStmt,
const char * zName )

Definition at line 84588 of file sqlite3.c.

84590 {

References nName, Vdbe::pVList, sqlite3VListNameToNum(), and zName.

◆ sqlite3_bind_parameter_name()

SQLITE_API const char * sqlite3_bind_parameter_name ( sqlite3_stmt * pStmt,
int i )

Definition at line 84573 of file sqlite3.c.

References Vdbe::pVList, and sqlite3VListNumToName().

Referenced by dbvm_bind_names(), and dbvm_bind_parameter_name().

◆ sqlite3_bind_pointer()

SQLITE_API int sqlite3_bind_pointer ( sqlite3_stmt * pStmt,
int i,
void * pPtr,
const char * zPTtype,
void(*)(void *) xDestructor )

Definition at line 84448 of file sqlite3.c.

84449 {
84450 sqlite3_mutex_leave(p->db->mutex);
84451 }
84452 return rc;
84453}
84455 sqlite3_stmt *pStmt,
84456 int i,
84457 void *pPtr,
84458 const char *zPTtype,
84459 void (*xDestructor)(void*)
84460){
84461 int rc;
84462 Vdbe *p = (Vdbe*)pStmt;
84463 rc = vdbeUnbind(p, i);
84464 if( rc==SQLITE_OK ){
84465 sqlite3VdbeMemSetPointer(&p->aVar[i-1], pPtr, zPTtype, xDestructor);
SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *, int, void *, const char *, void(*)(void *))
Definition sqlite3.c:84448
SQLITE_PRIVATE void sqlite3VdbeMemSetPointer(Mem *, void *, const char *, void(*)(void *))
Definition sqlite3.c:76702
Mem * aVar
Definition sqlite3.c:21103

◆ sqlite3_bind_text()

SQLITE_API int sqlite3_bind_text ( sqlite3_stmt * pStmt,
int i,
const char * zData,
int nData,
void(*)(void *) xDel )

Definition at line 84466 of file sqlite3.c.

84467 {
84468 xDestructor(pPtr);
84469 }
84470 return rc;
84471}
84473 sqlite3_stmt *pStmt,
84474 int i,
SQLITE_API int sqlite3_bind_text(sqlite3_stmt *, int, const char *, int, void(*)(void *))
Definition sqlite3.c:84466

Referenced by dbvm_bind_index().

◆ sqlite3_bind_text16()

SQLITE_API int sqlite3_bind_text16 ( sqlite3_stmt * pStmt,
int i,
const void * zData,
int nData,
void(*)(void *) xDel )

Definition at line 84492 of file sqlite3.c.

84492 {
84493 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
84494 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
84495 }
84496}
84497#ifndef SQLITE_OMIT_UTF16
84499 sqlite3_stmt *pStmt,
84500 int i,
#define SQLITE_UTF16NATIVE
Definition sqlite3.c:14456
SQLITE_API int sqlite3_bind_text16(sqlite3_stmt *, int, const void *, int, void(*)(void *))
Definition sqlite3.c:84492
#define SQLITE_UTF16
Definition sqlite3.c:6255

◆ sqlite3_bind_text64()

SQLITE_API int sqlite3_bind_text64 ( sqlite3_stmt * pStmt,
int i,
const char * zData,
sqlite3_uint64 nData,
void(*)(void *) xDel,
unsigned char encoding )

Definition at line 84475 of file sqlite3.c.

84478 {
84479 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF8);
84480}
84482 sqlite3_stmt *pStmt,
84483 int i,
84484 const char *zData,
84485 sqlite3_uint64 nData,
84486 void (*xDel)(void*),
84487 unsigned char enc
84488){
84489 assert( xDel!=SQLITE_DYNAMIC );
84490 if( nData>0x7fffffff ){
#define SQLITE_UTF8
Definition sqlite3.c:6252
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt *, int, const char *, sqlite3_uint64, void(*)(void *), unsigned char encoding)
Definition sqlite3.c:84475

References bindText(), and SQLITE_UTF8.

◆ sqlite3_bind_value()

SQLITE_API int sqlite3_bind_value ( sqlite3_stmt * pStmt,
int i,
const sqlite3_value * pValue )

Definition at line 84502 of file sqlite3.c.

84504 {
84505 return bindText(pStmt, i, zData, nData, xDel, SQLITE_UTF16NATIVE);
84506}
84507#endif /* SQLITE_OMIT_UTF16 */
84508SQLITE_API int sqlite3_bind_value(sqlite3_stmt *pStmt, int i, const sqlite3_value *pValue){
84509 int rc;
84510 switch( sqlite3_value_type((sqlite3_value*)pValue) ){
84511 case SQLITE_INTEGER: {
84512 rc = sqlite3_bind_int64(pStmt, i, pValue->u.i);
84513 break;
84514 }
84515 case SQLITE_FLOAT: {
84516 rc = sqlite3_bind_double(pStmt, i, pValue->u.r);
84517 break;
84518 }
84519 case SQLITE_BLOB: {
84520 if( pValue->flags & MEM_Zero ){
84521 rc = sqlite3_bind_zeroblob(pStmt, i, pValue->u.nZero);
84522 }else{
84523 rc = sqlite3_bind_blob(pStmt, i, pValue->z, pValue->n,SQLITE_TRANSIENT);
84524 }
84525 break;
84526 }
84527 case SQLITE_TEXT: {
84528 rc = bindText(pStmt,i, pValue->z, pValue->n, SQLITE_TRANSIENT,
84529 pValue->enc);
84530 break;
84531 }
84532 default: {
#define SQLITE_FLOAT
Definition sqlite3.c:5792
#define SQLITE_BLOB
Definition sqlite3.c:5793
SQLITE_API int sqlite3_bind_blob(sqlite3_stmt *, int, const void *, int n, void(*)(void *))
Definition sqlite3.c:84390
#define SQLITE_INTEGER
Definition sqlite3.c:5791
#define MEM_Zero
Definition sqlite3.c:20971
SQLITE_API int sqlite3_bind_value(sqlite3_stmt *, int, const sqlite3_value *)
Definition sqlite3.c:84502
SQLITE_API int sqlite3_value_type(sqlite3_value *)
Definition sqlite3.c:83216
#define SQLITE_TEXT
Definition sqlite3.c:5798
#define SQLITE_TRANSIENT
Definition sqlite3.c:6671
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *, int, int n)
Definition sqlite3.c:84533
union sqlite3_value::MemValue u

References bindText(), and SQLITE_UTF16NATIVE.

◆ sqlite3_bind_zeroblob()

SQLITE_API int sqlite3_bind_zeroblob ( sqlite3_stmt * pStmt,
int i,
int n )

Definition at line 84533 of file sqlite3.c.

84539 {
84540 int rc;
84541 Vdbe *p = (Vdbe *)pStmt;
84542 rc = vdbeUnbind(p, i);

◆ sqlite3_bind_zeroblob64()

SQLITE_API int sqlite3_bind_zeroblob64 ( sqlite3_stmt * pStmt,
int i,
sqlite3_uint64 n )

Definition at line 84543 of file sqlite3.c.

84543 {
84544 sqlite3VdbeMemSetZeroBlob(&p->aVar[i-1], n);
84545 sqlite3_mutex_leave(p->db->mutex);
84546 }
84547 return rc;
84548}
84550 int rc;
84551 Vdbe *p = (Vdbe *)pStmt;
84553 if( n>(u64)p->db->aLimit[SQLITE_LIMIT_LENGTH] ){
84554 rc = SQLITE_TOOBIG;
84555 }else{
84556 assert( (n & 0x7FFFFFFF)==n );
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *, int, sqlite3_uint64)
Definition sqlite3.c:84543
#define SQLITE_TOOBIG
Definition sqlite3.c:1488
#define SQLITE_LIMIT_LENGTH
Definition sqlite3.c:4944
SQLITE_PRIVATE void sqlite3VdbeMemSetZeroBlob(Mem *, int)
Definition sqlite3.c:76661
sqlite3 * db
Definition sqlite3.c:21084
int aLimit[SQLITE_N_LIMIT]
Definition sqlite3.c:16853

References Vdbe::aVar, Vdbe::db, sqlite3::mutex, sqlite3_mutex_leave(), and sqlite3VdbeMemSetZeroBlob().

◆ sqlite3_blob_bytes()

SQLITE_API int sqlite3_blob_bytes ( sqlite3_blob * pBlob)

Definition at line 93830 of file sqlite3.c.

References Incrblob::nByte, and Incrblob::pStmt.

◆ sqlite3_blob_close()

SQLITE_API int sqlite3_blob_close ( sqlite3_blob * pBlob)

Definition at line 93719 of file sqlite3.c.

93725 {
93726 Incrblob *p = (Incrblob *)pBlob;
93727 int rc;
93728 sqlite3 *db;
93729
93730 if( p ){
93731 sqlite3_stmt *pStmt = p->pStmt;
93732 db = p->db;
93734 sqlite3DbFree(db, p);
SQLITE_PRIVATE void sqlite3DbFree(sqlite3 *, void *)
Definition sqlite3.c:27757
sqlite3_stmt * pStmt
Definition sqlite3.c:93397
sqlite3 * db
Definition sqlite3.c:93398

◆ sqlite3_blob_open()

SQLITE_API int sqlite3_blob_open ( sqlite3 * db,
const char * zDb,
const char * zTable,
const char * zColumn,
sqlite3_int64 iRow,
int flags,
sqlite3_blob ** ppBlob )

Definition at line 93486 of file sqlite3.c.

93500 {
93501 int nAttempt = 0;
93502 int iCol; /* Index of zColumn in row-record */
93503 int rc = SQLITE_OK;
93504 char *zErr = 0;
93505 Table *pTab;
93506 Incrblob *pBlob = 0;
93507 Parse sParse;
93508
93509#ifdef SQLITE_ENABLE_API_ARMOR
93510 if( ppBlob==0 ){
93511 return SQLITE_MISUSE_BKPT;
93512 }
93513#endif
93514 *ppBlob = 0;
93515#ifdef SQLITE_ENABLE_API_ARMOR
93516 if( !sqlite3SafetyCheckOk(db) || zTable==0 ){
93517 return SQLITE_MISUSE_BKPT;
93518 }
93519#endif
93520 wrFlag = !!wrFlag; /* wrFlag = (wrFlag ? 1 : 0); */
93521
93523
93524 pBlob = (Incrblob *)sqlite3DbMallocZero(db, sizeof(Incrblob));
93525 do {
93526 memset(&sParse, 0, sizeof(Parse));
93527 if( !pBlob ) goto blob_open_out;
93528 sParse.db = db;
93529 sqlite3DbFree(db, zErr);
93530 zErr = 0;
93531
93533 pTab = sqlite3LocateTable(&sParse, 0, zTable, zDb);
93534 if( pTab && IsVirtual(pTab) ){
93535 pTab = 0;
93536 sqlite3ErrorMsg(&sParse, "cannot open virtual table: %s", zTable);
93537 }
93538 if( pTab && !HasRowid(pTab) ){
93539 pTab = 0;
93540 sqlite3ErrorMsg(&sParse, "cannot open table without rowid: %s", zTable);
93541 }
93542#ifndef SQLITE_OMIT_VIEW
93543 if( pTab && pTab->pSelect ){
93544 pTab = 0;
93545 sqlite3ErrorMsg(&sParse, "cannot open view: %s", zTable);
93546 }
93547#endif
93548 if( !pTab ){
93549 if( sParse.zErrMsg ){
93550 sqlite3DbFree(db, zErr);
93551 zErr = sParse.zErrMsg;
93552 sParse.zErrMsg = 0;
93553 }
93554 rc = SQLITE_ERROR;
93556 goto blob_open_out;
93557 }
93558 pBlob->pTab = pTab;
93559 pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
93560
93561 /* Now search pTab for the exact column. */
93562 for(iCol=0; iCol<pTab->nCol; iCol++) {
93563 if( sqlite3StrICmp(pTab->aCol[iCol].zName, zColumn)==0 ){
93564 break;
93565 }
93566 }
93567 if( iCol==pTab->nCol ){
93568 sqlite3DbFree(db, zErr);
93569 zErr = sqlite3MPrintf(db, "no such column: \"%s\"", zColumn);
93570 rc = SQLITE_ERROR;
93572 goto blob_open_out;
93573 }
93574
93575 /* If the value is being opened for writing, check that the
93576 ** column is not indexed, and that it is not part of a foreign key.
93577 */
93578 if( wrFlag ){
93579 const char *zFault = 0;
93580 Index *pIdx;
93581#ifndef SQLITE_OMIT_FOREIGN_KEY
93582 if( db->flags&SQLITE_ForeignKeys ){
93583 /* Check that the column is not part of an FK child key definition. It
93584 ** is not necessary to check if it is part of a parent key, as parent
93585 ** key columns must be indexed. The check below will pick up this
93586 ** case. */
93587 FKey *pFKey;
93588 for(pFKey=pTab->pFKey; pFKey; pFKey=pFKey->pNextFrom){
93589 int j;
93590 for(j=0; j<pFKey->nCol; j++){
93591 if( pFKey->aCol[j].iFrom==iCol ){
93592 zFault = "foreign key";
93593 }
93594 }
93595 }
93596 }
93597#endif
93598 for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
93599 int j;
93600 for(j=0; j<pIdx->nKeyCol; j++){
93601 /* FIXME: Be smarter about indexes that use expressions */
93602 if( pIdx->aiColumn[j]==iCol || pIdx->aiColumn[j]==XN_EXPR ){
93603 zFault = "indexed";
93604 }
93605 }
93606 }
93607 if( zFault ){
93608 sqlite3DbFree(db, zErr);
93609 zErr = sqlite3MPrintf(db, "cannot open %s column for writing", zFault);
93610 rc = SQLITE_ERROR;
93612 goto blob_open_out;
93613 }
93614 }
93615
93616 pBlob->pStmt = (sqlite3_stmt *)sqlite3VdbeCreate(&sParse);
93617 assert( pBlob->pStmt || db->mallocFailed );
93618 if( pBlob->pStmt ){
93619
93620 /* This VDBE program seeks a btree cursor to the identified
93621 ** db/table/row entry. The reason for using a vdbe program instead
93622 ** of writing code to use the b-tree layer directly is that the
93623 ** vdbe program will take advantage of the various transaction,
93624 ** locking and error handling infrastructure built into the vdbe.
93625 **
93626 ** After seeking the cursor, the vdbe executes an OP_ResultRow.
93627 ** Code external to the Vdbe then "borrows" the b-tree cursor and
93628 ** uses it to implement the blob_read(), blob_write() and
93629 ** blob_bytes() functions.
93630 **
93631 ** The sqlite3_blob_close() function finalizes the vdbe program,
93632 ** which closes the b-tree cursor and (possibly) commits the
93633 ** transaction.
93634 */
93635 static const int iLn = VDBE_OFFSET_LINENO(2);
93636 static const VdbeOpList openBlob[] = {
93637 {OP_TableLock, 0, 0, 0}, /* 0: Acquire a read or write lock */
93638 {OP_OpenRead, 0, 0, 0}, /* 1: Open a cursor */
93639 /* blobSeekToRow() will initialize r[1] to the desired rowid */
93640 {OP_NotExists, 0, 5, 1}, /* 2: Seek the cursor to rowid=r[1] */
93641 {OP_Column, 0, 0, 1}, /* 3 */
93642 {OP_ResultRow, 1, 0, 0}, /* 4 */
93643 {OP_Halt, 0, 0, 0}, /* 5 */
93644 };
93645 Vdbe *v = (Vdbe *)pBlob->pStmt;
93646 int iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
93647 VdbeOp *aOp;
93648
93649 sqlite3VdbeAddOp4Int(v, OP_Transaction, iDb, wrFlag,
93650 pTab->pSchema->schema_cookie,
93651 pTab->pSchema->iGeneration);
93652 sqlite3VdbeChangeP5(v, 1);
93653 assert( sqlite3VdbeCurrentAddr(v)==2 || db->mallocFailed );
93654 aOp = sqlite3VdbeAddOpList(v, ArraySize(openBlob), openBlob, iLn);
93655
93656 /* Make sure a mutex is held on the table to be accessed */
93657 sqlite3VdbeUsesBtree(v, iDb);
93658
93659 if( db->mallocFailed==0 ){
93660 assert( aOp!=0 );
93661 /* Configure the OP_TableLock instruction */
93662#ifdef SQLITE_OMIT_SHARED_CACHE
93663 aOp[0].opcode = OP_Noop;
93664#else
93665 aOp[0].p1 = iDb;
93666 aOp[0].p2 = pTab->tnum;
93667 aOp[0].p3 = wrFlag;
93669 }
93670 if( db->mallocFailed==0 ){
93671#endif
93672
93673 /* Remove either the OP_OpenWrite or OpenRead. Set the P2
93674 ** parameter of the other to pTab->tnum. */
93675 if( wrFlag ) aOp[1].opcode = OP_OpenWrite;
93676 aOp[1].p2 = pTab->tnum;
93677 aOp[1].p3 = iDb;
93678
93679 /* Configure the number of columns. Configure the cursor to
93680 ** think that the table has one more column than it really
93681 ** does. An OP_Column to retrieve this imaginary column will
93682 ** always return an SQL NULL. This is useful because it means
93683 ** we can invoke OP_Column to fill in the vdbe cursors type
93684 ** and offset cache without causing any IO.
93685 */
93686 aOp[1].p4type = P4_INT32;
93687 aOp[1].p4.i = pTab->nCol+1;
93688 aOp[3].p2 = pTab->nCol;
93689
93690 sParse.nVar = 0;
93691 sParse.nMem = 1;
93692 sParse.nTab = 1;
93693 sqlite3VdbeMakeReady(v, &sParse);
93694 }
93695 }
93696
93697 pBlob->iCol = iCol;
93698 pBlob->db = db;
93700 if( db->mallocFailed ){
93701 goto blob_open_out;
93702 }
93703 rc = blobSeekToRow(pBlob, iRow, &zErr);
93704 } while( (++nAttempt)<SQLITE_MAX_SCHEMA_RETRY && rc==SQLITE_SCHEMA );
93705
93706blob_open_out:
93707 if( rc==SQLITE_OK && db->mallocFailed==0 ){
93708 *ppBlob = (sqlite3_blob *)pBlob;
93709 }else{
93710 if( pBlob && pBlob->pStmt ) sqlite3VdbeFinalize((Vdbe *)pBlob->pStmt);
93711 sqlite3DbFree(db, pBlob);
93712 }
93713 sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr);
SQLITE_PRIVATE void sqlite3VdbeMakeReady(Vdbe *, Parse *)
Definition sqlite3.c:80075
#define OP_OpenRead
Definition sqlite3.c:15662
#define SQLITE_SCHEMA
Definition sqlite3.c:1487
SQLITE_PRIVATE char * sqlite3MPrintf(sqlite3 *, const char *,...)
Definition sqlite3.c:29286
SQLITE_PRIVATE void sqlite3BtreeLeaveAll(sqlite3 *)
Definition sqlite3.c:64378
#define SQLITE_ForeignKeys
Definition sqlite3.c:16993
#define OP_Noop
Definition sqlite3.c:15739
#define OP_Column
Definition sqlite3.c:15655
#define IsVirtual(X)
Definition sqlite3.c:17556
struct sqlite3_blob sqlite3_blob
Definition sqlite3.c:8124
#define ArraySize(X)
Definition sqlite3.c:14594
SQLITE_PRIVATE void * sqlite3DbMallocZero(sqlite3 *, u64)
Definition sqlite3.c:27849
#define OP_ResultRow
Definition sqlite3.c:15646
#define OP_Transaction
Definition sqlite3.c:15568
#define OP_NotExists
Definition sqlite3.c:15598
#define SQLITE_MAX_SCHEMA_RETRY
Definition sqlite3.c:20730
SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *)
Definition sqlite3.c:78623
#define P4_TRANSIENT
Definition sqlite3.c:15505
#define XN_EXPR
Definition sqlite3.c:17832
#define OP_TableLock
Definition sqlite3.c:15727
SQLITE_PRIVATE Vdbe * sqlite3VdbeCreate(Parse *)
Definition sqlite3.c:77757
SQLITE_PRIVATE void sqlite3BtreeEnterAll(sqlite3 *)
Definition sqlite3.c:64366
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe *, int)
Definition sqlite3.c:79490
#define P4_INT32
Definition sqlite3.c:15508
#define OP_OpenWrite
Definition sqlite3.c:15663
SQLITE_PRIVATE Table * sqlite3LocateTable(Parse *, u32 flags, const char *, const char *)
Definition sqlite3.c:110777
SQLITE_PRIVATE int sqlite3StrICmp(const char *, const char *)
Definition sqlite3.c:31468
#define VDBE_OFFSET_LINENO(x)
Definition sqlite3.c:16001
SQLITE_PRIVATE VdbeOp * sqlite3VdbeAddOpList(Vdbe *, int nOp, VdbeOpList const *aOp, int iLineno)
Definition sqlite3.c:78700
SQLITE_PRIVATE void sqlite3VdbeChangeP5(Vdbe *, u16 P5)
Definition sqlite3.c:78788
SQLITE_PRIVATE int sqlite3SchemaToIndex(sqlite3 *db, Schema *)
Definition sqlite3.c:128852
SQLITE_PRIVATE void sqlite3VdbeChangeP4(Vdbe *, int addr, const char *zP4, int N)
Definition sqlite3.c:79028
#define HasRowid(X)
Definition sqlite3.c:17583
SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *, const char *,...)
Definition sqlite3.c:31363
#define OP_Halt
Definition sqlite3.c:15634
SQLITE_PRIVATE int sqlite3VdbeFinalize(Vdbe *)
Definition sqlite3.c:81114
static int blobSeekToRow(Incrblob *p, sqlite3_int64 iRow, char **pzErr)
Definition sqlite3.c:93421
SQLITE_PRIVATE int sqlite3VdbeAddOp4Int(Vdbe *, int, int, int, int, int)
Definition sqlite3.c:78215
char * zName
Definition sqlite3.c:17332
char * zDbSName
Definition sqlite3.c:16606
struct FKey::sColMap aCol[1]
int nCol
Definition sqlite3.c:17620
FKey * pNextFrom
Definition sqlite3.c:17616
Table * pTab
Definition sqlite3.c:93400
char * zDb
Definition sqlite3.c:93399
Index * pNext
Definition sqlite3.c:17782
i16 * aiColumn
Definition sqlite3.c:17778
u16 nKeyCol
Definition sqlite3.c:17790
char * zErrMsg
Definition sqlite3.c:18681
sqlite3 * db
Definition sqlite3.c:18680
int nTab
Definition sqlite3.c:18697
int nMem
Definition sqlite3.c:18698
ynVar nVar
Definition sqlite3.c:18748
int schema_cookie
Definition sqlite3.c:16631
int iGeneration
Definition sqlite3.c:16632
i16 nCol
Definition sqlite3.c:17500
Schema * pSchema
Definition sqlite3.c:17517
Pgno tnum
Definition sqlite3.c:17496
char * zName
Definition sqlite3.c:17488
FKey * pFKey
Definition sqlite3.c:17492
Select * pSelect
Definition sqlite3.c:17491
Index * pIndex
Definition sqlite3.c:17490
Column * aCol
Definition sqlite3.c:17489
signed char p4type
Definition sqlite3.c:15436
int p1
Definition sqlite3.c:15438
int p2
Definition sqlite3.c:15439
int p3
Definition sqlite3.c:15440
union VdbeOp::p4union p4
u8 opcode
Definition sqlite3.c:15435
Db * aDb
Definition sqlite3.c:16824
u8 mallocFailed
Definition sqlite3.c:16839
u64 flags
Definition sqlite3.c:16827

◆ sqlite3_blob_read()

SQLITE_API int sqlite3_blob_read ( sqlite3_blob * pBlob,
void * Z,
int N,
int iOffset )

Definition at line 93813 of file sqlite3.c.

◆ sqlite3_blob_reopen()

SQLITE_API int sqlite3_blob_reopen ( sqlite3_blob * pBlob,
sqlite3_int64 iRow )

Definition at line 93845 of file sqlite3.c.

93851 {
93852 int rc;
93853 Incrblob *p = (Incrblob *)pBlob;
93854 sqlite3 *db;
93855
93856 if( p==0 ) return SQLITE_MISUSE_BKPT;
93857 db = p->db;
93859
93860 if( p->pStmt==0 ){
93861 /* If there is no statement handle, then the blob-handle has
93862 ** already been invalidated. Return SQLITE_ABORT in this case.
93863 */
93864 rc = SQLITE_ABORT;
93865 }else{
93866 char *zErr;
93867 rc = blobSeekToRow(p, iRow, &zErr);
93868 if( rc!=SQLITE_OK ){
93869 sqlite3ErrorWithMsg(db, rc, (zErr ? "%s" : 0), zErr);
93870 sqlite3DbFree(db, zErr);
93871 }
93872 assert( rc!=SQLITE_SCHEMA );
93873 }
#define SQLITE_ABORT
Definition sqlite3.c:1474

References blobSeekToRow(), Incrblob::db, sqlite3::mutex, Incrblob::pStmt, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3ApiExit(), sqlite3DbFree(), sqlite3ErrorWithMsg(), SQLITE_ABORT, SQLITE_MISUSE_BKPT, SQLITE_OK, and SQLITE_SCHEMA.

◆ sqlite3_blob_write()

SQLITE_API int sqlite3_blob_write ( sqlite3_blob * pBlob,
const void * z,
int n,
int iOffset )

Definition at line 93820 of file sqlite3.c.

◆ sqlite3_busy_handler()

SQLITE_API int sqlite3_busy_handler ( sqlite3 * db,
int(*)(void *, int) xBusy,
void * pArg )

Definition at line 162677 of file sqlite3.c.

162687 {
162688#ifdef SQLITE_ENABLE_API_ARMOR
162689 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
162690#endif
162692 db->busyHandler.xBusyHandler = xBusy;
int(* xBusyHandler)(void *, int)
Definition sqlite3.c:14565
BusyHandler busyHandler
Definition sqlite3.c:16925

Referenced by db_busy_handler(), and sqlite3_busy_timeout().

◆ sqlite3_busy_timeout()

SQLITE_API int sqlite3_busy_timeout ( sqlite3 * db,
int ms )

Definition at line 162731 of file sqlite3.c.

162737 {
162738#ifdef SQLITE_ENABLE_API_ARMOR
162739 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
162740#endif
162741 if( ms>0 ){
162742 sqlite3_busy_handler(db, (int(*)(void*,int))sqliteDefaultBusyCallback,
162743 (void*)db);
SQLITE_API int sqlite3_busy_handler(sqlite3 *, int(*)(void *, int), void *)
Definition sqlite3.c:162677
static int sqliteDefaultBusyCallback(void *ptr, int count)
Definition sqlite3.c:162609

References sqlite3_busy_handler(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, and sqliteDefaultBusyCallback().

Referenced by db_busy_timeout(), and sqlite3Pragma().

◆ sqlite3_cancel_auto_extension()

SQLITE_API int sqlite3_cancel_auto_extension ( void(*)(void) xEntryPoint)

Definition at line 125000 of file sqlite3.c.

125008 {
125009#if SQLITE_THREADSAFE
125011#endif
125012 int i;
125013 int n = 0;
125016 for(i=(int)wsdAutoext.nExt-1; i>=0; i--){
125017 if( wsdAutoext.aExt[i]==xInit ){
125018 wsdAutoext.nExt--;
125019 wsdAutoext.aExt[i] = wsdAutoext.aExt[wsdAutoext.nExt];
125020 n++;

References mutex, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3MutexAlloc(), SQLITE_MUTEX_STATIC_MAIN, wsdAutoext, and wsdAutoextInit.

◆ sqlite3_changes()

SQLITE_API int sqlite3_changes ( sqlite3 * db)

Definition at line 162082 of file sqlite3.c.

162088 {
162089#ifdef SQLITE_ENABLE_API_ARMOR
162090 if( !sqlite3SafetyCheckOk(db) ){

Referenced by changes(), and db_changes().

◆ sqlite3_clear_bindings()

SQLITE_API int sqlite3_clear_bindings ( sqlite3_stmt * pStmt)

Definition at line 83128 of file sqlite3.c.

83134 {
83135 int i;
83136 int rc = SQLITE_OK;
83137 Vdbe *p = (Vdbe*)pStmt;
83138#if SQLITE_THREADSAFE
83139 sqlite3_mutex *mutex = ((Vdbe*)pStmt)->db->mutex;
83140#endif
83142 for(i=0; i<p->nVar; i++){
83144 p->aVar[i].flags = MEM_Null;
83145 }
83146 assert( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 || p->expmask==0 );
#define SQLITE_PREPARE_SAVESQL
Definition sqlite3.c:15792
SQLITE_PRIVATE void sqlite3VdbeMemRelease(Mem *p)
Definition sqlite3.c:76363
#define MEM_Null
Definition sqlite3.c:20948
ynVar nVar
Definition sqlite3.c:21087
u32 expmask
Definition sqlite3.c:21146
u8 prepFlags
Definition sqlite3.c:21125

◆ sqlite3_close()

SQLITE_API int sqlite3_close ( sqlite3 * db)

Definition at line 162246 of file sqlite3.c.

Referenced by cleanupdb(), and openDatabase().

◆ sqlite3_close_v2()

SQLITE_API int sqlite3_close_v2 ( sqlite3 * db)

Definition at line 162247 of file sqlite3.c.

References sqlite3Close().

◆ sqlite3_collation_needed()

SQLITE_API int sqlite3_collation_needed ( sqlite3 * db,
void * pCollNeededArg,
void(*)(void *, sqlite3 *, int eTextRep, const char *) xCollNeeded )

Definition at line 164507 of file sqlite3.c.

164517 {
164518#ifdef SQLITE_ENABLE_API_ARMOR
164519 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
164520#endif

References sqlite3::mutex, sqlite3::pCollNeededArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_OK, sqlite3::xCollNeeded, and sqlite3::xCollNeeded16.

◆ sqlite3_collation_needed16()

SQLITE_API int sqlite3_collation_needed16 ( sqlite3 * db,
void * pCollNeededArg,
void(*)(void *, sqlite3 *, int eTextRep, const void *) xCollNeeded16 )

Definition at line 164528 of file sqlite3.c.

164538 {
164539#ifdef SQLITE_ENABLE_API_ARMOR
164540 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
164541#endif

References sqlite3::mutex, sqlite3::pCollNeededArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_OK, sqlite3::xCollNeeded, and sqlite3::xCollNeeded16.

◆ sqlite3_column_blob()

SQLITE_API const void * sqlite3_column_blob ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84091 of file sqlite3.c.

84097 {
84098 const void *val;
84099 val = sqlite3_value_blob( columnMem(pStmt,i) );
84100 /* Even though there is no encoding conversion, value_blob() might
SQLITE_API const void * sqlite3_value_blob(sqlite3_value *)
Definition sqlite3.c:83153
static Mem * columnMem(sqlite3_stmt *pStmt, int i)
Definition sqlite3.c:84036

Referenced by vm_push_column().

◆ sqlite3_column_bytes()

SQLITE_API int sqlite3_column_bytes ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84101 of file sqlite3.c.

Referenced by vm_push_column().

◆ sqlite3_column_bytes16()

SQLITE_API int sqlite3_column_bytes16 ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84106 of file sqlite3.c.

84107 {
84108 int val = sqlite3_value_bytes( columnMem(pStmt,i) );
84109 columnMallocFailure(pStmt);
84110 return val;
static void columnMallocFailure(sqlite3_stmt *pStmt)
Definition sqlite3.c:84071
SQLITE_API int sqlite3_value_bytes(sqlite3_value *)
Definition sqlite3.c:83166

◆ sqlite3_column_count()

◆ sqlite3_column_database_name()

SQLITE_API const char * sqlite3_column_database_name ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_database_name16()

SQLITE_API const void * sqlite3_column_database_name16 ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_decltype()

SQLITE_API const char * sqlite3_column_decltype ( sqlite3_stmt * pStmt,
int N )

Definition at line 84241 of file sqlite3.c.

Referenced by dbvm_get_named_types(), dbvm_get_type(), dbvm_get_types(), and dbvm_get_utypes().

◆ sqlite3_column_decltype16()

SQLITE_API const void * sqlite3_column_decltype16 ( sqlite3_stmt * pStmt,
int N )

Definition at line 84245 of file sqlite3.c.

84247 {

References COLNAME_DECLTYPE, and columnName().

◆ sqlite3_column_double()

SQLITE_API double sqlite3_column_double ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84111 of file sqlite3.c.

84112 {
84113 int val = sqlite3_value_bytes16( columnMem(pStmt,i) );
84114 columnMallocFailure(pStmt);
84115 return val;
SQLITE_API int sqlite3_value_bytes16(sqlite3_value *)
Definition sqlite3.c:83169

Referenced by vm_push_column().

◆ sqlite3_column_int()

SQLITE_API int sqlite3_column_int ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84116 of file sqlite3.c.

84117 {
84118 double val = sqlite3_value_double( columnMem(pStmt,i) );
84119 columnMallocFailure(pStmt);
84120 return val;
SQLITE_API double sqlite3_value_double(sqlite3_value *)
Definition sqlite3.c:83172

◆ sqlite3_column_int64()

SQLITE_API sqlite3_int64 sqlite3_column_int64 ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84121 of file sqlite3.c.

84122 {
84123 int val = sqlite3_value_int( columnMem(pStmt,i) );
84124 columnMallocFailure(pStmt);
84125 return val;
SQLITE_API int sqlite3_value_int(sqlite3_value *)
Definition sqlite3.c:83175

Referenced by vm_push_column().

◆ sqlite3_column_name()

SQLITE_API const char * sqlite3_column_name ( sqlite3_stmt * pStmt,
int N )

◆ sqlite3_column_name16()

SQLITE_API const void * sqlite3_column_name16 ( sqlite3_stmt * pStmt,
int N )

Definition at line 84222 of file sqlite3.c.

84224 {

References COLNAME_NAME, and columnName().

◆ sqlite3_column_origin_name()

SQLITE_API const char * sqlite3_column_origin_name ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_origin_name16()

SQLITE_API const void * sqlite3_column_origin_name16 ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_table_name()

SQLITE_API const char * sqlite3_column_table_name ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_table_name16()

SQLITE_API const void * sqlite3_column_table_name16 ( sqlite3_stmt * ,
int  )

◆ sqlite3_column_text()

SQLITE_API const unsigned char * sqlite3_column_text ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84126 of file sqlite3.c.

84127 {
84128 sqlite_int64 val = sqlite3_value_int64( columnMem(pStmt,i) );
84129 columnMallocFailure(pStmt);
84130 return val;
SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value *)
Definition sqlite3.c:83178

Referenced by execSql(), sqlite3_exec(), and vm_push_column().

◆ sqlite3_column_text16()

SQLITE_API const void * sqlite3_column_text16 ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84141 of file sqlite3.c.

◆ sqlite3_column_type()

SQLITE_API int sqlite3_column_type ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84147 of file sqlite3.c.

84147 {
84148 const void *val = sqlite3_value_text16( columnMem(pStmt,i) );
84149 columnMallocFailure(pStmt);
84150 return val;
84151}
SQLITE_API const void * sqlite3_value_text16(sqlite3_value *)
Definition sqlite3.c:83202

References columnMallocFailure(), columnMem(), and sqlite3_value_text16().

Referenced by sqlite3_exec(), and vm_push_column().

◆ sqlite3_column_value()

SQLITE_API sqlite3_value * sqlite3_column_value ( sqlite3_stmt * pStmt,
int iCol )

Definition at line 84131 of file sqlite3.c.

84132 {
84133 const unsigned char *val = sqlite3_value_text( columnMem(pStmt,i) );
84134 columnMallocFailure(pStmt);
84135 return val;
84136}
84138 Mem *pOut = columnMem(pStmt, i);
84139 if( pOut->flags&MEM_Static ){
#define MEM_Static
Definition sqlite3.c:20968
SQLITE_API const unsigned char * sqlite3_value_text(sqlite3_value *)
Definition sqlite3.c:83198
SQLITE_API sqlite3_value * sqlite3_column_value(sqlite3_stmt *, int iCol)
Definition sqlite3.c:84131

◆ sqlite3_commit_hook()

SQLITE_API void * sqlite3_commit_hook ( sqlite3 * db,
int(*)(void *) xCallback,
void * pArg )

Definition at line 163156 of file sqlite3.c.

163166 {
163167 void *pOld;
163168
163169#ifdef SQLITE_ENABLE_API_ARMOR
163170 if( !sqlite3SafetyCheckOk(db) ){
163171 (void)SQLITE_MISUSE_BKPT;
163172 return 0;
163173 }
163174#endif

References sqlite3::mutex, sqlite3::pCommitArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, and sqlite3::xCommitCallback.

Referenced by db_commit_hook().

◆ sqlite3_compileoption_get()

SQLITE_API const char * sqlite3_compileoption_get ( int N)

Definition at line 165586 of file sqlite3.c.

165592 {
165593 int nOpt;
165594 const char **azCompileOpt;

Referenced by sqlite3Pragma().

◆ sqlite3_compileoption_used()

SQLITE_API int sqlite3_compileoption_used ( const char * zOptName)

Definition at line 165553 of file sqlite3.c.

165559 {
165560 int i, n;
165561 int nOpt;
165562 const char **azCompileOpt;
165563
165564#if SQLITE_ENABLE_API_ARMOR
165565 if( zOptName==0 ){
165566 (void)SQLITE_MISUSE_BKPT;
165567 return 0;
165568 }
165569#endif
165570
165571 azCompileOpt = sqlite3CompileOptions(&nOpt);
165572
165573 if( sqlite3StrNICmp(zOptName, "SQLITE_", 7)==0 ) zOptName += 7;
165574 n = sqlite3Strlen30(zOptName);
165575
165576 /* Since nOpt is normally in single digits, a linear search is
165577 ** adequate. No need for a binary search. */
165578 for(i=0; i<nOpt; i++){
165579 if( sqlite3StrNICmp(zOptName, azCompileOpt[i], n)==0
165580 && sqlite3IsIdChar((unsigned char)azCompileOpt[i][n])==0
SQLITE_PRIVATE int sqlite3IsIdChar(u8)
Definition sqlite3.c:159925
SQLITE_PRIVATE int sqlite3Strlen30(const char *)
Definition sqlite3.c:31259
SQLITE_PRIVATE const char ** sqlite3CompileOptions(int *pnOpt)
Definition sqlite3.c:782
#define sqlite3StrNICmp
Definition sqlite3.c:19345

References sqlite3CompileOptions(), sqlite3IsIdChar(), sqlite3Strlen30(), sqlite3StrNICmp, and SQLITE_MISUSE_BKPT.

Referenced by compileoptionusedFunc().

◆ sqlite3_complete()

SQLITE_API int sqlite3_complete ( const char * sql)

Definition at line 160710 of file sqlite3.c.

160716 {
160717 u8 state = 0; /* Current state, using numbers defined in header comment */
160718 u8 token; /* Value of the next token */
160719
160720#ifndef SQLITE_OMIT_TRIGGER
160721 /* A complex statement machine used to detect the end of a CREATE TRIGGER
160722 ** statement. This is the normal case.
160723 */
160724 static const u8 trans[8][8] = {
160725 /* Token: */
160726 /* State: ** SEMI WS OTHER EXPLAIN CREATE TEMP TRIGGER END */
160727 /* 0 INVALID: */ { 1, 0, 2, 3, 4, 2, 2, 2, },
160728 /* 1 START: */ { 1, 1, 2, 3, 4, 2, 2, 2, },
160729 /* 2 NORMAL: */ { 1, 2, 2, 2, 2, 2, 2, 2, },
160730 /* 3 EXPLAIN: */ { 1, 3, 3, 2, 4, 2, 2, 2, },
160731 /* 4 CREATE: */ { 1, 4, 2, 2, 2, 4, 5, 2, },
160732 /* 5 TRIGGER: */ { 6, 5, 5, 5, 5, 5, 5, 5, },
160733 /* 6 SEMI: */ { 6, 6, 5, 5, 5, 5, 5, 7, },
160734 /* 7 END: */ { 1, 7, 5, 5, 5, 5, 5, 5, },
160735 };
160736#else
160737 /* If triggers are not supported by this compile then the statement machine
160738 ** used to detect the end of a statement is much simpler
160739 */
160740 static const u8 trans[3][3] = {
160741 /* Token: */
160742 /* State: ** SEMI WS OTHER */
160743 /* 0 INVALID: */ { 1, 0, 2, },
160744 /* 1 START: */ { 1, 1, 2, },
160745 /* 2 NORMAL: */ { 1, 2, 2, },
160746 };
160747#endif /* SQLITE_OMIT_TRIGGER */
160748
160749#ifdef SQLITE_ENABLE_API_ARMOR
160750 if( zSql==0 ){
160751 (void)SQLITE_MISUSE_BKPT;
160752 return 0;
160753 }
160754#endif
160755
160756 while( *zSql ){
160757 switch( *zSql ){
160758 case ';': { /* A semicolon */
160759 token = tkSEMI;
160760 break;
160761 }
160762 case ' ':
160763 case '\r':
160764 case '\t':
160765 case '\n':
160766 case '\f': { /* White space is ignored */
160767 token = tkWS;
160768 break;
160769 }
160770 case '/': { /* C-style comments */
160771 if( zSql[1]!='*' ){
160772 token = tkOTHER;
160773 break;
160774 }
160775 zSql += 2;
160776 while( zSql[0] && (zSql[0]!='*' || zSql[1]!='/') ){ zSql++; }
160777 if( zSql[0]==0 ) return 0;
160778 zSql++;
160779 token = tkWS;
160780 break;
160781 }
160782 case '-': { /* SQL-style comments from "--" to end of line */
160783 if( zSql[1]!='-' ){
160784 token = tkOTHER;
160785 break;
160786 }
160787 while( *zSql && *zSql!='\n' ){ zSql++; }
160788 if( *zSql==0 ) return state==1;
160789 token = tkWS;
160790 break;
160791 }
160792 case '[': { /* Microsoft-style identifiers in [...] */
160793 zSql++;
160794 while( *zSql && *zSql!=']' ){ zSql++; }
160795 if( *zSql==0 ) return 0;
160796 token = tkOTHER;
160797 break;
160798 }
160799 case '`': /* Grave-accent quoted symbols used by MySQL */
160800 case '"': /* single- and double-quoted strings */
160801 case '\'': {
160802 int c = *zSql;
160803 zSql++;
160804 while( *zSql && *zSql!=c ){ zSql++; }
160805 if( *zSql==0 ) return 0;
160806 token = tkOTHER;
160807 break;
160808 }
160809 default: {
160810#ifdef SQLITE_EBCDIC
160811 unsigned char c;
160812#endif
160813 if( IdChar((u8)*zSql) ){
160814 /* Keywords and unquoted identifiers */
160815 int nId;
160816 for(nId=1; IdChar(zSql[nId]); nId++){}
160817#ifdef SQLITE_OMIT_TRIGGER
160818 token = tkOTHER;
160819#else
160820 switch( *zSql ){
160821 case 'c': case 'C': {
160822 if( nId==6 && sqlite3StrNICmp(zSql, "create", 6)==0 ){
160823 token = tkCREATE;
160824 }else{
160825 token = tkOTHER;
160826 }
160827 break;
160828 }
160829 case 't': case 'T': {
160830 if( nId==7 && sqlite3StrNICmp(zSql, "trigger", 7)==0 ){
160831 token = tkTRIGGER;
160832 }else if( nId==4 && sqlite3StrNICmp(zSql, "temp", 4)==0 ){
160833 token = tkTEMP;
160834 }else if( nId==9 && sqlite3StrNICmp(zSql, "temporary", 9)==0 ){
160835 token = tkTEMP;
160836 }else{
160837 token = tkOTHER;
160838 }
160839 break;
160840 }
160841 case 'e': case 'E': {
160842 if( nId==3 && sqlite3StrNICmp(zSql, "end", 3)==0 ){
160843 token = tkEND;
160844 }else
160845#ifndef SQLITE_OMIT_EXPLAIN
160846 if( nId==7 && sqlite3StrNICmp(zSql, "explain", 7)==0 ){
160847 token = tkEXPLAIN;
160848 }else
160849#endif
160850 {
160851 token = tkOTHER;
160852 }
160853 break;
160854 }
160855 default: {
160856 token = tkOTHER;
160857 break;
160858 }
160859 }
160860#endif /* SQLITE_OMIT_TRIGGER */
160861 zSql += nId-1;
160862 }else{
160863 /* Operators and special symbols */
160864 token = tkOTHER;
160865 }
160866 break;
160867 }
#define tkSEMI
Definition sqlite3.c:160646
#define IdChar(C)
Definition sqlite3.c:159903
#define tkEXPLAIN
Definition sqlite3.c:160650
#define tkOTHER
Definition sqlite3.c:160648
#define tkCREATE
Definition sqlite3.c:160651
#define tkWS
Definition sqlite3.c:160647
#define tkTEMP
Definition sqlite3.c:160652
#define tkEND
Definition sqlite3.c:160654
#define tkTRIGGER
Definition sqlite3.c:160653

References IdChar, sqlite3StrNICmp, SQLITE_MISUSE_BKPT, tkCREATE, tkEND, tkEXPLAIN, tkOTHER, tkSEMI, tkTEMP, tkTRIGGER, and tkWS.

Referenced by lsqlite_complete(), and sqlite3_complete16().

◆ sqlite3_complete16()

SQLITE_API int sqlite3_complete16 ( const void * sql)

Definition at line 160875 of file sqlite3.c.

160881 {
160882 sqlite3_value *pVal;
160883 char const *zSql8;
160884 int rc;
160885
160886#ifndef SQLITE_OMIT_AUTOINIT
160887 rc = sqlite3_initialize();
160888 if( rc ) return rc;
160889#endif
160890 pVal = sqlite3ValueNew(0);
160892 zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8);
160893 if( zSql8 ){
160894 rc = sqlite3_complete(zSql8);
SQLITE_PRIVATE void sqlite3ValueSetStr(sqlite3_value *, int, const void *, u8, void(*)(void *))
Definition sqlite3.c:77687
#define SQLITE_STATIC
Definition sqlite3.c:6670
SQLITE_API int sqlite3_complete(const char *sql)
Definition sqlite3.c:160710
SQLITE_PRIVATE sqlite3_value * sqlite3ValueNew(sqlite3 *)
Definition sqlite3.c:77116
SQLITE_PRIVATE const void * sqlite3ValueText(sqlite3_value *, u8)
Definition sqlite3.c:77098

References sqlite3_complete(), sqlite3_initialize(), sqlite3ValueFree(), sqlite3ValueNew(), sqlite3ValueSetStr(), sqlite3ValueText(), SQLITE_NOMEM_BKPT, SQLITE_STATIC, SQLITE_UTF16NATIVE, and SQLITE_UTF8.

◆ sqlite3_config()

SQLITE_API int sqlite3_config ( int op,
... )

Definition at line 161425 of file sqlite3.c.

161431 {
161432 va_list ap;
161433 int rc = SQLITE_OK;
161434
161435 /* sqlite3_config() shall return SQLITE_MISUSE if it is invoked while
161436 ** the SQLite library is in use. */
161437 if( sqlite3GlobalConfig.isInit ) return SQLITE_MISUSE_BKPT;
161438
161439 va_start(ap, op);
161440 switch( op ){
161441
161442 /* Mutex configuration options are only available in a threadsafe
161443 ** compile.
161444 */
161445#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-54466-46756 */
161447 /* EVIDENCE-OF: R-02748-19096 This option sets the threading mode to
161448 ** Single-thread. */
161449 sqlite3GlobalConfig.bCoreMutex = 0; /* Disable mutex on core */
161450 sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
161451 break;
161452 }
161453#endif
161454#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-20520-54086 */
161456 /* EVIDENCE-OF: R-14374-42468 This option sets the threading mode to
161457 ** Multi-thread. */
161458 sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
161459 sqlite3GlobalConfig.bFullMutex = 0; /* Disable mutex on connections */
161460 break;
161461 }
161462#endif
161463#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-59593-21810 */
161465 /* EVIDENCE-OF: R-41220-51800 This option sets the threading mode to
161466 ** Serialized. */
161467 sqlite3GlobalConfig.bCoreMutex = 1; /* Enable mutex on core */
161468 sqlite3GlobalConfig.bFullMutex = 1; /* Enable mutex on connections */
161469 break;
161470 }
161471#endif
161472#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-63666-48755 */
161473 case SQLITE_CONFIG_MUTEX: {
161474 /* Specify an alternative mutex implementation */
161475 sqlite3GlobalConfig.mutex = *va_arg(ap, sqlite3_mutex_methods*);
161476 break;
161477 }
161478#endif
161479#if defined(SQLITE_THREADSAFE) && SQLITE_THREADSAFE>0 /* IMP: R-14450-37597 */
161480 case SQLITE_CONFIG_GETMUTEX: {
161481 /* Retrieve the current mutex implementation */
161482 *va_arg(ap, sqlite3_mutex_methods*) = sqlite3GlobalConfig.mutex;
161483 break;
161484 }
161485#endif
161486
161487 case SQLITE_CONFIG_MALLOC: {
161488 /* EVIDENCE-OF: R-55594-21030 The SQLITE_CONFIG_MALLOC option takes a
161489 ** single argument which is a pointer to an instance of the
161490 ** sqlite3_mem_methods structure. The argument specifies alternative
161491 ** low-level memory allocation routines to be used in place of the memory
161492 ** allocation routines built into SQLite. */
161493 sqlite3GlobalConfig.m = *va_arg(ap, sqlite3_mem_methods*);
161494 break;
161495 }
161497 /* EVIDENCE-OF: R-51213-46414 The SQLITE_CONFIG_GETMALLOC option takes a
161498 ** single argument which is a pointer to an instance of the
161499 ** sqlite3_mem_methods structure. The sqlite3_mem_methods structure is
161500 ** filled with the currently defined memory allocation routines. */
161501 if( sqlite3GlobalConfig.m.xMalloc==0 ) sqlite3MemSetDefault();
161502 *va_arg(ap, sqlite3_mem_methods*) = sqlite3GlobalConfig.m;
161503 break;
161504 }
161506 /* EVIDENCE-OF: R-61275-35157 The SQLITE_CONFIG_MEMSTATUS option takes
161507 ** single argument of type int, interpreted as a boolean, which enables
161508 ** or disables the collection of memory allocation statistics. */
161509 sqlite3GlobalConfig.bMemstat = va_arg(ap, int);
161510 break;
161511 }
161513 sqlite3GlobalConfig.bSmallMalloc = va_arg(ap, int);
161514 break;
161515 }
161517 /* EVIDENCE-OF: R-18761-36601 There are three arguments to
161518 ** SQLITE_CONFIG_PAGECACHE: A pointer to 8-byte aligned memory (pMem),
161519 ** the size of each page cache line (sz), and the number of cache lines
161520 ** (N). */
161521 sqlite3GlobalConfig.pPage = va_arg(ap, void*);
161522 sqlite3GlobalConfig.szPage = va_arg(ap, int);
161523 sqlite3GlobalConfig.nPage = va_arg(ap, int);
161524 break;
161525 }
161527 /* EVIDENCE-OF: R-39100-27317 The SQLITE_CONFIG_PCACHE_HDRSZ option takes
161528 ** a single parameter which is a pointer to an integer and writes into
161529 ** that integer the number of extra bytes per page required for each page
161530 ** in SQLITE_CONFIG_PAGECACHE. */
161531 *va_arg(ap, int*) =
161535 break;
161536 }
161537
161538 case SQLITE_CONFIG_PCACHE: {
161539 /* no-op */
161540 break;
161541 }
161543 /* now an error */
161544 rc = SQLITE_ERROR;
161545 break;
161546 }
161547
161548 case SQLITE_CONFIG_PCACHE2: {
161549 /* EVIDENCE-OF: R-63325-48378 The SQLITE_CONFIG_PCACHE2 option takes a
161550 ** single argument which is a pointer to an sqlite3_pcache_methods2
161551 ** object. This object specifies the interface to a custom page cache
161552 ** implementation. */
161553 sqlite3GlobalConfig.pcache2 = *va_arg(ap, sqlite3_pcache_methods2*);
161554 break;
161555 }
161557 /* EVIDENCE-OF: R-22035-46182 The SQLITE_CONFIG_GETPCACHE2 option takes a
161558 ** single argument which is a pointer to an sqlite3_pcache_methods2
161559 ** object. SQLite copies of the current page cache implementation into
161560 ** that object. */
161561 if( sqlite3GlobalConfig.pcache2.xInit==0 ){
161563 }
161564 *va_arg(ap, sqlite3_pcache_methods2*) = sqlite3GlobalConfig.pcache2;
161565 break;
161566 }
161567
161568/* EVIDENCE-OF: R-06626-12911 The SQLITE_CONFIG_HEAP option is only
161569** available if SQLite is compiled with either SQLITE_ENABLE_MEMSYS3 or
161570** SQLITE_ENABLE_MEMSYS5 and returns SQLITE_ERROR if invoked otherwise. */
161571#if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5)
161572 case SQLITE_CONFIG_HEAP: {
161573 /* EVIDENCE-OF: R-19854-42126 There are three arguments to
161574 ** SQLITE_CONFIG_HEAP: An 8-byte aligned pointer to the memory, the
161575 ** number of bytes in the memory buffer, and the minimum allocation size.
161576 */
161577 sqlite3GlobalConfig.pHeap = va_arg(ap, void*);
161578 sqlite3GlobalConfig.nHeap = va_arg(ap, int);
161579 sqlite3GlobalConfig.mnReq = va_arg(ap, int);
161580
161581 if( sqlite3GlobalConfig.mnReq<1 ){
161582 sqlite3GlobalConfig.mnReq = 1;
161583 }else if( sqlite3GlobalConfig.mnReq>(1<<12) ){
161584 /* cap min request size at 2^12 */
161585 sqlite3GlobalConfig.mnReq = (1<<12);
161586 }
161587
161588 if( sqlite3GlobalConfig.pHeap==0 ){
161589 /* EVIDENCE-OF: R-49920-60189 If the first pointer (the memory pointer)
161590 ** is NULL, then SQLite reverts to using its default memory allocator
161591 ** (the system malloc() implementation), undoing any prior invocation of
161592 ** SQLITE_CONFIG_MALLOC.
161593 **
161594 ** Setting sqlite3GlobalConfig.m to all zeros will cause malloc to
161595 ** revert to its default implementation when sqlite3_initialize() is run
161596 */
161597 memset(&sqlite3GlobalConfig.m, 0, sizeof(sqlite3GlobalConfig.m));
161598 }else{
161599 /* EVIDENCE-OF: R-61006-08918 If the memory pointer is not NULL then the
161600 ** alternative memory allocator is engaged to handle all of SQLites
161601 ** memory allocation needs. */
161602#ifdef SQLITE_ENABLE_MEMSYS3
161603 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys3();
161604#endif
161605#ifdef SQLITE_ENABLE_MEMSYS5
161606 sqlite3GlobalConfig.m = *sqlite3MemGetMemsys5();
161607#endif
161608 }
161609 break;
161610 }
161611#endif
161612
161614 sqlite3GlobalConfig.szLookaside = va_arg(ap, int);
161615 sqlite3GlobalConfig.nLookaside = va_arg(ap, int);
161616 break;
161617 }
161618
161619 /* Record a pointer to the logger function and its first argument.
161620 ** The default is NULL. Logging is disabled if the function pointer is
161621 ** NULL.
161622 */
161623 case SQLITE_CONFIG_LOG: {
161624 /* MSVC is picky about pulling func ptrs from va lists.
161625 ** http://support.microsoft.com/kb/47961
161626 ** sqlite3GlobalConfig.xLog = va_arg(ap, void(*)(void*,int,const char*));
161627 */
161628 typedef void(*LOGFUNC_t)(void*,int,const char*);
161629 sqlite3GlobalConfig.xLog = va_arg(ap, LOGFUNC_t);
161630 sqlite3GlobalConfig.pLogArg = va_arg(ap, void*);
161631 break;
161632 }
161633
161634 /* EVIDENCE-OF: R-55548-33817 The compile-time setting for URI filenames
161635 ** can be changed at start-time using the
161636 ** sqlite3_config(SQLITE_CONFIG_URI,1) or
161637 ** sqlite3_config(SQLITE_CONFIG_URI,0) configuration calls.
161638 */
161639 case SQLITE_CONFIG_URI: {
161640 /* EVIDENCE-OF: R-25451-61125 The SQLITE_CONFIG_URI option takes a single
161641 ** argument of type int. If non-zero, then URI handling is globally
161642 ** enabled. If the parameter is zero, then URI handling is globally
161643 ** disabled. */
161644 sqlite3GlobalConfig.bOpenUri = va_arg(ap, int);
161645 break;
161646 }
161647
161649 /* EVIDENCE-OF: R-36592-02772 The SQLITE_CONFIG_COVERING_INDEX_SCAN
161650 ** option takes a single integer argument which is interpreted as a
161651 ** boolean in order to enable or disable the use of covering indices for
161652 ** full table scans in the query optimizer. */
161653 sqlite3GlobalConfig.bUseCis = va_arg(ap, int);
161654 break;
161655 }
161656
161657#ifdef SQLITE_ENABLE_SQLLOG
161658 case SQLITE_CONFIG_SQLLOG: {
161659 typedef void(*SQLLOGFUNC_t)(void*, sqlite3*, const char*, int);
161660 sqlite3GlobalConfig.xSqllog = va_arg(ap, SQLLOGFUNC_t);
161661 sqlite3GlobalConfig.pSqllogArg = va_arg(ap, void *);
161662 break;
161663 }
161664#endif
161665
161667 /* EVIDENCE-OF: R-58063-38258 SQLITE_CONFIG_MMAP_SIZE takes two 64-bit
161668 ** integer (sqlite3_int64) values that are the default mmap size limit
161669 ** (the default setting for PRAGMA mmap_size) and the maximum allowed
161670 ** mmap size limit. */
161671 sqlite3_int64 szMmap = va_arg(ap, sqlite3_int64);
161672 sqlite3_int64 mxMmap = va_arg(ap, sqlite3_int64);
161673 /* EVIDENCE-OF: R-53367-43190 If either argument to this option is
161674 ** negative, then that argument is changed to its compile-time default.
161675 **
161676 ** EVIDENCE-OF: R-34993-45031 The maximum allowed mmap size will be
161677 ** silently truncated if necessary so that it does not exceed the
161678 ** compile-time maximum mmap size set by the SQLITE_MAX_MMAP_SIZE
161679 ** compile-time option.
161680 */
161681 if( mxMmap<0 || mxMmap>SQLITE_MAX_MMAP_SIZE ){
161682 mxMmap = SQLITE_MAX_MMAP_SIZE;
161683 }
161684 if( szMmap<0 ) szMmap = SQLITE_DEFAULT_MMAP_SIZE;
161685 if( szMmap>mxMmap) szMmap = mxMmap;
161686 sqlite3GlobalConfig.mxMmap = mxMmap;
161687 sqlite3GlobalConfig.szMmap = szMmap;
161688 break;
161689 }
161690
161691#if SQLITE_OS_WIN && defined(SQLITE_WIN32_MALLOC) /* IMP: R-04780-55815 */
161693 /* EVIDENCE-OF: R-34926-03360 SQLITE_CONFIG_WIN32_HEAPSIZE takes a 32-bit
161694 ** unsigned integer value that specifies the maximum size of the created
161695 ** heap. */
161696 sqlite3GlobalConfig.nHeap = va_arg(ap, int);
161697 break;
161698 }
161699#endif
161700
161701 case SQLITE_CONFIG_PMASZ: {
161702 sqlite3GlobalConfig.szPma = va_arg(ap, unsigned int);
161703 break;
161704 }
161705
161707 sqlite3GlobalConfig.nStmtSpill = va_arg(ap, int);
161708 break;
161709 }
161710
161711#ifdef SQLITE_ENABLE_SORTER_REFERENCES
161713 int iVal = va_arg(ap, int);
161714 if( iVal<0 ){
161716 }
161717 sqlite3GlobalConfig.szSorterRef = (u32)iVal;
161718 break;
161719 }
161720#endif /* SQLITE_ENABLE_SORTER_REFERENCES */
161721
161722#ifdef SQLITE_ENABLE_DESERIALIZE
161724 sqlite3GlobalConfig.mxMemdbSize = va_arg(ap, sqlite3_int64);
161725 break;
161726 }
161727#endif /* SQLITE_ENABLE_DESERIALIZE */
161728
161729 default: {
161730 rc = SQLITE_ERROR;
#define SQLITE_DEFAULT_SORTERREF_SIZE
Definition sqlite3.c:14239
#define SQLITE_CONFIG_MEMSTATUS
Definition sqlite3.c:3086
sqlite_int64 sqlite3_int64
Definition sqlite3.c:1329
#define SQLITE_CONFIG_MUTEX
Definition sqlite3.c:3087
#define SQLITE_CONFIG_PMASZ
Definition sqlite3.c:3102
#define SQLITE_CONFIG_STMTJRNL_SPILL
Definition sqlite3.c:3103
SQLITE_PRIVATE void sqlite3MemSetDefault(void)
Definition sqlite3.c:23824
#define SQLITE_CONFIG_HEAP
Definition sqlite3.c:3085
#define SQLITE_CONFIG_MEMDB_MAXSIZE
Definition sqlite3.c:3106
#define SQLITE_CONFIG_PCACHE2
Definition sqlite3.c:3095
#define SQLITE_CONFIG_SMALL_MALLOC
Definition sqlite3.c:3104
SQLITE_PRIVATE int sqlite3HeaderSizeBtree(void)
Definition sqlite3.c:75028
#define SQLITE_CONFIG_PAGECACHE
Definition sqlite3.c:3084
#define SQLITE_CONFIG_GETMALLOC
Definition sqlite3.c:3082
#define SQLITE_CONFIG_LOG
Definition sqlite3.c:3093
#define SQLITE_CONFIG_GETMUTEX
Definition sqlite3.c:3088
#define SQLITE_CONFIG_MULTITHREAD
Definition sqlite3.c:3079
#define SQLITE_CONFIG_COVERING_INDEX_SCAN
Definition sqlite3.c:3097
SQLITE_PRIVATE int sqlite3HeaderSizePcache1(void)
Definition sqlite3.c:50968
#define SQLITE_CONFIG_MALLOC
Definition sqlite3.c:3081
#define SQLITE_CONFIG_WIN32_HEAPSIZE
Definition sqlite3.c:3100
#define SQLITE_CONFIG_LOOKASIDE
Definition sqlite3.c:3090
#define SQLITE_DEFAULT_MMAP_SIZE
Definition sqlite3.c:14527
#define sqlite3GlobalConfig
Definition sqlite3.c:14634
SQLITE_PRIVATE void sqlite3PCacheSetDefault(void)
Definition sqlite3.c:50946
#define SQLITE_CONFIG_URI
Definition sqlite3.c:3094
#define SQLITE_CONFIG_SQLLOG
Definition sqlite3.c:3098
#define SQLITE_MAX_MMAP_SIZE
Definition sqlite3.c:14517
#define SQLITE_CONFIG_MMAP_SIZE
Definition sqlite3.c:3099
#define SQLITE_CONFIG_PCACHE
Definition sqlite3.c:3091
#define SQLITE_CONFIG_PCACHE_HDRSZ
Definition sqlite3.c:3101
#define SQLITE_CONFIG_SERIALIZED
Definition sqlite3.c:3080
#define SQLITE_CONFIG_GETPCACHE
Definition sqlite3.c:3092
#define SQLITE_CONFIG_SINGLETHREAD
Definition sqlite3.c:3078
#define SQLITE_CONFIG_SORTERREF_SIZE
Definition sqlite3.c:3105
SQLITE_PRIVATE int sqlite3HeaderSizePcache(void)
Definition sqlite3.c:49720
#define SQLITE_CONFIG_GETPCACHE2
Definition sqlite3.c:3096

References sqlite3GlobalConfig, sqlite3HeaderSizeBtree(), sqlite3HeaderSizePcache(), sqlite3HeaderSizePcache1(), sqlite3MemSetDefault(), sqlite3PCacheSetDefault(), SQLITE_CONFIG_COVERING_INDEX_SCAN, SQLITE_CONFIG_GETMALLOC, SQLITE_CONFIG_GETMUTEX, SQLITE_CONFIG_GETPCACHE, SQLITE_CONFIG_GETPCACHE2, SQLITE_CONFIG_HEAP, SQLITE_CONFIG_LOG, SQLITE_CONFIG_LOOKASIDE, SQLITE_CONFIG_MALLOC, SQLITE_CONFIG_MEMDB_MAXSIZE, SQLITE_CONFIG_MEMSTATUS, SQLITE_CONFIG_MMAP_SIZE, SQLITE_CONFIG_MULTITHREAD, SQLITE_CONFIG_MUTEX, SQLITE_CONFIG_PAGECACHE, SQLITE_CONFIG_PCACHE, SQLITE_CONFIG_PCACHE2, SQLITE_CONFIG_PCACHE_HDRSZ, SQLITE_CONFIG_PMASZ, SQLITE_CONFIG_SERIALIZED, SQLITE_CONFIG_SINGLETHREAD, SQLITE_CONFIG_SMALL_MALLOC, SQLITE_CONFIG_SORTERREF_SIZE, SQLITE_CONFIG_SQLLOG, SQLITE_CONFIG_STMTJRNL_SPILL, SQLITE_CONFIG_URI, SQLITE_CONFIG_WIN32_HEAPSIZE, SQLITE_DEFAULT_MMAP_SIZE, SQLITE_DEFAULT_SORTERREF_SIZE, SQLITE_ERROR, SQLITE_MAX_MMAP_SIZE, SQLITE_MISUSE_BKPT, and SQLITE_OK.

Referenced by sqlite3MemSetDefault().

◆ sqlite3_context_db_handle()

SQLITE_API sqlite3 * sqlite3_context_db_handle ( sqlite3_context * p)

Definition at line 83794 of file sqlite3.c.

83794 : R-46798-50301 The sqlite3_context_db_handle() interface
83795** returns a copy of the pointer to the database connection (the 1st
83796** parameter) of the sqlite3_create_function() and
83797** sqlite3_create_function16() routines that originally registered the
SQLITE_API int sqlite3_create_function(sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
Definition sqlite3.c:162936
SQLITE_API sqlite3 * sqlite3_context_db_handle(sqlite3_context *)
Definition sqlite3.c:83794
SQLITE_API int sqlite3_create_function16(sqlite3 *db, const void *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *))
Definition sqlite3.c:162980

References sqlite3_value::db, and sqlite3_context::pOut.

Referenced by attachFunc(), changes(), contextMalloc(), detachFunc(), likeFunc(), loadExt(), renameColumnFunc(), renameEditSql(), renameTableFunc(), renameTableTest(), replaceFunc(), statInit(), strftimeFunc(), and substrFunc().

◆ sqlite3_create_collation()

SQLITE_API int sqlite3_create_collation ( sqlite3 * db,
const char * zName,
int eTextRep,
void * pArg,
int(*)(void *, int, const void *, int, const void *) xCompare )

Definition at line 164439 of file sqlite3.c.

◆ sqlite3_create_collation16()

SQLITE_API int sqlite3_create_collation16 ( sqlite3 * db,
const void * zName,
int eTextRep,
void * pArg,
int(*)(void *, int, const void *, int, const void *) xCompare )

Definition at line 164477 of file sqlite3.c.

164489 {
164490 int rc = SQLITE_OK;
164491 char *zName8;
164492
164493#ifdef SQLITE_ENABLE_API_ARMOR
164494 if( !sqlite3SafetyCheckOk(db) || zName==0 ) return SQLITE_MISUSE_BKPT;
164495#endif
164497 assert( !db->mallocFailed );
164498 zName8 = sqlite3Utf16to8(db, zName, -1, SQLITE_UTF16NATIVE);
164499 if( zName8 ){
164500 rc = createCollation(db, zName8, (u8)enc, pCtx, xCompare, 0);
static int createCollation(sqlite3 *db, const char *zName, u8 enc, void *pCtx, int(*xCompare)(void *, int, const void *, int, const void *), void(*xDel)(void *))
Definition sqlite3.c:163588
SQLITE_PRIVATE char * sqlite3Utf16to8(sqlite3 *, const void *, int, u8)
Definition sqlite3.c:31111
char * zName
Definition sqlite3.c:22329

◆ sqlite3_create_collation_v2()

SQLITE_API int sqlite3_create_collation_v2 ( sqlite3 * db,
const char * zName,
int eTextRep,
void * pArg,
int(*)(void *, int, const void *, int, const void *) xCompare,
void(*)(void *) xDestroy )

Definition at line 164452 of file sqlite3.c.

164465 {
164466 int rc;
164467
164468#ifdef SQLITE_ENABLE_API_ARMOR
164469 if( !sqlite3SafetyCheckOk(db) || zName==0 ) return SQLITE_MISUSE_BKPT;
164470#endif

Referenced by db_create_collation().

◆ sqlite3_create_filename()

SQLITE_API char * sqlite3_create_filename ( const char * zDatabase,
const char * zJournal,
const char * zWal,
int nParam,
const char ** azParam )

Definition at line 165241 of file sqlite3.c.

165253 {
165254 sqlite3_int64 nByte;
165255 int i;
165256 char *pResult, *p;
165257 nByte = strlen(zDatabase) + strlen(zJournal) + strlen(zWal) + 10;
165258 for(i=0; i<nParam*2; i++){
165259 nByte += strlen(azParam[i])+1;
165260 }
165261 pResult = p = sqlite3_malloc64( nByte );
165262 if( p==0 ) return 0;
165263 memset(p, 0, 4);
165264 p += 4;
165265 p = appendText(p, zDatabase);
165266 for(i=0; i<nParam*2; i++){
165267 p = appendText(p, azParam[i]);
165268 }
165269 *(p++) = 0;
165270 p = appendText(p, zJournal);
SQLITE_API void * sqlite3_malloc64(sqlite3_uint64)
Definition sqlite3.c:27621
static char * appendText(char *p, const char *z)
Definition sqlite3.c:165226

References appendText(), and sqlite3_malloc64().

◆ sqlite3_create_function()

SQLITE_API int sqlite3_create_function ( sqlite3 * db,
const char * zFunctionName,
int nArg,
int eTextRep,
void * pApp,
void(*)(sqlite3_context *, int, sqlite3_value **) xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **) xStep,
void(*)(sqlite3_context *) xFinal )

Definition at line 162936 of file sqlite3.c.

Referenced by db_register_function().

◆ sqlite3_create_function16()

SQLITE_API int sqlite3_create_function16 ( sqlite3 * db,
const void * zFunctionName,
int nArg,
int eTextRep,
void * pApp,
void(*)(sqlite3_context *, int, sqlite3_value **) xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **) xStep,
void(*)(sqlite3_context *) xFinal )

Definition at line 162980 of file sqlite3.c.

162980 {
162981 return createFunctionApi(db, zFunc, nArg, enc, p, 0, xStep,
162982 xFinal, xValue, xInverse, xDestroy);
162983}
162984
162985#ifndef SQLITE_OMIT_UTF16
162987 sqlite3 *db,
162988 const void *zFunctionName,
162989 int nArg,
162990 int eTextRep,
162991 void *p,
162992 void (*xSFunc)(sqlite3_context*,int,sqlite3_value**),
162993 void (*xStep)(sqlite3_context*,int,sqlite3_value**),
162994 void (*xFinal)(sqlite3_context*)
162995){
162996 int rc;
162997 char *zFunc8;
162998
162999#ifdef SQLITE_ENABLE_API_ARMOR
163000 if( !sqlite3SafetyCheckOk(db) || zFunctionName==0 ) return SQLITE_MISUSE_BKPT;
163001#endif
163003 assert( !db->mallocFailed );
163004 zFunc8 = sqlite3Utf16to8(db, zFunctionName, -1, SQLITE_UTF16NATIVE);
static int createFunctionApi(sqlite3 *db, const char *zFunc, int nArg, int enc, void *p, void(*xSFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xValue)(sqlite3_context *), void(*xInverse)(sqlite3_context *, int, sqlite3_value **), void(*xDestroy)(void *))
Definition sqlite3.c:162885

References createFunctionApi().

◆ sqlite3_create_function_v2()

SQLITE_API int sqlite3_create_function_v2 ( sqlite3 * db,
const char * zFunctionName,
int nArg,
int eTextRep,
void * pApp,
void(*)(sqlite3_context *, int, sqlite3_value **) xFunc,
void(*)(sqlite3_context *, int, sqlite3_value **) xStep,
void(*)(sqlite3_context *) xFinal,
void(*)(void *) xDestroy )

Definition at line 162949 of file sqlite3.c.

162951 {
162952 return createFunctionApi(db, zFunc, nArg, enc, p, xSFunc, xStep,
162953 xFinal, 0, 0, 0);
162954}
162956 sqlite3 *db,
162957 const char *zFunc,
162958 int nArg,
162959 int enc,
162960 void *p,
162961 void (*xSFunc)(sqlite3_context*,int,sqlite3_value **),
162962 void (*xStep)(sqlite3_context*,int,sqlite3_value **),
SQLITE_API int sqlite3_create_function_v2(sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xFunc)(sqlite3_context *, int, sqlite3_value **), void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xDestroy)(void *))
Definition sqlite3.c:162949

References createFunctionApi().

Referenced by sqlite3_overload_function().

◆ sqlite3_create_module()

SQLITE_API int sqlite3_create_module ( sqlite3 * db,
const char * zName,
const sqlite3_module * p,
void * pClientData )

Definition at line 139679 of file sqlite3.c.

◆ sqlite3_create_module_v2()

SQLITE_API int sqlite3_create_module_v2 ( sqlite3 * db,
const char * zName,
const sqlite3_module * p,
void * pClientData,
void(*)(void *) xDestroy )

Definition at line 139694 of file sqlite3.c.

◆ sqlite3_create_window_function()

SQLITE_API int sqlite3_create_window_function ( sqlite3 * db,
const char * zFunctionName,
int nArg,
int eTextRep,
void * pApp,
void(*)(sqlite3_context *, int, sqlite3_value **) xStep,
void(*)(sqlite3_context *) xFinal,
void(*)(sqlite3_context *) xValue,
void(*)(sqlite3_context *, int, sqlite3_value **) xInverse,
void(*)(void *) xDestroy )

Definition at line 162963 of file sqlite3.c.

162965 {
162966 return createFunctionApi(db, zFunc, nArg, enc, p, xSFunc, xStep,
162967 xFinal, 0, 0, xDestroy);
162968}
162970 sqlite3 *db,
162971 const char *zFunc,
162972 int nArg,
162973 int enc,
162974 void *p,
162975 void (*xStep)(sqlite3_context*,int,sqlite3_value **),
162976 void (*xFinal)(sqlite3_context*),
162977 void (*xValue)(sqlite3_context*),
SQLITE_API int sqlite3_create_window_function(sqlite3 *db, const char *zFunctionName, int nArg, int eTextRep, void *pApp, void(*xStep)(sqlite3_context *, int, sqlite3_value **), void(*xFinal)(sqlite3_context *), void(*xValue)(sqlite3_context *), void(*xInverse)(sqlite3_context *, int, sqlite3_value **), void(*xDestroy)(void *))
Definition sqlite3.c:162963

References createFunctionApi().

◆ sqlite3_data_count()

SQLITE_API int sqlite3_data_count ( sqlite3_stmt * pStmt)

Definition at line 83987 of file sqlite3.c.

Referenced by db_do_next_row(), and dbvm_step().

◆ sqlite3_database_file_object()

SQLITE_API sqlite3_file * sqlite3_database_file_object ( const char * zName)

Definition at line 56713 of file sqlite3.c.

56719 {
56720 Pager *pPager;

References Pager::fd, and zName.

◆ sqlite3_db_cacheflush()

SQLITE_API int sqlite3_db_cacheflush ( sqlite3 * db)

Definition at line 161881 of file sqlite3.c.

161887 {
161888 int i;
161889 int rc = SQLITE_OK;
161890 int bSeenBusy = 0;
161891
161892#ifdef SQLITE_ENABLE_API_ARMOR
161893 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
161894#endif
161897 for(i=0; rc==SQLITE_OK && i<db->nDb; i++){
161898 Btree *pBt = db->aDb[i].pBt;
161899 if( pBt && sqlite3BtreeIsInTrans(pBt) ){
161900 Pager *pPager = sqlite3BtreePager(pBt);
161901 rc = sqlite3PagerFlush(pPager);
161902 if( rc==SQLITE_BUSY ){
161903 bSeenBusy = 1;
161904 rc = SQLITE_OK;
161905 }
SQLITE_PRIVATE int sqlite3PagerFlush(Pager *)
Definition sqlite3.c:56293
SQLITE_PRIVATE int sqlite3BtreeIsInTrans(Btree *)
Definition sqlite3.c:74792
Btree * pBt
Definition sqlite3.c:16607
int nDb
Definition sqlite3.c:16825

◆ sqlite3_db_config()

SQLITE_API int sqlite3_db_config ( sqlite3 * db,
int op,
... )

Definition at line 161910 of file sqlite3.c.

161910 : rc);
161911}
161912
161913/*
161914** Configuration settings for an individual database connection
161915*/
161916SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
161917 va_list ap;
161918 int rc;
161919 va_start(ap, op);
161920 switch( op ){
161922 /* IMP: R-06824-28531 */
161923 /* IMP: R-36257-52125 */
161924 db->aDb[0].zDbSName = va_arg(ap,char*);
161925 rc = SQLITE_OK;
161926 break;
161927 }
161929 void *pBuf = va_arg(ap, void*); /* IMP: R-26835-10964 */
161930 int sz = va_arg(ap, int); /* IMP: R-47871-25994 */
161931 int cnt = va_arg(ap, int); /* IMP: R-04460-53386 */
161932 rc = setupLookaside(db, pBuf, sz, cnt);
161933 break;
161934 }
161935 default: {
161936 static const struct {
161937 int op; /* The opcode */
161938 u32 mask; /* Mask of the bit in sqlite3.flags to set/clear */
161939 } aFlagOp[] = {
161957 };
161958 unsigned int i;
161959 rc = SQLITE_ERROR; /* IMP: R-42790-23372 */
161960 for(i=0; i<ArraySize(aFlagOp); i++){
161961 if( aFlagOp[i].op==op ){
161962 int onoff = va_arg(ap, int);
161963 int *pRes = va_arg(ap, int*);
161964 u64 oldFlags = db->flags;
161965 if( onoff>0 ){
161966 db->flags |= aFlagOp[i].mask;
161967 }else if( onoff==0 ){
161968 db->flags &= ~(u64)aFlagOp[i].mask;
161969 }
161970 if( oldFlags!=db->flags ){
161972 }
161973 if( pRes ){
161974 *pRes = (db->flags & aFlagOp[i].mask)!=0;
161975 }
161976 rc = SQLITE_OK;
161977 break;
161978 }
161979 }
#define mask(n)
#define SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
Definition sqlite3.c:3382
#define SQLITE_LegacyAlter
Definition sqlite3.c:17005
#define SQLITE_DBCONFIG_DEFENSIVE
Definition sqlite3.c:3387
#define SQLITE_DBCONFIG_DQS_DDL
Definition sqlite3.c:3391
#define SQLITE_DBCONFIG_ENABLE_TRIGGER
Definition sqlite3.c:3380
#define SQLITE_EnableQPSG
Definition sqlite3.c:17002
SQLITE_API int sqlite3_db_config(sqlite3 *, int op,...)
Definition sqlite3.c:161910
#define SQLITE_Fts3Tokenizer
Definition sqlite3.c:17001
#define SQLITE_DBCONFIG_ENABLE_FKEY
Definition sqlite3.c:3379
#define SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
Definition sqlite3.c:3381
#define SQLITE_DqsDDL
Definition sqlite3.c:17008
#define SQLITE_EnableView
Definition sqlite3.c:17010
#define SQLITE_Defensive
Definition sqlite3.c:17007
#define SQLITE_ResetDatabase
Definition sqlite3.c:17004
#define SQLITE_DBCONFIG_TRUSTED_SCHEMA
Definition sqlite3.c:3394
#define SQLITE_DBCONFIG_RESET_DATABASE
Definition sqlite3.c:3386
#define SQLITE_DBCONFIG_DQS_DML
Definition sqlite3.c:3390
#define SQLITE_WriteSchema
Definition sqlite3.c:16978
#define SQLITE_DBCONFIG_ENABLE_QPSG
Definition sqlite3.c:3384
static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt)
Definition sqlite3.c:161743
#define SQLITE_EnableTrigger
Definition sqlite3.c:16997
SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3 *, int)
Definition sqlite3.c:82779
#define SQLITE_DBCONFIG_WRITABLE_SCHEMA
Definition sqlite3.c:3388
#define SQLITE_NoSchemaError
Definition sqlite3.c:17006
#define SQLITE_TriggerEQP
Definition sqlite3.c:17003
#define SQLITE_DqsDML
Definition sqlite3.c:17009
#define SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
Definition sqlite3.c:3389
#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
Definition sqlite3.c:3383
#define SQLITE_TrustedSchema
Definition sqlite3.c:16985
#define SQLITE_LegacyFileFmt
Definition sqlite3.c:16979
#define SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
Definition sqlite3.c:3393
#define SQLITE_NoCkptOnClose
Definition sqlite3.c:16990
#define SQLITE_DBCONFIG_LOOKASIDE
Definition sqlite3.c:3378
#define SQLITE_DBCONFIG_ENABLE_VIEW
Definition sqlite3.c:3392
#define SQLITE_DBCONFIG_MAINDBNAME
Definition sqlite3.c:3377
#define SQLITE_LoadExtension
Definition sqlite3.c:16995
#define SQLITE_DBCONFIG_TRIGGER_EQP
Definition sqlite3.c:3385

◆ sqlite3_db_filename()

SQLITE_API const char * sqlite3_db_filename ( sqlite3 * db,
const char * zDbName )

Definition at line 165384 of file sqlite3.c.

165390 {
165391 Btree *pBt;
165392#ifdef SQLITE_ENABLE_API_ARMOR
165393 if( !sqlite3SafetyCheckOk(db) ){
165394 (void)SQLITE_MISUSE_BKPT;

Referenced by db_db_filename().

◆ sqlite3_db_handle()

SQLITE_API sqlite3 * sqlite3_db_handle ( sqlite3_stmt * pStmt)

Definition at line 84646 of file sqlite3.c.

◆ sqlite3_db_mutex()

SQLITE_API sqlite3_mutex * sqlite3_db_mutex ( sqlite3 * db)

Definition at line 161843 of file sqlite3.c.

161849 {
161850#ifdef SQLITE_ENABLE_API_ARMOR
161851 if( !sqlite3SafetyCheckOk(db) ){

◆ sqlite3_db_readonly()

SQLITE_API int sqlite3_db_readonly ( sqlite3 * db,
const char * zDbName )

Definition at line 165400 of file sqlite3.c.

165406 {
165407 Btree *pBt;
165408#ifdef SQLITE_ENABLE_API_ARMOR
165409 if( !sqlite3SafetyCheckOk(db) ){
165410 (void)SQLITE_MISUSE_BKPT;

◆ sqlite3_db_release_memory()

SQLITE_API int sqlite3_db_release_memory ( sqlite3 * db)

Definition at line 161857 of file sqlite3.c.

161863 {
161864 int i;
161865
161866#ifdef SQLITE_ENABLE_API_ARMOR
161867 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
161868#endif
161871 for(i=0; i<db->nDb; i++){
161872 Btree *pBt = db->aDb[i].pBt;
161873 if( pBt ){
161874 Pager *pPager = sqlite3BtreePager(pBt);
161875 sqlite3PagerShrink(pPager);
SQLITE_PRIVATE void sqlite3PagerShrink(Pager *)
Definition sqlite3.c:55186

Referenced by sqlite3Pragma().

◆ sqlite3_db_status()

SQLITE_API int sqlite3_db_status ( sqlite3 * db,
int op,
int * pCur,
int * pHiwtr,
int resetFlg )

Definition at line 21515 of file sqlite3.c.

21526 {
21527 int rc = SQLITE_OK; /* Return code */
21528#ifdef SQLITE_ENABLE_API_ARMOR
21529 if( !sqlite3SafetyCheckOk(db) || pCurrent==0|| pHighwater==0 ){
21530 return SQLITE_MISUSE_BKPT;
21531 }
21532#endif
21534 switch( op ){
21536 *pCurrent = sqlite3LookasideUsed(db, pHighwater);
21537 if( resetFlag ){
21538 LookasideSlot *p = db->lookaside.pFree;
21539 if( p ){
21540 while( p->pNext ) p = p->pNext;
21541 p->pNext = db->lookaside.pInit;
21542 db->lookaside.pInit = db->lookaside.pFree;
21543 db->lookaside.pFree = 0;
21544 }
21545#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
21546 p = db->lookaside.pSmallFree;
21547 if( p ){
21548 while( p->pNext ) p = p->pNext;
21549 p->pNext = db->lookaside.pSmallInit;
21551 db->lookaside.pSmallFree = 0;
21552 }
21553#endif
21554 }
21555 break;
21556 }
21557
21564 assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)>=0 );
21565 assert( (op-SQLITE_DBSTATUS_LOOKASIDE_HIT)<3 );
21566 *pCurrent = 0;
21567 *pHighwater = db->lookaside.anStat[op - SQLITE_DBSTATUS_LOOKASIDE_HIT];
21568 if( resetFlag ){
21570 }
21571 break;
21572 }
21573
21574 /*
21575 ** Return an approximation for the amount of memory currently used
21576 ** by all pagers associated with the given database connection. The
21577 ** highwater mark is meaningless and is returned as zero.
21578 */
21581 int totalUsed = 0;
21582 int i;
21584 for(i=0; i<db->nDb; i++){
21585 Btree *pBt = db->aDb[i].pBt;
21586 if( pBt ){
21587 Pager *pPager = sqlite3BtreePager(pBt);
21588 int nByte = sqlite3PagerMemUsed(pPager);
21590 nByte = nByte / sqlite3BtreeConnectionCount(pBt);
21591 }
21592 totalUsed += nByte;
21593 }
21594 }
21596 *pCurrent = totalUsed;
21597 *pHighwater = 0;
21598 break;
21599 }
21600
21601 /*
21602 ** *pCurrent gets an accurate estimate of the amount of memory used
21603 ** to store the schema for all databases (main, temp, and any ATTACHed
21604 ** databases. *pHighwater is set to zero.
21605 */
21607 int i; /* Used to iterate through schemas */
21608 int nByte = 0; /* Used to accumulate return value */
21609
21611 db->pnBytesFreed = &nByte;
21612 for(i=0; i<db->nDb; i++){
21613 Schema *pSchema = db->aDb[i].pSchema;
21614 if( ALWAYS(pSchema!=0) ){
21615 HashElem *p;
21616
21617 nByte += sqlite3GlobalConfig.m.xRoundup(sizeof(HashElem)) * (
21618 pSchema->tblHash.count
21619 + pSchema->trigHash.count
21620 + pSchema->idxHash.count
21621 + pSchema->fkeyHash.count
21622 );
21623 nByte += sqlite3_msize(pSchema->tblHash.ht);
21624 nByte += sqlite3_msize(pSchema->trigHash.ht);
21625 nByte += sqlite3_msize(pSchema->idxHash.ht);
21626 nByte += sqlite3_msize(pSchema->fkeyHash.ht);
21627
21628 for(p=sqliteHashFirst(&pSchema->trigHash); p; p=sqliteHashNext(p)){
21630 }
21631 for(p=sqliteHashFirst(&pSchema->tblHash); p; p=sqliteHashNext(p)){
21633 }
21634 }
21635 }
21636 db->pnBytesFreed = 0;
21638
21639 *pHighwater = 0;
21640 *pCurrent = nByte;
21641 break;
21642 }
21643
21644 /*
21645 ** *pCurrent gets an accurate estimate of the amount of memory used
21646 ** to store all prepared statements.
21647 ** *pHighwater is set to zero.
21648 */
21650 struct Vdbe *pVdbe; /* Used to iterate through VMs */
21651 int nByte = 0; /* Used to accumulate return value */
21652
21653 db->pnBytesFreed = &nByte;
21654 for(pVdbe=db->pVdbe; pVdbe; pVdbe=pVdbe->pNext){
21655 sqlite3VdbeClearObject(db, pVdbe);
21656 sqlite3DbFree(db, pVdbe);
21657 }
21658 db->pnBytesFreed = 0;
21659
21660 *pHighwater = 0; /* IMP: R-64479-57858 */
21661 *pCurrent = nByte;
21662
21663 break;
21664 }
21665
21666 /*
21667 ** Set *pCurrent to the total cache hits or misses encountered by all
21668 ** pagers the database handle is connected to. *pHighwater is always set
21669 ** to zero.
21670 */
21673 /* no break */ deliberate_fall_through
21677 int i;
21678 int nRet = 0;
21681
21682 for(i=0; i<db->nDb; i++){
21683 if( db->aDb[i].pBt ){
21684 Pager *pPager = sqlite3BtreePager(db->aDb[i].pBt);
21685 sqlite3PagerCacheStat(pPager, op, resetFlag, &nRet);
21686 }
21687 }
21688 *pHighwater = 0; /* IMP: R-42420-56072 */
21689 /* IMP: R-54100-20147 */
21690 /* IMP: R-29431-39229 */
21691 *pCurrent = nRet;
21692 break;
21693 }
21694
21695 /* Set *pCurrent to non-zero if there are unresolved deferred foreign
21696 ** key constraints. Set *pCurrent to zero if all foreign key constraints
21697 ** have been satisfied. The *pHighwater is always set to zero.
21698 */
21700 *pHighwater = 0; /* IMP: R-11967-56545 */
21701 *pCurrent = db->nDeferredImmCons>0 || db->nDeferredCons>0;
21702 break;
21703 }
21704
21705 default: {
21706 rc = SQLITE_ERROR;
#define SQLITE_DBSTATUS_CACHE_HIT
Definition sqlite3.c:9204
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE
Definition sqlite3.c:9202
#define sqliteHashNext(E)
Definition sqlite3.c:13927
#define SQLITE_DBSTATUS_STMT_USED
Definition sqlite3.c:9200
SQLITE_PRIVATE int sqlite3LookasideUsed(sqlite3 *, int *)
Definition sqlite3.c:21501
SQLITE_API sqlite3_uint64 sqlite3_msize(void *)
Definition sqlite3.c:27683
#define SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL
Definition sqlite3.c:9203
SQLITE_PRIVATE void sqlite3PagerCacheStat(Pager *, int, int, int *)
Definition sqlite3.c:58474
SQLITE_PRIVATE void sqlite3DeleteTrigger(sqlite3 *, Trigger *)
Definition sqlite3.c:136938
#define SQLITE_DBSTATUS_CACHE_USED
Definition sqlite3.c:9198
#define ALWAYS(X)
Definition sqlite3.c:13736
#define sqliteHashFirst(H)
Definition sqlite3.c:13926
#define sqliteHashData(E)
Definition sqlite3.c:13928
#define SQLITE_DBSTATUS_LOOKASIDE_HIT
Definition sqlite3.c:9201
SQLITE_PRIVATE int sqlite3PagerMemUsed(Pager *)
Definition sqlite3.c:58427
SQLITE_PRIVATE void sqlite3DeleteTable(sqlite3 *, Table *)
Definition sqlite3.c:111102
SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *, Vdbe *)
Definition sqlite3.c:81168
#define SQLITE_DBSTATUS_SCHEMA_USED
Definition sqlite3.c:9199
#define SQLITE_DBSTATUS_CACHE_USED_SHARED
Definition sqlite3.c:9208
SQLITE_PRIVATE int sqlite3BtreeConnectionCount(Btree *)
Definition sqlite3.c:75043
#define SQLITE_DBSTATUS_CACHE_WRITE
Definition sqlite3.c:9206
#define SQLITE_DBSTATUS_DEFERRED_FKS
Definition sqlite3.c:9207
#define SQLITE_DBSTATUS_CACHE_SPILL
Definition sqlite3.c:9209
#define SQLITE_DBSTATUS_LOOKASIDE_USED
Definition sqlite3.c:9197
#define SQLITE_DBSTATUS_CACHE_MISS
Definition sqlite3.c:9205
#define deliberate_fall_through
Definition sqlite3.c:1008
Schema * pSchema
Definition sqlite3.c:16610
unsigned int count
Definition sqlite3.c:13886
struct Hash::_ht * ht
LookasideSlot * pNext
Definition sqlite3.c:16737
LookasideSlot * pInit
Definition sqlite3.c:16725
LookasideSlot * pFree
Definition sqlite3.c:16726
LookasideSlot * pSmallInit
Definition sqlite3.c:16728
u32 anStat[3]
Definition sqlite3.c:16724
LookasideSlot * pSmallFree
Definition sqlite3.c:16729
Hash trigHash
Definition sqlite3.c:16635
Hash idxHash
Definition sqlite3.c:16634
Hash fkeyHash
Definition sqlite3.c:16636
Hash tblHash
Definition sqlite3.c:16633
Vdbe * pNext
Definition sqlite3.c:21085
int rc
Definition sqlite3.c:21093
i64 nDeferredCons
Definition sqlite3.c:16932
int * pnBytesFreed
Definition sqlite3.c:16934
struct Vdbe * pVdbe
Definition sqlite3.c:16821
i64 nDeferredImmCons
Definition sqlite3.c:16933
Lookaside lookaside
Definition sqlite3.c:16906

◆ sqlite3_declare_vtab()

SQLITE_API int sqlite3_declare_vtab ( sqlite3 * db,
const char * zSQL )

Definition at line 140366 of file sqlite3.c.

140372 {
140373 VtabCtx *pCtx;
140374 int rc = SQLITE_OK;
140375 Table *pTab;
140376 char *zErr = 0;
140377 Parse sParse;
140378
140379#ifdef SQLITE_ENABLE_API_ARMOR
140380 if( !sqlite3SafetyCheckOk(db) || zCreateTable==0 ){
140381 return SQLITE_MISUSE_BKPT;
140382 }
140383#endif
140385 pCtx = db->pVtabCtx;
140386 if( !pCtx || pCtx->bDeclared ){
140389 return SQLITE_MISUSE_BKPT;
140390 }
140391 pTab = pCtx->pTab;
140392 assert( IsVirtual(pTab) );
140393
140394 memset(&sParse, 0, sizeof(sParse));
140396 sParse.db = db;
140397 sParse.nQueryLoop = 1;
140398 if( SQLITE_OK==sqlite3RunParser(&sParse, zCreateTable, &zErr)
140399 && sParse.pNewTable
140400 && !db->mallocFailed
140401 && !sParse.pNewTable->pSelect
140402 && !IsVirtual(sParse.pNewTable)
140403 ){
140404 if( !pTab->aCol ){
140405 Table *pNew = sParse.pNewTable;
140406 Index *pIdx;
140407 pTab->aCol = pNew->aCol;
140408 pTab->nCol = pNew->nCol;
140410 pNew->nCol = 0;
140411 pNew->aCol = 0;
140412 assert( pTab->pIndex==0 );
140413 assert( HasRowid(pNew) || sqlite3PrimaryKeyIndex(pNew)!=0 );
140414 if( !HasRowid(pNew)
140415 && pCtx->pVTable->pMod->pModule->xUpdate!=0
140416 && sqlite3PrimaryKeyIndex(pNew)->nKeyCol!=1
140417 ){
140418 /* WITHOUT ROWID virtual tables must either be read-only (xUpdate==0)
140419 ** or else must have a single-column PRIMARY KEY */
140420 rc = SQLITE_ERROR;
140421 }
140422 pIdx = pNew->pIndex;
140423 if( pIdx ){
140424 assert( pIdx->pNext==0 );
140425 pTab->pIndex = pIdx;
140426 pNew->pIndex = 0;
140427 pIdx->pTable = pTab;
140428 }
140429 }
140430 pCtx->bDeclared = 1;
140431 }else{
140432 sqlite3ErrorWithMsg(db, SQLITE_ERROR, (zErr ? "%s" : 0), zErr);
140433 sqlite3DbFree(db, zErr);
140434 rc = SQLITE_ERROR;
140435 }
140436 sParse.eParseMode = PARSE_MODE_NORMAL;
140437
140438 if( sParse.pVdbe ){
140439 sqlite3VdbeFinalize(sParse.pVdbe);
140440 }
140441 sqlite3DeleteTable(db, sParse.pNewTable);
140442 sqlite3ParserReset(&sParse);
SQLITE_PRIVATE int sqlite3RunParser(Parse *, const char *, char **)
Definition sqlite3.c:160294
#define PARSE_MODE_NORMAL
Definition sqlite3.c:18781
#define TF_NoVisibleRowid
Definition sqlite3.c:17545
#define SQLITE_MISUSE
Definition sqlite3.c:1491
#define TF_WithoutRowid
Definition sqlite3.c:17543
#define PARSE_MODE_DECLARE_VTAB
Definition sqlite3.c:18782
SQLITE_PRIVATE void sqlite3ParserReset(Parse *)
Definition sqlite3.c:128891
SQLITE_PRIVATE Index * sqlite3PrimaryKeyIndex(Table *)
Definition sqlite3.c:111310
Table * pTable
Definition sqlite3.c:17780
const sqlite3_module * pModule
Definition sqlite3.c:17306
Table * pNewTable
Definition sqlite3.c:18762
Vdbe * pVdbe
Definition sqlite3.c:18682
u8 eParseMode
Definition sqlite3.c:18751
u32 nQueryLoop
Definition sqlite3.c:18723
u32 tabFlags
Definition sqlite3.c:17498
Module * pMod
Definition sqlite3.c:17468
int bDeclared
Definition sqlite3.c:139599
Table * pTab
Definition sqlite3.c:139597
VTable * pVTable
Definition sqlite3.c:139596
int(* xUpdate)(sqlite3_vtab *, int, sqlite3_value **, sqlite3_int64 *)
Definition sqlite3.c:7777
VtabCtx * pVtabCtx
Definition sqlite3.c:16919

References Table::aCol, VtabCtx::bDeclared, Parse::db, Parse::eParseMode, HasRowid, IsVirtual, sqlite3::mallocFailed, sqlite3::mutex, Table::nCol, Parse::nQueryLoop, PARSE_MODE_DECLARE_VTAB, PARSE_MODE_NORMAL, Table::pIndex, VTable::pMod, Module::pModule, Parse::pNewTable, Index::pNext, Table::pSelect, VtabCtx::pTab, Index::pTable, Parse::pVdbe, sqlite3::pVtabCtx, VtabCtx::pVTable, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3ApiExit(), sqlite3DbFree(), sqlite3DeleteTable(), sqlite3Error(), sqlite3ErrorWithMsg(), sqlite3ParserReset(), sqlite3PrimaryKeyIndex(), sqlite3RunParser(), sqlite3SafetyCheckOk(), sqlite3VdbeFinalize(), SQLITE_ERROR, SQLITE_MISUSE, SQLITE_MISUSE_BKPT, SQLITE_OK, Table::tabFlags, TF_NoVisibleRowid, TF_WithoutRowid, and sqlite3_module::xUpdate.

◆ sqlite3_deserialize()

SQLITE_API int sqlite3_deserialize ( sqlite3 * db,
const char * zSchema,
unsigned char * pData,
sqlite3_int64 szDb,
sqlite3_int64 szBuf,
unsigned mFlags )

◆ sqlite3_drop_modules()

SQLITE_API int sqlite3_drop_modules ( sqlite3 * db,
const char ** azKeep )

Definition at line 139711 of file sqlite3.c.

139717 {
139718 HashElem *pThis, *pNext;
139719#ifdef SQLITE_ENABLE_API_ARMOR
139720 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
139721#endif
139722 for(pThis=sqliteHashFirst(&db->aModule); pThis; pThis=pNext){
139723 Module *pMod = (Module*)sqliteHashData(pThis);
139724 pNext = sqliteHashNext(pThis);
139725 if( azNames ){
139726 int ii;
139727 for(ii=0; azNames[ii]!=0 && strcmp(azNames[ii],pMod->zName)!=0; ii++){}
const char * zName
Definition sqlite3.c:17307
Hash aModule
Definition sqlite3.c:16918

◆ sqlite3_enable_load_extension()

SQLITE_API int sqlite3_enable_load_extension ( sqlite3 * db,
int onoff )

Definition at line 124907 of file sqlite3.c.

124913 {
124915 if( onoff ){
#define SQLITE_LoadExtFunc
Definition sqlite3.c:16996

Referenced by db_load_extension().

◆ sqlite3_enable_shared_cache()

SQLITE_API int sqlite3_enable_shared_cache ( int enable)

Definition at line 64566 of file sqlite3.c.

References sqlite3GlobalConfig, and SQLITE_OK.

◆ sqlite3_errcode()

SQLITE_API int sqlite3_errcode ( sqlite3 * db)

Definition at line 163553 of file sqlite3.c.

163559 {
163560 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
163561 return SQLITE_MISUSE_BKPT;
SQLITE_PRIVATE int sqlite3SafetyCheckSickOrOk(sqlite3 *)
Definition sqlite3.c:32559

References sqlite3SafetyCheckSickOrOk(), and SQLITE_MISUSE_BKPT.

Referenced by db_errcode(), db_prepare(), dbvm_reset(), lsqlite_do_open(), and openDatabase().

◆ sqlite3_errmsg()

SQLITE_API const char * sqlite3_errmsg ( sqlite3 * db)

Definition at line 163483 of file sqlite3.c.

163489 {
163490 const char *z;
163491 if( !db ){
163493 }
163494 if( !sqlite3SafetyCheckSickOrOk(db) ){
163496 }
163498 if( db->mallocFailed ){
163500 }else{
163501 testcase( db->pErr==0 );
163502 z = db->errCode ? (char*)sqlite3_value_text(db->pErr) : 0;
163503 assert( !db->mallocFailed );
163504 if( z==0 ){
SQLITE_PRIVATE const char * sqlite3ErrStr(int)
Definition sqlite3.c:162539
int errCode
Definition sqlite3.c:16832
sqlite3_value * pErr
Definition sqlite3.c:16901

Referenced by blobSeekToRow(), db_do_next_row(), db_do_rows(), db_errmsg(), execSqlF(), lsqlite_do_open(), sqlite3_exec(), and sqlite3InitCallback().

◆ sqlite3_errmsg16()

SQLITE_API const void * sqlite3_errmsg16 ( sqlite3 * db)

Definition at line 163511 of file sqlite3.c.

163517 {
163518 static const u16 outOfMem[] = {
163519 'o', 'u', 't', ' ', 'o', 'f', ' ', 'm', 'e', 'm', 'o', 'r', 'y', 0
163520 };
163521 static const u16 misuse[] = {
163522 'b', 'a', 'd', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', ' ',
163523 'o', 'r', ' ', 'o', 't', 'h', 'e', 'r', ' ', 'A', 'P', 'I', ' ',
163524 'm', 'i', 's', 'u', 's', 'e', 0
163525 };
163526
163527 const void *z;
163528 if( !db ){
163529 return (void *)outOfMem;
163530 }
163531 if( !sqlite3SafetyCheckSickOrOk(db) ){
163532 return (void *)misuse;
163533 }
163535 if( db->mallocFailed ){
163536 z = (void *)outOfMem;
163537 }else{
163538 z = sqlite3_value_text16(db->pErr);
163539 if( z==0 ){
163541 z = sqlite3_value_text16(db->pErr);
163542 }
163543 /* A malloc() may have failed within the call to sqlite3_value_text16()
163544 ** above. If this is the case, then the db->mallocFailed flag needs to
163545 ** be cleared before returning. Do this directly, instead of via
163546 ** sqlite3ApiExit(), to avoid setting the database handle error message.
UINT16_TYPE u16
Definition sqlite3.c:14332

References sqlite3::errCode, sqlite3::mallocFailed, sqlite3::mutex, sqlite3::pErr, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3_value_text16(), sqlite3ErrorWithMsg(), sqlite3ErrStr(), sqlite3OomClear(), and sqlite3SafetyCheckSickOrOk().

◆ sqlite3_errstr()

SQLITE_API const char * sqlite3_errstr ( int rc)

Definition at line 163580 of file sqlite3.c.

References sqlite3ErrStr().

◆ sqlite3_exec()

SQLITE_API int sqlite3_exec ( sqlite3 * db,
const char * sql,
int(*)(void *, int, char **, char **) callback,
void * pArg,
char ** errmsg )

Definition at line 123455 of file sqlite3.c.

123467 {
123468 int rc = SQLITE_OK; /* Return code */
123469 const char *zLeftover; /* Tail of unprocessed SQL */
123470 sqlite3_stmt *pStmt = 0; /* The current SQL statement */
123471 char **azCols = 0; /* Names of result columns */
123472 int callbackIsInit; /* True if callback data is initialized */
123473
123474 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
123475 if( zSql==0 ) zSql = "";
123476
123478 sqlite3Error(db, SQLITE_OK);
123479 while( rc==SQLITE_OK && zSql[0] ){
123480 int nCol = 0;
123481 char **azVals = 0;
123482
123483 pStmt = 0;
123484 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
123485 assert( rc==SQLITE_OK || pStmt==0 );
123486 if( rc!=SQLITE_OK ){
123487 continue;
123488 }
123489 if( !pStmt ){
123490 /* this happens for a comment or white-space */
123491 zSql = zLeftover;
123492 continue;
123493 }
123494 callbackIsInit = 0;
123495
123496 while( 1 ){
123497 int i;
123498 rc = sqlite3_step(pStmt);
123499
123500 /* Invoke the callback function if required */
123501 if( xCallback && (SQLITE_ROW==rc ||
123502 (SQLITE_DONE==rc && !callbackIsInit
123503 && db->flags&SQLITE_NullCallback)) ){
123504 if( !callbackIsInit ){
123505 nCol = sqlite3_column_count(pStmt);
123506 azCols = sqlite3DbMallocRaw(db, (2*nCol+1)*sizeof(const char*));
123507 if( azCols==0 ){
123508 goto exec_out;
123509 }
123510 for(i=0; i<nCol; i++){
123511 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
123512 /* sqlite3VdbeSetColName() installs column names as UTF8
123513 ** strings so there is no way for sqlite3_column_name() to fail. */
123514 assert( azCols[i]!=0 );
123515 }
123516 callbackIsInit = 1;
123517 }
123518 if( rc==SQLITE_ROW ){
123519 azVals = &azCols[nCol];
123520 for(i=0; i<nCol; i++){
123521 azVals[i] = (char *)sqlite3_column_text(pStmt, i);
123522 if( !azVals[i] && sqlite3_column_type(pStmt, i)!=SQLITE_NULL ){
123523 sqlite3OomFault(db);
123524 goto exec_out;
123525 }
123526 }
123527 azVals[i] = 0;
123528 }
123529 if( xCallback(pArg, nCol, azVals, azCols) ){
123530 /* EVIDENCE-OF: R-38229-40159 If the callback function to
123531 ** sqlite3_exec() returns non-zero, then sqlite3_exec() will
123532 ** return SQLITE_ABORT. */
123533 rc = SQLITE_ABORT;
123534 sqlite3VdbeFinalize((Vdbe *)pStmt);
123535 pStmt = 0;
123537 goto exec_out;
123538 }
123539 }
123540
123541 if( rc!=SQLITE_ROW ){
123542 rc = sqlite3VdbeFinalize((Vdbe *)pStmt);
123543 pStmt = 0;
123544 zSql = zLeftover;
123545 while( sqlite3Isspace(zSql[0]) ) zSql++;
123546 break;
123547 }
123548 }
123549
123550 sqlite3DbFree(db, azCols);
123551 azCols = 0;
123552 }
123553
123554exec_out:
123555 if( pStmt ) sqlite3VdbeFinalize((Vdbe *)pStmt);
123556 sqlite3DbFree(db, azCols);
123557
123558 rc = sqlite3ApiExit(db, rc);
123559 if( rc!=SQLITE_OK && pzErrMsg ){
123560 *pzErrMsg = sqlite3DbStrDup(0, sqlite3_errmsg(db));
123561 if( *pzErrMsg==0 ){
123562 rc = SQLITE_NOMEM_BKPT;
123564 }
123565 }else if( pzErrMsg ){
123566 *pzErrMsg = 0;
SQLITE_PRIVATE char * sqlite3DbStrDup(sqlite3 *, const char *)
Definition sqlite3.c:28018
SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt)
Definition sqlite3.c:83978
SQLITE_API int sqlite3_column_type(sqlite3_stmt *, int iCol)
Definition sqlite3.c:84147
#define SQLITE_NullCallback
Definition sqlite3.c:16986
SQLITE_PRIVATE void sqlite3OomFault(sqlite3 *)
Definition sqlite3.c:28071
#define SQLITE_ROW
Definition sqlite3.c:1499
SQLITE_API int sqlite3_prepare_v2(sqlite3 *db, const char *zSql, int nByte, sqlite3_stmt **ppStmt, const char **pzTail)
Definition sqlite3.c:129146
SQLITE_PRIVATE void * sqlite3DbMallocRaw(sqlite3 *, u64)
Definition sqlite3.c:27893
SQLITE_API int sqlite3_step(sqlite3_stmt *)
Definition sqlite3.c:83730
#define sqlite3Isspace(x)
Definition sqlite3.c:19319
SQLITE_API const char * sqlite3_column_name(sqlite3_stmt *, int N)
Definition sqlite3.c:84218
SQLITE_API const char * sqlite3_errmsg(sqlite3 *)
Definition sqlite3.c:163483
SQLITE_PRIVATE int sqlite3ApiExit(sqlite3 *db, int)
Definition sqlite3.c:28121
SQLITE_API const unsigned char * sqlite3_column_text(sqlite3_stmt *, int iCol)
Definition sqlite3.c:84126
#define SQLITE_NULL
Definition sqlite3.c:5794

References sqlite3::errMask, sqlite3::flags, sqlite3::mutex, sqlite3_column_count(), sqlite3_column_name(), sqlite3_column_text(), sqlite3_column_type(), sqlite3_errmsg(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3_prepare_v2(), sqlite3_step(), sqlite3ApiExit(), sqlite3DbFree(), sqlite3DbMallocRaw(), sqlite3DbStrDup(), sqlite3Error(), sqlite3Isspace, sqlite3OomFault(), sqlite3SafetyCheckOk(), sqlite3VdbeFinalize(), SQLITE_ABORT, SQLITE_DONE, SQLITE_MISUSE_BKPT, SQLITE_NOMEM, SQLITE_NOMEM_BKPT, SQLITE_NULL, SQLITE_NullCallback, SQLITE_OK, and SQLITE_ROW.

Referenced by db_exec(), lsqlite_open_ptr(), sqlite3_get_table(), sqlite3AnalysisLoad(), sqlite3InitOne(), and sqlite3VdbeExec().

◆ sqlite3_expanded_sql()

SQLITE_API char * sqlite3_expanded_sql ( sqlite3_stmt * pStmt)

Definition at line 84745 of file sqlite3.c.

84751 {
84752#ifdef SQLITE_OMIT_TRACE
84753 return 0;
84754#else
84755 char *z = 0;
84756 const char *zSql = sqlite3_sql(pStmt);
84757 if( zSql ){
84758 Vdbe *p = (Vdbe *)pStmt;
SQLITE_API const char * sqlite3_sql(sqlite3_stmt *pStmt)
Definition sqlite3.c:84731

References Vdbe::db, sqlite3::mutex, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3_sql(), and sqlite3VdbeExpandSql().

◆ sqlite3_expired()

SQLITE_API SQLITE_DEPRECATED int sqlite3_expired ( sqlite3_stmt * pStmt)

Definition at line 83009 of file sqlite3.c.

References Vdbe::expired.

◆ sqlite3_extended_errcode()

SQLITE_API int sqlite3_extended_errcode ( sqlite3 * db)

Definition at line 163562 of file sqlite3.c.

163563 {
163564 return SQLITE_NOMEM_BKPT;
163565 }
163566 return db->errCode & db->errMask;
163567}
163569 if( db && !sqlite3SafetyCheckSickOrOk(db) ){
163570 return SQLITE_MISUSE_BKPT;
SQLITE_API int sqlite3_extended_errcode(sqlite3 *db)
Definition sqlite3.c:163562
int errMask
Definition sqlite3.c:16833

◆ sqlite3_extended_result_codes()

SQLITE_API int sqlite3_extended_result_codes ( sqlite3 * db,
int onoff )

Definition at line 164768 of file sqlite3.c.

164774 {
164775#ifdef SQLITE_ENABLE_API_ARMOR
164776 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;

◆ sqlite3_file_control()

SQLITE_API int sqlite3_file_control ( sqlite3 * db,
const char * zDbName,
int op,
void * pArg )

Definition at line 164781 of file sqlite3.c.

164787 {
164788 int rc = SQLITE_ERROR;
164789 Btree *pBtree;
164790
164791#ifdef SQLITE_ENABLE_API_ARMOR
164792 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
164793#endif
164795 pBtree = sqlite3DbNameToBtree(db, zDbName);
164796 if( pBtree ){
164797 Pager *pPager;
164798 sqlite3_file *fd;
164799 sqlite3BtreeEnter(pBtree);
164800 pPager = sqlite3BtreePager(pBtree);
164801 assert( pPager!=0 );
164802 fd = sqlite3PagerFile(pPager);
164803 assert( fd!=0 );
164804 if( op==SQLITE_FCNTL_FILE_POINTER ){
164805 *(sqlite3_file**)pArg = fd;
164806 rc = SQLITE_OK;
164807 }else if( op==SQLITE_FCNTL_VFS_POINTER ){
164808 *(sqlite3_vfs**)pArg = sqlite3PagerVfs(pPager);
164809 rc = SQLITE_OK;
164810 }else if( op==SQLITE_FCNTL_JOURNAL_POINTER ){
164811 *(sqlite3_file**)pArg = sqlite3PagerJrnlFile(pPager);
164812 rc = SQLITE_OK;
164813 }else if( op==SQLITE_FCNTL_DATA_VERSION ){
164814 *(unsigned int*)pArg = sqlite3PagerDataVersion(pPager);
164815 rc = SQLITE_OK;
164816 }else if( op==SQLITE_FCNTL_RESERVE_BYTES ){
164817 int iNew = *(int*)pArg;
164818 *(int*)pArg = sqlite3BtreeGetRequestedReserve(pBtree);
164819 if( iNew>=0 && iNew<=255 ){
164820 sqlite3BtreeSetPageSize(pBtree, 0, iNew, 0);
164821 }
164822 rc = SQLITE_OK;
164823 }else{
164824 rc = sqlite3OsFileControl(fd, op, pArg);
#define SQLITE_FCNTL_DATA_VERSION
Definition sqlite3.c:2212
SQLITE_PRIVATE Btree * sqlite3DbNameToBtree(sqlite3 *, const char *)
Definition sqlite3.c:165375
#define SQLITE_FCNTL_FILE_POINTER
Definition sqlite3.c:2185
SQLITE_PRIVATE sqlite3_vfs * sqlite3PagerVfs(Pager *)
Definition sqlite3.c:58685
#define SQLITE_FCNTL_VFS_POINTER
Definition sqlite3.c:2204
SQLITE_PRIVATE int sqlite3OsFileControl(sqlite3_file *, int, void *)
Definition sqlite3.c:23088
SQLITE_PRIVATE sqlite3_file * sqlite3PagerJrnlFile(Pager *)
Definition sqlite3.c:58702
SQLITE_PRIVATE int sqlite3BtreeGetRequestedReserve(Btree *)
Definition sqlite3.c:67396
#define SQLITE_FCNTL_JOURNAL_POINTER
Definition sqlite3.c:2205
SQLITE_PRIVATE u32 sqlite3PagerDataVersion(Pager *)
Definition sqlite3.c:53456
SQLITE_PRIVATE int sqlite3BtreeSetPageSize(Btree *p, int nPagesize, int nReserve, int eFix)
Definition sqlite3.c:67334
#define SQLITE_FCNTL_RESERVE_BYTES
Definition sqlite3.c:2215

Referenced by sqlite3Pragma(), and sqlite3VdbeExec().

◆ sqlite3_filename_database()

SQLITE_API const char * sqlite3_filename_database ( const char * zFilename)

Definition at line 165350 of file sqlite3.c.

◆ sqlite3_filename_journal()

SQLITE_API const char * sqlite3_filename_journal ( const char * zFilename)

Definition at line 165353 of file sqlite3.c.

165356 {
165357 return databaseName(zFilename);
165358}
165359SQLITE_API const char *sqlite3_filename_journal(const char *zFilename){
165360 zFilename = databaseName(zFilename);
165361 zFilename += sqlite3Strlen30(zFilename) + 1;
static const char * databaseName(const char *zName)
Definition sqlite3.c:165215
SQLITE_API const char * sqlite3_filename_journal(const char *)
Definition sqlite3.c:165353

References databaseName().

◆ sqlite3_filename_wal()

SQLITE_API const char * sqlite3_filename_wal ( const char * zFilename)

Definition at line 165362 of file sqlite3.c.

165362 {
165363 zFilename += sqlite3Strlen30(zFilename) + 1;
165364 zFilename += sqlite3Strlen30(zFilename) + 1;
165365 }
165366 return zFilename + 1;
165367}
165368SQLITE_API const char *sqlite3_filename_wal(const char *zFilename){
165369#ifdef SQLITE_OMIT_WAL
165370 return 0;
SQLITE_API const char * sqlite3_filename_wal(const char *)
Definition sqlite3.c:165362

References sqlite3Strlen30().

◆ sqlite3_finalize()

SQLITE_API int sqlite3_finalize ( sqlite3_stmt * pStmt)

Definition at line 83080 of file sqlite3.c.

83086 {
83087 int rc;
83088 if( pStmt==0 ){
83089 /* IMPLEMENTATION-OF: R-57228-12904 Invoking sqlite3_finalize() on a NULL
83090 ** pointer is a harmless no-op. */
83091 rc = SQLITE_OK;
83092 }else{
83093 Vdbe *v = (Vdbe*)pStmt;
83094 sqlite3 *db = v->db;
83095 if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
83097 checkProfileCallback(db, v);
#define checkProfileCallback(DB, P)
Definition sqlite3.c:83065
static int vdbeSafety(Vdbe *p)
Definition sqlite3.c:83020

References checkProfileCallback, Vdbe::db, sqlite3::mutex, sqlite3_mutex_enter(), sqlite3ApiExit(), sqlite3LeaveMutexAndCloseZombie(), sqlite3VdbeFinalize(), SQLITE_MISUSE_BKPT, SQLITE_OK, and vdbeSafety().

Referenced by blobSeekToRow(), cleanupvm(), db_close_vm(), db_do_next_row(), and sqlite3InitCallback().

◆ sqlite3_free()

SQLITE_API void sqlite3_free ( void * p)

Definition at line 27692 of file sqlite3.c.

27697 {
27698 if( p==0 ) return; /* IMP: R-49053-54554 */
27700 assert( sqlite3MemdebugNoType(p, (u8)~MEMTYPE_HEAP) );
27701 if( sqlite3GlobalConfig.bMemstat ){
27705 sqlite3GlobalConfig.m.xFree(p);
SQLITE_PRIVATE void sqlite3StatusDown(int, int)
Definition sqlite3.c:21413
#define sqlite3MemdebugHasType(X, Y)
Definition sqlite3.c:20328
#define mem0
Definition sqlite3.c:27369
#define SQLITE_STATUS_MEMORY_USED
Definition sqlite3.c:9050
#define MEMTYPE_HEAP
Definition sqlite3.c:20331
#define sqlite3MemdebugNoType(X, Y)
Definition sqlite3.c:20329
SQLITE_PRIVATE int sqlite3MallocSize(void *)
Definition sqlite3.c:27643
#define SQLITE_STATUS_MALLOC_COUNT
Definition sqlite3.c:9059

Referenced by attachFunc(), btreeRestoreCursorPosition(), charFunc(), clearAllSharedCacheTableLocks(), closeUnixFile(), createFunctionApi(), db_load_extension(), findInodeInfo(), loadExt(), lsqlite_temp_directory(), openDatabase(), pager_delsuper(), pcache1Destroy(), pcache1ResizeHash(), pthreadMutexFree(), quoteFunc(), rehash(), releaseAllSavepoints(), releaseInodeInfo(), renameColumnParseError(), renameEditSql(), replaceFunc(), saveCursorKey(), setupLookaside(), sqlite3_backup_init(), sqlite3_free_filename(), sqlite3_get_table(), sqlite3_get_table_cb(), sqlite3_overload_function(), sqlite3AnalysisLoad(), sqlite3AutoLoadExtensions(), sqlite3BitvecBuiltinTest(), sqlite3BtreeIntegrityCheck(), sqlite3BtreeMovetoUnpacked(), sqlite3BtreeOpen(), sqlite3InvalidFunction(), sqlite3LeaveMutexAndCloseZombie(), sqlite3LoadExtension(), sqlite3NotPureFunc(), sqlite3OsInit(), sqlite3PagerClose(), sqlite3PagerOpen(), sqlite3Pragma(), sqlite3RunParser(), sqlite3VdbeExec(), sqlite3VdbeList(), sqlite3VdbeMemGrow(), sqlite3VtabImportErrmsg(), sqlite3WalOpen(), statGet(), unixFullPathname(), unixOpen(), unixOpenSharedMemory(), unixShmPurge(), unixShmUnmap(), vdbePmaWriterFinish(), vdbeSorterListToPMA(), vtabBestIndex(), vtabCallConstructor(), walBeginShmUnreliable(), walIndexRecover(), walIteratorInit(), walRewriteChecksums(), whereLoopAddVirtual(), and whereLoopAddVirtualOne().

◆ sqlite3_free_filename()

SQLITE_API void sqlite3_free_filename ( char * p)

Definition at line 165277 of file sqlite3.c.

References databaseName(), and sqlite3_free().

Referenced by attachFunc(), openDatabase(), and sqlite3ParseUri().

◆ sqlite3_free_table()

SQLITE_API void sqlite3_free_table ( char ** result)

Definition at line 136368 of file sqlite3.c.

136376 {
136377 if( azResult ){
136378 int i, n;
136379 azResult--;

Referenced by sqlite3_get_table().

◆ sqlite3_get_autocommit()

SQLITE_API int sqlite3_get_autocommit ( sqlite3 * db)

Definition at line 164561 of file sqlite3.c.

164567 {
164568#ifdef SQLITE_ENABLE_API_ARMOR
164569 if( !sqlite3SafetyCheckOk(db) ){

References sqlite3::autoCommit, sqlite3SafetyCheckOk(), and SQLITE_MISUSE_BKPT.

◆ sqlite3_get_auxdata()

SQLITE_API void * sqlite3_get_auxdata ( sqlite3_context * pCtx,
int N )

Definition at line 83888 of file sqlite3.c.

83890 : If iArg is negative then access a cache of
83891** auxiliary data pointers that is available to all functions within a
83892** single prepared statement. The iArg values must match.
83893*/
83894SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *pCtx, int iArg){
83895 AuxData *pAuxData;
83896
83897 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83898#if SQLITE_ENABLE_STAT4
83899 if( pCtx->pVdbe==0 ) return 0;
83900#else
83901 assert( pCtx->pVdbe!=0 );
83902#endif
83903 for(pAuxData=pCtx->pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){
static int statement(LexState *ls)
static const char * match(MatchState *ms, const char *s, const char *p)
SQLITE_API void * sqlite3_get_auxdata(sqlite3_context *, int N)
Definition sqlite3.c:83888
AuxData * pNextAux
Definition sqlite3.c:21017
AuxData * pAuxData
Definition sqlite3.c:21148

References sqlite3_value::db, AuxData::iAuxArg, AuxData::iAuxOp, sqlite3_context::iOp, sqlite3::mutex, AuxData::pAux, Vdbe::pAuxData, AuxData::pNextAux, sqlite3_context::pOut, sqlite3_context::pVdbe, and sqlite3_mutex_held().

◆ sqlite3_get_table()

SQLITE_API int sqlite3_get_table ( sqlite3 * db,
const char * zSql,
char *** pazResult,
int * pnRow,
int * pnColumn,
char ** pzErrmsg )

Definition at line 136299 of file sqlite3.c.

136312 {
136313 int rc;
136314 TabResult res;
136315
136316#ifdef SQLITE_ENABLE_API_ARMOR
136317 if( !sqlite3SafetyCheckOk(db) || pazResult==0 ) return SQLITE_MISUSE_BKPT;
136318#endif
136319 *pazResult = 0;
136320 if( pnColumn ) *pnColumn = 0;
136321 if( pnRow ) *pnRow = 0;
136322 if( pzErrMsg ) *pzErrMsg = 0;
136323 res.zErrMsg = 0;
136324 res.nRow = 0;
136325 res.nColumn = 0;
136326 res.nData = 1;
136327 res.nAlloc = 20;
136328 res.rc = SQLITE_OK;
136329 res.azResult = sqlite3_malloc64(sizeof(char*)*res.nAlloc );
136330 if( res.azResult==0 ){
136331 db->errCode = SQLITE_NOMEM;
136332 return SQLITE_NOMEM_BKPT;
136333 }
136334 res.azResult[0] = 0;
136335 rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
136336 assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
136337 res.azResult[0] = SQLITE_INT_TO_PTR(res.nData);
136338 if( (rc&0xff)==SQLITE_ABORT ){
136339 sqlite3_free_table(&res.azResult[1]);
136340 if( res.zErrMsg ){
136341 if( pzErrMsg ){
136342 sqlite3_free(*pzErrMsg);
136343 *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
136344 }
136345 sqlite3_free(res.zErrMsg);
136346 }
136347 db->errCode = res.rc; /* Assume 32-bit assignment is atomic */
136348 return res.rc;
136349 }
136350 sqlite3_free(res.zErrMsg);
136351 if( rc!=SQLITE_OK ){
136352 sqlite3_free_table(&res.azResult[1]);
136353 return rc;
136354 }
136355 if( res.nAlloc>res.nData ){
136356 char **azNew;
136357 azNew = sqlite3Realloc( res.azResult, sizeof(char*)*res.nData );
136358 if( azNew==0 ){
136359 sqlite3_free_table(&res.azResult[1]);
136360 db->errCode = SQLITE_NOMEM;
136361 return SQLITE_NOMEM_BKPT;
136362 }
136363 res.azResult = azNew;
static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv)
Definition sqlite3.c:136225
SQLITE_API char * sqlite3_mprintf(const char *,...)
Definition sqlite3.c:29323
SQLITE_API int sqlite3_exec(sqlite3 *, const char *sql, int(*callback)(void *, int, char **, char **), void *, char **errmsg)
Definition sqlite3.c:123455
#define SQLITE_INT_TO_PTR(X)
Definition sqlite3.c:13513
SQLITE_PRIVATE void * sqlite3Realloc(void *, u64)
Definition sqlite3.c:27765
SQLITE_API void sqlite3_free_table(char **result)
Definition sqlite3.c:136368
char * zErrMsg
Definition sqlite3.c:136212
char ** azResult
Definition sqlite3.c:136211

References TabResult::azResult, sqlite3::errCode, TabResult::nAlloc, TabResult::nColumn, TabResult::nData, TabResult::nRow, TabResult::rc, sqlite3_exec(), sqlite3_free(), sqlite3_free_table(), sqlite3_get_table_cb(), sqlite3_malloc64(), sqlite3_mprintf(), sqlite3Realloc(), sqlite3SafetyCheckOk(), SQLITE_ABORT, SQLITE_INT_TO_PTR, SQLITE_MISUSE_BKPT, SQLITE_NOMEM, SQLITE_NOMEM_BKPT, SQLITE_OK, and TabResult::zErrMsg.

◆ sqlite3_global_recover()

SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover ( void )

Definition at line 164550 of file sqlite3.c.

References SQLITE_OK.

◆ sqlite3_hard_heap_limit64()

SQLITE_API sqlite3_int64 sqlite3_hard_heap_limit64 ( sqlite3_int64 N)

Definition at line 27449 of file sqlite3.c.

27454 {
27455 sqlite3_int64 priorLimit;
27456#ifndef SQLITE_OMIT_AUTOINIT
27457 int rc = sqlite3_initialize();
27458 if( rc ) return -1;
27459#endif
27461 priorLimit = mem0.hardLimit;
27462 if( n>=0 ){
27463 mem0.hardLimit = n;
27464 if( n<mem0.alarmThreshold || mem0.alarmThreshold==0 ){
27465 mem0.alarmThreshold = n;

References mem0, sqlite3_initialize(), sqlite3_mutex_enter(), and sqlite3_mutex_leave().

Referenced by sqlite3Pragma().

◆ sqlite3_initialize()

SQLITE_API int sqlite3_initialize ( void )

Definition at line 161196 of file sqlite3.c.

161202 {
161203 MUTEX_LOGIC( sqlite3_mutex *pMainMtx; ) /* The main static mutex */
161204 int rc; /* Result code */
161205#ifdef SQLITE_EXTRA_INIT
161206 int bRunExtraInit = 0; /* Extra initialization needed */
161207#endif
161208
161209#ifdef SQLITE_OMIT_WSD
161210 rc = sqlite3_wsd_init(4096, 24);
161211 if( rc!=SQLITE_OK ){
161212 return rc;
161213 }
161214#endif
161215
161216 /* If the following assert() fails on some obscure processor/compiler
161217 ** combination, the work-around is to set the correct pointer
161218 ** size at compile-time using -DSQLITE_PTRSIZE=n compile-time option */
161219 assert( SQLITE_PTRSIZE==sizeof(char*) );
161220
161221 /* If SQLite is already completely initialized, then this call
161222 ** to sqlite3_initialize() should be a no-op. But the initialization
161223 ** must be complete. So isInit must not be set until the very end
161224 ** of this routine.
161225 */
161226 if( sqlite3GlobalConfig.isInit ){
161228 return SQLITE_OK;
161229 }
161230
161231 /* Make sure the mutex subsystem is initialized. If unable to
161232 ** initialize the mutex subsystem, return early with the error.
161233 ** If the system is so sick that we are unable to allocate a mutex,
161234 ** there is not much SQLite is going to be able to do.
161235 **
161236 ** The mutex subsystem must take care of serializing its own
161237 ** initialization.
161238 */
161239 rc = sqlite3MutexInit();
161240 if( rc ) return rc;
161241
161242 /* Initialize the malloc() system and the recursive pInitMutex mutex.
161243 ** This operation is protected by the STATIC_MAIN mutex. Note that
161244 ** MutexAlloc() is called for a static mutex prior to initializing the
161245 ** malloc subsystem - this implies that the allocation of a static
161246 ** mutex must not require support from the malloc subsystem.
161247 */
161249 sqlite3_mutex_enter(pMainMtx);
161250 sqlite3GlobalConfig.isMutexInit = 1;
161251 if( !sqlite3GlobalConfig.isMallocInit ){
161252 rc = sqlite3MallocInit();
161253 }
161254 if( rc==SQLITE_OK ){
161255 sqlite3GlobalConfig.isMallocInit = 1;
161256 if( !sqlite3GlobalConfig.pInitMutex ){
161257 sqlite3GlobalConfig.pInitMutex =
161259 if( sqlite3GlobalConfig.bCoreMutex && !sqlite3GlobalConfig.pInitMutex ){
161260 rc = SQLITE_NOMEM_BKPT;
161261 }
161262 }
161263 }
161264 if( rc==SQLITE_OK ){
161265 sqlite3GlobalConfig.nRefInitMutex++;
161266 }
161267 sqlite3_mutex_leave(pMainMtx);
161268
161269 /* If rc is not SQLITE_OK at this point, then either the malloc
161270 ** subsystem could not be initialized or the system failed to allocate
161271 ** the pInitMutex mutex. Return an error in either case. */
161272 if( rc!=SQLITE_OK ){
161273 return rc;
161274 }
161275
161276 /* Do the rest of the initialization under the recursive mutex so
161277 ** that we will be able to handle recursive calls into
161278 ** sqlite3_initialize(). The recursive calls normally come through
161279 ** sqlite3_os_init() when it invokes sqlite3_vfs_register(), but other
161280 ** recursive calls might also be possible.
161281 **
161282 ** IMPLEMENTATION-OF: R-00140-37445 SQLite automatically serializes calls
161283 ** to the xInit method, so the xInit method need not be threadsafe.
161284 **
161285 ** The following mutex is what serializes access to the appdef pcache xInit
161286 ** methods. The sqlite3_pcache_methods.xInit() all is embedded in the
161287 ** call to sqlite3PcacheInitialize().
161288 */
161290 if( sqlite3GlobalConfig.isInit==0 && sqlite3GlobalConfig.inProgress==0 ){
161291 sqlite3GlobalConfig.inProgress = 1;
161292#ifdef SQLITE_ENABLE_SQLLOG
161293 {
161294 extern void sqlite3_init_sqllog(void);
161295 sqlite3_init_sqllog();
161296 }
161297#endif
161300 if( sqlite3GlobalConfig.isPCacheInit==0 ){
161302 }
161303 if( rc==SQLITE_OK ){
161304 sqlite3GlobalConfig.isPCacheInit = 1;
161305 rc = sqlite3OsInit();
161306 }
161307#ifdef SQLITE_ENABLE_DESERIALIZE
161308 if( rc==SQLITE_OK ){
161309 rc = sqlite3MemdbInit();
161310 }
161311#endif
161312 if( rc==SQLITE_OK ){
161316 sqlite3GlobalConfig.isInit = 1;
161317#ifdef SQLITE_EXTRA_INIT
161318 bRunExtraInit = 1;
161319#endif
161320 }
161321 sqlite3GlobalConfig.inProgress = 0;
161322 }
161324
161325 /* Go back under the static mutex and clean up the recursive
161326 ** mutex to prevent a resource leak.
161327 */
161328 sqlite3_mutex_enter(pMainMtx);
161329 sqlite3GlobalConfig.nRefInitMutex--;
161330 if( sqlite3GlobalConfig.nRefInitMutex<=0 ){
161331 assert( sqlite3GlobalConfig.nRefInitMutex==0 );
161333 sqlite3GlobalConfig.pInitMutex = 0;
161334 }
161335 sqlite3_mutex_leave(pMainMtx);
161336
161337 /* The following is just a sanity check to make sure SQLite has
161338 ** been compiled correctly. It is important to run this code, but
161339 ** we don't want to run it too often and soak up CPU cycles for no
161340 ** reason. So we run it once during initialization.
161341 */
161342#ifndef NDEBUG
161343#ifndef SQLITE_OMIT_FLOATING_POINT
161344 /* This section of code's only "output" is via assert() statements. */
161345 if( rc==SQLITE_OK ){
161346 u64 x = (((u64)1)<<63)-1;
161347 double y;
161348 assert(sizeof(x)==8);
161349 assert(sizeof(x)==sizeof(y));
161350 memcpy(&y, &x, 8);
161351 assert( sqlite3IsNaN(y) );
161352 }
161353#endif
161354#endif
161355
161356 /* Do extra initialization steps requested by the SQLITE_EXTRA_INIT
161357 ** compile-time option.
161358 */
161359#ifdef SQLITE_EXTRA_INIT
161360 if( bRunExtraInit ){
161361 int SQLITE_EXTRA_INIT(const char*);
SQLITE_PRIVATE FuncDefHash sqlite3BuiltinFunctions
Definition sqlite3.c:20634
#define SQLITE_MUTEX_RECURSIVE
Definition sqlite3.c:8630
SQLITE_PRIVATE int sqlite3PcacheInitialize(void)
Definition sqlite3.c:49132
SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *)
Definition sqlite3.c:25943
SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void)
Definition sqlite3.c:118958
SQLITE_PRIVATE void sqlite3MemoryBarrier(void)
Definition sqlite3.c:26314
SQLITE_PRIVATE int sqlite3MutexInit(void)
Definition sqlite3.c:25860
#define SQLITE_PTRSIZE
Definition sqlite3.c:14393
SQLITE_PRIVATE int sqlite3MallocInit(void)
Definition sqlite3.c:27471
#define MUTEX_LOGIC(X)
Definition sqlite3.c:16560
SQLITE_PRIVATE void sqlite3PCacheBufferSetup(void *, int sz, int n)
Definition sqlite3.c:50022
SQLITE_PRIVATE int sqlite3IsNaN(double)
Definition sqlite3.c:31244
SQLITE_PRIVATE int sqlite3OsInit(void)
Definition sqlite3.c:23290

References MUTEX_LOGIC, sqlite3_mutex_enter(), sqlite3_mutex_free(), sqlite3_mutex_leave(), sqlite3BuiltinFunctions, sqlite3GlobalConfig, sqlite3IsNaN(), sqlite3MallocInit(), sqlite3MemoryBarrier(), sqlite3MutexAlloc(), sqlite3MutexInit(), sqlite3OsInit(), sqlite3PCacheBufferSetup(), sqlite3PcacheInitialize(), sqlite3RegisterBuiltinFunctions(), SQLITE_MUTEX_RECURSIVE, SQLITE_MUTEX_STATIC_MAIN, SQLITE_NOMEM_BKPT, SQLITE_OK, and SQLITE_PTRSIZE.

Referenced by openDatabase(), sqlite3_auto_extension(), sqlite3_complete16(), sqlite3_hard_heap_limit64(), sqlite3_soft_heap_limit64(), sqlite3_vfs_find(), and sqlite3_vfs_register().

◆ sqlite3_interrupt()

SQLITE_API void sqlite3_interrupt ( sqlite3 * db)

Definition at line 162748 of file sqlite3.c.

162754 {
162755#ifdef SQLITE_ENABLE_API_ARMOR
162756 if( !sqlite3SafetyCheckOk(db) && (db==0 || db->magic!=SQLITE_MAGIC_ZOMBIE) ){
#define SQLITE_MAGIC_ZOMBIE
Definition sqlite3.c:17082
u32 magic
Definition sqlite3.c:16850

Referenced by db_interrupt(), and sqlite3VdbeExec().

◆ sqlite3_keyword_check()

SQLITE_API int sqlite3_keyword_check ( const char * zName,
int nName )

Definition at line 159878 of file sqlite3.c.

◆ sqlite3_keyword_count()

SQLITE_API int sqlite3_keyword_count ( void )

Definition at line 159877 of file sqlite3.c.

159877{

◆ sqlite3_keyword_name()

SQLITE_API int sqlite3_keyword_name ( int i,
const char ** pzName,
int * pnName )

Definition at line 159871 of file sqlite3.c.

159871 {
159872 int id = TK_ID;
159873 keywordCode((char*)z, n, &id);
159874 return id;
159875}
159876#define SQLITE_N_KEYWORD 145
static int keywordCode(const char *z, int n, int *pType)
Definition sqlite3.c:159693
#define TK_ID
Definition sqlite3.c:14001

References keywordCode(), and TK_ID.

◆ sqlite3_last_insert_rowid()

SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid ( sqlite3 * db)

Definition at line 162054 of file sqlite3.c.

162060 {
162061#ifdef SQLITE_ENABLE_API_ARMOR
162062 if( !sqlite3SafetyCheckOk(db) ){

Referenced by db_last_insert_rowid(), and dbvm_last_insert_rowid().

◆ sqlite3_libversion()

SQLITE_API const char * sqlite3_libversion ( void )

Definition at line 161104 of file sqlite3.c.

References sqlite3_version.

Referenced by lsqlite_version().

◆ sqlite3_libversion_number()

SQLITE_API int sqlite3_libversion_number ( void )

Definition at line 161117 of file sqlite3.c.

◆ sqlite3_limit()

SQLITE_API int sqlite3_limit ( sqlite3 * db,
int id,
int newVal )

Definition at line 163728 of file sqlite3.c.

163734 {
163735 int oldLimit;
163736
163737#ifdef SQLITE_ENABLE_API_ARMOR
163738 if( !sqlite3SafetyCheckOk(db) ){
163739 (void)SQLITE_MISUSE_BKPT;
163740 return -1;
163741 }
163742#endif
163743
163744 /* EVIDENCE-OF: R-30189-54097 For each limit category SQLITE_LIMIT_NAME
163745 ** there is a hard upper bound set at compile-time by a C preprocessor
163746 ** macro called SQLITE_MAX_NAME. (The "_LIMIT_" in the name is changed to
163747 ** "_MAX_".)
163748 */
163763
163764
163765 if( limitId<0 || limitId>=SQLITE_N_LIMIT ){
163766 return -1;
163767 }
163768 oldLimit = db->aLimit[limitId];
163769 if( newLimit>=0 ){ /* IMP: R-52476-28732 */
163770 if( newLimit>aHardLimit[limitId] ){
#define SQLITE_MAX_FUNCTION_ARG
Definition sqlite3.c:13334
static const int aHardLimit[]
Definition sqlite3.c:163665
#define SQLITE_LIMIT_ATTACHED
Definition sqlite3.c:4951
#define SQLITE_LIMIT_COLUMN
Definition sqlite3.c:4946
#define SQLITE_MAX_COMPOUND_SELECT
Definition sqlite3.c:13319
#define SQLITE_MAX_LIKE_PATTERN_LENGTH
Definition sqlite3.c:13439
#define SQLITE_LIMIT_WORKER_THREADS
Definition sqlite3.c:4955
#define SQLITE_LIMIT_COMPOUND_SELECT
Definition sqlite3.c:4948
#define SQLITE_LIMIT_FUNCTION_ARG
Definition sqlite3.c:4950
#define SQLITE_LIMIT_VDBE_OP
Definition sqlite3.c:4949
#define SQLITE_MAX_COLUMN
Definition sqlite3.c:13282
#define SQLITE_MAX_EXPR_DEPTH
Definition sqlite3.c:13307
#define SQLITE_LIMIT_SQL_LENGTH
Definition sqlite3.c:4945
#define SQLITE_LIMIT_EXPR_DEPTH
Definition sqlite3.c:4947
#define SQLITE_MAX_LENGTH
Definition sqlite3.c:13261
#define SQLITE_MAX_WORKER_THREADS
Definition sqlite3.c:14212
#define SQLITE_LIMIT_LIKE_PATTERN_LENGTH
Definition sqlite3.c:4952
#define SQLITE_MAX_VDBE_OP
Definition sqlite3.c:13327
#define SQLITE_LIMIT_TRIGGER_DEPTH
Definition sqlite3.c:4954
#define SQLITE_MAX_ATTACHED
Definition sqlite3.c:13365
#define SQLITE_MAX_SQL_LENGTH
Definition sqlite3.c:13293
#define SQLITE_LIMIT_VARIABLE_NUMBER
Definition sqlite3.c:4953
#define SQLITE_MAX_VARIABLE_NUMBER
Definition sqlite3.c:13376
#define SQLITE_MAX_TRIGGER_DEPTH
Definition sqlite3.c:13450
#define SQLITE_N_LIMIT
Definition sqlite3.c:16671

References aHardLimit, sqlite3::aLimit, sqlite3SafetyCheckOk(), SQLITE_LIMIT_ATTACHED, SQLITE_LIMIT_COLUMN, SQLITE_LIMIT_COMPOUND_SELECT, SQLITE_LIMIT_EXPR_DEPTH, SQLITE_LIMIT_FUNCTION_ARG, SQLITE_LIMIT_LENGTH, SQLITE_LIMIT_LIKE_PATTERN_LENGTH, SQLITE_LIMIT_SQL_LENGTH, SQLITE_LIMIT_TRIGGER_DEPTH, SQLITE_LIMIT_VARIABLE_NUMBER, SQLITE_LIMIT_VDBE_OP, SQLITE_LIMIT_WORKER_THREADS, SQLITE_MAX_ATTACHED, SQLITE_MAX_COLUMN, SQLITE_MAX_COMPOUND_SELECT, SQLITE_MAX_EXPR_DEPTH, SQLITE_MAX_FUNCTION_ARG, SQLITE_MAX_LENGTH, SQLITE_MAX_LIKE_PATTERN_LENGTH, SQLITE_MAX_SQL_LENGTH, SQLITE_MAX_TRIGGER_DEPTH, SQLITE_MAX_VARIABLE_NUMBER, SQLITE_MAX_VDBE_OP, SQLITE_MAX_WORKER_THREADS, SQLITE_MISUSE_BKPT, and SQLITE_N_LIMIT.

Referenced by sqlite3Pragma().

◆ sqlite3_load_extension()

SQLITE_API int sqlite3_load_extension ( sqlite3 * db,
const char * zFile,
const char * zProc,
char ** pzErrMsg )

Definition at line 124876 of file sqlite3.c.

124887 {
124888 int rc;

Referenced by db_load_extension(), and loadExt().

◆ sqlite3_log()

◆ sqlite3_malloc()

SQLITE_API void * sqlite3_malloc ( int n)

Definition at line 27615 of file sqlite3.c.

27620 {

Referenced by sqlite3OsInit(), unixFullPathname(), and walRewriteChecksums().

◆ sqlite3_malloc64()

◆ sqlite3_memory_alarm()

SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm ( void(*)(void *, sqlite3_int64, int) ,
void * ,
sqlite3_int64  )

◆ sqlite3_memory_highwater()

SQLITE_API sqlite3_int64 sqlite3_memory_highwater ( int resetFlag)

Definition at line 27521 of file sqlite3.c.

References sqlite3_status64(), and SQLITE_STATUS_MEMORY_USED.

◆ sqlite3_memory_used()

SQLITE_API sqlite3_int64 sqlite3_memory_used ( void )

Definition at line 27510 of file sqlite3.c.

◆ sqlite3_mprintf()

SQLITE_API char * sqlite3_mprintf ( const char * zFormat,
... )

◆ sqlite3_msize()

SQLITE_API sqlite3_uint64 sqlite3_msize ( void * p)

Definition at line 27683 of file sqlite3.c.

◆ sqlite3_mutex_alloc()

SQLITE_API sqlite3_mutex * sqlite3_mutex_alloc ( int id)

Definition at line 25922 of file sqlite3.c.

25927 {
25928#ifndef SQLITE_OMIT_AUTOINIT
25929 if( id<=SQLITE_MUTEX_RECURSIVE && sqlite3_initialize() ) return 0;

Referenced by findInodeInfo(), and unixOpenSharedMemory().

◆ sqlite3_mutex_enter()

◆ sqlite3_mutex_free()

SQLITE_API void sqlite3_mutex_free ( sqlite3_mutex * p)

◆ sqlite3_mutex_held()

SQLITE_API int sqlite3_mutex_held ( sqlite3_mutex * )

◆ sqlite3_mutex_leave()

◆ sqlite3_mutex_notheld()

SQLITE_API int sqlite3_mutex_notheld ( sqlite3_mutex * )

◆ sqlite3_mutex_try()

SQLITE_API int sqlite3_mutex_try ( sqlite3_mutex * p)

Definition at line 25965 of file sqlite3.c.

25970 {
25971 int rc = SQLITE_OK;
25972 if( p ){

References sqlite3GlobalConfig, and SQLITE_OK.

Referenced by btreeLockCarefully().

◆ sqlite3_next_stmt()

SQLITE_API sqlite3_stmt * sqlite3_next_stmt ( sqlite3 * pDb,
sqlite3_stmt * pStmt )

Definition at line 84680 of file sqlite3.c.

84686 {
84687 sqlite3_stmt *pNext;
84688#ifdef SQLITE_ENABLE_API_ARMOR
84689 if( !sqlite3SafetyCheckOk(pDb) ){
84690 (void)SQLITE_MISUSE_BKPT;
84691 return 0;
84692 }
84693#endif
84695 if( pStmt==0 ){
84696 pNext = (sqlite3_stmt*)pDb->pVdbe;

References sqlite3::mutex, sqlite3::pVdbe, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), and SQLITE_MISUSE_BKPT.

◆ sqlite3_normalized_sql()

SQLITE_API const char * sqlite3_normalized_sql ( sqlite3_stmt * pStmt)

◆ sqlite3_open()

SQLITE_API int sqlite3_open ( const char * filename,
sqlite3 ** ppDb )

Definition at line 164380 of file sqlite3.c.

◆ sqlite3_open16()

SQLITE_API int sqlite3_open16 ( const void * filename,
sqlite3 ** ppDb )

Definition at line 164400 of file sqlite3.c.

164409 {
164410 char const *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
164411 sqlite3_value *pVal;
164412 int rc;
164413
164414#ifdef SQLITE_ENABLE_API_ARMOR
164415 if( ppDb==0 ) return SQLITE_MISUSE_BKPT;
164416#endif
164417 *ppDb = 0;
164418#ifndef SQLITE_OMIT_AUTOINIT
164419 rc = sqlite3_initialize();
164420 if( rc ) return rc;
164421#endif
164422 if( zFilename==0 ) zFilename = "\000\000";
164423 pVal = sqlite3ValueNew(0);
164424 sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
164425 zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
164426 if( zFilename8 ){
164427 rc = openDatabase(zFilename8, ppDb,
164429 assert( *ppDb || rc==SQLITE_NOMEM );
164430 if( rc==SQLITE_OK && !DbHasProperty(*ppDb, 0, DB_SchemaLoaded) ){
164431 SCHEMA_ENC(*ppDb) = ENC(*ppDb) = SQLITE_UTF16NATIVE;
164432 }
164433 }else{
#define SQLITE_OPEN_CREATE
Definition sqlite3.c:1603
#define SQLITE_OPEN_READWRITE
Definition sqlite3.c:1602
static int openDatabase(const char *zFilename, sqlite3 **ppDb, unsigned int flags, const char *zVfs)
Definition sqlite3.c:164053
#define DB_SchemaLoaded
Definition sqlite3.c:16663
#define DbHasProperty(D, I, P)
Definition sqlite3.c:16648
#define ENC(db)
Definition sqlite3.c:16961
#define SCHEMA_ENC(db)
Definition sqlite3.c:16960

◆ sqlite3_open_v2()

SQLITE_API int sqlite3_open_v2 ( const char * filename,
sqlite3 ** ppDb,
int flags,
const char * zVfs )

Definition at line 164387 of file sqlite3.c.

164389 {
164390 return openDatabase(zFilename, ppDb,
164392}
164394 const char *filename, /* Database filename (UTF-8) */
SQLITE_API int sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs)
Definition sqlite3.c:164387

References openDatabase(), SQLITE_OPEN_CREATE, and SQLITE_OPEN_READWRITE.

◆ sqlite3_os_end()

SQLITE_API int sqlite3_os_end ( void )

Definition at line 41473 of file sqlite3.c.

References SQLITE_OK, and unixBigLock.

Referenced by sqlite3_shutdown().

◆ sqlite3_os_init()

SQLITE_API int sqlite3_os_init ( void )

Definition at line 41373 of file sqlite3.c.

41379 {
41380 /*
41381 ** The following macro defines an initializer for an sqlite3_vfs object.
41382 ** The name of the VFS is NAME. The pAppData is a pointer to a pointer
41383 ** to the "finder" function. (pAppData is a pointer to a pointer because
41384 ** silly C90 rules prohibit a void* from being cast to a function pointer
41385 ** and so we have to go through the intermediate pointer to avoid problems
41386 ** when compiling with -pedantic-errors on GCC.)
41387 **
41388 ** The FINDER parameter to this macro is the name of the pointer to the
41389 ** finder-function. The finder-function returns a pointer to the
41390 ** sqlite_io_methods object that implements the desired locking
41391 ** behaviors. See the division above that contains the IOMETHODS
41392 ** macro for addition information on finder-functions.
41393 **
41394 ** Most finders simply return a pointer to a fixed sqlite3_io_methods
41395 ** object. But the "autolockIoFinder" available on MacOSX does a little
41396 ** more than that; it looks at the filesystem type that hosts the
41397 ** database file and tries to choose an locking method appropriate for
41398 ** that filesystem time.
41399 */
41400 #define UNIXVFS(VFSNAME, FINDER) { \
41401 3, /* iVersion */ \
41402 sizeof(unixFile), /* szOsFile */ \
41403 MAX_PATHNAME, /* mxPathname */ \
41404 0, /* pNext */ \
41405 VFSNAME, /* zName */ \
41406 (void*)&FINDER, /* pAppData */ \
41407 unixOpen, /* xOpen */ \
41408 unixDelete, /* xDelete */ \
41409 unixAccess, /* xAccess */ \
41410 unixFullPathname, /* xFullPathname */ \
41411 unixDlOpen, /* xDlOpen */ \
41412 unixDlError, /* xDlError */ \
41413 unixDlSym, /* xDlSym */ \
41414 unixDlClose, /* xDlClose */ \
41415 unixRandomness, /* xRandomness */ \
41416 unixSleep, /* xSleep */ \
41417 unixCurrentTime, /* xCurrentTime */ \
41418 unixGetLastError, /* xGetLastError */ \
41419 unixCurrentTimeInt64, /* xCurrentTimeInt64 */ \
41420 unixSetSystemCall, /* xSetSystemCall */ \
41421 unixGetSystemCall, /* xGetSystemCall */ \
41422 unixNextSystemCall, /* xNextSystemCall */ \
41423 }
41424
41425 /*
41426 ** All default VFSes for unix are contained in the following array.
41427 **
41428 ** Note that the sqlite3_vfs.pNext field of the VFS object is modified
41429 ** by the SQLite core when the VFS is registered. So the following
41430 ** array cannot be const.
41431 */
41432 static sqlite3_vfs aVfs[] = {
41433#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
41434 UNIXVFS("unix", autolockIoFinder ),
41435#elif OS_VXWORKS
41436 UNIXVFS("unix", vxworksIoFinder ),
41437#else
41438 UNIXVFS("unix", posixIoFinder ),
41439#endif
41440 UNIXVFS("unix-none", nolockIoFinder ),
41441 UNIXVFS("unix-dotfile", dotlockIoFinder ),
41442 UNIXVFS("unix-excl", posixIoFinder ),
41443#if OS_VXWORKS
41444 UNIXVFS("unix-namedsem", semIoFinder ),
41445#endif
41446#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
41447 UNIXVFS("unix-posix", posixIoFinder ),
41448#endif
41449#if SQLITE_ENABLE_LOCKING_STYLE
41450 UNIXVFS("unix-flock", flockIoFinder ),
41451#endif
41452#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__)
41453 UNIXVFS("unix-afp", afpIoFinder ),
41454 UNIXVFS("unix-nfs", nfsIoFinder ),
41455 UNIXVFS("unix-proxy", proxyIoFinder ),
41456#endif
41457 };
41458 unsigned int i; /* Loop counter */
41459
41460 /* Double-check that the aSyscall[] array has been constructed
41461 ** correctly. See ticket [bb3a86e890c8e96ab] */
41462 assert( ArraySize(aSyscall)==29 );
41463
41464 /* Register all VFSes defined in the aVfs[] array */
#define UNIXVFS(VFSNAME, FINDER)
static struct unix_syscall aSyscall[]

References ArraySize, aSyscall, sqlite3_vfs_register(), sqlite3MutexAlloc(), SQLITE_MUTEX_STATIC_VFS1, SQLITE_OK, unixBigLock, and UNIXVFS.

Referenced by sqlite3OsInit().

◆ sqlite3_overload_function()

SQLITE_API int sqlite3_overload_function ( sqlite3 * db,
const char * zFuncName,
int nArg )

Definition at line 163042 of file sqlite3.c.

163052 {
163053 int rc;
163054 char *zCopy;
163055
163056#ifdef SQLITE_ENABLE_API_ARMOR
163057 if( !sqlite3SafetyCheckOk(db) || zName==0 || nArg<-2 ){
163058 return SQLITE_MISUSE_BKPT;
163059 }
163060#endif
163062 rc = sqlite3FindFunction(db, zName, nArg, SQLITE_UTF8, 0)!=0;
SQLITE_PRIVATE FuncDef * sqlite3FindFunction(sqlite3 *, const char *, int, u8, u8)
Definition sqlite3.c:115931

References sqlite3::mutex, sqlite3_create_function_v2(), sqlite3_free(), sqlite3_mprintf(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3FindFunction(), sqlite3InvalidFunction(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_NOMEM, SQLITE_OK, SQLITE_UTF8, and zName.

Referenced by sqlite3RegisterPerConnectionBuiltinFunctions().

◆ sqlite3_prepare()

SQLITE_API int sqlite3_prepare ( sqlite3 * db,
const char * zSql,
int nByte,
sqlite3_stmt ** ppStmt,
const char ** pzTail )

Definition at line 129134 of file sqlite3.c.

◆ sqlite3_prepare16()

SQLITE_API int sqlite3_prepare16 ( sqlite3 * db,
const void * zSql,
int nByte,
sqlite3_stmt ** ppStmt,
const void ** pzTail )

Definition at line 129250 of file sqlite3.c.

◆ sqlite3_prepare16_v2()

SQLITE_API int sqlite3_prepare16_v2 ( sqlite3 * db,
const void * zSql,
int nByte,
sqlite3_stmt ** ppStmt,
const void ** pzTail )

Definition at line 129262 of file sqlite3.c.

129262 {
129263 int rc;
129264 rc = sqlite3Prepare16(db,zSql,nBytes,0,ppStmt,pzTail);
129265 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
129266 return rc;
129267}
129269 sqlite3 *db, /* Database handle. */
129270 const void *zSql, /* UTF-16 encoded SQL statement. */
129271 int nBytes, /* Length of zSql in bytes. */
129272 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
129273 const void **pzTail /* OUT: End of parsed string */
static int sqlite3Prepare16(sqlite3 *db, const void *zSql, int nBytes, u32 prepFlags, sqlite3_stmt **ppStmt, const void **pzTail)
Definition sqlite3.c:129192
SQLITE_API int sqlite3_prepare16_v2(sqlite3 *db, const void *zSql, int nByte, sqlite3_stmt **ppStmt, const void **pzTail)
Definition sqlite3.c:129262

References sqlite3Prepare16(), and SQLITE_OK.

◆ sqlite3_prepare16_v3()

SQLITE_API int sqlite3_prepare16_v3 ( sqlite3 * db,
const void * zSql,
int nByte,
unsigned int prepFlags,
sqlite3_stmt ** ppStmt,
const void ** pzTail )

Definition at line 129274 of file sqlite3.c.

129274 {
129275 int rc;
129276 rc = sqlite3Prepare16(db,zSql,nBytes,SQLITE_PREPARE_SAVESQL,ppStmt,pzTail);
129277 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
129278 return rc;
129279}
129281 sqlite3 *db, /* Database handle. */
129282 const void *zSql, /* UTF-16 encoded SQL statement. */
129283 int nBytes, /* Length of zSql in bytes. */
129284 unsigned int prepFlags, /* Zero or more SQLITE_PREPARE_* flags */
129285 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
129286 const void **pzTail /* OUT: End of parsed string */
129287){
129288 int rc;
SQLITE_API int sqlite3_prepare16_v3(sqlite3 *db, const void *zSql, int nByte, unsigned int prepFlags, sqlite3_stmt **ppStmt, const void **pzTail)
Definition sqlite3.c:129274

References sqlite3Prepare16(), SQLITE_OK, and SQLITE_PREPARE_SAVESQL.

◆ sqlite3_prepare_v2()

SQLITE_API int sqlite3_prepare_v2 ( sqlite3 * db,
const char * zSql,
int nByte,
sqlite3_stmt ** ppStmt,
const char ** pzTail )

Definition at line 129146 of file sqlite3.c.

129146 {
129147 int rc;
129148 rc = sqlite3LockAndPrepare(db,zSql,nBytes,0,0,ppStmt,pzTail);
129149 assert( rc==SQLITE_OK || ppStmt==0 || *ppStmt==0 ); /* VERIFY: F13021 */
129150 return rc;
129151}
129153 sqlite3 *db, /* Database handle. */
129154 const char *zSql, /* UTF-8 encoded SQL statement. */
129155 int nBytes, /* Length of zSql in bytes. */
129156 sqlite3_stmt **ppStmt, /* OUT: A pointer to the prepared statement */
129157 const char **pzTail /* OUT: End of parsed string */
129158){
129159 int rc;
129160 /* EVIDENCE-OF: R-37923-12173 The sqlite3_prepare_v2() interface works
129161 ** exactly the same as sqlite3_prepare_v3() with a zero prepFlags
129162 ** parameter.
129163 **
static int sqlite3LockAndPrepare(sqlite3 *db, const char *zSql, int nBytes, u32 prepFlags, Vdbe *pOld, sqlite3_stmt **ppStmt, const char **pzTail)
Definition sqlite3.c:129050

References sqlite3LockAndPrepare(), and SQLITE_OK.

Referenced by db_do_rows(), db_prepare(), execSql(), and sqlite3_exec().

◆ sqlite3_prepare_v3()

SQLITE_API int sqlite3_prepare_v3 ( sqlite3 * db,
const char * zSql,
int nByte,
unsigned int prepFlags,
sqlite3_stmt ** ppStmt,
const char ** pzTail )

Definition at line 129164 of file sqlite3.c.

129177 {
129178 int rc;
129179 /* EVIDENCE-OF: R-56861-42673 sqlite3_prepare_v3() differs from
129180 ** sqlite3_prepare_v2() only in having the extra prepFlags parameter,
129181 ** which is a bit array consisting of zero or more of the
129182 ** SQLITE_PREPARE_* flags.
129183 **
129184 ** Proof by comparison to the implementation of sqlite3_prepare_v2()
129185 ** directly above. */

◆ sqlite3_profile()

SQLITE_API SQLITE_DEPRECATED void * sqlite3_profile ( sqlite3 * db,
void(*)(void *, const char *, sqlite3_uint64) xProfile,
void * pArg )

Definition at line 163126 of file sqlite3.c.

163136 {
163137 void *pOld;
163138
163139#ifdef SQLITE_ENABLE_API_ARMOR
163140 if( !sqlite3SafetyCheckOk(db) ){
163141 (void)SQLITE_MISUSE_BKPT;
163142 return 0;
163143 }
163144#endif
163146 pOld = db->pProfileArg;
163147 db->xProfile = xProfile;
void * pProfileArg
Definition sqlite3.c:16878
void(* xProfile)(void *, const char *, u64)
Definition sqlite3.c:16877

References sqlite3::mTrace, sqlite3::mutex, sqlite3::pProfileArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_TRACE_NONLEGACY_MASK, SQLITE_TRACE_XPROFILE, and sqlite3::xProfile.

◆ sqlite3_progress_handler()

SQLITE_API void sqlite3_progress_handler ( sqlite3 * db,
int nOps,
int(*)(void *) xProgress,
void * pArg )

Definition at line 162700 of file sqlite3.c.

162711 {
162712#ifdef SQLITE_ENABLE_API_ARMOR
162713 if( !sqlite3SafetyCheckOk(db) ){
162714 (void)SQLITE_MISUSE_BKPT;
162715 return;
162716 }
162717#endif
162719 if( nOps>0 ){
162720 db->xProgress = xProgress;
162721 db->nProgressOps = (unsigned)nOps;
162722 db->pProgressArg = pArg;
162723 }else{
void * pProgressArg
Definition sqlite3.c:16913
int(* xProgress)(void *)
Definition sqlite3.c:16912
unsigned nProgressOps
Definition sqlite3.c:16914

References sqlite3::mutex, sqlite3::nProgressOps, sqlite3::pProgressArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, and sqlite3::xProgress.

Referenced by db_progress_handler().

◆ sqlite3_randomness()

SQLITE_API void sqlite3_randomness ( int N,
void * P )

Definition at line 30261 of file sqlite3.c.

30267 {
30268 unsigned char t;
30269 unsigned char *zBuf = pBuf;
30270
30271 /* The "wsdPrng" macro will resolve to the pseudo-random number generator
30272 ** state vector. If writable static data is unsupported on the target,
30273 ** we have to locate the state vector at run-time. In the more common
30274 ** case where writable static data is supported, wsdPrng can refer directly
30275 ** to the "sqlite3Prng" state vector declared above.
30276 */
30277#ifdef SQLITE_OMIT_WSD
30278 struct sqlite3PrngType *p = &GLOBAL(struct sqlite3PrngType, sqlite3Prng);
30279# define wsdPrng p[0]
30280#else
30281# define wsdPrng sqlite3Prng
30282#endif
30283
30284#if SQLITE_THREADSAFE
30286#endif
30287
30288#ifndef SQLITE_OMIT_AUTOINIT
30289 if( sqlite3_initialize() ) return;
30290#endif
30291
30292#if SQLITE_THREADSAFE
30294#endif
30295
30297 if( N<=0 || pBuf==0 ){
30298 wsdPrng.isInit = 0;
30300 return;
30301 }
30302
30303 /* Initialize the state of the random number generator once,
30304 ** the first time this routine is called. The seed value does
30305 ** not need to contain a lot of randomness since we are not
30306 ** trying to do secure encryption or anything like that...
30307 **
30308 ** Nothing in this file or anywhere else in SQLite does any kind of
30309 ** encryption. The RC4 algorithm is being used as a PRNG (pseudo-random
30310 ** number generator) not as an encryption device.
30311 */
30312 if( !wsdPrng.isInit ){
30313 int i;
30314 char k[256];
30315 wsdPrng.j = 0;
30316 wsdPrng.i = 0;
30318 for(i=0; i<256; i++){
30319 wsdPrng.s[i] = (u8)i;
30320 }
30321 for(i=0; i<256; i++){
30322 wsdPrng.j += wsdPrng.s[i] + k[i];
30323 t = wsdPrng.s[wsdPrng.j];
30324 wsdPrng.s[wsdPrng.j] = wsdPrng.s[i];
30325 wsdPrng.s[i] = t;
30326 }
30327 wsdPrng.isInit = 1;
30328 }
30329
30330 assert( N>0 );
30331 do{
30332 wsdPrng.i++;
30333 t = wsdPrng.s[wsdPrng.i];
30334 wsdPrng.j += t;
30335 wsdPrng.s[wsdPrng.i] = wsdPrng.s[wsdPrng.j];
SQLITE_API sqlite3_vfs * sqlite3_vfs_find(const char *zVfsName)
Definition sqlite3.c:23307
static SQLITE_WSD struct sqlite3PrngType sqlite3Prng
SQLITE_PRIVATE int sqlite3OsRandomness(sqlite3_vfs *, int, char *)
Definition sqlite3.c:23221
#define SQLITE_MUTEX_STATIC_PRNG
Definition sqlite3.c:8635
#define wsdPrng
#define GLOBAL(t, v)
Definition sqlite3.c:14633
unsigned char i
Definition sqlite3.c:30254

Referenced by randomFunc(), sqlite3BitvecBuiltinTest(), sqlite3ColumnsFromExprList(), sqlite3VdbeExec(), unixGetTempname(), unixOpen(), vdbeCommit(), walCheckpoint(), walRestartLog(), and writeJournalHdr().

◆ sqlite3_realloc()

SQLITE_API void * sqlite3_realloc ( void * pOld,
int n )

Definition at line 27819 of file sqlite3.c.

27824 {
27825#ifndef SQLITE_OMIT_AUTOINIT

Referenced by unixShmMap().

◆ sqlite3_realloc64()

SQLITE_API void * sqlite3_realloc64 ( void * pOld,
sqlite3_uint64 n )

Definition at line 27826 of file sqlite3.c.

27831 {

Referenced by sqlite3_auto_extension().

◆ sqlite3_release_memory()

SQLITE_API int sqlite3_release_memory ( int n)

Definition at line 27335 of file sqlite3.c.

27340 {
27341#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT
27342 return sqlite3PcacheReleaseMemory(n);
27343#else
27344 /* IMPLEMENTATION-OF: R-34391-24921 The sqlite3_release_memory() routine
27345 ** is a no-op returning zero if SQLite is not compiled with

References UNUSED_PARAMETER.

◆ sqlite3_reset()

SQLITE_API int sqlite3_reset ( sqlite3_stmt * pStmt)

Definition at line 83107 of file sqlite3.c.

83113 {
83114 int rc;
83115 if( pStmt==0 ){
83116 rc = SQLITE_OK;
83117 }else{
83118 Vdbe *v = (Vdbe*)pStmt;
83119 sqlite3 *db = v->db;
83121 checkProfileCallback(db, v);
83122 rc = sqlite3VdbeReset(v);
SQLITE_PRIVATE int sqlite3VdbeReset(Vdbe *)
Definition sqlite3.c:81017
SQLITE_PRIVATE void sqlite3VdbeRewind(Vdbe *)
Definition sqlite3.c:80022

References checkProfileCallback, Vdbe::db, sqlite3::errMask, sqlite3::mutex, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3ApiExit(), sqlite3VdbeReset(), sqlite3VdbeRewind(), and SQLITE_OK.

Referenced by db_do_next_row(), dbvm_reset(), sqlite3_step(), and sqlite3Step().

◆ sqlite3_reset_auto_extension()

SQLITE_API void sqlite3_reset_auto_extension ( void )

Definition at line 125025 of file sqlite3.c.

125031 {
125032#ifndef SQLITE_OMIT_AUTOINIT
125034#endif
125035 {
125036#if SQLITE_THREADSAFE
125038#endif

Referenced by sqlite3_shutdown().

◆ sqlite3_result_blob()

SQLITE_API void sqlite3_result_blob ( sqlite3_context * pCtx,
const void * z,
int n,
void(*)(void *) xDel )

Definition at line 83379 of file sqlite3.c.

83379 {
83380 xDel((void*)p);
83381 }
83382 if( pCtx ) sqlite3_result_error_toobig(pCtx);
83383 return SQLITE_TOOBIG;
83384}
83386 sqlite3_context *pCtx,
83387 const void *z,
83388 int n,
SQLITE_API void sqlite3_result_blob(sqlite3_context *, const void *, int, void(*)(void *))
Definition sqlite3.c:83379
SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *)
Definition sqlite3.c:83532

Referenced by lcontext_result_blob(), and statGet().

◆ sqlite3_result_blob64()

SQLITE_API void sqlite3_result_blob64 ( sqlite3_context * pCtx,
const void * z,
sqlite3_uint64 n,
void(*)(void *) xDel )

Definition at line 83389 of file sqlite3.c.

83390 {
83391 assert( n>=0 );
83392 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83393 setResultStrOrError(pCtx, z, n, 0, xDel);
83394}
83396 sqlite3_context *pCtx,
83397 const void *z,
83399 void (*xDel)(void *)
83400){
83401 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83402 assert( xDel!=SQLITE_DYNAMIC );
SQLITE_API void sqlite3_result_blob64(sqlite3_context *, const void *, sqlite3_uint64, void(*)(void *))
Definition sqlite3.c:83389
static void setResultStrOrError(sqlite3_context *pCtx, const char *z, int n, u8 enc, void(*xDel)(void *))
Definition sqlite3.c:83352

References sqlite3_value::db, sqlite3::mutex, sqlite3_context::pOut, setResultStrOrError(), and sqlite3_mutex_held().

Referenced by substrFunc().

◆ sqlite3_result_double()

SQLITE_API void sqlite3_result_double ( sqlite3_context * pCtx,
double rVal )

Definition at line 83403 of file sqlite3.c.

83403 {
83404 (void)invokeValueDestructor(z, xDel, pCtx);
83405 }else{
83406 setResultStrOrError(pCtx, z, (int)n, 0, xDel);

References invokeValueDestructor().

Referenced by absFunc(), juliandayFunc(), lcontext_result(), and lcontext_result_double().

◆ sqlite3_result_error()

◆ sqlite3_result_error16()

SQLITE_API void sqlite3_result_error16 ( sqlite3_context * pCtx,
const void * z,
int n )

Definition at line 83413 of file sqlite3.c.

83413 {
83414 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83415 pCtx->isError = SQLITE_ERROR;
83417}
SQLITE_PRIVATE int sqlite3VdbeMemSetStr(Mem *, const char *, int, u8, void(*)(void *))
Definition sqlite3.c:76892

References sqlite3_value::db, sqlite3_context::isError, sqlite3::mutex, sqlite3_context::pOut, sqlite3_mutex_held(), sqlite3VdbeMemSetStr(), SQLITE_ERROR, SQLITE_TRANSIENT, and SQLITE_UTF8.

◆ sqlite3_result_error_code()

SQLITE_API void sqlite3_result_error_code ( sqlite3_context * pCtx,
int errCode )

Definition at line 83520 of file sqlite3.c.

83520 {
83521 return SQLITE_TOOBIG;
83522 }
83523 sqlite3VdbeMemSetZeroBlob(pCtx->pOut, (int)n);
83524 return SQLITE_OK;
83525}
83527 pCtx->isError = errCode ? errCode : -1;
83528#ifdef SQLITE_DEBUG
83529 if( pCtx->pVdbe ) pCtx->pVdbe->rcApp = errCode;
SQLITE_API void sqlite3_result_error_code(sqlite3_context *, int)
Definition sqlite3.c:83520

References SQLITE_TOOBIG.

Referenced by attachFunc(), renameColumnFunc(), and renameTableFunc().

◆ sqlite3_result_error_nomem()

SQLITE_API void sqlite3_result_error_nomem ( sqlite3_context * pCtx)

◆ sqlite3_result_error_toobig()

SQLITE_API void sqlite3_result_error_toobig ( sqlite3_context * pCtx)

Definition at line 83532 of file sqlite3.c.

Referenced by contextMalloc(), invokeValueDestructor(), replaceFunc(), and strftimeFunc().

◆ sqlite3_result_int()

◆ sqlite3_result_int64()

SQLITE_API void sqlite3_result_int64 ( sqlite3_context * pCtx,
sqlite3_int64 iVal )

Definition at line 83423 of file sqlite3.c.

83425 {
83426 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );

Referenced by absFunc(), countInverse(), lcontext_result(), randomFunc(), and statGet().

◆ sqlite3_result_null()

SQLITE_API void sqlite3_result_null ( sqlite3_context * pCtx)

Definition at line 83427 of file sqlite3.c.

83429 {
83430 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );

Referenced by absFunc(), lcontext_result(), and lcontext_result_null().

◆ sqlite3_result_pointer()

SQLITE_API void sqlite3_result_pointer ( sqlite3_context * pCtx,
void * pPtr,
const char * zPType,
void(*)(void *) xDestructor )

Definition at line 83431 of file sqlite3.c.

83433 {
83434 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83436}
83438 sqlite3_context *pCtx,
83439 void *pPtr,
83440 const char *zPType,
83441 void (*xDestructor)(void*)
83442){
SQLITE_API void sqlite3_result_pointer(sqlite3_context *, void *, const char *, void(*)(void *))
Definition sqlite3.c:83431
SQLITE_PRIVATE void sqlite3VdbeMemSetNull(Mem *)
Definition sqlite3.c:76646

◆ sqlite3_result_subtype()

SQLITE_API void sqlite3_result_subtype ( sqlite3_context * pCtx,
unsigned int eSubtype )

Definition at line 83443 of file sqlite3.c.

◆ sqlite3_result_text()

SQLITE_API void sqlite3_result_text ( sqlite3_context * pCtx,
const char * z,
int n,
void(*)(void *) xDel )

Definition at line 83449 of file sqlite3.c.

83449 {
83450 Mem *pOut = pCtx->pOut;
83451 assert( sqlite3_mutex_held(pOut->db->mutex) );
83452 pOut->eSubtype = eSubtype & 0xff;
83453 pOut->flags |= MEM_Subtype;
83454}
83456 sqlite3_context *pCtx,
83457 const char *z,
SQLITE_API void sqlite3_result_text(sqlite3_context *, const char *, int, void(*)(void *))
Definition sqlite3.c:83449
#define MEM_Subtype
Definition sqlite3.c:20972

References sqlite3_value::db, sqlite3_value::eSubtype, sqlite3_value::flags, MEM_Subtype, sqlite3::mutex, sqlite3_context::pOut, and sqlite3_mutex_held().

Referenced by dateFunc(), datetimeFunc(), lcontext_result(), lcontext_result_text(), quoteFunc(), renameEditSql(), replaceFunc(), sourceidFunc(), statGet(), strftimeFunc(), and timeFunc().

◆ sqlite3_result_text16()

SQLITE_API void sqlite3_result_text16 ( sqlite3_context * pCtx,
const void * z,
int n,
void(*)(void *) xDel )

Definition at line 83475 of file sqlite3.c.

83476 {
83477 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
83478 }
83479}
83480#ifndef SQLITE_OMIT_UTF16
83482 sqlite3_context *pCtx,
83483 const void *z,
SQLITE_API void sqlite3_result_text16(sqlite3_context *, const void *, int, void(*)(void *))
Definition sqlite3.c:83475

◆ sqlite3_result_text16be()

SQLITE_API void sqlite3_result_text16be ( sqlite3_context * pCtx,
const void * z,
int n,
void(*)(void *) xDel )

Definition at line 83484 of file sqlite3.c.

83486 {
83487 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83488 setResultStrOrError(pCtx, z, n, SQLITE_UTF16NATIVE, xDel);
83489}
83491 sqlite3_context *pCtx,
83492 const void *z,
SQLITE_API void sqlite3_result_text16be(sqlite3_context *, const void *, int, void(*)(void *))
Definition sqlite3.c:83484

References sqlite3_value::db, sqlite3::mutex, sqlite3_context::pOut, setResultStrOrError(), sqlite3_mutex_held(), and SQLITE_UTF16NATIVE.

◆ sqlite3_result_text16le()

SQLITE_API void sqlite3_result_text16le ( sqlite3_context * pCtx,
const void * z,
int n,
void(*)(void *) xDel )

Definition at line 83493 of file sqlite3.c.

83495 {
83496 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83497 setResultStrOrError(pCtx, z, n, SQLITE_UTF16BE, xDel);
83498}
83500 sqlite3_context *pCtx,
83501 const void *z,
#define SQLITE_UTF16BE
Definition sqlite3.c:6254
SQLITE_API void sqlite3_result_text16le(sqlite3_context *, const void *, int, void(*)(void *))
Definition sqlite3.c:83493

References sqlite3_value::db, sqlite3::mutex, sqlite3_context::pOut, setResultStrOrError(), sqlite3_mutex_held(), and SQLITE_UTF16BE.

◆ sqlite3_result_text64()

SQLITE_API void sqlite3_result_text64 ( sqlite3_context * pCtx,
const char * z,
sqlite3_uint64 n,
void(*)(void *) xDel,
unsigned char encoding )

Definition at line 83458 of file sqlite3.c.

83460 {
83461 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83462 setResultStrOrError(pCtx, z, n, SQLITE_UTF8, xDel);
83463}
83465 sqlite3_context *pCtx,
83466 const char *z,
83468 void (*xDel)(void *),
83469 unsigned char enc
83470){
83471 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83472 assert( xDel!=SQLITE_DYNAMIC );
83473 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
SQLITE_API void sqlite3_result_text64(sqlite3_context *, const char *, sqlite3_uint64, void(*)(void *), unsigned char encoding)
Definition sqlite3.c:83458

References sqlite3_value::db, sqlite3::mutex, sqlite3_context::pOut, setResultStrOrError(), sqlite3_mutex_held(), and SQLITE_UTF8.

Referenced by charFunc(), and substrFunc().

◆ sqlite3_result_value()

SQLITE_API void sqlite3_result_value ( sqlite3_context * pCtx,
sqlite3_value * pValue )

Definition at line 83503 of file sqlite3.c.

83504 {
83505 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83506 setResultStrOrError(pCtx, z, n, SQLITE_UTF16LE, xDel);
#define SQLITE_UTF16LE
Definition sqlite3.c:6253

References sqlite3_value::db, sqlite3::mutex, sqlite3_context::pOut, setResultStrOrError(), sqlite3_mutex_held(), and SQLITE_UTF16LE.

Referenced by last_valueFinalizeFunc(), nullifFunc(), quoteFunc(), and replaceFunc().

◆ sqlite3_result_zeroblob()

SQLITE_API void sqlite3_result_zeroblob ( sqlite3_context * pCtx,
int n )

Definition at line 83507 of file sqlite3.c.

83509 {
83510 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );

◆ sqlite3_result_zeroblob64()

SQLITE_API int sqlite3_result_zeroblob64 ( sqlite3_context * pCtx,
sqlite3_uint64 n )

Definition at line 83511 of file sqlite3.c.

83513 {
83514 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83516}
83518 Mem *pOut = pCtx->pOut;
83519 assert( sqlite3_mutex_held(pOut->db->mutex) );
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *, sqlite3_uint64 n)
Definition sqlite3.c:83511

◆ sqlite3_rollback_hook()

SQLITE_API void * sqlite3_rollback_hook ( sqlite3 * db,
void(*)(void *) xCallback,
void * pArg )

Definition at line 163206 of file sqlite3.c.

163216 {
163217 void *pRet;
163218
163219#ifdef SQLITE_ENABLE_API_ARMOR
163220 if( !sqlite3SafetyCheckOk(db) ){
163221 (void)SQLITE_MISUSE_BKPT;
163222 return 0;
163223 }
163224#endif

Referenced by db_rollback_hook().

◆ sqlite3_rtree_geometry_callback()

SQLITE_API int sqlite3_rtree_geometry_callback ( sqlite3 * db,
const char * zGeom,
int(*)(sqlite3_rtree_geometry *, int, sqlite3_rtree_dbl *, int *) xGeom,
void * pContext )

◆ sqlite3_rtree_query_callback()

SQLITE_API int sqlite3_rtree_query_callback ( sqlite3 * db,
const char * zQueryFunc,
int(*)(sqlite3_rtree_query_info *) xQueryFunc,
void * pContext,
void(*)(void *) xDestructor )

◆ sqlite3_serialize()

SQLITE_API unsigned char * sqlite3_serialize ( sqlite3 * db,
const char * zSchema,
sqlite3_int64 * piSize,
unsigned int mFlags )

◆ sqlite3_set_authorizer()

SQLITE_API int sqlite3_set_authorizer ( sqlite3 * db,
int(*)(void *, int, const char *, const char *, const char *, const char *) xAuth,
void * pUserData )

Definition at line 110182 of file sqlite3.c.

110192 {
110193#ifdef SQLITE_ENABLE_API_ARMOR
110194 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
110195#endif

References sqlite3::mutex, sqlite3::pAuthArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3ExpirePreparedStatements(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_OK, and sqlite3::xAuth.

◆ sqlite3_set_auxdata()

SQLITE_API void sqlite3_set_auxdata ( sqlite3_context * pCtx,
int N,
void * pAux,
void(*)(void *) xDelete )

Definition at line 83916 of file sqlite3.c.

83918 : If iArg is negative then make the data available
83919** to all functions within the current prepared statement using iArg as an
83920** access code.
83921*/
83923 sqlite3_context *pCtx,
83924 int iArg,
83925 void *pAux,
83926 void (*xDelete)(void*)
83927){
83928 AuxData *pAuxData;
83929 Vdbe *pVdbe = pCtx->pVdbe;
83930
83931 assert( sqlite3_mutex_held(pCtx->pOut->db->mutex) );
83932#ifdef SQLITE_ENABLE_STAT4
83933 if( pVdbe==0 ) goto failed;
83934#else
83935 assert( pVdbe!=0 );
83936#endif
83937
83938 for(pAuxData=pVdbe->pAuxData; pAuxData; pAuxData=pAuxData->pNextAux){
83939 if( pAuxData->iAuxArg==iArg && (pAuxData->iAuxOp==pCtx->iOp || iArg<0) ){
83940 break;
83941 }
83942 }
83943 if( pAuxData==0 ){
83944 pAuxData = sqlite3DbMallocZero(pVdbe->db, sizeof(AuxData));
83945 if( !pAuxData ) goto failed;
83946 pAuxData->iAuxOp = pCtx->iOp;
83947 pAuxData->iAuxArg = iArg;
83948 pAuxData->pNextAux = pVdbe->pAuxData;
83949 pVdbe->pAuxData = pAuxData;
83950 if( pCtx->isError==0 ) pCtx->isError = -1;
83951 }else if( pAuxData->xDeleteAux ){
83952 pAuxData->xDeleteAux(pAuxData->pAux);
83953 }
83954
83955 pAuxData->pAux = pAux;
83956 pAuxData->xDeleteAux = xDelete;
83957 return;
SQLITE_API void sqlite3_set_auxdata(sqlite3_context *, int N, void *, void(*)(void *))
Definition sqlite3.c:83916
void(* xDeleteAux)(void *)
Definition sqlite3.c:21016
void * pAux
Definition sqlite3.c:21015
int iAuxArg
Definition sqlite3.c:21014
int iAuxOp
Definition sqlite3.c:21013

References sqlite3_value::db, Vdbe::db, AuxData::iAuxArg, AuxData::iAuxOp, sqlite3_context::iOp, sqlite3_context::isError, sqlite3::mutex, AuxData::pAux, Vdbe::pAuxData, AuxData::pNextAux, sqlite3_context::pOut, sqlite3_context::pVdbe, sqlite3_mutex_held(), sqlite3DbMallocZero(), and AuxData::xDeleteAux.

◆ sqlite3_set_last_insert_rowid()

SQLITE_API void sqlite3_set_last_insert_rowid ( sqlite3 * db,
sqlite3_int64 iRowid )

Definition at line 162067 of file sqlite3.c.

162073 {
162074#ifdef SQLITE_ENABLE_API_ARMOR
162075 if( !sqlite3SafetyCheckOk(db) ){
162076 (void)SQLITE_MISUSE_BKPT;
162077 return;

◆ sqlite3_shutdown()

SQLITE_API int sqlite3_shutdown ( void )

Definition at line 161371 of file sqlite3.c.

161377 {
161378#ifdef SQLITE_OMIT_WSD
161379 int rc = sqlite3_wsd_init(4096, 24);
161380 if( rc!=SQLITE_OK ){
161381 return rc;
161382 }
161383#endif
161384
161385 if( sqlite3GlobalConfig.isInit ){
161386#ifdef SQLITE_EXTRA_SHUTDOWN
161387 void SQLITE_EXTRA_SHUTDOWN(void);
161388 SQLITE_EXTRA_SHUTDOWN();
161389#endif
161390 sqlite3_os_end();
161392 sqlite3GlobalConfig.isInit = 0;
161393 }
161394 if( sqlite3GlobalConfig.isPCacheInit ){
161396 sqlite3GlobalConfig.isPCacheInit = 0;
161397 }
161398 if( sqlite3GlobalConfig.isMallocInit ){
161400 sqlite3GlobalConfig.isMallocInit = 0;
161401
161402#ifndef SQLITE_OMIT_SHUTDOWN_DIRECTORIES
161403 /* The heap subsystem has now been shutdown and these values are supposed
161404 ** to be NULL or point to memory that was obtained from sqlite3_malloc(),
161405 ** which would rely on that heap subsystem; therefore, make sure these
161406 ** values cannot refer to heap memory that was just invalidated when the
161407 ** heap subsystem was shutdown. This is only done if the current call to
161408 ** this function resulted in the heap subsystem actually being shutdown.
161409 */
161412#endif
161413 }
161414 if( sqlite3GlobalConfig.isMutexInit ){
SQLITE_API int sqlite3_os_end(void)
Definition sqlite3.c:41473
SQLITE_PRIVATE void sqlite3MallocEnd(void)
Definition sqlite3.c:27500
SQLITE_API char * sqlite3_temp_directory
Definition sqlite3.c:7084
SQLITE_API void sqlite3_reset_auto_extension(void)
Definition sqlite3.c:125025
SQLITE_API char * sqlite3_data_directory
Definition sqlite3.c:7121
SQLITE_PRIVATE void sqlite3PcacheShutdown(void)
Definition sqlite3.c:49142

References sqlite3_data_directory, sqlite3_os_end(), sqlite3_reset_auto_extension(), sqlite3_temp_directory, sqlite3GlobalConfig, sqlite3MallocEnd(), sqlite3MutexEnd(), sqlite3PcacheShutdown(), and SQLITE_OK.

◆ sqlite3_sleep()

SQLITE_API int sqlite3_sleep ( int ms)

Definition at line 164752 of file sqlite3.c.

164758 {
164759 sqlite3_vfs *pVfs;
164760 int rc;
164761 pVfs = sqlite3_vfs_find(0);
164762 if( pVfs==0 ) return 0;
164763

◆ sqlite3_snapshot_cmp()

SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp ( sqlite3_snapshot * p1,
sqlite3_snapshot * p2 )

◆ sqlite3_snapshot_free()

SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free ( sqlite3_snapshot * )

◆ sqlite3_snapshot_get()

SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get ( sqlite3 * db,
const char * zSchema,
sqlite3_snapshot ** ppSnapshot )

◆ sqlite3_snapshot_open()

SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open ( sqlite3 * db,
const char * zSchema,
sqlite3_snapshot * pSnapshot )

◆ sqlite3_snapshot_recover()

SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover ( sqlite3 * db,
const char * zDb )

◆ sqlite3_snprintf()

SQLITE_API char * sqlite3_snprintf ( int n,
char * zBuf,
const char * zFormat,
... )

◆ sqlite3_soft_heap_limit()

SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit ( int N)

Definition at line 27432 of file sqlite3.c.

◆ sqlite3_soft_heap_limit64()

SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64 ( sqlite3_int64 N)

Definition at line 27407 of file sqlite3.c.

27412 {
27413 sqlite3_int64 priorLimit;
27414 sqlite3_int64 excess;
27415 sqlite3_int64 nUsed;
27416#ifndef SQLITE_OMIT_AUTOINIT
27417 int rc = sqlite3_initialize();
27418 if( rc ) return -1;
27419#endif
27421 priorLimit = mem0.alarmThreshold;
27422 if( n<0 ){
27424 return priorLimit;
27425 }
27426 if( mem0.hardLimit>0 && (n>mem0.hardLimit || n==0) ){
27427 n = mem0.hardLimit;
27428 }
27429 mem0.alarmThreshold = n;
27431 AtomicStore(&mem0.nearlyFull, n>0 && n<=nUsed);
SQLITE_PRIVATE sqlite3_int64 sqlite3StatusValue(int)
Definition sqlite3.c:21382
#define AtomicStore(PTR, VAL)
Definition sqlite3.c:13477

References AtomicStore, mem0, sqlite3_initialize(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3StatusValue(), and SQLITE_STATUS_MEMORY_USED.

Referenced by sqlite3Pragma().

◆ sqlite3_sourceid()

SQLITE_API const char * sqlite3_sourceid ( void )

Definition at line 230510 of file sqlite3.c.

References SQLITE_SOURCE_ID.

Referenced by sourceidFunc(), and sqlite3CorruptError().

◆ sqlite3_sql()

SQLITE_API const char * sqlite3_sql ( sqlite3_stmt * pStmt)

Definition at line 84731 of file sqlite3.c.

Referenced by sqlite3_expanded_sql(), and sqlite3Reprepare().

◆ sqlite3_status()

SQLITE_API int sqlite3_status ( int op,
int * pCurrent,
int * pHighwater,
int resetFlag )

Definition at line 21472 of file sqlite3.c.

21477 {
21478 sqlite3_int64 iCur = 0, iHwtr = 0;
21479 int rc;
21480#ifdef SQLITE_ENABLE_API_ARMOR
21481 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
21482#endif
21483 rc = sqlite3_status64(op, &iCur, &iHwtr, resetFlag);
21484 if( rc==0 ){
SQLITE_API int sqlite3_status64(int op, sqlite3_int64 *pCurrent, sqlite3_int64 *pHighwater, int resetFlag)
Definition sqlite3.c:21447

◆ sqlite3_status64()

SQLITE_API int sqlite3_status64 ( int op,
sqlite3_int64 * pCurrent,
sqlite3_int64 * pHighwater,
int resetFlag )

Definition at line 21447 of file sqlite3.c.

21457 {
21458 sqlite3_mutex *pMutex;
21460 if( op<0 || op>=ArraySize(wsdStat.nowValue) ){
21461 return SQLITE_MISUSE_BKPT;
21462 }
21463#ifdef SQLITE_ENABLE_API_ARMOR
21464 if( pCurrent==0 || pHighwater==0 ) return SQLITE_MISUSE_BKPT;
21465#endif
21467 sqlite3_mutex_enter(pMutex);
21468 *pCurrent = wsdStat.nowValue[op];
21469 *pHighwater = wsdStat.mxValue[op];
21470 if( resetFlag ){
21471 wsdStat.mxValue[op] = wsdStat.nowValue[op];
static const char statMutex[]
Definition sqlite3.c:21350
SQLITE_PRIVATE sqlite3_mutex * sqlite3Pcache1Mutex(void)
Definition sqlite3.c:50974
#define wsdStat
Definition sqlite3.c:21375
#define wsdStatInit
Definition sqlite3.c:21374
SQLITE_PRIVATE sqlite3_mutex * sqlite3MallocMutex(void)
Definition sqlite3.c:27374

Referenced by sqlite3_memory_highwater().

◆ sqlite3_step()

SQLITE_API int sqlite3_step ( sqlite3_stmt * pStmt)

Definition at line 83730 of file sqlite3.c.

83736 {
83737 int rc = SQLITE_OK; /* Result from sqlite3Step() */
83738 Vdbe *v = (Vdbe*)pStmt; /* the prepared statement */
83739 int cnt = 0; /* Counter to prevent infinite loop of reprepares */
83740 sqlite3 *db; /* The database connection */
83741
83742 if( vdbeSafetyNotNull(v) ){
83743 return SQLITE_MISUSE_BKPT;
83744 }
83745 db = v->db;
83747 v->doingRerun = 0;
83748 while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
83749 && cnt++ < SQLITE_MAX_SCHEMA_RETRY ){
83750 int savedPc = v->pc;
83751 rc = sqlite3Reprepare(v);
83752 if( rc!=SQLITE_OK ){
83753 /* This case occurs after failing to recompile an sql statement.
83754 ** The error message from the SQL compiler has already been loaded
83755 ** into the database handle. This block copies the error message
83756 ** from the database handle into the statement and sets the statement
83757 ** program counter to 0 to ensure that when the statement is
83758 ** finalized or reset the parser error message is available via
83759 ** sqlite3_errmsg() and sqlite3_errcode().
83760 */
83761 const char *zErr = (const char *)sqlite3_value_text(db->pErr);
83762 sqlite3DbFree(db, v->zErrMsg);
83763 if( !db->mallocFailed ){
83764 v->zErrMsg = sqlite3DbStrDup(db, zErr);
83765 v->rc = rc = sqlite3ApiExit(db, rc);
83766 } else {
83767 v->zErrMsg = 0;
83768 v->rc = rc = SQLITE_NOMEM_BKPT;
83769 }
83770 break;
83771 }
83772 sqlite3_reset(pStmt);
static int vdbeSafetyNotNull(Vdbe *p)
Definition sqlite3.c:83028
static int sqlite3Step(Vdbe *p)
Definition sqlite3.c:83596
SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt)
Definition sqlite3.c:83107
SQLITE_PRIVATE int sqlite3Reprepare(Vdbe *)
Definition sqlite3.c:129095
u8 doingRerun
Definition sqlite3.c:21126
char * zErrMsg
Definition sqlite3.c:21113
int pc
Definition sqlite3.c:21092

References Vdbe::db, Vdbe::doingRerun, Vdbe::expired, sqlite3::mallocFailed, sqlite3::mutex, Vdbe::pc, sqlite3::pErr, Vdbe::rc, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3_reset(), sqlite3_value_text(), sqlite3ApiExit(), sqlite3DbFree(), sqlite3DbStrDup(), sqlite3Reprepare(), sqlite3Step(), SQLITE_MAX_SCHEMA_RETRY, SQLITE_MISUSE_BKPT, SQLITE_NOMEM_BKPT, SQLITE_OK, SQLITE_SCHEMA, vdbeSafetyNotNull(), and Vdbe::zErrMsg.

Referenced by blobSeekToRow(), execSql(), sqlite3_exec(), and stepvm().

◆ sqlite3_stmt_busy()

SQLITE_API int sqlite3_stmt_busy ( sqlite3_stmt * pStmt)

Definition at line 84669 of file sqlite3.c.

84669 : 0;
84670}
84671
84672/*

◆ sqlite3_stmt_isexplain()

SQLITE_API int sqlite3_stmt_isexplain ( sqlite3_stmt * pStmt)

Definition at line 84662 of file sqlite3.c.

◆ sqlite3_stmt_readonly()

SQLITE_API int sqlite3_stmt_readonly ( sqlite3_stmt * pStmt)

Definition at line 84654 of file sqlite3.c.

◆ sqlite3_stmt_scanstatus()

SQLITE_API int sqlite3_stmt_scanstatus ( sqlite3_stmt * pStmt,
int idx,
int iScanStatusOp,
void * pOut )

◆ sqlite3_stmt_scanstatus_reset()

SQLITE_API void sqlite3_stmt_scanstatus_reset ( sqlite3_stmt * )

◆ sqlite3_stmt_status()

SQLITE_API int sqlite3_stmt_status ( sqlite3_stmt * pStmt,
int op,
int resetFlg )

Definition at line 84701 of file sqlite3.c.

84707 {
84708 Vdbe *pVdbe = (Vdbe*)pStmt;
84709 u32 v;
84710#ifdef SQLITE_ENABLE_API_ARMOR
84711 if( !pStmt
84712 || (op!=SQLITE_STMTSTATUS_MEMUSED && (op<0||op>=ArraySize(pVdbe->aCounter)))
84713 ){
84714 (void)SQLITE_MISUSE_BKPT;
84715 return 0;
84716 }
84717#endif
84718 if( op==SQLITE_STMTSTATUS_MEMUSED ){
84719 sqlite3 *db = pVdbe->db;
84721 v = 0;
84722 db->pnBytesFreed = (int*)&v;
84723 sqlite3VdbeClearObject(db, pVdbe);
84724 sqlite3DbFree(db, pVdbe);
84725 db->pnBytesFreed = 0;
#define SQLITE_STMTSTATUS_MEMUSED
Definition sqlite3.c:9300
u32 aCounter[7]
Definition sqlite3.c:21136

◆ sqlite3_str_append()

SQLITE_API void sqlite3_str_append ( sqlite3_str * p,
const char * zIn,
int N )

Definition at line 29123 of file sqlite3.c.

29129 {
29130 assert( z!=0 || N==0 );
29131 assert( p->zText!=0 || p->nChar==0 || p->accError );
29132 assert( N>=0 );
29133 assert( p->accError==0 || p->nAlloc==0 || p->mxAlloc==0 );
29134 if( p->nChar+N >= p->nAlloc ){
29135 enlargeAndAppend(p,z,N);
static void SQLITE_NOINLINE enlargeAndAppend(StrAccum *p, const char *z, int N)
Definition sqlite3.c:29111
char * zText
Definition sqlite3.c:18970

Referenced by explainAppendTerm(), explainIndexRange(), sqlite3_str_vappendf(), sqlite3RunParser(), sqlite3VdbeDisplayP4(), sqlite3VdbeExpandSql(), and sqlite3WhereExplainOneScan().

◆ sqlite3_str_appendall()

SQLITE_API void sqlite3_str_appendall ( sqlite3_str * p,
const char * zIn )

◆ sqlite3_str_appendchar()

SQLITE_API void sqlite3_str_appendchar ( sqlite3_str * p,
int N,
char C )

Definition at line 29095 of file sqlite3.c.

29101 {

Referenced by sqlite3_str_vappendf().

◆ sqlite3_str_appendf()

SQLITE_API void sqlite3_str_appendf ( sqlite3_str * p,
const char * zFormat,
... )

◆ sqlite3_str_errcode()

SQLITE_API int sqlite3_str_errcode ( sqlite3_str * p)

Definition at line 29197 of file sqlite3.c.

◆ sqlite3_str_finish()

SQLITE_API char * sqlite3_str_finish ( sqlite3_str * p)

Definition at line 29185 of file sqlite3.c.

29185 {
29186 0, 0, 0, 0, 0, SQLITE_NOMEM, 0
29187};
29188
29189/* Finalize a string created using sqlite3_str_new().
29190*/
29192 char *z;
29193 if( p!=0 && p!=&sqlite3OomStr ){
29194 z = sqlite3StrAccumFinish(p);
static sqlite3_str sqlite3OomStr
Definition sqlite3.c:29179
SQLITE_API char * sqlite3_str_finish(sqlite3_str *)
Definition sqlite3.c:29185
SQLITE_PRIVATE char * sqlite3StrAccumFinish(StrAccum *)
Definition sqlite3.c:29163

References SQLITE_NOMEM.

Referenced by sqlite3RunParser().

◆ sqlite3_str_length()

SQLITE_API int sqlite3_str_length ( sqlite3_str * p)

Definition at line 29202 of file sqlite3.c.

29203 {
29204 return p ? p->accError : SQLITE_NOMEM;

References sqlite3_str::accError, and SQLITE_NOMEM.

◆ sqlite3_str_new()

SQLITE_API sqlite3_str * sqlite3_str_new ( sqlite3 * db)

Definition at line 29251 of file sqlite3.c.

29257 {
29258 sqlite3_str *p = sqlite3_malloc64(sizeof(*p));
29259 if( p ){
29260 sqlite3StrAccumInit(p, 0, 0, 0,
SQLITE_PRIVATE void sqlite3StrAccumInit(StrAccum *, sqlite3 *, char *, int, int)
Definition sqlite3.c:29240

Referenced by sqlite3RunParser().

◆ sqlite3_str_reset()

SQLITE_API void sqlite3_str_reset ( sqlite3_str * p)

Definition at line 29216 of file sqlite3.c.

29222 {
29223 if( isMalloced(p) ){
29224 sqlite3DbFree(p->db, p->zText);
#define isMalloced(X)
Definition sqlite3.c:18981
sqlite3 * db
Definition sqlite3.c:18969

Referenced by sqlite3BtreeIntegrityCheck(), sqlite3StrAccumEnlarge(), and sqlite3VdbeExpandSql().

◆ sqlite3_str_value()

SQLITE_API char * sqlite3_str_value ( sqlite3_str * p)

Definition at line 29207 of file sqlite3.c.

29208 {
29209 return p ? p->nChar : 0;
29210}
29211

References sqlite3_str::nChar.

◆ sqlite3_str_vappendf()

SQLITE_API void sqlite3_str_vappendf ( sqlite3_str * pAccum,
const char * zFormat,
va_list ap )

Definition at line 28341 of file sqlite3.c.

28351 {
28352 int c; /* Next character in the format string */
28353 char *bufpt; /* Pointer to the conversion buffer */
28354 int precision; /* Precision of the current field */
28355 int length; /* Length of the field */
28356 int idx; /* A general purpose loop counter */
28357 int width; /* Width of the current field */
28358 etByte flag_leftjustify; /* True if "-" flag is present */
28359 etByte flag_prefix; /* '+' or ' ' or 0 for prefix */
28360 etByte flag_alternateform; /* True if "#" flag is present */
28361 etByte flag_altform2; /* True if "!" flag is present */
28362 etByte flag_zeropad; /* True if field width constant starts with zero */
28363 etByte flag_long; /* 1 for the "l" flag, 2 for "ll", 0 by default */
28364 etByte done; /* Loop termination flag */
28365 etByte cThousand; /* Thousands separator for %d and %u */
28366 etByte xtype = etINVALID; /* Conversion paradigm */
28367 u8 bArgList; /* True for SQLITE_PRINTF_SQLFUNC */
28368 char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */
28369 sqlite_uint64 longvalue; /* Value for integer types */
28370 LONGDOUBLE_TYPE realvalue; /* Value for real types */
28371 const et_info *infop; /* Pointer to the appropriate info structure */
28372 char *zOut; /* Rendering buffer */
28373 int nOut; /* Size of the rendering buffer */
28374 char *zExtra = 0; /* Malloced memory used by some conversion */
28375#ifndef SQLITE_OMIT_FLOATING_POINT
28376 int exp, e2; /* exponent of real numbers */
28377 int nsd; /* Number of significant digits returned */
28378 double rounder; /* Used for rounding floating point values */
28379 etByte flag_dp; /* True if decimal point should be shown */
28380 etByte flag_rtz; /* True if trailing zeros should be removed */
28381#endif
28382 PrintfArguments *pArgList = 0; /* Arguments for SQLITE_PRINTF_SQLFUNC */
28383 char buf[etBUFSIZE]; /* Conversion buffer */
28384
28385 /* pAccum never starts out with an empty buffer that was obtained from
28386 ** malloc(). This precondition is required by the mprintf("%z...")
28387 ** optimization. */
28388 assert( pAccum->nChar>0 || (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 );
28389
28390 bufpt = 0;
28391 if( (pAccum->printfFlags & SQLITE_PRINTF_SQLFUNC)!=0 ){
28392 pArgList = va_arg(ap, PrintfArguments*);
28393 bArgList = 1;
28394 }else{
28395 bArgList = 0;
28396 }
28397 for(; (c=(*fmt))!=0; ++fmt){
28398 if( c!='%' ){
28399 bufpt = (char *)fmt;
28400#if HAVE_STRCHRNUL
28401 fmt = strchrnul(fmt, '%');
28402#else
28403 do{ fmt++; }while( *fmt && *fmt != '%' );
28404#endif
28405 sqlite3_str_append(pAccum, bufpt, (int)(fmt - bufpt));
28406 if( *fmt==0 ) break;
28407 }
28408 if( (c=(*++fmt))==0 ){
28409 sqlite3_str_append(pAccum, "%", 1);
28410 break;
28411 }
28412 /* Find out what flags are present */
28413 flag_leftjustify = flag_prefix = cThousand =
28414 flag_alternateform = flag_altform2 = flag_zeropad = 0;
28415 done = 0;
28416 width = 0;
28417 flag_long = 0;
28418 precision = -1;
28419 do{
28420 switch( c ){
28421 case '-': flag_leftjustify = 1; break;
28422 case '+': flag_prefix = '+'; break;
28423 case ' ': flag_prefix = ' '; break;
28424 case '#': flag_alternateform = 1; break;
28425 case '!': flag_altform2 = 1; break;
28426 case '0': flag_zeropad = 1; break;
28427 case ',': cThousand = ','; break;
28428 default: done = 1; break;
28429 case 'l': {
28430 flag_long = 1;
28431 c = *++fmt;
28432 if( c=='l' ){
28433 c = *++fmt;
28434 flag_long = 2;
28435 }
28436 done = 1;
28437 break;
28438 }
28439 case '1': case '2': case '3': case '4': case '5':
28440 case '6': case '7': case '8': case '9': {
28441 unsigned wx = c - '0';
28442 while( (c = *++fmt)>='0' && c<='9' ){
28443 wx = wx*10 + c - '0';
28444 }
28445 testcase( wx>0x7fffffff );
28446 width = wx & 0x7fffffff;
28447#ifdef SQLITE_PRINTF_PRECISION_LIMIT
28448 if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
28449 width = SQLITE_PRINTF_PRECISION_LIMIT;
28450 }
28451#endif
28452 if( c!='.' && c!='l' ){
28453 done = 1;
28454 }else{
28455 fmt--;
28456 }
28457 break;
28458 }
28459 case '*': {
28460 if( bArgList ){
28461 width = (int)getIntArg(pArgList);
28462 }else{
28463 width = va_arg(ap,int);
28464 }
28465 if( width<0 ){
28466 flag_leftjustify = 1;
28467 width = width >= -2147483647 ? -width : 0;
28468 }
28469#ifdef SQLITE_PRINTF_PRECISION_LIMIT
28470 if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
28471 width = SQLITE_PRINTF_PRECISION_LIMIT;
28472 }
28473#endif
28474 if( (c = fmt[1])!='.' && c!='l' ){
28475 c = *++fmt;
28476 done = 1;
28477 }
28478 break;
28479 }
28480 case '.': {
28481 c = *++fmt;
28482 if( c=='*' ){
28483 if( bArgList ){
28484 precision = (int)getIntArg(pArgList);
28485 }else{
28486 precision = va_arg(ap,int);
28487 }
28488 if( precision<0 ){
28489 precision = precision >= -2147483647 ? -precision : -1;
28490 }
28491 c = *++fmt;
28492 }else{
28493 unsigned px = 0;
28494 while( c>='0' && c<='9' ){
28495 px = px*10 + c - '0';
28496 c = *++fmt;
28497 }
28498 testcase( px>0x7fffffff );
28499 precision = px & 0x7fffffff;
28500 }
28501#ifdef SQLITE_PRINTF_PRECISION_LIMIT
28502 if( precision>SQLITE_PRINTF_PRECISION_LIMIT ){
28503 precision = SQLITE_PRINTF_PRECISION_LIMIT;
28504 }
28505#endif
28506 if( c=='l' ){
28507 --fmt;
28508 }else{
28509 done = 1;
28510 }
28511 break;
28512 }
28513 }
28514 }while( !done && (c=(*++fmt))!=0 );
28515
28516 /* Fetch the info entry for the field */
28517 infop = &fmtinfo[0];
28518 xtype = etINVALID;
28519 for(idx=0; idx<ArraySize(fmtinfo); idx++){
28520 if( c==fmtinfo[idx].fmttype ){
28521 infop = &fmtinfo[idx];
28522 xtype = infop->type;
28523 break;
28524 }
28525 }
28526
28527 /*
28528 ** At this point, variables are initialized as follows:
28529 **
28530 ** flag_alternateform TRUE if a '#' is present.
28531 ** flag_altform2 TRUE if a '!' is present.
28532 ** flag_prefix '+' or ' ' or zero
28533 ** flag_leftjustify TRUE if a '-' is present or if the
28534 ** field width was negative.
28535 ** flag_zeropad TRUE if the width began with 0.
28536 ** flag_long 1 for "l", 2 for "ll"
28537 ** width The specified field width. This is
28538 ** always non-negative. Zero is the default.
28539 ** precision The specified precision. The default
28540 ** is -1.
28541 ** xtype The class of the conversion.
28542 ** infop Pointer to the appropriate info struct.
28543 */
28544 assert( width>=0 );
28545 assert( precision>=(-1) );
28546 switch( xtype ){
28547 case etPOINTER:
28548 flag_long = sizeof(char*)==sizeof(i64) ? 2 :
28549 sizeof(char*)==sizeof(long int) ? 1 : 0;
28550 /* no break */ deliberate_fall_through
28551 case etORDINAL:
28552 case etRADIX:
28553 cThousand = 0;
28554 /* no break */ deliberate_fall_through
28555 case etDECIMAL:
28556 if( infop->flags & FLAG_SIGNED ){
28557 i64 v;
28558 if( bArgList ){
28559 v = getIntArg(pArgList);
28560 }else if( flag_long ){
28561 if( flag_long==2 ){
28562 v = va_arg(ap,i64) ;
28563 }else{
28564 v = va_arg(ap,long int);
28565 }
28566 }else{
28567 v = va_arg(ap,int);
28568 }
28569 if( v<0 ){
28570 if( v==SMALLEST_INT64 ){
28571 longvalue = ((u64)1)<<63;
28572 }else{
28573 longvalue = -v;
28574 }
28575 prefix = '-';
28576 }else{
28577 longvalue = v;
28578 prefix = flag_prefix;
28579 }
28580 }else{
28581 if( bArgList ){
28582 longvalue = (u64)getIntArg(pArgList);
28583 }else if( flag_long ){
28584 if( flag_long==2 ){
28585 longvalue = va_arg(ap,u64);
28586 }else{
28587 longvalue = va_arg(ap,unsigned long int);
28588 }
28589 }else{
28590 longvalue = va_arg(ap,unsigned int);
28591 }
28592 prefix = 0;
28593 }
28594 if( longvalue==0 ) flag_alternateform = 0;
28595 if( flag_zeropad && precision<width-(prefix!=0) ){
28596 precision = width-(prefix!=0);
28597 }
28598 if( precision<etBUFSIZE-10-etBUFSIZE/3 ){
28599 nOut = etBUFSIZE;
28600 zOut = buf;
28601 }else{
28602 u64 n;
28603 n = (u64)precision + 10;
28604 if( cThousand ) n += precision/3;
28605 zOut = zExtra = printfTempBuf(pAccum, n);
28606 if( zOut==0 ) return;
28607 nOut = (int)n;
28608 }
28609 bufpt = &zOut[nOut-1];
28610 if( xtype==etORDINAL ){
28611 static const char zOrd[] = "thstndrd";
28612 int x = (int)(longvalue % 10);
28613 if( x>=4 || (longvalue/10)%10==1 ){
28614 x = 0;
28615 }
28616 *(--bufpt) = zOrd[x*2+1];
28617 *(--bufpt) = zOrd[x*2];
28618 }
28619 {
28620 const char *cset = &aDigits[infop->charset];
28621 u8 base = infop->base;
28622 do{ /* Convert to ascii */
28623 *(--bufpt) = cset[longvalue%base];
28624 longvalue = longvalue/base;
28625 }while( longvalue>0 );
28626 }
28627 length = (int)(&zOut[nOut-1]-bufpt);
28628 while( precision>length ){
28629 *(--bufpt) = '0'; /* Zero pad */
28630 length++;
28631 }
28632 if( cThousand ){
28633 int nn = (length - 1)/3; /* Number of "," to insert */
28634 int ix = (length - 1)%3 + 1;
28635 bufpt -= nn;
28636 for(idx=0; nn>0; idx++){
28637 bufpt[idx] = bufpt[idx+nn];
28638 ix--;
28639 if( ix==0 ){
28640 bufpt[++idx] = cThousand;
28641 nn--;
28642 ix = 3;
28643 }
28644 }
28645 }
28646 if( prefix ) *(--bufpt) = prefix; /* Add sign */
28647 if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */
28648 const char *pre;
28649 char x;
28650 pre = &aPrefix[infop->prefix];
28651 for(; (x=(*pre))!=0; pre++) *(--bufpt) = x;
28652 }
28653 length = (int)(&zOut[nOut-1]-bufpt);
28654 break;
28655 case etFLOAT:
28656 case etEXP:
28657 case etGENERIC:
28658 if( bArgList ){
28659 realvalue = getDoubleArg(pArgList);
28660 }else{
28661 realvalue = va_arg(ap,double);
28662 }
28663#ifdef SQLITE_OMIT_FLOATING_POINT
28664 length = 0;
28665#else
28666 if( precision<0 ) precision = 6; /* Set default precision */
28667#ifdef SQLITE_FP_PRECISION_LIMIT
28668 if( precision>SQLITE_FP_PRECISION_LIMIT ){
28669 precision = SQLITE_FP_PRECISION_LIMIT;
28670 }
28671#endif
28672 if( realvalue<0.0 ){
28673 realvalue = -realvalue;
28674 prefix = '-';
28675 }else{
28676 prefix = flag_prefix;
28677 }
28678 if( xtype==etGENERIC && precision>0 ) precision--;
28679 testcase( precision>0xfff );
28680 idx = precision & 0xfff;
28681 rounder = arRound[idx%10];
28682 while( idx>=10 ){ rounder *= 1.0e-10; idx -= 10; }
28683 if( xtype==etFLOAT ){
28684 double rx = (double)realvalue;
28686 int ex;
28687 memcpy(&u, &rx, sizeof(u));
28688 ex = -1023 + (int)((u>>52)&0x7ff);
28689 if( precision+(ex/3) < 15 ) rounder += realvalue*3e-16;
28690 realvalue += rounder;
28691 }
28692 /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
28693 exp = 0;
28694 if( sqlite3IsNaN((double)realvalue) ){
28695 bufpt = "NaN";
28696 length = 3;
28697 break;
28698 }
28699 if( realvalue>0.0 ){
28700 LONGDOUBLE_TYPE scale = 1.0;
28701 while( realvalue>=1e100*scale && exp<=350 ){ scale *= 1e100;exp+=100;}
28702 while( realvalue>=1e10*scale && exp<=350 ){ scale *= 1e10; exp+=10; }
28703 while( realvalue>=10.0*scale && exp<=350 ){ scale *= 10.0; exp++; }
28704 realvalue /= scale;
28705 while( realvalue<1e-8 ){ realvalue *= 1e8; exp-=8; }
28706 while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }
28707 if( exp>350 ){
28708 bufpt = buf;
28709 buf[0] = prefix;
28710 memcpy(buf+(prefix!=0),"Inf",4);
28711 length = 3+(prefix!=0);
28712 break;
28713 }
28714 }
28715 bufpt = buf;
28716 /*
28717 ** If the field type is etGENERIC, then convert to either etEXP
28718 ** or etFLOAT, as appropriate.
28719 */
28720 if( xtype!=etFLOAT ){
28721 realvalue += rounder;
28722 if( realvalue>=10.0 ){ realvalue *= 0.1; exp++; }
28723 }
28724 if( xtype==etGENERIC ){
28725 flag_rtz = !flag_alternateform;
28726 if( exp<-4 || exp>precision ){
28727 xtype = etEXP;
28728 }else{
28729 precision = precision - exp;
28730 xtype = etFLOAT;
28731 }
28732 }else{
28733 flag_rtz = flag_altform2;
28734 }
28735 if( xtype==etEXP ){
28736 e2 = 0;
28737 }else{
28738 e2 = exp;
28739 }
28740 {
28741 i64 szBufNeeded; /* Size of a temporary buffer needed */
28742 szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;
28743 if( szBufNeeded > etBUFSIZE ){
28744 bufpt = zExtra = printfTempBuf(pAccum, szBufNeeded);
28745 if( bufpt==0 ) return;
28746 }
28747 }
28748 zOut = bufpt;
28749 nsd = 16 + flag_altform2*10;
28750 flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2;
28751 /* The sign in front of the number */
28752 if( prefix ){
28753 *(bufpt++) = prefix;
28754 }
28755 /* Digits prior to the decimal point */
28756 if( e2<0 ){
28757 *(bufpt++) = '0';
28758 }else{
28759 for(; e2>=0; e2--){
28760 *(bufpt++) = et_getdigit(&realvalue,&nsd);
28761 }
28762 }
28763 /* The decimal point */
28764 if( flag_dp ){
28765 *(bufpt++) = '.';
28766 }
28767 /* "0" digits after the decimal point but before the first
28768 ** significant digit of the number */
28769 for(e2++; e2<0; precision--, e2++){
28770 assert( precision>0 );
28771 *(bufpt++) = '0';
28772 }
28773 /* Significant digits after the decimal point */
28774 while( (precision--)>0 ){
28775 *(bufpt++) = et_getdigit(&realvalue,&nsd);
28776 }
28777 /* Remove trailing zeros and the "." if no digits follow the "." */
28778 if( flag_rtz && flag_dp ){
28779 while( bufpt[-1]=='0' ) *(--bufpt) = 0;
28780 assert( bufpt>zOut );
28781 if( bufpt[-1]=='.' ){
28782 if( flag_altform2 ){
28783 *(bufpt++) = '0';
28784 }else{
28785 *(--bufpt) = 0;
28786 }
28787 }
28788 }
28789 /* Add the "eNNN" suffix */
28790 if( xtype==etEXP ){
28791 *(bufpt++) = aDigits[infop->charset];
28792 if( exp<0 ){
28793 *(bufpt++) = '-'; exp = -exp;
28794 }else{
28795 *(bufpt++) = '+';
28796 }
28797 if( exp>=100 ){
28798 *(bufpt++) = (char)((exp/100)+'0'); /* 100's digit */
28799 exp %= 100;
28800 }
28801 *(bufpt++) = (char)(exp/10+'0'); /* 10's digit */
28802 *(bufpt++) = (char)(exp%10+'0'); /* 1's digit */
28803 }
28804 *bufpt = 0;
28805
28806 /* The converted number is in buf[] and zero terminated. Output it.
28807 ** Note that the number is in the usual order, not reversed as with
28808 ** integer conversions. */
28809 length = (int)(bufpt-zOut);
28810 bufpt = zOut;
28811
28812 /* Special case: Add leading zeros if the flag_zeropad flag is
28813 ** set and we are not left justified */
28814 if( flag_zeropad && !flag_leftjustify && length < width){
28815 int i;
28816 int nPad = width - length;
28817 for(i=width; i>=nPad; i--){
28818 bufpt[i] = bufpt[i-nPad];
28819 }
28820 i = prefix!=0;
28821 while( nPad-- ) bufpt[i++] = '0';
28822 length = width;
28823 }
28824#endif /* !defined(SQLITE_OMIT_FLOATING_POINT) */
28825 break;
28826 case etSIZE:
28827 if( !bArgList ){
28828 *(va_arg(ap,int*)) = pAccum->nChar;
28829 }
28830 length = width = 0;
28831 break;
28832 case etPERCENT:
28833 buf[0] = '%';
28834 bufpt = buf;
28835 length = 1;
28836 break;
28837 case etCHARX:
28838 if( bArgList ){
28839 bufpt = getTextArg(pArgList);
28840 length = 1;
28841 if( bufpt ){
28842 buf[0] = c = *(bufpt++);
28843 if( (c&0xc0)==0xc0 ){
28844 while( length<4 && (bufpt[0]&0xc0)==0x80 ){
28845 buf[length++] = *(bufpt++);
28846 }
28847 }
28848 }else{
28849 buf[0] = 0;
28850 }
28851 }else{
28852 unsigned int ch = va_arg(ap,unsigned int);
28853 if( ch<0x00080 ){
28854 buf[0] = ch & 0xff;
28855 length = 1;
28856 }else if( ch<0x00800 ){
28857 buf[0] = 0xc0 + (u8)((ch>>6)&0x1f);
28858 buf[1] = 0x80 + (u8)(ch & 0x3f);
28859 length = 2;
28860 }else if( ch<0x10000 ){
28861 buf[0] = 0xe0 + (u8)((ch>>12)&0x0f);
28862 buf[1] = 0x80 + (u8)((ch>>6) & 0x3f);
28863 buf[2] = 0x80 + (u8)(ch & 0x3f);
28864 length = 3;
28865 }else{
28866 buf[0] = 0xf0 + (u8)((ch>>18) & 0x07);
28867 buf[1] = 0x80 + (u8)((ch>>12) & 0x3f);
28868 buf[2] = 0x80 + (u8)((ch>>6) & 0x3f);
28869 buf[3] = 0x80 + (u8)(ch & 0x3f);
28870 length = 4;
28871 }
28872 }
28873 if( precision>1 ){
28874 width -= precision-1;
28875 if( width>1 && !flag_leftjustify ){
28876 sqlite3_str_appendchar(pAccum, width-1, ' ');
28877 width = 0;
28878 }
28879 while( precision-- > 1 ){
28880 sqlite3_str_append(pAccum, buf, length);
28881 }
28882 }
28883 bufpt = buf;
28884 flag_altform2 = 1;
28885 goto adjust_width_for_utf8;
28886 case etSTRING:
28887 case etDYNSTRING:
28888 if( bArgList ){
28889 bufpt = getTextArg(pArgList);
28890 xtype = etSTRING;
28891 }else{
28892 bufpt = va_arg(ap,char*);
28893 }
28894 if( bufpt==0 ){
28895 bufpt = "";
28896 }else if( xtype==etDYNSTRING ){
28897 if( pAccum->nChar==0
28898 && pAccum->mxAlloc
28899 && width==0
28900 && precision<0
28901 && pAccum->accError==0
28902 ){
28903 /* Special optimization for sqlite3_mprintf("%z..."):
28904 ** Extend an existing memory allocation rather than creating
28905 ** a new one. */
28906 assert( (pAccum->printfFlags&SQLITE_PRINTF_MALLOCED)==0 );
28907 pAccum->zText = bufpt;
28908 pAccum->nAlloc = sqlite3DbMallocSize(pAccum->db, bufpt);
28909 pAccum->nChar = 0x7fffffff & (int)strlen(bufpt);
28911 length = 0;
28912 break;
28913 }
28914 zExtra = bufpt;
28915 }
28916 if( precision>=0 ){
28917 if( flag_altform2 ){
28918 /* Set length to the number of bytes needed in order to display
28919 ** precision characters */
28920 unsigned char *z = (unsigned char*)bufpt;
28921 while( precision-- > 0 && z[0] ){
28923 }
28924 length = (int)(z - (unsigned char*)bufpt);
28925 }else{
28926 for(length=0; length<precision && bufpt[length]; length++){}
28927 }
28928 }else{
28929 length = 0x7fffffff & (int)strlen(bufpt);
28930 }
28931 adjust_width_for_utf8:
28932 if( flag_altform2 && width>0 ){
28933 /* Adjust width to account for extra bytes in UTF-8 characters */
28934 int ii = length - 1;
28935 while( ii>=0 ) if( (bufpt[ii--] & 0xc0)==0x80 ) width++;
28936 }
28937 break;
28938 case etSQLESCAPE: /* %q: Escape ' characters */
28939 case etSQLESCAPE2: /* %Q: Escape ' and enclose in '...' */
28940 case etSQLESCAPE3: { /* %w: Escape " characters */
28941 int i, j, k, n, isnull;
28942 int needQuote;
28943 char ch;
28944 char q = ((xtype==etSQLESCAPE3)?'"':'\''); /* Quote character */
28945 char *escarg;
28946
28947 if( bArgList ){
28948 escarg = getTextArg(pArgList);
28949 }else{
28950 escarg = va_arg(ap,char*);
28951 }
28952 isnull = escarg==0;
28953 if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
28954 /* For %q, %Q, and %w, the precision is the number of bytes (or
28955 ** characters if the ! flags is present) to use from the input.
28956 ** Because of the extra quoting characters inserted, the number
28957 ** of output characters may be larger than the precision.
28958 */
28959 k = precision;
28960 for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){
28961 if( ch==q ) n++;
28962 if( flag_altform2 && (ch&0xc0)==0xc0 ){
28963 while( (escarg[i+1]&0xc0)==0x80 ){ i++; }
28964 }
28965 }
28966 needQuote = !isnull && xtype==etSQLESCAPE2;
28967 n += i + 3;
28968 if( n>etBUFSIZE ){
28969 bufpt = zExtra = printfTempBuf(pAccum, n);
28970 if( bufpt==0 ) return;
28971 }else{
28972 bufpt = buf;
28973 }
28974 j = 0;
28975 if( needQuote ) bufpt[j++] = q;
28976 k = i;
28977 for(i=0; i<k; i++){
28978 bufpt[j++] = ch = escarg[i];
28979 if( ch==q ) bufpt[j++] = ch;
28980 }
28981 if( needQuote ) bufpt[j++] = q;
28982 bufpt[j] = 0;
28983 length = j;
28984 goto adjust_width_for_utf8;
28985 }
28986 case etTOKEN: {
28987 Token *pToken;
28988 if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
28989 pToken = va_arg(ap, Token*);
28990 assert( bArgList==0 );
28991 if( pToken && pToken->n ){
28992 sqlite3_str_append(pAccum, (const char*)pToken->z, pToken->n);
28993 }
28994 length = width = 0;
28995 break;
28996 }
28997 case etSRCLIST: {
28998 SrcList *pSrc;
28999 int k;
29000 struct SrcList_item *pItem;
29001 if( (pAccum->printfFlags & SQLITE_PRINTF_INTERNAL)==0 ) return;
29002 pSrc = va_arg(ap, SrcList*);
29003 k = va_arg(ap, int);
29004 pItem = &pSrc->a[k];
29005 assert( bArgList==0 );
29006 assert( k>=0 && k<pSrc->nSrc );
29007 if( pItem->zDatabase ){
29008 sqlite3_str_appendall(pAccum, pItem->zDatabase);
29009 sqlite3_str_append(pAccum, ".", 1);
29010 }
29011 sqlite3_str_appendall(pAccum, pItem->zName);
29012 length = width = 0;
29013 break;
29014 }
29015 default: {
29016 assert( xtype==etINVALID );
29017 return;
29018 }
29019 }/* End switch over the format type */
29020 /*
29021 ** The text of the conversion is pointed to by "bufpt" and is
29022 ** "length" characters long. The field width is "width". Do
29023 ** the output. Both length and width are in bytes, not characters,
29024 ** at this point. If the "!" flag was present on string conversions
29025 ** indicating that width and precision should be expressed in characters,
29026 ** then the values have been translated prior to reaching this point.
29027 */
29028 width -= length;
29029 if( width>0 ){
29030 if( !flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' ');
29031 sqlite3_str_append(pAccum, bufpt, length);
29032 if( flag_leftjustify ) sqlite3_str_appendchar(pAccum, width, ' ');
29033 }else{
29034 sqlite3_str_append(pAccum, bufpt, length);
29035 }
29036
static const char aDigits[]
Definition sqlite3.c:28204
#define etCHARX
Definition sqlite3.c:28161
#define etSIZE
Definition sqlite3.c:28157
#define SQLITE_PRINTF_MALLOCED
Definition sqlite3.c:18979
#define SQLITE_PRINTF_SQLFUNC
Definition sqlite3.c:18978
unsigned long long int sqlite_uint64
Definition sqlite3.c:1327
static const char aPrefix[]
Definition sqlite3.c:28205
static double getDoubleArg(PrintfArguments *p)
Definition sqlite3.c:28290
#define etPOINTER
Definition sqlite3.c:28167
static char * getTextArg(PrintfArguments *p)
Definition sqlite3.c:28294
#define FLAG_SIGNED
Definition sqlite3.c:28196
static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt)
Definition sqlite3.c:28260
#define etGENERIC
Definition sqlite3.c:28156
#define SQLITE_FP_PRECISION_LIMIT
Definition sqlite3.c:28335
#define etPERCENT
Definition sqlite3.c:28160
#define etRADIX
Definition sqlite3.c:28153
#define etDECIMAL
Definition sqlite3.c:28170
#define etEXP
Definition sqlite3.c:28155
SQLITE_API void sqlite3_str_appendall(sqlite3_str *, const char *zIn)
Definition sqlite3.c:29140
#define etSTRING
Definition sqlite3.c:28158
#define etORDINAL
Definition sqlite3.c:28169
#define SMALLEST_INT64
Definition sqlite3.c:14466
SQLITE_API void sqlite3_str_appendchar(sqlite3_str *, int N, char C)
Definition sqlite3.c:29095
#define SQLITE_SKIP_UTF8(zIn)
Definition sqlite3.c:19250
#define etDYNSTRING
Definition sqlite3.c:28159
unsigned char etByte
Definition sqlite3.c:28178
SQLITE_PRIVATE int sqlite3DbMallocSize(sqlite3 *, void *)
Definition sqlite3.c:27654
static const et_info fmtinfo[]
Definition sqlite3.c:28206
static const double arRound[]
Definition sqlite3.c:28237
#define etBUFSIZE
Definition sqlite3.c:28329
#define LONGDOUBLE_TYPE
Definition sqlite3.c:14327
#define etFLOAT
Definition sqlite3.c:28154
static sqlite3_int64 getIntArg(PrintfArguments *p)
Definition sqlite3.c:28286
#define etSRCLIST
Definition sqlite3.c:28166
#define MAX(A, B)
Definition sqlite3.c:14266
#define etTOKEN
Definition sqlite3.c:28165
#define SQLITE_PRINTF_INTERNAL
Definition sqlite3.c:18977
#define etSQLESCAPE
Definition sqlite3.c:28163
SQLITE_API void sqlite3_str_append(sqlite3_str *, const char *zIn, int N)
Definition sqlite3.c:29123
#define etINVALID
Definition sqlite3.c:28172
#define etSQLESCAPE3
Definition sqlite3.c:28168
#define etSQLESCAPE2
Definition sqlite3.c:28164
static char * printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n)
Definition sqlite3.c:28308
struct SrcList::SrcList_item a[1]
const char * z
Definition sqlite3.c:17864
unsigned int n
Definition sqlite3.c:17865
etByte type
Definition sqlite3.c:28188
etByte base
Definition sqlite3.c:28186
etByte prefix
Definition sqlite3.c:28190
etByte charset
Definition sqlite3.c:28189
etByte flags
Definition sqlite3.c:28187

References SrcList::a, sqlite3_str::accError, aDigits, aPrefix, ArraySize, arRound, et_info::base, et_info::charset, sqlite3_str::db, deliberate_fall_through, et_getdigit(), etBUFSIZE, etCHARX, etDECIMAL, etDYNSTRING, etEXP, etFLOAT, etGENERIC, etINVALID, etORDINAL, etPERCENT, etPOINTER, etRADIX, etSIZE, etSQLESCAPE, etSQLESCAPE2, etSQLESCAPE3, etSRCLIST, etSTRING, etTOKEN, FLAG_SIGNED, et_info::flags, fmtinfo, getDoubleArg(), getIntArg(), getTextArg(), LONGDOUBLE_TYPE, MAX, sqlite3_str::mxAlloc, Token::n, sqlite3_str::nAlloc, sqlite3_str::nChar, et_info::prefix, sqlite3_str::printfFlags, printfTempBuf(), SMALLEST_INT64, sqlite3_str_append(), sqlite3_str_appendall(), sqlite3_str_appendchar(), sqlite3DbFree(), sqlite3DbMallocSize(), sqlite3IsNaN(), SQLITE_FP_PRECISION_LIMIT, SQLITE_PRINTF_INTERNAL, SQLITE_PRINTF_MALLOCED, SQLITE_PRINTF_SQLFUNC, SQLITE_SKIP_UTF8, testcase, et_info::type, Token::z, and sqlite3_str::zText.

Referenced by renderLogMsg(), and sqlite3_str_appendf().

◆ sqlite3_strglob()

SQLITE_API int sqlite3_strglob ( const char * zGlob,
const char * zStr )

Definition at line 117856 of file sqlite3.c.

Referenced by decodeIntArray().

◆ sqlite3_stricmp()

SQLITE_API int sqlite3_stricmp ( const char * zLeft,
const char * zRight )

Definition at line 31460 of file sqlite3.c.

31460 : R-30243-02494 The sqlite3_stricmp() and
31461** sqlite3_strnicmp() APIs allow applications and extensions to compare
31462** the contents of two buffers containing UTF-8 strings in a
31463** case-independent fashion, using the same definition of "case
31464** independence" that SQLite uses internally when comparing identifiers.
31465*/
31466SQLITE_API int sqlite3_stricmp(const char *zLeft, const char *zRight){
31467 if( zLeft==0 ){
SQLITE_API int sqlite3_strnicmp(const char *, const char *, int)
Definition sqlite3.c:31487
SQLITE_API int sqlite3_stricmp(const char *, const char *)
Definition sqlite3.c:31460

Referenced by analysisLoader(), isSelfJoinView(), lookupName(), parseModifier(), renameColumnElistNames(), renameColumnFunc(), renameColumnIdlistNames(), renameTableFunc(), resolveAsName(), sqlite3AddColumn(), sqlite3CheckObjectName(), sqlite3ExprCompare(), sqlite3FindDbName(), sqlite3FkCheck(), sqlite3FkRequired(), sqlite3GenerateRowDelete(), sqlite3Pragma(), sqlite3Select(), xferCompatibleIndex(), and xferOptimization().

◆ sqlite3_strlike()

SQLITE_API int sqlite3_strlike ( const char * zGlob,
const char * zStr,
unsigned int cEsc )

Definition at line 117864 of file sqlite3.c.

Referenced by analyzeOneTable(), and sqlite3VdbeExec().

◆ sqlite3_strnicmp()

SQLITE_API int sqlite3_strnicmp ( const char * zLeft,
const char * zRight,
int N )

Definition at line 31487 of file sqlite3.c.

31493 {
31494 register unsigned char *a, *b;
31495 if( zLeft==0 ){
31496 return zRight ? -1 : 0;
31497 }else if( zRight==0 ){
31498 return 1;

Referenced by codeInteger(), execSql(), parseModifier(), sqlite3InitCallback(), sqlite3IsShadowTableOf(), sqlite3LoadExtension(), sqlite3LocateTable(), sqlite3PragmaVtabRegister(), and yy_reduce().

◆ sqlite3_system_errno()

SQLITE_API int sqlite3_system_errno ( sqlite3 * db)

Definition at line 163571 of file sqlite3.c.

163572 {
163573 return SQLITE_NOMEM_BKPT;

◆ sqlite3_table_column_metadata()

SQLITE_API int sqlite3_table_column_metadata ( sqlite3 * db,
const char * zDbName,
const char * zTableName,
const char * zColumnName,
char const ** pzDataType,
char const ** pzCollSeq,
int * pNotNull,
int * pPrimaryKey,
int * pAutoinc )

Definition at line 164634 of file sqlite3.c.

164650 {
164651 int rc;
164652 char *zErrMsg = 0;
164653 Table *pTab = 0;
164654 Column *pCol = 0;
164655 int iCol = 0;
164656 char const *zDataType = 0;
164657 char const *zCollSeq = 0;
164658 int notnull = 0;
164659 int primarykey = 0;
164660 int autoinc = 0;
164661
164662
164663#ifdef SQLITE_ENABLE_API_ARMOR
164664 if( !sqlite3SafetyCheckOk(db) || zTableName==0 ){
164665 return SQLITE_MISUSE_BKPT;
164666 }
164667#endif
164668
164669 /* Ensure the database schema has been loaded */
164672 rc = sqlite3Init(db, &zErrMsg);
164673 if( SQLITE_OK!=rc ){
164674 goto error_out;
164675 }
164676
164677 /* Locate the table in question */
164678 pTab = sqlite3FindTable(db, zTableName, zDbName);
164679 if( !pTab || pTab->pSelect ){
164680 pTab = 0;
164681 goto error_out;
164682 }
164683
164684 /* Find the column for which info is requested */
164685 if( zColumnName==0 ){
164686 /* Query for existance of table only */
164687 }else{
164688 for(iCol=0; iCol<pTab->nCol; iCol++){
164689 pCol = &pTab->aCol[iCol];
164690 if( 0==sqlite3StrICmp(pCol->zName, zColumnName) ){
164691 break;
164692 }
164693 }
164694 if( iCol==pTab->nCol ){
164695 if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){
164696 iCol = pTab->iPKey;
164697 pCol = iCol>=0 ? &pTab->aCol[iCol] : 0;
164698 }else{
164699 pTab = 0;
164700 goto error_out;
164701 }
164702 }
164703 }
164704
164705 /* The following block stores the meta information that will be returned
164706 ** to the caller in local variables zDataType, zCollSeq, notnull, primarykey
164707 ** and autoinc. At this point there are two possibilities:
164708 **
164709 ** 1. The specified column name was rowid", "oid" or "_rowid_"
164710 ** and there is no explicitly declared IPK column.
164711 **
164712 ** 2. The table is not a view and the column name identified an
164713 ** explicitly declared column. Copy meta information from *pCol.
164714 */
164715 if( pCol ){
164716 zDataType = sqlite3ColumnType(pCol,0);
164717 zCollSeq = pCol->zColl;
164718 notnull = pCol->notNull!=0;
164719 primarykey = (pCol->colFlags & COLFLAG_PRIMKEY)!=0;
164720 autoinc = pTab->iPKey==iCol && (pTab->tabFlags & TF_Autoincrement)!=0;
164721 }else{
164722 zDataType = "INTEGER";
164723 primarykey = 1;
164724 }
164725 if( !zCollSeq ){
164726 zCollSeq = sqlite3StrBINARY;
164727 }
164728
164729error_out:
164731
164732 /* Whether the function call succeeded or failed, set the output parameters
164733 ** to whatever their local counterparts contain. If an error did occur,
164734 ** this has the effect of zeroing all output parameters.
164735 */
164736 if( pzDataType ) *pzDataType = zDataType;
164737 if( pzCollSeq ) *pzCollSeq = zCollSeq;
164738 if( pNotNull ) *pNotNull = notnull;
164739 if( pPrimaryKey ) *pPrimaryKey = primarykey;
164740 if( pAutoinc ) *pAutoinc = autoinc;
164741
164742 if( SQLITE_OK==rc && !pTab ){
164743 sqlite3DbFree(db, zErrMsg);
164744 zErrMsg = sqlite3MPrintf(db, "no such table column: %s.%s", zTableName,
164745 zColumnName);
164746 rc = SQLITE_ERROR;
164747 }
#define COLFLAG_PRIMKEY
Definition sqlite3.c:17344
SQLITE_PRIVATE int sqlite3IsRowid(const char *)
Definition sqlite3.c:102059
SQLITE_PRIVATE char * sqlite3ColumnType(Column *, char *)
Definition sqlite3.c:31271
#define TF_Autoincrement
Definition sqlite3.c:17538
SQLITE_PRIVATE int sqlite3Init(sqlite3 *, char **)
Definition sqlite3.c:128749
SQLITE_PRIVATE Table * sqlite3FindTable(sqlite3 *, const char *, const char *)
Definition sqlite3.c:110699
SQLITE_PRIVATE const char sqlite3StrBINARY[]
Definition sqlite3.c:20683
u8 notNull
Definition sqlite3.c:17335
char * zColl
Definition sqlite3.c:17334
u16 colFlags
Definition sqlite3.c:17339
i16 iPKey
Definition sqlite3.c:17499

References Table::aCol, COLFLAG_PRIMKEY, Column::colFlags, HasRowid, Table::iPKey, sqlite3::mutex, Table::nCol, Column::notNull, Table::pSelect, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3ApiExit(), sqlite3BtreeEnterAll(), sqlite3BtreeLeaveAll(), sqlite3ColumnType(), sqlite3DbFree(), sqlite3ErrorWithMsg(), sqlite3FindTable(), sqlite3Init(), sqlite3IsRowid(), sqlite3MPrintf(), sqlite3SafetyCheckOk(), sqlite3StrBINARY, sqlite3StrICmp(), SQLITE_ERROR, SQLITE_MISUSE_BKPT, SQLITE_OK, Table::tabFlags, TF_Autoincrement, Column::zColl, and Column::zName.

◆ sqlite3_test_control()

SQLITE_API int sqlite3_test_control ( int op,
... )

Definition at line 164829 of file sqlite3.c.

164835 {
164836 int rc = 0;
164837#ifdef SQLITE_UNTESTABLE
164838 UNUSED_PARAMETER(op);
164839#else
164840 va_list ap;
164841 va_start(ap, op);
164842 switch( op ){
164843
164844 /*
164845 ** Save the current state of the PRNG.
164846 */
164849 break;
164850 }
164851
164852 /*
164853 ** Restore the state of the PRNG to the last state saved using
164854 ** PRNG_SAVE. If PRNG_SAVE has never before been called, then
164855 ** this verb acts like PRNG_RESET.
164856 */
164859 break;
164860 }
164861
164862 /* sqlite3_test_control(SQLITE_TESTCTRL_PRNG_SEED, int x, sqlite3 *db);
164863 **
164864 ** Control the seed for the pseudo-random number generator (PRNG) that
164865 ** is built into SQLite. Cases:
164866 **
164867 ** x!=0 && db!=0 Seed the PRNG to the current value of the
164868 ** schema cookie in the main database for db, or
164869 ** x if the schema cookie is zero. This case
164870 ** is convenient to use with database fuzzers
164871 ** as it allows the fuzzer some control over the
164872 ** the PRNG seed.
164873 **
164874 ** x!=0 && db==0 Seed the PRNG to the value of x.
164875 **
164876 ** x==0 && db==0 Revert to default behavior of using the
164877 ** xRandomness method on the primary VFS.
164878 **
164879 ** This test-control also resets the PRNG so that the new seed will
164880 ** be used for the next call to sqlite3_randomness().
164881 */
164882#ifndef SQLITE_OMIT_WSD
164884 int x = va_arg(ap, int);
164885 int y;
164886 sqlite3 *db = va_arg(ap, sqlite3*);
164887 assert( db==0 || db->aDb[0].pSchema!=0 );
164888 if( db && (y = db->aDb[0].pSchema->schema_cookie)!=0 ){ x = y; }
164890 sqlite3_randomness(0,0);
164891 break;
164892 }
164893#endif
164894
164895 /*
164896 ** sqlite3_test_control(BITVEC_TEST, size, program)
164897 **
164898 ** Run a test against a Bitvec object of size. The program argument
164899 ** is an array of integers that defines the test. Return -1 on a
164900 ** memory allocation error, 0 on success, or non-zero for an error.
164901 ** See the sqlite3BitvecBuiltinTest() for additional information.
164902 */
164904 int sz = va_arg(ap, int);
164905 int *aProg = va_arg(ap, int*);
164906 rc = sqlite3BitvecBuiltinTest(sz, aProg);
164907 break;
164908 }
164909
164910 /*
164911 ** sqlite3_test_control(FAULT_INSTALL, xCallback)
164912 **
164913 ** Arrange to invoke xCallback() whenever sqlite3FaultSim() is called,
164914 ** if xCallback is not NULL.
164915 **
164916 ** As a test of the fault simulator mechanism itself, sqlite3FaultSim(0)
164917 ** is called immediately after installing the new callback and the return
164918 ** value from sqlite3FaultSim(0) becomes the return from
164919 ** sqlite3_test_control().
164920 */
164922 /* MSVC is picky about pulling func ptrs from va lists.
164923 ** http://support.microsoft.com/kb/47961
164924 ** sqlite3GlobalConfig.xTestCallback = va_arg(ap, int(*)(int));
164925 */
164926 typedef int(*TESTCALLBACKFUNC_t)(int);
164927 sqlite3GlobalConfig.xTestCallback = va_arg(ap, TESTCALLBACKFUNC_t);
164928 rc = sqlite3FaultSim(0);
164929 break;
164930 }
164931
164932 /*
164933 ** sqlite3_test_control(BENIGN_MALLOC_HOOKS, xBegin, xEnd)
164934 **
164935 ** Register hooks to call to indicate which malloc() failures
164936 ** are benign.
164937 */
164939 typedef void (*void_function)(void);
164940 void_function xBenignBegin;
164941 void_function xBenignEnd;
164942 xBenignBegin = va_arg(ap, void_function);
164943 xBenignEnd = va_arg(ap, void_function);
164944 sqlite3BenignMallocHooks(xBenignBegin, xBenignEnd);
164945 break;
164946 }
164947
164948 /*
164949 ** sqlite3_test_control(SQLITE_TESTCTRL_PENDING_BYTE, unsigned int X)
164950 **
164951 ** Set the PENDING byte to the value in the argument, if X>0.
164952 ** Make no changes if X==0. Return the value of the pending byte
164953 ** as it existing before this routine was called.
164954 **
164955 ** IMPORTANT: Changing the PENDING byte from 0x40000000 results in
164956 ** an incompatible database file format. Changing the PENDING byte
164957 ** while any database connection is open results in undefined and
164958 ** deleterious behavior.
164959 */
164961 rc = PENDING_BYTE;
164962#ifndef SQLITE_OMIT_WSD
164963 {
164964 unsigned int newVal = va_arg(ap, unsigned int);
164965 if( newVal ) sqlite3PendingByte = newVal;
164966 }
164967#endif
164968 break;
164969 }
164970
164971 /*
164972 ** sqlite3_test_control(SQLITE_TESTCTRL_ASSERT, int X)
164973 **
164974 ** This action provides a run-time test to see whether or not
164975 ** assert() was enabled at compile-time. If X is true and assert()
164976 ** is enabled, then the return value is true. If X is true and
164977 ** assert() is disabled, then the return value is zero. If X is
164978 ** false and assert() is enabled, then the assertion fires and the
164979 ** process aborts. If X is false and assert() is disabled, then the
164980 ** return value is zero.
164981 */
164982 case SQLITE_TESTCTRL_ASSERT: {
164983 volatile int x = 0;
164984 assert( /*side-effects-ok*/ (x = va_arg(ap,int))!=0 );
164985 rc = x;
164986 break;
164987 }
164988
164989
164990 /*
164991 ** sqlite3_test_control(SQLITE_TESTCTRL_ALWAYS, int X)
164992 **
164993 ** This action provides a run-time test to see how the ALWAYS and
164994 ** NEVER macros were defined at compile-time.
164995 **
164996 ** The return value is ALWAYS(X) if X is true, or 0 if X is false.
164997 **
164998 ** The recommended test is X==2. If the return value is 2, that means
164999 ** ALWAYS() and NEVER() are both no-op pass-through macros, which is the
165000 ** default setting. If the return value is 1, then ALWAYS() is either
165001 ** hard-coded to true or else it asserts if its argument is false.
165002 ** The first behavior (hard-coded to true) is the case if
165003 ** SQLITE_TESTCTRL_ASSERT shows that assert() is disabled and the second
165004 ** behavior (assert if the argument to ALWAYS() is false) is the case if
165005 ** SQLITE_TESTCTRL_ASSERT shows that assert() is enabled.
165006 **
165007 ** The run-time test procedure might look something like this:
165008 **
165009 ** if( sqlite3_test_control(SQLITE_TESTCTRL_ALWAYS, 2)==2 ){
165010 ** // ALWAYS() and NEVER() are no-op pass-through macros
165011 ** }else if( sqlite3_test_control(SQLITE_TESTCTRL_ASSERT, 1) ){
165012 ** // ALWAYS(x) asserts that x is true. NEVER(x) asserts x is false.
165013 ** }else{
165014 ** // ALWAYS(x) is a constant 1. NEVER(x) is a constant 0.
165015 ** }
165016 */
165017 case SQLITE_TESTCTRL_ALWAYS: {
165018 int x = va_arg(ap,int);
165019 rc = x ? ALWAYS(x) : 0;
165020 break;
165021 }
165022
165023 /*
165024 ** sqlite3_test_control(SQLITE_TESTCTRL_BYTEORDER);
165025 **
165026 ** The integer returned reveals the byte-order of the computer on which
165027 ** SQLite is running:
165028 **
165029 ** 1 big-endian, determined at run-time
165030 ** 10 little-endian, determined at run-time
165031 ** 432101 big-endian, determined at compile-time
165032 ** 123410 little-endian, determined at compile-time
165033 */
165036 break;
165037 }
165038
165039 /* sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, sqlite3 *db, int N)
165040 **
165041 ** Enable or disable various optimizations for testing purposes. The
165042 ** argument N is a bitmask of optimizations to be disabled. For normal
165043 ** operation N should be 0. The idea is that a test program (like the
165044 ** SQL Logic Test or SLT test module) can run the same SQL multiple times
165045 ** with various optimizations disabled to verify that the same answer
165046 ** is obtained in every case.
165047 */
165049 sqlite3 *db = va_arg(ap, sqlite3*);
165050 db->dbOptFlags = (u16)(va_arg(ap, int) & 0xffff);
165051 break;
165052 }
165053
165054 /* sqlite3_test_control(SQLITE_TESTCTRL_LOCALTIME_FAULT, int onoff);
165055 **
165056 ** If parameter onoff is non-zero, subsequent calls to localtime()
165057 ** and its variants fail. If onoff is zero, undo this setting.
165058 */
165060 sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int);
165061 break;
165062 }
165063
165064 /* sqlite3_test_control(SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, sqlite3*);
165065 **
165066 ** Toggle the ability to use internal functions on or off for
165067 ** the database connection given in the argument.
165068 */
165070 sqlite3 *db = va_arg(ap, sqlite3*);
165072 break;
165073 }
165074
165075 /* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int);
165076 **
165077 ** Set or clear a flag that indicates that the database file is always well-
165078 ** formed and never corrupt. This flag is clear by default, indicating that
165079 ** database files might have arbitrary corruption. Setting the flag during
165080 ** testing causes certain assert() statements in the code to be activated
165081 ** that demonstrat invariants on well-formed database files.
165082 */
165084 sqlite3GlobalConfig.neverCorrupt = va_arg(ap, int);
165085 break;
165086 }
165087
165088 /* sqlite3_test_control(SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS, int);
165089 **
165090 ** Set or clear a flag that causes SQLite to verify that type, name,
165091 ** and tbl_name fields of the sqlite_schema table. This is normally
165092 ** on, but it is sometimes useful to turn it off for testing.
165093 **
165094 ** 2020-07-22: Disabling EXTRA_SCHEMA_CHECKS also disables the
165095 ** verification of rootpage numbers when parsing the schema. This
165096 ** is useful to make it easier to reach strange internal error states
165097 ** during testing. The EXTRA_SCHEMA_CHECKS setting is always enabled
165098 ** in production.
165099 */
165101 sqlite3GlobalConfig.bExtraSchemaChecks = va_arg(ap, int);
165102 break;
165103 }
165104
165105 /* Set the threshold at which OP_Once counters reset back to zero.
165106 ** By default this is 0x7ffffffe (over 2 billion), but that value is
165107 ** too big to test in a reasonable amount of time, so this control is
165108 ** provided to set a small and easily reachable reset value.
165109 */
165111 sqlite3GlobalConfig.iOnceResetThreshold = va_arg(ap, int);
165112 break;
165113 }
165114
165115 /* sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE, xCallback, ptr);
165116 **
165117 ** Set the VDBE coverage callback function to xCallback with context
165118 ** pointer ptr.
165119 */
165121#ifdef SQLITE_VDBE_COVERAGE
165122 typedef void (*branch_callback)(void*,unsigned int,
165123 unsigned char,unsigned char);
165124 sqlite3GlobalConfig.xVdbeBranch = va_arg(ap,branch_callback);
165125 sqlite3GlobalConfig.pVdbeBranchArg = va_arg(ap,void*);
165126#endif
165127 break;
165128 }
165129
165130 /* sqlite3_test_control(SQLITE_TESTCTRL_SORTER_MMAP, db, nMax); */
165132 sqlite3 *db = va_arg(ap, sqlite3*);
165133 db->nMaxSorterMmap = va_arg(ap, int);
165134 break;
165135 }
165136
165137 /* sqlite3_test_control(SQLITE_TESTCTRL_ISINIT);
165138 **
165139 ** Return SQLITE_OK if SQLite has been initialized and SQLITE_ERROR if
165140 ** not.
165141 */
165142 case SQLITE_TESTCTRL_ISINIT: {
165143 if( sqlite3GlobalConfig.isInit==0 ) rc = SQLITE_ERROR;
165144 break;
165145 }
165146
165147 /* sqlite3_test_control(SQLITE_TESTCTRL_IMPOSTER, db, dbName, onOff, tnum);
165148 **
165149 ** This test control is used to create imposter tables. "db" is a pointer
165150 ** to the database connection. dbName is the database name (ex: "main" or
165151 ** "temp") which will receive the imposter. "onOff" turns imposter mode on
165152 ** or off. "tnum" is the root page of the b-tree to which the imposter
165153 ** table should connect.
165154 **
165155 ** Enable imposter mode only when the schema has already been parsed. Then
165156 ** run a single CREATE TABLE statement to construct the imposter table in
165157 ** the parsed schema. Then turn imposter mode back off again.
165158 **
165159 ** If onOff==0 and tnum>0 then reset the schema for all databases, causing
165160 ** the schema to be reparsed the next time it is needed. This has the
165161 ** effect of erasing all imposter tables.
165162 */
165164 sqlite3 *db = va_arg(ap, sqlite3*);
165166 db->init.iDb = sqlite3FindDbName(db, va_arg(ap,const char*));
165167 db->init.busy = db->init.imposterTable = va_arg(ap,int);
165168 db->init.newTnum = va_arg(ap,int);
165169 if( db->init.busy==0 && db->init.newTnum>0 ){
165171 }
165173 break;
165174 }
165175
165176#if defined(YYCOVERAGE)
165177 /* sqlite3_test_control(SQLITE_TESTCTRL_PARSER_COVERAGE, FILE *out)
165178 **
165179 ** This test control (only available when SQLite is compiled with
165180 ** -DYYCOVERAGE) writes a report onto "out" that shows all
165181 ** state/lookahead combinations in the parser state machine
165182 ** which are never exercised. If any state is missed, make the
165183 ** return code SQLITE_ERROR.
165184 */
165186 FILE *out = va_arg(ap, FILE*);
165187 if( sqlite3ParserCoverage(out) ) rc = SQLITE_ERROR;
165188 break;
165189 }
165190#endif /* defined(YYCOVERAGE) */
165191
165192 /* sqlite3_test_control(SQLITE_TESTCTRL_RESULT_INTREAL, sqlite3_context*);
165193 **
165194 ** This test-control causes the most recent sqlite3_result_int64() value
165195 ** to be interpreted as a MEM_IntReal instead of as an MEM_Int. Normally,
165196 ** MEM_IntReal values only arise during an INSERT operation of integer
165197 ** values into a REAL column, so they can be challenging to test. This
165198 ** test-control enables us to write an intreal() SQL function that can
165199 ** inject an intreal() value at arbitrary places in an SQL statement,
165200 ** for testing purposes.
165201 */
165203 sqlite3_context *pCtx = va_arg(ap, sqlite3_context*);
165204 sqlite3ResultIntReal(pCtx);
165205 break;
#define SQLITE_TESTCTRL_PARSER_COVERAGE
Definition sqlite3.c:8759
#define SQLITE_TESTCTRL_ALWAYS
Definition sqlite3.c:8744
#define SQLITE_TESTCTRL_LOCALTIME_FAULT
Definition sqlite3.c:8750
#define SQLITE_TESTCTRL_IMPOSTER
Definition sqlite3.c:8758
#define SQLITE_LITTLEENDIAN
Definition sqlite3.c:14455
#define UNUSED_PARAMETER(x)
Definition sqlite3.c:14653
#define SQLITE_TESTCTRL_SORTER_MMAP
Definition sqlite3.c:8757
#define SQLITE_TESTCTRL_PRNG_SAVE
Definition sqlite3.c:8736
SQLITE_PRIVATE int sqlite3PendingByte
Definition sqlite3.c:20663
#define SQLITE_TESTCTRL_ISINIT
Definition sqlite3.c:8756
SQLITE_PRIVATE void sqlite3ResultIntReal(sqlite3_context *)
Definition sqlite3.c:83552
#define SQLITE_TESTCTRL_PENDING_BYTE
Definition sqlite3.c:8742
#define SQLITE_TESTCTRL_PRNG_SEED
Definition sqlite3.c:8761
#define DBFLAG_InternalFunc
Definition sqlite3.c:17033
SQLITE_PRIVATE int sqlite3FaultSim(int)
Definition sqlite3.c:31234
SQLITE_PRIVATE void sqlite3BenignMallocHooks(void(*)(void), void(*)(void))
Definition sqlite3.c:23455
#define SQLITE_TESTCTRL_PRNG_RESTORE
Definition sqlite3.c:8737
#define SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS
Definition sqlite3.c:8762
#define SQLITE_TESTCTRL_NEVER_CORRUPT
Definition sqlite3.c:8753
#define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS
Definition sqlite3.c:8741
#define SQLITE_TESTCTRL_ASSERT
Definition sqlite3.c:8743
#define SQLITE_TESTCTRL_OPTIMIZATIONS
Definition sqlite3.c:8746
SQLITE_PRIVATE int sqlite3FindDbName(sqlite3 *, const char *)
Definition sqlite3.c:111172
SQLITE_PRIVATE void sqlite3PrngSaveState(void)
Definition sqlite3.c:30348
#define SQLITE_BYTEORDER
Definition sqlite3.c:14437
SQLITE_PRIVATE int sqlite3BitvecBuiltinTest(int, int *)
Definition sqlite3.c:48796
#define SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD
Definition sqlite3.c:8752
#define SQLITE_TESTCTRL_VDBE_COVERAGE
Definition sqlite3.c:8754
SQLITE_API void sqlite3_randomness(int N, void *P)
Definition sqlite3.c:30261
#define SQLITE_TESTCTRL_BITVEC_TEST
Definition sqlite3.c:8739
SQLITE_PRIVATE void sqlite3PrngRestoreState(void)
Definition sqlite3.c:30355
#define SQLITE_TESTCTRL_RESULT_INTREAL
Definition sqlite3.c:8760
#define SQLITE_TESTCTRL_FAULT_INSTALL
Definition sqlite3.c:8740
#define SQLITE_TESTCTRL_BYTEORDER
Definition sqlite3.c:8755
#define SQLITE_BIGENDIAN
Definition sqlite3.c:14454
SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config
Definition sqlite3.c:20573
#define SQLITE_TESTCTRL_INTERNAL_FUNCTIONS
Definition sqlite3.c:8749
unsigned int iPrngSeed
Definition sqlite3.c:19066
int nMaxSorterMmap
Definition sqlite3.c:16854
u32 mDbFlags
Definition sqlite3.c:16826
struct sqlite3::sqlite3InitInfo init
u16 dbOptFlags
Definition sqlite3.c:16835

◆ sqlite3_thread_cleanup()

SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup ( void )

Definition at line 164626 of file sqlite3.c.

◆ sqlite3_threadsafe()

SQLITE_API int sqlite3_threadsafe ( void )

Definition at line 161123 of file sqlite3.c.

161123{ return SQLITE_VERSION_NUMBER; }
#define SQLITE_VERSION_NUMBER
Definition sqlite3.c:1175

References SQLITE_VERSION_NUMBER.

◆ sqlite3_total_changes()

SQLITE_API int sqlite3_total_changes ( sqlite3 * db)

Definition at line 162095 of file sqlite3.c.

162101 {
162102#ifdef SQLITE_ENABLE_API_ARMOR
162103 if( !sqlite3SafetyCheckOk(db) ){

Referenced by db_total_changes().

◆ sqlite3_trace()

SQLITE_API SQLITE_DEPRECATED void * sqlite3_trace ( sqlite3 * db,
void(*)(void *, const char *) xTrace,
void * pArg )

Definition at line 163075 of file sqlite3.c.

163081 {
163082 void *pOld;
163083
163084#ifdef SQLITE_ENABLE_API_ARMOR
163085 if( !sqlite3SafetyCheckOk(db) ){
163086 (void)SQLITE_MISUSE_BKPT;
163087 return 0;
163088 }
163089#endif
163091 pOld = db->pTraceArg;
void * pTraceArg
Definition sqlite3.c:16875

References sqlite3::mTrace, sqlite3::mutex, sqlite3::pTraceArg, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_TRACE_LEGACY, sqlite3::trace, and sqlite3::xLegacy.

Referenced by db_trace().

◆ sqlite3_trace_v2()

SQLITE_API int sqlite3_trace_v2 ( sqlite3 * db,
unsigned uMask,
int(*)(unsigned, void *, void *, void *) xCallback,
void * pCtx )

Definition at line 163096 of file sqlite3.c.

163107 {
163108#ifdef SQLITE_ENABLE_API_ARMOR
163109 if( !sqlite3SafetyCheckOk(db) ){
163110 return SQLITE_MISUSE_BKPT;
163111 }
163112#endif
163114 if( mTrace==0 ) xTrace = 0;
163115 if( xTrace==0 ) mTrace = 0;

◆ sqlite3_transfer_bindings()

SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings ( sqlite3_stmt * pFromStmt,
sqlite3_stmt * pToStmt )

Definition at line 84622 of file sqlite3.c.

84628 {
84629 Vdbe *pFrom = (Vdbe*)pFromStmt;
84630 Vdbe *pTo = (Vdbe*)pToStmt;
84631 if( pFrom->nVar!=pTo->nVar ){
84632 return SQLITE_ERROR;
84633 }
84634 assert( (pTo->prepFlags & SQLITE_PREPARE_SAVESQL)!=0 || pTo->expmask==0 );
84635 if( pTo->expmask ){
84636 pTo->expired = 1;
84637 }
bft expired
Definition sqlite3.c:21127

References Vdbe::expired, Vdbe::expmask, Vdbe::nVar, Vdbe::prepFlags, sqlite3TransferBindings(), SQLITE_ERROR, and SQLITE_PREPARE_SAVESQL.

◆ sqlite3_unlock_notify()

SQLITE_API int sqlite3_unlock_notify ( sqlite3 * pBlocked,
void(*)(void **apArg, int nArg) xNotify,
void * pNotifyArg )

◆ sqlite3_update_hook()

SQLITE_API void * sqlite3_update_hook ( sqlite3 * db,
void(*)(void *, int, char const *, char const *, sqlite3_int64) xCallback,
void * pArg )

Definition at line 163181 of file sqlite3.c.

163191 {
163192 void *pRet;
163193
163194#ifdef SQLITE_ENABLE_API_ARMOR
163195 if( !sqlite3SafetyCheckOk(db) ){
163196 (void)SQLITE_MISUSE_BKPT;
163197 return 0;
163198 }
163199#endif

Referenced by db_update_hook().

◆ sqlite3_uri_boolean()

SQLITE_API int sqlite3_uri_boolean ( const char * zFile,
const char * zParam,
int bDefault )

Definition at line 165318 of file sqlite3.c.

165318 : 0;
165319}
165320
165321/*
165322** Return a boolean value for a query parameter.

Referenced by sqlite3PagerOpen(), and unixOpenSharedMemory().

◆ sqlite3_uri_int64()

SQLITE_API sqlite3_int64 sqlite3_uri_int64 ( const char * zFilename,
const char * zParam,
sqlite3_int64 bDflt )

Definition at line 165327 of file sqlite3.c.

165327 : bDflt;
165328}
165329
165330/*
165331** Return a 64-bit integer value for a query parameter.
165332*/
165334 const char *zFilename, /* Filename as passed to xOpen */
165335 const char *zParam, /* URI parameter sought */
165336 sqlite3_int64 bDflt /* return if parameter is missing */
165337){
165338 const char *z = sqlite3_uri_parameter(zFilename, zParam);
SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char *, const char *, sqlite3_int64)
Definition sqlite3.c:165327
SQLITE_API const char * sqlite3_uri_parameter(const char *zFilename, const char *zParam)
Definition sqlite3.c:165295

◆ sqlite3_uri_key()

SQLITE_API const char * sqlite3_uri_key ( const char * zFilename,
int N )

Definition at line 165304 of file sqlite3.c.

165310 {
165311 if( zFilename==0 || N<0 ) return 0;
165312 zFilename = databaseName(zFilename);
165313 zFilename += sqlite3Strlen30(zFilename) + 1;

◆ sqlite3_uri_parameter()

SQLITE_API const char * sqlite3_uri_parameter ( const char * zFilename,
const char * zParam )

Definition at line 165295 of file sqlite3.c.

References databaseName().

Referenced by findCreateFileMode().

◆ sqlite3_user_data()

◆ sqlite3_value_blob()

SQLITE_API const void * sqlite3_value_blob ( sqlite3_value * pVal)

Definition at line 83153 of file sqlite3.c.

83159 {
83160 Mem *p = (Mem*)pVal;
83161 if( p->flags & (MEM_Blob|MEM_Str) ){
83162 if( ExpandBlob(p)!=SQLITE_OK ){
83163 assert( p->flags==MEM_Null && p->z==0 );
83164 return 0;
83165 }
#define MEM_Blob
Definition sqlite3.c:20952
#define ExpandBlob(P)
Definition sqlite3.c:21321
#define MEM_Str
Definition sqlite3.c:20949

References ExpandBlob, sqlite3_value::flags, MEM_Blob, MEM_Null, MEM_Str, SQLITE_OK, and sqlite3_value::z.

Referenced by db_push_value(), instrFunc(), quoteFunc(), statGet(), statPush(), and substrFunc().

◆ sqlite3_value_bytes()

SQLITE_API int sqlite3_value_bytes ( sqlite3_value * pVal)

Definition at line 83166 of file sqlite3.c.

83167 : 0;
83168 }else{

Referenced by db_push_value(), instrFunc(), isDate(), likeFunc(), quoteFunc(), replaceFunc(), statPush(), and substrFunc().

◆ sqlite3_value_bytes16()

SQLITE_API int sqlite3_value_bytes16 ( sqlite3_value * pVal)

Definition at line 83169 of file sqlite3.c.

◆ sqlite3_value_double()

SQLITE_API double sqlite3_value_double ( sqlite3_value * pVal)

Definition at line 83172 of file sqlite3.c.

83172 {
83173 return sqlite3ValueBytes(pVal, SQLITE_UTF8);
83174}
SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *, u8)
Definition sqlite3.c:77714

References sqlite3ValueBytes(), and SQLITE_UTF8.

Referenced by absFunc(), db_push_value(), isDate(), and quoteFunc().

◆ sqlite3_value_dup()

SQLITE_API sqlite3_value * sqlite3_value_dup ( const sqlite3_value * pOrig)

Definition at line 83313 of file sqlite3.c.

83313 {
83314 return (pVal->flags&MEM_FromBind)!=0;
83315}
83316
83317/* Make a copy of an sqlite3_value object
83318*/
83320 sqlite3_value *pNew;
83321 if( pOrig==0 ) return 0;
83322 pNew = sqlite3_malloc( sizeof(*pNew) );
83323 if( pNew==0 ) return 0;
83324 memset(pNew, 0, sizeof(*pNew));
83325 memcpy(pNew, pOrig, MEMCELLSIZE);
83326 pNew->flags &= ~MEM_Dyn;
83327 pNew->db = 0;
83328 if( pNew->flags&(MEM_Str|MEM_Blob) ){
83329 pNew->flags &= ~(MEM_Static|MEM_Dyn);
83330 pNew->flags |= MEM_Ephem;
SQLITE_API sqlite3_value * sqlite3_value_dup(const sqlite3_value *)
Definition sqlite3.c:83313
#define MEM_Ephem
Definition sqlite3.c:20969
#define MEMCELLSIZE
Definition sqlite3.c:20933
SQLITE_API void * sqlite3_malloc(int)
Definition sqlite3.c:27615
#define MEM_FromBind
Definition sqlite3.c:20955
#define MEM_Dyn
Definition sqlite3.c:20967
SQLITE_PRIVATE int sqlite3VdbeMemMakeWriteable(Mem *)
Definition sqlite3.c:76154

References sqlite3_value::flags, and MEM_FromBind.

Referenced by instrFunc().

◆ sqlite3_value_free()

SQLITE_API void sqlite3_value_free ( sqlite3_value * pOld)

Definition at line 83336 of file sqlite3.c.

Referenced by instrFunc(), and last_valueValueFunc().

◆ sqlite3_value_frombind()

SQLITE_API int sqlite3_value_frombind ( sqlite3_value * pVal)

Definition at line 83307 of file sqlite3.c.

83308 {
83309 return (pVal->flags&(MEM_Null|MEM_Zero))==(MEM_Null|MEM_Zero);

References sqlite3_value::flags, MEM_Null, and MEM_Zero.

◆ sqlite3_value_int()

◆ sqlite3_value_int64()

SQLITE_API sqlite3_int64 sqlite3_value_int64 ( sqlite3_value * pVal)

Definition at line 83178 of file sqlite3.c.

83178 {
83179 return sqlite3VdbeRealValue((Mem*)pVal);
83180}
SQLITE_PRIVATE double sqlite3VdbeRealValue(Mem *)
Definition sqlite3.c:76445

References sqlite3VdbeRealValue().

Referenced by absFunc(), charFunc(), db_push_value(), ntileStepFunc(), statInit(), statPush(), and sumStep().

◆ sqlite3_value_nochange()

SQLITE_API int sqlite3_value_nochange ( sqlite3_value * pVal)

Definition at line 83302 of file sqlite3.c.

Referenced by sqlite3_vtab_nochange(), and sqlite3VdbeMemExpandBlob().

◆ sqlite3_value_numeric_type()

SQLITE_API int sqlite3_value_numeric_type ( sqlite3_value * pVal)

Definition at line 85640 of file sqlite3.c.

85646 {
85647 int eType = sqlite3_value_type(pVal);
85648 if( eType==SQLITE_TEXT ){
u8 eType
Definition sqlite3.c:22327

References applyNumericAffinity(), eType, sqlite3_value_type(), and SQLITE_TEXT.

Referenced by sumStep().

◆ sqlite3_value_pointer()

SQLITE_API void * sqlite3_value_pointer ( sqlite3_value * pVal,
const char * zPType )

Definition at line 83185 of file sqlite3.c.

83187 {
83188 Mem *pMem = (Mem*)pVal;
83189 return ((pMem->flags & MEM_Subtype) ? pMem->eSubtype : 0);
83190}
83191SQLITE_API void *sqlite3_value_pointer(sqlite3_value *pVal, const char *zPType){
83192 Mem *p = (Mem*)pVal;
83195 && zPType!=0
83196 && p->eSubtype=='p'
83197 && strcmp(p->u.zPType, zPType)==0
#define MEM_Term
Definition sqlite3.c:20966
SQLITE_API void * sqlite3_value_pointer(sqlite3_value *, const char *)
Definition sqlite3.c:83185
#define MEM_TypeMask
Definition sqlite3.c:20958

◆ sqlite3_value_subtype()

SQLITE_API unsigned int sqlite3_value_subtype ( sqlite3_value * pVal)

Definition at line 83181 of file sqlite3.c.

83181 {
83182 return (int)sqlite3VdbeIntValue((Mem*)pVal);
83183}
SQLITE_PRIVATE i64 sqlite3VdbeIntValue(Mem *)
Definition sqlite3.c:76416

References sqlite3VdbeIntValue().

◆ sqlite3_value_text()

◆ sqlite3_value_text16()

SQLITE_API const void * sqlite3_value_text16 ( sqlite3_value * pVal)

Definition at line 83202 of file sqlite3.c.

83204 {

Referenced by columnName(), sqlite3_column_type(), and sqlite3_errmsg16().

◆ sqlite3_value_text16be()

SQLITE_API const void * sqlite3_value_text16be ( sqlite3_value * pVal)

Definition at line 83205 of file sqlite3.c.

◆ sqlite3_value_text16le()

SQLITE_API const void * sqlite3_value_text16le ( sqlite3_value * pVal)

Definition at line 83208 of file sqlite3.c.

83208 {
83210}

References sqlite3ValueText(), and SQLITE_UTF16NATIVE.

◆ sqlite3_value_type()

SQLITE_API int sqlite3_value_type ( sqlite3_value * pVal)

Definition at line 83216 of file sqlite3.c.

83222 {
83223 static const u8 aType[] = {
83224 SQLITE_BLOB, /* 0x00 (not possible) */
83225 SQLITE_NULL, /* 0x01 NULL */
83226 SQLITE_TEXT, /* 0x02 TEXT */
83227 SQLITE_NULL, /* 0x03 (not possible) */
83228 SQLITE_INTEGER, /* 0x04 INTEGER */
83229 SQLITE_NULL, /* 0x05 (not possible) */
83230 SQLITE_INTEGER, /* 0x06 INTEGER + TEXT */
83231 SQLITE_NULL, /* 0x07 (not possible) */
83232 SQLITE_FLOAT, /* 0x08 FLOAT */
83233 SQLITE_NULL, /* 0x09 (not possible) */
83234 SQLITE_FLOAT, /* 0x0a FLOAT + TEXT */
83235 SQLITE_NULL, /* 0x0b (not possible) */
83236 SQLITE_INTEGER, /* 0x0c (not possible) */
83237 SQLITE_NULL, /* 0x0d (not possible) */
83238 SQLITE_INTEGER, /* 0x0e (not possible) */
83239 SQLITE_NULL, /* 0x0f (not possible) */
83240 SQLITE_BLOB, /* 0x10 BLOB */
83241 SQLITE_NULL, /* 0x11 (not possible) */
83242 SQLITE_TEXT, /* 0x12 (not possible) */
83243 SQLITE_NULL, /* 0x13 (not possible) */
83244 SQLITE_INTEGER, /* 0x14 INTEGER + BLOB */
83245 SQLITE_NULL, /* 0x15 (not possible) */
83246 SQLITE_INTEGER, /* 0x16 (not possible) */
83247 SQLITE_NULL, /* 0x17 (not possible) */
83248 SQLITE_FLOAT, /* 0x18 FLOAT + BLOB */
83249 SQLITE_NULL, /* 0x19 (not possible) */
83250 SQLITE_FLOAT, /* 0x1a (not possible) */
83251 SQLITE_NULL, /* 0x1b (not possible) */
83252 SQLITE_INTEGER, /* 0x1c (not possible) */
83253 SQLITE_NULL, /* 0x1d (not possible) */
83254 SQLITE_INTEGER, /* 0x1e (not possible) */
83255 SQLITE_NULL, /* 0x1f (not possible) */
83256 SQLITE_FLOAT, /* 0x20 INTREAL */
83257 SQLITE_NULL, /* 0x21 (not possible) */
83258 SQLITE_TEXT, /* 0x22 INTREAL + TEXT */
83259 SQLITE_NULL, /* 0x23 (not possible) */
83260 SQLITE_FLOAT, /* 0x24 (not possible) */
83261 SQLITE_NULL, /* 0x25 (not possible) */
83262 SQLITE_FLOAT, /* 0x26 (not possible) */
83263 SQLITE_NULL, /* 0x27 (not possible) */
83264 SQLITE_FLOAT, /* 0x28 (not possible) */
83265 SQLITE_NULL, /* 0x29 (not possible) */
83266 SQLITE_FLOAT, /* 0x2a (not possible) */
83267 SQLITE_NULL, /* 0x2b (not possible) */
83268 SQLITE_FLOAT, /* 0x2c (not possible) */
83269 SQLITE_NULL, /* 0x2d (not possible) */
83270 SQLITE_FLOAT, /* 0x2e (not possible) */
83271 SQLITE_NULL, /* 0x2f (not possible) */
83272 SQLITE_BLOB, /* 0x30 (not possible) */
83273 SQLITE_NULL, /* 0x31 (not possible) */
83274 SQLITE_TEXT, /* 0x32 (not possible) */
83275 SQLITE_NULL, /* 0x33 (not possible) */
83276 SQLITE_FLOAT, /* 0x34 (not possible) */
83277 SQLITE_NULL, /* 0x35 (not possible) */
83278 SQLITE_FLOAT, /* 0x36 (not possible) */
83279 SQLITE_NULL, /* 0x37 (not possible) */
83280 SQLITE_FLOAT, /* 0x38 (not possible) */
83281 SQLITE_NULL, /* 0x39 (not possible) */
83282 SQLITE_FLOAT, /* 0x3a (not possible) */
83283 SQLITE_NULL, /* 0x3b (not possible) */
83284 SQLITE_FLOAT, /* 0x3c (not possible) */
83285 SQLITE_NULL, /* 0x3d (not possible) */
83286 SQLITE_FLOAT, /* 0x3e (not possible) */
83287 SQLITE_NULL, /* 0x3f (not possible) */
83288 };
83289#ifdef SQLITE_DEBUG
83290 {
83291 int eType = SQLITE_BLOB;
83292 if( pVal->flags & MEM_Null ){
83294 }else if( pVal->flags & (MEM_Real|MEM_IntReal) ){
83296 }else if( pVal->flags & MEM_Int ){
83298 }else if( pVal->flags & MEM_Str ){
#define MEM_Int
Definition sqlite3.c:20950
#define MEM_Real
Definition sqlite3.c:20951
#define MEM_IntReal
Definition sqlite3.c:20953

Referenced by absFunc(), db_push_value(), exprCompareVariable(), instrFunc(), isDate(), isLikeOrGlob(), likeFunc(), minmaxStep(), quoteFunc(), replaceFunc(), sqlite3_value_numeric_type(), statPush(), and substrFunc().

◆ sqlite3_vfs_find()

SQLITE_API sqlite3_vfs * sqlite3_vfs_find ( const char * zVfsName)

Definition at line 23307 of file sqlite3.c.

23312 {
23313 sqlite3_vfs *pVfs = 0;
23314#if SQLITE_THREADSAFE
23316#endif
23317#ifndef SQLITE_OMIT_AUTOINIT
23318 int rc = sqlite3_initialize();
23319 if( rc ) return 0;
23320#endif
23321#if SQLITE_THREADSAFE
23323#endif
23325 for(pVfs = vfsList; pVfs; pVfs=pVfs->pNext){
23326 if( zVfs==0 ) break;
#define vfsList
Definition sqlite3.c:23301
sqlite3_vfs * pNext
Definition sqlite3.c:2421

References mutex, sqlite3_vfs::pNext, sqlite3_initialize(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3MutexAlloc(), SQLITE_MUTEX_STATIC_MAIN, vfsList, and sqlite3_vfs::zName.

Referenced by attachFunc(), and sqlite3ParseUri().

◆ sqlite3_vfs_register()

SQLITE_API int sqlite3_vfs_register ( sqlite3_vfs * pVfs,
int makeDflt )

Definition at line 23353 of file sqlite3.c.

23358 {
23360#ifndef SQLITE_OMIT_AUTOINIT
23361 int rc = sqlite3_initialize();
23362 if( rc ) return rc;
23363#endif
23364#ifdef SQLITE_ENABLE_API_ARMOR
23365 if( pVfs==0 ) return SQLITE_MISUSE_BKPT;
23366#endif
23367
23370 vfsUnlink(pVfs);
23371 if( makeDflt || vfsList==0 ){
23372 pVfs->pNext = vfsList;
23373 vfsList = pVfs;
23374 }else{
23375 pVfs->pNext = vfsList->pNext;
23376 vfsList->pNext = pVfs;
static void vfsUnlink(sqlite3_vfs *pVfs)
Definition sqlite3.c:23331

References mutex, MUTEX_LOGIC, sqlite3_vfs::pNext, sqlite3_initialize(), sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3MutexAlloc(), SQLITE_MISUSE_BKPT, SQLITE_MUTEX_STATIC_MAIN, SQLITE_OK, vfsList, and vfsUnlink().

Referenced by sqlite3_os_init().

◆ sqlite3_vfs_unregister()

SQLITE_API int sqlite3_vfs_unregister ( sqlite3_vfs * pVfs)

Definition at line 23381 of file sqlite3.c.

23386 {
23388#ifndef SQLITE_OMIT_AUTOINIT
23389 int rc = sqlite3_initialize();
23390 if( rc ) return rc;
23391#endif

◆ sqlite3_vmprintf()

SQLITE_API char * sqlite3_vmprintf ( const char * zFormat,
va_list ap )

Definition at line 29299 of file sqlite3.c.

29305 {
29306 char *z;
29307 char zBase[SQLITE_PRINT_BUF_SIZE];
29308 StrAccum acc;
29309
29310#ifdef SQLITE_ENABLE_API_ARMOR
29311 if( zFormat==0 ){
29312 (void)SQLITE_MISUSE_BKPT;
29313 return 0;
29314 }
29315#endif
29316#ifndef SQLITE_OMIT_AUTOINIT
29317 if( sqlite3_initialize() ) return 0;
#define SQLITE_PRINT_BUF_SIZE
Definition sqlite3.c:28327

◆ sqlite3_vsnprintf()

SQLITE_API char * sqlite3_vsnprintf ( int n,
char * zBuf,
const char * zFormat,
va_list ap )

Definition at line 29348 of file sqlite3.c.

29354 {
29355 StrAccum acc;
29356 if( n<=0 ) return zBuf;
29357#ifdef SQLITE_ENABLE_API_ARMOR
29358 if( zBuf==0 || zFormat==0 ) {
29359 (void)SQLITE_MISUSE_BKPT;
29360 if( zBuf ) zBuf[0] = 0;
29361 return zBuf;
29362 }

References SQLITE_MISUSE_BKPT.

◆ sqlite3_vtab_collation()

SQLITE_API SQLITE_EXPERIMENTAL const char * sqlite3_vtab_collation ( sqlite3_index_info * pIdxInfo,
int iCons )

Definition at line 148920 of file sqlite3.c.

148926 {
148927 HiddenIndexInfo *pHidden = (HiddenIndexInfo*)&pIdxInfo[1];
148928 const char *zRet = 0;
148929 if( iCons>=0 && iCons<pIdxInfo->nConstraint ){
148930 CollSeq *pC = 0;
148931 int iTerm = pIdxInfo->aConstraint[iCons].iTermOffset;
148932 Expr *pX = pHidden->pWC->a[iTerm].pExpr;
148933 if( pX->pLeft ){
Expr * pLeft
Definition sqlite3.c:18014
WhereClause * pWC
Definition sqlite3.c:145638
WhereTerm * a
Definition sqlite3.c:141252
Expr * pExpr
Definition sqlite3.c:141169
struct sqlite3_index_info::sqlite3_index_constraint * aConstraint

References WhereClause::a, sqlite3_index_info::aConstraint, sqlite3_index_info::sqlite3_index_constraint::iTermOffset, WhereTerm::pExpr, Expr::pLeft, HiddenIndexInfo::pParse, HiddenIndexInfo::pWC, sqlite3ExprCompareCollSeq(), sqlite3StrBINARY, and CollSeq::zName.

◆ sqlite3_vtab_config()

SQLITE_API int sqlite3_vtab_config ( sqlite3 * db,
int op,
... )

Definition at line 140848 of file sqlite3.c.

140854 {
140855 va_list ap;
140856 int rc = SQLITE_OK;
140857 VtabCtx *p;
140858
140859#ifdef SQLITE_ENABLE_API_ARMOR
140860 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
140861#endif
140863 p = db->pVtabCtx;
140864 if( !p ){
140865 rc = SQLITE_MISUSE_BKPT;
140866 }else{
140867 assert( p->pTab==0 || IsVirtual(p->pTab) );
140868 va_start(ap, op);
140869 switch( op ){
140871 p->pVTable->bConstraint = (u8)va_arg(ap, int);
140872 break;
140873 }
140874 case SQLITE_VTAB_INNOCUOUS: {
140876 break;
140877 }
140878 case SQLITE_VTAB_DIRECTONLY: {
140880 break;
140881 }
140882 default: {
140883 rc = SQLITE_MISUSE_BKPT;
140884 break;
140885 }
140886 }
140887 va_end(ap);
#define SQLITE_VTABRISK_Low
Definition sqlite3.c:17479
#define SQLITE_VTAB_INNOCUOUS
Definition sqlite3.c:10224
#define SQLITE_VTAB_DIRECTONLY
Definition sqlite3.c:10225
#define SQLITE_VTAB_CONSTRAINT_SUPPORT
Definition sqlite3.c:10223
#define SQLITE_VTABRISK_High
Definition sqlite3.c:17481
u8 bConstraint
Definition sqlite3.c:17471
u8 eVtabRisk
Definition sqlite3.c:17472

References VTable::bConstraint, VTable::eVtabRisk, IsVirtual, sqlite3::mutex, VtabCtx::pTab, sqlite3::pVtabCtx, VtabCtx::pVTable, sqlite3_mutex_enter(), sqlite3_mutex_leave(), sqlite3Error(), sqlite3SafetyCheckOk(), SQLITE_MISUSE_BKPT, SQLITE_OK, SQLITE_VTAB_CONSTRAINT_SUPPORT, SQLITE_VTAB_DIRECTONLY, SQLITE_VTAB_INNOCUOUS, SQLITE_VTABRISK_High, and SQLITE_VTABRISK_Low.

◆ sqlite3_vtab_nochange()

SQLITE_API int sqlite3_vtab_nochange ( sqlite3_context * p)

Definition at line 83813 of file sqlite3.c.

References sqlite3_context::pOut, and sqlite3_value_nochange().

◆ sqlite3_vtab_on_conflict()

SQLITE_API int sqlite3_vtab_on_conflict ( sqlite3 * db)

Definition at line 140830 of file sqlite3.c.

140836 {
140837 static const unsigned char aMap[] = {
140839 };
140840#ifdef SQLITE_ENABLE_API_ARMOR
140841 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
#define SQLITE_IGNORE
Definition sqlite3.c:4098
#define SQLITE_FAIL
Definition sqlite3.c:10287
#define SQLITE_ROLLBACK
Definition sqlite3.c:10285
#define SQLITE_REPLACE
Definition sqlite3.c:10289

References OE_Abort, OE_Fail, OE_Ignore, OE_Replace, OE_Rollback, sqlite3SafetyCheckOk(), SQLITE_ABORT, SQLITE_FAIL, SQLITE_IGNORE, SQLITE_MISUSE_BKPT, SQLITE_REPLACE, SQLITE_ROLLBACK, and sqlite3::vtabOnConflict.

◆ sqlite3_wal_autocheckpoint()

SQLITE_API int sqlite3_wal_autocheckpoint ( sqlite3 * db,
int N )

Definition at line 163281 of file sqlite3.c.

163287 {
163288#ifdef SQLITE_OMIT_WAL
163289 UNUSED_PARAMETER(db);
163290 UNUSED_PARAMETER(nFrame);
163291#else
163292#ifdef SQLITE_ENABLE_API_ARMOR
163293 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
163294#endif
163295 if( nFrame>0 ){
SQLITE_PRIVATE int sqlite3WalDefaultHook(void *, sqlite3 *, const char *, int)
Definition sqlite3.c:163255
SQLITE_API void * sqlite3_wal_hook(sqlite3 *, int(*)(void *, sqlite3 *, const char *, int), void *)
Definition sqlite3.c:163302

References sqlite3_wal_hook(), sqlite3SafetyCheckOk(), sqlite3WalDefaultHook(), SQLITE_INT_TO_PTR, SQLITE_MISUSE_BKPT, SQLITE_OK, and UNUSED_PARAMETER.

Referenced by openDatabase(), and sqlite3Pragma().

◆ sqlite3_wal_checkpoint()

SQLITE_API int sqlite3_wal_checkpoint ( sqlite3 * db,
const char * zDb )

Definition at line 163391 of file sqlite3.c.

References sqlite3_wal_checkpoint_v2(), and SQLITE_CHECKPOINT_PASSIVE.

Referenced by sqlite3WalDefaultHook().

◆ sqlite3_wal_checkpoint_v2()

SQLITE_API int sqlite3_wal_checkpoint_v2 ( sqlite3 * db,
const char * zDb,
int eMode,
int * pnLog,
int * pnCkpt )

Definition at line 163329 of file sqlite3.c.

163341 {
163342#ifdef SQLITE_OMIT_WAL
163343 return SQLITE_OK;
163344#else
163345 int rc; /* Return code */
163346 int iDb = SQLITE_MAX_ATTACHED; /* sqlite3.aDb[] index of db to checkpoint */
163347
163348#ifdef SQLITE_ENABLE_API_ARMOR
163349 if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
163350#endif
163351
163352 /* Initialize the output variables to -1 in case an error occurs. */
163353 if( pnLog ) *pnLog = -1;
163354 if( pnCkpt ) *pnCkpt = -1;
163355
163356 assert( SQLITE_CHECKPOINT_PASSIVE==0 );
163357 assert( SQLITE_CHECKPOINT_FULL==1 );
163358 assert( SQLITE_CHECKPOINT_RESTART==2 );
163359 assert( SQLITE_CHECKPOINT_TRUNCATE==3 );
163360 if( eMode<SQLITE_CHECKPOINT_PASSIVE || eMode>SQLITE_CHECKPOINT_TRUNCATE ){
163361 /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint
163362 ** mode: */
163363 return SQLITE_MISUSE;
163364 }
163365
163367 if( zDb && zDb[0] ){
163368 iDb = sqlite3FindDbName(db, zDb);
163369 }
163370 if( iDb<0 ){
163371 rc = SQLITE_ERROR;
163372 sqlite3ErrorWithMsg(db, SQLITE_ERROR, "unknown database: %s", zDb);
163373 }else{
163374 db->busyHandler.nBusy = 0;
163375 rc = sqlite3Checkpoint(db, iDb, eMode, pnLog, pnCkpt);
163376 sqlite3Error(db, rc);
163377 }
163378 rc = sqlite3ApiExit(db, rc);
163379
163380 /* If there are no active statements, clear the interrupt flag at this
163381 ** point. */
163382 if( db->nVdbeActive==0 ){
163383 AtomicStore(&db->u1.isInterrupted, 0);
SQLITE_PRIVATE int sqlite3Checkpoint(sqlite3 *, int, int, int *, int *)
Definition sqlite3.c:163418
#define SQLITE_CHECKPOINT_TRUNCATE
Definition sqlite3.c:10139
#define SQLITE_CHECKPOINT_FULL
Definition sqlite3.c:10137
#define SQLITE_CHECKPOINT_RESTART
Definition sqlite3.c:10138
#define SQLITE_CHECKPOINT_PASSIVE
Definition sqlite3.c:10136
volatile int isInterrupted
Definition sqlite3.c:16903
int nVdbeActive
Definition sqlite3.c:16864
union sqlite3::@105 u1

Referenced by sqlite3_wal_checkpoint().

◆ sqlite3_wal_hook()

SQLITE_API void * sqlite3_wal_hook ( sqlite3 * db,
int(*)(void *, sqlite3 *, const char *, int) xCallback,
void * pArg )

Definition at line 163302 of file sqlite3.c.

163312 {
163313#ifndef SQLITE_OMIT_WAL
163314 void *pRet;
163315#ifdef SQLITE_ENABLE_API_ARMOR
163316 if( !sqlite3SafetyCheckOk(db) ){
163317 (void)SQLITE_MISUSE_BKPT;
163318 return 0;
163319 }
163320#endif
163322 pRet = db->pWalArg;
163323 db->xWalCallback = xCallback;
163324 db->pWalArg = pArg;
int(* xWalCallback)(void *, sqlite3 *, const char *, int)
Definition sqlite3.c:16895
void * pWalArg
Definition sqlite3.c:16896

Referenced by sqlite3_wal_autocheckpoint().

◆ sqlite3_win32_set_directory()

SQLITE_API int sqlite3_win32_set_directory ( unsigned long type,
void * zValue )

◆ sqlite3_win32_set_directory16()

SQLITE_API int sqlite3_win32_set_directory16 ( unsigned long type,
const void * zValue )

◆ sqlite3_win32_set_directory8()

SQLITE_API int sqlite3_win32_set_directory8 ( unsigned long type,
const char * zValue )

Variable Documentation

◆ sqlite3_data_directory

SQLITE_API SQLITE_EXTERN char* sqlite3_data_directory

Definition at line 6073 of file sqlite3.h.

◆ sqlite3_temp_directory

SQLITE_API SQLITE_EXTERN char* sqlite3_temp_directory

Definition at line 6036 of file sqlite3.h.

◆ sqlite3_version

SQLITE_API SQLITE_EXTERN const char sqlite3_version[]

Definition at line 162 of file sqlite3.h.