sqlite: modernc.org/sqlite/lib Index | Files

package sqlite3

import "modernc.org/sqlite/lib"

Index

Package Files

capi_linux_amd64.go hooks.go sqlite_linux_amd64.go

Constants

const (
    ALT_SCHEMA_TABLE                      = "sqlite_schema"
    ALT_TEMP_SCHEMA_TABLE                 = "sqlite_temp_schema"
    BITVEC_SZ                             = 512
    BITVEC_SZELEM                         = 8
    BTALLOC_ANY                           = 0
    BTALLOC_EXACT                         = 1
    BTALLOC_LE                            = 2
    BTCF_AtLast                           = 0x08
    BTCF_Incrblob                         = 0x10
    BTCF_Multiple                         = 0x20
    BTCF_Pinned                           = 0x40
    BTCF_ValidNKey                        = 0x02
    BTCF_ValidOvfl                        = 0x04
    BTCF_WriteFlag                        = 0x01
    BTCURSOR_MAX_DEPTH                    = 20
    BTREE_APPEND                          = 0x08
    BTREE_APPLICATION_ID                  = 8
    BTREE_AUTOVACUUM_FULL                 = 1
    BTREE_AUTOVACUUM_INCR                 = 2
    BTREE_AUTOVACUUM_NONE                 = 0
    BTREE_AUXDELETE                       = 0x04
    BTREE_BLOBKEY                         = 2
    BTREE_BULKLOAD                        = 0x00000001
    BTREE_DATA_VERSION                    = 15
    BTREE_DEFAULT_CACHE_SIZE              = 3
    BTREE_FILE_FORMAT                     = 2
    BTREE_FORDELETE                       = 0x00000008
    BTREE_FREE_PAGE_COUNT                 = 0
    BTREE_HINT_RANGE                      = 0
    BTREE_INCR_VACUUM                     = 7
    BTREE_INTKEY                          = 1
    BTREE_LARGEST_ROOT_PAGE               = 4
    BTREE_MEMORY                          = 2
    BTREE_OMIT_JOURNAL                    = 1
    BTREE_SAVEPOSITION                    = 0x02
    BTREE_SCHEMA_VERSION                  = 1
    BTREE_SEEK_EQ                         = 0x00000002
    BTREE_SINGLE                          = 4
    BTREE_TEXT_ENCODING                   = 5
    BTREE_UNORDERED                       = 8
    BTREE_USER_VERSION                    = 6
    BTREE_WRCSR                           = 0x00000004
    BTS_EXCLUSIVE                         = 0x0040
    BTS_FAST_SECURE                       = 0x000c
    BTS_INITIALLY_EMPTY                   = 0x0010
    BTS_NO_WAL                            = 0x0020
    BTS_OVERWRITE                         = 0x0008
    BTS_PAGESIZE_FIXED                    = 0x0002
    BTS_PENDING                           = 0x0080
    BTS_READ_ONLY                         = 0x0001
    BTS_SECURE_DELETE                     = 0x0004
    BUFSIZ                                = 8192
    CACHE_STALE                           = 0
    CBRK                                  = 0
    CC_AND                                = 24
    CC_BANG                               = 15
    CC_COMMA                              = 23
    CC_DIGIT                              = 3
    CC_DOLLAR                             = 4
    CC_DOT                                = 26
    CC_EQ                                 = 14
    CC_GT                                 = 13
    CC_ID                                 = 2
    CC_ILLEGAL                            = 27
    CC_KYWD                               = 1
    CC_LP                                 = 17
    CC_LT                                 = 12
    CC_MINUS                              = 11
    CC_NUL                                = 28
    CC_PERCENT                            = 22
    CC_PIPE                               = 10
    CC_PLUS                               = 20
    CC_QUOTE                              = 8
    CC_QUOTE2                             = 9
    CC_RP                                 = 18
    CC_SEMI                               = 19
    CC_SLASH                              = 16
    CC_SPACE                              = 7
    CC_STAR                               = 21
    CC_TILDA                              = 25
    CC_VARALPHA                           = 5
    CC_VARNUM                             = 6
    CC_X                                  = 0
    CDISCARD                              = 15
    CDSUSP                                = 25
    CEOF                                  = 4
    CEOL                                  = 0
    CEOT                                  = 4
    CERASE                                = 0177
    CFLUSH                                = 15
    CINTR                                 = 3
    CKCNSTRNT_COLUMN                      = 0x01
    CKCNSTRNT_ROWID                       = 0x02
    CKILL                                 = 21
    CLNEXT                                = 22
    CLOCK_BOOTTIME                        = 7
    CLOCK_BOOTTIME_ALARM                  = 9
    CLOCK_MONOTONIC                       = 1
    CLOCK_MONOTONIC_COARSE                = 6
    CLOCK_MONOTONIC_RAW                   = 4
    CLOCK_PROCESS_CPUTIME_ID              = 2
    CLOCK_REALTIME                        = 0
    CLOCK_REALTIME_ALARM                  = 8
    CLOCK_REALTIME_COARSE                 = 5
    CLOCK_TAI                             = 11
    CLOCK_THREAD_CPUTIME_ID               = 3
    CMIN                                  = 1
    COLFLAG_BUSY                          = 0x0100
    COLFLAG_GENERATED                     = 0x0060
    COLFLAG_HASTYPE                       = 0x0004
    COLFLAG_HIDDEN                        = 0x0002
    COLFLAG_NOINSERT                      = 0x0062
    COLFLAG_NOTAVAIL                      = 0x0080
    COLFLAG_PRIMKEY                       = 0x0001
    COLFLAG_SORTERREF                     = 0x0010
    COLFLAG_STORED                        = 0x0040
    COLFLAG_UNIQUE                        = 0x0008
    COLFLAG_VIRTUAL                       = 0x0020
    COLNAME_COLUMN                        = 4
    COLNAME_DATABASE                      = 2
    COLNAME_DECLTYPE                      = 1
    COLNAME_N                             = 5
    COLNAME_NAME                          = 0
    COLNAME_TABLE                         = 3
    CQUIT                                 = 034
    CREPRINT                              = 18
    CRPRNT                                = 18
    CSTART                                = 17
    CSTATUS                               = 0
    CSTOP                                 = 19
    CSUSP                                 = 26
    CTIME                                 = 0
    CURSOR_FAULT                          = 4
    CURSOR_INVALID                        = 1
    CURSOR_REQUIRESEEK                    = 3
    CURSOR_SKIPNEXT                       = 2
    CURSOR_VALID                          = 0
    CURTYPE_BTREE                         = 0
    CURTYPE_PSEUDO                        = 3
    CURTYPE_SORTER                        = 1
    CURTYPE_VTAB                          = 2
    CWERASE                               = 23
    DBFLAG_EncodingFixed                  = 0x0040
    DBFLAG_InternalFunc                   = 0x0020
    DBFLAG_PreferBuiltin                  = 0x0002
    DBFLAG_SchemaChange                   = 0x0001
    DBFLAG_SchemaKnownOk                  = 0x0010
    DBFLAG_Vacuum                         = 0x0004
    DBFLAG_VacuumInto                     = 0x0008
    DBPAGE_COLUMN_DATA                    = 1
    DBPAGE_COLUMN_PGNO                    = 0
    DBPAGE_COLUMN_SCHEMA                  = 2
    DB_ResetWanted                        = 0x0008
    DB_SchemaLoaded                       = 0x0001
    DB_UnresetViews                       = 0x0002
    DFLT_SCHEMA_TABLE                     = "sqlite_master"
    DFLT_TEMP_SCHEMA_TABLE                = "sqlite_temp_master"
    DIRECT_MODE                           = 0
    DOTLOCK_SUFFIX                        = ".lock"
    E2BIG                                 = 7
    EACCES                                = 13
    EADDRINUSE                            = 98
    EADDRNOTAVAIL                         = 99
    EADV                                  = 68
    EAFNOSUPPORT                          = 97
    EAGAIN                                = 11
    EALREADY                              = 114
    EBADE                                 = 52
    EBADF                                 = 9
    EBADFD                                = 77
    EBADMSG                               = 74
    EBADR                                 = 53
    EBADRQC                               = 56
    EBADSLT                               = 57
    EBFONT                                = 59
    EBUSY                                 = 16
    ECANCELED                             = 125
    ECHILD                                = 10
    ECHRNG                                = 44
    ECOMM                                 = 70
    ECONNABORTED                          = 103
    ECONNREFUSED                          = 111
    ECONNRESET                            = 104
    EDEADLK                               = 35
    EDEADLOCK                             = 35
    EDESTADDRREQ                          = 89
    EDOM                                  = 33
    EDOTDOT                               = 73
    EDQUOT                                = 122
    EEXIST                                = 17
    EFAULT                                = 14
    EFBIG                                 = 27
    EHOSTDOWN                             = 112
    EHOSTUNREACH                          = 113
    EHWPOISON                             = 133
    EIDRM                                 = 43
    EILSEQ                                = 84
    EINPROGRESS                           = 115
    EINTR                                 = 4
    EINVAL                                = 22
    EIO                                   = 5
    EISCONN                               = 106
    EISDIR                                = 21
    EISNAM                                = 120
    EKEYEXPIRED                           = 127
    EKEYREJECTED                          = 129
    EKEYREVOKED                           = 128
    EL2HLT                                = 51
    EL2NSYNC                              = 45
    EL3HLT                                = 46
    EL3RST                                = 47
    ELIBACC                               = 79
    ELIBBAD                               = 80
    ELIBEXEC                              = 83
    ELIBMAX                               = 82
    ELIBSCN                               = 81
    ELNRNG                                = 48
    ELOOP                                 = 40
    EMEDIUMTYPE                           = 124
    EMFILE                                = 24
    EMLINK                                = 31
    EMSGSIZE                              = 90
    EMULTIHOP                             = 72
    ENAMETOOLONG                          = 36
    ENAME_NAME                            = 0
    ENAME_SPAN                            = 1
    ENAME_TAB                             = 2
    ENAVAIL                               = 119
    ENETDOWN                              = 100
    ENETRESET                             = 102
    ENETUNREACH                           = 101
    ENFILE                                = 23
    ENOANO                                = 55
    ENOBUFS                               = 105
    ENOCSI                                = 50
    ENODATA                               = 61
    ENODEV                                = 19
    ENOENT                                = 2
    ENOEXEC                               = 8
    ENOKEY                                = 126
    ENOLCK                                = 37
    ENOLINK                               = 67
    ENOMEDIUM                             = 123
    ENOMEM                                = 12
    ENOMSG                                = 42
    ENONET                                = 64
    ENOPKG                                = 65
    ENOPROTOOPT                           = 92
    ENOSPC                                = 28
    ENOSR                                 = 63
    ENOSTR                                = 60
    ENOSYS                                = 38
    ENOTBLK                               = 15
    ENOTCONN                              = 107
    ENOTDIR                               = 20
    ENOTEMPTY                             = 39
    ENOTNAM                               = 118
    ENOTRECOVERABLE                       = 131
    ENOTSOCK                              = 88
    ENOTSUP                               = 95
    ENOTTY                                = 25
    ENOTUNIQ                              = 76
    ENXIO                                 = 6
    EOF                                   = -1
    EOPNOTSUPP                            = 95
    EOVERFLOW                             = 75
    EOWNERDEAD                            = 130
    EPERM                                 = 1
    EPFNOSUPPORT                          = 96
    EPIPE                                 = 32
    EPROTO                                = 71
    EPROTONOSUPPORT                       = 93
    EPROTOTYPE                            = 91
    EP_Agg                                = 0x000010
    EP_Alias                              = 0x400000
    EP_CanBeNull                          = 0x100000
    EP_Collate                            = 0x000100
    EP_Commuted                           = 0x000200
    EP_ConstFunc                          = 0x080000
    EP_DblQuoted                          = 0x000040
    EP_Distinct                           = 0x000002
    EP_FixedCol                           = 0x000008
    EP_FromDDL                            = 0x40000000
    EP_FromJoin                           = 0x000001
    EP_HasFunc                            = 0x000004
    EP_Immutable                          = 0x02
    EP_InfixFunc                          = 0x000080
    EP_IntValue                           = 0x000400
    EP_IsFalse                            = 0x20000000
    EP_IsTrue                             = 0x10000000
    EP_Leaf                               = 0x800000
    EP_MemToken                           = 0x010000
    EP_NoReduce                           = 0x01
    EP_Propagate                          = 2097412
    EP_Quoted                             = 0x4000000
    EP_Reduced                            = 0x002000
    EP_Skip                               = 0x001000
    EP_Static                             = 0x8000000
    EP_Subquery                           = 0x200000
    EP_Subrtn                             = 0x2000000
    EP_TokenOnly                          = 0x004000
    EP_Unlikely                           = 0x040000
    EP_VarSelect                          = 0x000020
    EP_Win                                = 0x008000
    EP_WinFunc                            = 0x1000000
    EP_xIsSelect                          = 0x000800
    ERANGE                                = 34
    EREMCHG                               = 78
    EREMOTE                               = 66
    EREMOTEIO                             = 121
    ERESTART                              = 85
    ERFKILL                               = 132
    EROFS                                 = 30
    ESHUTDOWN                             = 108
    ESOCKTNOSUPPORT                       = 94
    ESPIPE                                = 29
    ESRCH                                 = 3
    ESRMNT                                = 69
    ESTALE                                = 116
    ESTRPIPE                              = 86
    ETIME                                 = 62
    ETIMEDOUT                             = 110
    ETOOMANYREFS                          = 109
    ETXTBSY                               = 26
    EUCLEAN                               = 117
    EUNATCH                               = 49
    EUSERS                                = 87
    EWOULDBLOCK                           = 11
    EXCLUDED_TABLE_NUMBER                 = 2
    EXCLUSIVE_LOCK                        = 4
    EXDEV                                 = 18
    EXFULL                                = 54
    EXIT_FAILURE                          = 1
    EXIT_SUCCESS                          = 0
    EXPRDUP_REDUCE                        = 0x0001
    F2FS_FEATURE_ATOMIC_WRITE             = 0x0004
    F2FS_IOCTL_MAGIC                      = 0xf5
    F2FS_IOC_ABORT_VOLATILE_WRITE         = 62725
    F2FS_IOC_COMMIT_ATOMIC_WRITE          = 62722
    F2FS_IOC_START_ATOMIC_WRITE           = 62721
    F2FS_IOC_START_VOLATILE_WRITE         = 62723
    FD_CLOEXEC                            = 1
    FD_SETSIZE                            = 1024
    FILENAME_MAX                          = 4096
    FIOASYNC                              = 0x5452
    FIOCLEX                               = 0x5451
    FIONBIO                               = 0x5421
    FIONCLEX                              = 0x5450
    FIONREAD                              = 0x541B
    FIOQSIZE                              = 0x5460
    FLAG_SIGNED                           = 1
    FLAG_STRING                           = 4
    FOPEN_MAX                             = 16
    FP_ILOGB0                             = -2147483648
    FP_ILOGBNAN                           = -2147483648
    FP_INFINITE1                          = 1
    FP_NAN1                               = 0
    FP_NORMAL1                            = 4
    FP_SUBNORMAL1                         = 3
    FP_ZERO1                              = 2
    FTS5CSR_EOF                           = 0x01
    FTS5CSR_FREE_ZRANK                    = 0x10
    FTS5CSR_REQUIRE_CONTENT               = 0x02
    FTS5CSR_REQUIRE_DOCSIZE               = 0x04
    FTS5CSR_REQUIRE_INST                  = 0x08
    FTS5CSR_REQUIRE_POSLIST               = 0x40
    FTS5CSR_REQUIRE_RESEEK                = 0x20
    FTS5INDEX_QUERY_DESC                  = 0x0002
    FTS5INDEX_QUERY_NOOUTPUT              = 0x0020
    FTS5INDEX_QUERY_PREFIX                = 0x0001
    FTS5INDEX_QUERY_SCAN                  = 0x0008
    FTS5INDEX_QUERY_SKIPEMPTY             = 0x0010
    FTS5INDEX_QUERY_TEST_NOIDX            = 0x0004
    FTS5_AND                              = 2
    FTS5_AVERAGES_ROWID                   = 1
    FTS5_BI_MATCH                         = 0x0001
    FTS5_BI_ORDER_DESC                    = 0x0080
    FTS5_BI_ORDER_RANK                    = 0x0020
    FTS5_BI_ORDER_ROWID                   = 0x0040
    FTS5_BI_RANK                          = 0x0002
    FTS5_BI_ROWID_EQ                      = 0x0004
    FTS5_BI_ROWID_GE                      = 0x0010
    FTS5_BI_ROWID_LE                      = 0x0008
    FTS5_CARET                            = 12
    FTS5_COLON                            = 5
    FTS5_COMMA                            = 13
    FTS5_CONTENT_EXTERNAL                 = 2
    FTS5_CONTENT_NONE                     = 1
    FTS5_CONTENT_NORMAL                   = 0
    FTS5_CORRUPT                          = 267
    FTS5_CURRENT_VERSION                  = 4
    FTS5_DATA_DLI_B                       = 1
    FTS5_DATA_HEIGHT_B                    = 5
    FTS5_DATA_ID_B                        = 16
    FTS5_DATA_PADDING                     = 20
    FTS5_DATA_PAGE_B                      = 31
    FTS5_DATA_ZERO_PADDING                = 8
    FTS5_DEFAULT_AUTOMERGE                = 4
    FTS5_DEFAULT_CRISISMERGE              = 16
    FTS5_DEFAULT_HASHSIZE                 = 1048576
    FTS5_DEFAULT_NEARDIST                 = 10
    FTS5_DEFAULT_PAGE_SIZE                = 4050
    FTS5_DEFAULT_RANK                     = "bm25"
    FTS5_DEFAULT_USERMERGE                = 4
    FTS5_DETAIL_COLUMNS                   = 2
    FTS5_DETAIL_FULL                      = 0
    FTS5_DETAIL_NONE                      = 1
    FTS5_EOF                              = 0
    FTS5_LCP                              = 7
    FTS5_LP                               = 10
    FTS5_MAIN_PREFIX                      = 48
    FTS5_MAX_PAGE_SIZE                    = 65536
    FTS5_MAX_PREFIX_INDEXES               = 31
    FTS5_MAX_SEGMENT                      = 2000
    FTS5_MAX_TOKEN_SIZE                   = 32768
    FTS5_MINUS                            = 6
    FTS5_MIN_DLIDX_SIZE                   = 4
    FTS5_NOINLINE                         = 0
    FTS5_NOT                              = 3
    FTS5_OPT_WORK_UNIT                    = 1000
    FTS5_OR                               = 1
    FTS5_PLAN_MATCH                       = 1
    FTS5_PLAN_ROWID                       = 6
    FTS5_PLAN_SCAN                        = 5
    FTS5_PLAN_SORTED_MATCH                = 4
    FTS5_PLAN_SOURCE                      = 2
    FTS5_PLAN_SPECIAL                     = 3
    FTS5_PLUS                             = 14
    FTS5_PORTER_MAX_TOKEN                 = 64
    FTS5_RANK_NAME                        = "rank"
    FTS5_RCP                              = 8
    FTS5_REMOVE_DIACRITICS_COMPLEX        = 2
    FTS5_REMOVE_DIACRITICS_NONE           = 0
    FTS5_REMOVE_DIACRITICS_SIMPLE         = 1
    FTS5_ROWID_NAME                       = "rowid"
    FTS5_RP                               = 11
    FTS5_SEGITER_ONETERM                  = 0x01
    FTS5_SEGITER_REVERSE                  = 0x02
    FTS5_STAR                             = 15
    FTS5_STMT_DELETE_CONTENT              = 5
    FTS5_STMT_DELETE_DOCSIZE              = 7
    FTS5_STMT_INSERT_CONTENT              = 3
    FTS5_STMT_LOOKUP                      = 2
    FTS5_STMT_LOOKUP_DOCSIZE              = 8
    FTS5_STMT_REPLACE_CONFIG              = 9
    FTS5_STMT_REPLACE_CONTENT             = 4
    FTS5_STMT_REPLACE_DOCSIZE             = 6
    FTS5_STMT_SCAN                        = 10
    FTS5_STMT_SCAN_ASC                    = 0
    FTS5_STMT_SCAN_DESC                   = 1
    FTS5_STRING                           = 9
    FTS5_STRUCTURE_ROWID                  = 10
    FTS5_TERM                             = 4
    FTS5_TOKENIZE_AUX                     = 0x0008
    FTS5_TOKENIZE_DOCUMENT                = 0x0004
    FTS5_TOKENIZE_PREFIX                  = 0x0002
    FTS5_TOKENIZE_QUERY                   = 0x0001
    FTS5_TOKEN_COLOCATED                  = 0x0001
    FTS5_VOCAB_COL                        = 0
    FTS5_VOCAB_COL_SCHEMA                 = "term, col, doc, cnt"
    FTS5_VOCAB_INSTANCE                   = 2
    FTS5_VOCAB_INST_SCHEMA                = "term, doc, col, offset"
    FTS5_VOCAB_ROW                        = 1
    FTS5_VOCAB_ROW_SCHEMA                 = "term, doc, cnt"
    FTS5_VOCAB_TERM_EQ                    = 0x01
    FTS5_VOCAB_TERM_GE                    = 0x02
    FTS5_VOCAB_TERM_LE                    = 0x04
    FTS5_WORK_UNIT                        = 64
    FULLY_WITHIN                          = 2
    FUNC_PERFECT_MATCH                    = 6
    F_DUPFD                               = 0
    F_EXLCK                               = 4
    F_GETFD                               = 1
    F_GETFL                               = 3
    F_GETLK                               = 5
    F_GETLK64                             = 5
    F_GETOWN                              = 9
    F_LOCK                                = 1
    F_OK                                  = 0
    F_RDLCK                               = 0
    F_SETFD                               = 2
    F_SETFL                               = 4
    F_SETLK                               = 6
    F_SETLK64                             = 6
    F_SETLKW                              = 7
    F_SETLKW64                            = 7
    F_SETOWN                              = 8
    F_SHLCK                               = 8
    F_TEST                                = 3
    F_TLOCK                               = 2
    F_ULOCK                               = 0
    F_UNLCK                               = 2
    F_WRLCK                               = 1
    GCC_VERSION                           = 0
    GEOPOLY_PI                            = 3.1415926535897932385
    HASHSIZE                              = 97
    HASHTABLE_HASH_1                      = 383
    HASHTABLE_NPAGE                       = 4096
    HASHTABLE_NSLOT                       = 8192
    HAVE_FCHOWN                           = 1
    HAVE_FULLFSYNC                        = 0
    HAVE_GETHOSTUUID                      = 0
    HAVE_LSTAT                            = 1
    HAVE_MREMAP                           = 0
    HAVE_READLINK                         = 1
    HAVE_USLEEP                           = 1
    HUGE_VAL                              = 0
    HUGE_VALF                             = 0
    HUGE_VALL                             = 0
    INCRINIT_NORMAL                       = 0
    INCRINIT_ROOT                         = 2
    INCRINIT_TASK                         = 1
    INFINITY                              = 0
    INITFLAG_AlterTable                   = 0x0001
    INLINEFUNC_affinity                   = 4
    INLINEFUNC_coalesce                   = 0
    INLINEFUNC_expr_compare               = 3
    INLINEFUNC_expr_implies_expr          = 2
    INLINEFUNC_iif                        = 5
    INLINEFUNC_implies_nonnull_row        = 1
    INLINEFUNC_unlikely                   = 99
    INTERFACE                             = 1
    IN_INDEX_EPH                          = 2
    IN_INDEX_INDEX_ASC                    = 3
    IN_INDEX_INDEX_DESC                   = 4
    IN_INDEX_LOOP                         = 0x0004
    IN_INDEX_MEMBERSHIP                   = 0x0002
    IN_INDEX_NOOP                         = 5
    IN_INDEX_NOOP_OK                      = 0x0001
    IN_INDEX_ROWID                        = 1
    IOCSIZE_MASK                          = 1073676288
    IOCSIZE_SHIFT                         = 16
    IOC_IN                                = 1073741824
    IOC_INOUT                             = 3221225472
    IOC_OUT                               = 2147483648
    IsStat4                               = 1
    JEACH_ATOM                            = 3
    JEACH_FULLKEY                         = 6
    JEACH_ID                              = 4
    JEACH_JSON                            = 8
    JEACH_KEY                             = 0
    JEACH_PARENT                          = 5
    JEACH_PATH                            = 7
    JEACH_ROOT                            = 9
    JEACH_TYPE                            = 2
    JEACH_VALUE                           = 1
    JNODE_APPEND                          = 0x20
    JNODE_ESCAPE                          = 0x02
    JNODE_LABEL                           = 0x40
    JNODE_PATCH                           = 0x10
    JNODE_RAW                             = 0x01
    JNODE_REMOVE                          = 0x04
    JNODE_REPLACE                         = 0x08
    JSON_ARRAY                            = 6
    JSON_CACHE_ID                         = -429938
    JSON_CACHE_SZ                         = 4
    JSON_FALSE                            = 2
    JSON_INT                              = 3
    JSON_MAX_DEPTH                        = 2000
    JSON_NOINLINE                         = 0
    JSON_NULL                             = 0
    JSON_OBJECT                           = 7
    JSON_REAL                             = 4
    JSON_STRING                           = 5
    JSON_SUBTYPE                          = 74
    JSON_TRUE                             = 1
    JT_CROSS                              = 0x0002
    JT_ERROR                              = 0x0040
    JT_INNER                              = 0x0001
    JT_LEFT                               = 0x0008
    JT_NATURAL                            = 0x0004
    JT_OUTER                              = 0x0020
    JT_RIGHT                              = 0x0010
    KEYINFO_ORDER_BIGNULL                 = 0x02
    KEYINFO_ORDER_DESC                    = 0x01
    LOCATE_NOERR                          = 0x02
    LOCATE_VIEW                           = 0x01
    LOOKASIDE_SMALL                       = 128
    L_ctermid                             = 9
    L_tmpnam                              = 20
    MAP_FIXED                             = 0x10
    MAP_PRIVATE                           = 0x02
    MAP_SHARED                            = 0x01
    MATH_ERREXCEPT                        = 2
    MATH_ERRNO                            = 1
    MAXFLOAT                              = 3.40282347e+38
    MAX_PATHNAME                          = 512
    MAX_SECTOR_SIZE                       = 0x10000
    MCL_CURRENT                           = 1
    MCL_FUTURE                            = 2
    MCL_ONFAULT                           = 4
    MEMJOURNAL_DFLT_FILECHUNKSIZE         = 1024
    MEMTYPE_HEAP                          = 0x01
    MEMTYPE_LOOKASIDE                     = 0x02
    MEMTYPE_PCACHE                        = 0x04
    MEM_AffMask                           = 0x003f
    MEM_Agg                               = 0x2000
    MEM_Blob                              = 0x0010
    MEM_Cleared                           = 0x0100
    MEM_Dyn                               = 0x0400
    MEM_Ephem                             = 0x1000
    MEM_FromBind                          = 0x0040
    MEM_Int                               = 0x0004
    MEM_IntReal                           = 0x0020
    MEM_Null                              = 0x0001
    MEM_Real                              = 0x0008
    MEM_Static                            = 0x0800
    MEM_Str                               = 0x0002
    MEM_Subtype                           = 0x8000
    MEM_Term                              = 0x0200
    MEM_TypeMask                          = 0xc1bf
    MEM_Undefined                         = 0x0080
    MEM_Zero                              = 0x4000
    MSVC_VERSION                          = 0
    MS_ASYNC                              = 1
    MS_INVALIDATE                         = 2
    MS_SYNC                               = 4
    M_1_PI                                = 0.31830988618379067154
    M_2_PI                                = 0.63661977236758134308
    M_2_SQRTPI                            = 1.12837916709551257390
    M_E                                   = 2.7182818284590452354
    M_LN10                                = 2.30258509299404568402
    M_LN2                                 = 0.69314718055994530942
    M_LOG10E                              = 0.43429448190325182765
    M_LOG2E                               = 1.4426950408889634074
    M_PI                                  = 3.14159265358979323846
    M_PI_2                                = 1.57079632679489661923
    M_PI_4                                = 0.78539816339744830962
    M_SQRT1_2                             = 0.70710678118654752440
    M_SQRT2                               = 1.41421356237309504880
    NAN                                   = 0
    NB                                    = 3
    NCC                                   = 8
    NC_AllowAgg                           = 0x00001
    NC_AllowWin                           = 0x04000
    NC_Complex                            = 0x02000
    NC_FromDDL                            = 0x40000
    NC_GenCol                             = 0x00008
    NC_HasAgg                             = 0x00010
    NC_HasWin                             = 0x08000
    NC_IdxExpr                            = 0x00020
    NC_InAggFunc                          = 0x20000
    NC_IsCheck                            = 0x00004
    NC_IsDDL                              = 0x10000
    NC_MinMaxAgg                          = 0x01000
    NC_PartIdx                            = 0x00002
    NC_SelfRef                            = 0x0002e
    NC_UAggInfo                           = 0x00100
    NC_UEList                             = 0x00080
    NC_UUpsert                            = 0x00200
    NC_VarSelect                          = 0x00040
    NDEBUG                                = 1
    NN                                    = 1
    NOT_WITHIN                            = 0
    NO_LOCK                               = 0
    N_6PACK                               = 7
    N_AX25                                = 5
    N_HCI                                 = 15
    N_HDLC                                = 13
    N_IRDA                                = 11
    N_MASC                                = 8
    N_MOUSE                               = 2
    N_OR_COST                             = 3
    N_PPP                                 = 3
    N_PROFIBUS_FDL                        = 10
    N_R3964                               = 9
    N_SLIP                                = 1
    N_SMSBLOCK                            = 12
    N_SORT_BUCKET                         = 32
    N_STATEMENT                           = 8
    N_STRIP                               = 4
    N_SYNC_PPP                            = 14
    N_TTY                                 = 0
    N_X25                                 = 6
    OE_Abort                              = 2
    OE_Cascade                            = 10
    OE_Default                            = 11
    OE_Fail                               = 3
    OE_Ignore                             = 4
    OE_None                               = 0
    OE_Replace                            = 5
    OE_Restrict                           = 7
    OE_Rollback                           = 1
    OE_SetDflt                            = 9
    OE_SetNull                            = 8
    OE_Update                             = 6
    OMIT_TEMPDB                           = 0
    ONEPASS_MULTI                         = 2
    ONEPASS_OFF                           = 0
    ONEPASS_SINGLE                        = 1
    OPFLAG_APPEND                         = 0x08
    OPFLAG_AUXDELETE                      = 0x04
    OPFLAG_BULKCSR                        = 0x01
    OPFLAG_EPHEM                          = 0x01
    OPFLAG_FORDELETE                      = 0x08
    OPFLAG_ISNOOP                         = 0x40
    OPFLAG_ISUPDATE                       = 0x04
    OPFLAG_LASTROWID                      = 0x20
    OPFLAG_LENGTHARG                      = 0x40
    OPFLAG_NCHANGE                        = 0x01
    OPFLAG_NOCHNG                         = 0x01
    OPFLAG_NOCHNG_MAGIC                   = 0x6d
    OPFLAG_P2ISREG                        = 0x10
    OPFLAG_PERMUTE                        = 0x01
    OPFLAG_SAVEPOSITION                   = 0x02
    OPFLAG_SEEKEQ                         = 0x02
    OPFLAG_TYPEOFARG                      = 0x80
    OPFLAG_USESEEKRESULT                  = 0x10
    OPFLG_IN1                             = 0x02
    OPFLG_IN2                             = 0x04
    OPFLG_IN3                             = 0x08
    OPFLG_JUMP                            = 0x01
    OPFLG_OUT2                            = 0x10
    OPFLG_OUT3                            = 0x20
    OP_Abortable                          = 175
    OP_Add                                = 105
    OP_AddImm                             = 82
    OP_Affinity                           = 90
    OP_AggFinal                           = 157
    OP_AggInverse                         = 153
    OP_AggStep                            = 154
    OP_AggStep1                           = 155
    OP_AggValue                           = 156
    OP_And                                = 44
    OP_AutoCommit                         = 1
    OP_BitAnd                             = 101
    OP_BitNot                             = 112
    OP_BitOr                              = 102
    OP_Blob                               = 74
    OP_Cast                               = 84
    OP_Checkpoint                         = 6
    OP_Clear                              = 137
    OP_Close                              = 116
    OP_CollSeq                            = 81
    OP_Column                             = 89
    OP_ColumnsUsed                        = 117
    OP_Compare                            = 86
    OP_Concat                             = 110
    OP_Copy                               = 77
    OP_Count                              = 92
    OP_CreateBtree                        = 139
    OP_CursorHint                         = 171
    OP_CursorLock                         = 159
    OP_CursorUnlock                       = 160
    OP_DecrJumpZero                       = 59
    OP_DeferredSeek                       = 133
    OP_Delete                             = 122
    OP_Destroy                            = 136
    OP_Divide                             = 108
    OP_DropIndex                          = 144
    OP_DropTable                          = 143
    OP_DropTrigger                        = 145
    OP_ElseNotEq                          = 58
    OP_EndCoroutine                       = 66
    OP_Eq                                 = 53
    OP_Expire                             = 158
    OP_Explain                            = 174
    OP_FinishSeek                         = 135
    OP_FkCounter                          = 149
    OP_FkIfZero                           = 47
    OP_Found                              = 30
    OP_Function                           = 64
    OP_Ge                                 = 57
    OP_Gosub                              = 12
    OP_Goto                               = 11
    OP_Gt                                 = 54
    OP_Halt                               = 68
    OP_HaltIfNull                         = 67
    OP_IdxDelete                          = 132
    OP_IdxGE                              = 41
    OP_IdxGT                              = 39
    OP_IdxInsert                          = 130
    OP_IdxLE                              = 38
    OP_IdxLT                              = 40
    OP_IdxRowid                           = 134
    OP_If                                 = 18
    OP_IfNoHope                           = 27
    OP_IfNot                              = 20
    OP_IfNotOpen                          = 26
    OP_IfNotZero                          = 49
    OP_IfNullRow                          = 21
    OP_IfPos                              = 48
    OP_IfSmaller                          = 34
    OP_IncrVacuum                         = 60
    OP_Init                               = 62
    OP_InitCoroutine                      = 13
    OP_Insert                             = 121
    OP_Int64                              = 70
    OP_IntCopy                            = 79
    OP_Integer                            = 69
    OP_IntegrityCk                        = 146
    OP_IsNull                             = 50
    OP_IsTrue                             = 87
    OP_JournalMode                        = 7
    OP_Jump                               = 16
    OP_Last                               = 33
    OP_Le                                 = 55
    OP_LoadAnalysis                       = 142
    OP_Lt                                 = 56
    OP_MakeRecord                         = 91
    OP_MaxPgcnt                           = 169
    OP_MemMax                             = 151
    OP_Move                               = 76
    OP_Multiply                           = 107
    OP_MustBeInt                          = 15
    OP_Ne                                 = 52
    OP_NewRowid                           = 120
    OP_Next                               = 5
    OP_NoConflict                         = 28
    OP_Noop                               = 173
    OP_Not                                = 19
    OP_NotExists                          = 32
    OP_NotFound                           = 29
    OP_NotNull                            = 51
    OP_Null                               = 72
    OP_NullRow                            = 128
    OP_Offset                             = 88
    OP_OffsetLimit                        = 152
    OP_Once                               = 17
    OP_OpenAutoindex                      = 99
    OP_OpenDup                            = 98
    OP_OpenEphemeral                      = 100
    OP_OpenPseudo                         = 114
    OP_OpenRead                           = 96
    OP_OpenWrite                          = 97
    OP_Or                                 = 43
    OP_Pagecount                          = 168
    OP_Param                              = 148
    OP_ParseSchema                        = 141
    OP_Permutation                        = 85
    OP_Prev                               = 4
    OP_Program                            = 46
    OP_PureFunc                           = 63
    OP_ReadCookie                         = 93
    OP_Real                               = 150
    OP_RealAffinity                       = 83
    OP_ReleaseReg                         = 172
    OP_Remainder                          = 109
    OP_ReopenIdx                          = 95
    OP_ResetCount                         = 123
    OP_ResetSorter                        = 138
    OP_ResultRow                          = 80
    OP_Return                             = 65
    OP_Rewind                             = 37
    OP_RowData                            = 126
    OP_RowSetAdd                          = 147
    OP_RowSetRead                         = 42
    OP_RowSetTest                         = 45
    OP_Rowid                              = 127
    OP_SCopy                              = 78
    OP_Savepoint                          = 0
    OP_SeekEnd                            = 129
    OP_SeekGE                             = 24
    OP_SeekGT                             = 25
    OP_SeekHit                            = 118
    OP_SeekLE                             = 23
    OP_SeekLT                             = 22
    OP_SeekRowid                          = 31
    OP_Sequence                           = 119
    OP_SequenceTest                       = 113
    OP_SetCookie                          = 94
    OP_ShiftLeft                          = 103
    OP_ShiftRight                         = 104
    OP_SoftNull                           = 73
    OP_Sort                               = 36
    OP_SorterCompare                      = 124
    OP_SorterData                         = 125
    OP_SorterInsert                       = 131
    OP_SorterNext                         = 3
    OP_SorterOpen                         = 111
    OP_SorterSort                         = 35
    OP_SqlExec                            = 140
    OP_String                             = 71
    OP_String8                            = 115
    OP_Subtract                           = 106
    OP_TableLock                          = 161
    OP_Trace                              = 170
    OP_Transaction                        = 2
    OP_VBegin                             = 162
    OP_VColumn                            = 166
    OP_VCreate                            = 163
    OP_VDestroy                           = 164
    OP_VFilter                            = 9
    OP_VNext                              = 61
    OP_VOpen                              = 165
    OP_VRename                            = 167
    OP_VUpdate                            = 10
    OP_Vacuum                             = 8
    OP_Variable                           = 75
    OP_Yield                              = 14
    OS_VXWORKS                            = 0
    O_ACCMODE                             = 0003
    O_APPEND                              = 02000
    O_ASYNC                               = 020000
    O_BINARY                              = 0
    O_CREAT                               = 0100
    O_DSYNC                               = 4096
    O_EXCL                                = 0200
    O_FSYNC                               = 1052672
    O_LARGEFILE                           = 0
    O_NDELAY                              = 2048
    O_NOCTTY                              = 0400
    O_NOFOLLOW                            = 0
    O_NONBLOCK                            = 04000
    O_RDONLY                              = 00
    O_RDWR                                = 02
    O_RSYNC                               = 1052672
    O_SYNC                                = 04010000
    O_TRUNC                               = 01000
    O_WRONLY                              = 01
    P4_ADVANCE                            = -5
    P4_COLLSEQ                            = -2
    P4_DYNAMIC                            = -7
    P4_DYNBLOB                            = -17
    P4_EXPR                               = -10
    P4_FREE_IF_LE                         = -7
    P4_FUNCCTX                            = -16
    P4_FUNCDEF                            = -8
    P4_INT32                              = -3
    P4_INT64                              = -14
    P4_INTARRAY                           = -15
    P4_KEYINFO                            = -9
    P4_MEM                                = -11
    P4_NOTUSED                            = 0
    P4_REAL                               = -13
    P4_STATIC                             = -1
    P4_SUBPROGRAM                         = -4
    P4_TABLE                              = -6
    P4_TRANSIENT                          = 0
    P4_VTAB                               = -12
    P5_ConstraintCheck                    = 3
    P5_ConstraintFK                       = 4
    P5_ConstraintNotNull                  = 1
    P5_ConstraintUnique                   = 2
    PAGER_CACHESPILL                      = 0x20
    PAGER_CKPT_FULLFSYNC                  = 0x10
    PAGER_ERROR                           = 6
    PAGER_FLAGS_MASK                      = 0x38
    PAGER_FULLFSYNC                       = 0x08
    PAGER_GET_NOCONTENT                   = 0x01
    PAGER_GET_READONLY                    = 0x02
    PAGER_JOURNALMODE_DELETE              = 0
    PAGER_JOURNALMODE_MEMORY              = 4
    PAGER_JOURNALMODE_OFF                 = 2
    PAGER_JOURNALMODE_PERSIST             = 1
    PAGER_JOURNALMODE_QUERY               = -1
    PAGER_JOURNALMODE_TRUNCATE            = 3
    PAGER_JOURNALMODE_WAL                 = 5
    PAGER_LOCKINGMODE_EXCLUSIVE           = 1
    PAGER_LOCKINGMODE_NORMAL              = 0
    PAGER_LOCKINGMODE_QUERY               = -1
    PAGER_MEMORY                          = 0x0002
    PAGER_OMIT_JOURNAL                    = 0x0001
    PAGER_OPEN                            = 0
    PAGER_READER                          = 1
    PAGER_STAT_HIT                        = 0
    PAGER_STAT_MISS                       = 1
    PAGER_STAT_SPILL                      = 3
    PAGER_STAT_WRITE                      = 2
    PAGER_SYNCHRONOUS_EXTRA               = 0x04
    PAGER_SYNCHRONOUS_FULL                = 0x03
    PAGER_SYNCHRONOUS_MASK                = 0x07
    PAGER_SYNCHRONOUS_NORMAL              = 0x02
    PAGER_SYNCHRONOUS_OFF                 = 0x01
    PAGER_WRITER_CACHEMOD                 = 3
    PAGER_WRITER_DBMOD                    = 4
    PAGER_WRITER_FINISHED                 = 5
    PAGER_WRITER_LOCKED                   = 2
    PARSE_MODE_DECLARE_VTAB               = 1
    PARSE_MODE_NORMAL                     = 0
    PARSE_MODE_RENAME                     = 2
    PARSE_MODE_UNMAP                      = 3
    PARTLY_WITHIN                         = 1
    PCACHE1_MIGHT_USE_GROUP_MUTEX         = 1
    PCACHE_DIRTYLIST_ADD                  = 2
    PCACHE_DIRTYLIST_FRONT                = 3
    PCACHE_DIRTYLIST_REMOVE               = 1
    PENDING_LOCK                          = 3
    PGHDR_CLEAN                           = 0x001
    PGHDR_DIRTY                           = 0x002
    PGHDR_DONT_WRITE                      = 0x010
    PGHDR_MMAP                            = 0x020
    PGHDR_NEED_SYNC                       = 0x008
    PGHDR_WAL_APPEND                      = 0x040
    PGHDR_WRITEABLE                       = 0x004
    POSIX_FADV_DONTNEED                   = 4
    POSIX_FADV_NOREUSE                    = 5
    POSIX_FADV_NORMAL                     = 0
    POSIX_FADV_RANDOM                     = 1
    POSIX_FADV_SEQUENTIAL                 = 2
    POSIX_FADV_WILLNEED                   = 3
    POSIX_MADV_DONTNEED                   = 4
    POSIX_MADV_NORMAL                     = 0
    POSIX_MADV_RANDOM                     = 1
    POSIX_MADV_SEQUENTIAL                 = 2
    POSIX_MADV_WILLNEED                   = 3
    PROT_EXEC                             = 0x4
    PROT_GROWSDOWN                        = 0x01000000
    PROT_GROWSUP                          = 0x02000000
    PROT_NONE                             = 0x0
    PROT_READ                             = 0x1
    PROT_WRITE                            = 0x2
    PTF_INTKEY                            = 0x01
    PTF_LEAF                              = 0x08
    PTF_LEAFDATA                          = 0x04
    PTF_ZERODATA                          = 0x02
    PTRMAP_BTREE                          = 5
    PTRMAP_FREEPAGE                       = 2
    PTRMAP_OVERFLOW1                      = 3
    PTRMAP_OVERFLOW2                      = 4
    PTRMAP_ROOTPAGE                       = 1
    P_tmpdir                              = "/tmp"
    PragFlg_NeedSchema                    = 0x01
    PragFlg_NoColumns                     = 0x02
    PragFlg_NoColumns1                    = 0x04
    PragFlg_ReadOnly                      = 0x08
    PragFlg_Result0                       = 0x10
    PragFlg_Result1                       = 0x20
    PragFlg_SchemaOpt                     = 0x40
    PragFlg_SchemaReq                     = 0x80
    PragTyp_ACTIVATE_EXTENSIONS           = 0
    PragTyp_ANALYSIS_LIMIT                = 1
    PragTyp_AUTO_VACUUM                   = 3
    PragTyp_BUSY_TIMEOUT                  = 5
    PragTyp_CACHE_SIZE                    = 6
    PragTyp_CACHE_SPILL                   = 7
    PragTyp_CASE_SENSITIVE_LIKE           = 8
    PragTyp_COLLATION_LIST                = 9
    PragTyp_COMPILE_OPTIONS               = 10
    PragTyp_DATABASE_LIST                 = 12
    PragTyp_DATA_STORE_DIRECTORY          = 11
    PragTyp_DEFAULT_CACHE_SIZE            = 13
    PragTyp_ENCODING                      = 14
    PragTyp_FLAG                          = 4
    PragTyp_FOREIGN_KEY_CHECK             = 15
    PragTyp_FOREIGN_KEY_LIST              = 16
    PragTyp_FUNCTION_LIST                 = 17
    PragTyp_HARD_HEAP_LIMIT               = 18
    PragTyp_HEADER_VALUE                  = 2
    PragTyp_INCREMENTAL_VACUUM            = 19
    PragTyp_INDEX_INFO                    = 20
    PragTyp_INDEX_LIST                    = 21
    PragTyp_INTEGRITY_CHECK               = 22
    PragTyp_JOURNAL_MODE                  = 23
    PragTyp_JOURNAL_SIZE_LIMIT            = 24
    PragTyp_LOCKING_MODE                  = 26
    PragTyp_LOCK_PROXY_FILE               = 25
    PragTyp_LOCK_STATUS                   = 43
    PragTyp_MMAP_SIZE                     = 28
    PragTyp_MODULE_LIST                   = 29
    PragTyp_OPTIMIZE                      = 30
    PragTyp_PAGE_COUNT                    = 27
    PragTyp_PAGE_SIZE                     = 31
    PragTyp_PRAGMA_LIST                   = 32
    PragTyp_SECURE_DELETE                 = 33
    PragTyp_SHRINK_MEMORY                 = 34
    PragTyp_SOFT_HEAP_LIMIT               = 35
    PragTyp_STATS                         = 44
    PragTyp_SYNCHRONOUS                   = 36
    PragTyp_TABLE_INFO                    = 37
    PragTyp_TEMP_STORE                    = 38
    PragTyp_TEMP_STORE_DIRECTORY          = 39
    PragTyp_THREADS                       = 40
    PragTyp_WAL_AUTOCHECKPOINT            = 41
    PragTyp_WAL_CHECKPOINT                = 42
    RAND_MAX                              = 2147483647
    RBU_CREATE_STATE                      = "CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)"
    RBU_DELETE                            = 2
    RBU_ENABLE_DELTA_CKSUM                = 0
    RBU_IDX_DELETE                        = 4
    RBU_IDX_INSERT                        = 5
    RBU_INSERT                            = 1
    RBU_PK_EXTERNAL                       = 3
    RBU_PK_IPK                            = 2
    RBU_PK_NONE                           = 1
    RBU_PK_NOTABLE                        = 0
    RBU_PK_VTAB                           = 5
    RBU_PK_WITHOUT_ROWID                  = 4
    RBU_REPLACE                           = 3
    RBU_STAGE_CAPTURE                     = 3
    RBU_STAGE_CKPT                        = 4
    RBU_STAGE_DONE                        = 5
    RBU_STAGE_MOVE                        = 2
    RBU_STAGE_OAL                         = 1
    RBU_STATE_CKPT                        = 6
    RBU_STATE_COOKIE                      = 7
    RBU_STATE_DATATBL                     = 10
    RBU_STATE_IDX                         = 3
    RBU_STATE_OALSZ                       = 8
    RBU_STATE_PHASEONESTEP                = 9
    RBU_STATE_PROGRESS                    = 5
    RBU_STATE_ROW                         = 4
    RBU_STATE_STAGE                       = 1
    RBU_STATE_TBL                         = 2
    RBU_UPDATE                            = 6
    READMARK_NOT_USED                     = 0xffffffff
    READ_LOCK                             = 1
    RESERVED_LOCK                         = 2
    RNDAWAY                               = 0
    RNDTOWARDS                            = 0
    ROWSET_ALLOCATION_SIZE                = 1024
    ROWSET_NEXT                           = 0x02
    ROWSET_SORTED                         = 0x01
    RTLD_BINDING_MASK                     = 0x3
    RTLD_DEEPBIND                         = 0x00008
    RTLD_GLOBAL                           = 0x00100
    RTLD_LAZY                             = 0x00001
    RTLD_LOCAL                            = 0
    RTLD_NODELETE                         = 0x01000
    RTLD_NOLOAD                           = 0x00004
    RTLD_NOW                              = 0x00002
    RTREE_CACHE_SZ                        = 5
    RTREE_CHECK_MAX_ERROR                 = 100
    RTREE_COORD_INT32                     = 1
    RTREE_COORD_REAL32                    = 0
    RTREE_DEFAULT_ROWEST                  = 1048576
    RTREE_EQ                              = 0x41
    RTREE_FALSE                           = 0x40
    RTREE_GE                              = 0x44
    RTREE_GT                              = 0x45
    RTREE_LE                              = 0x42
    RTREE_LT                              = 0x43
    RTREE_MATCH                           = 0x46
    RTREE_MAXCELLS                        = 51
    RTREE_MAX_AUX_COLUMN                  = 100
    RTREE_MAX_DEPTH                       = 40
    RTREE_MAX_DIMENSIONS                  = 5
    RTREE_MIN_ROWEST                      = 100
    RTREE_QUERY                           = 0x47
    RTREE_TRUE                            = 0x3f
    RTREE_ZERO                            = 0.0
    R_OK                                  = 4
    SAVEPOINT_BEGIN                       = 0
    SAVEPOINT_RELEASE                     = 1
    SAVEPOINT_ROLLBACK                    = 2
    SCHEMA_ROOT                           = 1
    SEEK_CUR                              = 1
    SEEK_END                              = 2
    SEEK_SET                              = 0
    SELECTTRACE_ENABLED                   = 0
    SF_Aggregate                          = 0x0000008
    SF_All                                = 0x0000002
    SF_ComplexResult                      = 0x0040000
    SF_Compound                           = 0x0000100
    SF_Converted                          = 0x0010000
    SF_Distinct                           = 0x0000001
    SF_Expanded                           = 0x0000040
    SF_FixedLimit                         = 0x0004000
    SF_HasAgg                             = 0x0000010
    SF_HasTypeInfo                        = 0x0000080
    SF_IncludeHidden                      = 0x0020000
    SF_MaybeConvert                       = 0x0008000
    SF_MinMaxAgg                          = 0x0001000
    SF_MultiValue                         = 0x0000400
    SF_NestedFrom                         = 0x0000800
    SF_NoopOrderBy                        = 0x0400000
    SF_Recursive                          = 0x0002000
    SF_Resolved                           = 0x0000004
    SF_UpdateFrom                         = 0x0800000
    SF_UsesEphemeral                      = 0x0000020
    SF_Values                             = 0x0000200
    SF_View                               = 0x0200000
    SF_WhereBegin                         = 0x0080000
    SF_WinRewrite                         = 0x0100000
    SHARED_LOCK                           = 1
    SHARED_SIZE                           = 510
    SIOCADDDLCI                           = 0x8980
    SIOCADDMULTI                          = 0x8931
    SIOCADDRT                             = 0x890B
    SIOCDARP                              = 0x8953
    SIOCDELDLCI                           = 0x8981
    SIOCDELMULTI                          = 0x8932
    SIOCDELRT                             = 0x890C
    SIOCDEVPRIVATE                        = 0x89F0
    SIOCDIFADDR                           = 0x8936
    SIOCDRARP                             = 0x8960
    SIOCGARP                              = 0x8954
    SIOCGIFADDR                           = 0x8915
    SIOCGIFBR                             = 0x8940
    SIOCGIFBRDADDR                        = 0x8919
    SIOCGIFCONF                           = 0x8912
    SIOCGIFCOUNT                          = 0x8938
    SIOCGIFDSTADDR                        = 0x8917
    SIOCGIFENCAP                          = 0x8925
    SIOCGIFFLAGS                          = 0x8913
    SIOCGIFHWADDR                         = 0x8927
    SIOCGIFINDEX                          = 0x8933
    SIOCGIFMAP                            = 0x8970
    SIOCGIFMEM                            = 0x891f
    SIOCGIFMETRIC                         = 0x891d
    SIOCGIFMTU                            = 0x8921
    SIOCGIFNAME                           = 0x8910
    SIOCGIFNETMASK                        = 0x891b
    SIOCGIFPFLAGS                         = 0x8935
    SIOCGIFSLAVE                          = 0x8929
    SIOCGIFTXQLEN                         = 0x8942
    SIOCGRARP                             = 0x8961
    SIOCPROTOPRIVATE                      = 0x89E0
    SIOCRTMSG                             = 0x890D
    SIOCSARP                              = 0x8955
    SIOCSIFADDR                           = 0x8916
    SIOCSIFBR                             = 0x8941
    SIOCSIFBRDADDR                        = 0x891a
    SIOCSIFDSTADDR                        = 0x8918
    SIOCSIFENCAP                          = 0x8926
    SIOCSIFFLAGS                          = 0x8914
    SIOCSIFHWADDR                         = 0x8924
    SIOCSIFHWBROADCAST                    = 0x8937
    SIOCSIFLINK                           = 0x8911
    SIOCSIFMAP                            = 0x8971
    SIOCSIFMEM                            = 0x8920
    SIOCSIFMETRIC                         = 0x891e
    SIOCSIFMTU                            = 0x8922
    SIOCSIFNAME                           = 0x8923
    SIOCSIFNETMASK                        = 0x891c
    SIOCSIFPFLAGS                         = 0x8934
    SIOCSIFSLAVE                          = 0x8930
    SIOCSIFTXQLEN                         = 0x8943
    SIOCSRARP                             = 0x8962
    SIOGIFINDEX                           = 35123
    SLOT_2_0                              = 0x001fc07f
    SLOT_4_2_0                            = 0xf01fc07f
    SORTER_MAX_MERGE_COUNT                = 16
    SORTER_TYPE_INTEGER                   = 0x01
    SORTER_TYPE_TEXT                      = 0x02
    SORTFLAG_UseSorter                    = 0x01
    SPILLFLAG_NOSYNC                      = 0x04
    SPILLFLAG_OFF                         = 0x01
    SPILLFLAG_ROLLBACK                    = 0x02
    SQLITE3EXT_H                          = 0
    SQLITE3_H                             = 0
    SQLITE3_TEXT                          = 3
    SQLITEINT_H                           = 0
    SQLITE_ABORT                          = 4
    SQLITE_ABORT_ROLLBACK                 = 516
    SQLITE_ACCESS_EXISTS                  = 0
    SQLITE_ACCESS_READ                    = 2
    SQLITE_ACCESS_READWRITE               = 1
    SQLITE_AFF_BLOB                       = 0x41
    SQLITE_AFF_INTEGER                    = 0x44
    SQLITE_AFF_MASK                       = 0x47
    SQLITE_AFF_NONE                       = 0x40
    SQLITE_AFF_NUMERIC                    = 0x43
    SQLITE_AFF_REAL                       = 0x45
    SQLITE_AFF_TEXT                       = 0x42
    SQLITE_ALLOW_COVERING_INDEX_SCAN      = 1
    SQLITE_ALTER_TABLE                    = 26
    SQLITE_AMALGAMATION                   = 1
    SQLITE_ANALYZE                        = 28
    SQLITE_ANY                            = 5
    SQLITE_API                            = 0
    SQLITE_APICALL                        = 0
    SQLITE_ASCII                          = 1
    SQLITE_ATTACH                         = 24
    SQLITE_AUTH                           = 23
    SQLITE_AUTH_USER                      = 279
    SQLITE_AllOpts                        = 0xffff
    SQLITE_AutoIndex                      = 0x00008000
    SQLITE_BIGENDIAN                      = 0
    SQLITE_BIG_DBL                        = 0
    SQLITE_BLDF1_INDEXED                  = 0x0001
    SQLITE_BLDF1_UNIQUE                   = 0x0002
    SQLITE_BLDF2_2NDPASS                  = 0x0004
    SQLITE_BLOB                           = 4
    SQLITE_BTREE_H                        = 0
    SQLITE_BUSY                           = 5
    SQLITE_BUSY_RECOVERY                  = 261
    SQLITE_BUSY_SNAPSHOT                  = 517
    SQLITE_BUSY_TIMEOUT                   = 773
    SQLITE_BYTEORDER                      = 1234
    SQLITE_CALLBACK                       = 0
    SQLITE_CANTOPEN                       = 14
    SQLITE_CANTOPEN_CONVPATH              = 1038
    SQLITE_CANTOPEN_DIRTYWAL              = 1294
    SQLITE_CANTOPEN_FULLPATH              = 782
    SQLITE_CANTOPEN_ISDIR                 = 526
    SQLITE_CANTOPEN_NOTEMPDIR             = 270
    SQLITE_CANTOPEN_SYMLINK               = 1550
    SQLITE_CDECL                          = 0
    SQLITE_CHECKPOINT_FULL                = 1
    SQLITE_CHECKPOINT_PASSIVE             = 0
    SQLITE_CHECKPOINT_RESTART             = 2
    SQLITE_CHECKPOINT_TRUNCATE            = 3
    SQLITE_CONFIG_COVERING_INDEX_SCAN     = 20
    SQLITE_CONFIG_GETMALLOC               = 5
    SQLITE_CONFIG_GETMUTEX                = 11
    SQLITE_CONFIG_GETPCACHE               = 15
    SQLITE_CONFIG_GETPCACHE2              = 19
    SQLITE_CONFIG_HEAP                    = 8
    SQLITE_CONFIG_LOG                     = 16
    SQLITE_CONFIG_LOOKASIDE               = 13
    SQLITE_CONFIG_MALLOC                  = 4
    SQLITE_CONFIG_MEMDB_MAXSIZE           = 29
    SQLITE_CONFIG_MEMSTATUS               = 9
    SQLITE_CONFIG_MMAP_SIZE               = 22
    SQLITE_CONFIG_MULTITHREAD             = 2
    SQLITE_CONFIG_MUTEX                   = 10
    SQLITE_CONFIG_PAGECACHE               = 7
    SQLITE_CONFIG_PCACHE                  = 14
    SQLITE_CONFIG_PCACHE2                 = 18
    SQLITE_CONFIG_PCACHE_HDRSZ            = 24
    SQLITE_CONFIG_PMASZ                   = 25
    SQLITE_CONFIG_SCRATCH                 = 6
    SQLITE_CONFIG_SERIALIZED              = 3
    SQLITE_CONFIG_SINGLETHREAD            = 1
    SQLITE_CONFIG_SMALL_MALLOC            = 27
    SQLITE_CONFIG_SORTERREF_SIZE          = 28
    SQLITE_CONFIG_SQLLOG                  = 21
    SQLITE_CONFIG_STMTJRNL_SPILL          = 26
    SQLITE_CONFIG_URI                     = 17
    SQLITE_CONFIG_WIN32_HEAPSIZE          = 23
    SQLITE_CONSTRAINT                     = 19
    SQLITE_CONSTRAINT_CHECK               = 275
    SQLITE_CONSTRAINT_COMMITHOOK          = 531
    SQLITE_CONSTRAINT_FOREIGNKEY          = 787
    SQLITE_CONSTRAINT_FUNCTION            = 1043
    SQLITE_CONSTRAINT_NOTNULL             = 1299
    SQLITE_CONSTRAINT_PINNED              = 2835
    SQLITE_CONSTRAINT_PRIMARYKEY          = 1555
    SQLITE_CONSTRAINT_ROWID               = 2579
    SQLITE_CONSTRAINT_TRIGGER             = 1811
    SQLITE_CONSTRAINT_UNIQUE              = 2067
    SQLITE_CONSTRAINT_VTAB                = 2323
    SQLITE_COPY                           = 0
    SQLITE_CORE                           = 1
    SQLITE_CORRUPT                        = 11
    SQLITE_CORRUPT_INDEX                  = 779
    SQLITE_CORRUPT_SEQUENCE               = 523
    SQLITE_CORRUPT_VTAB                   = 267
    SQLITE_CREATE_INDEX                   = 1
    SQLITE_CREATE_TABLE                   = 2
    SQLITE_CREATE_TEMP_INDEX              = 3
    SQLITE_CREATE_TEMP_TABLE              = 4
    SQLITE_CREATE_TEMP_TRIGGER            = 5
    SQLITE_CREATE_TEMP_VIEW               = 6
    SQLITE_CREATE_TRIGGER                 = 7
    SQLITE_CREATE_VIEW                    = 8
    SQLITE_CREATE_VTABLE                  = 29
    SQLITE_CacheSpill                     = 0x00000020
    SQLITE_CellSizeCk                     = 0x00200000
    SQLITE_CkptFullFSync                  = 0x00000010
    SQLITE_CountOfView                    = 0x0200
    SQLITE_CoverIdxScan                   = 0x0020
    SQLITE_CursorHints                    = 0x0400
    SQLITE_DBCONFIG_DEFENSIVE             = 1010
    SQLITE_DBCONFIG_DQS_DDL               = 1014
    SQLITE_DBCONFIG_DQS_DML               = 1013
    SQLITE_DBCONFIG_ENABLE_FKEY           = 1002
    SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004
    SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005
    SQLITE_DBCONFIG_ENABLE_QPSG           = 1007
    SQLITE_DBCONFIG_ENABLE_TRIGGER        = 1003
    SQLITE_DBCONFIG_ENABLE_VIEW           = 1015
    SQLITE_DBCONFIG_LEGACY_ALTER_TABLE    = 1012
    SQLITE_DBCONFIG_LEGACY_FILE_FORMAT    = 1016
    SQLITE_DBCONFIG_LOOKASIDE             = 1001
    SQLITE_DBCONFIG_MAINDBNAME            = 1000
    SQLITE_DBCONFIG_MAX                   = 1017
    SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE      = 1006
    SQLITE_DBCONFIG_RESET_DATABASE        = 1009
    SQLITE_DBCONFIG_TRIGGER_EQP           = 1008
    SQLITE_DBCONFIG_TRUSTED_SCHEMA        = 1017
    SQLITE_DBCONFIG_WRITABLE_SCHEMA       = 1011
    SQLITE_DBSTATUS_CACHE_HIT             = 7
    SQLITE_DBSTATUS_CACHE_MISS            = 8
    SQLITE_DBSTATUS_CACHE_SPILL           = 12
    SQLITE_DBSTATUS_CACHE_USED            = 1
    SQLITE_DBSTATUS_CACHE_USED_SHARED     = 11
    SQLITE_DBSTATUS_CACHE_WRITE           = 9
    SQLITE_DBSTATUS_DEFERRED_FKS          = 10
    SQLITE_DBSTATUS_LOOKASIDE_HIT         = 4
    SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL   = 6
    SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE   = 5
    SQLITE_DBSTATUS_LOOKASIDE_USED        = 0
    SQLITE_DBSTATUS_MAX                   = 12
    SQLITE_DBSTATUS_SCHEMA_USED           = 2
    SQLITE_DBSTATUS_STMT_USED             = 3
    SQLITE_DEBUG_OS_TRACE                 = 0
    SQLITE_DEFAULT_AUTOVACUUM             = 0
    SQLITE_DEFAULT_CACHE_SIZE             = -2000
    SQLITE_DEFAULT_FILE_FORMAT            = 4
    SQLITE_DEFAULT_FILE_PERMISSIONS       = 0644
    SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT     = -1
    SQLITE_DEFAULT_MEMSTATUS              = 0
    SQLITE_DEFAULT_MMAP_SIZE              = 0
    SQLITE_DEFAULT_PAGE_SIZE              = 1024
    SQLITE_DEFAULT_PCACHE_INITSZ          = 20
    SQLITE_DEFAULT_PROXYDIR_PERMISSIONS   = 0755
    SQLITE_DEFAULT_RECURSIVE_TRIGGERS     = 0
    SQLITE_DEFAULT_SECTOR_SIZE            = 4096
    SQLITE_DEFAULT_SORTERREF_SIZE         = 0x7fffffff
    SQLITE_DEFAULT_SYNCHRONOUS            = 2
    SQLITE_DEFAULT_WAL_AUTOCHECKPOINT     = 1000
    SQLITE_DEFAULT_WAL_SYNCHRONOUS        = 2
    SQLITE_DEFAULT_WORKER_THREADS         = 0
    SQLITE_DELETE                         = 9
    SQLITE_DENY                           = 1
    SQLITE_DEPRECATED                     = 0
    SQLITE_DESERIALIZE_FREEONCLOSE        = 1
    SQLITE_DESERIALIZE_READONLY           = 4
    SQLITE_DESERIALIZE_RESIZEABLE         = 2
    SQLITE_DETACH                         = 25
    SQLITE_DETERMINISTIC                  = 0x000000800
    SQLITE_DIRECTONLY                     = 0x000080000
    SQLITE_DONE                           = 101
    SQLITE_DQS                            = 3
    SQLITE_DROP_INDEX                     = 10
    SQLITE_DROP_TABLE                     = 11
    SQLITE_DROP_TEMP_INDEX                = 12
    SQLITE_DROP_TEMP_TABLE                = 13
    SQLITE_DROP_TEMP_TRIGGER              = 14
    SQLITE_DROP_TEMP_VIEW                 = 15
    SQLITE_DROP_TRIGGER                   = 16
    SQLITE_DROP_VIEW                      = 17
    SQLITE_DROP_VTABLE                    = 30
    SQLITE_Defensive                      = 0x10000000
    SQLITE_DeferFKs                       = 0x00080000
    SQLITE_DistinctOpt                    = 0x0010
    SQLITE_DqsDDL                         = 0x20000000
    SQLITE_DqsDML                         = 0x40000000
    SQLITE_ECEL_DUP                       = 0x01
    SQLITE_ECEL_FACTOR                    = 0x02
    SQLITE_ECEL_OMITREF                   = 0x08
    SQLITE_ECEL_REF                       = 0x04
    SQLITE_EMPTY                          = 16
    SQLITE_ENABLE_BYTECODE_VTAB           = 1
    SQLITE_ENABLE_COLUMN_METADATA         = 1
    SQLITE_ENABLE_DBPAGE_VTAB             = 1
    SQLITE_ENABLE_DBSTAT_VTAB             = 1
    SQLITE_ENABLE_DESERIALIZE             = 1
    SQLITE_ENABLE_EXPLAIN_COMMENTS        = 1
    SQLITE_ENABLE_FTS5                    = 1
    SQLITE_ENABLE_GEOPOLY                 = 1
    SQLITE_ENABLE_JSON1                   = 1
    SQLITE_ENABLE_LOCKING_STYLE           = 0
    SQLITE_ENABLE_MEMORY_MANAGEMENT       = 1
    SQLITE_ENABLE_OFFSET_SQL_FUNC         = 1
    SQLITE_ENABLE_PREUPDATE_HOOK          = 1
    SQLITE_ENABLE_RBU                     = 1
    SQLITE_ENABLE_RTREE                   = 1
    SQLITE_ENABLE_SNAPSHOT                = 1
    SQLITE_ENABLE_STAT4                   = 1
    SQLITE_ENABLE_STMTVTAB                = 1
    SQLITE_ENABLE_UNLOCK_NOTIFY           = 1
    SQLITE_ERROR                          = 1
    SQLITE_ERROR_MISSING_COLLSEQ          = 257
    SQLITE_ERROR_RETRY                    = 513
    SQLITE_ERROR_SNAPSHOT                 = 769
    SQLITE_EXPERIMENTAL                   = 0
    SQLITE_EXTENSION_INIT1                = 0
    SQLITE_EXTENSION_INIT3                = 0
    SQLITE_EnableQPSG                     = 0x00800000
    SQLITE_EnableTrigger                  = 0x00040000
    SQLITE_EnableView                     = 0x80000000
    SQLITE_FAIL                           = 3
    SQLITE_FAULTINJECTOR_COUNT            = 1
    SQLITE_FAULTINJECTOR_MALLOC           = 0
    SQLITE_FCNTL_BEGIN_ATOMIC_WRITE       = 31
    SQLITE_FCNTL_BUSYHANDLER              = 15
    SQLITE_FCNTL_CHUNK_SIZE               = 6
    SQLITE_FCNTL_CKPT_DONE                = 37
    SQLITE_FCNTL_CKPT_START               = 39
    SQLITE_FCNTL_COMMIT_ATOMIC_WRITE      = 32
    SQLITE_FCNTL_COMMIT_PHASETWO          = 22
    SQLITE_FCNTL_DATA_VERSION             = 35
    SQLITE_FCNTL_DB_UNCHANGED             = 0xca093fa0
    SQLITE_FCNTL_FILE_POINTER             = 7
    SQLITE_FCNTL_GET_LOCKPROXYFILE        = 2
    SQLITE_FCNTL_HAS_MOVED                = 20
    SQLITE_FCNTL_JOURNAL_POINTER          = 28
    SQLITE_FCNTL_LAST_ERRNO               = 4
    SQLITE_FCNTL_LOCKSTATE                = 1
    SQLITE_FCNTL_LOCK_TIMEOUT             = 34
    SQLITE_FCNTL_MMAP_SIZE                = 18
    SQLITE_FCNTL_OVERWRITE                = 11
    SQLITE_FCNTL_PDB                      = 30
    SQLITE_FCNTL_PERSIST_WAL              = 10
    SQLITE_FCNTL_POWERSAFE_OVERWRITE      = 13
    SQLITE_FCNTL_PRAGMA                   = 14
    SQLITE_FCNTL_RBU                      = 26
    SQLITE_FCNTL_RBUCNT                   = 5149216
    SQLITE_FCNTL_RESERVE_BYTES            = 38
    SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE    = 33
    SQLITE_FCNTL_SET_LOCKPROXYFILE        = 3
    SQLITE_FCNTL_SIZE_HINT                = 5
    SQLITE_FCNTL_SIZE_LIMIT               = 36
    SQLITE_FCNTL_SYNC                     = 21
    SQLITE_FCNTL_SYNC_OMITTED             = 8
    SQLITE_FCNTL_TEMPFILENAME             = 16
    SQLITE_FCNTL_TRACE                    = 19
    SQLITE_FCNTL_VFSNAME                  = 12
    SQLITE_FCNTL_VFS_POINTER              = 27
    SQLITE_FCNTL_WAL_BLOCK                = 24
    SQLITE_FCNTL_WIN32_AV_RETRY           = 9
    SQLITE_FCNTL_WIN32_GET_HANDLE         = 29
    SQLITE_FCNTL_WIN32_SET_HANDLE         = 23
    SQLITE_FCNTL_ZIPVFS                   = 25
    SQLITE_FILE_HEADER                    = "SQLite format 3"
    SQLITE_FLOAT                          = 2
    SQLITE_FORMAT                         = 24
    SQLITE_FP_PRECISION_LIMIT             = 100000000
    SQLITE_FRAME_MAGIC                    = 0x879fb71e
    SQLITE_FSFLAGS_IS_MSDOS               = 0x1
    SQLITE_FULL                           = 13
    SQLITE_FUNCTION                       = 31
    SQLITE_FUNC_CASE                      = 0x0008
    SQLITE_FUNC_CONSTANT                  = 0x0800
    SQLITE_FUNC_COUNT                     = 0x0100
    SQLITE_FUNC_DIRECT                    = 0x00080000
    SQLITE_FUNC_ENCMASK                   = 0x0003
    SQLITE_FUNC_EPHEM                     = 0x0010
    SQLITE_FUNC_HASH_SZ                   = 23
    SQLITE_FUNC_INLINE                    = 0x00400000
    SQLITE_FUNC_INTERNAL                  = 0x00040000
    SQLITE_FUNC_LENGTH                    = 0x0040
    SQLITE_FUNC_LIKE                      = 0x0004
    SQLITE_FUNC_MINMAX                    = 0x1000
    SQLITE_FUNC_NEEDCOLL                  = 0x0020
    SQLITE_FUNC_OFFSET                    = 0x8000
    SQLITE_FUNC_SLOCHNG                   = 0x2000
    SQLITE_FUNC_SUBTYPE                   = 0x00100000
    SQLITE_FUNC_TEST                      = 0x4000
    SQLITE_FUNC_TYPEOF                    = 0x0080
    SQLITE_FUNC_UNLIKELY                  = 0x0400
    SQLITE_FUNC_UNSAFE                    = 0x00200000
    SQLITE_FUNC_WINDOW                    = 0x00010000
    SQLITE_FactorOutConst                 = 0x0008
    SQLITE_ForeignKeys                    = 0x00004000
    SQLITE_Fts3Tokenizer                  = 0x00400000
    SQLITE_FullColNames                   = 0x00000004
    SQLITE_FullFSync                      = 0x00000008
    SQLITE_GET_LOCKPROXYFILE              = 2
    SQLITE_GroupByOrder                   = 0x0004
    SQLITE_HASH_H                         = 0
    SQLITE_HAVE_OS_TRACE                  = 0
    SQLITE_HAVE_ZLIB                      = 1
    SQLITE_IDXTYPE_APPDEF                 = 0
    SQLITE_IDXTYPE_IPK                    = 3
    SQLITE_IDXTYPE_PRIMARYKEY             = 2
    SQLITE_IDXTYPE_UNIQUE                 = 1
    SQLITE_IGNORE                         = 2
    SQLITE_INDEX_CONSTRAINT_EQ            = 2
    SQLITE_INDEX_CONSTRAINT_FUNCTION      = 150
    SQLITE_INDEX_CONSTRAINT_GE            = 32
    SQLITE_INDEX_CONSTRAINT_GLOB          = 66
    SQLITE_INDEX_CONSTRAINT_GT            = 4
    SQLITE_INDEX_CONSTRAINT_IS            = 72
    SQLITE_INDEX_CONSTRAINT_ISNOT         = 69
    SQLITE_INDEX_CONSTRAINT_ISNOTNULL     = 70
    SQLITE_INDEX_CONSTRAINT_ISNULL        = 71
    SQLITE_INDEX_CONSTRAINT_LE            = 8
    SQLITE_INDEX_CONSTRAINT_LIKE          = 65
    SQLITE_INDEX_CONSTRAINT_LT            = 16
    SQLITE_INDEX_CONSTRAINT_MATCH         = 64
    SQLITE_INDEX_CONSTRAINT_NE            = 68
    SQLITE_INDEX_CONSTRAINT_REGEXP        = 67
    SQLITE_INDEX_SCAN_UNIQUE              = 1
    SQLITE_INNOCUOUS                      = 0x000200000
    SQLITE_INSERT                         = 18
    SQLITE_INTEGER                        = 1
    SQLITE_INTEGRITY_CHECK_ERROR_MAX      = 100
    SQLITE_INTERNAL                       = 2
    SQLITE_INTERRUPT                      = 9
    SQLITE_IOCAP_ATOMIC                   = 0x00000001
    SQLITE_IOCAP_ATOMIC16K                = 0x00000040
    SQLITE_IOCAP_ATOMIC1K                 = 0x00000004
    SQLITE_IOCAP_ATOMIC2K                 = 0x00000008
    SQLITE_IOCAP_ATOMIC32K                = 0x00000080
    SQLITE_IOCAP_ATOMIC4K                 = 0x00000010
    SQLITE_IOCAP_ATOMIC512                = 0x00000002
    SQLITE_IOCAP_ATOMIC64K                = 0x00000100
    SQLITE_IOCAP_ATOMIC8K                 = 0x00000020
    SQLITE_IOCAP_BATCH_ATOMIC             = 0x00004000
    SQLITE_IOCAP_IMMUTABLE                = 0x00002000
    SQLITE_IOCAP_POWERSAFE_OVERWRITE      = 0x00001000
    SQLITE_IOCAP_SAFE_APPEND              = 0x00000200
    SQLITE_IOCAP_SEQUENTIAL               = 0x00000400
    SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN    = 0x00000800
    SQLITE_IOERR                          = 10
    SQLITE_IOERR_ACCESS                   = 3338
    SQLITE_IOERR_AUTH                     = 7178
    SQLITE_IOERR_BEGIN_ATOMIC             = 7434
    SQLITE_IOERR_BLOCKED                  = 2826
    SQLITE_IOERR_CHECKRESERVEDLOCK        = 3594
    SQLITE_IOERR_CLOSE                    = 4106
    SQLITE_IOERR_COMMIT_ATOMIC            = 7690
    SQLITE_IOERR_CONVPATH                 = 6666
    SQLITE_IOERR_DATA                     = 8202
    SQLITE_IOERR_DELETE                   = 2570
    SQLITE_IOERR_DELETE_NOENT             = 5898
    SQLITE_IOERR_DIR_CLOSE                = 4362
    SQLITE_IOERR_DIR_FSYNC                = 1290
    SQLITE_IOERR_FSTAT                    = 1802
    SQLITE_IOERR_FSYNC                    = 1034
    SQLITE_IOERR_GETTEMPPATH              = 6410
    SQLITE_IOERR_LOCK                     = 3850
    SQLITE_IOERR_MMAP                     = 6154
    SQLITE_IOERR_NOMEM                    = 3082
    SQLITE_IOERR_NOMEM_BKPT               = 3082
    SQLITE_IOERR_RDLOCK                   = 2314
    SQLITE_IOERR_READ                     = 266
    SQLITE_IOERR_ROLLBACK_ATOMIC          = 7946
    SQLITE_IOERR_SEEK                     = 5642
    SQLITE_IOERR_SHMLOCK                  = 5130
    SQLITE_IOERR_SHMMAP                   = 5386
    SQLITE_IOERR_SHMOPEN                  = 4618
    SQLITE_IOERR_SHMSIZE                  = 4874
    SQLITE_IOERR_SHORT_READ               = 522
    SQLITE_IOERR_TRUNCATE                 = 1546
    SQLITE_IOERR_UNLOCK                   = 2058
    SQLITE_IOERR_VNODE                    = 6922
    SQLITE_IOERR_WRITE                    = 778
    SQLITE_IgnoreChecks                   = 0x00000200
    SQLITE_JUMPIFNULL                     = 0x10
    SQLITE_KEEPNULL                       = 0x08
    SQLITE_LAST_ERRNO                     = 4
    SQLITE_LIKE_DOESNT_MATCH_BLOBS        = 1
    SQLITE_LIMIT_ATTACHED                 = 7
    SQLITE_LIMIT_COLUMN                   = 2
    SQLITE_LIMIT_COMPOUND_SELECT          = 4
    SQLITE_LIMIT_EXPR_DEPTH               = 3
    SQLITE_LIMIT_FUNCTION_ARG             = 6
    SQLITE_LIMIT_LENGTH                   = 0
    SQLITE_LIMIT_LIKE_PATTERN_LENGTH      = 8
    SQLITE_LIMIT_SQL_LENGTH               = 1
    SQLITE_LIMIT_TRIGGER_DEPTH            = 10
    SQLITE_LIMIT_VARIABLE_NUMBER          = 9
    SQLITE_LIMIT_VDBE_OP                  = 5
    SQLITE_LIMIT_WORKER_THREADS           = 11
    SQLITE_LITTLEENDIAN                   = 1
    SQLITE_LOCKED                         = 6
    SQLITE_LOCKED_SHAREDCACHE             = 262
    SQLITE_LOCKED_VTAB                    = 518
    SQLITE_LOCK_EXCLUSIVE                 = 4
    SQLITE_LOCK_NONE                      = 0
    SQLITE_LOCK_PENDING                   = 3
    SQLITE_LOCK_RESERVED                  = 2
    SQLITE_LOCK_SHARED                    = 1
    SQLITE_LegacyAlter                    = 0x04000000
    SQLITE_LegacyFileFmt                  = 0x00000002
    SQLITE_LoadExtFunc                    = 0x00020000
    SQLITE_LoadExtension                  = 0x00010000
    SQLITE_MAGIC_BUSY                     = 0xf03b7906
    SQLITE_MAGIC_CLOSED                   = 0x9f3c2d33
    SQLITE_MAGIC_ERROR                    = 0xb5357930
    SQLITE_MAGIC_OPEN                     = 0xa029a697
    SQLITE_MAGIC_SICK                     = 0x4b771290
    SQLITE_MAGIC_ZOMBIE                   = 0x64cffc7f
    SQLITE_MALLOC_SOFT_LIMIT              = 1024
    SQLITE_MATCH                          = 0
    SQLITE_MAX_ATTACHED                   = 10
    SQLITE_MAX_COLUMN                     = 2000
    SQLITE_MAX_COMPOUND_SELECT            = 500
    SQLITE_MAX_DEFAULT_PAGE_SIZE          = 8192
    SQLITE_MAX_EXPR_DEPTH                 = 1000
    SQLITE_MAX_FILE_FORMAT                = 4
    SQLITE_MAX_FUNCTION_ARG               = 127
    SQLITE_MAX_LENGTH                     = 1000000000
    SQLITE_MAX_LIKE_PATTERN_LENGTH        = 50000
    SQLITE_MAX_MEMORY                     = 0
    SQLITE_MAX_MMAP_SIZE                  = 0x7fff0000
    SQLITE_MAX_PAGE_COUNT                 = 1073741823
    SQLITE_MAX_PAGE_SIZE                  = 65536
    SQLITE_MAX_PMASZ                      = 536870912
    SQLITE_MAX_SCHEMA_RETRY               = 50
    SQLITE_MAX_SQL_LENGTH                 = 1000000000
    SQLITE_MAX_SRCLIST                    = 200
    SQLITE_MAX_SYMLINKS                   = 100
    SQLITE_MAX_TRIGGER_DEPTH              = 1000
    SQLITE_MAX_VARIABLE_NUMBER            = 32766
    SQLITE_MAX_VDBE_OP                    = 250000000
    SQLITE_MAX_WORKER_THREADS             = 8
    SQLITE_MEMDB_DEFAULT_MAXSIZE          = 1073741824
    SQLITE_MINIMUM_FILE_DESCRIPTOR        = 3
    SQLITE_MISMATCH                       = 20
    SQLITE_MISUSE                         = 21
    SQLITE_MSVC_H                         = 0
    SQLITE_MUTEX_APPDEF                   = 1
    SQLITE_MUTEX_FAST                     = 0
    SQLITE_MUTEX_NOOP                     = 1
    SQLITE_MUTEX_RECURSIVE                = 1
    SQLITE_MUTEX_STATIC_APP1              = 8
    SQLITE_MUTEX_STATIC_APP2              = 9
    SQLITE_MUTEX_STATIC_APP3              = 10
    SQLITE_MUTEX_STATIC_LRU               = 6
    SQLITE_MUTEX_STATIC_LRU2              = 7
    SQLITE_MUTEX_STATIC_MAIN              = 2
    SQLITE_MUTEX_STATIC_MASTER            = 2
    SQLITE_MUTEX_STATIC_MEM               = 3
    SQLITE_MUTEX_STATIC_MEM2              = 4
    SQLITE_MUTEX_STATIC_OPEN              = 4
    SQLITE_MUTEX_STATIC_PMEM              = 7
    SQLITE_MUTEX_STATIC_PRNG              = 5
    SQLITE_MUTEX_STATIC_VFS1              = 11
    SQLITE_MUTEX_STATIC_VFS2              = 12
    SQLITE_MUTEX_STATIC_VFS3              = 13
    SQLITE_MX_JUMP_OPCODE                 = 62
    SQLITE_NEED_ERR_NAME                  = 0
    SQLITE_NOINLINE                       = 0
    SQLITE_NOLFS                          = 22
    SQLITE_NOMATCH                        = 1
    SQLITE_NOMEM                          = 7
    SQLITE_NOMEM_BKPT                     = 7
    SQLITE_NOTADB                         = 26
    SQLITE_NOTFOUND                       = 12
    SQLITE_NOTICE                         = 27
    SQLITE_NOTICE_RECOVER_ROLLBACK        = 539
    SQLITE_NOTICE_RECOVER_WAL             = 283
    SQLITE_NOTNULL                        = 0x90
    SQLITE_NOWILDCARDMATCH                = 2
    SQLITE_NO_TSAN                        = 0
    SQLITE_NULL                           = 5
    SQLITE_NULLEQ                         = 0x80
    SQLITE_N_BTREE_META                   = 16
    SQLITE_N_KEYWORD                      = 145
    SQLITE_N_LIMIT                        = 12
    SQLITE_NoCkptOnClose                  = 0x00000800
    SQLITE_NoSchemaError                  = 0x08000000
    SQLITE_NullCallback                   = 0x00000100
    SQLITE_OK                             = 0
    SQLITE_OK_LOAD_PERMANENTLY            = 256
    SQLITE_OK_SYMLINK                     = 512
    SQLITE_OPEN_AUTOPROXY                 = 0x00000020
    SQLITE_OPEN_CREATE                    = 0x00000004
    SQLITE_OPEN_DELETEONCLOSE             = 0x00000008
    SQLITE_OPEN_EXCLUSIVE                 = 0x00000010
    SQLITE_OPEN_FULLMUTEX                 = 0x00010000
    SQLITE_OPEN_MAIN_DB                   = 0x00000100
    SQLITE_OPEN_MAIN_JOURNAL              = 0x00000800
    SQLITE_OPEN_MASTER_JOURNAL            = 0x00004000
    SQLITE_OPEN_MEMORY                    = 0x00000080
    SQLITE_OPEN_NOFOLLOW                  = 0x01000000
    SQLITE_OPEN_NOMUTEX                   = 0x00008000
    SQLITE_OPEN_PRIVATECACHE              = 0x00040000
    SQLITE_OPEN_READONLY                  = 0x00000001
    SQLITE_OPEN_READWRITE                 = 0x00000002
    SQLITE_OPEN_SHAREDCACHE               = 0x00020000
    SQLITE_OPEN_SUBJOURNAL                = 0x00002000
    SQLITE_OPEN_SUPER_JOURNAL             = 0x00004000
    SQLITE_OPEN_TEMP_DB                   = 0x00000200
    SQLITE_OPEN_TEMP_JOURNAL              = 0x00001000
    SQLITE_OPEN_TRANSIENT_DB              = 0x00000400
    SQLITE_OPEN_URI                       = 0x00000040
    SQLITE_OPEN_WAL                       = 0x00080000
    SQLITE_OS_SETUP_H                     = 0
    SQLITE_OS_UNIX                        = 1
    SQLITE_OS_WIN                         = 0
    SQLITE_OmitNoopJoin                   = 0x0100
    SQLITE_OrderByIdxJoin                 = 0x0040
    SQLITE_PAGER_H                        = 0
    SQLITE_PERM                           = 3
    SQLITE_POWERSAFE_OVERWRITE            = 1
    SQLITE_PRAGMA                         = 19
    SQLITE_PREPARE_MASK                   = 0x0f
    SQLITE_PREPARE_NORMALIZE              = 0x02
    SQLITE_PREPARE_NO_VTAB                = 0x04
    SQLITE_PREPARE_PERSISTENT             = 0x01
    SQLITE_PREPARE_SAVESQL                = 0x80
    SQLITE_PRINTF_INTERNAL                = 0x01
    SQLITE_PRINTF_MALLOCED                = 0x04
    SQLITE_PRINTF_SQLFUNC                 = 0x02
    SQLITE_PRINT_BUF_SIZE                 = 70
    SQLITE_PRIVATE                        = 0
    SQLITE_PROTOCOL                       = 15
    SQLITE_PTRSIZE                        = 8
    SQLITE_PropagateConst                 = 0x8000
    SQLITE_PushDown                       = 0x1000
    SQLITE_QUERY_PLANNER_LIMIT            = 20000
    SQLITE_QUERY_PLANNER_LIMIT_INCR       = 1000
    SQLITE_QueryFlattener                 = 0x0001
    SQLITE_QueryOnly                      = 0x00100000
    SQLITE_RANGE                          = 25
    SQLITE_RBU_STATE_CHECKPOINT           = 3
    SQLITE_RBU_STATE_DONE                 = 4
    SQLITE_RBU_STATE_ERROR                = 5
    SQLITE_RBU_STATE_MOVE                 = 2
    SQLITE_RBU_STATE_OAL                  = 1
    SQLITE_RBU_UPDATE_CACHESIZE           = 16
    SQLITE_READ                           = 20
    SQLITE_READONLY                       = 8
    SQLITE_READONLY_CANTINIT              = 1288
    SQLITE_READONLY_CANTLOCK              = 520
    SQLITE_READONLY_DBMOVED               = 1032
    SQLITE_READONLY_DIRECTORY             = 1544
    SQLITE_READONLY_RECOVERY              = 264
    SQLITE_READONLY_ROLLBACK              = 776
    SQLITE_RECURSIVE                      = 33
    SQLITE_REINDEX                        = 27
    SQLITE_REPLACE                        = 5
    SQLITE_ROLLBACK                       = 1
    SQLITE_ROW                            = 100
    SQLITE_ReadUncommit                   = 0x00000400
    SQLITE_RecTriggers                    = 0x00002000
    SQLITE_ResetDatabase                  = 0x02000000
    SQLITE_ReverseOrder                   = 0x00001000
    SQLITE_SAVEPOINT                      = 32
    SQLITE_SCANSTAT_EST                   = 2
    SQLITE_SCANSTAT_EXPLAIN               = 4
    SQLITE_SCANSTAT_NAME                  = 3
    SQLITE_SCANSTAT_NLOOP                 = 0
    SQLITE_SCANSTAT_NVISIT                = 1
    SQLITE_SCANSTAT_SELECTID              = 5
    SQLITE_SCHEMA                         = 17
    SQLITE_SELECT                         = 21
    SQLITE_SERIALIZE_NOCOPY               = 0x001
    SQLITE_SET_LOCKPROXYFILE              = 3
    SQLITE_SHM_EXCLUSIVE                  = 8
    SQLITE_SHM_LOCK                       = 2
    SQLITE_SHM_NLOCK                      = 8
    SQLITE_SHM_SHARED                     = 4
    SQLITE_SHM_UNLOCK                     = 1
    SQLITE_SORTER_PMASZ                   = 250
    SQLITE_SOUNDEX                        = 1
    SQLITE_SOURCE_ID                      = "2020-08-14 13:23:32 fca8dc8b578f215a969cd899336378966156154710873e68b3d9ac5881b0ff3f"
    SQLITE_SO_ASC                         = 0
    SQLITE_SO_DESC                        = 1
    SQLITE_SO_UNDEFINED                   = -1
    SQLITE_STAT4_SAMPLES                  = 24
    SQLITE_STATUS_MALLOC_COUNT            = 9
    SQLITE_STATUS_MALLOC_SIZE             = 5
    SQLITE_STATUS_MEMORY_USED             = 0
    SQLITE_STATUS_PAGECACHE_OVERFLOW      = 2
    SQLITE_STATUS_PAGECACHE_SIZE          = 7
    SQLITE_STATUS_PAGECACHE_USED          = 1
    SQLITE_STATUS_PARSER_STACK            = 6
    SQLITE_STATUS_SCRATCH_OVERFLOW        = 4
    SQLITE_STATUS_SCRATCH_SIZE            = 8
    SQLITE_STATUS_SCRATCH_USED            = 3
    SQLITE_STDCALL                        = 0
    SQLITE_STMTJRNL_SPILL                 = 65536
    SQLITE_STMTSTATUS_AUTOINDEX           = 3
    SQLITE_STMTSTATUS_FULLSCAN_STEP       = 1
    SQLITE_STMTSTATUS_MEMUSED             = 99
    SQLITE_STMTSTATUS_REPREPARE           = 5
    SQLITE_STMTSTATUS_RUN                 = 6
    SQLITE_STMTSTATUS_SORT                = 2
    SQLITE_STMTSTATUS_VM_STEP             = 4
    SQLITE_STOREP2                        = 0x20
    SQLITE_SUBTYPE                        = 0x000100000
    SQLITE_SYNC_DATAONLY                  = 0x00010
    SQLITE_SYNC_FULL                      = 0x00003
    SQLITE_SYNC_NORMAL                    = 0x00002
    SQLITE_SYSAPI                         = 0
    SQLITE_SYSTEM_MALLOC                  = 1
    SQLITE_ShortColNames                  = 0x00000040
    SQLITE_SimplifyJoin                   = 0x2000
    SQLITE_SkipScan                       = 0x4000
    SQLITE_Stat4                          = 0x0800
    SQLITE_TCLAPI                         = 0
    SQLITE_TEMP_FILE_PREFIX               = "etilqs_"
    SQLITE_TEMP_STORE                     = 1
    SQLITE_TEST                           = 1
    SQLITE_TESTCTRL_ALWAYS                = 13
    SQLITE_TESTCTRL_ASSERT                = 12
    SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS   = 10
    SQLITE_TESTCTRL_BITVEC_TEST           = 8
    SQLITE_TESTCTRL_BYTEORDER             = 22
    SQLITE_TESTCTRL_EXPLAIN_STMT          = 19
    SQLITE_TESTCTRL_EXTRA_SCHEMA_CHECKS   = 29
    SQLITE_TESTCTRL_FAULT_INSTALL         = 9
    SQLITE_TESTCTRL_FIRST                 = 5
    SQLITE_TESTCTRL_IMPOSTER              = 25
    SQLITE_TESTCTRL_INTERNAL_FUNCTIONS    = 17
    SQLITE_TESTCTRL_ISINIT                = 23
    SQLITE_TESTCTRL_ISKEYWORD             = 16
    SQLITE_TESTCTRL_LAST                  = 29
    SQLITE_TESTCTRL_LOCALTIME_FAULT       = 18
    SQLITE_TESTCTRL_NEVER_CORRUPT         = 20
    SQLITE_TESTCTRL_ONCE_RESET_THRESHOLD  = 19
    SQLITE_TESTCTRL_OPTIMIZATIONS         = 15
    SQLITE_TESTCTRL_PARSER_COVERAGE       = 26
    SQLITE_TESTCTRL_PENDING_BYTE          = 11
    SQLITE_TESTCTRL_PRNG_RESET            = 7
    SQLITE_TESTCTRL_PRNG_RESTORE          = 6
    SQLITE_TESTCTRL_PRNG_SAVE             = 5
    SQLITE_TESTCTRL_PRNG_SEED             = 28
    SQLITE_TESTCTRL_RESERVE               = 14
    SQLITE_TESTCTRL_RESULT_INTREAL        = 27
    SQLITE_TESTCTRL_SCRATCHMALLOC         = 17
    SQLITE_TESTCTRL_SORTER_MMAP           = 24
    SQLITE_TESTCTRL_VDBE_COVERAGE         = 21
    SQLITE_TEXT                           = 3
    SQLITE_THREADSAFE                     = 1
    SQLITE_TOKEN_KEYWORD                  = 0x2
    SQLITE_TOKEN_QUOTED                   = 0x1
    SQLITE_TOOBIG                         = 18
    SQLITE_TRACE_CLOSE                    = 0x08
    SQLITE_TRACE_LEGACY                   = 0x40
    SQLITE_TRACE_NONLEGACY_MASK           = 0x0f
    SQLITE_TRACE_PROFILE                  = 0x02
    SQLITE_TRACE_ROW                      = 0x04
    SQLITE_TRACE_STMT                     = 0x01
    SQLITE_TRACE_XPROFILE                 = 0x80
    SQLITE_TRANSACTION                    = 22
    SQLITE_Transitive                     = 0x0080
    SQLITE_TriggerEQP                     = 0x01000000
    SQLITE_TrustedSchema                  = 0x00000080
    SQLITE_UPDATE                         = 23
    SQLITE_USE_URI                        = 0
    SQLITE_UTF16                          = 4
    SQLITE_UTF16BE                        = 3
    SQLITE_UTF16LE                        = 2
    SQLITE_UTF16NATIVE                    = 2
    SQLITE_UTF16_ALIGNED                  = 8
    SQLITE_UTF8                           = 1
    SQLITE_VDBEINT_H                      = 0
    SQLITE_VDBE_H                         = 0
    SQLITE_VERSION                        = "3.33.0"
    SQLITE_VERSION_NUMBER                 = 3033000
    SQLITE_VTABRISK_High                  = 2
    SQLITE_VTABRISK_Low                   = 0
    SQLITE_VTABRISK_Normal                = 1
    SQLITE_VTAB_CONSTRAINT_SUPPORT        = 1
    SQLITE_VTAB_DIRECTONLY                = 3
    SQLITE_VTAB_INNOCUOUS                 = 2
    SQLITE_WAL_H                          = 0
    SQLITE_WARNING                        = 28
    SQLITE_WARNING_AUTOINDEX              = 284
    SQLITE_WHEREINT_H                     = 0
    SQLITE_WIN32_DATA_DIRECTORY_TYPE      = 1
    SQLITE_WIN32_TEMP_DIRECTORY_TYPE      = 2
    SQLITE_WSD                            = 0
    SQLITE_WindowFunc                     = 0x0002
    SQLITE_WriteSchema                    = 0x00000001
    SRT_Coroutine                         = 13
    SRT_Discard                           = 4
    SRT_DistFifo                          = 6
    SRT_DistQueue                         = 8
    SRT_EphemTab                          = 12
    SRT_Except                            = 2
    SRT_Exists                            = 3
    SRT_Fifo                              = 5
    SRT_Mem                               = 10
    SRT_Output                            = 9
    SRT_Queue                             = 7
    SRT_Set                               = 11
    SRT_Table                             = 14
    SRT_Union                             = 1
    SRT_Upfrom                            = 15
    STAT_GET_NDLT                         = 4
    STAT_GET_NEQ                          = 2
    STAT_GET_NLT                          = 3
    STAT_GET_ROWID                        = 1
    STAT_GET_STAT1                        = 0
    STDERR_FILENO                         = 2
    STDIN_FILENO                          = 0
    STDOUT_FILENO                         = 1
    STMT_COLUMN_BUSY                      = 3
    STMT_COLUMN_MEM                       = 10
    STMT_COLUMN_NAIDX                     = 6
    STMT_COLUMN_NCOL                      = 1
    STMT_COLUMN_NSCAN                     = 4
    STMT_COLUMN_NSORT                     = 5
    STMT_COLUMN_NSTEP                     = 7
    STMT_COLUMN_REPREP                    = 8
    STMT_COLUMN_RO                        = 2
    STMT_COLUMN_RUN                       = 9
    STMT_COLUMN_SQL                       = 0
    S_IFBLK                               = 24576
    S_IFCHR                               = 8192
    S_IFDIR                               = 16384
    S_IFIFO                               = 4096
    S_IFLNK                               = 40960
    S_IFMT                                = 61440
    S_IFREG                               = 32768
    S_IFSOCK                              = 49152
    S_IRGRP                               = 32
    S_IROTH                               = 4
    S_IRUSR                               = 256
    S_IRWXG                               = 56
    S_IRWXO                               = 7
    S_IRWXU                               = 448
    S_ISGID                               = 1024
    S_ISUID                               = 2048
    S_ISVTX                               = 512
    S_IWGRP                               = 16
    S_IWOTH                               = 2
    S_IWUSR                               = 128
    S_IXGRP                               = 8
    S_IXOTH                               = 1
    S_IXUSR                               = 64
    TCFLSH                                = 0x540B
    TCGETA                                = 0x5405
    TCGETS                                = 0x5401
    TCGETX                                = 0x5432
    TCSBRK                                = 0x5409
    TCSBRKP                               = 0x5425
    TCSETA                                = 0x5406
    TCSETAF                               = 0x5408
    TCSETAW                               = 0x5407
    TCSETS                                = 0x5402
    TCSETSF                               = 0x5404
    TCSETSW                               = 0x5403
    TCSETX                                = 0x5433
    TCSETXF                               = 0x5434
    TCSETXW                               = 0x5435
    TCXONC                                = 0x540A
    TERM_ANDINFO                          = 0x0020
    TERM_CODED                            = 0x0004
    TERM_COPIED                           = 0x0008
    TERM_DYNAMIC                          = 0x0001
    TERM_HEURTRUTH                        = 0x2000
    TERM_HIGHTRUTH                        = 0x4000
    TERM_IS                               = 0x0800
    TERM_LIKE                             = 0x0400
    TERM_LIKECOND                         = 0x0200
    TERM_LIKEOPT                          = 0x0100
    TERM_ORINFO                           = 0x0010
    TERM_OR_OK                            = 0x0040
    TERM_VARSELECT                        = 0x1000
    TERM_VIRTUAL                          = 0x0002
    TERM_VNULL                            = 0x0080
    TF_Autoincrement                      = 0x0008
    TF_Ephemeral                          = 0x0002
    TF_HasGenerated                       = 0x0060
    TF_HasNotNull                         = 0x0800
    TF_HasPrimaryKey                      = 0x0004
    TF_HasStat1                           = 0x0010
    TF_HasStored                          = 0x0040
    TF_HasVirtual                         = 0x0020
    TF_NoVisibleRowid                     = 0x0200
    TF_OOOHidden                          = 0x0400
    TF_Readonly                           = 0x0001
    TF_Shadow                             = 0x1000
    TF_StatsUsed                          = 0x0100
    TF_WithoutRowid                       = 0x0080
    TIMER_ABSTIME                         = 1
    TIMER_END                             = 0
    TIMER_START                           = 0
    TIME_UTC                              = 1
    TIOCCBRK                              = 0x5428
    TIOCCONS                              = 0x541D
    TIOCEXCL                              = 0x540C
    TIOCGETD                              = 0x5424
    TIOCGICOUNT                           = 0x545D
    TIOCGLCKTRMIOS                        = 0x5456
    TIOCGPGRP                             = 0x540F
    TIOCGPTPEER                           = 21569
    TIOCGRS485                            = 0x542E
    TIOCGSERIAL                           = 0x541E
    TIOCGSID                              = 0x5429
    TIOCGSOFTCAR                          = 0x5419
    TIOCGWINSZ                            = 0x5413
    TIOCINQ                               = 21531
    TIOCLINUX                             = 0x541C
    TIOCMBIC                              = 0x5417
    TIOCMBIS                              = 0x5416
    TIOCMGET                              = 0x5415
    TIOCMIWAIT                            = 0x545C
    TIOCMSET                              = 0x5418
    TIOCM_CAR                             = 0x040
    TIOCM_CD                              = 64
    TIOCM_CTS                             = 0x020
    TIOCM_DSR                             = 0x100
    TIOCM_DTR                             = 0x002
    TIOCM_LE                              = 0x001
    TIOCM_RI                              = 128
    TIOCM_RNG                             = 0x080
    TIOCM_RTS                             = 0x004
    TIOCM_SR                              = 0x010
    TIOCM_ST                              = 0x008
    TIOCNOTTY                             = 0x5422
    TIOCNXCL                              = 0x540D
    TIOCOUTQ                              = 0x5411
    TIOCPKT                               = 0x5420
    TIOCPKT_DATA                          = 0
    TIOCPKT_DOSTOP                        = 32
    TIOCPKT_FLUSHREAD                     = 1
    TIOCPKT_FLUSHWRITE                    = 2
    TIOCPKT_IOCTL                         = 64
    TIOCPKT_NOSTOP                        = 16
    TIOCPKT_START                         = 8
    TIOCPKT_STOP                          = 4
    TIOCSBRK                              = 0x5427
    TIOCSCTTY                             = 0x540E
    TIOCSERCONFIG                         = 0x5453
    TIOCSERGETLSR                         = 0x5459
    TIOCSERGETMULTI                       = 0x545A
    TIOCSERGSTRUCT                        = 0x5458
    TIOCSERGWILD                          = 0x5454
    TIOCSERSETMULTI                       = 0x545B
    TIOCSERSWILD                          = 0x5455
    TIOCSER_TEMT                          = 0x01
    TIOCSETD                              = 0x5423
    TIOCSLCKTRMIOS                        = 0x5457
    TIOCSPGRP                             = 0x5410
    TIOCSRS485                            = 0x542F
    TIOCSSERIAL                           = 0x541F
    TIOCSSOFTCAR                          = 0x541A
    TIOCSTI                               = 0x5412
    TIOCSWINSZ                            = 0x5414
    TIOCVHANGUP                           = 0x5437
    TK_ABORT                              = 27
    TK_ACTION                             = 28
    TK_ADD                                = 160
    TK_AFTER                              = 29
    TK_AGG_COLUMN                         = 166
    TK_AGG_FUNCTION                       = 165
    TK_ALL                                = 133
    TK_ALTER                              = 159
    TK_ALWAYS                             = 96
    TK_ANALYZE                            = 30
    TK_AND                                = 44
    TK_ANY                                = 100
    TK_AS                                 = 24
    TK_ASC                                = 31
    TK_ASTERISK                           = 177
    TK_ATTACH                             = 32
    TK_AUTOINCR                           = 124
    TK_BEFORE                             = 33
    TK_BEGIN                              = 5
    TK_BETWEEN                            = 48
    TK_BITAND                             = 101
    TK_BITNOT                             = 112
    TK_BITOR                              = 102
    TK_BLOB                               = 151
    TK_BY                                 = 34
    TK_CASCADE                            = 35
    TK_CASE                               = 154
    TK_CAST                               = 36
    TK_CHECK                              = 122
    TK_COLLATE                            = 111
    TK_COLUMN                             = 164
    TK_COLUMNKW                           = 60
    TK_COMMA                              = 26
    TK_COMMIT                             = 10
    TK_CONCAT                             = 110
    TK_CONFLICT                           = 37
    TK_CONSTRAINT                         = 117
    TK_CREATE                             = 17
    TK_CTIME_KW                           = 99
    TK_CURRENT                            = 85
    TK_DATABASE                           = 38
    TK_DEFAULT                            = 118
    TK_DEFERRABLE                         = 129
    TK_DEFERRED                           = 7
    TK_DELETE                             = 126
    TK_DESC                               = 39
    TK_DETACH                             = 40
    TK_DISTINCT                           = 138
    TK_DO                                 = 61
    TK_DOT                                = 139
    TK_DROP                               = 131
    TK_EACH                               = 41
    TK_ELSE                               = 157
    TK_END                                = 11
    TK_EQ                                 = 53
    TK_ESCAPE                             = 58
    TK_EXCEPT                             = 134
    TK_EXCLUDE                            = 91
    TK_EXCLUSIVE                          = 9
    TK_EXISTS                             = 20
    TK_EXPLAIN                            = 2
    TK_FAIL                               = 42
    TK_FILTER                             = 163
    TK_FIRST                              = 83
    TK_FLOAT                              = 150
    TK_FOLLOWING                          = 86
    TK_FOR                                = 62
    TK_FOREIGN                            = 130
    TK_FROM                               = 140
    TK_FUNCTION                           = 169
    TK_GE                                 = 57
    TK_GENERATED                          = 95
    TK_GROUP                              = 144
    TK_GROUPS                             = 92
    TK_GT                                 = 54
    TK_HAVING                             = 145
    TK_ID                                 = 59
    TK_IF                                 = 18
    TK_IF_NULL_ROW                        = 176
    TK_IGNORE                             = 63
    TK_ILLEGAL                            = 180
    TK_IMMEDIATE                          = 8
    TK_IN                                 = 49
    TK_INDEX                              = 158
    TK_INDEXED                            = 114
    TK_INITIALLY                          = 64
    TK_INSERT                             = 125
    TK_INSTEAD                            = 65
    TK_INTEGER                            = 152
    TK_INTERSECT                          = 135
    TK_INTO                               = 148
    TK_IS                                 = 45
    TK_ISNOT                              = 168
    TK_ISNULL                             = 50
    TK_JOIN                               = 141
    TK_JOIN_KW                            = 116
    TK_KEY                                = 67
    TK_LAST                               = 84
    TK_LE                                 = 55
    TK_LIKE_KW                            = 47
    TK_LIMIT                              = 146
    TK_LP                                 = 22
    TK_LSHIFT                             = 103
    TK_LT                                 = 56
    TK_MATCH                              = 46
    TK_MINUS                              = 106
    TK_NE                                 = 52
    TK_NO                                 = 66
    TK_NOT                                = 19
    TK_NOTHING                            = 149
    TK_NOTNULL                            = 51
    TK_NULL                               = 119
    TK_NULLS                              = 82
    TK_OF                                 = 68
    TK_OFFSET                             = 69
    TK_ON                                 = 113
    TK_OR                                 = 43
    TK_ORDER                              = 143
    TK_OTHERS                             = 93
    TK_OVER                               = 162
    TK_PARTITION                          = 87
    TK_PLAN                               = 4
    TK_PLUS                               = 105
    TK_PRAGMA                             = 70
    TK_PRECEDING                          = 88
    TK_PRIMARY                            = 120
    TK_QUERY                              = 3
    TK_RAISE                              = 71
    TK_RANGE                              = 89
    TK_RECURSIVE                          = 72
    TK_REFERENCES                         = 123
    TK_REGISTER                           = 173
    TK_REINDEX                            = 97
    TK_RELEASE                            = 14
    TK_REM                                = 109
    TK_RENAME                             = 98
    TK_REPLACE                            = 73
    TK_RESTRICT                           = 74
    TK_ROLLBACK                           = 12
    TK_ROW                                = 75
    TK_ROWS                               = 76
    TK_RP                                 = 23
    TK_RSHIFT                             = 104
    TK_SAVEPOINT                          = 13
    TK_SELECT                             = 136
    TK_SELECT_COLUMN                      = 175
    TK_SEMI                               = 1
    TK_SET                                = 128
    TK_SLASH                              = 108
    TK_SPACE                              = 179
    TK_SPAN                               = 178
    TK_STAR                               = 107
    TK_STRING                             = 115
    TK_TABLE                              = 16
    TK_TEMP                               = 21
    TK_THEN                               = 156
    TK_TIES                               = 94
    TK_TO                                 = 15
    TK_TRANSACTION                        = 6
    TK_TRIGGER                            = 77
    TK_TRUEFALSE                          = 167
    TK_TRUTH                              = 172
    TK_UMINUS                             = 170
    TK_UNBOUNDED                          = 90
    TK_UNION                              = 132
    TK_UNIQUE                             = 121
    TK_UPDATE                             = 127
    TK_UPLUS                              = 171
    TK_USING                              = 142
    TK_VACUUM                             = 78
    TK_VALUES                             = 137
    TK_VARIABLE                           = 153
    TK_VECTOR                             = 174
    TK_VIEW                               = 79
    TK_VIRTUAL                            = 80
    TK_WHEN                               = 155
    TK_WHERE                              = 147
    TK_WINDOW                             = 161
    TK_WITH                               = 81
    TK_WITHOUT                            = 25
    TMP_MAX                               = 238328
    TRANS_NONE                            = 0
    TRANS_READ                            = 1
    TRANS_WRITE                           = 2
    TRIGGER_AFTER                         = 2
    TRIGGER_BEFORE                        = 1
    UNIXFILE_DELETE                       = 0x20
    UNIXFILE_DIRSYNC                      = 0x08
    UNIXFILE_EXCL                         = 0x01
    UNIXFILE_NOLOCK                       = 0x80
    UNIXFILE_PERSIST_WAL                  = 0x04
    UNIXFILE_PSOW                         = 0x10
    UNIXFILE_RDONLY                       = 0x02
    UNIXFILE_URI                          = 0x40
    UNIX_SHM_BASE                         = 120
    UNIX_SHM_DMS                          = 128
    UNKNOWN_LOCK                          = 5
    VDBE_DISPLAY_P4                       = 1
    VDBE_MAGIC_DEAD                       = 0x5606c3c8
    VDBE_MAGIC_HALT                       = 0x319c2973
    VDBE_MAGIC_INIT                       = 0x16bceaa5
    VDBE_MAGIC_RESET                      = 0x48fa9f76
    VDBE_MAGIC_RUN                        = 0x2df20da3
    WALINDEX_MAX_VERSION                  = 3007000
    WAL_ALL_BUT_WRITE                     = 1
    WAL_CKPT_LOCK                         = 1
    WAL_EXCLUSIVE_MODE                    = 1
    WAL_FRAME_HDRSIZE                     = 24
    WAL_HDRSIZE                           = 32
    WAL_HEAPMEMORY_MODE                   = 2
    WAL_LOCK_CKPT                         = 1
    WAL_LOCK_READ0                        = 3
    WAL_LOCK_WRITE                        = 0
    WAL_MAGIC                             = 0x377f0682
    WAL_MAX_VERSION                       = 3007000
    WAL_NORMAL_MODE                       = 0
    WAL_NREADER                           = 5
    WAL_RDONLY                            = 1
    WAL_RDWR                              = 0
    WAL_RECOVER_LOCK                      = 2
    WAL_RETRY                             = -1
    WAL_SAVEPOINT_NDATA                   = 4
    WAL_SHM_RDONLY                        = 2
    WAL_WRITE_LOCK                        = 0
    WCONTINUED                            = 8
    WEXITED                               = 4
    WHERE_AUTO_INDEX                      = 0x00004000
    WHERE_BIGNULL_SORT                    = 0x00080000
    WHERE_BOTH_LIMIT                      = 0x00000030
    WHERE_BTM_LIMIT                       = 0x00000020
    WHERE_COLUMN_EQ                       = 0x00000001
    WHERE_COLUMN_IN                       = 0x00000004
    WHERE_COLUMN_NULL                     = 0x00000008
    WHERE_COLUMN_RANGE                    = 0x00000002
    WHERE_CONSTRAINT                      = 0x0000000f
    WHERE_DISTINCTBY                      = 0x0080
    WHERE_DISTINCT_NOOP                   = 0
    WHERE_DISTINCT_ORDERED                = 2
    WHERE_DISTINCT_UNIQUE                 = 1
    WHERE_DISTINCT_UNORDERED              = 3
    WHERE_DUPLICATES_OK                   = 0x0010
    WHERE_GROUPBY                         = 0x0040
    WHERE_IDX_ONLY                        = 0x00000040
    WHERE_INDEXED                         = 0x00000200
    WHERE_IN_ABLE                         = 0x00000800
    WHERE_IN_EARLYOUT                     = 0x00040000
    WHERE_IPK                             = 0x00000100
    WHERE_MULTI_OR                        = 0x00002000
    WHERE_ONEPASS_DESIRED                 = 0x0004
    WHERE_ONEPASS_MULTIROW                = 0x0008
    WHERE_ONEROW                          = 0x00001000
    WHERE_ORDERBY_LIMIT                   = 0x0800
    WHERE_ORDERBY_MAX                     = 0x0002
    WHERE_ORDERBY_MIN                     = 0x0001
    WHERE_ORDERBY_NORMAL                  = 0x0000
    WHERE_OR_SUBCLAUSE                    = 0x0020
    WHERE_PARTIALIDX                      = 0x00020000
    WHERE_SEEK_TABLE                      = 0x0400
    WHERE_SEEK_UNIQ_TABLE                 = 0x1000
    WHERE_SKIPSCAN                        = 0x00008000
    WHERE_SORTBYGROUP                     = 0x0200
    WHERE_TOP_LIMIT                       = 0x00000010
    WHERE_UNQ_WANTED                      = 0x00010000
    WHERE_USE_LIMIT                       = 0x4000
    WHERE_VIRTUALTABLE                    = 0x00000400
    WHERE_WANT_DISTINCT                   = 0x0100
    WINDOW_AGGINVERSE                     = 2
    WINDOW_AGGSTEP                        = 3
    WINDOW_ENDING_INT                     = 1
    WINDOW_ENDING_NUM                     = 4
    WINDOW_NTH_VALUE_INT                  = 2
    WINDOW_RETURN_ROW                     = 1
    WINDOW_STARTING_INT                   = 0
    WINDOW_STARTING_NUM                   = 3
    WNOHANG                               = 1
    WNOWAIT                               = 0x01000000
    WO_ALL                                = 0x1fff
    WO_AND                                = 0x0400
    WO_AUX                                = 0x0040
    WO_EQ                                 = 0x0002
    WO_EQUIV                              = 0x0800
    WO_GE                                 = 32
    WO_GT                                 = 4
    WO_IN                                 = 0x0001
    WO_IS                                 = 0x0080
    WO_ISNULL                             = 0x0100
    WO_LE                                 = 8
    WO_LT                                 = 16
    WO_NOOP                               = 0x1000
    WO_OR                                 = 0x0200
    WO_SINGLE                             = 0x01ff
    WRC_Abort                             = 2
    WRC_Continue                          = 0
    WRC_Prune                             = 1
    WRITE_LOCK                            = 2
    WSTOPPED                              = 2
    WUNTRACED                             = 2
    W_OK                                  = 2
    XN_EXPR                               = -2
    XN_ROWID                              = -1
    X_OK                                  = 1
    YYFALLBACK                            = 1
    YYNOCODE                              = 310
    YYNOERRORRECOVERY                     = 1
    YYNRULE                               = 385
    YYNRULE_WITH_ACTION                   = 325
    YYNSTATE                              = 553
    YYNTOKEN                              = 181
    YYPARSEFREENEVERNULL                  = 1
    YYSTACKDEPTH                          = 100
    YYWILDCARD                            = 100
    YY_ACCEPT_ACTION                      = 1189
    YY_ACTTAB_COUNT                       = 1962
    YY_ERROR_ACTION                       = 1188
    YY_MAX_REDUCE                         = 1575
    YY_MAX_SHIFT                          = 552
    YY_MAX_SHIFTREDUCE                    = 1187
    YY_MIN_REDUCE                         = 1191
    YY_MIN_SHIFTREDUCE                    = 803
    YY_NO_ACTION                          = 1190
    YY_REDUCE_COUNT                       = 391
    YY_REDUCE_MAX                         = 1625
    YY_REDUCE_MIN                         = -262
    YY_SHIFT_COUNT                        = 552
    YY_SHIFT_MAX                          = 1951
    YY_SHIFT_MIN                          = 0
    X_ANSI_STDARG_H_                      = 0
    X_ANSI_STDDEF_H                       = 0
    X_ASM_GENERIC_ERRNO_BASE_H            = 0
    X_ASM_GENERIC_ERRNO_H                 = 0
    X_ASM_GENERIC_IOCTL_H                 = 0
    X_ASSERT_H                            = 1
    X_BITS_ERRNO_H                        = 1
    X_BITS_FLOATN_COMMON_H                = 0
    X_BITS_FLOATN_H                       = 0
    X_BITS_LIBM_SIMD_DECL_STUBS_H         = 1
    X_BITS_POSIX_OPT_H                    = 1
    X_BITS_PTHREADTYPES_ARCH_H            = 1
    X_BITS_PTHREADTYPES_COMMON_H          = 1
    X_BITS_STAT_H                         = 1
    X_BITS_STDINT_INTN_H                  = 1
    X_BITS_STDIO_LIM_H                    = 1
    X_BITS_TIME_H                         = 1
    X_BITS_TYPESIZES_H                    = 1
    X_BITS_TYPES_H                        = 1
    X_BSD_PTRDIFF_T_                      = 0
    X_BSD_SIZE_T_                         = 0
    X_BSD_SIZE_T_DEFINED_                 = 0
    X_DLFCN_H                             = 1
    X_ERRNO_H                             = 1
    X_FCNTL_H                             = 1
    X_FEATURES_H                          = 1
    X_FILE_OFFSET_BITS                    = 64
    X_FTS5INT_H                           = 0
    X_FTS5_H                              = 0
    X_FTSINT_H                            = 0
    X_GCC_MAX_ALIGN_T                     = 0
    X_GCC_PTRDIFF_T                       = 0
    X_GCC_SIZE_T                          = 0
    X_GCC_WCHAR_T                         = 0
    X_GETOPT_CORE_H                       = 1
    X_GETOPT_POSIX_H                      = 1
    X_IOC_DIRBITS                         = 2
    X_IOC_DIRMASK                         = 3
    X_IOC_DIRSHIFT                        = 30
    X_IOC_NONE                            = 0
    X_IOC_NRBITS                          = 8
    X_IOC_NRMASK                          = 255
    X_IOC_NRSHIFT                         = 0
    X_IOC_READ                            = 2
    X_IOC_SIZEBITS                        = 14
    X_IOC_SIZEMASK                        = 16383
    X_IOC_SIZESHIFT                       = 16
    X_IOC_TYPEBITS                        = 8
    X_IOC_TYPEMASK                        = 255
    X_IOC_TYPESHIFT                       = 8
    X_IOC_WRITE                           = 1
    X_IOFBF                               = 0
    X_IOLBF                               = 1
    X_IONBF                               = 2
    X_IO_EOF_SEEN                         = 0x0010
    X_IO_ERR_SEEN                         = 0x0020
    X_IO_USER_LOCK                        = 0x8000
    X_LARGEFILE_SOURCE                    = 1
    X_LARGE_FILE                          = 1
    X_LFS64_ASYNCHRONOUS_IO               = 1
    X_LFS64_LARGEFILE                     = 1
    X_LFS64_STDIO                         = 1
    X_LFS_ASYNCHRONOUS_IO                 = 1
    X_LFS_LARGEFILE                       = 1
    X_LINUX_IOCTL_H                       = 0
    X_LP64                                = 1
    X_MATH_H                              = 1
    X_MKNOD_VER                           = 0
    X_MKNOD_VER_LINUX                     = 0
    X_OS_COMMON_H_                        = 0
    X_POSIX2_CHAR_TERM                    = 200809
    X_POSIX2_C_BIND                       = 200112
    X_POSIX2_C_DEV                        = 200112
    X_POSIX2_C_VERSION                    = 200112
    X_POSIX2_LOCALEDEF                    = 200112
    X_POSIX2_SW_DEV                       = 200112
    X_POSIX2_VERSION                      = 200112
    X_POSIX_ADVISORY_INFO                 = 200809
    X_POSIX_ASYNCHRONOUS_IO               = 200809
    X_POSIX_ASYNC_IO                      = 1
    X_POSIX_BARRIERS                      = 200809
    X_POSIX_CHOWN_RESTRICTED              = 0
    X_POSIX_CLOCK_SELECTION               = 200809
    X_POSIX_CPUTIME                       = 0
    X_POSIX_C_SOURCE                      = 200112
    X_POSIX_FSYNC                         = 200809
    X_POSIX_IPV6                          = 200809
    X_POSIX_JOB_CONTROL                   = 1
    X_POSIX_MAPPED_FILES                  = 200809
    X_POSIX_MEMLOCK                       = 200809
    X_POSIX_MEMLOCK_RANGE                 = 200809
    X_POSIX_MEMORY_PROTECTION             = 200809
    X_POSIX_MESSAGE_PASSING               = 200809
    X_POSIX_MONOTONIC_CLOCK               = 0
    X_POSIX_NO_TRUNC                      = 1
    X_POSIX_PRIORITIZED_IO                = 200809
    X_POSIX_PRIORITY_SCHEDULING           = 200809
    X_POSIX_RAW_SOCKETS                   = 200809
    X_POSIX_READER_WRITER_LOCKS           = 200809
    X_POSIX_REALTIME_SIGNALS              = 200809
    X_POSIX_REENTRANT_FUNCTIONS           = 1
    X_POSIX_REGEXP                        = 1
    X_POSIX_SAVED_IDS                     = 1
    X_POSIX_SEMAPHORES                    = 200809
    X_POSIX_SHARED_MEMORY_OBJECTS         = 200809
    X_POSIX_SHELL                         = 1
    X_POSIX_SOURCE                        = 1
    X_POSIX_SPAWN                         = 200809
    X_POSIX_SPIN_LOCKS                    = 200809
    X_POSIX_SPORADIC_SERVER               = -1
    X_POSIX_SYNCHRONIZED_IO               = 200809
    X_POSIX_THREADS                       = 200809
    X_POSIX_THREAD_ATTR_STACKADDR         = 200809
    X_POSIX_THREAD_ATTR_STACKSIZE         = 200809
    X_POSIX_THREAD_CPUTIME                = 0
    X_POSIX_THREAD_PRIORITY_SCHEDULING    = 200809
    X_POSIX_THREAD_PRIO_INHERIT           = 200809
    X_POSIX_THREAD_PRIO_PROTECT           = 200809
    X_POSIX_THREAD_PROCESS_SHARED         = 200809
    X_POSIX_THREAD_SAFE_FUNCTIONS         = 200809
    X_POSIX_THREAD_SPORADIC_SERVER        = -1
    X_POSIX_TIMEOUTS                      = 200809
    X_POSIX_TIMERS                        = 200809
    X_POSIX_TRACE                         = -1
    X_POSIX_TRACE_EVENT_FILTER            = -1
    X_POSIX_TRACE_INHERIT                 = -1
    X_POSIX_TRACE_LOG                     = -1
    X_POSIX_TYPED_MEMORY_OBJECTS          = -1
    X_POSIX_V6_LP64_OFF64                 = 1
    X_POSIX_V6_LPBIG_OFFBIG               = -1
    X_POSIX_V7_LP64_OFF64                 = 1
    X_POSIX_V7_LPBIG_OFFBIG               = -1
    X_POSIX_VDISABLE                      = 0
    X_POSIX_VERSION                       = 200112
    X_PTRDIFF_T                           = 0
    X_PTRDIFF_T_                          = 0
    X_PTRDIFF_T_DECLARED                  = 0
    X_SIZET_                              = 0
    X_SIZE_T                              = 0
    X_SIZE_T_                             = 0
    X_SIZE_T_DECLARED                     = 0
    X_SIZE_T_DEFINED                      = 0
    X_SIZE_T_DEFINED_                     = 0
    X_SQLITE3RBU_H                        = 0
    X_SQLITE3RTREE_H_                     = 0
    X_SQLITE_OS_H_                        = 0
    X_STATBUF_ST_BLKSIZE                  = 0
    X_STATBUF_ST_NSEC                     = 0
    X_STATBUF_ST_RDEV                     = 0
    X_STAT_VER                            = 1
    X_STAT_VER_KERNEL                     = 0
    X_STAT_VER_LINUX                      = 1
    X_STDARG_H                            = 0
    X_STDC_PREDEF_H                       = 1
    X_STDDEF_H                            = 0
    X_STDDEF_H_                           = 0
    X_STDIO_H                             = 1
    X_STDLIB_H                            = 1
    X_STRING_H                            = 1
    X_STRUCT_TIMESPEC                     = 1
    X_SYS_CDEFS_H                         = 1
    X_SYS_IOCTL_H                         = 1
    X_SYS_MMAN_H                          = 1
    X_SYS_SELECT_H                        = 1
    X_SYS_SIZE_T_H                        = 0
    X_SYS_STAT_H                          = 1
    X_SYS_TIME_H                          = 1
    X_SYS_TTYDEFAULTS_H_                  = 0
    X_SYS_TYPES_H                         = 1
    X_THREAD_SHARED_TYPES_H               = 1
    X_TIME_H                              = 1
    X_T_PTRDIFF                           = 0
    X_T_PTRDIFF_                          = 0
    X_T_SIZE                              = 0
    X_T_SIZE_                             = 0
    X_T_WCHAR                             = 0
    X_T_WCHAR_                            = 0
    X_UNISTD_H                            = 1
    X_VA_LIST                             = 0
    X_VA_LIST_                            = 0
    X_VA_LIST_DEFINED                     = 0
    X_VA_LIST_T_H                         = 0
    X_WCHAR_T                             = 0
    X_WCHAR_T_                            = 0
    X_WCHAR_T_DECLARED                    = 0
    X_WCHAR_T_DEFINED                     = 0
    X_WCHAR_T_DEFINED_                    = 0
    X_WCHAR_T_H                           = 0
    X_XBS5_LP64_OFF64                     = 1
    X_XBS5_LPBIG_OFFBIG                   = -1
    X_XOPEN_ENH_I18N                      = 1
    X_XOPEN_LEGACY                        = 1
    X_XOPEN_REALTIME                      = 1
    X_XOPEN_REALTIME_THREADS              = 1
    X_XOPEN_SHM                           = 1
    X_XOPEN_SOURCE                        = 600
    X_XOPEN_UNIX                          = 1
    X_XOPEN_VERSION                       = 600
    X_XOPEN_XCU_VERSION                   = 4
    X_XOPEN_XPG2                          = 1
    X_XOPEN_XPG3                          = 1
    X_XOPEN_XPG4                          = 1
    BBatch                                = 0
    Deliberate_fall_through               = 0
    EtBUFSIZE                             = 70
    EtCHARX                               = 8
    EtDECIMAL                             = 16
    EtDYNSTRING                           = 6
    EtEXP                                 = 2
    EtFLOAT                               = 1
    EtGENERIC                             = 3
    EtINVALID                             = 17
    EtORDINAL                             = 15
    EtPERCENT                             = 7
    EtPOINTER                             = 13
    EtRADIX                               = 0
    EtSIZE                                = 4
    EtSQLESCAPE                           = 9
    EtSQLESCAPE2                          = 10
    EtSQLESCAPE3                          = 14
    EtSRCLIST                             = 12
    EtSTRING                              = 5
    EtTOKEN                               = 11
    Fts5YYNFTS5TOKEN                      = 16
    Fts5YYNOCODE                          = 27
    Fts5YYNOERRORRECOVERY                 = 1
    Fts5YYNRULE                           = 28
    Fts5YYNRULE_WITH_ACTION               = 28
    Fts5YYNSTATE                          = 35
    Fts5YYPARSEFREENOTNULL                = 1
    Fts5YYSTACKDEPTH                      = 100
    Fts5YY_ACCEPT_ACTION                  = 81
    Fts5YY_ACTTAB_COUNT                   = 105
    Fts5YY_ERROR_ACTION                   = 80
    Fts5YY_MAX_REDUCE                     = 110
    Fts5YY_MAX_SHIFT                      = 34
    Fts5YY_MAX_SHIFTREDUCE                = 79
    Fts5YY_MIN_REDUCE                     = 83
    Fts5YY_MIN_SHIFTREDUCE                = 52
    Fts5YY_NO_ACTION                      = 82
    Fts5YY_REDUCE_COUNT                   = 17
    Fts5YY_REDUCE_MAX                     = 67
    Fts5YY_REDUCE_MIN                     = -17
    Fts5YY_SHIFT_COUNT                    = 34
    Fts5YY_SHIFT_MAX                      = 93
    Fts5YY_SHIFT_MIN                      = 0
    Linux                                 = 1
    Math_errhandling                      = 3
    Sqlite3Fts5ParserCTX_FETCH            = 0
    Sqlite3Fts5ParserCTX_PARAM            = 0
    Sqlite3Fts5ParserCTX_PDECL            = 0
    Sqlite3Fts5ParserCTX_SDECL            = 0
    Sqlite3Fts5ParserCTX_STORE            = 0
    Sqlite3ParserARG_FETCH                = 0
    Sqlite3ParserARG_PARAM                = 0
    Sqlite3ParserARG_PDECL                = 0
    Sqlite3ParserARG_SDECL                = 0
    Sqlite3ParserARG_STORE                = 0
    Sqlite3Parser_ENGINEALWAYSONSTACK     = 1
    TkCREATE                              = 4
    TkEND                                 = 7
    TkEXPLAIN                             = 3
    TkOTHER                               = 2
    TkSEMI                                = 0
    TkTEMP                                = 5
    TkTRIGGER                             = 6
    TkWS                                  = 1
    Unix                                  = 1
    WsdAutoextInit                        = 0
    WsdHooksInit                          = 0
    WsdStatInit                           = 0
)
const (
    FP_NAN       = 0
    FP_INFINITE  = 1
    FP_ZERO      = 2
    FP_SUBNORMAL = 3
    FP_NORMAL    = 4
)

All floating-point numbers can be put in one of these categories.

const (
    X_PC_LINK_MAX           = 0
    X_PC_MAX_CANON          = 1
    X_PC_MAX_INPUT          = 2
    X_PC_NAME_MAX           = 3
    X_PC_PATH_MAX           = 4
    X_PC_PIPE_BUF           = 5
    X_PC_CHOWN_RESTRICTED   = 6
    X_PC_NO_TRUNC           = 7
    X_PC_VDISABLE           = 8
    X_PC_SYNC_IO            = 9
    X_PC_ASYNC_IO           = 10
    X_PC_PRIO_IO            = 11
    X_PC_SOCK_MAXBUF        = 12
    X_PC_FILESIZEBITS       = 13
    X_PC_REC_INCR_XFER_SIZE = 14
    X_PC_REC_MAX_XFER_SIZE  = 15
    X_PC_REC_MIN_XFER_SIZE  = 16
    X_PC_REC_XFER_ALIGN     = 17
    X_PC_ALLOC_SIZE_MIN     = 18
    X_PC_SYMLINK_MAX        = 19
    X_PC_2_SYMLINKS         = 20
)

Values for the NAME argument to `pathconf' and `fpathconf'.

const (
    X_CS_PATH = 0 // The default search path.

    X_CS_V6_WIDTH_RESTRICTED_ENVS = 1

    X_CS_GNU_LIBC_VERSION       = 2
    X_CS_GNU_LIBPTHREAD_VERSION = 3

    X_CS_V5_WIDTH_RESTRICTED_ENVS = 4

    X_CS_V7_WIDTH_RESTRICTED_ENVS = 5

    X_CS_LFS_CFLAGS      = 1000
    X_CS_LFS_LDFLAGS     = 1001
    X_CS_LFS_LIBS        = 1002
    X_CS_LFS_LINTFLAGS   = 1003
    X_CS_LFS64_CFLAGS    = 1004
    X_CS_LFS64_LDFLAGS   = 1005
    X_CS_LFS64_LIBS      = 1006
    X_CS_LFS64_LINTFLAGS = 1007

    X_CS_XBS5_ILP32_OFF32_CFLAGS     = 1100
    X_CS_XBS5_ILP32_OFF32_LDFLAGS    = 1101
    X_CS_XBS5_ILP32_OFF32_LIBS       = 1102
    X_CS_XBS5_ILP32_OFF32_LINTFLAGS  = 1103
    X_CS_XBS5_ILP32_OFFBIG_CFLAGS    = 1104
    X_CS_XBS5_ILP32_OFFBIG_LDFLAGS   = 1105
    X_CS_XBS5_ILP32_OFFBIG_LIBS      = 1106
    X_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107
    X_CS_XBS5_LP64_OFF64_CFLAGS      = 1108
    X_CS_XBS5_LP64_OFF64_LDFLAGS     = 1109
    X_CS_XBS5_LP64_OFF64_LIBS        = 1110
    X_CS_XBS5_LP64_OFF64_LINTFLAGS   = 1111
    X_CS_XBS5_LPBIG_OFFBIG_CFLAGS    = 1112
    X_CS_XBS5_LPBIG_OFFBIG_LDFLAGS   = 1113
    X_CS_XBS5_LPBIG_OFFBIG_LIBS      = 1114
    X_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115

    X_CS_POSIX_V6_ILP32_OFF32_CFLAGS     = 1116
    X_CS_POSIX_V6_ILP32_OFF32_LDFLAGS    = 1117
    X_CS_POSIX_V6_ILP32_OFF32_LIBS       = 1118
    X_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS  = 1119
    X_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS    = 1120
    X_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS   = 1121
    X_CS_POSIX_V6_ILP32_OFFBIG_LIBS      = 1122
    X_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123
    X_CS_POSIX_V6_LP64_OFF64_CFLAGS      = 1124
    X_CS_POSIX_V6_LP64_OFF64_LDFLAGS     = 1125
    X_CS_POSIX_V6_LP64_OFF64_LIBS        = 1126
    X_CS_POSIX_V6_LP64_OFF64_LINTFLAGS   = 1127
    X_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS    = 1128
    X_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS   = 1129
    X_CS_POSIX_V6_LPBIG_OFFBIG_LIBS      = 1130
    X_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131

    X_CS_POSIX_V7_ILP32_OFF32_CFLAGS     = 1132
    X_CS_POSIX_V7_ILP32_OFF32_LDFLAGS    = 1133
    X_CS_POSIX_V7_ILP32_OFF32_LIBS       = 1134
    X_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS  = 1135
    X_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS    = 1136
    X_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS   = 1137
    X_CS_POSIX_V7_ILP32_OFFBIG_LIBS      = 1138
    X_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139
    X_CS_POSIX_V7_LP64_OFF64_CFLAGS      = 1140
    X_CS_POSIX_V7_LP64_OFF64_LDFLAGS     = 1141
    X_CS_POSIX_V7_LP64_OFF64_LIBS        = 1142
    X_CS_POSIX_V7_LP64_OFF64_LINTFLAGS   = 1143
    X_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS    = 1144
    X_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS   = 1145
    X_CS_POSIX_V7_LPBIG_OFFBIG_LIBS      = 1146
    X_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147

    X_CS_V6_ENV = 1148
    X_CS_V7_ENV = 1149
)

Values for the NAME argument to `confstr'.

const (
    X_SC_ARG_MAX               = 0
    X_SC_CHILD_MAX             = 1
    X_SC_CLK_TCK               = 2
    X_SC_NGROUPS_MAX           = 3
    X_SC_OPEN_MAX              = 4
    X_SC_STREAM_MAX            = 5
    X_SC_TZNAME_MAX            = 6
    X_SC_JOB_CONTROL           = 7
    X_SC_SAVED_IDS             = 8
    X_SC_REALTIME_SIGNALS      = 9
    X_SC_PRIORITY_SCHEDULING   = 10
    X_SC_TIMERS                = 11
    X_SC_ASYNCHRONOUS_IO       = 12
    X_SC_PRIORITIZED_IO        = 13
    X_SC_SYNCHRONIZED_IO       = 14
    X_SC_FSYNC                 = 15
    X_SC_MAPPED_FILES          = 16
    X_SC_MEMLOCK               = 17
    X_SC_MEMLOCK_RANGE         = 18
    X_SC_MEMORY_PROTECTION     = 19
    X_SC_MESSAGE_PASSING       = 20
    X_SC_SEMAPHORES            = 21
    X_SC_SHARED_MEMORY_OBJECTS = 22
    X_SC_AIO_LISTIO_MAX        = 23
    X_SC_AIO_MAX               = 24
    X_SC_AIO_PRIO_DELTA_MAX    = 25
    X_SC_DELAYTIMER_MAX        = 26
    X_SC_MQ_OPEN_MAX           = 27
    X_SC_MQ_PRIO_MAX           = 28
    X_SC_VERSION               = 29
    X_SC_PAGESIZE              = 30
    X_SC_RTSIG_MAX             = 31
    X_SC_SEM_NSEMS_MAX         = 32
    X_SC_SEM_VALUE_MAX         = 33
    X_SC_SIGQUEUE_MAX          = 34
    X_SC_TIMER_MAX             = 35

    // Values for the argument to `sysconf'
    //       corresponding to _POSIX2_* symbols.
    X_SC_BC_BASE_MAX        = 36
    X_SC_BC_DIM_MAX         = 37
    X_SC_BC_SCALE_MAX       = 38
    X_SC_BC_STRING_MAX      = 39
    X_SC_COLL_WEIGHTS_MAX   = 40
    X_SC_EQUIV_CLASS_MAX    = 41
    X_SC_EXPR_NEST_MAX      = 42
    X_SC_LINE_MAX           = 43
    X_SC_RE_DUP_MAX         = 44
    X_SC_CHARCLASS_NAME_MAX = 45

    X_SC_2_VERSION   = 46
    X_SC_2_C_BIND    = 47
    X_SC_2_C_DEV     = 48
    X_SC_2_FORT_DEV  = 49
    X_SC_2_FORT_RUN  = 50
    X_SC_2_SW_DEV    = 51
    X_SC_2_LOCALEDEF = 52

    X_SC_PII                 = 53
    X_SC_PII_XTI             = 54
    X_SC_PII_SOCKET          = 55
    X_SC_PII_INTERNET        = 56
    X_SC_PII_OSI             = 57
    X_SC_POLL                = 58
    X_SC_SELECT              = 59
    X_SC_UIO_MAXIOV          = 60
    X_SC_IOV_MAX             = 60
    X_SC_PII_INTERNET_STREAM = 61
    X_SC_PII_INTERNET_DGRAM  = 62
    X_SC_PII_OSI_COTS        = 63
    X_SC_PII_OSI_CLTS        = 64
    X_SC_PII_OSI_M           = 65
    X_SC_T_IOV_MAX           = 66

    // Values according to POSIX 1003.1c (POSIX threads).
    X_SC_THREADS                      = 67
    X_SC_THREAD_SAFE_FUNCTIONS        = 68
    X_SC_GETGR_R_SIZE_MAX             = 69
    X_SC_GETPW_R_SIZE_MAX             = 70
    X_SC_LOGIN_NAME_MAX               = 71
    X_SC_TTY_NAME_MAX                 = 72
    X_SC_THREAD_DESTRUCTOR_ITERATIONS = 73
    X_SC_THREAD_KEYS_MAX              = 74
    X_SC_THREAD_STACK_MIN             = 75
    X_SC_THREAD_THREADS_MAX           = 76
    X_SC_THREAD_ATTR_STACKADDR        = 77
    X_SC_THREAD_ATTR_STACKSIZE        = 78
    X_SC_THREAD_PRIORITY_SCHEDULING   = 79
    X_SC_THREAD_PRIO_INHERIT          = 80
    X_SC_THREAD_PRIO_PROTECT          = 81
    X_SC_THREAD_PROCESS_SHARED        = 82

    X_SC_NPROCESSORS_CONF = 83
    X_SC_NPROCESSORS_ONLN = 84
    X_SC_PHYS_PAGES       = 85
    X_SC_AVPHYS_PAGES     = 86
    X_SC_ATEXIT_MAX       = 87
    X_SC_PASS_MAX         = 88

    X_SC_XOPEN_VERSION     = 89
    X_SC_XOPEN_XCU_VERSION = 90
    X_SC_XOPEN_UNIX        = 91
    X_SC_XOPEN_CRYPT       = 92
    X_SC_XOPEN_ENH_I18N    = 93
    X_SC_XOPEN_SHM         = 94

    X_SC_2_CHAR_TERM = 95
    X_SC_2_C_VERSION = 96
    X_SC_2_UPE       = 97

    X_SC_XOPEN_XPG2 = 98
    X_SC_XOPEN_XPG3 = 99
    X_SC_XOPEN_XPG4 = 100

    X_SC_CHAR_BIT   = 101
    X_SC_CHAR_MAX   = 102
    X_SC_CHAR_MIN   = 103
    X_SC_INT_MAX    = 104
    X_SC_INT_MIN    = 105
    X_SC_LONG_BIT   = 106
    X_SC_WORD_BIT   = 107
    X_SC_MB_LEN_MAX = 108
    X_SC_NZERO      = 109
    X_SC_SSIZE_MAX  = 110
    X_SC_SCHAR_MAX  = 111
    X_SC_SCHAR_MIN  = 112
    X_SC_SHRT_MAX   = 113
    X_SC_SHRT_MIN   = 114
    X_SC_UCHAR_MAX  = 115
    X_SC_UINT_MAX   = 116
    X_SC_ULONG_MAX  = 117
    X_SC_USHRT_MAX  = 118

    X_SC_NL_ARGMAX  = 119
    X_SC_NL_LANGMAX = 120
    X_SC_NL_MSGMAX  = 121
    X_SC_NL_NMAX    = 122
    X_SC_NL_SETMAX  = 123
    X_SC_NL_TEXTMAX = 124

    X_SC_XBS5_ILP32_OFF32  = 125
    X_SC_XBS5_ILP32_OFFBIG = 126
    X_SC_XBS5_LP64_OFF64   = 127
    X_SC_XBS5_LPBIG_OFFBIG = 128

    X_SC_XOPEN_LEGACY           = 129
    X_SC_XOPEN_REALTIME         = 130
    X_SC_XOPEN_REALTIME_THREADS = 131

    X_SC_ADVISORY_INFO          = 132
    X_SC_BARRIERS               = 133
    X_SC_BASE                   = 134
    X_SC_C_LANG_SUPPORT         = 135
    X_SC_C_LANG_SUPPORT_R       = 136
    X_SC_CLOCK_SELECTION        = 137
    X_SC_CPUTIME                = 138
    X_SC_THREAD_CPUTIME         = 139
    X_SC_DEVICE_IO              = 140
    X_SC_DEVICE_SPECIFIC        = 141
    X_SC_DEVICE_SPECIFIC_R      = 142
    X_SC_FD_MGMT                = 143
    X_SC_FIFO                   = 144
    X_SC_PIPE                   = 145
    X_SC_FILE_ATTRIBUTES        = 146
    X_SC_FILE_LOCKING           = 147
    X_SC_FILE_SYSTEM            = 148
    X_SC_MONOTONIC_CLOCK        = 149
    X_SC_MULTI_PROCESS          = 150
    X_SC_SINGLE_PROCESS         = 151
    X_SC_NETWORKING             = 152
    X_SC_READER_WRITER_LOCKS    = 153
    X_SC_SPIN_LOCKS             = 154
    X_SC_REGEXP                 = 155
    X_SC_REGEX_VERSION          = 156
    X_SC_SHELL                  = 157
    X_SC_SIGNALS                = 158
    X_SC_SPAWN                  = 159
    X_SC_SPORADIC_SERVER        = 160
    X_SC_THREAD_SPORADIC_SERVER = 161
    X_SC_SYSTEM_DATABASE        = 162
    X_SC_SYSTEM_DATABASE_R      = 163
    X_SC_TIMEOUTS               = 164
    X_SC_TYPED_MEMORY_OBJECTS   = 165
    X_SC_USER_GROUPS            = 166
    X_SC_USER_GROUPS_R          = 167
    X_SC_2_PBS                  = 168
    X_SC_2_PBS_ACCOUNTING       = 169
    X_SC_2_PBS_LOCATE           = 170
    X_SC_2_PBS_MESSAGE          = 171
    X_SC_2_PBS_TRACK            = 172
    X_SC_SYMLOOP_MAX            = 173
    X_SC_STREAMS                = 174
    X_SC_2_PBS_CHECKPOINT       = 175

    X_SC_V6_ILP32_OFF32  = 176
    X_SC_V6_ILP32_OFFBIG = 177
    X_SC_V6_LP64_OFF64   = 178
    X_SC_V6_LPBIG_OFFBIG = 179

    X_SC_HOST_NAME_MAX      = 180
    X_SC_TRACE              = 181
    X_SC_TRACE_EVENT_FILTER = 182
    X_SC_TRACE_INHERIT      = 183
    X_SC_TRACE_LOG          = 184

    X_SC_LEVEL1_ICACHE_SIZE     = 185
    X_SC_LEVEL1_ICACHE_ASSOC    = 186
    X_SC_LEVEL1_ICACHE_LINESIZE = 187
    X_SC_LEVEL1_DCACHE_SIZE     = 188
    X_SC_LEVEL1_DCACHE_ASSOC    = 189
    X_SC_LEVEL1_DCACHE_LINESIZE = 190
    X_SC_LEVEL2_CACHE_SIZE      = 191
    X_SC_LEVEL2_CACHE_ASSOC     = 192
    X_SC_LEVEL2_CACHE_LINESIZE  = 193
    X_SC_LEVEL3_CACHE_SIZE      = 194
    X_SC_LEVEL3_CACHE_ASSOC     = 195
    X_SC_LEVEL3_CACHE_LINESIZE  = 196
    X_SC_LEVEL4_CACHE_SIZE      = 197
    X_SC_LEVEL4_CACHE_ASSOC     = 198
    X_SC_LEVEL4_CACHE_LINESIZE  = 199

    X_SC_IPV6        = 235
    X_SC_RAW_SOCKETS = 236

    X_SC_V7_ILP32_OFF32  = 237
    X_SC_V7_ILP32_OFFBIG = 238
    X_SC_V7_LP64_OFF64   = 239
    X_SC_V7_LPBIG_OFFBIG = 240

    X_SC_SS_REPL_MAX = 241

    X_SC_TRACE_EVENT_NAME_MAX = 242
    X_SC_TRACE_NAME_MAX       = 243
    X_SC_TRACE_SYS_MAX        = 244
    X_SC_TRACE_USER_EVENT_MAX = 245

    X_SC_XOPEN_STREAMS = 246

    X_SC_THREAD_ROBUST_PRIO_INHERIT = 247
    X_SC_THREAD_ROBUST_PRIO_PROTECT = 248
)

Values for the argument to `sysconf'.

const (
    P_ALL  = 0 // Wait for any child.
    P_PID  = 1 // Wait for specified process.
    P_PGID = 2
)
const (
    // Timers run in real time.
    ITIMER_REAL = 0
    // Timers run only when the process is executing.
    ITIMER_VIRTUAL = 1
    // Timers run when the process is executing and when
    //       the system is executing on behalf of the process.
    ITIMER_PROF = 2
)

Values for the first argument to `getitimer' and `setitimer'.

Variables

var CAPI = map[string]struct{}{ /* 1272 elements not displayed */

}
var Xsqlite3Config = Sqlite3Config{FbMemstat: 0, FbCoreMutex: U8(1), FbFullMutex: (U8(libc.Bool32(1 == 1))), FbOpenUri: U8(0), FbUseCis: U8(1), FbSmallMalloc: U8(0), FbExtraSchemaChecks: U8(1), FmxStrlen: 0x7ffffffe, FneverCorrupt: 0, FszLookaside: 1200, FnLookaside: 40, FnStmtSpill: (64 * 1024), Fm: Sqlite3_mem_methods{FxMalloc: uintptr(0), FxFree: uintptr(0), FxRealloc: uintptr(0), FxSize: uintptr(0), FxRoundup: uintptr(0), FxInit: uintptr(0), FxShutdown: uintptr(0), FpAppData: uintptr(0)}, Fmutex: Sqlite3_mutex_methods{FxMutexInit: uintptr(0), FxMutexEnd: uintptr(0), FxMutexAlloc: uintptr(0), FxMutexFree: uintptr(0), FxMutexEnter: uintptr(0), FxMutexTry: uintptr(0), FxMutexLeave: uintptr(0), FxMutexHeld: uintptr(0), FxMutexNotheld: uintptr(0)}, Fpcache2: Sqlite3_pcache_methods2{FiVersion: 0, FpArg: uintptr(0), FxInit: uintptr(0), FxShutdown: uintptr(0), FxCreate: uintptr(0), FxCachesize: uintptr(0), FxPagecount: uintptr(0), FxFetch: uintptr(0), FxUnpin: uintptr(0), FxRekey: uintptr(0), FxTruncate: uintptr(0), FxDestroy: uintptr(0), FxShrink: uintptr(0)}, FpHeap: uintptr(0), FnHeap: 0, FmnReq: 0, FmxReq: 0, FszMmap: int64(0), FmxMmap: int64(0x7fff0000), FpPage: uintptr(0), FszPage: 0, FnPage: 20, FmxParserStack: 0, FsharedCacheEnabled: 0, FszPma: U32(250), FisInit: 0, FinProgress: 0, FisMutexInit: 0, FisMallocInit: 0, FisPCacheInit: 0, FnRefInitMutex: 0, FpInitMutex: uintptr(0), FxLog: uintptr(0), FpLogArg: uintptr(0), FmxMemdbSize: int64(1073741824), FxTestCallback: uintptr(0), FbLocaltimeFault: 0, FiOnceResetThreshold: 0x7ffffffe, FszSorterRef: U32(0x7fffffff), FiPrngSeed: uint32(0),
}   /* sqlite3.c:20578:48 */

The following singleton contains the global configuration for the SQLite library.

var Xsqlite3CtypeMap = [256]uint8{ /* 256 elements not displayed */

}

The following 256 byte lookup table is used to support SQLites built-in equivalents to the following standard library functions:

isspace()                        0x01
isalpha()                        0x02
isdigit()                        0x04
isalnum()                        0x06
isxdigit()                       0x08
toupper()                        0x20
SQLite identifier character      0x40
Quote character                  0x80

Bit 0x20 is set if the mapped character requires translation to upper case. i.e. if the character is a lower-case ASCII character. If x is a lower-case ASCII character, then its upper-case equivalent is (x - 0x20). Therefore toupper() can be implemented as:

(x & ~(map[x]&0x20))

The equivalent of tolower() is implemented using the sqlite3UpperToLower[] array. tolower() is used more often than toupper() by SQLite.

Bit 0x40 is set if the character is non-alphanumeric and can be used in an SQLite identifier. Identifiers are alphanumerics, "_", "$", and any non-ASCII UTF character. Hence the test for whether or not a character is part of an identifier is 0x46.

var Xsqlite3OSTrace int32 = 0 /* sqlite3.c:161140:7 */

When compiling the test fixture or with debugging enabled (on Win32), this variable being set to non-zero will cause OSTRACE macros to emit extra diagnostic information.

var Xsqlite3OpcodeProperty = [176]uint8{ /* 176 elements not displayed */ }

#include "opcodes.h" Properties of opcodes. The OPFLG_INITIALIZER macro is created by mkopcodeh.awk during compilation. Data is obtained from the comments following the "case OP_xxxx:" statements in the vdbe.c file.

var Xsqlite3PendingByte int32 = 0x40000000 /* sqlite3.c:20668:20 */

The value of the "pending" byte must be 0x40000000 (1 byte past the 1-gibabyte boundary) in a compatible database. SQLite never uses the database page that contains the pending byte. It never attempts to read or write that page. The pending byte page is set aside for use by the VFS layers as space for managing file locks.

During testing, it is often desirable to move the pending byte to a different position in the file. This allows code that has to deal with the pending byte to run on files that are much smaller than 1 GiB. The sqlite3_test_control() interface can be used to move the pending byte.

IMPORTANT: Changing the pending byte to any value other than 0x40000000 results in an incompatible database file format! Changing the pending byte during operation will result in undefined and incorrect behavior.

var Xsqlite3SharedCacheList uintptr = uintptr(0) /* sqlite3.c:64558:25 */

A list of BtShared objects that are eligible for participation in shared cache. This variable has file scope during normal builds, but the test harness needs to access it so we make it global for test builds.

Access to this variable is protected by SQLITE_MUTEX_STATIC_MAIN.

var Xsqlite3StrBINARY = *(*[7]int8)(unsafe.Pointer(ts + 344)) /* sqlite3.c:20688:27 */

Name of the default collating sequence

var Xsqlite3UpperToLower = [256]uint8{ /* 256 elements not displayed */

}

An array to map all upper-case characters into their corresponding lower-case character.

SQLite only considers US-ASCII (or EBCDIC) characters. We do not handle case conversions for the UTF character set since the tables involved are nearly as big or bigger than SQLite itself.

var Xsqlite3WhereTrace int32 = 0 /* sqlite3.c:145653:11 */

Test variable that can be set to enable WHERE tracing *

var Xsqlite3_current_time int32 = 0 /* sqlite3.c:40111:16 */ // Fake system time in seconds since 1970.

The following variable, if set to a non-zero value, is interpreted as the number of seconds since 1970 and is used to set the result of sqlite3OsCurrentTime() during testing.

var Xsqlite3_data_directory uintptr = uintptr(0) /* sqlite3.c:161169:17 */

If the following global variable points to a string which is the name of a directory, then that directory will be used to store all database files specified with a relative pathname.

See also the "PRAGMA data_store_directory" SQL command.

var Xsqlite3_diskfull int32 = 0 /* sqlite3.c:22996:16 */
var Xsqlite3_diskfull_pending int32 = 0 /* sqlite3.c:22995:16 */
var Xsqlite3_found_count int32 = 0 /* sqlite3.c:85345:16 */

The next global variable is incremented each time the OP_Found opcode is executed. This is used to test whether or not the foreign key operation implemented using OP_FkIsZero is working. This variable has no function other than to help verify the correct operation of the library.

var Xsqlite3_fts5_may_be_corrupt int32 = 1 /* sqlite3.c:223008:16 */

This variable is set to false when running tests for which the on disk structures should not be corrupt. Otherwise, true. If it is false, extra assert() conditions in the fts5 code are activated - conditions that are only true if it is guaranteed that the fts5 database is not corrupt.

var Xsqlite3_fullsync_count int32 = 0 /* sqlite3.c:37079:16 */
var Xsqlite3_interrupt_count int32 = 0 /* sqlite3.c:85297:16 */

When this global variable is positive, it gets decremented once before each instruction in the VDBE. When it reaches zero, the u1.isInterrupted field of the sqlite3 structure is set in order to simulate an interrupt.

This facility is used for testing purposes only. It does not function in an ordinary build.

var Xsqlite3_io_error_benign int32 = 0 /* sqlite3.c:22994:16 */ // True if errors are benign
var Xsqlite3_io_error_hardhit int32 = 0 /* sqlite3.c:22991:16 */ // Number of non-benign errors
var Xsqlite3_io_error_hit int32 = 0 /* sqlite3.c:22990:16 */ // Total number of I/O Errors

If we compile with the SQLITE_TEST macro set, then the following block of code will give us the ability to simulate a disk I/O error. This is used for testing the I/O recovery logic.

var Xsqlite3_io_error_pending int32 = 0 /* sqlite3.c:22992:16 */ // Count down to first I/O error
var Xsqlite3_io_error_persist int32 = 0 /* sqlite3.c:22993:16 */ // True if I/O errors persist
var Xsqlite3_like_count int32 = 0 /* sqlite3.c:117880:16 */

Count the number of times that the LIKE operator (or GLOB which is just a variation of LIKE) gets called. This is used for testing only.

var Xsqlite3_max_blobsize int32 = 0 /* sqlite3.c:85319:16 */

The next global variable records the size of the largest MEM_Blob or MEM_Str that has been used by a VDBE opcode. The test procedures use this information to make sure that the zero-blob functionality is working correctly. This variable has no function other than to help verify the correct operation of the library.

var Xsqlite3_memdebug_vfs_oom_test int32 = 1 /* sqlite3.c:23031:16 */

The default SQLite sqlite3_vfs implementations do not allocate memory (actually, os_unix.c allocates a small amount of memory from within OsOpen()), but some third-party implementations may. So we test the effects of a malloc() failing and the sqlite3OsXXX() function returning SQLITE_IOERR_NOMEM using the DO_OS_MALLOC_TEST macro.

The following functions are instrumented for malloc() failure testing:

sqlite3OsRead()
sqlite3OsWrite()
sqlite3OsSync()
sqlite3OsFileSize()
sqlite3OsLock()
sqlite3OsCheckReservedLock()
sqlite3OsFileControl()
sqlite3OsShmMap()
sqlite3OsOpen()
sqlite3OsDelete()
sqlite3OsAccess()
sqlite3OsFullPathname()
var Xsqlite3_open_file_count int32 = 0 /* sqlite3.c:23003:16 */

When testing, also keep a count of the number of open files.

var Xsqlite3_opentemp_count int32 = 0 /* sqlite3.c:55290:16 */

The following global variable is incremented whenever the library attempts to open a temporary file. This information is used for testing and analysis only.

var Xsqlite3_pager_readdb_count int32 = 0 /* sqlite3.c:52426:16 */ // Number of full pages read from DB

The following global variables hold counters used for testing purposes only. These variables do not exist in a non-testing build. These variables are not thread-safe.

var Xsqlite3_pager_writedb_count int32 = 0 /* sqlite3.c:52427:16 */ // Number of full pages written to DB
var Xsqlite3_pager_writej_count int32 = 0 /* sqlite3.c:52428:16 */ // Number of pages written to journal
var Xsqlite3_search_count int32 = 0 /* sqlite3.c:85285:16 */

The following global variable is incremented every time a cursor moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test procedures use this information to make sure that indices are working correctly. This variable has no function other than to help verify the correct operation of the library.

var Xsqlite3_sort_count int32 = 0 /* sqlite3.c:85308:16 */

The next global variable is incremented each type the OP_Sort opcode is executed. The test procedures use this information to make sure that sorting is occurring or not occurring at appropriate times. This variable has no function other than to help verify the correct operation of the library.

var Xsqlite3_sync_count int32 = 0 /* sqlite3.c:37078:16 */

Count the number of fullsyncs and normal syncs. This is used to test that syncs and fullsyncs are occurring at the right times.

var Xsqlite3_temp_directory uintptr = uintptr(0) /* sqlite3.c:161160:17 */

If the following global variable points to a string which is the name of a directory, then that directory will be used to store temporary files.

See also the "PRAGMA temp_store_directory" SQL command.

var Xsqlite3_version = *(*[7]int8)(unsafe.Pointer(ts + 337)) /* sqlite3.c:1210:23 */

CAPI3REF: Run-Time Library Version Numbers KEYWORDS: sqlite3_version sqlite3_sourceid

These interfaces provide the same information as the [SQLITE_VERSION], [SQLITE_VERSION_NUMBER], and [SQLITE_SOURCE_ID] C preprocessor macros but are associated with the library instead of the header file. ^(Cautious programmers might include assert() statements in their application to verify that values returned by these interfaces match the macros in the header, and thus ensure that the application is compiled with matching library and header files.

assert( sqlite3_libversion_number()==SQLITE_VERSION_NUMBER );
assert( strncmp(sqlite3_sourceid(),SQLITE_SOURCE_ID,80)==0 );
assert( strcmp(sqlite3_libversion(),SQLITE_VERSION)==0 );

^The sqlite3_version[] string constant contains the text of [SQLITE_VERSION] macro. ^The sqlite3_libversion() function returns a pointer to the to the sqlite3_version[] string constant. The sqlite3_libversion() function is provided for use in DLLs since DLL users usually do not have direct access to string constants within the DLL. ^The sqlite3_libversion_number() function returns an integer equal to [SQLITE_VERSION_NUMBER]. ^(The sqlite3_sourceid() function returns a pointer to a string constant whose value is the same as the [SQLITE_SOURCE_ID] C preprocessor macro. Except if SQLite is built using an edited copy of [the amalgamation], then the last four characters of the hash might be different from [SQLITE_SOURCE_ID].)^

See also: [sqlite_version()] and [sqlite_source_id()].

var Xsqlite3_xferopt_count int32 /* sqlite3.c:122998:16: */

The following global variable is incremented whenever the transfer optimization is used. This is used for testing purposes only - to make sure the transfer optimization really is happening when it is supposed to.

func X__ccgo_sqlite3_log Uses

func X__ccgo_sqlite3_log(t *libc.TLS, iErrCode int32, zFormat uintptr, va uintptr)

Format and write a message to the log if logging is enabled.

func Xdisable_simulated_io_errors Uses

func Xdisable_simulated_io_errors(tls *libc.TLS)

func Xenable_simulated_io_errors Uses

func Xenable_simulated_io_errors(tls *libc.TLS)

func XrbuVacuumIndexStart Uses

func XrbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) uintptr

This function is called as part of restating an RBU vacuum when the current operation is writing content to an index. If possible, it queries the target index b-tree for the largest key already written to it, then composes and returns an expression that can be used in a WHERE clause to select the remaining required rows from the source table. It is only possible to return such an expression if:

* The index contains no DESC columns, and
* The last key written to the index before the operation was
  suspended does not contain any NULL values.

The expression is of the form:

(index-field1, index-field2, ...) > (?, ?, ...)

except that the "?" placeholders are replaced with literal values.

If the expression cannot be created, NULL is returned. In this case, the caller has to use an OFFSET clause to extract only the required rows from the sourct table, just as it does for an RBU update operation.

func Xsqlite3AbsInt32 Uses

func Xsqlite3AbsInt32(tls *libc.TLS, x int32) int32

Compute the absolute value of a 32-bit signed integer, of possible. Or if the integer has a value of -2147483648, return +2147483647

func Xsqlite3AddCheckConstraint Uses

func Xsqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintptr)

Add a new CHECK constraint to the table currently under construction.

func Xsqlite3AddCollateType Uses

func Xsqlite3AddCollateType(tls *libc.TLS, pParse uintptr, pToken uintptr)

Set the collation function of the most recently parsed table column to the CollSeq given.

func Xsqlite3AddColumn Uses

func Xsqlite3AddColumn(tls *libc.TLS, pParse uintptr, pName uintptr, pType uintptr)

Add a new column to the table currently being constructed.

The parser calls this routine once for each column declaration in a CREATE TABLE statement. sqlite3StartTable() gets called first to get things going. Then this routine is called for each column.

func Xsqlite3AddDefaultValue Uses

func Xsqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStart uintptr, zEnd uintptr)

The expression is the default value for the most recently added column of the table currently under construction.

Default value expressions must be constant. Raise an exception if this is not the case.

This routine is called by the parser while in the middle of parsing a CREATE TABLE statement.

func Xsqlite3AddGenerated Uses

func Xsqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType uintptr)

Change the most recently parsed column to be a GENERATED ALWAYS AS column.

func Xsqlite3AddInt64 Uses

func Xsqlite3AddInt64(tls *libc.TLS, pA uintptr, iB I64) int32

Attempt to add, substract, or multiply the 64-bit signed value iB against the other 64-bit signed integer at *pA and store the result in *pA. Return 0 on success. Or if the operation would have resulted in an overflow, leave *pA unchanged and return 1.

func Xsqlite3AddNotNull Uses

func Xsqlite3AddNotNull(tls *libc.TLS, pParse uintptr, onError int32)

This routine is called by the parser while in the middle of parsing a CREATE TABLE statement. A "NOT NULL" constraint has been seen on a column. This routine sets the notNull flag on the column currently under construction.

func Xsqlite3AddPrimaryKey Uses

func Xsqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError int32, autoInc int32, sortOrder int32)

Designate the PRIMARY KEY for the table. pList is a list of names of columns that form the primary key. If pList is NULL, then the most recently added column of the table is the primary key.

A table can have at most one primary key. If the table already has a primary key (and this is the second primary key) then create an error.

If the PRIMARY KEY is on a single column whose datatype is INTEGER, then we will try to use that column as the rowid. Set the Table.iPKey field of the table under construction to be the index of the INTEGER PRIMARY KEY column. Table.iPKey is set to -1 if there is no INTEGER PRIMARY KEY.

If the key is not an INTEGER PRIMARY KEY, then create a unique index for the key. No index is created for INTEGER PRIMARY KEYs.

func Xsqlite3AffinityType Uses

func Xsqlite3AffinityType(tls *libc.TLS, zIn uintptr, pCol uintptr) int8

Scan the column type name zType (length nType) and return the associated affinity type.

This routine does a case-independent search of zType for the substrings in the following table. If one of the substrings is found, the corresponding affinity is returned. If zType contains more than one of the substrings, entries toward the top of the table take priority. For example, if zType is 'BLOBINT', SQLITE_AFF_INTEGER is returned.

Substring | Affinity -------------------------------- 'INT' | SQLITE_AFF_INTEGER 'CHAR' | SQLITE_AFF_TEXT 'CLOB' | SQLITE_AFF_TEXT 'TEXT' | SQLITE_AFF_TEXT 'BLOB' | SQLITE_AFF_BLOB 'REAL' | SQLITE_AFF_REAL 'FLOA' | SQLITE_AFF_REAL 'DOUB' | SQLITE_AFF_REAL

If none of the substrings in the above table are found, SQLITE_AFF_NUMERIC is returned.

func Xsqlite3AggInfoPersistWalkerInit Uses

func Xsqlite3AggInfoPersistWalkerInit(tls *libc.TLS, pWalker uintptr, pParse uintptr)

Initialize a Walker object so that will persist AggInfo entries referenced by the tree that is walked.

func Xsqlite3AllocateIndexObject Uses

func Xsqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol I16, nExtra int32, ppExtra uintptr) uintptr

Allocate heap space to hold an Index object with nCol columns.

Increase the allocation size to provide an extra nExtra bytes of 8-byte aligned space after the Index object and return a pointer to this extra space in *ppExtra.

func Xsqlite3AlterBeginAddColumn Uses

func Xsqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr)

This function is called by the parser after the table-name in an "ALTER TABLE <table-name> ADD" statement is parsed. Argument pSrc is the full-name of the table being altered.

This routine makes a (partial) copy of the Table structure for the table being altered and sets Parse.pNewTable to point to it. Routines called by the parser as the column definition is parsed (i.e. sqlite3AddColumn()) add the new Column data to the copy. The copy of the Table structure is deleted by tokenize.c after parsing is finished.

Routine sqlite3AlterFinishAddColumn() will be called to complete coding the "ALTER TABLE ... ADD" statement.

func Xsqlite3AlterFinishAddColumn Uses

func Xsqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr)

This function is called after an "ALTER TABLE ... ADD" statement has been parsed. Argument pColDef contains the text of the new column definition.

The Table structure pParse->pNewTable was extended to include the new column during parsing.

func Xsqlite3AlterFunctions Uses

func Xsqlite3AlterFunctions(tls *libc.TLS)

Register built-in functions used to help implement ALTER TABLE

func Xsqlite3AlterRenameColumn Uses

func Xsqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld uintptr, pNew uintptr)

Handles the following parser reduction:

cmd ::= ALTER TABLE pSrc RENAME COLUMN pOld TO pNew

func Xsqlite3AlterRenameTable Uses

func Xsqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName uintptr)

Generate code to implement the "ALTER TABLE xxx RENAME TO yyy" command.

func Xsqlite3AnalysisLoad Uses

func Xsqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) int32

Load the content of the sqlite_stat1 and sqlite_stat4 tables. The contents of sqlite_stat1 are used to populate the Index.aiRowEst[] arrays. The contents of sqlite_stat4 are used to populate the Index.aSample[] arrays.

If the sqlite_stat1 table is not present in the database, SQLITE_ERROR is returned. In this case, even if SQLITE_ENABLE_STAT4 was defined during compilation and the sqlite_stat4 table is present, no data is read from it.

If SQLITE_ENABLE_STAT4 was defined during compilation and the sqlite_stat4 table is not present in the database, SQLITE_ERROR is returned. However, in this case, data is read from the sqlite_stat1 table (if it is present) before returning.

If an OOM error occurs, this function always sets db->mallocFailed. This means if the caller does not care about other errors, the return code may be ignored.

func Xsqlite3Analyze Uses

func Xsqlite3Analyze(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr)

Generate code for the ANALYZE command. The parser calls this routine when it recognizes an ANALYZE command.

ANALYZE                            -- 1
ANALYZE  <database>                -- 2
ANALYZE  ?<database>.?<tablename>  -- 3

Form 1 causes all indices in all attached databases to be analyzed. Form 2 analyzes all indices the single database named. Form 3 analyzes all indices associated with the named table.

func Xsqlite3ApiExit Uses

func Xsqlite3ApiExit(tls *libc.TLS, db uintptr, rc int32) int32

This function must be called before exiting any API function (i.e. returning control to the user) that has called sqlite3_malloc or sqlite3_realloc.

The returned value is normally a copy of the second argument to this function. However, if a malloc() failure has occurred since the previous invocation SQLITE_NOMEM is returned instead.

If an OOM as occurred, then the connection error-code (the value returned by sqlite3_errcode()) is set to SQLITE_NOMEM.

func Xsqlite3ArrayAllocate Uses

func Xsqlite3ArrayAllocate(tls *libc.TLS, db uintptr, pArray uintptr, szEntry int32, pnEntry uintptr, pIdx uintptr) uintptr

pArray is a pointer to an array of objects. Each object in the array is szEntry bytes in size. This routine uses sqlite3DbRealloc() to extend the array so that there is space for a new object at the end.

When this function is called, *pnEntry contains the current size of the array (in entries - so the allocation is ((*pnEntry) * szEntry) bytes in total).

If the realloc() is successful (i.e. if no OOM condition occurs), the space allocated for the new object is zeroed, *pnEntry updated to reflect the new size of the array and a pointer to the new allocation returned. *pIdx is set to the index of the new array entry in this case.

Otherwise, if the realloc() fails, *pIdx is set to -1, *pnEntry remains unchanged and a copy of pArray returned.

func Xsqlite3AtoF Uses

func Xsqlite3AtoF(tls *libc.TLS, z uintptr, pResult uintptr, length int32, enc U8) int32

The string z[] is an text representation of a real number. Convert this string to a double and write it into *pResult.

The string z[] is length bytes in length (bytes, not characters) and uses the encoding enc. The string is not necessarily zero-terminated.

Return TRUE if the result is a valid real number (or integer) and FALSE if the string is empty or contains extraneous text. More specifically return

 1          =>  The input string is a pure integer
 2 or more  =>  The input has a decimal point or eNNN clause
 0 or less  =>  The input string is not a valid number
-1          =>  Not a valid number, but has a valid prefix which
                includes a decimal point and/or an eNNN clause

Valid numbers are in one of these formats:

[+-]digits[E[+-]digits]
[+-]digits.[digits][E[+-]digits]
[+-].digits[E[+-]digits]

Leading and trailing whitespace is ignored for the purpose of determining validity.

If some prefix of the input string is a valid number, this routine returns FALSE but it still converts the prefix and writes the result into *pResult.

func Xsqlite3Atoi Uses

func Xsqlite3Atoi(tls *libc.TLS, z uintptr) int32

Return a 32-bit integer value extracted from a string. If the string is not an integer, just return 0.

func Xsqlite3Atoi64 Uses

func Xsqlite3Atoi64(tls *libc.TLS, zNum uintptr, pNum uintptr, length int32, enc U8) int32

Convert zNum to a 64-bit signed integer. zNum must be decimal. This routine does *not* accept hexadecimal notation.

Returns:

-1    Not even a prefix of the input text looks like an integer
 0    Successful transformation.  Fits in a 64-bit signed integer.
 1    Excess non-space text after the integer value
 2    Integer too large for a 64-bit signed integer or is malformed
 3    Special case of 9223372036854775808

length is the number of bytes in the string (bytes, not characters). The string is not necessarily zero-terminated. The encoding is given by enc.

func Xsqlite3Attach Uses

func Xsqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, pKey uintptr)

Called by the parser to compile an ATTACH statement.

ATTACH p AS pDbname KEY pKey

func Xsqlite3AuthCheck Uses

func Xsqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, zArg2 uintptr, zArg3 uintptr) int32

Do an authorization check using the code and arguments given. Return either SQLITE_OK (zero) or SQLITE_IGNORE or SQLITE_DENY. If SQLITE_DENY is returned, then the error count and error message in pParse are modified appropriately.

func Xsqlite3AuthContextPop Uses

func Xsqlite3AuthContextPop(tls *libc.TLS, pContext uintptr)

Pop an authorization context that was previously pushed by sqlite3AuthContextPush

func Xsqlite3AuthContextPush Uses

func Xsqlite3AuthContextPush(tls *libc.TLS, pParse uintptr, pContext uintptr, zContext uintptr)

Push an authorization context. After this routine is called, the zArg3 argument to authorization callbacks will be zContext until popped. Or if pParse==0, this routine is a no-op.

func Xsqlite3AuthRead Uses

func Xsqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uintptr, pTabList uintptr)

The pExpr should be a TK_COLUMN expression. The table referred to is in pTabList or else it is the NEW or OLD table of a trigger. Check to see if it is OK to read this particular column.

If the auth function returns SQLITE_IGNORE, change the TK_COLUMN instruction into a TK_NULL. If the auth function returns SQLITE_DENY, then generate an error.

func Xsqlite3AuthReadCol Uses

func Xsqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintptr, iDb int32) int32

Invoke the authorization callback for permission to read column zCol from table zTab in database zDb. This function assumes that an authorization callback has been registered (i.e. that sqlite3.xAuth is not NULL).

If SQLITE_IGNORE is returned and pExpr is not NULL, then pExpr is changed to an SQL NULL expression. Otherwise, if pExpr is NULL, then SQLITE_IGNORE is treated as SQLITE_DENY. In this case an error is left in pParse.

func Xsqlite3AutoLoadExtensions Uses

func Xsqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr)

Load all automatic extensions.

If anything goes wrong, set an error in the database connection.

func Xsqlite3AutoincrementBegin Uses

func Xsqlite3AutoincrementBegin(tls *libc.TLS, pParse uintptr)

This routine generates code that will initialize all of the register used by the autoincrement tracker.

func Xsqlite3AutoincrementEnd Uses

func Xsqlite3AutoincrementEnd(tls *libc.TLS, pParse uintptr)

func Xsqlite3BackupRestart Uses

func Xsqlite3BackupRestart(tls *libc.TLS, pBackup uintptr)

Restart the backup process. This is called when the pager layer detects that the database has been modified by an external database connection. In this case there is no way of knowing which of the pages that have been copied into the destination database are still valid and which are not, so the entire process needs to be restarted.

It is assumed that the mutex associated with the BtShared object corresponding to the source database is held when this function is called.

func Xsqlite3BackupUpdate Uses

func Xsqlite3BackupUpdate(tls *libc.TLS, pBackup uintptr, iPage Pgno, aData uintptr)

func Xsqlite3BeginBenignMalloc Uses

func Xsqlite3BeginBenignMalloc(tls *libc.TLS)

This (sqlite3EndBenignMalloc()) is called by SQLite code to indicate that subsequent malloc failures are benign. A call to sqlite3EndBenignMalloc() indicates that subsequent malloc failures are non-benign.

func Xsqlite3BeginTransaction Uses

func Xsqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32)

Generate VDBE code for a BEGIN statement.

func Xsqlite3BeginTrigger Uses

func Xsqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, tr_tm int32, op int32, pColumns uintptr, pTableName uintptr, pWhen uintptr, isTemp int32, noErr int32)

This is called by the parser when it sees a CREATE TRIGGER statement up to the point of the BEGIN before the trigger actions. A Trigger structure is generated based on the information available and stored in pParse->pNewTrigger. After the trigger actions have been parsed, the sqlite3FinishTrigger() function is called to complete the trigger construction process.

func Xsqlite3BeginWriteOperation Uses

func Xsqlite3BeginWriteOperation(tls *libc.TLS, pParse uintptr, setStatement int32, iDb int32)

Generate VDBE code that prepares for doing an operation that might change the database.

This routine starts a new transaction if we are not already within a transaction. If we are already within a transaction, then a checkpoint is set if the setStatement parameter is true. A checkpoint should be set for operations that might fail (due to a constraint) part of the way through and which will need to undo some writes without having to rollback the whole transaction. For operations where all constraints can be checked before any changes are made to the database, it is never necessary to undo a write and the checkpoint should not be set.

func Xsqlite3BenignMallocHooks Uses

func Xsqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr)

Register hooks to call when sqlite3BeginBenignMalloc() and sqlite3EndBenignMalloc() are called, respectively.

func Xsqlite3BinaryCompareCollSeq Uses

func Xsqlite3BinaryCompareCollSeq(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr

Return a pointer to the collation sequence that should be used by a binary comparison operator comparing pLeft and pRight.

If the left hand expression has a collating sequence type, then it is used. Otherwise the collation sequence for the right hand expression is used, or the default (BINARY) if neither expression has a collating type.

Argument pRight (but not pLeft) may be a null pointer. In this case, it is not considered.

func Xsqlite3BitvecBuiltinTest Uses

func Xsqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) int32

This routine runs an extensive test of the Bitvec code.

The input is an array of integers that acts as a program to test the Bitvec. The integers are opcodes followed by 0, 1, or 3 operands, depending on the opcode. Another opcode follows immediately after the last operand.

There are 6 opcodes numbered from 0 through 5. 0 is the "halt" opcode and causes the test to end.

0          Halt and return the number of errors
1 N S X    Set N bits beginning with S and incrementing by X
2 N S X    Clear N bits beginning with S and incrementing by X
3 N        Set N randomly chosen bits
4 N        Clear N randomly chosen bits
5 N S X    Set N bits from S increment X in array only, not in bitvec

The opcodes 1 through 4 perform set and clear operations are performed on both a Bitvec object and on a linear array of bits obtained from malloc. Opcode 5 works on the linear array only, not on the Bitvec. Opcode 5 is used to deliberately induce a fault in order to confirm that error detection works.

At the conclusion of the test the linear array is compared against the Bitvec object. If there are any differences, an error is returned. If they are the same, zero is returned.

If a memory allocation error occurs, return -1.

func Xsqlite3BitvecClear Uses

func Xsqlite3BitvecClear(tls *libc.TLS, p uintptr, i U32, pBuf uintptr)

Clear the i-th bit.

pBuf must be a pointer to at least BITVEC_SZ bytes of temporary storage that BitvecClear can use to rebuilt its hash table.

func Xsqlite3BitvecCreate Uses

func Xsqlite3BitvecCreate(tls *libc.TLS, iSize U32) uintptr

Create a new bitmap object able to handle bits between 0 and iSize, inclusive. Return a pointer to the new object. Return NULL if malloc fails.

func Xsqlite3BitvecDestroy Uses

func Xsqlite3BitvecDestroy(tls *libc.TLS, p uintptr)

Destroy a bitmap object. Reclaim all memory used.

func Xsqlite3BitvecSet Uses

func Xsqlite3BitvecSet(tls *libc.TLS, p uintptr, i U32) int32

Set the i-th bit. Return 0 on success and an error code if anything goes wrong.

This routine might cause sub-bitmaps to be allocated. Failing to get the memory needed to hold the sub-bitmap is the only that can go wrong with an insert, assuming p and i are valid.

The calling function must ensure that p is a valid Bitvec object and that the value for "i" is within range of the Bitvec object. Otherwise the behavior is undefined.

func Xsqlite3BitvecTest Uses

func Xsqlite3BitvecTest(tls *libc.TLS, p uintptr, i U32) int32

func Xsqlite3BitvecTestNotNull Uses

func Xsqlite3BitvecTestNotNull(tls *libc.TLS, p uintptr, i U32) int32

Check to see if the i-th bit is set. Return true or false. If p is NULL (if the bitmap has not been created) or if i is out of range, then return false.

func Xsqlite3BlobCompare Uses

func Xsqlite3BlobCompare(tls *libc.TLS, pB1 uintptr, pB2 uintptr) int32

Compare two blobs. Return negative, zero, or positive if the first is less than, equal to, or greater than the second, respectively. If one blob is a prefix of the other, then the shorter is the lessor.

func Xsqlite3BtreeBeginStmt Uses

func Xsqlite3BtreeBeginStmt(tls *libc.TLS, p uintptr, iStatement int32) int32

Start a statement subtransaction. The subtransaction can be rolled back independently of the main transaction. You must start a transaction before starting a subtransaction. The subtransaction is ended automatically if the main transaction commits or rolls back.

Statement subtransactions are used around individual SQL statements that are contained within a BEGIN...COMMIT block. If a constraint error occurs within the statement, the effect of that one statement can be rolled back without having to rollback the entire transaction.

A statement sub-transaction is implemented as an anonymous savepoint. The value passed as the second parameter is the total number of savepoints, including the new anonymous savepoint, open on the B-Tree. i.e. if there are no active savepoints and no other statement-transactions open, iStatement is 1. This anonymous savepoint can be released or rolled back using the sqlite3BtreeSavepoint() function.

func Xsqlite3BtreeBeginTrans Uses

func Xsqlite3BtreeBeginTrans(tls *libc.TLS, p uintptr, wrflag int32, pSchemaVersion uintptr) int32

Attempt to start a new transaction. A write-transaction is started if the second argument is nonzero, otherwise a read- transaction. If the second argument is 2 or more and exclusive transaction is started, meaning that no other process is allowed to access the database. A preexisting transaction may not be upgraded to exclusive by calling this routine a second time - the exclusivity flag only works for a new transaction.

A write-transaction must be started before attempting any changes to the database. None of the following routines will work unless a transaction is started first:

sqlite3BtreeCreateTable()
sqlite3BtreeCreateIndex()
sqlite3BtreeClearTable()
sqlite3BtreeDropTable()
sqlite3BtreeInsert()
sqlite3BtreeDelete()
sqlite3BtreeUpdateMeta()

If an initial attempt to acquire the lock fails because of lock contention and the database was previously unlocked, then invoke the busy handler if there is one. But if there was previously a read-lock, do not invoke the busy handler - just return SQLITE_BUSY. SQLITE_BUSY is returned when there is already a read-lock in order to avoid a deadlock.

Suppose there are two processes A and B. A has a read lock and B has a reserved lock. B tries to promote to exclusive but is blocked because of A's read lock. A tries to promote to reserved but is blocked by B. One or the other of the two processes must give way or there can be no progress. By returning SQLITE_BUSY and not invoking the busy callback when A already has a read lock, we encourage A to give up and let B proceed.

func Xsqlite3BtreeCheckpoint Uses

func Xsqlite3BtreeCheckpoint(tls *libc.TLS, p uintptr, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

Run a checkpoint on the Btree passed as the first argument.

Return SQLITE_LOCKED if this or any other connection has an open transaction on the shared-cache the argument Btree is connected to.

Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.

func Xsqlite3BtreeClearCursor Uses

func Xsqlite3BtreeClearCursor(tls *libc.TLS, pCur uintptr)

Clear the current cursor position.

func Xsqlite3BtreeClearTable Uses

func Xsqlite3BtreeClearTable(tls *libc.TLS, p uintptr, iTable int32, pnChange uintptr) int32

Delete all information from a single table in the database. iTable is the page number of the root of the table. After this routine returns, the root page is empty, but still exists.

This routine will fail with SQLITE_LOCKED if there are any open read cursors on the table. Open write cursors are moved to the root of the table.

If pnChange is not NULL, then table iTable must be an intkey table. The integer value pointed to by pnChange is incremented by the number of entries in the table.

func Xsqlite3BtreeClearTableOfCursor Uses

func Xsqlite3BtreeClearTableOfCursor(tls *libc.TLS, pCur uintptr) int32

Delete all information from the single table that pCur is open on.

This routine only work for pCur on an ephemeral table.

func Xsqlite3BtreeClose Uses

func Xsqlite3BtreeClose(tls *libc.TLS, p uintptr) int32

Close an open database and invalidate all cursors.

func Xsqlite3BtreeCloseCursor Uses

func Xsqlite3BtreeCloseCursor(tls *libc.TLS, pCur uintptr) int32

Close a cursor. The read lock on the database file is released when the last cursor is closed.

func Xsqlite3BtreeCommit Uses

func Xsqlite3BtreeCommit(tls *libc.TLS, p uintptr) int32

Do both phases of a commit.

func Xsqlite3BtreeCommitPhaseOne Uses

func Xsqlite3BtreeCommitPhaseOne(tls *libc.TLS, p uintptr, zSuperJrnl uintptr) int32

This routine does the first phase of a two-phase commit. This routine causes a rollback journal to be created (if it does not already exist) and populated with enough information so that if a power loss occurs the database can be restored to its original state by playing back the journal. Then the contents of the journal are flushed out to the disk. After the journal is safely on oxide, the changes to the database are written into the database file and flushed to oxide. At the end of this call, the rollback journal still exists on the disk and we are still holding all locks, so the transaction has not committed. See sqlite3BtreeCommitPhaseTwo() for the second phase of the commit process.

This call is a no-op if no write-transaction is currently active on pBt.

Otherwise, sync the database file for the btree pBt. zSuperJrnl points to the name of a super-journal file that should be written into the individual journal file, or is NULL, indicating no super-journal file (single database transaction).

When this is called, the super-journal should already have been created, populated with this journal pointer and synced to disk.

Once this is routine has returned, the only thing required to commit the write-transaction for this database file is to delete the journal.

func Xsqlite3BtreeCommitPhaseTwo Uses

func Xsqlite3BtreeCommitPhaseTwo(tls *libc.TLS, p uintptr, bCleanup int32) int32

Commit the transaction currently in progress.

This routine implements the second phase of a 2-phase commit. The sqlite3BtreeCommitPhaseOne() routine does the first phase and should be invoked prior to calling this routine. The sqlite3BtreeCommitPhaseOne() routine did all the work of writing information out to disk and flushing the contents so that they are written onto the disk platter. All this routine has to do is delete or truncate or zero the header in the the rollback journal (which causes the transaction to commit) and drop locks.

Normally, if an error occurs while the pager layer is attempting to finalize the underlying journal file, this function returns an error and the upper layer will attempt a rollback. However, if the second argument is non-zero then this b-tree transaction is part of a multi-file transaction. In this case, the transaction has already been committed (by deleting a super-journal file) and the caller will ignore this functions return code. So, even if an error occurs in the pager layer, reset the b-tree objects internal state to indicate that the write transaction has been closed. This is quite safe, as the pager will have transitioned to the error state.

This will release the write lock on the database file. If there are no active cursors, it also releases the read lock.

func Xsqlite3BtreeConnectionCount Uses

func Xsqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) int32

Return the number of connections to the BtShared object accessed by the Btree handle passed as the only argument. For private caches this is always 1. For shared caches it may be 1 or greater.

func Xsqlite3BtreeCopyFile Uses

func Xsqlite3BtreeCopyFile(tls *libc.TLS, pTo uintptr, pFrom uintptr) int32

Copy the complete content of pBtFrom into pBtTo. A transaction must be active for both files.

The size of file pTo may be reduced by this operation. If anything goes wrong, the transaction on pTo is rolled back. If successful, the transaction is committed before returning.

func Xsqlite3BtreeCount Uses

func Xsqlite3BtreeCount(tls *libc.TLS, db uintptr, pCur uintptr, pnEntry uintptr) int32

The first argument, pCur, is a cursor opened on some b-tree. Count the number of entries in the b-tree and write the result to *pnEntry.

SQLITE_OK is returned if the operation is successfully executed. Otherwise, if an error is encountered (i.e. an IO error or database corruption) an SQLite error code is returned.

func Xsqlite3BtreeCreateTable Uses

func Xsqlite3BtreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, flags int32) int32

func Xsqlite3BtreeCursor Uses

func Xsqlite3BtreeCursor(tls *libc.TLS, p uintptr, iTable Pgno, wrFlag int32, pKeyInfo uintptr, pCur uintptr) int32

func Xsqlite3BtreeCursorHasHint Uses

func Xsqlite3BtreeCursorHasHint(tls *libc.TLS, pCsr uintptr, mask uint32) int32

Return true if the cursor has a hint specified. This routine is only used from within assert() statements

func Xsqlite3BtreeCursorHasMoved Uses

func Xsqlite3BtreeCursorHasMoved(tls *libc.TLS, pCur uintptr) int32

Determine whether or not a cursor has moved from the position where it was last placed, or has been invalidated for any other reason. Cursors can move when the row they are pointing at is deleted out from under them, for example. Cursor might also move if a btree is rebalanced.

Calling this routine with a NULL cursor pointer returns false.

Use the separate sqlite3BtreeCursorRestore() routine to restore a cursor back to where it ought to be if this routine returns true.

func Xsqlite3BtreeCursorHintFlags Uses

func Xsqlite3BtreeCursorHintFlags(tls *libc.TLS, pCur uintptr, x uint32)

Provide flag hints to the cursor.

func Xsqlite3BtreeCursorIsValidNN Uses

func Xsqlite3BtreeCursorIsValidNN(tls *libc.TLS, pCur uintptr) int32

func Xsqlite3BtreeCursorPin Uses

func Xsqlite3BtreeCursorPin(tls *libc.TLS, pCur uintptr)

Pin or unpin a cursor.

func Xsqlite3BtreeCursorRestore Uses

func Xsqlite3BtreeCursorRestore(tls *libc.TLS, pCur uintptr, pDifferentRow uintptr) int32

This routine restores a cursor back to its original position after it has been moved by some outside activity (such as a btree rebalance or a row having been deleted out from under the cursor).

On success, the *pDifferentRow parameter is false if the cursor is left pointing at exactly the same row. *pDifferntRow is the row the cursor was pointing to has been deleted, forcing the cursor to point to some nearby row.

This routine should only be called for a cursor that just returned TRUE from sqlite3BtreeCursorHasMoved().

func Xsqlite3BtreeCursorSize Uses

func Xsqlite3BtreeCursorSize(tls *libc.TLS) int32

Return the size of a BtCursor object in bytes.

This interfaces is needed so that users of cursors can preallocate sufficient storage to hold a cursor. The BtCursor object is opaque to users so they cannot do the sizeof() themselves - they must call this routine.

func Xsqlite3BtreeCursorUnpin Uses

func Xsqlite3BtreeCursorUnpin(tls *libc.TLS, pCur uintptr)

func Xsqlite3BtreeCursorZero Uses

func Xsqlite3BtreeCursorZero(tls *libc.TLS, p uintptr)

Initialize memory that will be converted into a BtCursor object.

The simple approach here would be to memset() the entire object to zero. But it turns out that the apPage[] and aiIdx[] arrays do not need to be zeroed and they are large, so we can save a lot of run-time by skipping the initialization of those elements.

func Xsqlite3BtreeDelete Uses

func Xsqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags U8) int32

Delete the entry that the cursor is pointing to.

If the BTREE_SAVEPOSITION bit of the flags parameter is zero, then the cursor is left pointing at an arbitrary location after the delete. But if that bit is set, then the cursor is left in a state such that the next call to BtreeNext() or BtreePrev() moves it to the same row as it would have been on if the call to BtreeDelete() had been omitted.

The BTREE_AUXDELETE bit of flags indicates that is one of several deletes associated with a single table entry and its indexes. Only one of those deletes is considered the "primary" delete. The primary delete occurs on a cursor that is not a BTREE_FORDELETE cursor. All but one delete operation on non-FORDELETE cursors is tagged with the AUXDELETE flag. The BTREE_AUXDELETE bit is a hint that is not used by this implementation, but which might be used by alternative storage engines.

func Xsqlite3BtreeDropTable Uses

func Xsqlite3BtreeDropTable(tls *libc.TLS, p uintptr, iTable int32, piMoved uintptr) int32

func Xsqlite3BtreeEnter Uses

func Xsqlite3BtreeEnter(tls *libc.TLS, p uintptr)

Enter a mutex on the given BTree object.

If the object is not sharable, then no mutex is ever required and this routine is a no-op. The underlying mutex is non-recursive. But we keep a reference count in Btree.wantToLock so the behavior of this interface is recursive.

To avoid deadlocks, multiple Btrees are locked in the same order by all database connections. The p->pNext is a list of other Btrees belonging to the same database connection as the p Btree which need to be locked after p. If we cannot get a lock on p, then first unlock all of the others on p->pNext, then wait for the lock to become available on p, then relock all of the subsequent Btrees that desire a lock.

func Xsqlite3BtreeEnterAll Uses

func Xsqlite3BtreeEnterAll(tls *libc.TLS, db uintptr)

func Xsqlite3BtreeEnterCursor Uses

func Xsqlite3BtreeEnterCursor(tls *libc.TLS, pCur uintptr)

Enter a mutex on a Btree given a cursor owned by that Btree.

These entry points are used by incremental I/O only. Enter() is required any time OMIT_SHARED_CACHE is not defined, regardless of whether or not the build is threadsafe. Leave() is only required by threadsafe builds.

func Xsqlite3BtreeEof Uses

func Xsqlite3BtreeEof(tls *libc.TLS, pCur uintptr) int32

Return TRUE if the cursor is not pointing at an entry of the table.

TRUE will be returned after a call to sqlite3BtreeNext() moves past the last entry in the table or sqlite3BtreePrev() moves past the first entry. TRUE is also returned if the table is empty.

func Xsqlite3BtreeFakeValidCursor Uses

func Xsqlite3BtreeFakeValidCursor(tls *libc.TLS) uintptr

Return a pointer to a fake BtCursor object that will always answer false to the sqlite3BtreeCursorHasMoved() routine above. The fake cursor returned must not be used with any other Btree interface.

func Xsqlite3BtreeFirst Uses

func Xsqlite3BtreeFirst(tls *libc.TLS, pCur uintptr, pRes uintptr) int32

Move the cursor to the first entry in the table. Return SQLITE_OK on success. Set *pRes to 0 if the cursor actually points to something or set *pRes to 1 if the table is empty.

func Xsqlite3BtreeGetAutoVacuum Uses

func Xsqlite3BtreeGetAutoVacuum(tls *libc.TLS, p uintptr) int32

Return the value of the 'auto-vacuum' property. If auto-vacuum is enabled 1 is returned. Otherwise 0.

func Xsqlite3BtreeGetFilename Uses

func Xsqlite3BtreeGetFilename(tls *libc.TLS, p uintptr) uintptr

Return the full pathname of the underlying database file. Return an empty string if the database is in-memory or a TEMP database.

The pager filename is invariant as long as the pager is open so it is safe to access without the BtShared mutex.

func Xsqlite3BtreeGetJournalname Uses

func Xsqlite3BtreeGetJournalname(tls *libc.TLS, p uintptr) uintptr

Return the pathname of the journal file for this database. The return value of this routine is the same regardless of whether the journal file has been created or not.

The pager journal filename is invariant as long as the pager is open so it is safe to access without the BtShared mutex.

func Xsqlite3BtreeGetMeta Uses

func Xsqlite3BtreeGetMeta(tls *libc.TLS, p uintptr, idx int32, pMeta uintptr)

This function may only be called if the b-tree connection already has a read or write transaction open on the database.

Read the meta-information out of a database file. Meta[0] is the number of free pages currently in the database. Meta[1] through meta[15] are available for use by higher layers. Meta[0] is read-only, the others are read/write.

The schema layer numbers meta values differently. At the schema layer (and the SetCookie and ReadCookie opcodes) the number of free pages is not visible. So Cookie[0] is the same as Meta[1].

This routine treats Meta[BTREE_DATA_VERSION] as a special case. Instead of reading the value out of the header, it instead loads the "DataVersion" from the pager. The BTREE_DATA_VERSION value is not actually stored in the database file. It is a number computed by the pager. But its access pattern is the same as header meta values, and so it is convenient to read it from this routine.

func Xsqlite3BtreeGetPageSize Uses

func Xsqlite3BtreeGetPageSize(tls *libc.TLS, p uintptr) int32

Return the currently defined page size

func Xsqlite3BtreeGetRequestedReserve Uses

func Xsqlite3BtreeGetRequestedReserve(tls *libc.TLS, p uintptr) int32

Return the number of bytes of space at the end of every page that are intentually left unused. This is the "reserved" space that is sometimes used by extensions.

The value returned is the larger of the current reserve size and the latest reserve size requested by SQLITE_FILECTRL_RESERVE_BYTES. The amount of reserve can only grow - never shrink.

func Xsqlite3BtreeGetReserveNoMutex Uses

func Xsqlite3BtreeGetReserveNoMutex(tls *libc.TLS, p uintptr) int32

This function is similar to sqlite3BtreeGetReserve(), except that it may only be called if it is guaranteed that the b-tree mutex is already held.

This is useful in one special case in the backup API code where it is known that the shared b-tree mutex is held, but the mutex on the database handle that owns *p is not. In this case if sqlite3BtreeEnter() were to be called, it might collide with some other operation on the database handle that owns *p, causing undefined behavior.

func Xsqlite3BtreeIncrVacuum Uses

func Xsqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) int32

A write-transaction must be opened before calling this function. It performs a single unit of work towards an incremental vacuum.

If the incremental vacuum is finished after this function has run, SQLITE_DONE is returned. If it is not finished, but no error occurred, SQLITE_OK is returned. Otherwise an SQLite error code.

func Xsqlite3BtreeIncrblobCursor Uses

func Xsqlite3BtreeIncrblobCursor(tls *libc.TLS, pCur uintptr)

Mark this cursor as an incremental blob cursor.

func Xsqlite3BtreeInsert Uses

func Xsqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, seekResult int32) int32

Insert a new record into the BTree. The content of the new record is described by the pX object. The pCur cursor is used only to define what table the record should be inserted into, and is left pointing at a random location.

For a table btree (used for rowid tables), only the pX.nKey value of the key is used. The pX.pKey value must be NULL. The pX.nKey is the rowid or INTEGER PRIMARY KEY of the row. The pX.nData,pData,nZero fields hold the content of the row.

For an index btree (used for indexes and WITHOUT ROWID tables), the key is an arbitrary byte sequence stored in pX.pKey,nKey. The pX.pData,nData,nZero fields must be zero.

If the seekResult parameter is non-zero, then a successful call to MovetoUnpacked() to seek cursor pCur to (pKey,nKey) has already been performed. In other words, if seekResult!=0 then the cursor is currently pointing to a cell that will be adjacent to the cell to be inserted. If seekResult<0 then pCur points to a cell that is smaller then (pKey,nKey). If seekResult>0 then pCur points to a cell that is larger than (pKey,nKey).

If seekResult==0, that means pCur is pointing at some unknown location. In that case, this routine must seek the cursor to the correct insertion point for (pKey,nKey) before doing the insertion. For index btrees, if pX->nMem is non-zero, then pX->aMem contains pointers to the unpacked key values and pX->aMem can be used instead of pX->pKey to avoid having to decode the key.

func Xsqlite3BtreeIntegrityCheck Uses

func Xsqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uintptr, nRoot int32, mxErr int32, pnErr uintptr) uintptr

This routine does a complete check of the given BTree file. aRoot[] is an array of pages numbers were each page number is the root page of a table. nRoot is the number of entries in aRoot.

A read-only or read-write transaction must be opened before calling this function.

Write the number of error seen in *pnErr. Except for some memory allocation errors, an error message held in memory obtained from malloc is returned if *pnErr is non-zero. If *pnErr==0 then NULL is returned. If a memory allocation error occurs, NULL is returned.

If the first entry in aRoot[] is 0, that indicates that the list of root pages is incomplete. This is a "partial integrity-check". This happens when performing an integrity check on a single table. The zero is skipped, of course. But in addition, the freelist checks and the checks to make sure every page is referenced are also skipped, since obviously it is not possible to know which pages are covered by the unverified btrees. Except, if aRoot[1] is 1, then the freelist checks are still performed.

func Xsqlite3BtreeIsInBackup Uses

func Xsqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) int32

func Xsqlite3BtreeIsInReadTrans Uses

func Xsqlite3BtreeIsInReadTrans(tls *libc.TLS, p uintptr) int32

Return non-zero if a read (or write) transaction is active.

func Xsqlite3BtreeIsInTrans Uses

func Xsqlite3BtreeIsInTrans(tls *libc.TLS, p uintptr) int32

Return non-zero if a transaction is active.

func Xsqlite3BtreeIsReadonly Uses

func Xsqlite3BtreeIsReadonly(tls *libc.TLS, p uintptr) int32

Return true if the given Btree is read-only.

func Xsqlite3BtreeLast Uses

func Xsqlite3BtreeLast(tls *libc.TLS, pCur uintptr, pRes uintptr) int32

Move the cursor to the last entry in the table. Return SQLITE_OK on success. Set *pRes to 0 if the cursor actually points to something or set *pRes to 1 if the table is empty.

func Xsqlite3BtreeLeave Uses

func Xsqlite3BtreeLeave(tls *libc.TLS, p uintptr)

Exit the recursive mutex on a Btree.

func Xsqlite3BtreeLeaveAll Uses

func Xsqlite3BtreeLeaveAll(tls *libc.TLS, db uintptr)

func Xsqlite3BtreeLeaveCursor Uses

func Xsqlite3BtreeLeaveCursor(tls *libc.TLS, pCur uintptr)

func Xsqlite3BtreeLockTable Uses

func Xsqlite3BtreeLockTable(tls *libc.TLS, p uintptr, iTab int32, isWriteLock U8) int32

Obtain a lock on the table whose root page is iTab. The lock is a write lock if isWritelock is true or a read lock if it is false.

func Xsqlite3BtreeMovetoUnpacked Uses

func Xsqlite3BtreeMovetoUnpacked(tls *libc.TLS, pCur uintptr, pIdxKey uintptr, intKey I64, biasRight int32, pRes uintptr) int32

Move the cursor so that it points to an entry near the key specified by pIdxKey or intKey. Return a success code.

For INTKEY tables, the intKey parameter is used. pIdxKey must be NULL. For index tables, pIdxKey is used and intKey is ignored.

If an exact match is not found, then the cursor is always left pointing at a leaf page which would hold the entry if it were present. The cursor might point to an entry that comes before or after the key.

An integer is written into *pRes which is the result of comparing the key with the entry to which the cursor is pointing. The meaning of the integer written into *pRes is as follows:

*pRes<0      The cursor is left pointing at an entry that
             is smaller than intKey/pIdxKey or if the table is empty
             and the cursor is therefore left point to nothing.

*pRes==0     The cursor is left pointing at an entry that
             exactly matches intKey/pIdxKey.

*pRes>0      The cursor is left pointing at an entry that
             is larger than intKey/pIdxKey.

For index tables, the pIdxKey->eqSeen field is set to 1 if there exists an entry in the table that exactly matches pIdxKey.

func Xsqlite3BtreeNewDb Uses

func Xsqlite3BtreeNewDb(tls *libc.TLS, p uintptr) int32

Initialize the first page of the database file (creating a database consisting of a single page and no schema objects). Return SQLITE_OK if successful, or an SQLite error code otherwise.

func Xsqlite3BtreeNext Uses

func Xsqlite3BtreeNext(tls *libc.TLS, pCur uintptr, flags int32) int32

func Xsqlite3BtreeOpen Uses

func Xsqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintptr, ppBtree uintptr, flags int32, vfsFlags int32) int32

Open a database file.

zFilename is the name of the database file. If zFilename is NULL then an ephemeral database is created. The ephemeral database might be exclusively in memory, or it might use a disk-based memory cache. Either way, the ephemeral database will be automatically deleted when sqlite3BtreeClose() is called.

If zFilename is ":memory:" then an in-memory database is created that is automatically destroyed when it is closed.

The "flags" parameter is a bitmask that might contain bits like BTREE_OMIT_JOURNAL and/or BTREE_MEMORY.

If the database is already opened in the same database connection and we are in shared cache mode, then the open will fail with an SQLITE_CONSTRAINT error. We cannot allow two or more BtShared objects in the same database connection since doing so will lead to problems with locking.

func Xsqlite3BtreePager Uses

func Xsqlite3BtreePager(tls *libc.TLS, p uintptr) uintptr

Return the pager associated with a BTree. This routine is used for testing and debugging only.

func Xsqlite3BtreePayload Uses

func Xsqlite3BtreePayload(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32

Read part of the payload for the row at which that cursor pCur is currently pointing. "amt" bytes will be transferred into pBuf[]. The transfer begins at "offset".

pCur can be pointing to either a table or an index b-tree. If pointing to a table btree, then the content section is read. If pCur is pointing to an index b-tree then the key section is read.

For sqlite3BtreePayload(), the caller must ensure that pCur is pointing to a valid row in the table. For sqlite3BtreePayloadChecked(), the cursor might be invalid or might need to be restored before being read.

Return SQLITE_OK on success or an error code if anything goes wrong. An error is returned if "offset+amt" is larger than the available payload.

func Xsqlite3BtreePayloadChecked Uses

func Xsqlite3BtreePayloadChecked(tls *libc.TLS, pCur uintptr, offset U32, amt U32, pBuf uintptr) int32

func Xsqlite3BtreePayloadFetch Uses

func Xsqlite3BtreePayloadFetch(tls *libc.TLS, pCur uintptr, pAmt uintptr) uintptr

For the entry that cursor pCur is point to, return as many bytes of the key or data as are available on the local b-tree page. Write the number of available bytes into *pAmt.

The pointer returned is ephemeral. The key/data may move or be destroyed on the next call to any Btree routine, including calls from other threads against the same cache. Hence, a mutex on the BtShared should be held prior to calling this routine.

These routines is used to get quick access to key and data in the common case where no overflow pages are used.

func Xsqlite3BtreePrevious Uses

func Xsqlite3BtreePrevious(tls *libc.TLS, pCur uintptr, flags int32) int32

func Xsqlite3BtreePutData Uses

func Xsqlite3BtreePutData(tls *libc.TLS, pCsr uintptr, offset U32, amt U32, z uintptr) int32

Argument pCsr must be a cursor opened for writing on an INTKEY table currently pointing at a valid table entry. This function modifies the data stored as part of that entry.

Only the data content may only be modified, it is not possible to change the length of the data stored. If this function is called with parameters that attempt to write past the end of the existing data, no modifications are made and SQLITE_CORRUPT is returned.

func Xsqlite3BtreeRollback Uses

func Xsqlite3BtreeRollback(tls *libc.TLS, p uintptr, tripCode int32, writeOnly int32) int32

Rollback the transaction in progress.

If tripCode is not SQLITE_OK then cursors will be invalidated (tripped). Only write cursors are tripped if writeOnly is true but all cursors are tripped if writeOnly is false. Any attempt to use a tripped cursor will result in an error.

This will release the write lock on the database file. If there are no active cursors, it also releases the read lock.

func Xsqlite3BtreeSavepoint Uses

func Xsqlite3BtreeSavepoint(tls *libc.TLS, p uintptr, op int32, iSavepoint int32) int32

The second argument to this function, op, is always SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. This function either releases or rolls back the savepoint identified by parameter iSavepoint, depending on the value of op.

Normally, iSavepoint is greater than or equal to zero. However, if op is SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the contents of the entire transaction are rolled back. This is different from a normal transaction rollback, as no locks are released and the transaction remains open.

func Xsqlite3BtreeSchema Uses

func Xsqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) uintptr

This function returns a pointer to a blob of memory associated with a single shared-btree. The memory is used by client code for its own purposes (for example, to store a high-level schema associated with the shared-btree). The btree layer manages reference counting issues.

The first time this is called on a shared-btree, nBytes bytes of memory are allocated, zeroed, and returned to the caller. For each subsequent call the nBytes parameter is ignored and a pointer to the same blob of memory returned.

If the nBytes parameter is 0 and the blob of memory has not yet been allocated, a null pointer is returned. If the blob has already been allocated, it is returned as normal.

Just before the shared-btree is closed, the function passed as the xFree argument when the memory allocation was made is invoked on the blob of allocated memory. The xFree function should not call sqlite3_free() on the memory, the btree layer does that.

func Xsqlite3BtreeSchemaLocked Uses

func Xsqlite3BtreeSchemaLocked(tls *libc.TLS, p uintptr) int32

Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared btree as the argument handle holds an exclusive lock on the sqlite_schema table. Otherwise SQLITE_OK.

func Xsqlite3BtreeSecureDelete Uses

func Xsqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) int32

Change the values for the BTS_SECURE_DELETE and BTS_OVERWRITE flags:

newFlag==0       Both BTS_SECURE_DELETE and BTS_OVERWRITE are cleared
newFlag==1       BTS_SECURE_DELETE set and BTS_OVERWRITE is cleared
newFlag==2       BTS_SECURE_DELETE cleared and BTS_OVERWRITE is set
newFlag==(-1)    No changes

This routine acts as a query if newFlag is less than zero

With BTS_OVERWRITE set, deleted content is overwritten by zeros, but freelist leaf pages are not written back to the database. Thus in-page deleted content is cleared, but freelist deleted content is not.

With BTS_SECURE_DELETE, operation is like BTS_OVERWRITE with the addition that freelist leaf pages are written back into the database, increasing the amount of disk I/O.

func Xsqlite3BtreeSetAutoVacuum Uses

func Xsqlite3BtreeSetAutoVacuum(tls *libc.TLS, p uintptr, autoVacuum int32) int32

Change the 'auto-vacuum' property of the database. If the 'autoVacuum' parameter is non-zero, then auto-vacuum mode is enabled. If zero, it is disabled. The default value for the auto-vacuum property is determined by the SQLITE_DEFAULT_AUTOVACUUM macro.

func Xsqlite3BtreeSetCacheSize Uses

func Xsqlite3BtreeSetCacheSize(tls *libc.TLS, p uintptr, mxPage int32) int32

Change the "soft" limit on the number of pages in the cache. Unused and unmodified pages will be recycled when the number of pages in the cache exceeds this soft limit. But the size of the cache is allowed to grow larger than this limit if it contains dirty pages or pages still in active use.

func Xsqlite3BtreeSetMmapLimit Uses

func Xsqlite3BtreeSetMmapLimit(tls *libc.TLS, p uintptr, szMmap Sqlite3_int64) int32

Change the limit on the amount of the database file that may be memory mapped.

func Xsqlite3BtreeSetPageSize Uses

func Xsqlite3BtreeSetPageSize(tls *libc.TLS, p uintptr, pageSize int32, nReserve int32, iFix int32) int32

Change the default pages size and the number of reserved bytes per page. Or, if the page size has already been fixed, return SQLITE_READONLY without changing anything.

The page size must be a power of 2 between 512 and 65536. If the page size supplied does not meet this constraint then the page size is not changed.

Page sizes are constrained to be a power of two so that the region of the database file used for locking (beginning at PENDING_BYTE, the first byte past the 1GB boundary, 0x40000000) needs to occur at the beginning of a page.

If parameter nReserve is less than zero, then the number of reserved bytes per page is left unchanged.

If the iFix!=0 then the BTS_PAGESIZE_FIXED flag is set so that the page size and autovacuum mode can no longer be changed.

func Xsqlite3BtreeSetPagerFlags Uses

func Xsqlite3BtreeSetPagerFlags(tls *libc.TLS, p uintptr, pgFlags uint32) int32

Change the way data is synced to disk in order to increase or decrease how well the database resists damage due to OS crashes and power failures. Level 1 is the same as asynchronous (no syncs() occur and there is a high probability of damage) Level 2 is the default. There is a very low but non-zero probability of damage. Level 3 reduces the probability of damage to near zero but with a write performance reduction.

func Xsqlite3BtreeSetSpillSize Uses

func Xsqlite3BtreeSetSpillSize(tls *libc.TLS, p uintptr, mxPage int32) int32

Change the "spill" limit on the number of pages in the cache. If the number of pages exceeds this limit during a write transaction, the pager might attempt to "spill" pages to the journal early in order to free up memory.

The value returned is the current spill size. If zero is passed as an argument, no changes are made to the spill size setting, so using mxPage of 0 is a way to query the current spill size.

func Xsqlite3BtreeSetVersion Uses

func Xsqlite3BtreeSetVersion(tls *libc.TLS, pBtree uintptr, iVersion int32) int32

Set both the "read version" (single byte at byte offset 18) and "write version" (single byte at byte offset 19) fields in the database header to iVersion.

func Xsqlite3BtreeSharable Uses

func Xsqlite3BtreeSharable(tls *libc.TLS, p uintptr) int32

Return true if the Btree passed as the only argument is sharable.

func Xsqlite3BtreeTripAllCursors Uses

func Xsqlite3BtreeTripAllCursors(tls *libc.TLS, pBtree uintptr, errCode int32, writeOnly int32) int32

This routine sets the state to CURSOR_FAULT and the error code to errCode for every cursor on any BtShared that pBtree references. Or if the writeOnly flag is set to 1, then only trip write cursors and leave read cursors unchanged.

Every cursor is a candidate to be tripped, including cursors that belong to other database connections that happen to be sharing the cache with pBtree.

This routine gets called when a rollback occurs. If the writeOnly flag is true, then only write-cursors need be tripped - read-only cursors save their current positions so that they may continue following the rollback. Or, if writeOnly is false, all cursors are tripped. In general, writeOnly is false if the transaction being rolled back modified the database schema. In this case b-tree root pages may be moved or deleted from the database altogether, making it unsafe for read cursors to continue.

If the writeOnly flag is true and an error is encountered while saving the current position of a read-only cursor, all cursors, including all read-cursors are tripped.

SQLITE_OK is returned if successful, or if an error occurs while saving a cursor position, an SQLite error code.

func Xsqlite3BtreeUpdateMeta Uses

func Xsqlite3BtreeUpdateMeta(tls *libc.TLS, p uintptr, idx int32, iMeta U32) int32

Write meta-information back into the database. Meta[0] is read-only and may not be written.

func Xsqlite3CantopenError Uses

func Xsqlite3CantopenError(tls *libc.TLS, lineno int32) int32

func Xsqlite3ChangeCookie Uses

func Xsqlite3ChangeCookie(tls *libc.TLS, pParse uintptr, iDb int32)

Generate code that will increment the schema cookie.

The schema cookie is used to determine when the schema for the database changes. After each schema change, the cookie value changes. When a process first reads the schema it records the cookie. Thereafter, whenever it goes to access the database, it checks the cookie to make sure the schema has not changed since it was last read.

This plan is not completely bullet-proof. It is possible for the schema to change multiple times and for the cookie to be set back to prior value. But schema changes are infrequent and the probability of hitting the same cookie value is only 1 chance in 2^32. So we're safe enough.

IMPLEMENTATION-OF: R-34230-56049 SQLite automatically increments the schema-version whenever the schema changes.

func Xsqlite3CheckCollSeq Uses

func Xsqlite3CheckCollSeq(tls *libc.TLS, pParse uintptr, pColl uintptr) int32

This routine is called on a collation sequence before it is used to check that it is defined. An undefined collation sequence exists when a database is loaded that contains references to collation sequences that have not been defined by sqlite3_create_collation() etc.

If required, this routine calls the 'collation needed' callback to request a definition of the collating sequence. If this doesn't work, an equivalent collating sequence that uses a text encoding different from the main database is substituted, if one is available.

func Xsqlite3CheckObjectName Uses

func Xsqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType uintptr, zTblName uintptr) int32

This routine is used to check if the UTF-8 string zName is a legal unqualified name for a new schema object (table, index, view or trigger). All names are legal except those that begin with the string "sqlite_" (in upper, lower or mixed case). This portion of the namespace is reserved for internal use.

When parsing the sqlite_schema table, this routine also checks to make sure the "type", "name", and "tbl_name" columns are consistent with the SQL.

func Xsqlite3Checkpoint Uses

func Xsqlite3Checkpoint(tls *libc.TLS, db uintptr, iDb int32, eMode int32, pnLog uintptr, pnCkpt uintptr) int32

Run a checkpoint on database iDb. This is a no-op if database iDb is not currently open in WAL mode.

If a transaction is open on the database being checkpointed, this function returns SQLITE_LOCKED and a checkpoint is not attempted. If an error occurs while running the checkpoint, an SQLite error code is returned (i.e. SQLITE_IOERR). Otherwise, SQLITE_OK.

The mutex on database handle db should be held by the caller. The mutex associated with the specific b-tree being checkpointed is taken by this function while the checkpoint is running.

If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are checkpointed. If an error is encountered it is returned immediately - no attempt is made to checkpoint any remaining databases.

Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL, RESTART or TRUNCATE.

func Xsqlite3ClearTempRegCache Uses

func Xsqlite3ClearTempRegCache(tls *libc.TLS, pParse uintptr)

Mark all temporary registers as being unavailable for reuse.

Always invoke this procedure after coding a subroutine or co-routine that might be invoked from other parts of the code, to ensure that the sub/co-routine does not use registers in common with the code that invokes the sub/co-routine.

func Xsqlite3CloseExtensions Uses

func Xsqlite3CloseExtensions(tls *libc.TLS, db uintptr)

Call this routine when the database connection is closing in order to clean up loaded extensions

func Xsqlite3CloseSavepoints Uses

func Xsqlite3CloseSavepoints(tls *libc.TLS, db uintptr)

Close all open savepoints. This function only manipulates fields of the database handle object, it does not close any savepoints that may be open at the b-tree/pager level.

func Xsqlite3CodeDropTable Uses

func Xsqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int32, isView int32)

Generate code to drop a table.

func Xsqlite3CodeRhsOfIN Uses

func Xsqlite3CodeRhsOfIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, iTab int32)

Generate code that will construct an ephemeral table containing all terms in the RHS of an IN operator. The IN operator can be in either of two forms:

x IN (4,5,11)              -- IN operator with list on right-hand side
x IN (SELECT a FROM b)     -- IN operator with subquery on the right

The pExpr parameter is the IN operator. The cursor number for the constructed ephermeral table is returned. The first time the ephemeral table is computed, the cursor number is also stored in pExpr->iTable, however the cursor number returned might not be the same, as it might have been duplicated using OP_OpenDup.

If the LHS expression ("x" in the examples) is a column value, or the SELECT statement returns a column value, then the affinity of that column is used to build the index keys. If both 'x' and the SELECT... statement are columns, then numeric affinity is used if either column has NUMERIC or INTEGER affinity. If neither 'x' nor the SELECT... statement are columns, then numeric affinity is used.

func Xsqlite3CodeRowTrigger Uses

func Xsqlite3CodeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, op int32, pChanges uintptr, tr_tm int32, pTab uintptr, reg int32, orconf int32, ignoreJump int32)

This is called to code the required FOR EACH ROW triggers for an operation on table pTab. The operation to code triggers for (INSERT, UPDATE or DELETE) is given by the op parameter. The tr_tm parameter determines whether the BEFORE or AFTER triggers are coded. If the operation is an UPDATE, then parameter pChanges is passed the list of columns being modified.

If there are no triggers that fire at the specified time for the specified operation on pTab, this function is a no-op.

The reg argument is the address of the first in an array of registers that contain the values substituted for the new.* and old.* references in the trigger program. If N is the number of columns in table pTab (a copy of pTab->nCol), then registers are populated as follows:

Register       Contains
------------------------------------------------------
reg+0          OLD.rowid
reg+1          OLD.* value of left-most column of pTab
...            ...
reg+N          OLD.* value of right-most column of pTab
reg+N+1        NEW.rowid
reg+N+2        OLD.* value of left-most column of pTab
...            ...
reg+N+N+1      NEW.* value of right-most column of pTab

For ON DELETE triggers, the registers containing the NEW.* values will never be accessed by the trigger program, so they are not allocated or populated by the caller (there is no data to populate them with anyway). Similarly, for ON INSERT triggers the values stored in the OLD.* registers are never accessed, and so are not allocated by the caller. So, for an ON INSERT trigger, the value passed to this function as parameter reg is not a readable register, although registers (reg+N) through (reg+N+N+1) are.

Parameter orconf is the default conflict resolution algorithm for the trigger program to use (REPLACE, IGNORE etc.). Parameter ignoreJump is the instruction that control should jump to if a trigger program raises an IGNORE exception.

func Xsqlite3CodeRowTriggerDirect Uses

func Xsqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab uintptr, reg int32, orconf int32, ignoreJump int32)

Generate code for the trigger program associated with trigger p on table pTab. The reg, orconf and ignoreJump parameters passed to this function are the same as those described in the header function for sqlite3CodeRowTrigger()

func Xsqlite3CodeSubselect Uses

func Xsqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) int32

Generate code for scalar subqueries used as a subquery expression or EXISTS operator:

(SELECT a FROM b)          -- subquery
EXISTS (SELECT a FROM b)   -- EXISTS subquery

The pExpr parameter is the SELECT or EXISTS operator to be coded.

Return the register that holds the result. For a multi-column SELECT, the result is stored in a contiguous array of registers and the return value is the register of the left-most result column. Return 0 if an error occurs.

func Xsqlite3CodeVerifyNamedSchema Uses

func Xsqlite3CodeVerifyNamedSchema(tls *libc.TLS, pParse uintptr, zDb uintptr)

If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each attached database. Otherwise, invoke it for the database named zDb only.

func Xsqlite3CodeVerifySchema Uses

func Xsqlite3CodeVerifySchema(tls *libc.TLS, pParse uintptr, iDb int32)

Record the fact that the schema cookie will need to be verified for database iDb. The code to actually verify the schema cookie will occur at the end of the top-level VDBE and will be generated later, by sqlite3FinishCoding().

func Xsqlite3CollapseDatabaseArray Uses

func Xsqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr)

Look through the list of open database files in db->aDb[] and if any have been closed, remove them from the list. Reallocate the db->aDb[] structure to a smaller size, if possible.

Entry 0 (the "main" database) and entry 1 (the "temp" database) are never candidates for being collapsed.

func Xsqlite3ColumnDefault Uses

func Xsqlite3ColumnDefault(tls *libc.TLS, v uintptr, pTab uintptr, i int32, iReg int32)

The most recently coded instruction was an OP_Column to retrieve the i-th column of table pTab. This routine sets the P4 parameter of the OP_Column to the default value, if any.

The default value of a column is specified by a DEFAULT clause in the column definition. This was either supplied by the user when the table was created, or added later to the table definition by an ALTER TABLE command. If the latter, then the row-records in the table btree on disk may not contain a value for the column and the default value, taken from the P4 parameter of the OP_Column instruction, is returned instead. If the former, then all row-records are guaranteed to include a value for the column and the P4 value is not required.

Column definitions created by an ALTER TABLE command may only have literal default values specified: a number, null or a string. (If a more complicated default expression value was provided, it is evaluated when the ALTER TABLE is executed and one of the literal values written into the sqlite_schema table.)

Therefore, the P4 parameter is only required if the default value for the column is a literal number, string or null. The sqlite3ValueFromExpr() function is capable of transforming these types of expressions into sqlite3_value objects.

If column as REAL affinity and the table is an ordinary b-tree table (not a virtual table) then the value might have been stored as an integer. In that case, add an OP_RealAffinity opcode to make sure it has been converted into REAL.

func Xsqlite3ColumnType Uses

func Xsqlite3ColumnType(tls *libc.TLS, pCol uintptr, zDflt uintptr) uintptr

Return the declared type of a column. Or return zDflt if the column has no declared type.

The column type is an extra string stored after the zero-terminator on the column name if and only if the COLFLAG_HASTYPE flag is set.

func Xsqlite3ColumnsFromExprList Uses

func Xsqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, pnCol uintptr, paCol uintptr) int32

Given an expression list (which is really the list of expressions that form the result set of a SELECT statement) compute appropriate column names for a table that would hold the expression list.

All column names will be unique.

Only the column names are computed. Column.zType, Column.zColl, and other fields of Column are zeroed.

Return SQLITE_OK on success. If a memory allocation error occurs, store NULL in *paCol and 0 in *pnCol and return SQLITE_NOMEM.

The only guarantee that SQLite makes about column names is that if the column has an AS clause assigning it a name, that will be the name used. That is the only documented guarantee. However, countless applications developed over the years have made baseless assumptions about column names and will break if those assumptions changes. Hence, use extreme caution when modifying this routine to avoid breaking legacy.

See Also: generateColumnNames()

func Xsqlite3CommitInternalChanges Uses

func Xsqlite3CommitInternalChanges(tls *libc.TLS, db uintptr)

This routine is called when a commit occurs.

func Xsqlite3CompareAffinity Uses

func Xsqlite3CompareAffinity(tls *libc.TLS, pExpr uintptr, aff2 int8) int8

pExpr is an operand of a comparison operator. aff2 is the type affinity of the other operand. This routine returns the type affinity that should be used for the comparison operator.

func Xsqlite3CompileOptions Uses

func Xsqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) uintptr

func Xsqlite3CompleteInsertion Uses

func Xsqlite3CompleteInsertion(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, regNewData int32, aRegIdx uintptr, update_flags int32, appendBias int32, useSeekResult int32)

This routine generates code to finish the INSERT or UPDATE operation that was started by a prior call to sqlite3GenerateConstraintChecks. A consecutive range of registers starting at regNewData contains the rowid and the content to be inserted.

The arguments to this routine should be the same as the first six arguments to sqlite3GenerateConstraintChecks.

func Xsqlite3ComputeGeneratedColumns Uses

func Xsqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore int32, pTab uintptr)

All regular columns for table pTab have been puts into registers starting with iRegStore. The registers that correspond to STORED or VIRTUAL columns have not yet been initialized. This routine goes back and computes the values for those columns based on the previously computed normal columns.

func Xsqlite3ConnectionBlocked Uses

func Xsqlite3ConnectionBlocked(tls *libc.TLS, db uintptr, pBlocker uintptr)

This function is called while stepping or preparing a statement associated with connection db. The operation will return SQLITE_LOCKED to the user because it requires a lock that will not be available until connection pBlocker concludes its current transaction.

func Xsqlite3ConnectionClosed Uses

func Xsqlite3ConnectionClosed(tls *libc.TLS, db uintptr)

This is called when the database connection passed as an argument is being closed. The connection is removed from the blocked list.

func Xsqlite3ConnectionUnlocked Uses

func Xsqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr)

This function is called when the transaction opened by database db has just finished. Locks held by database connection db have been released.

This function loops through each entry in the blocked connections list and does the following:

1) If the sqlite3.pBlockingConnection member of a list entry is
   set to db, then set pBlockingConnection=0.

2) If the sqlite3.pUnlockConnection member of a list entry is
   set to db, then invoke the configured unlock-notify callback and
   set pUnlockConnection=0.

3) If the two steps above mean that pBlockingConnection==0 and
   pUnlockConnection==0, remove the entry from the blocked connections
   list.

func Xsqlite3CorruptError Uses

func Xsqlite3CorruptError(tls *libc.TLS, lineno int32) int32

func Xsqlite3CreateColumnExpr Uses

func Xsqlite3CreateColumnExpr(tls *libc.TLS, db uintptr, pSrc uintptr, iSrc int32, iCol int32) uintptr

Allocate and return a pointer to an expression to load the column iCol from datasource iSrc in SrcList pSrc.

func Xsqlite3CreateForeignKey Uses

func Xsqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, pTo uintptr, pToCol uintptr, flags int32)

This routine is called to create a new foreign key on the table currently under construction. pFromCol determines which columns in the current table point to the foreign key. If pFromCol==0 then connect the key to the last column inserted. pTo is the name of the table referred to (a.k.a the "parent" table). pToCol is a list of tables in the parent pTo table. flags contains all information about the conflict resolution algorithms specified in the ON DELETE, ON UPDATE and ON INSERT clauses.

An FKey structure is created and added to the table currently under construction in the pParse->pNewTable field.

The foreign key is set for IMMEDIATE processing. A subsequent call to sqlite3DeferForeignKey() might change this to DEFERRED.

func Xsqlite3CreateFunc Uses

func Xsqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) int32

This function is exactly the same as sqlite3_create_function(), except that it is designed to be called by internal code. The difference is that if a malloc() fails in sqlite3_create_function(), an error code is returned and the mallocFailed flag cleared.

func Xsqlite3CreateIndex Uses

func Xsqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 uintptr, pTblName uintptr, pList uintptr, onError int32, pStart uintptr, pPIWhere uintptr, sortOrder int32, ifNotExist int32, idxType U8)

Create a new index for an SQL table. pName1.pName2 is the name of the index and pTblList is the name of the table that is to be indexed. Both will be NULL for a primary key or an index that is created to satisfy a UNIQUE constraint. If pTable and pIndex are NULL, use pParse->pNewTable as the table to be indexed. pParse->pNewTable is a table that is currently being constructed by a CREATE TABLE statement.

pList is a list of columns to be indexed. pList will be NULL if this is a primary key or unique-constraint on the most recent column added to the table currently under construction.

func Xsqlite3CreateView Uses

func Xsqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 uintptr, pName2 uintptr, pCNames uintptr, pSelect uintptr, isTemp int32, noErr int32)

The parser calls this routine in order to create a new VIEW

func Xsqlite3DbFree Uses

func Xsqlite3DbFree(tls *libc.TLS, db uintptr, p uintptr)

func Xsqlite3DbFreeNN Uses

func Xsqlite3DbFreeNN(tls *libc.TLS, db uintptr, p uintptr)

Free memory that might be associated with a particular database connection. Calling sqlite3DbFree(D,X) for X==0 is a harmless no-op. The sqlite3DbFreeNN(D,X) version requires that X be non-NULL.

func Xsqlite3DbIsNamed Uses

func Xsqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) int32

Return true if zName points to a name that may be used to refer to database iDb attached to handle db.

func Xsqlite3DbMallocRaw Uses

func Xsqlite3DbMallocRaw(tls *libc.TLS, db uintptr, n U64) uintptr

Allocate memory, either lookaside (if possible) or heap. If the allocation fails, set the mallocFailed flag in the connection pointer.

If db!=0 and db->mallocFailed is true (indicating a prior malloc failure on the same database connection) then always return 0. Hence for a particular database connection, once malloc starts failing, it fails consistently until mallocFailed is reset. This is an important assumption. There are many places in the code that do things like this:

int *a = (int*)sqlite3DbMallocRaw(db, 100);
int *b = (int*)sqlite3DbMallocRaw(db, 200);
if( b ) a[10] = 9;

In other words, if a subsequent malloc (ex: "b") worked, it is assumed that all prior mallocs (ex: "a") worked too.

The sqlite3MallocRawNN() variant guarantees that the "db" parameter is not a NULL pointer.

func Xsqlite3DbMallocRawNN Uses

func Xsqlite3DbMallocRawNN(tls *libc.TLS, db uintptr, n U64) uintptr

func Xsqlite3DbMallocSize Uses

func Xsqlite3DbMallocSize(tls *libc.TLS, db uintptr, p uintptr) int32

func Xsqlite3DbMallocZero Uses

func Xsqlite3DbMallocZero(tls *libc.TLS, db uintptr, n U64) uintptr

Allocate and zero memory. If the allocation fails, make the mallocFailed flag in the connection pointer.

func Xsqlite3DbNameToBtree Uses

func Xsqlite3DbNameToBtree(tls *libc.TLS, db uintptr, zDbName uintptr) uintptr

Return the Btree pointer identified by zDbName. Return NULL if not found.

func Xsqlite3DbRealloc Uses

func Xsqlite3DbRealloc(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr

Resize the block of memory pointed to by p to n bytes. If the resize fails, set the mallocFailed flag in the connection object.

func Xsqlite3DbReallocOrFree Uses

func Xsqlite3DbReallocOrFree(tls *libc.TLS, db uintptr, p uintptr, n U64) uintptr

Attempt to reallocate p. If the reallocation fails, then free p and set the mallocFailed flag in the database connection.

func Xsqlite3DbSpanDup Uses

func Xsqlite3DbSpanDup(tls *libc.TLS, db uintptr, zStart uintptr, zEnd uintptr) uintptr

The text between zStart and zEnd represents a phrase within a larger SQL statement. Make a copy of this phrase in space obtained form sqlite3DbMalloc(). Omit leading and trailing whitespace.

func Xsqlite3DbStrDup Uses

func Xsqlite3DbStrDup(tls *libc.TLS, db uintptr, z uintptr) uintptr

Make a copy of a string in memory obtained from sqliteMalloc(). These functions call sqlite3MallocRaw() directly instead of sqliteMalloc(). This is because when memory debugging is turned on, these two functions are called via macros that record the current file and line number in the ThreadData structure.

func Xsqlite3DbStrNDup Uses

func Xsqlite3DbStrNDup(tls *libc.TLS, db uintptr, z uintptr, n U64) uintptr

func Xsqlite3DbpageRegister Uses

func Xsqlite3DbpageRegister(tls *libc.TLS, db uintptr) int32

Invoke this routine to register the "dbpage" virtual table module

func Xsqlite3DbstatRegister Uses

func Xsqlite3DbstatRegister(tls *libc.TLS, db uintptr) int32

Invoke this routine to register the "dbstat" virtual table module

func Xsqlite3DebugPrintf Uses

func Xsqlite3DebugPrintf(tls *libc.TLS, zFormat uintptr, va uintptr)

A version of printf() that understands %lld. Used for debugging. The printf() built into some versions of windows does not understand %lld and segfaults if you give it a long long int.

func Xsqlite3DecOrHexToI64 Uses

func Xsqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) int32

Transform a UTF-8 integer literal, in either decimal or hexadecimal, into a 64-bit signed integer. This routine accepts hexadecimal literals, whereas sqlite3Atoi64() does not.

Returns:

0    Successful transformation.  Fits in a 64-bit signed integer.
1    Excess text after the integer value
2    Integer too large for a 64-bit signed integer or is malformed
3    Special case of 9223372036854775808

func Xsqlite3DefaultMutex Uses

func Xsqlite3DefaultMutex(tls *libc.TLS) uintptr

If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation is used regardless of the run-time threadsafety setting.

func Xsqlite3DefaultRowEst Uses

func Xsqlite3DefaultRowEst(tls *libc.TLS, pIdx uintptr)

Fill the Index.aiRowEst[] array with default information - information to be used when we have not run the ANALYZE command.

aiRowEst[0] is supposed to contain the number of elements in the index. Since we do not know, guess 1 million. aiRowEst[1] is an estimate of the number of rows in the table that match any particular value of the first column of the index. aiRowEst[2] is an estimate of the number of rows that match any particular combination of the first 2 columns of the index. And so forth. It must always be the case that

aiRowEst[N]<=aiRowEst[N-1]
aiRowEst[N]>=1

Apart from that, we have little to go on besides intuition as to how aiRowEst[] should be initialized. The numbers generated here are based on typical values found in actual indices.

func Xsqlite3DeferForeignKey Uses

func Xsqlite3DeferForeignKey(tls *libc.TLS, pParse uintptr, isDeferred int32)

This routine is called when an INITIALLY IMMEDIATE or INITIALLY DEFERRED clause is seen as part of a foreign key definition. The isDeferred parameter is 1 for INITIALLY DEFERRED and 0 for INITIALLY IMMEDIATE. The behavior of the most recently created foreign key is adjusted accordingly.

func Xsqlite3DeleteColumnNames Uses

func Xsqlite3DeleteColumnNames(tls *libc.TLS, db uintptr, pTable uintptr)

Delete memory allocated for the column names of a table or view (the Table.aCol[] array).

func Xsqlite3DeleteFrom Uses

func Xsqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr)

Generate code for a DELETE FROM statement.

DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
            \________/       \________________/
             pTabList              pWhere

func Xsqlite3DeleteIndexSamples Uses

func Xsqlite3DeleteIndexSamples(tls *libc.TLS, db uintptr, pIdx uintptr)

If the Index.aSample variable is not NULL, delete the aSample[] array and its contents.

func Xsqlite3DeleteTable Uses

func Xsqlite3DeleteTable(tls *libc.TLS, db uintptr, pTable uintptr)

func Xsqlite3DeleteTrigger Uses

func Xsqlite3DeleteTrigger(tls *libc.TLS, db uintptr, pTrigger uintptr)

Recursively delete a Trigger structure

func Xsqlite3DeleteTriggerStep Uses

func Xsqlite3DeleteTriggerStep(tls *libc.TLS, db uintptr, pTriggerStep uintptr)

Delete a linked list of TriggerStep structures.

func Xsqlite3Dequote Uses

func Xsqlite3Dequote(tls *libc.TLS, z uintptr)

Convert an SQL-style quoted string into a normal string by removing the quote characters. The conversion is done in-place. If the input does not begin with a quote character, then this routine is a no-op.

The input string must be zero-terminated. A new zero-terminator is added to the dequoted string.

The return value is -1 if no dequoting occurs or the length of the dequoted string, exclusive of the zero terminator, if dequoting does occur.

2002-02-14: This routine is extended to remove MS-Access style brackets from around identifiers. For example: "[a-b-c]" becomes "a-b-c".

func Xsqlite3DequoteExpr Uses

func Xsqlite3DequoteExpr(tls *libc.TLS, p uintptr)

func Xsqlite3Detach Uses

func Xsqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr)

Called by the parser to compile a DETACH statement.

DETACH pDbname

func Xsqlite3DropIndex Uses

func Xsqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists int32)

This routine will drop an existing named index. This routine implements the DROP INDEX statement.

func Xsqlite3DropTable Uses

func Xsqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int32, noErr int32)

This routine is called to do the work of a DROP TABLE statement. pName is the name of the table to be dropped.

func Xsqlite3DropTrigger Uses

func Xsqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int32)

This function is called to drop a trigger from the database schema.

This may be called directly from the parser and therefore identifies the trigger by name. The sqlite3DropTriggerPtr() routine does the same job as this routine except it takes a pointer to the trigger instead of the trigger name.

func Xsqlite3DropTriggerPtr Uses

func Xsqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr)

Drop a trigger given a pointer to that trigger.

func Xsqlite3EndBenignMalloc Uses

func Xsqlite3EndBenignMalloc(tls *libc.TLS)

func Xsqlite3EndTable Uses

func Xsqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr, tabOpts U8, pSelect uintptr)

This routine is called to report the final ")" that terminates a CREATE TABLE statement.

The table structure that other action routines have been building is added to the internal hash tables, assuming no errors have occurred.

An entry for the table is made in the schema table on disk, unless this is a temporary table or db->init.busy==1. When db->init.busy==1 it means we are reading the sqlite_schema table because we just connected to the database or because the sqlite_schema table has recently changed, so the entry for this table already exists in the sqlite_schema table. We do not want to create it again.

If the pSelect argument is not NULL, it means that this routine was called to create a table generated from a "CREATE TABLE ... AS SELECT ..." statement. The column names of the new table will match the result set of the SELECT.

func Xsqlite3EndTransaction Uses

func Xsqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32)

Generate VDBE code for a COMMIT or ROLLBACK statement. Code for ROLLBACK is generated if eType==TK_ROLLBACK. Otherwise code is generated for a COMMIT.

func Xsqlite3ErrName Uses

func Xsqlite3ErrName(tls *libc.TLS, rc int32) uintptr

Return a static string containing the name corresponding to the error code specified in the argument.

func Xsqlite3ErrStr Uses

func Xsqlite3ErrStr(tls *libc.TLS, rc int32) uintptr

Return a static string that describes the kind of error specified in the argument.

func Xsqlite3Error Uses

func Xsqlite3Error(tls *libc.TLS, db uintptr, err_code int32)

Set the current error code to err_code and clear any prior error message. Also set iSysErrno (by calling sqlite3System) if the err_code indicates that would be appropriate.

func Xsqlite3ErrorMsg Uses

func Xsqlite3ErrorMsg(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr)

Add an error message to pParse->zErrMsg and increment pParse->nErr. The following formatting characters are allowed:

%s      Insert a string
%z      A string that should be freed after use
%d      Insert an integer
%T      Insert a token
%S      Insert the first element of a SrcList

This function should be used to report any error that occurs while compiling an SQL statement (i.e. within sqlite3_prepare()). The last thing the sqlite3_prepare() function does is copy the error stored by this function into the database handle using sqlite3Error(). Functions sqlite3Error() or sqlite3ErrorWithMsg() should be used during statement execution (sqlite3_step() etc.).

func Xsqlite3ErrorToParser Uses

func Xsqlite3ErrorToParser(tls *libc.TLS, db uintptr, errCode int32) int32

If database connection db is currently parsing SQL, then transfer error code errCode to that parser if the parser has not already encountered some other kind of error.

func Xsqlite3ErrorWithMsg Uses

func Xsqlite3ErrorWithMsg(tls *libc.TLS, db uintptr, err_code int32, zFormat uintptr, va uintptr)

Set the most recent error code and error string for the sqlite handle "db". The error code is set to "err_code".

If it is not NULL, string zFormat specifies the format of the error string in the style of the printf functions: The following format characters are allowed:

%s      Insert a string
%z      A string that should be freed after use
%d      Insert an integer
%T      Insert a token
%S      Insert the first element of a SrcList

zFormat and any string tokens that follow it are assumed to be encoded in UTF-8.

To clear the most recent error for sqlite handle "db", sqlite3Error should be called with err_code set to SQLITE_OK and zFormat set to NULL.

func Xsqlite3ExpandSubquery Uses

func Xsqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32

The SrcList_item structure passed as the second argument represents a sub-query in the FROM clause of a SELECT statement. This function allocates and populates the SrcList_item.pTab object. If successful, SQLITE_OK is returned. Otherwise, if an OOM error is encountered, SQLITE_NOMEM.

func Xsqlite3ExpirePreparedStatements Uses

func Xsqlite3ExpirePreparedStatements(tls *libc.TLS, db uintptr, iCode int32)

Mark every prepared statement associated with a database connection as expired.

An expired statement means that recompilation of the statement is recommend. Statements expire when things happen that make their programs obsolete. Removing user-defined functions or collating sequences, or changing an authorization function are the types of things that make prepared statements obsolete.

If iCode is 1, then expiration is advisory. The statement should be reprepared before being restarted, but if it is already running it is allowed to run to completion.

Internally, this function just sets the Vdbe.expired flag on all prepared statements. The flag is set to 1 for an immediate expiration and set to 2 for an advisory expiration.

func Xsqlite3Expr Uses

func Xsqlite3Expr(tls *libc.TLS, db uintptr, op int32, zToken uintptr) uintptr

Allocate a new expression node from a zero-terminated token that has already been dequoted.

func Xsqlite3ExprAddCollateString Uses

func Xsqlite3ExprAddCollateString(tls *libc.TLS, pParse uintptr, pExpr uintptr, zC uintptr) uintptr

func Xsqlite3ExprAddCollateToken Uses

func Xsqlite3ExprAddCollateToken(tls *libc.TLS, pParse uintptr, pExpr uintptr, pCollName uintptr, dequote int32) uintptr

Set the collating sequence for expression pExpr to be the collating sequence named by pToken. Return a pointer to a new Expr node that implements the COLLATE operator.

If a memory allocation error occurs, that fact is recorded in pParse->db and the pExpr parameter is returned unchanged.

func Xsqlite3ExprAffinity Uses

func Xsqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) int8

Return the 'affinity' of the expression pExpr if any.

If pExpr is a column, a reference to a column via an 'AS' alias, or a sub-select with a column as the return value, then the affinity of that column is returned. Otherwise, 0x00 is returned, indicating no affinity for the expression.

i.e. the WHERE clause expressions in the following statements all have an affinity:

CREATE TABLE t1(a); SELECT * FROM t1 WHERE a; SELECT a AS b FROM t1 WHERE b; SELECT * FROM t1 WHERE (select a from t1);

func Xsqlite3ExprAlloc Uses

func Xsqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequote int32) uintptr

This routine is the core allocator for Expr nodes.

Construct a new expression node and return a pointer to it. Memory for this node and for the pToken argument is a single allocation obtained from sqlite3DbMalloc(). The calling function is responsible for making sure the node eventually gets freed.

If dequote is true, then the token (if it exists) is dequoted. If dequote is false, no dequoting is performed. The deQuote parameter is ignored if pToken is NULL or if the token does not appear to be quoted. If the quotes were of the form "..." (double-quotes) then the EP_DblQuoted flag is set on the expression node.

Special case: If op==TK_INTEGER and pToken points to a string that can be translated into a 32-bit integer, then the token is not stored in u.zToken. Instead, the integer values is written into u.iValue and the EP_IntValue flag is set. No extra storage is allocated to hold the integer text and the dequote flag is ignored.

func Xsqlite3ExprAnalyzeAggList Uses

func Xsqlite3ExprAnalyzeAggList(tls *libc.TLS, pNC uintptr, pList uintptr)

Call sqlite3ExprAnalyzeAggregates() for every expression in an expression list. Return the number of errors.

If an error is found, the analysis is cut short.

func Xsqlite3ExprAnalyzeAggregates Uses

func Xsqlite3ExprAnalyzeAggregates(tls *libc.TLS, pNC uintptr, pExpr uintptr)

Analyze the pExpr expression looking for aggregate functions and for variables that need to be added to AggInfo object that pNC->pAggInfo points to. Additional entries are made on the AggInfo object as necessary.

This routine should only be called after the expression has been analyzed by sqlite3ResolveExprNames().

func Xsqlite3ExprAnd Uses

func Xsqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintptr) uintptr

Join two expressions using an AND operator. If either expression is NULL, then just return the other expression.

If one side or the other of the AND is known to be false, then instead of returning an AND expression, just return a constant expression with a value of false.

func Xsqlite3ExprAssignVarNumber Uses

func Xsqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n U32)

Assign a variable number to an expression that encodes a wildcard in the original SQL statement.

Wildcards consisting of a single "?" are assigned the next sequential variable number.

Wildcards of the form "?nnn" are assigned the number "nnn". We make sure "nnn" is not too big to avoid a denial of service attack when the SQL statement comes from an external source.

Wildcards of the form ":aaa", "@aaa", or "$aaa" are assigned the same number as the previous instance of the same wildcard. Or if this is the first instance of the wildcard, the next sequential variable number is assigned.

func Xsqlite3ExprAttachSubtrees Uses

func Xsqlite3ExprAttachSubtrees(tls *libc.TLS, db uintptr, pRoot uintptr, pLeft uintptr, pRight uintptr)

Attach subtrees pLeft and pRight to the Expr node pRoot.

If pRoot==NULL that means that a memory allocation error has occurred. In that case, delete the subtrees pLeft and pRight.

func Xsqlite3ExprCanBeNull Uses

func Xsqlite3ExprCanBeNull(tls *libc.TLS, p uintptr) int32

Return FALSE if there is no chance that the expression can be NULL.

If the expression might be NULL or if the expression is too complex to tell return TRUE.

This routine is used as an optimization, to skip OP_IsNull opcodes when we know that a value cannot be NULL. Hence, a false positive (returning TRUE when in fact the expression can never be NULL) might be a small performance hit but is otherwise harmless. On the other hand, a false negative (returning FALSE when the result could be NULL) will likely result in an incorrect answer. So when in doubt, return TRUE.

func Xsqlite3ExprCheckHeight Uses

func Xsqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) int32

Check that argument nHeight is less than or equal to the maximum expression depth allowed. If it is not, leave an error message in pParse.

func Xsqlite3ExprCheckIN Uses

func Xsqlite3ExprCheckIN(tls *libc.TLS, pParse uintptr, pIn uintptr) int32

Expr pIn is an IN(...) expression. This function checks that the sub-select on the RHS of the IN() operator has the same number of columns as the vector on the LHS. Or, if the RHS of the IN() is not a sub-query, that the LHS is a vector of size 1.

func Xsqlite3ExprCode Uses

func Xsqlite3ExprCode(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Generate code that will evaluate expression pExpr and store the results in register target. The results are guaranteed to appear in register target.

func Xsqlite3ExprCodeCopy Uses

func Xsqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Make a transient copy of expression pExpr and then code it using sqlite3ExprCode(). This routine works just like sqlite3ExprCode() except that the input expression is guaranteed to be unchanged.

func Xsqlite3ExprCodeExprList Uses

func Xsqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, target int32, srcReg int32, flags U8) int32

Generate code that pushes the value of every element of the given expression list into a sequence of registers beginning at target.

Return the number of elements evaluated. The number returned will usually be pList->nExpr but might be reduced if SQLITE_ECEL_OMITREF is defined.

The SQLITE_ECEL_DUP flag prevents the arguments from being filled using OP_SCopy. OP_Copy must be used instead.

The SQLITE_ECEL_FACTOR argument allows constant arguments to be factored out into initialization code.

The SQLITE_ECEL_REF flag means that expressions in the list with ExprList.a[].u.x.iOrderByCol>0 have already been evaluated and stored in registers at srcReg, and so the value can be copied from there. If SQLITE_ECEL_OMITREF is also set, then the values with u.x.iOrderByCol>0 are simply omitted rather than being copied from srcReg.

func Xsqlite3ExprCodeFactorable Uses

func Xsqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32)

Generate code that will evaluate expression pExpr and store the results in register target. The results are guaranteed to appear in register target. If the expression is constant, then this routine might choose to code the expression at initialization time.

func Xsqlite3ExprCodeGeneratedColumn Uses

func Xsqlite3ExprCodeGeneratedColumn(tls *libc.TLS, pParse uintptr, pCol uintptr, regOut int32)

Generate code that will compute the value of generated column pCol and store the result in register regOut

func Xsqlite3ExprCodeGetColumn Uses

func Xsqlite3ExprCodeGetColumn(tls *libc.TLS, pParse uintptr, pTab uintptr, iColumn int32, iTable int32, iReg int32, p5 U8) int32

Generate code that will extract the iColumn-th column from table pTab and store the column value in register iReg.

There must be an open cursor to pTab in iTable when this routine is called. If iColumn<0 then code is generated that extracts the rowid.

func Xsqlite3ExprCodeGetColumnOfTable Uses

func Xsqlite3ExprCodeGetColumnOfTable(tls *libc.TLS, v uintptr, pTab uintptr, iTabCur int32, iCol int32, regOut int32)

Generate code to extract the value of the iCol-th column of a table.

func Xsqlite3ExprCodeLoadIndexColumn Uses

func Xsqlite3ExprCodeLoadIndexColumn(tls *libc.TLS, pParse uintptr, pIdx uintptr, iTabCur int32, iIdxCol int32, regOut int32)

Generate code that will load into register regOut a value that is appropriate for the iIdxCol-th column of index pIdx.

func Xsqlite3ExprCodeMove Uses

func Xsqlite3ExprCodeMove(tls *libc.TLS, pParse uintptr, iFrom int32, iTo int32, nReg int32)

Generate code to move content from registers iFrom...iFrom+nReg-1 over to iTo..iTo+nReg-1.

func Xsqlite3ExprCodeRunJustOnce Uses

func Xsqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, regDest int32) int32

Generate code that will evaluate expression pExpr just one time per prepared statement execution.

If the expression uses functions (that might throw an exception) then guard them with an OP_Once opcode to ensure that the code is only executed once. If no functions are involved, then factor the code out and put it at the end of the prepared statement in the initialization section.

If regDest>=0 then the result is always stored in that register and the result is not reusable. If regDest<0 then this routine is free to store the value whereever it wants. The register where the expression is stored is returned. When regDest<0, two identical expressions might code to the same register, if they do not contain function calls and hence are factored out into the initialization section at the end of the prepared statement.

func Xsqlite3ExprCodeTarget Uses

func Xsqlite3ExprCodeTarget(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) int32

Generate code into the current Vdbe to evaluate the given expression. Attempt to store the results in register "target". Return the register where results are stored.

With this routine, there is no guarantee that results will be stored in target. The result might be stored in some other register if it is convenient to do so. The calling function must check the return code and move the results to the desired register.

func Xsqlite3ExprCodeTemp Uses

func Xsqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uintptr) int32

Generate code to evaluate an expression and store the results into a register. Return the register number where the results are stored.

If the register is a temporary register that can be deallocated, then write its number into *pReg. If the result register is not a temporary, then set *pReg to zero.

If pExpr is a constant, then this routine might generate this code to fill the register in the initialization section of the VDBE program, in order to factor it out of the evaluation loop.

func Xsqlite3ExprCollSeq Uses

func Xsqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr

Return the collation sequence for the expression pExpr. If there is no defined collating sequence, return NULL.

See also: sqlite3ExprNNCollSeq()

The sqlite3ExprNNCollSeq() works the same exact that it returns the default collation if pExpr has no defined collation.

The collating sequence might be determined by a COLLATE operator or by the presence of a column with a defined collating sequence. COLLATE operators take first precedence. Left operands take precedence over right operands.

func Xsqlite3ExprCollSeqMatch Uses

func Xsqlite3ExprCollSeqMatch(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr) int32

Return TRUE if the two expressions have equivalent collating sequences.

func Xsqlite3ExprCompare Uses

func Xsqlite3ExprCompare(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, iTab int32) int32

Do a deep comparison of two expression trees. Return 0 if the two expressions are completely identical. Return 1 if they differ only by a COLLATE operator at the top level. Return 2 if there are differences other than the top-level COLLATE operator.

If any subelement of pB has Expr.iTable==(-1) then it is allowed to compare equal to an equivalent element in pA with Expr.iTable==iTab.

The pA side might be using TK_REGISTER. If that is the case and pB is not using TK_REGISTER but is otherwise equivalent, then still return 0.

Sometimes this routine will return 2 even if the two expressions really are equivalent. If we cannot prove that the expressions are identical, we return 2 just to be safe. So if this routine returns 2, then you do not really know for certain if the two expressions are the same. But if you get a 0 or 1 return, then you can be sure the expressions are the same. In the places where this routine is used, it does not hurt to get an extra 2 - that just might result in some slightly slower code. But returning an incorrect 0 or 1 could lead to a malfunction.

If pParse is not NULL then TK_VARIABLE terms in pA with bindings in pParse->pReprepare can be matched against literals in pB. The pParse->pVdbe->expmask bitmask is updated for each variable referenced. If pParse is NULL (the normal case) then any TK_VARIABLE term in Argument pParse should normally be NULL. If it is not NULL and pA or pB causes a return value of 2.

func Xsqlite3ExprCompareCollSeq Uses

func Xsqlite3ExprCompareCollSeq(tls *libc.TLS, pParse uintptr, p uintptr) uintptr

Expresssion p is a comparison operator. Return a collation sequence appropriate for the comparison operator.

This is normally just a wrapper around sqlite3BinaryCompareCollSeq(). However, if the OP_Commuted flag is set, then the order of the operands is reversed in the sqlite3BinaryCompareCollSeq() call so that the correct collating sequence is found.

func Xsqlite3ExprCompareSkip Uses

func Xsqlite3ExprCompareSkip(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32

Like sqlite3ExprCompare() except COLLATE operators at the top-level are ignored.

func Xsqlite3ExprCoveredByIndex Uses

func Xsqlite3ExprCoveredByIndex(tls *libc.TLS, pExpr uintptr, iCur int32, pIdx uintptr) int32

Determine if an index pIdx on table with cursor iCur contains will the expression pExpr. Return true if the index does cover the expression and false if the pExpr expression references table columns that are not found in the index pIdx.

An index covering an expression means that the expression can be evaluated using only the index and without having to lookup the corresponding table entry.

func Xsqlite3ExprDelete Uses

func Xsqlite3ExprDelete(tls *libc.TLS, db uintptr, p uintptr)

func Xsqlite3ExprDup Uses

func Xsqlite3ExprDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr

The following group of routines make deep copies of expressions, expression lists, ID lists, and select statements. The copies can be deleted (by being passed to their respective ...Delete() routines) without effecting the originals.

The expression list, ID, and source lists return by sqlite3ExprListDup(), sqlite3IdListDup(), and sqlite3SrcListDup() can not be further expanded by subsequent calls to sqlite*ListAppend() routines.

Any tables that the SrcList might point to are not duplicated.

The flags parameter contains a combination of the EXPRDUP_XXX flags. If the EXPRDUP_REDUCE flag is set, then the structure returned is a truncated version of the usual Expr structure that will be stored as part of the in-memory representation of the database schema.

func Xsqlite3ExprForVectorField Uses

func Xsqlite3ExprForVectorField(tls *libc.TLS, pParse uintptr, pVector uintptr, iField int32) uintptr

Compute and return a new Expr object which when passed to sqlite3ExprCode() will generate all necessary code to compute the iField-th column of the vector expression pVector.

It is ok for pVector to be a scalar (as long as iField==0). In that case, this routine works like sqlite3ExprDup().

The caller owns the returned Expr object and is responsible for ensuring that the returned value eventually gets freed.

The caller retains ownership of pVector. If pVector is a TK_SELECT, then the returned object will reference pVector and so pVector must remain valid for the life of the returned object. If pVector is a TK_VECTOR or a scalar expression, then it can be deleted as soon as this routine returns.

A trick to cause a TK_SELECT pVector to be deleted together with the returned Expr object is to attach the pVector to the pRight field of the returned TK_SELECT_COLUMN Expr object.

func Xsqlite3ExprFunction Uses

func Xsqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr, eDistinct int32) uintptr

Construct a new expression node for a function with multiple arguments.

func Xsqlite3ExprFunctionUsable Uses

func Xsqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pDef uintptr)

Check to see if a function is usable according to current access rules:

SQLITE_FUNC_DIRECT    -     Only usable from top-level SQL

SQLITE_FUNC_UNSAFE    -     Usable if TRUSTED_SCHEMA or from
                            top-level SQL

If the function is not usable, create an error.

func Xsqlite3ExprIdToTrueFalse Uses

func Xsqlite3ExprIdToTrueFalse(tls *libc.TLS, pExpr uintptr) int32

If the input expression is an ID with the name "true" or "false" then convert it into an TK_TRUEFALSE term. Return non-zero if the conversion happened, and zero if the expression is unaltered.

func Xsqlite3ExprIfFalse Uses

func Xsqlite3ExprIfFalse(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Generate code for a boolean expression such that a jump is made to the label "dest" if the expression is false but execution continues straight thru if the expression is true.

If the expression evaluates to NULL (neither true nor false) then jump if jumpIfNull is SQLITE_JUMPIFNULL or fall through if jumpIfNull is 0.

func Xsqlite3ExprIfFalseDup Uses

func Xsqlite3ExprIfFalseDup(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Like sqlite3ExprIfFalse() except that a copy is made of pExpr before code generation, and that copy is deleted after code generation. This ensures that the original pExpr is unchanged.

func Xsqlite3ExprIfTrue Uses

func Xsqlite3ExprIfTrue(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, jumpIfNull int32)

Generate code for a boolean expression such that a jump is made to the label "dest" if the expression is true but execution continues straight thru if the expression is false.

If the expression evaluates to NULL (neither true nor false), then take the jump if the jumpIfNull flag is SQLITE_JUMPIFNULL.

This code depends on the fact that certain token values (ex: TK_EQ) are the same as opcode values (ex: OP_Eq) that implement the corresponding operation. Special comments in vdbe.c and the mkopcodeh.awk script in the make process cause these values to align. Assert()s in the code below verify that the numbers are aligned correctly.

func Xsqlite3ExprImpliesExpr Uses

func Xsqlite3ExprImpliesExpr(tls *libc.TLS, pParse uintptr, pE1 uintptr, pE2 uintptr, iTab int32) int32

Return true if we can prove the pE2 will always be true if pE1 is true. Return false if we cannot complete the proof or if pE2 might be false. Examples:

pE1: x==5       pE2: x==5             Result: true
pE1: x>0        pE2: x==5             Result: false
pE1: x=21       pE2: x=21 OR y=43     Result: true
pE1: x!=123     pE2: x IS NOT NULL    Result: true
pE1: x!=?1      pE2: x IS NOT NULL    Result: true
pE1: x IS NULL  pE2: x IS NOT NULL    Result: false
pE1: x IS ?2    pE2: x IS NOT NULL    Reuslt: false

When comparing TK_COLUMN nodes between pE1 and pE2, if pE2 has Expr.iTable<0 then assume a table number given by iTab.

If pParse is not NULL, then the values of bound variables in pE1 are compared against literal values in pE2 and pParse->pVdbe->expmask is modified to record which bound variables are referenced. If pParse is NULL, then false will be returned if pE1 contains any bound variables.

When in doubt, return false. Returning true might give a performance improvement. Returning false might cause a performance reduction, but it will always give the correct answer and is hence always safe.

func Xsqlite3ExprImpliesNonNullRow Uses

func Xsqlite3ExprImpliesNonNullRow(tls *libc.TLS, p uintptr, iTab int32) int32

Return true (non-zero) if expression p can only be true if at least one column of table iTab is non-null. In other words, return true if expression p will always be NULL or false if every column of iTab is NULL.

False negatives are acceptable. In other words, it is ok to return zero even if expression p will never be true of every column of iTab is NULL. A false negative is merely a missed optimization opportunity.

False positives are not allowed, however. A false positive may result in an incorrect answer.

Terms of p that are marked with EP_FromJoin (and hence that come from the ON or USING clauses of LEFT JOINS) are excluded from the analysis.

This routine is used to check if a LEFT JOIN can be converted into an ordinary JOIN. The p argument is the WHERE clause. If the WHERE clause requires that some column of the right table of the LEFT JOIN be non-NULL, then the LEFT JOIN can be safely converted into an ordinary join.

func Xsqlite3ExprIsConstant Uses

func Xsqlite3ExprIsConstant(tls *libc.TLS, p uintptr) int32

Walk an expression tree. Return non-zero if the expression is constant and 0 if it involves variables or function calls.

For the purposes of this function, a double-quoted string (ex: "abc") is considered a variable but a single-quoted string (ex: 'abc') is a constant.

func Xsqlite3ExprIsConstantNotJoin Uses

func Xsqlite3ExprIsConstantNotJoin(tls *libc.TLS, p uintptr) int32

Walk an expression tree. Return non-zero if

(1) the expression is constant, and
(2) the expression does originate in the ON or USING clause
    of a LEFT JOIN, and
(3) the expression does not contain any EP_FixedCol TK_COLUMN
    operands created by the constant propagation optimization.

When this routine returns true, it indicates that the expression can be added to the pParse->pConstExpr list and evaluated once when the prepared statement starts up. See sqlite3ExprCodeRunJustOnce().

func Xsqlite3ExprIsConstantOrFunction Uses

func Xsqlite3ExprIsConstantOrFunction(tls *libc.TLS, p uintptr, isInit U8) int32

Walk an expression tree for the DEFAULT field of a column definition in a CREATE TABLE statement. Return non-zero if the expression is acceptable for use as a DEFAULT. That is to say, return non-zero if the expression is constant or a function call with constant arguments. Return and 0 if there are any variables.

isInit is true when parsing from sqlite_schema. isInit is false when processing a new CREATE TABLE statement. When isInit is true, parameters (such as ? or $abc) in the expression are converted into NULL. When isInit is false, parameters raise an error. Parameters should not be allowed in a CREATE TABLE statement, but some legacy versions of SQLite allowed it, so we need to support it when reading sqlite_schema for backwards compatibility.

If isInit is true, set EP_FromDDL on every TK_FUNCTION node.

For the purposes of this function, a double-quoted string (ex: "abc") is considered a variable but a single-quoted string (ex: 'abc') is a constant.

func Xsqlite3ExprIsConstantOrGroupBy Uses

func Xsqlite3ExprIsConstantOrGroupBy(tls *libc.TLS, pParse uintptr, p uintptr, pGroupBy uintptr) int32

Walk the expression tree passed as the first argument. Return non-zero if the expression consists entirely of constants or copies of terms in pGroupBy that sort with the BINARY collation sequence.

This routine is used to determine if a term of the HAVING clause can be promoted into the WHERE clause. In order for such a promotion to work, the value of the HAVING clause term must be the same for all members of a "group". The requirement that the GROUP BY term must be BINARY assumes that no other collating sequence will have a finer-grained grouping than binary. In other words (A=B COLLATE binary) implies A=B in every other collating sequence. The requirement that the GROUP BY be BINARY is stricter than necessary. It would also work to promote HAVING clauses that use the same alternative collating sequence as the GROUP BY term, but that is much harder to check, alternative collating sequences are uncommon, and this is only an optimization, so we take the easy way out and simply require the GROUP BY to use the BINARY collating sequence.

func Xsqlite3ExprIsInteger Uses

func Xsqlite3ExprIsInteger(tls *libc.TLS, p uintptr, pValue uintptr) int32

If the expression p codes a constant integer that is small enough to fit in a 32-bit integer, return 1 and put the value of the integer in *pValue. If the expression is not an integer or if it is too big to fit in a signed 32-bit integer, return 0 and leave *pValue unchanged.

func Xsqlite3ExprIsTableConstant Uses

func Xsqlite3ExprIsTableConstant(tls *libc.TLS, p uintptr, iCur int32) int32

Walk an expression tree. Return non-zero if the expression is constant for any single row of the table with cursor iCur. In other words, the expression must not refer to any non-deterministic function nor any table other than iCur.

func Xsqlite3ExprIsVector Uses

func Xsqlite3ExprIsVector(tls *libc.TLS, pExpr uintptr) int32

Return true if expression pExpr is a vector, or false otherwise.

A vector is defined as any expression that results in two or more columns of result. Every TK_VECTOR node is an vector because the parser will not generate a TK_VECTOR with fewer than two entries. But a TK_SELECT might be either a vector or a scalar. It is only considered a vector if it has two or more result columns.

func Xsqlite3ExprListAppend Uses

func Xsqlite3ExprListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pExpr uintptr) uintptr

Add a new element to the end of an expression list. If pList is initially NULL, then create a new expression list.

The pList argument must be either NULL or a pointer to an ExprList obtained from a prior call to sqlite3ExprListAppend(). This routine may not be used with an ExprList obtained from sqlite3ExprListDup(). Reason: This routine assumes that the number of slots in pList->a[] is a power of two. That is true for sqlite3ExprListAppend() returns but is not necessarily true from the return value of sqlite3ExprListDup().

If a memory allocation error occurs, the entire list is freed and NULL is returned. If non-NULL is returned, then it is guaranteed that the new entry was successfully appended.

func Xsqlite3ExprListAppendVector Uses

func Xsqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, pColumns uintptr, pExpr uintptr) uintptr

pColumns and pExpr form a vector assignment which is part of the SET clause of an UPDATE statement. Like this:

(a,b,c) = (expr1,expr2,expr3)

Or: (a,b,c) = (SELECT x,y,z FROM ....)

For each term of the vector assignment, append new entries to the expression list pList. In the case of a subquery on the RHS, append TK_SELECT_COLUMN expressions.

func Xsqlite3ExprListCheckLength Uses

func Xsqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, zObject uintptr)

If the expression list pEList contains more than iLimit elements, leave an error message in pParse.

func Xsqlite3ExprListCompare Uses

func Xsqlite3ExprListCompare(tls *libc.TLS, pA uintptr, pB uintptr, iTab int32) int32

Compare two ExprList objects. Return 0 if they are identical, 1 if they are certainly different, or 2 if it is not possible to determine if they are identical or not.

If any subelement of pB has Expr.iTable==(-1) then it is allowed to compare equal to an equivalent element in pA with Expr.iTable==iTab.

This routine might return non-zero for equivalent ExprLists. The only consequence will be disabled optimizations. But this routine must never return 0 if the two ExprList objects are different, or a malfunction will result.

Two NULL pointers are considered to be the same. But a NULL pointer always differs from a non-NULL pointer.

func Xsqlite3ExprListDelete Uses

func Xsqlite3ExprListDelete(tls *libc.TLS, db uintptr, pList uintptr)

func Xsqlite3ExprListDup Uses

func Xsqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) uintptr

func Xsqlite3ExprListSetName Uses

func Xsqlite3ExprListSetName(tls *libc.TLS, pParse uintptr, pList uintptr, pName uintptr, dequote int32)

Set the ExprList.a[].zEName element of the most recently added item on the expression list.

pList might be NULL following an OOM error. But pName should never be NULL. If a memory allocation fails, the pParse->db->mallocFailed flag is set.

func Xsqlite3ExprListSetSortOrder Uses

func Xsqlite3ExprListSetSortOrder(tls *libc.TLS, p uintptr, iSortOrder int32, eNulls int32)

Set the sort order for the last element on the given ExprList.

func Xsqlite3ExprListSetSpan Uses

func Xsqlite3ExprListSetSpan(tls *libc.TLS, pParse uintptr, pList uintptr, zStart uintptr, zEnd uintptr)

Set the ExprList.a[].zSpan element of the most recently added item on the expression list.

pList might be NULL following an OOM error. But pSpan should never be NULL. If a memory allocation fails, the pParse->db->mallocFailed flag is set.

func Xsqlite3ExprNNCollSeq Uses

func Xsqlite3ExprNNCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) uintptr

Return the collation sequence for the expression pExpr. If there is no defined collating sequence, return a pointer to the defautl collation sequence.

See also: sqlite3ExprCollSeq()

The sqlite3ExprCollSeq() routine works the same except that it returns NULL if there is no defined collation.

func Xsqlite3ExprNeedsNoAffinityChange Uses

func Xsqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) int32

Return TRUE if the given expression is a constant which would be unchanged by OP_Affinity with the affinity given in the second argument.

This routine is used to determine if the OP_Affinity operation can be omitted. When in doubt return FALSE. A false negative is harmless. A false positive, however, can result in the wrong answer.

func Xsqlite3ExprReferencesUpdatedColumn Uses

func Xsqlite3ExprReferencesUpdatedColumn(tls *libc.TLS, pExpr uintptr, aiChng uintptr, chngRowid int32) int32

pExpr is a CHECK constraint on a row that is being UPDATE-ed. The only columns that are modified by the UPDATE are those for which aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.

Return true if CHECK constraint pExpr uses any of the changing columns (or the rowid if it is changing). In other words, return true if this CHECK constraint must be validated for the new row in the UPDATE statement.

2018-09-15: pExpr might also be an expression for an index-on-expressions. The operation of this routine is the same - return true if an only if the expression uses one or more of columns identified by the second and third arguments.

func Xsqlite3ExprSetHeightAndFlags Uses

func Xsqlite3ExprSetHeightAndFlags(tls *libc.TLS, pParse uintptr, p uintptr)

Set the Expr.nHeight variable using the exprSetHeight() function. If the height is greater than the maximum allowed expression depth, leave an error in pParse.

Also propagate all EP_Propagate flags from the Expr.x.pList into Expr.flags.

func Xsqlite3ExprSimplifiedAndOr Uses

func Xsqlite3ExprSimplifiedAndOr(tls *libc.TLS, pExpr uintptr) uintptr

If pExpr is an AND or OR expression, try to simplify it by eliminating terms that are always true or false. Return the simplified expression. Or return the original expression if no simplification is possible.

Examples:

(x<10) AND true                =>   (x<10)
(x<10) AND false               =>   false
(x<10) AND (y=22 OR false)     =>   (x<10) AND (y=22)
(x<10) AND (y=22 OR true)      =>   (x<10)
(y=22) OR true                 =>   true

func Xsqlite3ExprSkipCollate Uses

func Xsqlite3ExprSkipCollate(tls *libc.TLS, pExpr uintptr) uintptr

Skip over any TK_COLLATE operators.

func Xsqlite3ExprSkipCollateAndLikely Uses

func Xsqlite3ExprSkipCollateAndLikely(tls *libc.TLS, pExpr uintptr) uintptr

Skip over any TK_COLLATE operators and/or any unlikely() or likelihood() or likely() functions at the root of an expression.

func Xsqlite3ExprTruthValue Uses

func Xsqlite3ExprTruthValue(tls *libc.TLS, pExpr uintptr) int32

The argument must be a TK_TRUEFALSE Expr node. Return 1 if it is TRUE and 0 if it is FALSE.

func Xsqlite3ExprUnmapAndDelete Uses

func Xsqlite3ExprUnmapAndDelete(tls *libc.TLS, pParse uintptr, p uintptr)

Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the expression.

func Xsqlite3ExprVectorSize Uses

func Xsqlite3ExprVectorSize(tls *libc.TLS, pExpr uintptr) int32

If the expression passed as the only argument is of type TK_VECTOR return the number of expressions in the vector. Or, if the expression is a sub-select, return the number of columns in the sub-select. For any other type of expression, return 1.

func Xsqlite3ExprWalkNoop Uses

func Xsqlite3ExprWalkNoop(tls *libc.TLS, NotUsed uintptr, NotUsed2 uintptr) int32

No-op routine for the parse-tree walker.

When this routine is the Walker.xExprCallback then expression trees are walked without any actions being taken at each node. Presumably, when this routine is used for Walker.xExprCallback then Walker.xSelectCallback is set to do something useful for every subquery in the parser tree.

func Xsqlite3FaultSim Uses

func Xsqlite3FaultSim(tls *libc.TLS, iTest int32) int32

Calls to sqlite3FaultSim() are used to simulate a failure during testing, or to bypass normal error detection during testing in order to let execute proceed futher downstream.

In deployment, sqlite3FaultSim() *always* return SQLITE_OK (0). The sqlite3FaultSim() function only returns non-zero during testing.

During testing, if the test harness has set a fault-sim callback using a call to sqlite3_test_control(SQLITE_TESTCTRL_FAULT_INSTALL), then each call to sqlite3FaultSim() is relayed to that application-supplied callback and the integer return value form the application-supplied callback is returned by sqlite3FaultSim().

The integer argument to sqlite3FaultSim() is a code to identify which sqlite3FaultSim() instance is being invoked. Each call to sqlite3FaultSim() should have a unique code. To prevent legacy testing applications from breaking, the codes should not be changed or reused.

func Xsqlite3FindCollSeq Uses

func Xsqlite3FindCollSeq(tls *libc.TLS, db uintptr, enc U8, zName uintptr, create int32) uintptr

Parameter zName points to a UTF-8 encoded string nName bytes long. Return the CollSeq* pointer for the collation sequence named zName for the encoding 'enc' from the database 'db'.

If the entry specified is not found and 'create' is true, then create a new entry. Otherwise return NULL.

A separate function sqlite3LocateCollSeq() is a wrapper around this routine. sqlite3LocateCollSeq() invokes the collation factory if necessary and generates an error message if the collating sequence cannot be found.

See also: sqlite3LocateCollSeq(), sqlite3GetCollSeq()

func Xsqlite3FindDb Uses

func Xsqlite3FindDb(tls *libc.TLS, db uintptr, pName uintptr) int32

The token *pName contains the name of a database (either "main" or "temp" or the name of an attached db). This routine returns the index of the named database in db->aDb[], or -1 if the named db does not exist.

func Xsqlite3FindDbName Uses

func Xsqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) int32

Parameter zName points to a nul-terminated buffer containing the name of a database ("main", "temp" or the name of an attached db). This function returns the index of the named database in db->aDb[], or -1 if the named db cannot be found.

func Xsqlite3FindFunction Uses

func Xsqlite3FindFunction(tls *libc.TLS, db uintptr, zName uintptr, nArg int32, enc U8, createFlag U8) uintptr

Locate a user function given a name, a number of arguments and a flag indicating whether the function prefers UTF-16 over UTF-8. Return a pointer to the FuncDef structure that defines that function, or return NULL if the function does not exist.

If the createFlag argument is true, then a new (blank) FuncDef structure is created and liked into the "db" structure if a no matching function previously existed.

If nArg is -2, then the first valid function found is returned. A function is valid if xSFunc is non-zero. The nArg==(-2) case is used to see if zName is a valid function name for some number of arguments. If nArg is -2, then createFlag must be 0.

If createFlag is false, then a function with the required name and number of arguments may be returned even if the eTextRep flag does not match that requested.

func Xsqlite3FindInIndex Uses

func Xsqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags U32, prRhsHasNull uintptr, aiMap uintptr, piTab uintptr) int32

This function is used by the implementation of the IN (...) operator. The pX parameter is the expression on the RHS of the IN operator, which might be either a list of expressions or a subquery.

The job of this routine is to find or create a b-tree object that can be used either to test for membership in the RHS set or to iterate through all members of the RHS set, skipping duplicates.

A cursor is opened on the b-tree object that is the RHS of the IN operator and pX->iTable is set to the index of that cursor.

The returned value of this function indicates the b-tree type, as follows:

IN_INDEX_ROWID      - The cursor was opened on a database table.
IN_INDEX_INDEX_ASC  - The cursor was opened on an ascending index.
IN_INDEX_INDEX_DESC - The cursor was opened on a descending index.
IN_INDEX_EPH        - The cursor was opened on a specially created and
                      populated epheremal table.
IN_INDEX_NOOP       - No cursor was allocated.  The IN operator must be
                      implemented as a sequence of comparisons.

An existing b-tree might be used if the RHS expression pX is a simple subquery such as:

SELECT <column1>, <column2>... FROM <table>

If the RHS of the IN operator is a list or a more complex subquery, then an ephemeral table might need to be generated from the RHS and then pX->iTable made to point to the ephemeral table instead of an existing table.

The inFlags parameter must contain, at a minimum, one of the bits IN_INDEX_MEMBERSHIP or IN_INDEX_LOOP but not both. If inFlags contains IN_INDEX_MEMBERSHIP, then the generated table will be used for a fast membership test. When the IN_INDEX_LOOP bit is set, the IN index will be used to loop over all values of the RHS of the IN operator.

When IN_INDEX_LOOP is used (and the b-tree will be used to iterate through the set members) then the b-tree must not contain duplicates. An epheremal table will be created unless the selected columns are guaranteed to be unique - either because it is an INTEGER PRIMARY KEY or due to a UNIQUE constraint or index.

When IN_INDEX_MEMBERSHIP is used (and the b-tree will be used for fast set membership tests) then an epheremal table must be used unless <columns> is a single INTEGER PRIMARY KEY column or an index can be found with the specified <columns> as its left-most.

If the IN_INDEX_NOOP_OK and IN_INDEX_MEMBERSHIP are both set and if the RHS of the IN operator is a list (not a subquery) then this routine might decide that creating an ephemeral b-tree for membership testing is too expensive and return IN_INDEX_NOOP. In that case, the calling routine should implement the IN operator using a sequence of Eq or Ne comparison operations.

When the b-tree is being used for membership tests, the calling function might need to know whether or not the RHS side of the IN operator contains a NULL. If prRhsHasNull is not a NULL pointer and if there is any chance that the (...) might contain a NULL value at runtime, then a register is allocated and the register number written to *prRhsHasNull. If there is no chance that the (...) contains a NULL value, then *prRhsHasNull is left unchanged.

If a register is allocated and its location stored in *prRhsHasNull, then the value in that register will be NULL if the b-tree contains one or more NULL values, and it will be some non-NULL value if the b-tree contains no NULL values.

If the aiMap parameter is not NULL, it must point to an array containing one element for each column returned by the SELECT statement on the RHS of the IN(...) operator. The i'th entry of the array is populated with the offset of the index column that matches the i'th column returned by the SELECT. For example, if the expression and selected index are:

(?,?,?) IN (SELECT a, b, c FROM t1)
CREATE INDEX i1 ON t1(b, c, a);

then aiMap[] is populated with {2, 0, 1}.

func Xsqlite3FindIndex Uses

func Xsqlite3FindIndex(tls *libc.TLS, db uintptr, zName uintptr, zDb uintptr) uintptr

Locate the in-memory structure that describes a particular index given the name of that index and the name of the database that contains the index. Return NULL if not found.

If zDatabase is 0, all databases are searched for the table and the first matching index is returned. (No checking for duplicate index names is done.) The search order is TEMP first, then MAIN, then any auxiliary databases added using the ATTACH command.

func Xsqlite3FindTable Uses

func Xsqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintptr) uintptr

Locate the in-memory structure that describes a particular database table given the name of that table and (optionally) the name of the database containing the table. Return NULL if not found.

If zDatabase is 0, all databases are searched for the table and the first matching table is returned. (No checking for duplicate table names is done.) The search order is TEMP first, then MAIN, then any auxiliary databases added using the ATTACH command.

See also sqlite3LocateTable().

func Xsqlite3FinishCoding Uses

func Xsqlite3FinishCoding(tls *libc.TLS, pParse uintptr)

This routine is called after a single SQL statement has been parsed and a VDBE program to execute that statement has been prepared. This routine puts the finishing touches on the VDBE program and resets the pParse structure for the next parse.

Note that if an error occurred, it might be the case that no VDBE code was generated.

func Xsqlite3FinishTrigger Uses

func Xsqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAll uintptr)

This routine is called after all of the trigger actions have been parsed in order to complete the process of building the trigger.

func Xsqlite3FixExpr Uses

func Xsqlite3FixExpr(tls *libc.TLS, pFix uintptr, pExpr uintptr) int32

func Xsqlite3FixExprList Uses

func Xsqlite3FixExprList(tls *libc.TLS, pFix uintptr, pList uintptr) int32

func Xsqlite3FixInit Uses

func Xsqlite3FixInit(tls *libc.TLS, pFix uintptr, pParse uintptr, iDb int32, zType uintptr, pName uintptr)

Initialize a DbFixer structure. This routine must be called prior to passing the structure to one of the sqliteFixAAAA() routines below.

func Xsqlite3FixSelect Uses

func Xsqlite3FixSelect(tls *libc.TLS, pFix uintptr, pSelect uintptr) int32

func Xsqlite3FixSrcList Uses

func Xsqlite3FixSrcList(tls *libc.TLS, pFix uintptr, pList uintptr) int32

The following set of routines walk through the parse tree and assign a specific database to all table references where the database name was left unspecified in the original SQL statement. The pFix structure must have been initialized by a prior call to sqlite3FixInit().

These routines are used to make sure that an index, trigger, or view in one database does not refer to objects in a different database. (Exception: indices, triggers, and views in the TEMP database are allowed to refer to anything.) If a reference is explicitly made to an object in a different database, an error message is added to pParse->zErrMsg and these routines return non-zero. If everything checks out, these routines return 0.

func Xsqlite3FixTriggerStep Uses

func Xsqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) int32

func Xsqlite3FkActions Uses

func Xsqlite3FkActions(tls *libc.TLS, pParse uintptr, pTab uintptr, pChanges uintptr, regOld int32, aChange uintptr, bChngRowid int32)

This function is called when deleting or updating a row to implement any required CASCADE, SET NULL or SET DEFAULT actions.

func Xsqlite3FkCheck Uses

func Xsqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, regNew int32, aChange uintptr, bChngRowid int32)

This function is called when inserting, deleting or updating a row of table pTab to generate VDBE code to perform foreign key constraint processing for the operation.

For a DELETE operation, parameter regOld is passed the index of the first register in an array of (pTab->nCol+1) registers containing the rowid of the row being deleted, followed by each of the column values of the row being deleted, from left to right. Parameter regNew is passed zero in this case.

For an INSERT operation, regOld is passed zero and regNew is passed the first register of an array of (pTab->nCol+1) registers containing the new row data.

For an UPDATE operation, this function is called twice. Once before the original record is deleted from the table using the calling convention described for DELETE. Then again after the original record is deleted but before the new record is inserted using the INSERT convention.

func Xsqlite3FkDelete Uses

func Xsqlite3FkDelete(tls *libc.TLS, db uintptr, pTab uintptr)

Free all memory associated with foreign key definitions attached to table pTab. Remove the deleted foreign keys from the Schema.fkeyHash hash table.

func Xsqlite3FkDropTable Uses

func Xsqlite3FkDropTable(tls *libc.TLS, pParse uintptr, pName uintptr, pTab uintptr)

This function is called to generate code that runs when table pTab is being dropped from the database. The SrcList passed as the second argument to this function contains a single entry guaranteed to resolve to table pTab.

Normally, no code is required. However, if either

(a) The table is the parent table of a FK constraint, or
(b) The table is the child table of a deferred FK constraint and it is
    determined at runtime that there are outstanding deferred FK
    constraint violations in the database,

then the equivalent of "DELETE FROM <tbl>" is executed before dropping the table from the database. Triggers are disabled while running this DELETE, but foreign key actions are not.

func Xsqlite3FkLocateIndex Uses

func Xsqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey uintptr, ppIdx uintptr, paiCol uintptr) int32

A foreign key constraint requires that the key columns in the parent table are collectively subject to a UNIQUE or PRIMARY KEY constraint. Given that pParent is the parent table for foreign key constraint pFKey, search the schema for a unique index on the parent key columns.

If successful, zero is returned. If the parent key is an INTEGER PRIMARY KEY column, then output variable *ppIdx is set to NULL. Otherwise, *ppIdx is set to point to the unique index.

If the parent key consists of a single column (the foreign key constraint is not a composite foreign key), output variable *paiCol is set to NULL. Otherwise, it is set to point to an allocated array of size N, where N is the number of columns in the parent key. The first element of the array is the index of the child table column that is mapped by the FK constraint to the parent table column stored in the left-most column of index *ppIdx. The second element of the array is the index of the child table column that corresponds to the second left-most column of *ppIdx, and so on.

If the required index cannot be found, either because:

1) The named parent key columns do not exist, or

2) The named parent key columns do exist, but are not subject to a
   UNIQUE or PRIMARY KEY constraint, or

3) No parent key columns were provided explicitly as part of the
   foreign key definition, and the parent table does not have a
   PRIMARY KEY, or

4) No parent key columns were provided explicitly as part of the
   foreign key definition, and the PRIMARY KEY of the parent table
   consists of a different number of columns to the child key in
   the child table.

then non-zero is returned, and a "foreign key mismatch" error loaded into pParse. If an OOM error occurs, non-zero is returned and the pParse->db->mallocFailed flag is set.

func Xsqlite3FkReferences Uses

func Xsqlite3FkReferences(tls *libc.TLS, pTab uintptr) uintptr

This function returns a linked list of FKey objects (connected by FKey.pNextTo) holding all children of table pTab. For example, given the following schema:

CREATE TABLE t1(a PRIMARY KEY);
CREATE TABLE t2(b REFERENCES t1(a);

Calling this function with table "t1" as an argument returns a pointer to the FKey structure representing the foreign key constraint on table "t2". Calling this function with "t2" as the argument would return a NULL pointer (as there are no FK constraints for which t2 is the parent table).

func Xsqlite3FkRequired Uses

func Xsqlite3FkRequired(tls *libc.TLS, pParse uintptr, pTab uintptr, aChange uintptr, chngRowid int32) int32

This function is called before generating code to update or delete a row contained in table pTab. If the operation is a DELETE, then parameter aChange is passed a NULL value. For an UPDATE, aChange points to an array of size N, where N is the number of columns in table pTab. If the i'th column is not modified by the UPDATE, then the corresponding entry in the aChange[] array is set to -1. If the column is modified, the value is 0 or greater. Parameter chngRowid is set to true if the UPDATE statement modifies the rowid fields of the table.

If any foreign key processing will be required, this function returns non-zero. If there is no foreign key related processing, this function returns zero.

For an UPDATE, this function returns 2 if:

* There are any FKs for which pTab is the child and the parent table, or
* the UPDATE modifies one or more parent keys for which the action is
  not "NO ACTION" (i.e. is CASCADE, SET DEFAULT or SET NULL).

Or, assuming some other foreign key processing is required, 1.

func Xsqlite3FreeIndex Uses

func Xsqlite3FreeIndex(tls *libc.TLS, db uintptr, p uintptr)

Reclaim the memory used by an index

func Xsqlite3Fts5Init Uses

func Xsqlite3Fts5Init(tls *libc.TLS, db uintptr) int32

The following functions are used to register the module with SQLite. If this module is being built as part of the SQLite core (SQLITE_CORE is defined), then sqlite3_open() will call sqlite3Fts5Init() directly.

Or, if this module is being built as a loadable extension, sqlite3Fts5Init() is omitted and the two standard entry points sqlite3_fts_init() and sqlite3_fts5_init() defined instead.

func Xsqlite3FunctionSearch Uses

func Xsqlite3FunctionSearch(tls *libc.TLS, h int32, zFunc uintptr) uintptr

Search a FuncDefHash for a function with the given name. Return a pointer to the matching FuncDef if found, or 0 if there is no match.

func Xsqlite3FunctionUsesThisSrc Uses

func Xsqlite3FunctionUsesThisSrc(tls *libc.TLS, pExpr uintptr, pSrcList uintptr) int32

Determine if any of the arguments to the pExpr Function reference pSrcList. Return true if they do. Also return true if the function has no arguments or has only constant arguments. Return false if pExpr references columns but not columns of tables found in pSrcList.

func Xsqlite3GenerateConstraintChecks Uses

func Xsqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintptr, aRegIdx uintptr, iDataCur int32, iIdxCur int32, regNewData int32, regOldData int32, pkChng U8, overrideError U8, ignoreDest int32, pbMayReplace uintptr, aiChng uintptr, pUpsert uintptr)

Generate code to do constraint checks prior to an INSERT or an UPDATE on table pTab.

The regNewData parameter is the first register in a range that contains the data to be inserted or the data after the update. There will be pTab->nCol+1 registers in this range. The first register (the one that regNewData points to) will contain the new rowid, or NULL in the case of a WITHOUT ROWID table. The second register in the range will contain the content of the first table column. The third register will contain the content of the second table column. And so forth.

The regOldData parameter is similar to regNewData except that it contains the data prior to an UPDATE rather than afterwards. regOldData is zero for an INSERT. This routine can distinguish between UPDATE and INSERT by checking regOldData for zero.

For an UPDATE, the pkChng boolean is true if the true primary key (the rowid for a normal table or the PRIMARY KEY for a WITHOUT ROWID table) might be modified by the UPDATE. If pkChng is false, then the key of the iDataCur content table is guaranteed to be unchanged by the UPDATE.

For an INSERT, the pkChng boolean indicates whether or not the rowid was explicitly specified as part of the INSERT statement. If pkChng is zero, it means that the either rowid is computed automatically or that the table is a WITHOUT ROWID table and has no rowid. On an INSERT, pkChng will only be true if the INSERT statement provides an integer value for either the rowid column or its INTEGER PRIMARY KEY alias.

The code generated by this routine will store new index entries into registers identified by aRegIdx[]. No index entry is created for indices where aRegIdx[i]==0. The order of indices in aRegIdx[] is the same as the order of indices on the linked list of indices at pTab->pIndex.

(2019-05-07) The generated code also creates a new record for the main table, if pTab is a rowid table, and stores that record in the register identified by aRegIdx[nIdx] - in other words in the first entry of aRegIdx[] past the last index. It is important that the record be generated during constraint checks to avoid affinity changes to the register content that occur after constraint checks but before the new record is inserted.

The caller must have already opened writeable cursors on the main table and all applicable indices (that is to say, all indices for which aRegIdx[] is not zero). iDataCur is the cursor for the main table when inserting or updating a rowid table, or the cursor for the PRIMARY KEY index when operating on a WITHOUT ROWID table. iIdxCur is the cursor for the first index in the pTab->pIndex list. Cursors for other indices are at iIdxCur+N for the N-th element of the pTab->pIndex list.

This routine also generates code to check constraints. NOT NULL, CHECK, and UNIQUE constraints are all checked. If a constraint fails, then the appropriate action is performed. There are five possible actions: ROLLBACK, ABORT, FAIL, REPLACE, and IGNORE.

Constraint type  Action       What Happens
---------------  ----------   ----------------------------------------
any              ROLLBACK     The current transaction is rolled back and
                              sqlite3_step() returns immediately with a
                              return code of SQLITE_CONSTRAINT.

any              ABORT        Back out changes from the current command
                              only (do not do a complete rollback) then
                              cause sqlite3_step() to return immediately
                              with SQLITE_CONSTRAINT.

any              FAIL         Sqlite3_step() returns immediately with a
                              return code of SQLITE_CONSTRAINT.  The
                              transaction is not rolled back and any
                              changes to prior rows are retained.

any              IGNORE       The attempt in insert or update the current
                              row is skipped, without throwing an error.
                              Processing continues with the next row.
                              (There is an immediate jump to ignoreDest.)

NOT NULL         REPLACE      The NULL value is replace by the default
                              value for that column.  If the default value
                              is NULL, the action is the same as ABORT.

UNIQUE           REPLACE      The other row that conflicts with the row
                              being inserted is removed.

CHECK            REPLACE      Illegal.  The results in an exception.

Which action to take is determined by the overrideError parameter. Or if overrideError==OE_Default, then the pParse->onError parameter is used. Or if pParse->onError==OE_Default then the onError value for the constraint is used.

func Xsqlite3GenerateIndexKey Uses

func Xsqlite3GenerateIndexKey(tls *libc.TLS, pParse uintptr, pIdx uintptr, iDataCur int32, regOut int32, prefixOnly int32, piPartIdxLabel uintptr, pPrior uintptr, regPrior int32) int32

Generate code that will assemble an index key and stores it in register regOut. The key with be for index pIdx which is an index on pTab. iCur is the index of a cursor open on the pTab table and pointing to the entry that needs indexing. If pTab is a WITHOUT ROWID table, then iCur must be the cursor of the PRIMARY KEY index.

Return a register number which is the first in a block of registers that holds the elements of the index key. The block of registers has already been deallocated by the time this routine returns.

If *piPartIdxLabel is not NULL, fill it in with a label and jump to that label if pIdx is a partial index that should be skipped. The label should be resolved using sqlite3ResolvePartIdxLabel(). A partial index should be skipped if its WHERE clause evaluates to false or null. If pIdx is not a partial index, *piPartIdxLabel will be set to zero which is an empty label that is ignored by sqlite3ResolvePartIdxLabel().

The pPrior and regPrior parameters are used to implement a cache to avoid unnecessary register loads. If pPrior is not NULL, then it is a pointer to a different index for which an index key has just been computed into register regPrior. If the current pIdx index is generating its key into the same sequence of registers and if pPrior and pIdx share a column in common, then the register corresponding to that column already holds the correct value and the loading of that register is skipped. This optimization is helpful when doing a DELETE or an INTEGRITY_CHECK on a table with multiple indices, and especially with the ROWID or PRIMARY KEY columns of the index.

func Xsqlite3GenerateRowDelete Uses

func Xsqlite3GenerateRowDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger uintptr, iDataCur int32, iIdxCur int32, iPk int32, nPk I16, count U8, onconf U8, eMode U8, iIdxNoSeek int32)

This routine generates VDBE code that causes a single row of a single table to be deleted. Both the original table entry and all indices are removed.

Preconditions:

1.  iDataCur is an open cursor on the btree that is the canonical data
    store for the table.  (This will be either the table itself,
    in the case of a rowid table, or the PRIMARY KEY index in the case
    of a WITHOUT ROWID table.)

2.  Read/write cursors for all indices of pTab must be open as
    cursor number iIdxCur+i for the i-th index.

3.  The primary key for the row to be deleted must be stored in a
    sequence of nPk memory cells starting at iPk.  If nPk==0 that means
    that a search record formed from OP_MakeRecord is contained in the
    single memory location iPk.

eMode:

Parameter eMode may be passed either ONEPASS_OFF (0), ONEPASS_SINGLE, or
ONEPASS_MULTI.  If eMode is not ONEPASS_OFF, then the cursor
iDataCur already points to the row to delete. If eMode is ONEPASS_OFF
then this function must seek iDataCur to the entry identified by iPk
and nPk before reading from it.

If eMode is ONEPASS_MULTI, then this call is being made as part
of a ONEPASS delete that affects multiple rows. In this case, if
iIdxNoSeek is a valid cursor number (>=0) and is not the same as
iDataCur, then its position should be preserved following the delete
operation. Or, if iIdxNoSeek is not a valid cursor number, the
position of iDataCur should be preserved instead.

iIdxNoSeek:

If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
then it identifies an index cursor (from within array of cursors
starting at iIdxCur) that already points to the index entry to be deleted.
Except, this optimization is disabled if there are BEFORE triggers since
the trigger body might have moved the cursor.

func Xsqlite3GenerateRowIndexDelete Uses

func Xsqlite3GenerateRowIndexDelete(tls *libc.TLS, pParse uintptr, pTab uintptr, iDataCur int32, iIdxCur int32, aRegIdx uintptr, iIdxNoSeek int32)

This routine generates VDBE code that causes the deletion of all index entries associated with a single row of a single table, pTab

Preconditions:

1.  A read/write cursor "iDataCur" must be open on the canonical storage
    btree for the table pTab.  (This will be either the table itself
    for rowid tables or to the primary key index for WITHOUT ROWID
    tables.)

2.  Read/write cursors for all indices of pTab must be open as
    cursor number iIdxCur+i for the i-th index.  (The pTab->pIndex
    index is the 0-th index.)

3.  The "iDataCur" cursor must be already be positioned on the row
    that is to be deleted.

func Xsqlite3GetCollSeq Uses

func Xsqlite3GetCollSeq(tls *libc.TLS, pParse uintptr, enc U8, pColl uintptr, zName uintptr) uintptr

This function is responsible for invoking the collation factory callback or substituting a collation sequence of a different encoding when the requested collation sequence is not available in the desired encoding.

If it is not NULL, then pColl must point to the database native encoding collation sequence with name zName, length nName.

The return value is either the collation sequence to be used in database db for collation type name zName, length nName, or NULL, if no collation sequence can be found. If no collation is found, leave an error message.

See also: sqlite3LocateCollSeq(), sqlite3FindCollSeq()

func Xsqlite3GetInt32 Uses

func Xsqlite3GetInt32(tls *libc.TLS, zNum uintptr, pValue uintptr) int32

If zNum represents an integer that will fit in 32-bits, then set *pValue to that integer and return true. Otherwise return false.

This routine accepts both decimal and hexadecimal notation for integers.

Any non-numeric characters that following zNum are ignored. This is different from sqlite3Atoi64() which requires the input number to be zero-terminated.

func Xsqlite3GetTempRange Uses

func Xsqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) int32

Allocate or deallocate a block of nReg consecutive registers.

func Xsqlite3GetTempReg Uses

func Xsqlite3GetTempReg(tls *libc.TLS, pParse uintptr) int32

Allocate a single new register for use to hold some intermediate result.

func Xsqlite3GetToken Uses

func Xsqlite3GetToken(tls *libc.TLS, z uintptr, tokenType uintptr) int32

Return the length (in bytes) of the token that begins at z[0]. Store the token type in *tokenType before returning.

func Xsqlite3GetUInt32 Uses

func Xsqlite3GetUInt32(tls *libc.TLS, z uintptr, pI uintptr) int32

Try to convert z into an unsigned 32-bit integer. Return true on success and false if there is an error.

Only decimal notation is accepted.

func Xsqlite3GetVTable Uses

func Xsqlite3GetVTable(tls *libc.TLS, db uintptr, pTab uintptr) uintptr

pTab is a pointer to a Table structure representing a virtual-table. Return a pointer to the VTable object used by connection db to access this virtual-table, if one has been created, or NULL otherwise.

func Xsqlite3GetVdbe Uses

func Xsqlite3GetVdbe(tls *libc.TLS, pParse uintptr) uintptr

Get a VDBE for the given parser context. Create a new one if necessary. If an error occurs, return NULL and leave a message in pParse.

func Xsqlite3HaltConstraint Uses

func Xsqlite3HaltConstraint(tls *libc.TLS, pParse uintptr, errCode int32, onError int32, p4 uintptr, p4type I8, p5Errmsg U8)

Code an OP_Halt that causes the vdbe to return an SQLITE_CONSTRAINT error. The onError parameter determines which (if any) of the statement and/or current transaction is rolled back.

func Xsqlite3HasExplicitNulls Uses

func Xsqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) int32

If expression list pList contains an expression that was parsed with an explicit "NULLS FIRST" or "NULLS LAST" clause, leave an error in pParse and return non-zero. Otherwise, return zero.

func Xsqlite3HashClear Uses

func Xsqlite3HashClear(tls *libc.TLS, pH uintptr)

Remove all entries from a hash table. Reclaim all memory. Call this routine to delete a hash table or to reset a hash table to the empty state.

func Xsqlite3HashFind Uses

func Xsqlite3HashFind(tls *libc.TLS, pH uintptr, pKey uintptr) uintptr

Attempt to locate an element of the hash table pH with a key that matches pKey. Return the data for this element if it is found, or NULL if there is no match.

func Xsqlite3HashInit Uses

func Xsqlite3HashInit(tls *libc.TLS, pNew uintptr)

Turn bulk memory into a hash table object by initializing the fields of the Hash structure.

"pNew" is a pointer to the hash table that is to be initialized.

func Xsqlite3HashInsert Uses

func Xsqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) uintptr

Insert an element into the hash table pH. The key is pKey and the data is "data".

If no element exists with a matching key, then a new element is created and NULL is returned.

If another element already exists with the same key, then the new data replaces the old data and the old data is returned. The key is not copied in this instance. If a malloc fails, then the new data is returned and the hash table is unchanged.

If the "data" parameter to this function is NULL, then the element corresponding to "key" is removed from the hash table.

func Xsqlite3HeaderSizeBtree Uses

func Xsqlite3HeaderSizeBtree(tls *libc.TLS) int32

Return the size of the header added to each page by this module.

func Xsqlite3HeaderSizePcache Uses

func Xsqlite3HeaderSizePcache(tls *libc.TLS) int32

Return the size of the header added by this middleware layer in the page-cache hierarchy.

func Xsqlite3HeaderSizePcache1 Uses

func Xsqlite3HeaderSizePcache1(tls *libc.TLS) int32

Return the size of the header on each page of this PCACHE implementation.

func Xsqlite3HeapNearlyFull Uses

func Xsqlite3HeapNearlyFull(tls *libc.TLS) int32

Return true if the heap is currently under memory pressure - in other words if the amount of heap used is close to the limit set by sqlite3_soft_heap_limit().

func Xsqlite3HexToBlob Uses

func Xsqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) uintptr

Convert a BLOB literal of the form "x'hhhhhh'" into its binary value. Return a pointer to its binary value. Space to hold the binary value has been obtained from malloc and must be freed by the calling routine.

func Xsqlite3IdListAppend Uses

func Xsqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken uintptr) uintptr

Append a new element to the given IdList. Create a new IdList if need be.

A new IdList is returned, or NULL if malloc() fails.

func Xsqlite3IdListDelete Uses

func Xsqlite3IdListDelete(tls *libc.TLS, db uintptr, pList uintptr)

Delete an IdList.

func Xsqlite3IdListDup Uses

func Xsqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) uintptr

func Xsqlite3IdListIndex Uses

func Xsqlite3IdListIndex(tls *libc.TLS, pList uintptr, zName uintptr) int32

Return the index in pList of the identifier named zId. Return -1 if not found.

func Xsqlite3IndexAffinityOk Uses

func Xsqlite3IndexAffinityOk(tls *libc.TLS, pExpr uintptr, idx_affinity int8) int32

pExpr is a comparison expression, eg. '=', '<', IN(...) etc. idx_affinity is the affinity of an indexed column. Return true if the index with affinity idx_affinity may be used to implement the comparison in pExpr.

func Xsqlite3IndexAffinityStr Uses

func Xsqlite3IndexAffinityStr(tls *libc.TLS, db uintptr, pIdx uintptr) uintptr

Return a pointer to the column affinity string associated with index pIdx. A column affinity string has one character for each column in the table, according to the affinity of the column:

Character      Column affinity
------------------------------
'A'            BLOB
'B'            TEXT
'C'            NUMERIC
'D'            INTEGER
'F'            REAL

An extra 'D' is appended to the end of the string to cover the rowid that appears as the last column in every index.

Memory for the buffer containing the column index affinity string is managed along with the rest of the Index structure. It will be released when sqlite3DeleteIndex() is called.

func Xsqlite3IndexColumnAffinity Uses

func Xsqlite3IndexColumnAffinity(tls *libc.TLS, db uintptr, pIdx uintptr, iCol int32) int8

Return the affinity for a single column of an index.

func Xsqlite3IndexHasDuplicateRootPage Uses

func Xsqlite3IndexHasDuplicateRootPage(tls *libc.TLS, pIndex uintptr) int32

Check to see if any sibling index (another index on the same table) of pIndex has the same root page number, and if it does, return true. This would indicate a corrupt schema.

func Xsqlite3IndexedByLookup Uses

func Xsqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) int32

If the source-list item passed as an argument was augmented with an INDEXED BY clause, then try to locate the specified index. If there was such a clause and the named index cannot be found, return SQLITE_ERROR and leave an error in pParse. Otherwise, populate pFrom->pIndex and return SQLITE_OK.

func Xsqlite3Init Uses

func Xsqlite3Init(tls *libc.TLS, db uintptr, pzErrMsg uintptr) int32

Initialize all database files - the main database file, the file used to store temporary tables, and any additional database files created using ATTACH statements. Return a success code. If an error occurs, write an error message into *pzErrMsg.

After a database is initialized, the DB_SchemaLoaded bit is set bit is set in the flags field of the Db structure.

func Xsqlite3InitCallback Uses

func Xsqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr, NotUsed uintptr) int32

This is the callback routine for the code that initializes the database. See sqlite3Init() below for additional information. This routine is also called from the OP_ParseSchema opcode of the VDBE.

Each callback contains the following information:

argv[0] = type of object: "table", "index", "trigger", or "view".
argv[1] = name of thing being created
argv[2] = associated table if an index or trigger
argv[3] = root page number for table or index. 0 for trigger or view.
argv[4] = SQL text for the CREATE statement.

func Xsqlite3InitOne Uses

func Xsqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFlags U32) int32

Attempt to read the database schema and initialize internal data structures for a single database file. The index of the database file is given by iDb. iDb==0 is used for the main database. iDb==1 should never be used. iDb>=2 is used for auxiliary databases. Return one of the SQLITE_ error codes to indicate success or failure.

func Xsqlite3Insert Uses

func Xsqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr)

This routine is called to handle SQL of the following forms:

insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST),...
insert into TABLE (IDLIST) select
insert into TABLE (IDLIST) default values

The IDLIST following the table name is always optional. If omitted, then a list of all (non-hidden) columns for the table is substituted. The IDLIST appears in the pColumn parameter. pColumn is NULL if IDLIST is omitted.

For the pSelect parameter holds the values to be inserted for the first two forms shown above. A VALUES clause is really just short-hand for a SELECT statement that omits the FROM clause and everything else that follows. If the pSelect parameter is NULL, that means that the DEFAULT VALUES form of the INSERT statement is intended.

The code generated follows one of four templates. For a simple insert with data coming from a single-row VALUES clause, the code executes once straight down through. Pseudo-code follows (we call this the "1st template"):

open write cursor to <table> and its indices
put VALUES clause expressions into registers
write the resulting record into <table>
cleanup

The three remaining templates assume the statement is of the form

INSERT INTO <table> SELECT ...

If the SELECT clause is of the restricted form "SELECT * FROM <table2>" - in other words if the SELECT pulls all columns from a single table and there is no WHERE or LIMIT or GROUP BY or ORDER BY clauses, and if <table2> and <table1> are distinct tables but have identical schemas, including all the same indices, then a special optimization is invoked that copies raw records from <table2> over to <table1>. See the xferOptimization() function for the implementation of this template. This is the 2nd template.

open a write cursor to <table>
open read cursor on <table2>
transfer all records in <table2> over to <table>
close cursors
foreach index on <table>
  open a write cursor on the <table> index
  open a read cursor on the corresponding <table2> index
  transfer all records from the read to the write cursors
  close cursors
end foreach

The 3rd template is for when the second template does not apply and the SELECT clause does not read from <table> at any time. The generated code follows this template:

   X <- A
   goto B
A: setup for the SELECT
   loop over the rows in the SELECT
     load values into registers R..R+n
     yield X
   end loop
   cleanup after the SELECT
   end-coroutine X
B: open write cursor to <table> and its indices
C: yield X, at EOF goto D
   insert the select result into <table> from R..R+n
   goto C
D: cleanup

The 4th template is used if the insert statement takes its values from a SELECT but the data is being inserted into a table that is also read as part of the SELECT. In the third form, we have to use an intermediate table to store the results of the select. The template is like this:

   X <- A
   goto B
A: setup for the SELECT
   loop over the tables in the SELECT
     load value into register R..R+n
     yield X
   end loop
   cleanup after the SELECT
   end co-routine R
B: open temp table
L: yield X, at EOF goto M
   insert row from R..R+n into temp table
   goto L
M: open write cursor to <table> and its indices
   rewind temp table
C: loop over rows of intermediate table
     transfer values form intermediate table into <table>
   end loop
D: cleanup

func Xsqlite3InsertBuiltinFuncs Uses

func Xsqlite3InsertBuiltinFuncs(tls *libc.TLS, aDef uintptr, nDef int32)

Insert a new FuncDef into a FuncDefHash hash table.

func Xsqlite3Int64ToText Uses

func Xsqlite3Int64ToText(tls *libc.TLS, v I64, zOut uintptr)

Render an signed 64-bit integer as text. Store the result in zOut[].

The caller must ensure that zOut[] is at least 21 bytes in size.

func Xsqlite3InvokeBusyHandler Uses

func Xsqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) int32

Invoke the given busy handler.

This routine is called when an operation failed to acquire a lock on VFS file pFile.

If this routine returns non-zero, the lock is retried. If it returns 0, the operation aborts with an SQLITE_BUSY error.

func Xsqlite3IsBinary Uses

func Xsqlite3IsBinary(tls *libc.TLS, p uintptr) int32

Return true if CollSeq is the default built-in BINARY.

func Xsqlite3IsIdChar Uses

func Xsqlite3IsIdChar(tls *libc.TLS, c U8) int32

Make the IdChar function accessible from ctime.c and alter.c

func Xsqlite3IsLikeFunction Uses

func Xsqlite3IsLikeFunction(tls *libc.TLS, db uintptr, pExpr uintptr, pIsNocase uintptr, aWc uintptr) int32

pExpr points to an expression which implements a function. If it is appropriate to apply the LIKE optimization to that function then set aWc[0] through aWc[2] to the wildcard characters and the escape character and then return TRUE. If the function is not a LIKE-style function then return FALSE.

The expression "a LIKE b ESCAPE c" is only considered a valid LIKE operator if c is a string literal that is exactly one byte in length. That one byte is stored in aWc[3]. aWc[3] is set to zero if there is no ESCAPE clause.

*pIsNocase is set to true if uppercase and lowercase are equivalent for the function (default for LIKE). If the function makes the distinction between uppercase and lowercase (as does GLOB) then *pIsNocase is set to false.

func Xsqlite3IsNaN Uses

func Xsqlite3IsNaN(tls *libc.TLS, x float64) int32

Return true if the floating point value is Not a Number (NaN).

func Xsqlite3IsReadOnly Uses

func Xsqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, viewOk int32) int32

Check to make sure the given table is writable. If it is not writable, generate an error message and return 1. If it is writable return 0;

func Xsqlite3IsRowid Uses

func Xsqlite3IsRowid(tls *libc.TLS, z uintptr) int32

Return TRUE if the given string is a row-id column name.

func Xsqlite3IsShadowTableOf Uses

func Xsqlite3IsShadowTableOf(tls *libc.TLS, db uintptr, pTab uintptr, zName uintptr) int32

Return true if pTab is a virtual table and zName is a shadow table name for that virtual table.

func Xsqlite3JoinType Uses

func Xsqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC uintptr) int32

Given 1 to 3 identifiers preceding the JOIN keyword, determine the type of join. Return an integer constant that expresses that type in terms of the following bit values:

JT_INNER
JT_CROSS
JT_OUTER
JT_NATURAL
JT_LEFT
JT_RIGHT

A full outer join is the combination of JT_LEFT and JT_RIGHT.

If an illegal or unsupported join type is seen, then still return a join type, but put an error in the pParse structure.

func Xsqlite3JournalIsInMemory Uses

func Xsqlite3JournalIsInMemory(tls *libc.TLS, p uintptr) int32

The file-handle passed as the only argument is open on a journal file. Return true if this "journal file" is currently stored in heap memory, or false otherwise.

func Xsqlite3JournalModename Uses

func Xsqlite3JournalModename(tls *libc.TLS, eMode int32) uintptr

Parameter eMode must be one of the PAGER_JOURNALMODE_XXX constants defined in pager.h. This function returns the associated lowercase journal-mode name.

func Xsqlite3JournalOpen Uses

func Xsqlite3JournalOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pJfd uintptr, flags int32, nSpill int32) int32

Open a journal file.

The behaviour of the journal file depends on the value of parameter nSpill. If nSpill is 0, then the journal file is always create and accessed using the underlying VFS. If nSpill is less than zero, then all content is always stored in main-memory. Finally, if nSpill is a positive value, then the journal file is initially created in-memory but may be flushed to disk later on. In this case the journal file is flushed to disk either when it grows larger than nSpill bytes in size, or when sqlite3JournalCreate() is called.

func Xsqlite3JournalSize Uses

func Xsqlite3JournalSize(tls *libc.TLS, pVfs uintptr) int32

Return the number of bytes required to store a JournalFile that uses vfs pVfs to create the underlying on-disk files.

func Xsqlite3Json1Init Uses

func Xsqlite3Json1Init(tls *libc.TLS, db uintptr) int32

func Xsqlite3KeyInfoAlloc Uses

func Xsqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) uintptr

Allocate a KeyInfo object sufficient for an index of N key columns and X extra columns.

func Xsqlite3KeyInfoFromExprList Uses

func Xsqlite3KeyInfoFromExprList(tls *libc.TLS, pParse uintptr, pList uintptr, iStart int32, nExtra int32) uintptr

Given an expression list, generate a KeyInfo structure that records the collating sequence for each expression in that expression list.

If the ExprList is an ORDER BY or GROUP BY clause then the resulting KeyInfo structure is appropriate for initializing a virtual index to implement that clause. If the ExprList is the result set of a SELECT then the KeyInfo structure is appropriate for initializing a virtual index to implement a DISTINCT test.

Space to hold the KeyInfo structure is obtained from malloc. The calling function is responsible for seeing that this structure is eventually freed.

func Xsqlite3KeyInfoOfIndex Uses

func Xsqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) uintptr

Return a KeyInfo structure that is appropriate for the given Index.

The caller should invoke sqlite3KeyInfoUnref() on the returned object when it has finished using it.

func Xsqlite3KeyInfoRef Uses

func Xsqlite3KeyInfoRef(tls *libc.TLS, p uintptr) uintptr

Make a new pointer to a KeyInfo object

func Xsqlite3KeyInfoUnref Uses

func Xsqlite3KeyInfoUnref(tls *libc.TLS, p uintptr)

Deallocate a KeyInfo object

func Xsqlite3KeywordCode Uses

func Xsqlite3KeywordCode(tls *libc.TLS, z uintptr, n int32) int32

func Xsqlite3LeaveMutexAndCloseZombie Uses

func Xsqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr)

Close the mutex on database connection db.

Furthermore, if database connection db is a zombie (meaning that there has been a prior call to sqlite3_close(db) or sqlite3_close_v2(db)) and every sqlite3_stmt has now been finalized and every sqlite3_backup has finished, then free all resources.

func Xsqlite3LocateCollSeq Uses

func Xsqlite3LocateCollSeq(tls *libc.TLS, pParse uintptr, zName uintptr) uintptr

This function returns the collation sequence for database native text encoding identified by the string zName.

If the requested collation sequence is not available, or not available in the database native encoding, the collation factory is invoked to request it. If the collation factory does not supply such a sequence, and the sequence is available in another text encoding, then that is returned instead.

If no versions of the requested collations sequence are available, or another error occurs, NULL is returned and an error message written into pParse.

This routine is a wrapper around sqlite3FindCollSeq(). This routine invokes the collation factory if the named collation cannot be found and generates an error message.

See also: sqlite3FindCollSeq(), sqlite3GetCollSeq()

func Xsqlite3LocateTable Uses

func Xsqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags U32, zName uintptr, zDbase uintptr) uintptr

Locate the in-memory structure that describes a particular database table given the name of that table and (optionally) the name of the database containing the table. Return NULL if not found. Also leave an error message in pParse->zErrMsg.

The difference between this routine and sqlite3FindTable() is that this routine leaves an error message in pParse->zErrMsg where sqlite3FindTable() does not.

func Xsqlite3LocateTableItem Uses

func Xsqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags U32, p uintptr) uintptr

Locate the table identified by *p.

This is a wrapper around sqlite3LocateTable(). The difference between sqlite3LocateTable() and this function is that this function restricts the search to schema (p->pSchema) if it is not NULL. p->pSchema may be non-NULL if it is part of a view or trigger program definition. See sqlite3FixSrcList() for details.

func Xsqlite3LookasideUsed Uses

func Xsqlite3LookasideUsed(tls *libc.TLS, db uintptr, pHighwater uintptr) int32

Count the number of slots of lookaside memory that are outstanding

func Xsqlite3MPrintf Uses

func Xsqlite3MPrintf(tls *libc.TLS, db uintptr, zFormat uintptr, va uintptr) uintptr

Print into memory obtained from sqliteMalloc(). Use the internal %-conversion extensions.

func Xsqlite3Malloc Uses

func Xsqlite3Malloc(tls *libc.TLS, n U64) uintptr

Allocate memory. This routine is like sqlite3_malloc() except that it assumes the memory subsystem has already been initialized.

func Xsqlite3MallocEnd Uses

func Xsqlite3MallocEnd(tls *libc.TLS)

Deinitialize the memory allocation subsystem.

func Xsqlite3MallocInit Uses

func Xsqlite3MallocInit(tls *libc.TLS) int32

Initialize the memory allocation subsystem.

func Xsqlite3MallocMutex Uses

func Xsqlite3MallocMutex(tls *libc.TLS) uintptr

Return the memory allocator mutex. sqlite3_status() needs it.

func Xsqlite3MallocSize Uses

func Xsqlite3MallocSize(tls *libc.TLS, p uintptr) int32

Return the size of a memory allocation previously obtained from sqlite3Malloc() or sqlite3_malloc().

func Xsqlite3MallocZero Uses

func Xsqlite3MallocZero(tls *libc.TLS, n U64) uintptr

Allocate and zero memory.

func Xsqlite3MatchEName Uses

func Xsqlite3MatchEName(tls *libc.TLS, pItem uintptr, zCol uintptr, zTab uintptr, zDb uintptr) int32

Subqueries stores the original database, table and column names for their result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN". Check to see if the zSpan given to this routine matches the zDb, zTab, and zCol. If any of zDb, zTab, and zCol are NULL then those fields will match anything.

func Xsqlite3MaterializeView Uses

func Xsqlite3MaterializeView(tls *libc.TLS, pParse uintptr, pView uintptr, pWhere uintptr, pOrderBy uintptr, pLimit uintptr, iCur int32)

Evaluate a view and store its result in an ephemeral table. The pWhere argument is an optional WHERE clause that restricts the set of rows in the view that are to be added to the ephemeral table.

func Xsqlite3MayAbort Uses

func Xsqlite3MayAbort(tls *libc.TLS, pParse uintptr)

The code generator calls this routine if is discovers that it is possible to abort a statement prior to completion. In order to perform this abort without corrupting the database, we need to make sure that the statement is protected by a statement transaction.

Technically, we only need to set the mayAbort flag if the isMultiWrite flag was previously set. There is a time dependency such that the abort must occur after the multiwrite. This makes some statements involving the REPLACE conflict resolution algorithm go a little faster. But taking advantage of this time dependency makes it more difficult to prove that the code is correct (in particular, it prevents us from writing an effective implementation of sqlite3AssertMayAbort()) and so we have chosen to take the safe route and skip the optimization.

func Xsqlite3MemCompare Uses

func Xsqlite3MemCompare(tls *libc.TLS, pMem1 uintptr, pMem2 uintptr, pColl uintptr) int32

Compare the values contained by the two memory cells, returning negative, zero or positive if pMem1 is less than, equal to, or greater than pMem2. Sorting order is NULL's first, followed by numbers (integers and reals) sorted numerically, followed by text ordered by the collating sequence pColl and finally blob's ordered by memcmp().

Two NULL values are considered equal by this function.

func Xsqlite3MemJournalOpen Uses

func Xsqlite3MemJournalOpen(tls *libc.TLS, pJfd uintptr)

Open an in-memory journal file.

func Xsqlite3MemSetDefault Uses

func Xsqlite3MemSetDefault(tls *libc.TLS)

This routine is the only routine in this file with external linkage.

Populate the low-level memory allocation function pointers in sqlite3GlobalConfig.m with pointers to the routines in this file.

func Xsqlite3MemdbInit Uses

func Xsqlite3MemdbInit(tls *libc.TLS) int32

This routine is called when the extension is loaded. Register the new VFS.

func Xsqlite3MisuseError Uses

func Xsqlite3MisuseError(tls *libc.TLS, lineno int32) int32

func Xsqlite3MulInt64 Uses

func Xsqlite3MulInt64(tls *libc.TLS, pA uintptr, iB I64) int32

func Xsqlite3MultiWrite Uses

func Xsqlite3MultiWrite(tls *libc.TLS, pParse uintptr)

Indicate that the statement currently under construction might write more than one entry (example: deleting one row then inserting another, inserting multiple rows in a table, or inserting a row and index entries.) If an abort occurs after some of these writes have completed, then it will be necessary to undo the completed writes.

func Xsqlite3MutexAlloc Uses

func Xsqlite3MutexAlloc(tls *libc.TLS, id int32) uintptr

func Xsqlite3MutexEnd Uses

func Xsqlite3MutexEnd(tls *libc.TLS) int32

Shutdown the mutex system. This call frees resources allocated by sqlite3MutexInit().

func Xsqlite3MutexInit Uses

func Xsqlite3MutexInit(tls *libc.TLS) int32

Initialize the mutex system.

func Xsqlite3NameFromToken Uses

func Xsqlite3NameFromToken(tls *libc.TLS, db uintptr, pName uintptr) uintptr

Given a token, return a string that consists of the text of that token. Space to hold the returned string is obtained from sqliteMalloc() and must be freed by the calling function.

Any quotation marks (ex: "name", 'name', [name], or `name`) that surround the body of the token are removed.

Tokens are often just pointers into the original SQL text and so are not \000 terminated and are not persistent. The returned string is \000 terminated and is persistent.

func Xsqlite3NestedParse Uses

func Xsqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uintptr)

Run the parser and code generator recursively in order to generate code for the SQL statement given onto the end of the pParse context currently under construction. When the parser is run recursively this way, the final OP_Halt is not appended and other initialization and finalization steps are omitted because those are handling by the outermost parser.

Not everything is nestable. This facility is designed to permit INSERT, UPDATE, and DELETE operations against the schema table. Use care if you decide to try to use this routine for some other purposes.

func Xsqlite3NoopDestructor Uses

func Xsqlite3NoopDestructor(tls *libc.TLS, p uintptr)

A no-op destructor

func Xsqlite3NoopMutex Uses

func Xsqlite3NoopMutex(tls *libc.TLS) uintptr

func Xsqlite3NotPureFunc Uses

func Xsqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) int32

Cause a function to throw an error if it was call from OP_PureFunc rather than OP_Function.

OP_PureFunc means that the function must be deterministic, and should throw an error if it is given inputs that would make it non-deterministic. This routine is invoked by date/time functions that use non-deterministic features such as 'now'.

func Xsqlite3OomClear Uses

func Xsqlite3OomClear(tls *libc.TLS, db uintptr)

This routine reactivates the memory allocator and clears the db->mallocFailed flag as necessary.

The memory allocator is not restarted if there are running VDBEs.

func Xsqlite3OomFault Uses

func Xsqlite3OomFault(tls *libc.TLS, db uintptr)

Call this routine to record the fact that an OOM (out-of-memory) error has happened. This routine will set db->mallocFailed, and also temporarily disable the lookaside memory allocator and interrupt any running VDBEs.

func Xsqlite3OpcodeName Uses

func Xsqlite3OpcodeName(tls *libc.TLS, i int32) uintptr

************* End of hash.c *********************************************** ************* Begin file opcodes.c **************************************** Automatically generated. Do not edit See the tool/mkopcodec.tcl script for details.

func Xsqlite3OpenSchemaTable Uses

func Xsqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32)

Open the sqlite_schema table stored in database number iDb for writing. The table is opened using cursor 0.

func Xsqlite3OpenTable Uses

func Xsqlite3OpenTable(tls *libc.TLS, pParse uintptr, iCur int32, iDb int32, pTab uintptr, opcode int32)

Generate code that will

(1) acquire a lock for table pTab then
(2) open pTab as cursor iCur.

If pTab is a WITHOUT ROWID table, then it is the PRIMARY KEY index for that table that is actually opened.

func Xsqlite3OpenTableAndIndices Uses

func Xsqlite3OpenTableAndIndices(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, p5 U8, iBase int32, aToOpen uintptr, piDataCur uintptr, piIdxCur uintptr) int32

Allocate cursors for the pTab table and all its indices and generate code to open and initialized those cursors.

The cursor for the object that contains the complete data (normally the table itself, but the PRIMARY KEY index in the case of a WITHOUT ROWID table) is returned in *piDataCur. The first index cursor is returned in *piIdxCur. The number of indices is returned.

Use iBase as the first cursor (either the *piDataCur for rowid tables or the first index for WITHOUT ROWID tables) if it is non-negative. If iBase is negative, then allocate the next available cursor.

For a rowid table, *piDataCur will be exactly one less than *piIdxCur. For a WITHOUT ROWID table, *piDataCur will be somewhere in the range of *piIdxCurs, depending on where the PRIMARY KEY index appears on the pTab->pIndex list.

If pTab is a virtual table, then this routine is a no-op and the *piDataCur and *piIdxCur values are left uninitialized.

func Xsqlite3OpenTempDatabase Uses

func Xsqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) int32

Make sure the TEMP database is open and available for use. Return the number of errors. Leave any error messages in the pParse structure.

func Xsqlite3OsAccess Uses

func Xsqlite3OsAccess(tls *libc.TLS, pVfs uintptr, zPath uintptr, flags int32, pResOut uintptr) int32

func Xsqlite3OsCheckReservedLock Uses

func Xsqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) int32

func Xsqlite3OsClose Uses

func Xsqlite3OsClose(tls *libc.TLS, pId uintptr)

The following routines are convenience wrappers around methods of the sqlite3_file object. This is mostly just syntactic sugar. All of this would be completely automatic if SQLite were coded using C++ instead of plain old C.

func Xsqlite3OsCloseFree Uses

func Xsqlite3OsCloseFree(tls *libc.TLS, pFile uintptr)

func Xsqlite3OsCurrentTimeInt64 Uses

func Xsqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) int32

func Xsqlite3OsDelete Uses

func Xsqlite3OsDelete(tls *libc.TLS, pVfs uintptr, zPath uintptr, dirSync int32) int32

func Xsqlite3OsDeviceCharacteristics Uses

func Xsqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) int32

func Xsqlite3OsDlClose Uses

func Xsqlite3OsDlClose(tls *libc.TLS, pVfs uintptr, pHandle uintptr)

func Xsqlite3OsDlError Uses

func Xsqlite3OsDlError(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr)

func Xsqlite3OsDlOpen Uses

func Xsqlite3OsDlOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr) uintptr

func Xsqlite3OsDlSym Uses

func Xsqlite3OsDlSym(tls *libc.TLS, pVfs uintptr, pHdle uintptr, zSym uintptr) uintptr

func Xsqlite3OsFetch Uses

func Xsqlite3OsFetch(tls *libc.TLS, id uintptr, iOff I64, iAmt int32, pp uintptr) int32

The real implementation of xFetch and xUnfetch

func Xsqlite3OsFileControl Uses

func Xsqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) int32

Use sqlite3OsFileControl() when we are doing something that might fail and we need to know about the failures. Use sqlite3OsFileControlHint() when simply tossing information over the wall to the VFS and we do not really care if the VFS receives and understands the information since it is only a hint and can be safely ignored. The sqlite3OsFileControlHint() routine has no return value since the return value would be meaningless.

func Xsqlite3OsFileControlHint Uses

func Xsqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr)

func Xsqlite3OsFileSize Uses

func Xsqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) int32

func Xsqlite3OsFullPathname Uses

func Xsqlite3OsFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nPathOut int32, zPathOut uintptr) int32

func Xsqlite3OsGetLastError Uses

func Xsqlite3OsGetLastError(tls *libc.TLS, pVfs uintptr) int32

func Xsqlite3OsInit Uses

func Xsqlite3OsInit(tls *libc.TLS) int32

This function is a wrapper around the OS specific implementation of sqlite3_os_init(). The purpose of the wrapper is to provide the ability to simulate a malloc failure, so that the handling of an error in sqlite3_os_init() by the upper layers can be tested.

func Xsqlite3OsLock Uses

func Xsqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) int32

func Xsqlite3OsOpen Uses

func Xsqlite3OsOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags int32, pFlagsOut uintptr) int32

The next group of routines are convenience wrappers around the VFS methods.

func Xsqlite3OsOpenMalloc Uses

func Xsqlite3OsOpenMalloc(tls *libc.TLS, pVfs uintptr, zFile uintptr, ppFile uintptr, flags int32, pOutFlags uintptr) int32

func Xsqlite3OsRandomness Uses

func Xsqlite3OsRandomness(tls *libc.TLS, pVfs uintptr, nByte int32, zBufOut uintptr) int32

func Xsqlite3OsRead Uses

func Xsqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset I64) int32

func Xsqlite3OsSectorSize Uses

func Xsqlite3OsSectorSize(tls *libc.TLS, id uintptr) int32

func Xsqlite3OsShmBarrier Uses

func Xsqlite3OsShmBarrier(tls *libc.TLS, id uintptr)

func Xsqlite3OsShmLock Uses

func Xsqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) int32

func Xsqlite3OsShmMap Uses

func Xsqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) int32

func Xsqlite3OsShmUnmap Uses

func Xsqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) int32

func Xsqlite3OsSleep Uses

func Xsqlite3OsSleep(tls *libc.TLS, pVfs uintptr, nMicro int32) int32

func Xsqlite3OsSync Uses

func Xsqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) int32

func Xsqlite3OsTruncate Uses

func Xsqlite3OsTruncate(tls *libc.TLS, id uintptr, size I64) int32

func