// Code generated by ccgo. DO NOT EDIT.
/*
SQLite Is Public Domain
All of the code and documentation in SQLite has been dedicated to the public
domain by the authors. All code authors, and representatives of the companies
they work for, have signed affidavits dedicating their contributions to the
public domain and originals of those signed affidavits are stored in a firesafe
at the main offices of Hwaci. Anyone is free to copy, modify, publish, use,
compile, sell, or distribute the original SQLite code, either in source code
form or as a compiled binary, for any purpose, commercial or non-commercial,
and by any means.
The previous paragraph applies to the deliverable code and documentation in
SQLite - those parts of the SQLite library that you actually bundle and ship
with a larger application. Some scripts used as part of the build process (for
example the "configure" scripts generated by autoconf) might fall under other
open-source licenses. Nothing from these build scripts ever reaches the final
deliverable SQLite library, however, and so the licenses associated with those
scripts should not be a factor in assessing your rights to copy and use the
SQLite library.
All of the deliverable code in SQLite has been written from scratch. No code
has been taken from other projects or from the open internet. Every line of
code can be traced back to its original author, and all of those authors have
public domain dedications on file. So the SQLite code base is clean and is
uncontaminated with licensed code from other projects.
*/
// sqlite3.c
// *****************************************************************************
// This file is an amalgamation of many separate C source files from SQLite
// version 3.19.3. By combining all the individual C code files into this
// single large file, the entire code can be compiled as a single translation
// unit. This allows many compilers to do optimizations that would not be
// possible if the files were compiled separately. Performance improvements
// of 5% or more are commonly seen when SQLite is compiled as a single
// translation unit.
//
// This file is all you need to compile SQLite. To use SQLite in other
// programs, you need this file and the "sqlite3.h" header file that defines
// the programming interface to the SQLite library. (If you do not have
// the "sqlite3.h" header file at hand, you will find a copy embedded within
// the text of this file. Search for "Begin file sqlite3.h" to find the start
// of the embedded sqlite3.h header file.) Additional code files may be needed
// if you want a wrapper to interface SQLite with your choice of programming
// language. The code for the "sqlite3" command-line shell is also in a
// separate file. This file contains only code for the core SQLite library.
package bin
import (
"fmt"
"math"
"os"
"path"
"runtime"
"unsafe"
"github.com/cznic/crt"
)
func ftrace(s string, args ...interface{}) {
_, fn, fl, _ := runtime.Caller(1)
fmt.Fprintf(os.Stderr, "# %s:%d: %v\n", path.Base(fn), fl, fmt.Sprintf(s, args...))
os.Stderr.Sync()
}
const (
XFTS5_TOKENIZE_AUX = 8
XFTS5_TOKENIZE_DOCUMENT = 4
XFTS5_TOKENIZE_PREFIX = 2
XFTS5_TOKENIZE_QUERY = 1
XFTS5_TOKEN_COLOCATED = 1
XFULLY_WITHIN = 2
XNOT_WITHIN = 0
XPARTLY_WITHIN = 1
XSQLITE3_TEXT = 3
XSQLITE_ABORT = 4
XSQLITE_ABORT_ROLLBACK = 516
XSQLITE_ACCESS_EXISTS = 0
XSQLITE_ACCESS_READ = 2
XSQLITE_ACCESS_READWRITE = 1
XSQLITE_ALTER_TABLE = 26
XSQLITE_ANALYZE = 28
XSQLITE_ANY = 5
XSQLITE_ATTACH = 24
XSQLITE_AUTH = 23
XSQLITE_AUTH_USER = 279
XSQLITE_BLOB = 4
XSQLITE_BUSY = 5
XSQLITE_BUSY_RECOVERY = 261
XSQLITE_BUSY_SNAPSHOT = 517
XSQLITE_CANTOPEN = 14
XSQLITE_CANTOPEN_CONVPATH = 1038
XSQLITE_CANTOPEN_FULLPATH = 782
XSQLITE_CANTOPEN_ISDIR = 526
XSQLITE_CANTOPEN_NOTEMPDIR = 270
XSQLITE_CHECKPOINT_FULL = 1
XSQLITE_CHECKPOINT_PASSIVE = 0
XSQLITE_CHECKPOINT_RESTART = 2
XSQLITE_CHECKPOINT_TRUNCATE = 3
XSQLITE_CONFIG_COVERING_INDEX_SCAN = 20
XSQLITE_CONFIG_GETMALLOC = 5
XSQLITE_CONFIG_GETMUTEX = 11
XSQLITE_CONFIG_GETPCACHE = 15
XSQLITE_CONFIG_GETPCACHE2 = 19
XSQLITE_CONFIG_HEAP = 8
XSQLITE_CONFIG_LOG = 16
XSQLITE_CONFIG_LOOKASIDE = 13
XSQLITE_CONFIG_MALLOC = 4
XSQLITE_CONFIG_MEMSTATUS = 9
XSQLITE_CONFIG_MMAP_SIZE = 22
XSQLITE_CONFIG_MULTITHREAD = 2
XSQLITE_CONFIG_MUTEX = 10
XSQLITE_CONFIG_PAGECACHE = 7
XSQLITE_CONFIG_PCACHE = 14
XSQLITE_CONFIG_PCACHE2 = 18
XSQLITE_CONFIG_PCACHE_HDRSZ = 24
XSQLITE_CONFIG_PMASZ = 25
XSQLITE_CONFIG_SCRATCH = 6
XSQLITE_CONFIG_SERIALIZED = 3
XSQLITE_CONFIG_SINGLETHREAD = 1
XSQLITE_CONFIG_SQLLOG = 21
XSQLITE_CONFIG_STMTJRNL_SPILL = 26
XSQLITE_CONFIG_URI = 17
XSQLITE_CONFIG_WIN32_HEAPSIZE = 23
XSQLITE_CONSTRAINT = 19
XSQLITE_CONSTRAINT_CHECK = 275
XSQLITE_CONSTRAINT_COMMITHOOK = 531
XSQLITE_CONSTRAINT_FOREIGNKEY = 787
XSQLITE_CONSTRAINT_FUNCTION = 1043
XSQLITE_CONSTRAINT_NOTNULL = 1299
XSQLITE_CONSTRAINT_PRIMARYKEY = 1555
XSQLITE_CONSTRAINT_ROWID = 2579
XSQLITE_CONSTRAINT_TRIGGER = 1811
XSQLITE_CONSTRAINT_UNIQUE = 2067
XSQLITE_CONSTRAINT_VTAB = 2323
XSQLITE_COPY = 0
XSQLITE_CORRUPT = 11
XSQLITE_CORRUPT_VTAB = 267
XSQLITE_CREATE_INDEX = 1
XSQLITE_CREATE_TABLE = 2
XSQLITE_CREATE_TEMP_INDEX = 3
XSQLITE_CREATE_TEMP_TABLE = 4
XSQLITE_CREATE_TEMP_TRIGGER = 5
XSQLITE_CREATE_TEMP_VIEW = 6
XSQLITE_CREATE_TRIGGER = 7
XSQLITE_CREATE_VIEW = 8
XSQLITE_CREATE_VTABLE = 29
XSQLITE_DBCONFIG_ENABLE_FKEY = 1002
XSQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER = 1004
XSQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION = 1005
XSQLITE_DBCONFIG_ENABLE_TRIGGER = 1003
XSQLITE_DBCONFIG_LOOKASIDE = 1001
XSQLITE_DBCONFIG_MAINDBNAME = 1000
XSQLITE_DBCONFIG_NO_CKPT_ON_CLOSE = 1006
XSQLITE_DBSTATUS_CACHE_HIT = 7
XSQLITE_DBSTATUS_CACHE_MISS = 8
XSQLITE_DBSTATUS_CACHE_USED = 1
XSQLITE_DBSTATUS_CACHE_USED_SHARED = 11
XSQLITE_DBSTATUS_CACHE_WRITE = 9
XSQLITE_DBSTATUS_DEFERRED_FKS = 10
XSQLITE_DBSTATUS_LOOKASIDE_HIT = 4
XSQLITE_DBSTATUS_LOOKASIDE_MISS_FULL = 6
XSQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE = 5
XSQLITE_DBSTATUS_LOOKASIDE_USED = 0
XSQLITE_DBSTATUS_MAX = 11
XSQLITE_DBSTATUS_SCHEMA_USED = 2
XSQLITE_DBSTATUS_STMT_USED = 3
XSQLITE_DELETE = 9
XSQLITE_DENY = 1
XSQLITE_DETACH = 25
XSQLITE_DETERMINISTIC = 2048
XSQLITE_DONE = 101
XSQLITE_DROP_INDEX = 10
XSQLITE_DROP_TABLE = 11
XSQLITE_DROP_TEMP_INDEX = 12
XSQLITE_DROP_TEMP_TABLE = 13
XSQLITE_DROP_TEMP_TRIGGER = 14
XSQLITE_DROP_TEMP_VIEW = 15
XSQLITE_DROP_TRIGGER = 16
XSQLITE_DROP_VIEW = 17
XSQLITE_DROP_VTABLE = 30
XSQLITE_EMPTY = 16
XSQLITE_ERROR = 1
XSQLITE_EXTERN = 0
XSQLITE_FAIL = 3
XSQLITE_FCNTL_BUSYHANDLER = 15
XSQLITE_FCNTL_CHUNK_SIZE = 6
XSQLITE_FCNTL_COMMIT_PHASETWO = 22
XSQLITE_FCNTL_FILE_POINTER = 7
XSQLITE_FCNTL_GET_LOCKPROXYFILE = 2
XSQLITE_FCNTL_HAS_MOVED = 20
XSQLITE_FCNTL_JOURNAL_POINTER = 28
XSQLITE_FCNTL_LAST_ERRNO = 4
XSQLITE_FCNTL_LOCKSTATE = 1
XSQLITE_FCNTL_MMAP_SIZE = 18
XSQLITE_FCNTL_OVERWRITE = 11
XSQLITE_FCNTL_PDB = 30
XSQLITE_FCNTL_PERSIST_WAL = 10
XSQLITE_FCNTL_POWERSAFE_OVERWRITE = 13
XSQLITE_FCNTL_PRAGMA = 14
XSQLITE_FCNTL_RBU = 26
XSQLITE_FCNTL_SET_LOCKPROXYFILE = 3
XSQLITE_FCNTL_SIZE_HINT = 5
XSQLITE_FCNTL_SYNC = 21
XSQLITE_FCNTL_SYNC_OMITTED = 8
XSQLITE_FCNTL_TEMPFILENAME = 16
XSQLITE_FCNTL_TRACE = 19
XSQLITE_FCNTL_VFSNAME = 12
XSQLITE_FCNTL_VFS_POINTER = 27
XSQLITE_FCNTL_WAL_BLOCK = 24
XSQLITE_FCNTL_WIN32_AV_RETRY = 9
XSQLITE_FCNTL_WIN32_GET_HANDLE = 29
XSQLITE_FCNTL_WIN32_SET_HANDLE = 23
XSQLITE_FCNTL_ZIPVFS = 25
XSQLITE_FLOAT = 2
XSQLITE_FORMAT = 24
XSQLITE_FULL = 13
XSQLITE_FUNCTION = 31
XSQLITE_GET_LOCKPROXYFILE = 2
XSQLITE_IGNORE = 2
XSQLITE_INDEX_CONSTRAINT_EQ = 2
XSQLITE_INDEX_CONSTRAINT_GE = 32
XSQLITE_INDEX_CONSTRAINT_GLOB = 66
XSQLITE_INDEX_CONSTRAINT_GT = 4
XSQLITE_INDEX_CONSTRAINT_LE = 8
XSQLITE_INDEX_CONSTRAINT_LIKE = 65
XSQLITE_INDEX_CONSTRAINT_LT = 16
XSQLITE_INDEX_CONSTRAINT_MATCH = 64
XSQLITE_INDEX_CONSTRAINT_REGEXP = 67
XSQLITE_INDEX_SCAN_UNIQUE = 1
XSQLITE_INSERT = 18
XSQLITE_INTEGER = 1
XSQLITE_INTERNAL = 2
XSQLITE_INTERRUPT = 9
XSQLITE_IOCAP_ATOMIC = 1
XSQLITE_IOCAP_ATOMIC16K = 64
XSQLITE_IOCAP_ATOMIC1K = 4
XSQLITE_IOCAP_ATOMIC2K = 8
XSQLITE_IOCAP_ATOMIC32K = 128
XSQLITE_IOCAP_ATOMIC4K = 16
XSQLITE_IOCAP_ATOMIC512 = 2
XSQLITE_IOCAP_ATOMIC64K = 256
XSQLITE_IOCAP_ATOMIC8K = 32
XSQLITE_IOCAP_IMMUTABLE = 8192
XSQLITE_IOCAP_POWERSAFE_OVERWRITE = 4096
XSQLITE_IOCAP_SAFE_APPEND = 512
XSQLITE_IOCAP_SEQUENTIAL = 1024
XSQLITE_IOCAP_UNDELETABLE_WHEN_OPEN = 2048
XSQLITE_IOERR = 10
XSQLITE_IOERR_ACCESS = 3338
XSQLITE_IOERR_AUTH = 7178
XSQLITE_IOERR_BLOCKED = 2826
XSQLITE_IOERR_CHECKRESERVEDLOCK = 3594
XSQLITE_IOERR_CLOSE = 4106
XSQLITE_IOERR_CONVPATH = 6666
XSQLITE_IOERR_DELETE = 2570
XSQLITE_IOERR_DELETE_NOENT = 5898
XSQLITE_IOERR_DIR_CLOSE = 4362
XSQLITE_IOERR_DIR_FSYNC = 1290
XSQLITE_IOERR_FSTAT = 1802
XSQLITE_IOERR_FSYNC = 1034
XSQLITE_IOERR_GETTEMPPATH = 6410
XSQLITE_IOERR_LOCK = 3850
XSQLITE_IOERR_MMAP = 6154
XSQLITE_IOERR_NOMEM = 3082
XSQLITE_IOERR_RDLOCK = 2314
XSQLITE_IOERR_READ = 266
XSQLITE_IOERR_SEEK = 5642
XSQLITE_IOERR_SHMLOCK = 5130
XSQLITE_IOERR_SHMMAP = 5386
XSQLITE_IOERR_SHMOPEN = 4618
XSQLITE_IOERR_SHMSIZE = 4874
XSQLITE_IOERR_SHORT_READ = 522
XSQLITE_IOERR_TRUNCATE = 1546
XSQLITE_IOERR_UNLOCK = 2058
XSQLITE_IOERR_VNODE = 6922
XSQLITE_IOERR_WRITE = 778
XSQLITE_LAST_ERRNO = 4
XSQLITE_LIMIT_ATTACHED = 7
XSQLITE_LIMIT_COLUMN = 2
XSQLITE_LIMIT_COMPOUND_SELECT = 4
XSQLITE_LIMIT_EXPR_DEPTH = 3
XSQLITE_LIMIT_FUNCTION_ARG = 6
XSQLITE_LIMIT_LENGTH = 0
XSQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8
XSQLITE_LIMIT_SQL_LENGTH = 1
XSQLITE_LIMIT_TRIGGER_DEPTH = 10
XSQLITE_LIMIT_VARIABLE_NUMBER = 9
XSQLITE_LIMIT_VDBE_OP = 5
XSQLITE_LIMIT_WORKER_THREADS = 11
XSQLITE_LOCKED = 6
XSQLITE_LOCKED_SHAREDCACHE = 262
XSQLITE_LOCK_EXCLUSIVE = 4
XSQLITE_LOCK_NONE = 0
XSQLITE_LOCK_PENDING = 3
XSQLITE_LOCK_RESERVED = 2
XSQLITE_LOCK_SHARED = 1
XSQLITE_MISMATCH = 20
XSQLITE_MISUSE = 21
XSQLITE_MUTEX_FAST = 0
XSQLITE_MUTEX_RECURSIVE = 1
XSQLITE_MUTEX_STATIC_APP1 = 8
XSQLITE_MUTEX_STATIC_APP2 = 9
XSQLITE_MUTEX_STATIC_APP3 = 10
XSQLITE_MUTEX_STATIC_LRU = 6
XSQLITE_MUTEX_STATIC_LRU2 = 7
XSQLITE_MUTEX_STATIC_MASTER = 2
XSQLITE_MUTEX_STATIC_MEM = 3
XSQLITE_MUTEX_STATIC_MEM2 = 4
XSQLITE_MUTEX_STATIC_OPEN = 4
XSQLITE_MUTEX_STATIC_PMEM = 7
XSQLITE_MUTEX_STATIC_PRNG = 5
XSQLITE_MUTEX_STATIC_VFS1 = 11
XSQLITE_MUTEX_STATIC_VFS2 = 12
XSQLITE_MUTEX_STATIC_VFS3 = 13
XSQLITE_NOLFS = 22
XSQLITE_NOMEM = 7
XSQLITE_NOTADB = 26
XSQLITE_NOTFOUND = 12
XSQLITE_NOTICE = 27
XSQLITE_NOTICE_RECOVER_ROLLBACK = 539
XSQLITE_NOTICE_RECOVER_WAL = 283
XSQLITE_NULL = 5
XSQLITE_OK = 0
XSQLITE_OK_LOAD_PERMANENTLY = 256
XSQLITE_OPEN_AUTOPROXY = 32
XSQLITE_OPEN_CREATE = 4
XSQLITE_OPEN_DELETEONCLOSE = 8
XSQLITE_OPEN_EXCLUSIVE = 16
XSQLITE_OPEN_FULLMUTEX = 65536
XSQLITE_OPEN_MAIN_DB = 256
XSQLITE_OPEN_MAIN_JOURNAL = 2048
XSQLITE_OPEN_MASTER_JOURNAL = 16384
XSQLITE_OPEN_MEMORY = 128
XSQLITE_OPEN_NOMUTEX = 32768
XSQLITE_OPEN_PRIVATECACHE = 262144
XSQLITE_OPEN_READONLY = 1
XSQLITE_OPEN_READWRITE = 2
XSQLITE_OPEN_SHAREDCACHE = 131072
XSQLITE_OPEN_SUBJOURNAL = 8192
XSQLITE_OPEN_TEMP_DB = 512
XSQLITE_OPEN_TEMP_JOURNAL = 4096
XSQLITE_OPEN_TRANSIENT_DB = 1024
XSQLITE_OPEN_URI = 64
XSQLITE_OPEN_WAL = 524288
XSQLITE_PERM = 3
XSQLITE_PRAGMA = 19
XSQLITE_PROTOCOL = 15
XSQLITE_RANGE = 25
XSQLITE_READ = 20
XSQLITE_READONLY = 8
XSQLITE_READONLY_CANTLOCK = 520
XSQLITE_READONLY_DBMOVED = 1032
XSQLITE_READONLY_RECOVERY = 264
XSQLITE_READONLY_ROLLBACK = 776
XSQLITE_RECURSIVE = 33
XSQLITE_REINDEX = 27
XSQLITE_REPLACE = 5
XSQLITE_ROLLBACK = 1
XSQLITE_ROW = 100
XSQLITE_SAVEPOINT = 32
XSQLITE_SCANSTAT_EST = 2
XSQLITE_SCANSTAT_EXPLAIN = 4
XSQLITE_SCANSTAT_NAME = 3
XSQLITE_SCANSTAT_NLOOP = 0
XSQLITE_SCANSTAT_NVISIT = 1
XSQLITE_SCANSTAT_SELECTID = 5
XSQLITE_SCHEMA = 17
XSQLITE_SELECT = 21
XSQLITE_SET_LOCKPROXYFILE = 3
XSQLITE_SHM_EXCLUSIVE = 8
XSQLITE_SHM_LOCK = 2
XSQLITE_SHM_NLOCK = 8
XSQLITE_SHM_SHARED = 4
XSQLITE_SHM_UNLOCK = 1
XSQLITE_SOURCE_ID = "2017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b"
XSQLITE_STATUS_MALLOC_COUNT = 9
XSQLITE_STATUS_MALLOC_SIZE = 5
XSQLITE_STATUS_MEMORY_USED = 0
XSQLITE_STATUS_PAGECACHE_OVERFLOW = 2
XSQLITE_STATUS_PAGECACHE_SIZE = 7
XSQLITE_STATUS_PAGECACHE_USED = 1
XSQLITE_STATUS_PARSER_STACK = 6
XSQLITE_STATUS_SCRATCH_OVERFLOW = 4
XSQLITE_STATUS_SCRATCH_SIZE = 8
XSQLITE_STATUS_SCRATCH_USED = 3
XSQLITE_STMTSTATUS_AUTOINDEX = 3
XSQLITE_STMTSTATUS_FULLSCAN_STEP = 1
XSQLITE_STMTSTATUS_SORT = 2
XSQLITE_STMTSTATUS_VM_STEP = 4
XSQLITE_SYNC_DATAONLY = 16
XSQLITE_SYNC_FULL = 3
XSQLITE_SYNC_NORMAL = 2
XSQLITE_TESTCTRL_ALWAYS = 13
XSQLITE_TESTCTRL_ASSERT = 12
XSQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS = 10
XSQLITE_TESTCTRL_BITVEC_TEST = 8
XSQLITE_TESTCTRL_BYTEORDER = 22
XSQLITE_TESTCTRL_EXPLAIN_STMT = 19
XSQLITE_TESTCTRL_FAULT_INSTALL = 9
XSQLITE_TESTCTRL_FIRST = 5
XSQLITE_TESTCTRL_IMPOSTER = 25
XSQLITE_TESTCTRL_ISINIT = 23
XSQLITE_TESTCTRL_ISKEYWORD = 16
XSQLITE_TESTCTRL_LAST = 25
XSQLITE_TESTCTRL_LOCALTIME_FAULT = 18
XSQLITE_TESTCTRL_NEVER_CORRUPT = 20
XSQLITE_TESTCTRL_ONCE_RESET_THRESHOLD = 19
XSQLITE_TESTCTRL_OPTIMIZATIONS = 15
XSQLITE_TESTCTRL_PENDING_BYTE = 11
XSQLITE_TESTCTRL_PRNG_RESET = 7
XSQLITE_TESTCTRL_PRNG_RESTORE = 6
XSQLITE_TESTCTRL_PRNG_SAVE = 5
XSQLITE_TESTCTRL_RESERVE = 14
XSQLITE_TESTCTRL_SCRATCHMALLOC = 17
XSQLITE_TESTCTRL_SORTER_MMAP = 24
XSQLITE_TESTCTRL_VDBE_COVERAGE = 21
XSQLITE_TEXT = 3
XSQLITE_TOOBIG = 18
XSQLITE_TRACE_CLOSE = 8
XSQLITE_TRACE_PROFILE = 2
XSQLITE_TRACE_ROW = 4
XSQLITE_TRACE_STMT = 1
XSQLITE_TRANSACTION = 22
XSQLITE_TRANSIENT = -1
XSQLITE_UPDATE = 23
XSQLITE_UTF16 = 4
XSQLITE_UTF16BE = 3
XSQLITE_UTF16LE = 2
XSQLITE_UTF16_ALIGNED = 8
XSQLITE_UTF8 = 1
XSQLITE_VERSION = "3.19.3"
XSQLITE_VERSION_NUMBER = 3019003
XSQLITE_VTAB_CONSTRAINT_SUPPORT = 1
XSQLITE_WARNING = 28
XSQLITE_WARNING_AUTOINDEX = 284
X_STDC_PREDEF_H = 1
X__ATOMIC_ACQUIRE = 2
X__ATOMIC_ACQ_REL = 4
X__ATOMIC_CONSUME = 1
X__ATOMIC_HLE_ACQUIRE = 65536
X__ATOMIC_HLE_RELEASE = 131072
X__ATOMIC_RELAXED = 0
X__ATOMIC_RELEASE = 3
X__ATOMIC_SEQ_CST = 5
X__BIGGEST_ALIGNMENT__ = 16
X__BYTE_ORDER__ = 1234
X__CHAR_BIT__ = 8
X__DBL_DECIMAL_DIG__ = 17
X__DBL_DIG__ = 15
X__DBL_HAS_DENORM__ = 1
X__DBL_HAS_INFINITY__ = 1
X__DBL_HAS_QUIET_NAN__ = 1
X__DBL_MANT_DIG__ = 53
X__DBL_MAX_10_EXP__ = 308
X__DBL_MAX_EXP__ = 1024
X__DBL_MIN_10_EXP__ = -307
X__DBL_MIN_EXP__ = -1021
X__DEC128_MANT_DIG__ = 34
X__DEC128_MAX_EXP__ = 6145
X__DEC128_MIN_EXP__ = -6142
X__DEC32_MANT_DIG__ = 7
X__DEC32_MAX_EXP__ = 97
X__DEC32_MIN_EXP__ = -94
X__DEC64_MANT_DIG__ = 16
X__DEC64_MAX_EXP__ = 385
X__DEC64_MIN_EXP__ = -382
X__DECIMAL_BID_FORMAT__ = 1
X__DECIMAL_DIG__ = 21
X__DEC_EVAL_METHOD__ = 2
X__FINITE_MATH_ONLY__ = 0
X__FLOAT_WORD_ORDER__ = 1234
X__FLT_DECIMAL_DIG__ = 9
X__FLT_DENORM_MIN__ = 1e-45
X__FLT_DIG__ = 6
X__FLT_EPSILON__ = 1.1920929e-07
X__FLT_EVAL_METHOD__ = 2
X__FLT_HAS_DENORM__ = 1
X__FLT_HAS_INFINITY__ = 1
X__FLT_HAS_QUIET_NAN__ = 1
X__FLT_MANT_DIG__ = 24
X__FLT_MAX_10_EXP__ = 38
X__FLT_MAX_EXP__ = 128
X__FLT_MAX__ = 3.4028235e+38
X__FLT_MIN_10_EXP__ = -37
X__FLT_MIN_EXP__ = -125
X__FLT_MIN__ = 1.1754944e-38
X__FLT_RADIX__ = 2
X__FUNCTION__ = 0
X__GXX_ABI_VERSION = 1010
X__INT16_MAX__ = 32767
X__INT32_MAX__ = 2147483647
X__INT32_TYPE__ = 0
X__INT64_MAX__ = 9223372036854775807
X__INT8_MAX__ = 127
X__INTMAX_MAX__ = 9223372036854775807
X__INTPTR_MAX__ = 2147483647
X__INTPTR_TYPE__ = 0
X__INT_FAST16_MAX__ = 2147483647
X__INT_FAST16_TYPE__ = 0
X__INT_FAST32_MAX__ = 2147483647
X__INT_FAST32_TYPE__ = 0
X__INT_FAST64_MAX__ = 9223372036854775807
X__INT_FAST8_MAX__ = 127
X__INT_LEAST16_MAX__ = 32767
X__INT_LEAST32_MAX__ = 2147483647
X__INT_LEAST32_TYPE__ = 0
X__INT_LEAST64_MAX__ = 9223372036854775807
X__INT_LEAST8_MAX__ = 127
X__INT_MAX__ = 2147483647
X__LDBL_DENORM_MIN__ = 0
X__LDBL_DIG__ = 18
X__LDBL_EPSILON__ = 1.0842021724855044e-19
X__LDBL_HAS_DENORM__ = 1
X__LDBL_HAS_INFINITY__ = 1
X__LDBL_HAS_QUIET_NAN__ = 1
X__LDBL_MANT_DIG__ = 64
X__LDBL_MAX_10_EXP__ = 4932
X__LDBL_MAX_EXP__ = 16384
X__LDBL_MAX__ = 0
X__LDBL_MIN_10_EXP__ = -4931
X__LDBL_MIN_EXP__ = -16381
X__LDBL_MIN__ = 0
X__LONG_LONG_MAX__ = 9223372036854775807
X__LONG_MAX__ = 2147483647
X__NO_INLINE__ = 1
X__ORDER_BIG_ENDIAN__ = 4321
X__ORDER_LITTLE_ENDIAN__ = 1234
X__ORDER_PDP_ENDIAN__ = 3412
X__PRAGMA_REDEFINE_EXTNAME = 1
X__PTRDIFF_MAX__ = 2147483647
X__PTRDIFF_TYPE__ = 0
X__SCHAR_MAX__ = 127
X__SEG_FS = 1
X__SEG_GS = 1
X__SHRT_MAX__ = 32767
X__SIG_ATOMIC_MAX__ = 2147483647
X__SIG_ATOMIC_MIN__ = -2147483648
X__SIG_ATOMIC_TYPE__ = 0
X__SIZEOF_DOUBLE__ = 8
X__SIZEOF_FLOAT128__ = 16
X__SIZEOF_FLOAT80__ = 12
X__SIZEOF_FLOAT__ = 4
X__SIZEOF_INT__ = 4
X__SIZEOF_LONG_DOUBLE__ = 12
X__SIZEOF_LONG_LONG__ = 8
X__SIZEOF_LONG__ = 4
X__SIZEOF_POINTER__ = 4
X__SIZEOF_PTRDIFF_T__ = 4
X__SIZEOF_SHORT__ = 2
X__SIZEOF_SIZE_T__ = 4
X__SIZEOF_WCHAR_T__ = 4
X__SIZEOF_WINT_T__ = 4
X__SIZE_MAX__ = 4294967295
X__SSP_STRONG__ = 3
X__STDC_HOSTED__ = 1
X__STDC_IEC_559_COMPLEX__ = 1
X__STDC_IEC_559__ = 1
X__STDC_ISO_10646__ = 201505
X__STDC_NO_THREADS__ = 1
X__STDC_VERSION__ = 199901
X__STDC__ = 1
X__STRICT_ANSI__ = 1
X__UINT16_MAX__ = 65535
X__UINT32_MAX__ = 4294967295
X__UINT64_MAX__ = 18446744073709551615
X__UINT8_MAX__ = 255
X__UINTMAX_MAX__ = 18446744073709551615
X__UINTPTR_MAX__ = 4294967295
X__UINT_FAST16_MAX__ = 4294967295
X__UINT_FAST32_MAX__ = 4294967295
X__UINT_FAST64_MAX__ = 18446744073709551615
X__UINT_FAST8_MAX__ = 255
X__UINT_LEAST16_MAX__ = 65535
X__UINT_LEAST32_MAX__ = 4294967295
X__UINT_LEAST64_MAX__ = 18446744073709551615
X__UINT_LEAST8_MAX__ = 255
X__VERSION__ = "6.2.0 20161005"
X__WCHAR_MAX__ = 2147483647
X__WCHAR_MIN__ = -2147483648
X__WINT_MAX__ = 4294967295
X__WINT_MIN__ = 0
X__code_model_32__ = 1
X__complex__ = 0
X__const = 0
X__i386 = 1
X__i386__ = 1
X__i686 = 1
X__i686__ = 1
X__inline = 0
X__linux = 1
X__linux__ = 1
X__pentiumpro = 1
X__pentiumpro__ = 1
X__restrict = 0
X__unix = 1
X__unix__ = 1
X__volatile = 0
)
func X_start(tls *crt.TLS, _argc int32, _argv **int8) {
crt.X__register_stdfiles(tls, Xstdin, Xstdout, Xstderr)
crt.X__builtin_exit(tls, Xmain(tls, _argc, _argv))
}
var Xstdin unsafe.Pointer
func init() {
Xstdin = unsafe.Pointer(&X__stdfiles)
}
var X__stdfiles [3]unsafe.Pointer
var Xstdout unsafe.Pointer
func init() {
Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 4)
}
var Xstderr unsafe.Pointer
func init() {
Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8)
}
func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) {
r0 = i32(0)
_use(tls, i32(0), Xsqlite3_exec, Xsqlite3_enable_load_extension)
return
}
func _use(tls *crt.TLS, _ int32, args ...interface{}) {
}
// Execute SQL code. Return one of the SQLITE_ success/failure
// codes. Also write an error message into memory obtained from
// malloc() and make *pzErrMsg point to that message.
//
// If the SQL is a query, then for each row in the query result
// the xCallback() function is called. pArg becomes the first
// argument to xCallback(). If xCallback=NULL then no callback
// is invoked, even for queries.
func Xsqlite3_exec(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _xCallback func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, _pArg unsafe.Pointer, _pzErrMsg **int8) (r0 int32) {
var _rc, _callbackIsInit, _1_nCol, _4_i, _14_nErrMsg int32
var _zLeftover *int8
var _pStmt unsafe.Pointer
var _azCols, _1_azVals **int8
_rc = i32(0)
_pStmt = nil
_azCols = nil
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(111141))
}
if _zSql == nil {
_zSql = str(0)
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_sqlite3Error(tls, _db, i32(0))
_2:
if _rc != i32(0) || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == 0 {
goto _exec_out
}
_1_azVals = nil
_pStmt = nil
_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, i32(-1), &_pStmt, &_zLeftover)
func() {
if _rc != i32(0) && _pStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111152), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_execØ00__func__Ø000))), unsafe.Pointer(str(95)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) {
goto _2
}
if _pStmt == nil {
_zSql = _zLeftover
goto _2
}
_callbackIsInit = i32(0)
_1_nCol = Xsqlite3_column_count(tls, _pStmt)
_10:
_rc = Xsqlite3_step(tls, _pStmt)
if _xCallback == nil || i32(100) != _rc && (i32(101) != _rc || _callbackIsInit != 0 || ((_db.X6)&i32(256)) == 0) {
goto _16
}
if _callbackIsInit != 0 {
goto _17
}
_azCols = (**int8)(_sqlite3DbMallocRaw(tls, _db, uint64(uint32((i32(2)*_1_nCol)+i32(1))*u32(4))))
if _azCols == nil {
goto _exec_out
}
_4_i = i32(0)
_19:
if _4_i >= _1_nCol {
goto _22
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 4*uintptr(_4_i))) = Xsqlite3_column_name(tls, _pStmt, _4_i)
func() {
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 4*uintptr(_4_i)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_execØ00__func__Ø000))), unsafe.Pointer(str(121)))
crt.X__builtin_abort(tls)
}
}()
_4_i += 1
goto _19
_22:
_callbackIsInit = i32(1)
_17:
if _rc != i32(100) {
goto _25
}
_1_azVals = (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azCols)) + 4*uintptr(_1_nCol)))
_4_i = i32(0)
_26:
if _4_i >= _1_nCol {
goto _29
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 4*uintptr(_4_i))) = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, _4_i)))
if ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 4*uintptr(_4_i)))) == nil) && (Xsqlite3_column_type(tls, _pStmt, _4_i) != i32(5)) {
_sqlite3OomFault(tls, _db)
goto _exec_out
}
_4_i += 1
goto _26
_29:
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_azVals)) + 4*uintptr(_4_i))) = nil
_25:
if _xCallback(tls, _pArg, _1_nCol, _1_azVals, _azCols) != 0 {
_rc = i32(4)
_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
_pStmt = nil
_sqlite3Error(tls, _db, i32(4))
goto _exec_out
}
_16:
if _rc == i32(100) {
goto _33
}
_rc = _sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
_pStmt = nil
_zSql = _zLeftover
_34:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))))))) & i32(1)) != 0 {
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _34
}
goto _11
_33:
goto _10
_11:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_azCols))
_azCols = nil
goto _2
_exec_out:
if _pStmt != nil {
_sqlite3VdbeFinalize(tls, (*TVdbe)(_pStmt))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_azCols))
_rc = _sqlite3ApiExit(tls, _db, _rc)
if _rc == i32(0) || _pzErrMsg == nil {
goto _38
}
_14_nErrMsg = i32(1) + _sqlite3Strlen30(tls, Xsqlite3_errmsg(tls, _db))
*_pzErrMsg = (*int8)(_sqlite3Malloc(tls, uint64(_14_nErrMsg)))
if (*_pzErrMsg) != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(*_pzErrMsg), (unsafe.Pointer)(Xsqlite3_errmsg(tls, _db)), uint32(_14_nErrMsg))
goto _40
}
_rc = _sqlite3NomemError(tls, i32(111233))
_sqlite3Error(tls, _db, i32(7))
_40:
goto _42
_38:
if _pzErrMsg != nil {
*_pzErrMsg = nil
}
_42:
func() {
if (_rc & (_db.X11)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111240), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_execØ00__func__Ø000))), unsafe.Pointer(str(134)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// Check to make sure we have a valid db pointer. This test is not
// foolproof but it does provide some measure of protection against
// misuse of the interface such as passing in db pointers that are
// NULL or which have been previously closed. If this routine returns
// 1 it means that the db pointer is valid and 0 if it should not be
// dereferenced for any reason. The calling function should invoke
// SQLITE_MISUSE immediately.
//
// sqlite3SafetyCheckOk() requires that the db pointer be valid for
// use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to
// open properly and is not fit for general use but which can be
// used as an argument to sqlite3_errmsg() or sqlite3_close().
func _sqlite3SafetyCheckOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _magic uint32
if _db == nil {
_logBadConnection(tls, str(155))
return i32(0)
}
_magic = _db.X28
if _magic == u32(2687084183) {
goto _1
}
if _sqlite3SafetyCheckSickOrOk(tls, _db) != 0 {
_logBadConnection(tls, str(160))
}
return i32(0)
_1:
return i32(1)
}
// Log an error that is an API call on a connection pointer that should
// not have been used. The "type" of connection pointer is given as the
// argument. The zType is a word like "NULL" or "closed" or "invalid".
func _logBadConnection(tls *crt.TLS, _zType *int8) {
Xsqlite3_log(tls, i32(21), str(169), unsafe.Pointer(_zType))
}
// Format and write a message to the log if logging is enabled.
func Xsqlite3_log(tls *crt.TLS, _iErrCode int32, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
if (_sqlite3Config.X35) != nil {
_ap = args
_renderLogMsg(tls, _iErrCode, _zFormat, _ap)
_ap = nil
}
}
var _sqlite3Config TSqlite3Config
func init() {
_sqlite3Config = TSqlite3Config{X0: i32(1), X1: i32(1), X2: i32(1), X3: i32(1), X4: i32(1), X5: i32(2147483646), X6: i32(0), X7: i32(1200), X8: i32(100), X9: i32(65536), X10: Xsqlite3_mem_methods{}, X11: Xsqlite3_mutex_methods{}, X12: Xsqlite3_pcache_methods2{}, X13: nil, X14: i32(0), X15: i32(0), X16: i32(0), X17: i64(0), X18: i64(2147418112), X19: nil, X20: i32(0), X21: i32(0), X22: nil, X23: i32(0), X24: i32(20), X25: i32(0), X26: i32(0), X27: u32(250), X28: i32(0), X29: i32(0), X30: i32(0), X31: i32(0), X32: i32(0), X33: i32(0), X34: nil, X35: nil, X36: nil, X37: nil, X38: i32(0), X39: i32(2147483646)}
}
// This is the routine that actually formats the sqlite3_log() message.
// We house it in a separate routine from sqlite3_log() to avoid using
// stack space on small-stack systems when logging is disabled.
//
// sqlite3_log() must render into a static buffer. It cannot dynamically
// allocate memory because it might be called while the memory allocator
// mutex is held.
//
// sqlite3VXPrintf() might ask for *temporary* memory allocations for
// certain format characters (%q) or for very large precisions or widths.
// Care must be taken that any sqlite3_log() calls that occur while the
// memory mutex is held do not use these mechanisms.
func _renderLogMsg(tls *crt.TLS, _iErrCode int32, _zFormat *int8, _ap []interface{}) {
var _acc XStrAccum
var _zMsg [210]int8
_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zMsg)), int32(u32(210)), i32(0))
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
(_sqlite3Config.X35)(tls, _sqlite3Config.X36, _iErrCode, _sqlite3StrAccumFinish(tls, &_acc))
_ = _acc
_ = _zMsg
}
// Initialize a string accumulator.
//
// p: The accumulator to be initialized.
// db: Pointer to a database connection. May be NULL. Lookaside
// memory is used if not NULL. db->mallocFailed is set appropriately
// when not NULL.
// zBase: An initial buffer. May be NULL in which case the initial buffer
// is malloced.
// n: Size of zBase in bytes. If total space requirements never exceed
// n then no memory allocations ever occur.
// mx: Maximum number of bytes to accumulate. If mx==0 then no memory
// allocations will ever occur.
func _sqlite3StrAccumInit(tls *crt.TLS, _p *XStrAccum, _db *Xsqlite3, _zBase *int8, _n int32, _mx int32) {
*(**int8)(unsafe.Pointer(&(_p.X2))) = store0((**int8)(unsafe.Pointer(&(_p.X1))), _zBase)
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db
*(*uint32)(unsafe.Pointer(&(_p.X3))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_n)
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(_mx)
*(*uint8)(unsafe.Pointer(&(_p.X6))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_p.X7))) = uint8(i32(0))
}
// Render a string given by "fmt" into the StrAccum object.
func _sqlite3VXPrintf(tls *crt.TLS, _pAccum *XStrAccum, _fmt *int8, _ap []interface{}) {
var _c, _precision, _length, _idx, _width, _nOut, _exp, _e2, _nsd, _49_x, _54_nn, _54_ix, _96_i, _96_nPad, _110_i, _110_j, _110_k, _110_n, _110_isnull, _110_needQuote, _120_k int32
var _29_v int64
var _prefix, _57_x, _110_ch, _110_q int8
var _13_wx, _20_px uint32
var _longvalue, _47_n uint64
var _bufpt, _zOut, _zExtra, _51_cset, _57_pre, _110_escarg *int8
var _realvalue, _rounder, _64_scale float64
var _flag_leftjustify, _flag_prefix, _flag_alternateform, _flag_altform2, _flag_zeropad, _flag_long, _done, _cThousand, _xtype, _bArgList, _flag_dp, _flag_rtz, _51_base uint8
var _pArgList *XPrintfArguments
var _infop *Xet_info
var _buf [70]int8
var _118_pToken *XToken
var _120_pSrc *XSrcList
var _120_pItem *TSrcList_item
_xtype = u8(17)
_zExtra = nil
_pArgList = nil
_bufpt = nil
if (int32(_pAccum.X7) & i32(2)) != i32(0) {
_pArgList = (*XPrintfArguments)(crt.VAPointer(&_ap))
_bArgList = uint8(i32(1))
goto _1
}
_bArgList = uint8(i32(0))
_1:
if store1(&_c, int32(*_fmt)) == i32(0) {
goto _5
}
if _c == i32(37) {
goto _6
}
_bufpt = _fmt
_7:
*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
if ((*_fmt) != 0) && (int32(*_fmt) != i32(37)) {
goto _7
}
_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, int32((uintptr(unsafe.Pointer(_fmt))-uintptr(unsafe.Pointer(_bufpt)))/1))
if int32(*_fmt) == i32(0) {
goto _5
}
_6:
if store1(&_c, int32(*preInc0(&_fmt, 1))) == i32(0) {
_sqlite3StrAccumAppend(tls, _pAccum, str(214), i32(1))
goto _5
}
_flag_leftjustify = store2(&_flag_prefix, store2(&_cThousand, store2(&_flag_alternateform, store2(&_flag_altform2, store2(&_flag_zeropad, uint8(i32(0)))))))
_done = uint8(i32(0))
_11:
switch _c {
case i32(32):
goto _15
case i32(33):
goto _17
case i32(35):
goto _16
case i32(43):
goto _14
case i32(44):
goto _19
case i32(45):
goto _13
case i32(48):
goto _18
default:
goto _20
}
_13:
_flag_leftjustify = uint8(i32(1))
goto _21
_14:
_flag_prefix = uint8(i32(43))
goto _21
_15:
_flag_prefix = uint8(i32(32))
goto _21
_16:
_flag_alternateform = uint8(i32(1))
goto _21
_17:
_flag_altform2 = uint8(i32(1))
goto _21
_18:
_flag_zeropad = uint8(i32(1))
goto _21
_19:
_cThousand = uint8(i32(44))
goto _21
_20:
_done = uint8(i32(1))
goto _21
_21:
if (_done == 0) && (store1(&_c, int32(*preInc0(&_fmt, 1))) != i32(0)) {
goto _11
}
if _c != i32(42) {
goto _23
}
if _bArgList != 0 {
_width = int32(_getIntArg(tls, _pArgList))
goto _25
}
_width = crt.VAInt32(&_ap)
_25:
if _width < i32(0) {
_flag_leftjustify = uint8(i32(1))
_width = func() int32 {
if _width >= i32(-2147483647) {
return (-_width)
}
return i32(0)
}()
}
_c = int32(*preInc0(&_fmt, 1))
goto _29
_23:
_13_wx = uint32(i32(0))
_30:
if (_c >= i32(48)) && (_c <= i32(57)) {
_13_wx = ((_13_wx * uint32(i32(10))) + uint32(_c)) - uint32(i32(48))
_c = int32(*preInc0(&_fmt, 1))
goto _30
}
_width = int32(_13_wx & uint32(i32(2147483647)))
_29:
func() {
if _width < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25327), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(216)))
crt.X__builtin_abort(tls)
}
}()
if _c != i32(46) {
goto _35
}
_c = int32(*preInc0(&_fmt, 1))
if _c != i32(42) {
goto _36
}
if _bArgList != 0 {
_precision = int32(_getIntArg(tls, _pArgList))
goto _38
}
_precision = crt.VAInt32(&_ap)
_38:
_c = int32(*preInc0(&_fmt, 1))
if _precision < i32(0) {
_precision = func() int32 {
if _precision >= i32(-2147483647) {
return (-_precision)
}
return i32(-1)
}()
}
goto _42
_36:
_20_px = uint32(i32(0))
_43:
if (_c >= i32(48)) && (_c <= i32(57)) {
_20_px = ((_20_px * uint32(i32(10))) + uint32(_c)) - uint32(i32(48))
_c = int32(*preInc0(&_fmt, 1))
goto _43
}
_precision = int32(_20_px & uint32(i32(2147483647)))
_42:
goto _46
_35:
_precision = i32(-1)
_46:
func() {
if _precision < i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25359), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(225)))
crt.X__builtin_abort(tls)
}
}()
if _c != i32(108) {
goto _49
}
_flag_long = uint8(i32(1))
_c = int32(*preInc0(&_fmt, 1))
if _c == i32(108) {
_flag_long = uint8(i32(2))
_c = int32(*preInc0(&_fmt, 1))
}
goto _51
_49:
_flag_long = uint8(i32(0))
_51:
_infop = (*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo)) + 6*uintptr(i32(0))))
_xtype = uint8(i32(17))
_idx = i32(0)
_52:
if _idx >= i32(23) {
goto _55
}
if _c == int32((*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo))+6*uintptr(_idx))).X0) {
_infop = (*Xet_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_fmtinfo)) + 6*uintptr(_idx)))
_xtype = _infop.X3
goto _55
}
_idx += 1
goto _52
_55:
switch int32(_xtype) {
case i32(0):
goto _59
case i32(1):
goto _62
case i32(2):
goto _62
case i32(3):
goto _62
case i32(4):
goto _65
case i32(5):
goto _68
case i32(6):
goto _68
case i32(7):
goto _66
case i32(8):
goto _67
case i32(9):
goto _70
case i32(10):
goto _70
case i32(11):
goto _73
case i32(12):
goto _74
case i32(13):
goto _58
case i32(14):
goto _70
case i32(15):
goto _59
case i32(16):
goto _61
default:
goto _75
}
_58:
_flag_long = uint8(i32(1))
_59:
_cThousand = uint8(i32(0))
_61:
if (int32(_infop.X2) & i32(1)) == 0 {
goto _76
}
if _bArgList != 0 {
_29_v = _getIntArg(tls, _pArgList)
goto _82
}
if _flag_long == 0 {
goto _79
}
if int32(_flag_long) == i32(2) {
_29_v = crt.VAInt64(&_ap)
goto _81
}
_29_v = int64(crt.VAInt32(&_ap))
_81:
goto _82
_79:
_29_v = int64(crt.VAInt32(&_ap))
_82:
if _29_v >= int64(i32(0)) {
goto _83
}
if _29_v == i64(-9223372036854775808) {
_longvalue = u64(9223372036854775808)
goto _85
}
_longvalue = uint64(-_29_v)
_85:
_prefix = int8(i32(45))
goto _86
_83:
_longvalue = uint64(_29_v)
_prefix = int8(_flag_prefix)
_86:
goto _87
_76:
if _bArgList != 0 {
_longvalue = uint64(_getIntArg(tls, _pArgList))
goto _93
}
if _flag_long == 0 {
goto _90
}
if int32(_flag_long) == i32(2) {
_longvalue = crt.VAUint64(&_ap)
goto _92
}
_longvalue = uint64(crt.VAUint32(&_ap))
_92:
goto _93
_90:
_longvalue = uint64(crt.VAUint32(&_ap))
_93:
_prefix = int8(i32(0))
_87:
if _longvalue == uint64(i32(0)) {
_flag_alternateform = uint8(i32(0))
}
if (_flag_zeropad != 0) && (_precision < (_width - bool2int(int32(_prefix) != i32(0)))) {
_precision = _width - bool2int(int32(_prefix) != i32(0))
}
if _precision < i32(37) {
_nOut = i32(70)
_zOut = (*int8)(unsafe.Pointer(&_buf))
goto _98
}
_47_n = (uint64(_precision) + uint64(i32(10))) + uint64(_precision/i32(3))
_zOut = store0(&_zExtra, (*int8)(_sqlite3Malloc(tls, _47_n)))
if _zOut == nil {
_setStrAccumError(tls, _pAccum, uint8(i32(1)))
return
}
_nOut = int32(_47_n)
_98:
_bufpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_nOut-i32(1))))
if int32(_xtype) != i32(15) {
goto _100
}
_49_x = int32(_longvalue % uint64(i32(10)))
if (_49_x >= i32(4)) || (((_longvalue / uint64(i32(10))) % uint64(i32(10))) == uint64(i32(1))) {
_49_x = i32(0)
}
*preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr((_49_x*i32(2))+i32(1))))
*preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VXPrintfØ00zOrdØ001)) + 1*uintptr(_49_x*i32(2))))
_100:
_51_cset = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aDigits)) + 1*uintptr(_infop.X4)))
_51_base = _infop.X1
_103:
*preInc0(&_bufpt, -1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_51_cset)) + 1*uintptr(_longvalue%uint64(_51_base))))
_longvalue = _longvalue / uint64(_51_base)
if _longvalue > uint64(i32(0)) {
goto _103
}
_length = int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)
_104:
if _precision > _length {
*preInc0(&_bufpt, -1) = int8(i32(48))
_length += 1
goto _104
}
if _cThousand == 0 {
goto _106
}
_54_nn = (_length - i32(1)) / i32(3)
_54_ix = ((_length - i32(1)) % i32(3)) + i32(1)
{
p := &_bufpt
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_54_nn)))
sink0 = *p
}
_idx = i32(0)
_107:
if _54_nn <= i32(0) {
goto _110
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_idx))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_idx+_54_nn)))
_54_ix -= 1
if _54_ix == i32(0) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(preInc1(&_idx, 1)))) = int8(_cThousand)
_54_nn -= 1
_54_ix = i32(3)
}
_idx += 1
goto _107
_110:
_106:
if _prefix != 0 {
*preInc0(&_bufpt, -1) = _prefix
}
if _flag_alternateform == 0 || (_infop.X5) == 0 {
goto _114
}
_57_pre = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPrefix)) + 1*uintptr(_infop.X5)))
_115:
if int32(store3(&_57_x, *_57_pre)) == i32(0) {
goto _118
}
*preInc0(&_bufpt, -1) = _57_x
*(*uintptr)(unsafe.Pointer(&_57_pre)) += uintptr(1)
goto _115
_118:
_114:
_length = int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_nOut-i32(1)))))) - uintptr(unsafe.Pointer(_bufpt))) / 1)
goto _119
_62:
if _bArgList != 0 {
_realvalue = _getDoubleArg(tls, _pArgList)
goto _121
}
_realvalue = crt.VAOther(&_ap).(float64)
_121:
if _precision < i32(0) {
_precision = i32(6)
}
if _realvalue < float64(0) {
_realvalue = -_realvalue
_prefix = int8(i32(45))
goto _124
}
_prefix = int8(_flag_prefix)
_124:
if (int32(_xtype) == i32(3)) && (_precision > i32(0)) {
_precision -= 1
}
*func() *float64 { _idx = _precision & i32(4095); return &_rounder }() = 0.5
_127:
if _idx <= i32(0) {
goto _130
}
{
p := func() *float64 { _idx -= 1; return &_rounder }()
*p = (*p) * (0.1)
sink4 = *p
}
goto _127
_130:
if int32(_xtype) == i32(1) {
{
p := &_realvalue
*p = (*p) + _rounder
sink4 = *p
}
}
_exp = i32(0)
if _sqlite3IsNaN(tls, _realvalue) != 0 {
_bufpt = str(241)
_length = i32(3)
goto _119
}
if _realvalue <= float64(0) {
goto _133
}
_64_scale = float64(1)
_134:
if (_realvalue >= (float64(1e+100) * _64_scale)) && (_exp <= i32(350)) {
{
p := &_64_scale
*p = (*p) * float64(1e+100)
sink4 = *p
}
{
p := &_exp
*p = (*p) + i32(100)
sink1 = *p
}
goto _134
}
_135:
if (_realvalue >= (float64(1e+10) * _64_scale)) && (_exp <= i32(350)) {
{
p := &_64_scale
*p = (*p) * float64(1e+10)
sink4 = *p
}
{
p := &_exp
*p = (*p) + i32(10)
sink1 = *p
}
goto _135
}
_138:
if (_realvalue >= (float64(10) * _64_scale)) && (_exp <= i32(350)) {
{
p := &_64_scale
*p = (*p) * float64(10)
sink4 = *p
}
_exp += 1
goto _138
}
{
p := &_realvalue
*p = (*p) / _64_scale
sink4 = *p
}
_143:
if _realvalue < float64(1e-08) {
{
p := &_realvalue
*p = (*p) * float64(1e+08)
sink4 = *p
}
{
p := &_exp
*p = (*p) - i32(8)
sink1 = *p
}
goto _143
}
_144:
if _realvalue < float64(1) {
{
p := &_realvalue
*p = (*p) * float64(10)
sink4 = *p
}
_exp -= 1
goto _144
}
if _exp > i32(350) {
_bufpt = (*int8)(unsafe.Pointer(&_buf))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = _prefix
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_buf))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(bool2int(int32(_prefix) != i32(0)))))))))), (unsafe.Pointer)(str(245)), uint32(i32(4)))
_length = i32(3) + bool2int(int32(_prefix) != i32(0))
goto _119
}
_133:
_bufpt = (*int8)(unsafe.Pointer(&_buf))
if int32(_xtype) == i32(1) {
goto _148
}
{
p := &_realvalue
*p = (*p) + _rounder
sink4 = *p
}
if _realvalue >= float64(10) {
{
p := &_realvalue
*p = (*p) * (0.1)
sink4 = *p
}
_exp += 1
}
_148:
if int32(_xtype) != i32(3) {
goto _150
}
_flag_rtz = uint8(bool2int(_flag_alternateform == 0))
if (_exp < i32(-4)) || (_exp > _precision) {
_xtype = uint8(i32(2))
goto _153
}
_precision = _precision - _exp
_xtype = uint8(i32(1))
_153:
goto _154
_150:
_flag_rtz = _flag_altform2
_154:
if int32(_xtype) == i32(2) {
_e2 = i32(0)
goto _156
}
_e2 = _exp
_156:
if ((int64(func() int32 {
if _e2 > i32(0) {
return _e2
}
return i32(0)
}()) + int64(_precision)) + int64(_width)) <= int64(i32(55)) {
goto _159
}
_bufpt = store0(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(((int64(func() int32 {
if _e2 > i32(0) {
return _e2
}
return i32(0)
}())+int64(_precision))+int64(_width))+int64(i32(15))))))
if _bufpt == nil {
_setStrAccumError(tls, _pAccum, uint8(i32(1)))
return
}
_159:
_zOut = _bufpt
_nsd = i32(16) + (int32(_flag_altform2) * i32(10))
_flag_dp = uint8((func() int32 {
if _precision > i32(0) {
return i32(1)
}
return i32(0)
}() | int32(_flag_alternateform)) | int32(_flag_altform2))
if _prefix != 0 {
*postInc0(&_bufpt, 1) = _prefix
}
if _e2 < i32(0) {
*postInc0(&_bufpt, 1) = int8(i32(48))
goto _167
}
_168:
if _e2 < i32(0) {
goto _171
}
*postInc0(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
_e2 -= 1
goto _168
_171:
_167:
if _flag_dp != 0 {
*postInc0(&_bufpt, 1) = int8(i32(46))
}
_e2 += 1
_173:
if _e2 >= i32(0) {
goto _176
}
func() {
if _precision <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(249)))
crt.X__builtin_abort(tls)
}
}()
*postInc0(&_bufpt, 1) = int8(i32(48))
*func() *int32 { _precision -= 1; return &_e2 }() += 1
goto _173
_176:
if postInc1(&_precision, int32(-1)) > i32(0) {
*postInc0(&_bufpt, 1) = _et_getdigit(tls, &_realvalue, &_nsd)
goto _176
}
if _flag_rtz == 0 || _flag_dp == 0 {
goto _182
}
_183:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(-1))))) == i32(48) {
*preInc0(&_bufpt, -1) = int8(i32(0))
goto _183
}
func() {
if uintptr(unsafe.Pointer(_bufpt)) <= uintptr(unsafe.Pointer(_zOut)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25626), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(261)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(-1))))) != i32(46) {
goto _187
}
if _flag_altform2 != 0 {
*postInc0(&_bufpt, 1) = int8(i32(48))
goto _189
}
*preInc0(&_bufpt, -1) = int8(i32(0))
_189:
_187:
_182:
if int32(_xtype) != i32(2) {
goto _190
}
*postInc0(&_bufpt, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aDigits)) + 1*uintptr(_infop.X4)))
if _exp < i32(0) {
*postInc0(&_bufpt, 1) = int8(i32(45))
_exp = -_exp
goto _192
}
*postInc0(&_bufpt, 1) = int8(i32(43))
_192:
if _exp >= i32(100) {
*postInc0(&_bufpt, 1) = int8((_exp / i32(100)) + i32(48))
{
p := &_exp
*p = (*p) % i32(100)
sink1 = *p
}
}
*postInc0(&_bufpt, 1) = int8((_exp / i32(10)) + i32(48))
*postInc0(&_bufpt, 1) = int8((_exp % i32(10)) + i32(48))
_190:
*_bufpt = int8(i32(0))
_length = int32((uintptr(unsafe.Pointer(_bufpt)) - uintptr(unsafe.Pointer(_zOut))) / 1)
_bufpt = _zOut
if _flag_zeropad == 0 || _flag_leftjustify != 0 || _length >= _width {
goto _196
}
_96_nPad = _width - _length
_96_i = _width
_197:
if _96_i < _96_nPad {
goto _200
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_96_i))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_96_i-_96_nPad)))
_96_i -= 1
goto _197
_200:
_96_i = bool2int(int32(_prefix) != i32(0))
_201:
if postInc1(&_96_nPad, int32(-1)) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_96_i, int32(1))))) = int8(i32(48))
goto _201
}
_length = _width
_196:
goto _119
_65:
if _bArgList == 0 {
*(*int32)(crt.VAPointer(&_ap)) = int32(_pAccum.X3)
}
_length = store1(&_width, i32(0))
goto _119
_66:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = int8(i32(37))
_bufpt = (*int8)(unsafe.Pointer(&_buf))
_length = i32(1)
goto _119
_67:
if _bArgList != 0 {
_bufpt = _getTextArg(tls, _pArgList)
_c = func() int32 {
if _bufpt != nil {
return int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(i32(0)))))
}
return i32(0)
}()
goto _207
}
_c = crt.VAInt32(&_ap)
_207:
if _precision <= i32(1) {
goto _208
}
{
p := &_width
*p = (*p) - (_precision - i32(1))
sink1 = *p
}
if (_width > i32(1)) && (_flag_leftjustify == 0) {
_sqlite3AppendChar(tls, _pAccum, _width-i32(1), int8(i32(32)))
_width = i32(0)
}
_sqlite3AppendChar(tls, _pAccum, _precision-i32(1), int8(_c))
_208:
_length = i32(1)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0)))) = int8(_c)
_bufpt = (*int8)(unsafe.Pointer(&_buf))
goto _119
_68:
if _bArgList != 0 {
_bufpt = _getTextArg(tls, _pArgList)
_xtype = uint8(i32(5))
goto _212
}
_bufpt = (*int8)(crt.VAPointer(&_ap))
_212:
if _bufpt == nil {
_bufpt = str(0)
goto _215
}
if int32(_xtype) == i32(6) {
_zExtra = _bufpt
}
_215:
if _precision < i32(0) {
goto _216
}
_length = i32(0)
_217:
if _length >= _precision || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_length)))) == 0 {
goto _221
}
_length += 1
goto _217
_221:
goto _222
_216:
_length = _sqlite3Strlen30(tls, _bufpt)
_222:
goto _119
_70:
_110_q = int8(func() int32 {
if int32(_xtype) == i32(14) {
return i32(34)
}
return i32(39)
}())
if _bArgList != 0 {
_110_escarg = _getTextArg(tls, _pArgList)
goto _226
}
_110_escarg = (*int8)(crt.VAPointer(&_ap))
_226:
_110_isnull = bool2int(_110_escarg == nil)
if _110_isnull != 0 {
_110_escarg = func() *int8 {
if int32(_xtype) == i32(10) {
return str(155)
}
return str(272)
}()
}
_110_k = _precision
_110_i = store1(&_110_n, i32(0))
_230:
if _110_k == i32(0) || int32(store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_110_escarg)) + 1*uintptr(_110_i))))) == i32(0) {
goto _234
}
if int32(_110_ch) == int32(_110_q) {
_110_n += 1
}
*func() *int32 { _110_i += 1; return &_110_k }() -= 1
goto _230
_234:
_110_needQuote = bool2int((_110_isnull == 0) && (int32(_xtype) == i32(10)))
{
p := &_110_n
*p = (*p) + (_110_i + i32(3))
sink1 = *p
}
if _110_n <= i32(70) {
goto _237
}
_bufpt = store0(&_zExtra, (*int8)(_sqlite3Malloc(tls, uint64(_110_n))))
if _bufpt == nil {
_setStrAccumError(tls, _pAccum, uint8(i32(1)))
return
}
goto _239
_237:
_bufpt = (*int8)(unsafe.Pointer(&_buf))
_239:
_110_j = i32(0)
if _110_needQuote != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_q
}
_110_k = _110_i
_110_i = i32(0)
_241:
if _110_i >= _110_k {
goto _244
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = store3(&_110_ch, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_110_escarg)) + 1*uintptr(_110_i))))
if int32(_110_ch) == int32(_110_q) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_ch
}
_110_i += 1
goto _241
_244:
if _110_needQuote != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(postInc1(&_110_j, int32(1))))) = _110_q
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_bufpt)) + 1*uintptr(_110_j))) = int8(i32(0))
_length = _110_j
goto _119
_73:
if (int32(_pAccum.X7) & i32(1)) == i32(0) {
return
}
_118_pToken = (*XToken)(crt.VAPointer(&_ap))
func() {
if int32(_bArgList) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(279)))
crt.X__builtin_abort(tls)
}
}()
if (_118_pToken != nil) && ((_118_pToken.X1) != 0) {
_sqlite3StrAccumAppend(tls, _pAccum, _118_pToken.X0, int32(_118_pToken.X1))
}
_length = store1(&_width, i32(0))
goto _119
_74:
if (int32(_pAccum.X7) & i32(1)) == i32(0) {
return
}
_120_pSrc = (*XSrcList)(crt.VAPointer(&_ap))
_120_k = crt.VAInt32(&_ap)
_120_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_120_pSrc.X2))))) + 68*uintptr(_120_k)))
func() {
if int32(_bArgList) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25786), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(279)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _120_k < i32(0) || _120_k >= (_120_pSrc.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25787), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(291)))
crt.X__builtin_abort(tls)
}
}()
if (_120_pItem.X1) != nil {
_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.X1)
_sqlite3StrAccumAppend(tls, _pAccum, str(312), i32(1))
}
_sqlite3StrAccumAppendAll(tls, _pAccum, _120_pItem.X2)
_length = store1(&_width, i32(0))
goto _119
_75:
func() {
if int32(_xtype) != i32(17) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25797), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VXPrintfØ00__func__Ø000))), unsafe.Pointer(str(314)))
crt.X__builtin_abort(tls)
}
}()
return
_119:
{
p := &_width
*p = (*p) - _length
sink1 = *p
}
if _width <= i32(0) {
goto _261
}
if _flag_leftjustify == 0 {
_sqlite3AppendChar(tls, _pAccum, _width, int8(i32(32)))
}
_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
if _flag_leftjustify != 0 {
_sqlite3AppendChar(tls, _pAccum, _width, int8(i32(32)))
}
goto _264
_261:
_sqlite3StrAccumAppend(tls, _pAccum, _bufpt, _length)
_264:
if _zExtra != nil {
_sqlite3DbFree(tls, (*Xsqlite3)(_pAccum.X0), (unsafe.Pointer)(_zExtra))
_zExtra = nil
}
*(*uintptr)(unsafe.Pointer(&_fmt)) += uintptr(1)
goto _1
_5:
_ = _nsd
_ = _buf
}
// Append N bytes of text from z to the StrAccum object. Increase the
// size of the memory allocation for StrAccum if necessary.
func _sqlite3StrAccumAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
func() {
if _z == nil && _N != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25912), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(331)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X2) == nil && (_p.X3) != uint32(i32(0)) && (_p.X6) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25913), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(344)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _N < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(386)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X6) != i32(0) && (_p.X4) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25915), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(391)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X3) + uint32(_N)) >= (_p.X4) {
_enlargeAndAppend(tls, _p, _z, _N)
goto _14
}
if _N != 0 {
func() {
if (_p.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumAppendØ00__func__Ø000))), unsafe.Pointer(str(422)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) + uint32(_N)
sink5 = *p
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2))+1*uintptr((_p.X3)-uint32(_N))))), (unsafe.Pointer)(_z), uint32(_N))
}
_14:
}
var _sqlite3StrAccumAppendØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StrAccumAppendØ00__func__Ø000[0], str(431), 22)
}
// The StrAccum "p" is not large enough to accept N new bytes of z[].
// So enlarge if first, then do the append.
//
// This is a helper routine to sqlite3StrAccumAppend() that does special-case
// work (enlarging the buffer) using tail recursion, so that the
// sqlite3StrAccumAppend() routine can use fast calling semantics.
func _enlargeAndAppend(tls *crt.TLS, _p *XStrAccum, _z *int8, _N int32) {
_N = _sqlite3StrAccumEnlarge(tls, _p, _N)
if _N > i32(0) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2))+1*uintptr(_p.X3)))), (unsafe.Pointer)(_z), uint32(_N))
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) + uint32(_N)
sink5 = *p
}
}
func() {
if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25904), unsafe.Pointer((*int8)(unsafe.Pointer(&_enlargeAndAppendØ00__func__Ø000))), unsafe.Pointer(str(453)))
crt.X__builtin_abort(tls)
}
}()
}
// Enlarge the memory allocation on a StrAccum object so that it is
// able to accept at least N more bytes of text.
//
// Return the number of bytes of text that StrAccum is able to accept
// after the attempted enlargement. The value returned might be zero.
func _sqlite3StrAccumEnlarge(tls *crt.TLS, _p *XStrAccum, _N int32) (r0 int32) {
var _3_szNew int64
var _zNew, _3_zOld *int8
func() {
if (int64(_p.X3) + int64(_N)) < int64(_p.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25831), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000))), unsafe.Pointer(str(505)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X6) != 0 {
return i32(0)
}
if (_p.X5) == uint32(i32(0)) {
_N = int32(((_p.X4) - (_p.X3)) - uint32(i32(1)))
_setStrAccumError(tls, _p, uint8(i32(2)))
return _N
}
_3_zOld = func() *int8 {
if (int32(_p.X7) & i32(4)) != i32(0) {
return (_p.X2)
}
return nil
}()
_3_szNew = int64(_p.X3)
func() {
if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25844), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000))), unsafe.Pointer(str(453)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_3_szNew
*p = (*p) + int64(_N+i32(1))
sink6 = *p
}
if (_3_szNew + int64(_p.X3)) <= int64(_p.X5) {
{
p := &_3_szNew
*p = (*p) + int64(_p.X3)
sink6 = *p
}
}
if _3_szNew > int64(_p.X5) {
_sqlite3StrAccumReset(tls, _p)
_setStrAccumError(tls, _p, uint8(i32(2)))
return i32(0)
}
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(int32(_3_szNew))
if (*Xsqlite3)(_p.X0) != nil {
_zNew = (*int8)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_3_zOld), uint64(_p.X4)))
goto _14
}
_zNew = (*int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_3_zOld), uint64(_p.X4)))
_14:
if _zNew == nil {
goto _15
}
func() {
if (_p.X2) == nil && (_p.X3) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumEnlargeØ00__func__Ø000))), unsafe.Pointer(str(534)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_p.X7) & i32(4)) == i32(0)) && ((_p.X3) > uint32(i32(0))) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_p.X2), _p.X3)
}
*(**int8)(unsafe.Pointer(&(_p.X2))) = _zNew
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_zNew)))
{
p := (*uint8)(unsafe.Pointer(&(_p.X7)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
goto _21
_15:
_sqlite3StrAccumReset(tls, _p)
_setStrAccumError(tls, _p, uint8(i32(1)))
return i32(0)
_21:
return _N
}
var _sqlite3StrAccumEnlargeØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StrAccumEnlargeØ00__func__Ø000[0], str(561), 23)
}
// Set the StrAccum object to an error mode.
func _setStrAccumError(tls *crt.TLS, _p *XStrAccum, _eError uint8) {
func() {
if int32(_eError) != i32(1) && int32(_eError) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25196), unsafe.Pointer((*int8)(unsafe.Pointer(&_setStrAccumErrorØ00__func__Ø000))), unsafe.Pointer(str(584)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_p.X6))) = _eError
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(i32(0))
}
var _setStrAccumErrorØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_setStrAccumErrorØ00__func__Ø000[0], str(634), 17)
}
// Reset an StrAccum string. Reclaim all malloced memory.
func _sqlite3StrAccumReset(tls *crt.TLS, _p *XStrAccum) {
func() {
if (((_p.X2) == nil) || ((_p.X2) == (_p.X1))) != ((int32(_p.X7) & i32(4)) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25964), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumResetØ00__func__Ø000))), unsafe.Pointer(str(453)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X7) & i32(4)) != i32(0) {
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X2))
{
p := (*uint8)(unsafe.Pointer(&(_p.X7)))
*p = uint8(int32(*p) & i32(-5))
sink2 = *p
}
}
*(**int8)(unsafe.Pointer(&(_p.X2))) = nil
}
var _sqlite3StrAccumResetØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StrAccumResetØ00__func__Ø000[0], str(651), 21)
}
func _sqlite3DbFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
func() {
if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24721), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbFreeØ00__func__Ø000))), unsafe.Pointer(str(672)))
crt.X__builtin_abort(tls)
}
}()
if _p != nil {
_sqlite3DbFreeNN(tls, _db, _p)
}
}
// The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
// intended for use inside assert() statements.
func Xsqlite3_mutex_held(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
func() {
if _p != nil && (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X7)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_heldØ00__func__Ø000))), unsafe.Pointer(str(711)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((_p == nil) || (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X7)})))(tls, _p) != 0)
}
var _sqlite3_mutex_heldØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_heldØ00__func__Ø000[0], str(756), 19)
}
var _sqlite3DbFreeØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbFreeØ00__func__Ø000[0], str(775), 14)
}
// 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 _sqlite3DbFreeNN(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
var _3_pBuf *Xsqlite3_file
func() {
if _db != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000))), unsafe.Pointer(str(672)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24696), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
if _db == nil {
goto _5
}
if (_db.X79) != nil {
_measureAllocationSize(tls, _db, _p)
return
}
if _isLookaside(tls, _db, _p) != 0 {
_3_pBuf = (*Xsqlite3_file)(_p)
crt.Xmemset(tls, _p, i32(170), uint32((*t7)(unsafe.Pointer(&(_db.X58))).X1))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pBuf.X0))))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = _3_pBuf
*(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X3))) -= 1
return
}
_5:
i32(0)
i32(0)
func() {
if _db == nil && i32(1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24716), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbFreeNNØ00__func__Ø000))), unsafe.Pointer(str(794)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_free(tls, _p)
}
var _sqlite3DbFreeNNØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbFreeNNØ00__func__Ø000[0], str(847), 16)
}
// Add the size of memory allocation "p" to the count in
// *db->pnBytesFreed.
func _measureAllocationSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) {
{
p := _db.X79
*p = (*p) + _sqlite3DbMallocSize(tls, _db, _p)
sink1 = *p
}
}
func _sqlite3DbMallocSize(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
if _db != nil && _isLookaside(tls, _db, _p) != 0 {
goto _3
}
if _db == nil {
i32(0)
i32(0)
goto _5
}
i32(0)
i32(0)
_5:
return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p)
_3:
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24653), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocSizeØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
return int32((*t7)(unsafe.Pointer(&(_db.X58))).X1)
}
var _sqlite3DbMallocSizeØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbMallocSizeØ00__func__Ø000[0], str(893), 20)
}
func _isLookaside(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer) (r0 int32) {
return bool2int((uint32(uintptr(_p)) >= uint32(uintptr((*t7)(unsafe.Pointer(&(_db.X58))).X7))) && (uint32(uintptr(_p)) < uint32(uintptr((*t7)(unsafe.Pointer(&(_db.X58))).X8))))
}
// Free memory previously obtained from sqlite3Malloc().
func Xsqlite3_free(tls *crt.TLS, _p unsafe.Pointer) {
if _p == nil {
return
}
i32(0)
i32(0)
if (_sqlite3Config.X0) != 0 {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_sqlite3StatusDown(tls, i32(0), _sqlite3MallocSize(tls, _p))
_sqlite3StatusDown(tls, i32(9), i32(1))
((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _2
}
((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p)
_2:
}
// Obtain the mutex p. If some other thread already has the mutex, block
// until it can be obtained.
func Xsqlite3_mutex_enter(tls *crt.TLS, _p *Xsqlite3_mutex) {
if _p != nil {
func() {
if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X4)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22865), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_enterØ00__func__Ø000))), unsafe.Pointer(str(913)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X4)})))(tls, _p)
}
}
var _sqlite3_mutex_enterØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_enterØ00__func__Ø000[0], str(951), 20)
}
var _mem0 TMem0Global
func _sqlite3StatusDown(tls *crt.TLS, _op int32, _N int32) {
func() {
if _N < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18574), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000))), unsafe.Pointer(str(386)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18575), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000))), unsafe.Pointer(str(971)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 {
return _sqlite3Pcache1Mutex(tls)
}
return _sqlite3MallocMutex(tls)
}()) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000))), unsafe.Pointer(str(1004)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18578), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusDownØ00__func__Ø000))), unsafe.Pointer(str(1085)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op)))
*p = (*p) - uint32(_N)
sink5 = *p
}
}
var _sqlite3StatusDownØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StatusDownØ00__func__Ø000[0], str(1125), 18)
}
var _statMutex [10]int8
func init() {
_statMutex = [10]int8{0, 1, 1, 0, 0, 0, 0, 1, 0, 0}
}
// Return the global mutex used by this PCACHE implementation. The
// sqlite3_status() routine needs access to this mutex.
func _sqlite3Pcache1Mutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
return (*Xsqlite3_mutex)(_pcache1_g.X9)
}
var _pcache1_g TPCacheGlobal
// Return the memory allocator mutex. sqlite3_status() needs it.
func _sqlite3MallocMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex) {
return (*Xsqlite3_mutex)(_mem0.X0)
}
var _sqlite3Stat Tsqlite3StatType
// Return the size of a memory allocation previously obtained from
// sqlite3Malloc() or sqlite3_malloc().
func _sqlite3MallocSize(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
i32(0)
return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p)
}
// The sqlite3_mutex_leave() routine exits a mutex that was previously
// entered by the same thread. The behavior is undefined if the mutex
// is not currently entered. If a NULL pointer is passed as an argument
// this function is a no-op.
func Xsqlite3_mutex_leave(tls *crt.TLS, _p *Xsqlite3_mutex) {
if _p != nil {
func() {
if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X6)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_leaveØ00__func__Ø000))), unsafe.Pointer(str(1143)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X6)})))(tls, _p)
}
}
var _sqlite3_mutex_leaveØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_leaveØ00__func__Ø000[0], str(1181), 20)
}
// 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 _sqlite3DbRealloc(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24904), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return _sqlite3DbMallocRawNN(tls, _db, _n)
}
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbReallocØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if _isLookaside(tls, _db, _p) != 0 && (_n <= uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1)) {
return _p
}
return _dbReallocFinish(tls, _db, _p, _n)
}
var _sqlite3DbReallocØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbReallocØ00__func__Ø000[0], str(1207), 17)
}
func _sqlite3DbMallocRawNN(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
var _pBuf *Xsqlite3_file
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24865), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X79) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24866), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000))), unsafe.Pointer(str(1224)))
crt.X__builtin_abort(tls)
}
}()
if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) != uint32(i32(0)) {
goto _6
}
func() {
if int32(_db.X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24868), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbMallocRawNNØ00__func__Ø000))), unsafe.Pointer(str(1244)))
crt.X__builtin_abort(tls)
}
}()
if _n > uint64((*t7)(unsafe.Pointer(&(_db.X58))).X1) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(1)))) += 1
goto _12
}
if store8(&_pBuf, (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6)) == nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(2)))) += 1
goto _12
}
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = (*Xsqlite3_file)(_pBuf.X0)
*(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X3))) += 1
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(i32(0)))) += 1
if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) > ((*t7)(unsafe.Pointer(&(_db.X58))).X4) {
*(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X4))) = (*t7)(unsafe.Pointer(&(_db.X58))).X3
}
return (unsafe.Pointer)(_pBuf)
_12:
goto _15
_6:
if (_db.X17) != 0 {
return nil
}
_15:
return _dbMallocRawFinish(tls, _db, _n)
}
var _sqlite3DbMallocRawNNØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbMallocRawNNØ00__func__Ø000[0], str(1264), 21)
}
// Finish the work of sqlite3DbMallocRawNN for the unusual and
// slower case when the allocation cannot be fulfilled using lookaside.
func _dbMallocRawFinish(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24824), unsafe.Pointer((*int8)(unsafe.Pointer(&_dbMallocRawFinishØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
_p = _sqlite3Malloc(tls, _n)
if _p == nil {
_sqlite3OomFault(tls, _db)
}
return _p
}
var _dbMallocRawFinishØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_dbMallocRawFinishØ00__func__Ø000[0], str(1285), 18)
}
// Allocate memory. This routine is like sqlite3_malloc() except that it
// assumes the memory subsystem has already been initialized.
func _sqlite3Malloc(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
if (_n == uint64(i32(0))) || (_n >= uint64(i32(2147483392))) {
_p = nil
goto _4
}
if (_sqlite3Config.X0) != 0 {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_mallocWithAlarm(tls, int32(_n), &_p)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _4
}
_p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)(tls, int32(_n))
_4:
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(_p)))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MallocØ00__func__Ø000))), unsafe.Pointer(str(1303)))
crt.X__builtin_abort(tls)
}
}()
return _p
}
// Do a memory allocation with statistics and alarms. Assume the
// lock is already held.
func _mallocWithAlarm(tls *crt.TLS, _n int32, _pp *unsafe.Pointer) {
var _nFull int32
var _1_nUsed int64
var _p unsafe.Pointer
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_mem0.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24437), unsafe.Pointer((*int8)(unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000))), unsafe.Pointer(str(1327)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24438), unsafe.Pointer((*int8)(unsafe.Pointer(&_mallocWithAlarmØ00__func__Ø000))), unsafe.Pointer(str(1358)))
crt.X__builtin_abort(tls)
}
}()
_nFull = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, _n)
_sqlite3StatusHighwater(tls, i32(5), _n)
if (_mem0.X1) <= int64(i32(0)) {
goto _4
}
_1_nUsed = _sqlite3StatusValue(tls, i32(0))
if _1_nUsed >= ((_mem0.X1) - int64(_nFull)) {
*(*int32)(unsafe.Pointer(&(_mem0.X5))) = i32(1)
_sqlite3MallocAlarm(tls, _nFull)
goto _6
}
*(*int32)(unsafe.Pointer(&(_mem0.X5))) = i32(0)
_6:
_4:
_p = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)(tls, _nFull)
if _p != nil {
_nFull = _sqlite3MallocSize(tls, _p)
_sqlite3StatusUp(tls, i32(0), _nFull)
_sqlite3StatusUp(tls, i32(9), i32(1))
}
*_pp = _p
}
var _mallocWithAlarmØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_mallocWithAlarmØ00__func__Ø000[0], str(1362), 16)
}
// Adjust the highwater mark if necessary.
// The caller must hold the appropriate mutex.
func _sqlite3StatusHighwater(tls *crt.TLS, _op int32, _X int32) {
var _newValue uint32
func() {
if _X < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18589), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000))), unsafe.Pointer(str(1378)))
crt.X__builtin_abort(tls)
}
}()
_newValue = uint32(_X)
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000))), unsafe.Pointer(str(1085)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18592), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000))), unsafe.Pointer(str(971)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 {
return _sqlite3Pcache1Mutex(tls)
}
return _sqlite3MallocMutex(tls)
}()) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18593), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000))), unsafe.Pointer(str(1004)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op != i32(5) && _op != i32(7) && _op != i32(8) && _op != i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18595), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusHighwaterØ00__func__Ø000))), unsafe.Pointer(str(1383)))
crt.X__builtin_abort(tls)
}
}()
if _newValue > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op)))) {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op))) = _newValue
}
}
var _sqlite3StatusHighwaterØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StatusHighwaterØ00__func__Ø000[0], str(1517), 23)
}
// Return the current value of a status parameter. The caller must
// be holding the appropriate mutex.
func _sqlite3StatusValue(tls *crt.TLS, _op int32) (r0 int64) {
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18543), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000))), unsafe.Pointer(str(1085)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18544), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000))), unsafe.Pointer(str(971)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 {
return _sqlite3Pcache1Mutex(tls)
}
return _sqlite3MallocMutex(tls)
}()) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18545), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusValueØ00__func__Ø000))), unsafe.Pointer(str(1004)))
crt.X__builtin_abort(tls)
}
}()
return int64(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op))))
}
var _sqlite3StatusValueØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StatusValueØ00__func__Ø000[0], str(1540), 19)
}
// Trigger the alarm
func _sqlite3MallocAlarm(tls *crt.TLS, _nByte int32) {
if (_mem0.X1) <= int64(i32(0)) {
return
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
Xsqlite3_release_memory(tls, _nByte)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
}
// Attempt to release up to n bytes of non-essential memory currently
// held by SQLite. An example of non-essential memory is memory used to
// cache database pages that are not currently in use.
func Xsqlite3_release_memory(tls *crt.TLS, _n int32) (r0 int32) {
return i32(0)
}
// Add N to the value of a status record. The caller must hold the
// appropriate mutex. (Locking is checked by assert()).
//
// The StatusUp() routine can accept positive or negative values for N.
// The value of N is added to the current status value and the high-water
// mark is adjusted if necessary.
//
// The StatusDown() routine lowers the current value by N. The highwater
// mark is unchanged. N must be non-negative for StatusDown().
func _sqlite3StatusUp(tls *crt.TLS, _op int32, _N int32) {
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18563), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000))), unsafe.Pointer(str(1085)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18564), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000))), unsafe.Pointer(str(971)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, func() *Xsqlite3_mutex {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 {
return _sqlite3Pcache1Mutex(tls)
}
return _sqlite3MallocMutex(tls)
}()) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18565), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StatusUpØ00__func__Ø000))), unsafe.Pointer(str(1004)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op)))
*p = (*p) + uint32(_N)
sink5 = *p
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op)))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op)))) {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op)))
}
}
var _sqlite3StatusUpØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StatusUpØ00__func__Ø000[0], str(1559), 16)
}
var _sqlite3MallocØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MallocØ00__func__Ø000[0], str(1575), 14)
}
// 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 _sqlite3OomFault(tls *crt.TLS, _db *Xsqlite3) {
if int32(_db.X17) != i32(0) || int32(_db.X18) != i32(0) {
goto _1
}
*(*uint8)(unsafe.Pointer(&(_db.X17))) = uint8(i32(1))
if (_db.X37) > i32(0) {
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(1)
}
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1
_1:
}
func _dbReallocFinish(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
var _pNew unsafe.Pointer
_pNew = nil
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24912), unsafe.Pointer((*int8)(unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24913), unsafe.Pointer((*int8)(unsafe.Pointer(&_dbReallocFinishØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
if int32(_db.X17) != i32(0) {
goto _4
}
if _isLookaside(tls, _db, _p) == 0 {
goto _5
}
_pNew = _sqlite3DbMallocRawNN(tls, _db, _n)
if _pNew != nil {
crt.Xmemcpy(tls, _pNew, _p, uint32((*t7)(unsafe.Pointer(&(_db.X58))).X1))
_sqlite3DbFree(tls, _db, _p)
}
goto _7
_5:
i32(0)
i32(0)
_pNew = Xsqlite3_realloc64(tls, _p, _n)
if _pNew == nil {
_sqlite3OomFault(tls, _db)
}
_7:
_4:
return _pNew
}
var _dbReallocFinishØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_dbReallocFinishØ00__func__Ø000[0], str(1589), 16)
}
func Xsqlite3_realloc64(tls *crt.TLS, _pOld unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
if Xsqlite3_initialize(tls) != 0 {
return nil
}
return _sqlite3Realloc(tls, _pOld, _n)
}
// Initialize SQLite.
//
// This routine must be called to initialize the memory allocation,
// VFS, and mutex subsystems prior to doing any serious work with
// SQLite. But as long as you do not compile with SQLITE_OMIT_AUTOINIT
// this routine will be called automatically by key routines such as
// sqlite3_open().
//
// This routine is a no-op except on its very first call for the process,
// or for the first call after a call to sqlite3_shutdown.
//
// The first thread to call this routine runs the initialization to
// completion. If subsequent threads call this routine before the first
// thread has finished the initialization process, then the subsequent
// threads must block until the first thread finishes with the initialization.
//
// The first thread might call this routine recursively. Recursive
// calls to this routine should not block, of course. Otherwise the
// initialization process would never complete.
//
// Let X be the first thread to enter this routine. Let Y be some other
// thread. Then while the initial invocation of this routine by X is
// incomplete, it is required that:
//
// * Calls to this routine from Y must block until the outer-most
// call by X completes.
//
// * Recursive calls to this routine from thread X return immediately
// without blocking.
func Xsqlite3_initialize(tls *crt.TLS) (r0 int32) {
var _rc int32
var _12_x uint64
var _12_y float64
var _pMaster *Xsqlite3_mutex
i32(0)
if (_sqlite3Config.X28) != 0 {
return i32(0)
}
_rc = _sqlite3MutexInit(tls)
if _rc != 0 {
return _rc
}
_pMaster = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _pMaster)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X30))) = i32(1)
if (_sqlite3Config.X31) == 0 {
_rc = _sqlite3MallocInit(tls)
}
if _rc != i32(0) {
goto _3
}
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X31))) = i32(1)
if (*Xsqlite3_mutex)(_sqlite3Config.X34) != nil {
goto _4
}
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X34))))) = _sqlite3MutexAlloc(tls, i32(1))
if (_sqlite3Config.X1) != 0 && ((*Xsqlite3_mutex)(_sqlite3Config.X34) == nil) {
_rc = _sqlite3NomemError(tls, i32(140658))
}
_4:
_3:
if _rc == i32(0) {
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X33))) += 1
}
Xsqlite3_mutex_leave(tls, _pMaster)
if _rc != i32(0) {
return _rc
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34))
if (_sqlite3Config.X28) != i32(0) || (_sqlite3Config.X29) != i32(0) {
goto _10
}
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X29))) = i32(1)
crt.Xmemset(tls, (unsafe.Pointer)(&_sqlite3BuiltinFunctions), i32(0), u32(92))
_sqlite3RegisterBuiltinFunctions(tls)
if (_sqlite3Config.X32) == i32(0) {
_rc = _sqlite3PcacheInitialize(tls)
}
if _rc == i32(0) {
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X32))) = i32(1)
_rc = _sqlite3OsInit(tls)
}
if _rc == i32(0) {
_sqlite3PCacheBufferSetup(tls, _sqlite3Config.X22, _sqlite3Config.X23, _sqlite3Config.X24)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X28))) = i32(1)
}
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X29))) = i32(0)
_10:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34))
Xsqlite3_mutex_enter(tls, _pMaster)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X33))) -= 1
if (_sqlite3Config.X33) <= i32(0) {
func() {
if (_sqlite3Config.X33) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140723), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000))), unsafe.Pointer(str(1605)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_sqlite3Config.X34))
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X34))))) = nil
}
Xsqlite3_mutex_leave(tls, _pMaster)
if _rc == i32(0) {
_12_x = u64(9223372036854775807)
i32(0)
i32(0)
crt.Xmemcpy(tls, (unsafe.Pointer)(&_12_y), (unsafe.Pointer)(&_12_x), uint32(i32(8)))
func() {
if _sqlite3IsNaN(tls, _12_y) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_initializeØ00__func__Ø000))), unsafe.Pointer(str(1642)))
crt.X__builtin_abort(tls)
}
}()
}
return _rc
_ = _12_x
panic(0)
}
// Initialize the mutex system.
func _sqlite3MutexInit(tls *crt.TLS) (r0 int32) {
var _rc int32
var _1_pFrom, _1_pTo *Xsqlite3_mutex_methods
_rc = i32(0)
if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) != nil {
goto _0
}
_1_pTo = (*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11)))
if (_sqlite3Config.X1) != 0 {
_1_pFrom = _sqlite3DefaultMutex(tls)
goto _2
}
_1_pFrom = _sqlite3NoopMutex(tls)
_2:
*(*func(*crt.TLS) int32)(unsafe.Pointer(&(_1_pTo.X0))) = _1_pFrom.X0
*(*func(*crt.TLS) int32)(unsafe.Pointer(&(_1_pTo.X1))) = _1_pFrom.X1
*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X3))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_1_pFrom.X3)}))
*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X4))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_1_pFrom.X4)}))
*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X5))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_1_pFrom.X5)}))
*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_1_pTo.X6))))) = *(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_1_pFrom.X6)}))
*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X7))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_1_pFrom.X7)}))
*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_pTo.X8))))) = *(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_1_pFrom.X8)}))
_sqlite3MemoryBarrier(tls)
*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer((*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&(_1_pTo.X2))))) = *(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{(_1_pFrom.X2)}))
_0:
func() {
if ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MutexInitØ00__func__Ø000))), unsafe.Pointer(str(1658)))
crt.X__builtin_abort(tls)
}
}()
_rc = ((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X0)(tls)
_mutexIsInit = i32(1)
bug20530(_mutexIsInit)
return _rc
}
func _sqlite3DefaultMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
return &_sqlite3DefaultMutexØ00sMutexØ001
}
var _sqlite3DefaultMutexØ00sMutexØ001 Xsqlite3_mutex_methods
func init() {
_sqlite3DefaultMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{X0: _pthreadMutexInit, X1: _pthreadMutexEnd, X2: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) *Xsqlite3_mutex
}{_pthreadMutexAlloc})), X3: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_pthreadMutexFree})), X4: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_pthreadMutexEnter})), X5: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_pthreadMutexTry})), X6: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_pthreadMutexLeave})), X7: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_pthreadMutexHeld})), X8: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_pthreadMutexNotheld}))}
}
// Initialize and deinitialize the mutex subsystem.
func _pthreadMutexInit(tls *crt.TLS) (r0 int32) {
return i32(0)
}
func _pthreadMutexEnd(tls *crt.TLS) (r0 int32) {
return i32(0)
}
// The sqlite3_mutex_alloc() routine allocates a new
// mutex and returns a pointer to it. If it returns NULL
// that means that a mutex could not be allocated. SQLite
// will unwind its stack and return an error. The argument
// to sqlite3_mutex_alloc() is one of these integer constants:
//
//
// - SQLITE_MUTEX_FAST
//
- SQLITE_MUTEX_RECURSIVE
//
- SQLITE_MUTEX_STATIC_MASTER
//
- SQLITE_MUTEX_STATIC_MEM
//
- SQLITE_MUTEX_STATIC_OPEN
//
- SQLITE_MUTEX_STATIC_PRNG
//
- SQLITE_MUTEX_STATIC_LRU
//
- SQLITE_MUTEX_STATIC_PMEM
//
- SQLITE_MUTEX_STATIC_APP1
//
- SQLITE_MUTEX_STATIC_APP2
//
- SQLITE_MUTEX_STATIC_APP3
//
- SQLITE_MUTEX_STATIC_VFS1
//
- SQLITE_MUTEX_STATIC_VFS2
//
- SQLITE_MUTEX_STATIC_VFS3
//
//
// The first two constants cause sqlite3_mutex_alloc() to create
// a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE
// is used but not necessarily so when SQLITE_MUTEX_FAST is used.
// The mutex implementation does not need to make a distinction
// between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does
// not want to. But SQLite will only request a recursive mutex in
// cases where it really needs one. If a faster non-recursive mutex
// implementation is available on the host platform, the mutex subsystem
// might return such a mutex in response to SQLITE_MUTEX_FAST.
//
// The other allowed parameters to sqlite3_mutex_alloc() each return
// a pointer to a static preexisting mutex. Six static mutexes are
// used by the current version of SQLite. Future versions of SQLite
// may add additional static mutexes. Static mutexes are for internal
// use by SQLite only. Applications that use SQLite mutexes should
// use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or
// SQLITE_MUTEX_RECURSIVE.
//
// Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST
// or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc()
// returns a different mutex on every call. But for the static
// mutex types, the same mutex is returned on every call that has
// the same type number.
func _pthreadMutexAlloc(tls *crt.TLS, _iType int32) (r0 *Xsqlite3_mutex) {
var _3_recursiveAttr crt.Xpthread_mutexattr_t
var _p *Xsqlite3_mutex
switch _iType {
case i32(0):
goto _2
case i32(1):
goto _1
default:
goto _3
}
_1:
_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(u32(40))))
if _p != nil {
crt.Xpthread_mutexattr_init(tls, &_3_recursiveAttr)
crt.Xpthread_mutexattr_settype(tls, &_3_recursiveAttr, i32(1))
crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))), &_3_recursiveAttr)
crt.Xpthread_mutexattr_destroy(tls, &_3_recursiveAttr)
}
goto _5
_2:
_p = (*Xsqlite3_mutex)(_sqlite3MallocZero(tls, uint64(u32(40))))
if _p != nil {
crt.Xpthread_mutex_init(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))), nil)
}
goto _5
_3:
if ((_iType - i32(2)) < i32(0)) || ((_iType - i32(2)) >= i32(12)) {
_sqlite3MisuseError(tls, i32(23329))
return nil
}
_p = (*Xsqlite3_mutex)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pthreadMutexAllocØ00staticMutexesØ001)) + 40*uintptr(_iType-i32(2))))
goto _5
_5:
if _p != nil {
*(*int32)(unsafe.Pointer(&(_p.X1))) = _iType
}
return _p
_ = _3_recursiveAttr
panic(0)
}
func _sqlite3MallocZero(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
_p = _sqlite3Malloc(tls, _n)
if _p != nil {
crt.Xmemset(tls, _p, i32(0), uint32(_n))
}
return _p
}
func _sqlite3MisuseError(tls *crt.TLS, _lineno int32) (r0 int32) {
return _reportError(tls, i32(21), _lineno, str(1695))
}
// The following routines are substitutes for constants SQLITE_CORRUPT,
// SQLITE_MISUSE, SQLITE_CANTOPEN, SQLITE_NOMEM and possibly other error
// constants. They serve two purposes:
//
// 1. Serve as a convenient place to set a breakpoint in a debugger
// to detect when version error conditions occurs.
//
// 2. Invoke sqlite3_log() to provide the source code location where
// a low-level error is first detected.
func _reportError(tls *crt.TLS, _iErr int32, _lineno int32, _zType *int8) (r0 int32) {
Xsqlite3_log(tls, _iErr, str(1702), unsafe.Pointer(_zType), _lineno, unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(20))))))+uintptr(unsafe.Pointer(Xsqlite3_sourceid(tls)))))))
return _iErr
}
// IMPLEMENTATION-OF: R-63124-39300 The sqlite3_sourceid() function returns a
// pointer to a string constant whose value is the same as the
// SQLITE_SOURCE_ID C preprocessor macro.
func Xsqlite3_sourceid(tls *crt.TLS) (r0 *int8) {
return str(1727)
}
var _pthreadMutexAllocØ00staticMutexesØ001 [12]Xsqlite3_mutex
// This routine deallocates a previously
// allocated mutex. SQLite is careful to deallocate every
// mutex that it allocates.
func _pthreadMutexFree(tls *crt.TLS, _p *Xsqlite3_mutex) {
func() {
if (_p.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23350), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexFreeØ00__func__Ø000))), unsafe.Pointer(str(1812)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X1) == i32(0)) || ((_p.X1) == i32(1)) {
crt.Xpthread_mutex_destroy(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))))
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
goto _4
}
_sqlite3MisuseError(tls, i32(23360))
_4:
}
var _pthreadMutexFreeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_pthreadMutexFreeØ00__func__Ø000[0], str(1823), 17)
}
// The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
// to enter a mutex. If another thread is already within the mutex,
// sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
// SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK
// upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can
// be entered multiple times by the same thread. In such cases the,
// mutex must be exited an equal number of times before another thread
// can enter. If the same thread tries to enter any other kind of mutex
// more than once, the behavior is undefined.
func _pthreadMutexEnter(tls *crt.TLS, _p *Xsqlite3_mutex) {
func() {
if (_p.X1) != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23377), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(1840)))
crt.X__builtin_abort(tls)
}
}()
crt.Xpthread_mutex_lock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))))
func() {
if (_p.X2) <= i32(0) && (_p.X3) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23406), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(1896)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X3))) = crt.Xpthread_self(tls)
*(*int32)(unsafe.Pointer(&(_p.X2))) += 1
if (_p.X4) != 0 {
crt.Xprintf(tls, str(1921), unsafe.Pointer(_p), _p.X4, _p.X2)
}
}
func _pthreadMutexNotheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
return bool2int(((_p.X2) == i32(0)) || (crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) == i32(0)))
}
var _pthreadMutexEnterØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_pthreadMutexEnterØ00__func__Ø000[0], str(1955), 18)
}
func _pthreadMutexTry(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
var _rc int32
func() {
if (_p.X1) != i32(1) && _pthreadMutexNotheld(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23420), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexTryØ00__func__Ø000))), unsafe.Pointer(str(1840)))
crt.X__builtin_abort(tls)
}
}()
if crt.Xpthread_mutex_trylock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0)))) == i32(0) {
*(*uint32)(unsafe.Pointer(&(_p.X3))) = crt.Xpthread_self(tls)
*(*int32)(unsafe.Pointer(&(_p.X2))) += 1
_rc = i32(0)
goto _4
}
_rc = i32(5)
_4:
if (_rc == i32(0)) && (_p.X4) != 0 {
crt.Xprintf(tls, str(1921), unsafe.Pointer(_p), _p.X4, _p.X2)
}
return _rc
}
var _pthreadMutexTryØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pthreadMutexTryØ00__func__Ø000[0], str(1973), 16)
}
// The sqlite3_mutex_leave() routine exits a mutex that was
// previously entered by the same thread. The behavior
// is undefined if the mutex is not currently entered or
// is not currently allocated. SQLite will never do either.
func _pthreadMutexLeave(tls *crt.TLS, _p *Xsqlite3_mutex) {
func() {
if _pthreadMutexHeld(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23476), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(1989)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X2))) -= 1
if (_p.X2) == i32(0) {
*(*uint32)(unsafe.Pointer(&(_p.X3))) = uint32(i32(0))
}
func() {
if (_p.X2) != i32(0) && (_p.X1) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23481), unsafe.Pointer((*int8)(unsafe.Pointer(&_pthreadMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(2009)))
crt.X__builtin_abort(tls)
}
}()
crt.Xpthread_mutex_unlock(tls, (*crt.Xpthread_mutex_t)(unsafe.Pointer(&(_p.X0))))
if (_p.X4) != 0 {
crt.Xprintf(tls, str(2053), unsafe.Pointer(_p), _p.X4, _p.X2)
}
}
func _pthreadMutexHeld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
return bool2int(((_p.X2) != i32(0)) && crt.Xpthread_equal(tls, _p.X3, crt.Xpthread_self(tls)) != 0)
}
var _pthreadMutexLeaveØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_pthreadMutexLeaveØ00__func__Ø000[0], str(2087), 18)
}
func _sqlite3NoopMutex(tls *crt.TLS) (r0 *Xsqlite3_mutex_methods) {
return &_sqlite3NoopMutexØ00sMutexØ001
}
var _sqlite3NoopMutexØ00sMutexØ001 Xsqlite3_mutex_methods
func init() {
_sqlite3NoopMutexØ00sMutexØ001 = Xsqlite3_mutex_methods{X0: _debugMutexInit, X1: _debugMutexEnd, X2: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) *Xsqlite3_mutex
}{_debugMutexAlloc})), X3: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_debugMutexFree})), X4: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_debugMutexEnter})), X5: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_debugMutexTry})), X6: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{_debugMutexLeave})), X7: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_debugMutexHeld})), X8: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{_debugMutexNotheld}))}
}
// Initialize and deinitialize the mutex subsystem.
func _debugMutexInit(tls *crt.TLS) (r0 int32) {
return i32(0)
}
func _debugMutexEnd(tls *crt.TLS) (r0 int32) {
return i32(0)
}
// The sqlite3_mutex_alloc() routine allocates a new
// mutex and returns a pointer to it. If it returns NULL
// that means that a mutex could not be allocated.
func _debugMutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
var _pNew *crt.Xstruct_timeval
_pNew = nil
switch _id {
case i32(0):
goto _1
case i32(1):
goto _1
default:
goto _3
}
_1:
_pNew = (*crt.Xstruct_timeval)(_sqlite3Malloc(tls, uint64(u32(8))))
if _pNew != nil {
*(*int32)(unsafe.Pointer(&(_pNew.X0))) = _id
*(*int32)(unsafe.Pointer(&(_pNew.X1))) = i32(0)
}
goto _5
_3:
if ((_id - i32(2)) < i32(0)) || ((_id - i32(2)) >= i32(12)) {
_sqlite3MisuseError(tls, i32(23039))
return nil
}
_pNew = (*crt.Xstruct_timeval)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_debugMutexAllocØ00aStaticØ001)) + 8*uintptr(_id-i32(2))))
*(*int32)(unsafe.Pointer(&(_pNew.X0))) = _id
goto _5
_5:
return (*Xsqlite3_mutex)(unsafe.Pointer(_pNew))
}
var _debugMutexAllocØ00aStaticØ001 [12]crt.Xstruct_timeval
// This routine deallocates a previously allocated mutex.
func _debugMutexFree(tls *crt.TLS, _pX *Xsqlite3_mutex) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
func() {
if (_p.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23056), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexFreeØ00__func__Ø000))), unsafe.Pointer(str(2105)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X0) == i32(1)) || ((_p.X0) == i32(0)) {
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
goto _4
}
_sqlite3MisuseError(tls, i32(23061))
_4:
}
var _debugMutexFreeØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_debugMutexFreeØ00__func__Ø000[0], str(2115), 15)
}
// The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
// to enter a mutex. If another thread is already within the mutex,
// sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
// SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK
// upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can
// be entered multiple times by the same thread. In such cases the,
// mutex must be exited an equal number of times before another thread
// can enter. If the same thread tries to enter any other kind of mutex
// more than once, the behavior is undefined.
func _debugMutexEnter(tls *crt.TLS, _pX *Xsqlite3_mutex) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
func() {
if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23079), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexEnterØ00__func__Ø000))), unsafe.Pointer(str(2130)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X1))) += 1
}
func _debugMutexNotheld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
return bool2int((_p == nil) || ((_p.X1) == i32(0)))
}
var _debugMutexEnterØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_debugMutexEnterØ00__func__Ø000[0], str(2185), 16)
}
func _debugMutexTry(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
func() {
if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23084), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexTryØ00__func__Ø000))), unsafe.Pointer(str(2130)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X1))) += 1
return i32(0)
}
var _debugMutexTryØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_debugMutexTryØ00__func__Ø000[0], str(2201), 14)
}
// The sqlite3_mutex_leave() routine exits a mutex that was
// previously entered by the same thread. The behavior
// is undefined if the mutex is not currently entered or
// is not currently allocated. SQLite will never do either.
func _debugMutexLeave(tls *crt.TLS, _pX *Xsqlite3_mutex) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
func() {
if _debugMutexHeld(tls, _pX) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23097), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(2215)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X1))) -= 1
func() {
if (_p.X0) != i32(1) && _debugMutexNotheld(tls, _pX) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(23099), unsafe.Pointer((*int8)(unsafe.Pointer(&_debugMutexLeaveØ00__func__Ø000))), unsafe.Pointer(str(2130)))
crt.X__builtin_abort(tls)
}
}()
}
// The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
// intended for use inside assert() statements.
func _debugMutexHeld(tls *crt.TLS, _pX *Xsqlite3_mutex) (r0 int32) {
var _p *crt.Xstruct_timeval
_p = (*crt.Xstruct_timeval)(unsafe.Pointer(_pX))
return bool2int((_p == nil) || ((_p.X1) > i32(0)))
}
var _debugMutexLeaveØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_debugMutexLeaveØ00__func__Ø000[0], str(2234), 16)
}
// Try to provide a memory barrier operation, needed for initialization
// and also for the implementation of xShmBarrier in the VFS in cases
// where SQLite is compiled without mutexes.
func _sqlite3MemoryBarrier(tls *crt.TLS) {
}
var _sqlite3MutexInitØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MutexInitØ00__func__Ø000[0], str(2250), 17)
}
var _mutexIsInit int32
func _sqlite3MutexAlloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
if (_sqlite3Config.X1) == 0 {
return nil
}
func() {
if _mutexIsInit == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22844), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000))), unsafe.Pointer(str(2267)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22845), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MutexAllocØ00__func__Ø000))), unsafe.Pointer(str(2292)))
crt.X__builtin_abort(tls)
}
}()
return (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)})))(tls, _id)
}
var _sqlite3MutexAllocØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MutexAllocØ00__func__Ø000[0], str(2330), 18)
}
// Initialize the memory allocation subsystem.
func _sqlite3MallocInit(tls *crt.TLS) (r0 int32) {
var _rc, _2_i, _2_n, _2_sz int32
var _2_pSlot *Xsqlite3_file
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{nil})) {
_sqlite3MemSetDefault(tls)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_mem0), i32(0), u32(28))
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X0))))) = _sqlite3MutexAlloc(tls, i32(3))
if (_sqlite3Config.X19) == nil || (_sqlite3Config.X20) < i32(100) || (_sqlite3Config.X21) <= i32(0) {
goto _3
}
_2_sz = (_sqlite3Config.X20) & i32(-8)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = _2_sz
_2_pSlot = (*Xsqlite3_file)(_sqlite3Config.X19)
_2_n = _sqlite3Config.X21
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = _2_pSlot
*(*uint32)(unsafe.Pointer(&(_mem0.X4))) = uint32(_2_n)
_2_i = i32(0)
_4:
if _2_i >= (_2_n - i32(1)) {
goto _7
}
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = (*Xsqlite3_file)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_2_sz))))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_2_pSlot))))))))
_2_pSlot = (*Xsqlite3_file)(_2_pSlot.X0)
_2_i += 1
goto _4
_7:
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = nil
*(*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X2))) = (unsafe.Pointer)((*Xsqlite3_file)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pSlot)) + 4*uintptr(i32(1)))))
goto _8
_3:
*(*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X2))) = nil
*(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X19))) = nil
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = i32(0)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X21))) = i32(0)
_8:
if ((_sqlite3Config.X22 == nil) || ((_sqlite3Config.X23) < i32(512))) || ((_sqlite3Config.X24) <= i32(0)) {
*(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X22))) = nil
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X23))) = i32(0)
}
_rc = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X5)(tls, (*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X7)
if _rc != i32(0) {
crt.Xmemset(tls, (unsafe.Pointer)(&_mem0), i32(0), u32(28))
}
return _rc
}
// 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 _sqlite3MemSetDefault(tls *crt.TLS) {
Xsqlite3_config(tls, i32(4), unsafe.Pointer(&_sqlite3MemSetDefaultØ00defaultMethodsØ001))
}
// This API allows applications to modify the global configuration of
// the SQLite library at run-time.
//
// This routine should only be called when there are no outstanding
// database connections or memory allocations. This routine is not
// threadsafe. Failure to heed these warnings can lead to unpredictable
// behavior.
func Xsqlite3_config(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
var _rc int32
var _22_szMmap, _22_mxMmap int64
var _ap []interface{}
_rc = i32(0)
if (_sqlite3Config.X28) != 0 {
return _sqlite3MisuseError(tls, i32(140829))
}
_ap = args
switch _op {
case i32(1):
goto _2
case i32(2):
goto _3
case i32(3):
goto _4
case i32(4):
goto _7
case i32(5):
goto _8
case i32(6):
goto _10
case i32(7):
goto _11
case i32(9):
goto _9
case i32(10):
goto _5
case i32(11):
goto _6
case i32(13):
goto _17
case i32(14):
goto _13
case i32(15):
goto _14
case i32(16):
goto _18
case i32(17):
goto _19
case i32(18):
goto _15
case i32(19):
goto _16
case i32(20):
goto _20
case i32(22):
goto _21
case i32(24):
goto _12
case i32(25):
goto _22
case i32(26):
goto _23
default:
goto _24
}
_2:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(0)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(0)
goto _25
_3:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(1)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(0)
goto _25
_4:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X1))) = i32(1)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X2))) = i32(1)
goto _25
_5:
*(*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))) = *(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap))
goto _25
_6:
*(*Xsqlite3_mutex_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.X11
goto _25
_7:
*(*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))) = *(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap))
goto _25
_8:
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{nil})) {
_sqlite3MemSetDefault(tls)
}
*(*Xsqlite3_mem_methods)(crt.VAPointer(&_ap)) = _sqlite3Config.X10
goto _25
_9:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X0))) = crt.VAInt32(&_ap)
goto _25
_10:
*(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X19))) = crt.VAPointer(&_ap)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X20))) = crt.VAInt32(&_ap)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X21))) = crt.VAInt32(&_ap)
goto _25
_11:
*(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X22))) = crt.VAPointer(&_ap)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X23))) = crt.VAInt32(&_ap)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X24))) = crt.VAInt32(&_ap)
goto _25
_12:
*(*int32)(crt.VAPointer(&_ap)) = (_sqlite3HeaderSizeBtree(tls) + _sqlite3HeaderSizePcache(tls)) + _sqlite3HeaderSizePcache1(tls)
goto _25
_13:
goto _25
_14:
_rc = i32(1)
goto _25
_15:
*(*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))) = *(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap))
goto _25
_16:
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil})) {
_sqlite3PCacheSetDefault(tls)
}
*(*Xsqlite3_pcache_methods2)(crt.VAPointer(&_ap)) = _sqlite3Config.X12
goto _25
_17:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X7))) = crt.VAInt32(&_ap)
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X8))) = crt.VAInt32(&_ap)
goto _25
_18:
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_sqlite3Config.X35))) = crt.VAOther(&_ap).(func(*crt.TLS, unsafe.Pointer, int32, *int8))
*(*unsafe.Pointer)(unsafe.Pointer(&(_sqlite3Config.X36))) = crt.VAPointer(&_ap)
goto _25
_19:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X3))) = crt.VAInt32(&_ap)
goto _25
_20:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X4))) = crt.VAInt32(&_ap)
goto _25
_21:
_22_szMmap = crt.VAInt64(&_ap)
_22_mxMmap = crt.VAInt64(&_ap)
if (_22_mxMmap < int64(i32(0))) || (_22_mxMmap > int64(i32(2147418112))) {
_22_mxMmap = int64(i32(2147418112))
}
if _22_szMmap < int64(i32(0)) {
_22_szMmap = int64(i32(0))
}
if _22_szMmap > _22_mxMmap {
_22_szMmap = _22_mxMmap
}
*(*int64)(unsafe.Pointer(&(_sqlite3Config.X18))) = _22_mxMmap
*(*int64)(unsafe.Pointer(&(_sqlite3Config.X17))) = _22_szMmap
goto _25
_22:
*(*uint32)(unsafe.Pointer(&(_sqlite3Config.X27))) = crt.VAUint32(&_ap)
goto _25
_23:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X9))) = crt.VAInt32(&_ap)
goto _25
_24:
_rc = i32(1)
goto _25
_25:
_ap = nil
return _rc
}
// Return the size of the header added to each page by this module.
func _sqlite3HeaderSizeBtree(tls *crt.TLS) (r0 int32) {
return int32(u32(88))
}
// Return the size of the header added by this middleware layer
// in the page-cache hierarchy.
func _sqlite3HeaderSizePcache(tls *crt.TLS) (r0 int32) {
return int32(u32(40))
}
// Return the size of the header on each page of this PCACHE implementation.
func _sqlite3HeaderSizePcache1(tls *crt.TLS) (r0 int32) {
return int32(u32(32))
}
// This function is called during initialization (sqlite3_initialize()) to
// install the default pluggable cache module, assuming the user has not
// already provided an alternative.
func _sqlite3PCacheSetDefault(tls *crt.TLS) {
Xsqlite3_config(tls, i32(18), unsafe.Pointer(&_sqlite3PCacheSetDefaultØ00defaultMethodsØ001))
}
var _sqlite3PCacheSetDefaultØ00defaultMethodsØ001 Xsqlite3_pcache_methods2
func init() {
_sqlite3PCacheSetDefaultØ00defaultMethodsØ001 = Xsqlite3_pcache_methods2{X0: i32(1), X1: nil, X2: _pcache1Init, X3: _pcache1Shutdown, X4: _pcache1Create, X5: _pcache1Cachesize, X6: _pcache1Pagecount, X7: *(*func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page
}{_pcache1Fetch})), X8: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32)
}{_pcache1Unpin})), X9: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32)
}{_pcache1Rekey})), X10: _pcache1Truncate, X11: _pcache1Destroy, X12: _pcache1Shrink}
}
// Implementation of the sqlite3_pcache.xInit method.
func _pcache1Init(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
func() {
if (_pcache1_g.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45688), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1InitØ00__func__Ø000))), unsafe.Pointer(str(2348)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_pcache1_g), i32(0), u32(100))
*(*int32)(unsafe.Pointer(&(_pcache1_g.X2))) = bool2int((_sqlite3Config.X22 == nil) || ((_sqlite3Config.X1) > i32(0)))
if (_sqlite3Config.X1) != 0 {
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X0))))) = _sqlite3MutexAlloc(tls, i32(6))
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X9))))) = _sqlite3MutexAlloc(tls, i32(7))
}
if ((_pcache1_g.X2) != 0 && ((_sqlite3Config.X24) != i32(0))) && (_sqlite3Config.X22 == nil) {
*(*int32)(unsafe.Pointer(&(_pcache1_g.X3))) = _sqlite3Config.X24
goto _7
}
*(*int32)(unsafe.Pointer(&(_pcache1_g.X3))) = i32(0)
_7:
*(*uint32)(unsafe.Pointer(&((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X3))) = uint32(i32(10))
*(*int32)(unsafe.Pointer(&(_pcache1_g.X1))) = i32(1)
return i32(0)
}
var _pcache1InitØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pcache1InitØ00__func__Ø000[0], str(2366), 12)
}
// Implementation of the sqlite3_pcache.xShutdown method.
// Note that the static mutex allocated in xInit does
// not need to be freed.
func _pcache1Shutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
func() {
if (_pcache1_g.X1) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45741), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ShutdownØ00__func__Ø000))), unsafe.Pointer(str(2378)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_pcache1_g), i32(0), u32(100))
}
var _pcache1ShutdownØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pcache1ShutdownØ00__func__Ø000[0], str(2396), 16)
}
// Implementation of the sqlite3_pcache.xCreate method.
//
// Allocate a new cache.
func _pcache1Create(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32) (r0 unsafe.Pointer) {
var _sz int32
var _pCache *XPCache1
var _pGroup *XPGroup
func() {
if (_szPage&(_szPage-i32(1))) != i32(0) || _szPage < i32(512) || _szPage > i32(65536) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45758), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CreateØ00__func__Ø000))), unsafe.Pointer(str(2412)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _szExtra >= i32(300) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45759), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CreateØ00__func__Ø000))), unsafe.Pointer(str(2469)))
crt.X__builtin_abort(tls)
}
}()
_sz = int32(u32(60) + (u32(52) * uint32(_pcache1_g.X2)))
_pCache = (*XPCache1)(_sqlite3MallocZero(tls, uint64(_sz)))
if _pCache == nil {
goto _6
}
if (_pcache1_g.X2) != 0 {
_pGroup = (*XPGroup)(unsafe.Pointer((*XPCache1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache)) + 60*uintptr(i32(1))))))
*(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = uint32(i32(10))
goto _8
}
_pGroup = (*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0)))
_8:
if int32((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X4) == i32(0) {
*(*uint8)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X4))) = uint8(i32(1))
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8))))) = store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X7))))), (*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))))
}
*(**XPGroup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X0))))) = _pGroup
*(*int32)(unsafe.Pointer(&(_pCache.X1))) = _szPage
*(*int32)(unsafe.Pointer(&(_pCache.X2))) = _szExtra
*(*int32)(unsafe.Pointer(&(_pCache.X3))) = int32(uint32(_szPage+_szExtra) + u32(32))
*(*int32)(unsafe.Pointer(&(_pCache.X4))) = func() int32 {
if _bPurgeable != 0 {
return i32(1)
}
return i32(0)
}()
func() {
if (*Xsqlite3_mutex)(_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45779), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CreateØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
_pcache1ResizeHash(tls, _pCache)
if _bPurgeable != 0 {
*(*uint32)(unsafe.Pointer(&(_pCache.X5))) = uint32(i32(10))
{
p := (*uint32)(unsafe.Pointer(&(_pGroup.X2)))
*p = (*p) + (_pCache.X5)
sink5 = *p
}
*(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = ((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2)
}
func() {
if (*Xsqlite3_mutex)(_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45786), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CreateØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
if (_pCache.X11) == uint32(i32(0)) {
_pcache1Destroy(tls, (unsafe.Pointer)(_pCache))
_pCache = nil
}
_6:
return (unsafe.Pointer)(_pCache)
}
var _pcache1CreateØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_pcache1CreateØ00__func__Ø000[0], str(2502), 14)
}
// This function is used to resize the hash table used by the cache passed
// as the first argument.
//
// The PCache mutex must be held when this function is called.
func _pcache1ResizeHash(tls *crt.TLS, _p *XPCache1) {
var _nNew, _i, _6_h uint32
var _5_pPage, _5_pNext *XPgHdr1
var _apNew **XPgHdr1
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_p.X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45528), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000))), unsafe.Pointer(str(2516)))
crt.X__builtin_abort(tls)
}
}()
_nNew = (_p.X11) * uint32(i32(2))
if _nNew < uint32(i32(256)) {
_nNew = uint32(i32(256))
}
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_p.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45535), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000))), unsafe.Pointer(str(2553)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X11) != 0 {
_sqlite3BeginBenignMalloc(tls)
}
_apNew = (**XPgHdr1)(_sqlite3MallocZero(tls, uint64(u32(4)*_nNew)))
if (_p.X11) != 0 {
_sqlite3EndBenignMalloc(tls)
}
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_p.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45539), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ResizeHashØ00__func__Ø000))), unsafe.Pointer(str(2553)))
crt.X__builtin_abort(tls)
}
}()
if _apNew == nil {
goto _9
}
_i = uint32(i32(0))
_10:
if _i >= (_p.X11) {
goto _13
}
_5_pNext = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X12)) + 4*uintptr(_i)))
_14:
if store10(&_5_pPage, _5_pNext) != nil {
_6_h = (_5_pPage.X1) % _nNew
_5_pNext = (*XPgHdr1)(_5_pPage.X5)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apNew)) + 4*uintptr(_6_h)))
*(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apNew)) + 4*uintptr(_6_h))) = _5_pPage
goto _14
}
_i += 1
goto _10
_13:
Xsqlite3_free(tls, (unsafe.Pointer)(_p.X12))
*(***XPgHdr1)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _apNew
*(*uint32)(unsafe.Pointer(&(_p.X11))) = _nNew
_9:
}
var _pcache1ResizeHashØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_pcache1ResizeHashØ00__func__Ø000[0], str(2575), 18)
}
// 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 _sqlite3BeginBenignMalloc(tls *crt.TLS) {
if (_sqlite3Hooks.X0) != nil {
(_sqlite3Hooks.X0)(tls)
}
}
var _sqlite3Hooks TBenignMallocHooks
func _sqlite3EndBenignMalloc(tls *crt.TLS) {
if (_sqlite3Hooks.X1) != nil {
(_sqlite3Hooks.X1)(tls)
}
}
// Implementation of the sqlite3_pcache.xDestroy method.
//
// Destroy a cache allocated using pcache1Create().
func _pcache1Destroy(tls *crt.TLS, _p unsafe.Pointer) {
var _pCache *XPCache1
var _pGroup *XPGroup
_pCache = (*XPCache1)(_p)
_pGroup = (*XPGroup)(_pCache.X0)
func() {
if (_pCache.X4) == 0 && ((_pCache.X6) != uint32(i32(0)) || (_pCache.X5) != uint32(i32(0))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46152), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2593)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_mutex)(_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46153), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
if (_pCache.X10) != 0 {
_pcache1TruncateUnsafe(tls, _pCache, uint32(i32(0)))
}
func() {
if (_pGroup.X1) < (_pCache.X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46155), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2652)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pGroup.X1)))
*p = (*p) - (_pCache.X6)
sink5 = *p
}
func() {
if (_pGroup.X2) < (_pCache.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46157), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2685)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pGroup.X2)))
*p = (*p) - (_pCache.X5)
sink5 = *p
}
*(*uint32)(unsafe.Pointer(&(_pGroup.X3))) = ((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2)
_pcache1EnforceMaxPage(tls, _pCache)
func() {
if (*Xsqlite3_mutex)(_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46161), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1DestroyØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_free(tls, _pCache.X14)
Xsqlite3_free(tls, (unsafe.Pointer)(_pCache.X12))
Xsqlite3_free(tls, (unsafe.Pointer)(_pCache))
}
var _pcache1DestroyØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pcache1DestroyØ00__func__Ø000[0], str(2718), 15)
}
// Discard all pages from cache pCache with a page number (key value)
// greater than or equal to iLimit. Any pinned pages that meet this
// criteria are unpinned before they are discarded.
//
// The PCache mutex must be held when this function is called.
func _pcache1TruncateUnsafe(tls *crt.TLS, _pCache *XPCache1, _iLimit uint32) {
var _nPage int32
var _h, _iStop uint32
var _3_pPage *XPgHdr1
var _3_pp **XPgHdr1
_nPage = i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45641), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2733)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X8) < _iLimit {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45642), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2775)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X11) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45643), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2801)))
crt.X__builtin_abort(tls)
}
}()
if ((_pCache.X8) - _iLimit) < (_pCache.X11) {
_h = _iLimit % (_pCache.X11)
_iStop = (_pCache.X8) % (_pCache.X11)
_nPage = i32(-10)
goto _7
}
_h = (_pCache.X11) / uint32(i32(2))
_iStop = _h - uint32(i32(1))
_7:
func() {
if _h >= (_pCache.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45661), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2819)))
crt.X__builtin_abort(tls)
}
}()
_3_pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_h)))
_13:
if store10(&_3_pPage, *_3_pp) == nil {
goto _14
}
if (_3_pPage.X1) < _iLimit {
goto _15
}
*(*uint32)(unsafe.Pointer(&(_pCache.X10))) -= 1
*_3_pp = (*XPgHdr1)(_3_pPage.X5)
if (_3_pPage.X2) == 0 {
_pcache1PinPage(tls, _3_pPage)
}
_pcache1FreePage(tls, _3_pPage)
goto _17
_15:
_3_pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pPage.X5)))))
if _nPage >= i32(0) {
_nPage += 1
}
_17:
goto _13
_14:
if _h == _iStop {
goto _10
}
_h = (_h + uint32(i32(1))) % (_pCache.X11)
goto _7
_10:
func() {
if _nPage >= i32(0) && (_pCache.X10) != uint32(_nPage) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45677), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateUnsafeØ00__func__Ø000))), unsafe.Pointer(str(2835)))
crt.X__builtin_abort(tls)
}
}()
}
var _pcache1TruncateUnsafeØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pcache1TruncateUnsafeØ00__func__Ø000[0], str(2877), 22)
}
// This function is used internally to remove the page pPage from the
// PGroup LRU list, if is part of it. If pPage is not part of the PGroup
// LRU list, then this function is a no-op.
//
// The PGroup mutex must be held when this function is called.
func _pcache1PinPage(tls *crt.TLS, _pPage *XPgHdr1) (r0 *XPgHdr1) {
var _pCache *XPCache1
func() {
if _pPage == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45567), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2899)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45568), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2908)))
crt.X__builtin_abort(tls)
}
}()
_pCache = (*XPCache1)(_pPage.X6)
func() {
if (*XPgHdr1)(_pPage.X7) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45570), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2927)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr1)(_pPage.X8) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45571), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2943)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45572), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2733)))
crt.X__builtin_abort(tls)
}
}()
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(_pPage.X8).X7))))) = (*XPgHdr1)(_pPage.X7)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(_pPage.X7).X8))))) = (*XPgHdr1)(_pPage.X8)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))) = nil
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = nil
*(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1))
func() {
if int32(_pPage.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45578), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2959)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XPgHdr1)(unsafe.Pointer(&((*XPGroup)(_pCache.X0).X5))).X4) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45579), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PinPageØ00__func__Ø000))), unsafe.Pointer(str(2978)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pCache.X9))) -= 1
return _pPage
}
var _pcache1PinPageØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pcache1PinPageØ00__func__Ø000[0], str(3010), 15)
}
// Free a page object allocated by pcache1AllocPage().
func _pcache1FreePage(tls *crt.TLS, _p *XPgHdr1) {
var _pCache *XPCache1
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45456), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
_pCache = (*XPCache1)(_p.X6)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)((*XPCache1)(_p.X6).X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45458), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FreePageØ00__func__Ø000))), unsafe.Pointer(str(3025)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) != 0 {
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = (*XPgHdr1)(_pCache.X13)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = _p
goto _5
}
_pcache1Free(tls, (*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X0)
_5:
if (_pCache.X4) != 0 {
*(*uint32)(unsafe.Pointer(&((*XPGroup)(_pCache.X0).X4))) -= 1
}
}
var _pcache1FreePageØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pcache1FreePageØ00__func__Ø000[0], str(3070), 16)
}
// Free an allocated buffer obtained from pcache1Alloc().
func _pcache1Free(tls *crt.TLS, _p unsafe.Pointer) {
var _3_nFreed int32
var _1_pSlot *Xsqlite3_file
if _p == nil {
return
}
if (uint32(uintptr(_p)) >= uint32(uintptr(_pcache1_g.X7))) && (uint32(uintptr(_p)) < uint32(uintptr(_pcache1_g.X8))) {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
_sqlite3StatusDown(tls, i32(1), i32(1))
_1_pSlot = (*Xsqlite3_file)(_p)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pSlot.X0))))) = (*Xsqlite3_file)(_pcache1_g.X10)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = _1_pSlot
*(*int32)(unsafe.Pointer(&(_pcache1_g.X11))) += 1
*(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = bool2int((_pcache1_g.X11) < (_pcache1_g.X6))
func() {
if (_pcache1_g.X11) > (_pcache1_g.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45365), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FreeØ00__func__Ø000))), unsafe.Pointer(str(3086)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
goto _5
}
i32(0)
_3_nFreed = i32(0)
_3_nFreed = _sqlite3MallocSize(tls, _p)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
_sqlite3StatusDown(tls, i32(2), _3_nFreed)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
Xsqlite3_free(tls, _p)
_5:
}
var _pcache1FreeØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pcache1FreeØ00__func__Ø000[0], str(3119), 12)
}
// If there are currently more than nMaxPage pages allocated, try
// to recycle pages to reduce the number allocated to nMaxPage.
func _pcache1EnforceMaxPage(tls *crt.TLS, _pCache *XPCache1) {
var _p *XPgHdr1
var _pGroup *XPGroup
_pGroup = (*XPGroup)(_pCache.X0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pGroup.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45613), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000))), unsafe.Pointer(str(3131)))
crt.X__builtin_abort(tls)
}
}()
_2:
if ((_pGroup.X4) > (_pGroup.X1)) && (int32(store10(&_p, (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8)).X4) == i32(0)) {
func() {
if (*XPGroup)((*XPCache1)(_p.X6).X0) != _pGroup {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45617), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000))), unsafe.Pointer(str(3165)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45618), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1EnforceMaxPageØ00__func__Ø000))), unsafe.Pointer(str(3191)))
crt.X__builtin_abort(tls)
}
}()
_pcache1PinPage(tls, _p)
_pcache1RemoveFromHash(tls, _p, i32(1))
goto _2
}
if ((_pCache.X10) == uint32(i32(0))) && ((_pCache.X14) != nil) {
Xsqlite3_free(tls, _pCache.X14)
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X14))) = (unsafe.Pointer)(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))), nil))
}
}
var _pcache1EnforceMaxPageØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pcache1EnforceMaxPageØ00__func__Ø000[0], str(3206), 22)
}
// Remove the page supplied as an argument from the hash table
// (PCache1.apHash structure) that it is currently stored in.
// Also free the page if freePage is true.
//
// The PGroup mutex must be held when this function is called.
func _pcache1RemoveFromHash(tls *crt.TLS, _pPage *XPgHdr1, _freeFlag int32) {
var _h uint32
var _pCache *XPCache1
var _pp **XPgHdr1
_pCache = (*XPCache1)(_pPage.X6)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45597), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RemoveFromHashØ00__func__Ø000))), unsafe.Pointer(str(2733)))
crt.X__builtin_abort(tls)
}
}()
_h = (_pPage.X1) % (_pCache.X11)
_pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_h)))
_2:
if (*_pp) == _pPage {
goto _5
}
_pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_pp).X5)))))
goto _2
_5:
*_pp = (*XPgHdr1)((*_pp).X5)
*(*uint32)(unsafe.Pointer(&(_pCache.X10))) -= 1
if _freeFlag != 0 {
_pcache1FreePage(tls, _pPage)
}
}
var _pcache1RemoveFromHashØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pcache1RemoveFromHashØ00__func__Ø000[0], str(3228), 22)
}
// Implementation of the sqlite3_pcache.xCachesize method.
//
// Configure the cache_size limit for a cache.
func _pcache1Cachesize(tls *crt.TLS, _p unsafe.Pointer, _nMax int32) {
var _pCache *XPCache1
var _1_pGroup *XPGroup
_pCache = (*XPCache1)(_p)
if (_pCache.X4) != 0 {
_1_pGroup = (*XPGroup)(_pCache.X0)
func() {
if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45804), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_1_pGroup.X1)))
*p = (*p) + (uint32(_nMax) - (_pCache.X6))
sink5 = *p
}
*(*uint32)(unsafe.Pointer(&(_1_pGroup.X3))) = ((_1_pGroup.X1) + uint32(i32(10))) - (_1_pGroup.X2)
*(*uint32)(unsafe.Pointer(&(_pCache.X6))) = uint32(_nMax)
*(*uint32)(unsafe.Pointer(&(_pCache.X7))) = ((_pCache.X6) * uint32(i32(9))) / uint32(i32(10))
_pcache1EnforceMaxPage(tls, _pCache)
func() {
if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45810), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1CachesizeØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
}
}
var _pcache1CachesizeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_pcache1CachesizeØ00__func__Ø000[0], str(3250), 17)
}
// Implementation of the sqlite3_pcache.xPagecount method.
func _pcache1Pagecount(tls *crt.TLS, _p unsafe.Pointer) (r0 int32) {
var _n int32
var _pCache *XPCache1
_pCache = (*XPCache1)(_p)
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45839), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
_n = int32(_pCache.X10)
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45841), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1PagecountØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
return _n
}
var _pcache1PagecountØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_pcache1PagecountØ00__func__Ø000[0], str(3294), 17)
}
func _pcache1Fetch(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
var _pCache *XPCache1
_pCache = (*XPCache1)(_p)
i32(0)
func() {
if (_pCache.X4) == 0 && _createFlag == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46037), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3311)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X4) == 0 && (_pCache.X5) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46038), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3347)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X4) != i32(0) && (_pCache.X5) != uint32(i32(10)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46039), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3385)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X5) != uint32(i32(0)) && (_pCache.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46040), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3427)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X11) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46041), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchØ00__func__Ø000))), unsafe.Pointer(str(3465)))
crt.X__builtin_abort(tls)
}
}()
return (*Xsqlite3_pcache_page)(unsafe.Pointer(_pcache1FetchNoMutex(tls, _p, _iKey, _createFlag)))
}
var _pcache1FetchØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pcache1FetchØ00__func__Ø000[0], str(3481), 13)
}
// Implementation of the sqlite3_pcache.xFetch method.
//
// Fetch a page by key value.
//
// Whether or not a new page may be allocated by this function depends on
// the value of the createFlag argument. 0 means do not allocate a new
// page. 1 means allocate a new page if space is easily available. 2
// means to try really hard to allocate a new page.
//
// For a non-purgeable cache (a cache used as the storage for an in-memory
// database) there is really no difference between createFlag 1 and 2. So
// the calling function (pcache.c) will never have a createFlag of 1 on
// a non-purgeable cache.
//
// There are three different approaches to obtaining space for a page,
// depending on the value of parameter createFlag (which may be 0, 1 or 2).
//
// 1. Regardless of the value of createFlag, the cache is searched for a
// copy of the requested page. If one is found, it is returned.
//
// 2. If createFlag==0 and the page is not already in the cache, NULL is
// returned.
//
// 3. If createFlag is 1, and the page is not already in the cache, then
// return NULL (do not allocate a new page) if any of the following
// conditions are true:
//
// (a) the number of pages pinned by the cache is greater than
// PCache1.nMax, or
//
// (b) the number of pages pinned by the cache is greater than
// the sum of nMax for all purgeable caches, less the sum of
// nMin for all other purgeable caches, or
//
// 4. If none of the first three conditions apply and the cache is marked
// as purgeable, and if one of the following is true:
//
// (a) The number of pages allocated for the cache is already
// PCache1.nMax, or
//
// (b) The number of pages allocated for all purgeable caches is
// already equal to or greater than the sum of nMax for all
// purgeable caches,
//
// (c) The system is under memory pressure and wants to avoid
// unnecessary pages cache entry allocations
//
// then attempt to recycle a page from the LRU list. If it is the right
// size, return the recycled buffer. Otherwise, free the buffer and
// proceed to step 5.
//
// 5. Otherwise, allocate and return a new page buffer.
//
// There are two versions of this routine. pcache1FetchWithMutex() is
// the general case. pcache1FetchNoMutex() is a faster implementation for
// the common case where pGroup->mutex is NULL. The pcache1Fetch() wrapper
// invokes the appropriate routine.
func _pcache1FetchNoMutex(tls *crt.TLS, _p unsafe.Pointer, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
var _pCache *XPCache1
var _pPage *XPgHdr1
_pCache = (*XPCache1)(_p)
_pPage = nil
_pPage = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_iKey%(_pCache.X11))))
_0:
if (_pPage != nil) && ((_pPage.X1) != _iKey) {
_pPage = (*XPgHdr1)(_pPage.X5)
goto _0
}
if _pPage == nil {
goto _3
}
if (_pPage.X2) == 0 {
return _pcache1PinPage(tls, _pPage)
}
return _pPage
_3:
if _createFlag != 0 {
return _pcache1FetchStage2(tls, _pCache, _iKey, _createFlag)
}
return nil
}
// Implement steps 3, 4, and 5 of the pcache1Fetch() algorithm described
// in the header of the pcache1Fetch() procedure.
//
// This steps are broken out into a separate procedure because they are
// usually not needed, and by avoiding the stack initialization required
// for these steps, the main pcache1Fetch() procedure can run faster.
func _pcache1FetchStage2(tls *crt.TLS, _pCache *XPCache1, _iKey uint32, _createFlag int32) (r0 *XPgHdr1) {
var _nPinned, _6_h uint32
var _2_pOther *XPCache1
var _pPage *XPgHdr1
var _pGroup *XPGroup
_pGroup = (*XPGroup)(_pCache.X0)
_pPage = nil
func() {
if (_pCache.X10) < (_pCache.X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45864), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3494)))
crt.X__builtin_abort(tls)
}
}()
_nPinned = (_pCache.X10) - (_pCache.X9)
func() {
if (_pGroup.X3) != (((_pGroup.X1) + uint32(i32(10))) - (_pGroup.X2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45866), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3531)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X7) != (((_pCache.X6) * uint32(i32(9))) / uint32(i32(10))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45867), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3592)))
crt.X__builtin_abort(tls)
}
}()
if (_createFlag == i32(1)) && (((_nPinned >= (_pGroup.X3)) || (_nPinned >= (_pCache.X7))) || (_pcache1UnderMemoryPressure(tls, _pCache) != 0 && ((_pCache.X9) < _nPinned))) {
return nil
}
if (_pCache.X10) >= (_pCache.X11) {
_pcache1ResizeHash(tls, _pCache)
}
func() {
if (_pCache.X11) <= uint32(i32(0)) || (**XPgHdr1)(unsafe.Pointer(_pCache.X12)) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45877), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(3628)))
crt.X__builtin_abort(tls)
}
}()
if (_pCache.X4) == 0 || ((*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8).X4) != 0 || ((_pCache.X10)+uint32(i32(1))) < (_pCache.X6) && _pcache1UnderMemoryPressure(tls, _pCache) == 0 {
goto _18
}
_pPage = (*XPgHdr1)((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X8)
func() {
if int32(_pPage.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45886), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1FetchStage2Ø00__func__Ø000))), unsafe.Pointer(str(2908)))
crt.X__builtin_abort(tls)
}
}()
_pcache1RemoveFromHash(tls, _pPage, i32(0))
_pcache1PinPage(tls, _pPage)
_2_pOther = (*XPCache1)(_pPage.X6)
if (_2_pOther.X3) != (_pCache.X3) {
_pcache1FreePage(tls, _pPage)
_pPage = nil
goto _22
}
{
p := (*uint32)(unsafe.Pointer(&(_pGroup.X4)))
*p = (*p) - uint32((_2_pOther.X4)-(_pCache.X4))
sink5 = *p
}
_22:
_18:
if _pPage == nil {
_pPage = _pcache1AllocPage(tls, _pCache, bool2int(_createFlag == i32(1)))
}
if _pPage == nil {
goto _24
}
_6_h = _iKey % (_pCache.X11)
*(*uint32)(unsafe.Pointer(&(_pCache.X10))) += 1
*(*uint32)(unsafe.Pointer(&(_pPage.X1))) = _iKey
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_6_h)))
*(**XPCache1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X6))))) = _pCache
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = nil
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))) = nil
*(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1))
*(*unsafe.Pointer)((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_pPage.X0))).X1) = nil
*(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_6_h))) = _pPage
if _iKey > (_pCache.X8) {
*(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iKey
}
_24:
return _pPage
}
var _pcache1FetchStage2Ø00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_pcache1FetchStage2Ø00__func__Ø000[0], str(3662), 19)
}
// Return true if it desirable to avoid allocating a new page cache
// entry.
//
// If memory was allocated specifically to the page cache using
// SQLITE_CONFIG_PAGECACHE but that memory has all been used, then
// it is desirable to avoid allocating a new page cache entry because
// presumably SQLITE_CONFIG_PAGECACHE was suppose to be sufficient
// for all page cache needs and we should not need to spill the
// allocation onto the heap.
//
// Or, the heap is used for all page cache memory but the heap is
// under memory pressure, then again it is desirable to avoid
// allocating a new page cache entry in order to avoid stressing
// the heap even further.
func _pcache1UnderMemoryPressure(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
if (_pcache1_g.X5) != 0 && (((_pCache.X1) + (_pCache.X2)) <= (_pcache1_g.X4)) {
return _pcache1_g.X12
}
return _sqlite3HeapNearlyFull(tls)
}
// 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 _sqlite3HeapNearlyFull(tls *crt.TLS) (r0 int32) {
return _mem0.X5
}
// Allocate a new page object initially associated with cache pCache.
func _pcache1AllocPage(tls *crt.TLS, _pCache *XPCache1, _benignMalloc int32) (r0 *XPgHdr1) {
var _pPg unsafe.Pointer
var _p *XPgHdr1
_p = nil
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45408), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1AllocPageØ00__func__Ø000))), unsafe.Pointer(str(2733)))
crt.X__builtin_abort(tls)
}
}()
if ((*XPgHdr1)(_pCache.X13) != nil) || (((_pCache.X10) == uint32(i32(0))) && _pcache1InitBulk(tls, _pCache) != 0) {
_p = (*XPgHdr1)(_pCache.X13)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = (*XPgHdr1)(_p.X5)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil
goto _5
}
if _benignMalloc != 0 {
_sqlite3BeginBenignMalloc(tls)
}
_pPg = _pcache1Alloc(tls, _pCache.X3)
_p = (*XPgHdr1)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pPg) + 1*uintptr(_pCache.X1)))))
if _benignMalloc != 0 {
_sqlite3EndBenignMalloc(tls)
}
if _pPg == nil {
return nil
}
*(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X0))) = _pPg
*(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_p.X0))).X1))) = (unsafe.Pointer)((*XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 32*uintptr(i32(1)))))
*(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(0))
_5:
if (_pCache.X4) != 0 {
*(*uint32)(unsafe.Pointer(&((*XPGroup)(_pCache.X0).X4))) += 1
}
return _p
}
var _pcache1AllocPageØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_pcache1AllocPageØ00__func__Ø000[0], str(3681), 17)
}
// Try to initialize the pCache->pFree and pCache->pBulk fields. Return
// true if pCache->pFree ends up containing one or more free pages.
func _pcache1InitBulk(tls *crt.TLS, _pCache *XPCache1) (r0 int32) {
var _4_nBulk int32
var _szBulk int64
var _zBulk *int8
var _5_pX *XPgHdr1
if (_pcache1_g.X3) == i32(0) {
return i32(0)
}
if (_pCache.X6) < uint32(i32(3)) {
return i32(0)
}
_sqlite3BeginBenignMalloc(tls)
if (_pcache1_g.X3) > i32(0) {
_szBulk = int64(_pCache.X3) * int64(_pcache1_g.X3)
goto _3
}
_szBulk = int64(i32(-1024)) * int64(_pcache1_g.X3)
_3:
if _szBulk > (int64(_pCache.X3) * int64(_pCache.X6)) {
_szBulk = int64(_pCache.X3) * int64(_pCache.X6)
}
_zBulk = (*int8)(store11((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X14))), _sqlite3Malloc(tls, uint64(_szBulk))))
_sqlite3EndBenignMalloc(tls)
if _zBulk == nil {
goto _5
}
_4_nBulk = _sqlite3MallocSize(tls, (unsafe.Pointer)(_zBulk)) / (_pCache.X3)
_6:
_5_pX = (*XPgHdr1)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBulk)) + 1*uintptr(_pCache.X1)))))
*(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_5_pX.X0))).X0))) = (unsafe.Pointer)(_zBulk)
*(*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer(&(_5_pX.X0))).X1))) = (unsafe.Pointer)((*XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_pX)) + 32*uintptr(i32(1)))))
*(*uint8)(unsafe.Pointer(&(_5_pX.X3))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_5_pX.X4))) = uint8(i32(0))
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pX.X5))))) = (*XPgHdr1)(_pCache.X13)
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X13))))) = _5_pX
{
p := &_zBulk
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_pCache.X3)))
sink0 = *p
}
if preInc1(&_4_nBulk, -1) != 0 {
goto _6
}
_5:
return bool2int((*XPgHdr1)(_pCache.X13) != nil)
_ = _4_nBulk
panic(0)
}
// Malloc function used within this file to allocate space from the buffer
// configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no
// such buffer exists or there is no space left in it, this function falls
// back to sqlite3Malloc().
//
// Multiple threads can run this routine at the same time. Global variables
// in pcache1 need to be protected via mutex.
func _pcache1Alloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
var _4_sz int32
var _p unsafe.Pointer
_p = nil
func() {
if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XPGroup)(unsafe.Pointer(&(_pcache1_g.X0))).X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45318), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1AllocØ00__func__Ø000))), unsafe.Pointer(str(3698)))
crt.X__builtin_abort(tls)
}
}()
if _nByte > (_pcache1_g.X4) {
goto _2
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
_p = _pcache1_g.X10
if _p != nil {
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = (*Xsqlite3_file)((*Xsqlite3_file)(_pcache1_g.X10).X0)
*(*int32)(unsafe.Pointer(&(_pcache1_g.X11))) -= 1
*(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = bool2int((_pcache1_g.X11) < (_pcache1_g.X6))
func() {
if (_pcache1_g.X11) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45326), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1AllocØ00__func__Ø000))), unsafe.Pointer(str(3739)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StatusHighwater(tls, i32(7), _nByte)
_sqlite3StatusUp(tls, i32(1), i32(1))
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
_2:
if _p != nil {
goto _6
}
_p = _sqlite3Malloc(tls, uint64(_nByte))
if _p != nil {
_4_sz = _sqlite3MallocSize(tls, _p)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
_sqlite3StatusHighwater(tls, i32(7), _nByte)
_sqlite3StatusUp(tls, i32(2), _4_sz)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pcache1_g.X9))
}
_6:
return _p
}
func Xsqlite3_mutex_notheld(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
func() {
if _p != nil && (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X8)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_notheldØ00__func__Ø000))), unsafe.Pointer(str(3760)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((_p == nil) || (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X8)})))(tls, _p) != 0)
}
var _sqlite3_mutex_notheldØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_notheldØ00__func__Ø000[0], str(3808), 22)
}
var _pcache1AllocØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pcache1AllocØ00__func__Ø000[0], str(3830), 13)
}
// Implementation of the sqlite3_pcache.xUnpin method.
//
// Mark a page as unpinned (eligible for asynchronous recycling).
func _pcache1Unpin(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _reuseUnlikely int32) {
var _pCache *XPCache1
var _pPage *XPgHdr1
var _2_ppFirst **XPgHdr1
var _pGroup *XPGroup
_pCache = (*XPCache1)(_p)
_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
_pGroup = (*XPGroup)(_pCache.X0)
func() {
if (*XPCache1)(_pPage.X6) != _pCache {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46067), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000))), unsafe.Pointer(str(3843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_mutex)(_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46068), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr1)(_pPage.X8) != nil || (*XPgHdr1)(_pPage.X7) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46073), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000))), unsafe.Pointer(str(3865)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X2) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46074), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000))), unsafe.Pointer(str(3906)))
crt.X__builtin_abort(tls)
}
}()
if _reuseUnlikely != 0 || ((_pGroup.X4) > (_pGroup.X1)) {
_pcache1RemoveFromHash(tls, _pPage, i32(1))
goto _11
}
_2_ppFirst = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5))).X7)))))
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X8))))) = (*XPgHdr1)(unsafe.Pointer(&(_pGroup.X5)))
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(store10((**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X7))))), *_2_ppFirst).X8))))) = _pPage
*_2_ppFirst = _pPage
*(*uint32)(unsafe.Pointer(&(_pCache.X9))) += 1
*(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(0))
_11:
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46088), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1UnpinØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
}
var _pcache1UnpinØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pcache1UnpinØ00__func__Ø000[0], str(3925), 13)
}
// Implementation of the sqlite3_pcache.xRekey method.
func _pcache1Rekey(tls *crt.TLS, _p unsafe.Pointer, _pPg *Xsqlite3_pcache_page, _iOld uint32, _iNew uint32) {
var _h uint32
var _pCache *XPCache1
var _pPage *XPgHdr1
var _pp **XPgHdr1
_pCache = (*XPCache1)(_p)
_pPage = (*XPgHdr1)(unsafe.Pointer(_pPg))
func() {
if (_pPage.X1) != _iOld {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46104), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000))), unsafe.Pointer(str(3938)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPCache1)(_pPage.X6) != _pCache {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46105), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000))), unsafe.Pointer(str(3843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46107), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
_h = _iOld % (_pCache.X11)
_pp = (**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_h)))
_6:
if (*_pp) != _pPage {
_pp = (**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_pp).X5)))))
goto _6
}
*_pp = (*XPgHdr1)(_pPage.X5)
_h = _iNew % (_pCache.X11)
*(*uint32)(unsafe.Pointer(&(_pPage.X1))) = _iNew
*(**XPgHdr1)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X5))))) = *(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_h)))
*(**XPgHdr1)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCache.X12)) + 4*uintptr(_h))) = _pPage
if _iNew > (_pCache.X8) {
*(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iNew
}
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46124), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1RekeyØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
}
var _pcache1RekeyØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pcache1RekeyØ00__func__Ø000[0], str(3956), 13)
}
// Implementation of the sqlite3_pcache.xTruncate method.
//
// Discard all unpinned pages in the cache with a page number equal to
// or greater than parameter iLimit. Any pinned pages with a page number
// equal to or greater than iLimit are implicitly unpinned.
func _pcache1Truncate(tls *crt.TLS, _p unsafe.Pointer, _iLimit uint32) {
var _pCache *XPCache1
_pCache = (*XPCache1)(_p)
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46136), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
if _iLimit <= (_pCache.X8) {
_pcache1TruncateUnsafe(tls, _pCache, _iLimit)
*(*uint32)(unsafe.Pointer(&(_pCache.X8))) = _iLimit - uint32(i32(1))
}
func() {
if (*Xsqlite3_mutex)((*XPGroup)(_pCache.X0).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46141), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1TruncateØ00__func__Ø000))), unsafe.Pointer(str(3267)))
crt.X__builtin_abort(tls)
}
}()
}
var _pcache1TruncateØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pcache1TruncateØ00__func__Ø000[0], str(3969), 16)
}
// Implementation of the sqlite3_pcache.xShrink method.
//
// Free up as much memory as possible.
func _pcache1Shrink(tls *crt.TLS, _p unsafe.Pointer) {
var _1_savedMaxPage int32
var _pCache *XPCache1
var _1_pGroup *XPGroup
_pCache = (*XPCache1)(_p)
if (_pCache.X4) != 0 {
_1_pGroup = (*XPGroup)(_pCache.X0)
func() {
if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45824), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
_1_savedMaxPage = int32(_1_pGroup.X1)
*(*uint32)(unsafe.Pointer(&(_1_pGroup.X1))) = uint32(i32(0))
_pcache1EnforceMaxPage(tls, _pCache)
*(*uint32)(unsafe.Pointer(&(_1_pGroup.X1))) = uint32(_1_savedMaxPage)
func() {
if (*Xsqlite3_mutex)(_1_pGroup.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(45829), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcache1ShrinkØ00__func__Ø000))), unsafe.Pointer(str(2483)))
crt.X__builtin_abort(tls)
}
}()
}
}
var _pcache1ShrinkØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_pcache1ShrinkØ00__func__Ø000[0], str(3985), 14)
}
var _sqlite3MemSetDefaultØ00defaultMethodsØ001 Xsqlite3_mem_methods
func init() {
_sqlite3MemSetDefaultØ00defaultMethodsØ001 = Xsqlite3_mem_methods{X0: _sqlite3MemMalloc, X1: _sqlite3MemFree, X2: _sqlite3MemRealloc, X3: _sqlite3MemSize, X4: _sqlite3MemRoundup, X5: _sqlite3MemInit, X6: _sqlite3MemShutdown, X7: nil}
}
// Like malloc(), but remember the size of the allocation
// so that we can find it later using sqlite3MemSize().
//
// For this low-level routine, we are guaranteed that nByte>0 because
// cases of nByte<=0 will be intercepted and dealt with by higher level
// routines.
func _sqlite3MemMalloc(tls *crt.TLS, _nByte int32) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
_p = crt.Xmalloc(tls, uint32(_nByte))
if _p == nil {
Xsqlite3_log(tls, i32(7), str(3999), _nByte)
}
return _p
}
// Like free() but works for allocations obtained from sqlite3MemMalloc()
// or sqlite3MemRealloc().
//
// For this low-level routine, we already know that pPrior!=0 since
// cases where pPrior==0 will have been intecepted and dealt with
// by higher-level routines.
func _sqlite3MemFree(tls *crt.TLS, _pPrior unsafe.Pointer) {
crt.Xfree(tls, _pPrior)
}
// Like realloc(). Resize an allocation previously obtained from
// sqlite3MemMalloc().
//
// For this low-level interface, we know that pPrior!=0. Cases where
// pPrior==0 while have been intercepted by higher-level routine and
// redirected to xMalloc. Similarly, we know that nByte>0 because
// cases where nByte<=0 will have been intercepted by higher-level
// routines and redirected to xFree.
func _sqlite3MemRealloc(tls *crt.TLS, _pPrior unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
_p = crt.Xrealloc(tls, _pPrior, uint32(_nByte))
if _p == nil {
Xsqlite3_log(tls, i32(7), str(4037), crt.Xmalloc_usable_size(tls, _pPrior), _nByte)
}
return _p
}
// Report the allocated size of a prior return from xMalloc()
// or xRealloc().
func _sqlite3MemSize(tls *crt.TLS, _pPrior unsafe.Pointer) (r0 int32) {
func() {
if _pPrior == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20827), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemSizeØ00__func__Ø000))), unsafe.Pointer(str(4073)))
crt.X__builtin_abort(tls)
}
}()
return int32(crt.Xmalloc_usable_size(tls, _pPrior))
}
var _sqlite3MemSizeØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MemSizeØ00__func__Ø000[0], str(4083), 15)
}
// Round up a request size to the next valid allocation size.
func _sqlite3MemRoundup(tls *crt.TLS, _n int32) (r0 int32) {
return (_n + i32(7)) & i32(-8)
}
// Initialize this module.
func _sqlite3MemInit(tls *crt.TLS, _NotUsed unsafe.Pointer) (r0 int32) {
return i32(0)
}
// Deinitialize this module.
func _sqlite3MemShutdown(tls *crt.TLS, _NotUsed unsafe.Pointer) {
}
func _sqlite3NomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
return _reportError(tls, i32(7), _lineno, str(4098))
}
var _sqlite3BuiltinFunctions XFuncDefHash
// All of the FuncDef structures in the aBuiltinFunc[] array above
// to the global function hash table. This occurs at start-time (as
// a consequence of calling sqlite3_initialize()).
//
// After this routine runs
func _sqlite3RegisterBuiltinFunctions(tls *crt.TLS) {
_sqlite3AlterFunctions(tls)
_sqlite3RegisterDateTimeFunctions(tls)
_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001)), i32(60))
}
// Register built-in functions used to help implement ALTER TABLE
func _sqlite3AlterFunctions(tls *crt.TLS) {
_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001)), i32(3))
}
// Insert a new FuncDef into a FuncDefHash hash table.
func _sqlite3InsertBuiltinFuncs(tls *crt.TLS, _aDef *XFuncDef, _nDef int32) {
var _i, _1_nName, _1_h int32
var _1_zName *int8
var _1_pOther *XFuncDef
_i = i32(0)
_0:
if _i >= _nDef {
goto _3
}
_1_zName = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i))).X6
_1_nName = _sqlite3Strlen30(tls, _1_zName)
_1_h = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zName)) + 1*uintptr(i32(0))))))))) + _1_nName) % i32(23)
_1_pOther = _functionSearch(tls, _1_h, _1_zName)
if _1_pOther != nil {
func() {
if _1_pOther == (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef))+28*uintptr(_i))) || (*XFuncDef)(_1_pOther.X3) == (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef))+28*uintptr(_i))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104459), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertBuiltinFuncsØ00__func__Ø000))), unsafe.Pointer(str(4102)))
crt.X__builtin_abort(tls)
}
}()
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i))).X3))))) = (*XFuncDef)(_1_pOther.X3)
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pOther.X3))))) = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i)))
goto _8
}
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i))).X3))))) = nil
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i))).X7))))))) = *(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 4*uintptr(_1_h)))
*(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 4*uintptr(_1_h))) = (*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDef)) + 28*uintptr(_i)))
_8:
_i += 1
goto _0
_3:
}
// Compute a string length that is limited to what can be stored in
// lower 30 bits of a 32-bit signed integer.
//
// The value returned will never be negative. Nor will it ever be greater
// than the actual length of the string. For very long strings (greater
// than 1GiB) the value returned might be less than the true string length.
func _sqlite3Strlen30(tls *crt.TLS, _z *int8) (r0 int32) {
if _z == nil {
return i32(0)
}
return i32(1073741823) & int32(crt.Xstrlen(tls, _z))
}
var _sqlite3UpperToLower [256]uint8
func init() {
_sqlite3UpperToLower = [256]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255}
}
// 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 _functionSearch(tls *crt.TLS, _h int32, _zFunc *int8) (r0 *XFuncDef) {
var _p *XFuncDef
_p = *(**XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[23]unsafe.Pointer)(unsafe.Pointer(&(_sqlite3BuiltinFunctions.X0))))) + 4*uintptr(_h)))
_0:
if _p == nil {
goto _3
}
if _sqlite3StrICmp(tls, _p.X6, _zFunc) == i32(0) {
return _p
}
_p = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7))))))
goto _0
_3:
return nil
}
func _sqlite3StrICmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
var _c int32
var _a, _b *uint8
_a = (*uint8)(unsafe.Pointer(_zLeft))
_b = (*uint8)(unsafe.Pointer(_zRight))
_0:
_c = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))
if _c != 0 || (int32(*_a) == i32(0)) {
goto _2
}
*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
goto _0
_2:
return _c
}
var _sqlite3InsertBuiltinFuncsØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InsertBuiltinFuncsØ00__func__Ø000[0], str(4146), 26)
}
var _sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 [3]XFuncDef
func init() {
_sqlite3AlterFunctionsØ00aAlterTableFuncsØ001 = [3]XFuncDef{XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_renameTableFunc})), X5: nil, X6: str(4172), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_renameTriggerFunc})), X5: nil, X6: str(4192), X7: t12{}}, XFuncDef{X0: i8(3), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_renameParentFunc})), X5: nil, X6: str(4214), X7: t12{}}}
}
// This function is used by SQL generated to implement the
// ALTER TABLE command. The first argument is the text of a CREATE TABLE or
// CREATE INDEX command. The second is a table name. The table name in
// the CREATE TABLE or CREATE INDEX statement is replaced with the third
// argument and the result returned. Examples:
//
// sqlite_rename_table('CREATE TABLE abc(a, b, c)', 'def')
// -> 'CREATE TABLE def(a, b, c)'
//
// sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def')
// -> 'CREATE INDEX i ON def(a, b, c)'
func _renameTableFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _token, _len int32
var _zRet *int8
var _zSql, _zTableName, _zCsr *uint8
var _tname XToken
var _db *Xsqlite3
_zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
_zCsr = _zSql
_len = i32(0)
_db = Xsqlite3_context_db_handle(tls, _context)
if _zSql == nil {
goto _0
}
_1:
if (*_zCsr) == 0 {
return
}
*(**int8)(unsafe.Pointer(&(_tname.X0))) = (*int8)(unsafe.Pointer(_zCsr))
*(*uint32)(unsafe.Pointer(&(_tname.X1))) = uint32(_len)
_3:
{
p := &_zCsr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_len)))
sink13 = *p
}
_len = _sqlite3GetToken(tls, _zCsr, &_token)
if _token == i32(163) {
goto _3
}
func() {
if _len <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96186), unsafe.Pointer((*int8)(unsafe.Pointer(&_renameTableFuncØ00__func__Ø000))), unsafe.Pointer(str(4235)))
crt.X__builtin_abort(tls)
}
}()
if (_token != i32(22)) && (_token != i32(125)) {
goto _1
}
_zRet = _sqlite3MPrintf(tls, _db, str(4241), int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_tname.X0))))-uintptr(unsafe.Pointer(_zSql)))/1), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.X0))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_tname.X1)))))))))
Xsqlite3_result_text(tls, _context, _zRet, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_0:
_ = _tname
}
func Xsqlite3_value_text(tls *crt.TLS, _pVal *XMem) (r0 *uint8) {
return (*uint8)(_sqlite3ValueText(tls, _pVal, uint8(i32(1))))
}
// This function is only available internally, it is not part of the
// external API. It works in a similar way to sqlite3_value_text(),
// except the data returned is in the encoding specified by the second
// parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or
// SQLITE_UTF8.
//
// (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
// If that is the case, then the result must be aligned on an even byte
// boundary.
func _sqlite3ValueText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
if _pVal == nil {
return nil
}
func() {
if (*Xsqlite3)(_pVal.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70759), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000))), unsafe.Pointer(str(4252)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_enc) & i32(3)) != (int32(_enc) & i32(-9)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70760), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000))), unsafe.Pointer(str(4303)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pVal.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70761), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ValueTextØ00__func__Ø000))), unsafe.Pointer(str(4340)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pVal.X1) & i32(514)) == i32(514)) && (int32(_pVal.X2) == int32(_enc)) {
return (unsafe.Pointer)(_pVal.X5)
}
if (int32(_pVal.X1) & i32(1)) != 0 {
return nil
}
return _valueToText(tls, _pVal, _enc)
}
var _sqlite3ValueTextØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ValueTextØ00__func__Ø000[0], str(4370), 17)
}
// The pVal argument is known to be a value other than NULL.
// Convert it into a string with encoding enc and return a pointer
// to a zero-terminated version of that string.
func _valueToText(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 unsafe.Pointer) {
func() {
if _pVal == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70716), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4387)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pVal.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVal.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70717), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4252)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_enc) & i32(3)) != (int32(_enc) & i32(-9)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70718), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4303)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pVal.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70719), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4340)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pVal.X1) & i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70720), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4395)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pVal.X1) & i32(18)) == 0 {
goto _11
}
if func() int32 {
if (int32(_pVal.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pVal)
}
return i32(0)
}() != 0 {
return nil
}
{
p := (*uint16)(unsafe.Pointer(&(_pVal.X1)))
*p = uint16(int32(*p) | i32(2))
sink14 = *p
}
if int32(_pVal.X2) != (int32(_enc) & i32(-9)) {
_sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc)&i32(-9))
}
if (int32(_enc)&i32(8)) == i32(0) || i32(1) != (i32(1)&int32(uintptr(unsafe.Pointer(_pVal.X5)))) {
goto _17
}
func() {
if (int32(_pVal.X1) & i32(6144)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70728), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4425)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3VdbeMemMakeWriteable(tls, _pVal) != i32(0) {
return nil
}
_17:
_sqlite3VdbeMemNulTerminate(tls, _pVal)
goto _21
_11:
_sqlite3VdbeMemStringify(tls, _pVal, _enc, uint8(i32(0)))
func() {
if i32(0) != (i32(1) & int32(uintptr(unsafe.Pointer(_pVal.X5)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70736), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4467)))
crt.X__builtin_abort(tls)
}
}()
_21:
func() {
if int32(_pVal.X2) != (int32(_enc)&i32(-9)) && (*Xsqlite3)(_pVal.X9) != nil && ((*Xsqlite3)(_pVal.X9).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70738), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueToTextØ00__func__Ø000))), unsafe.Pointer(str(4501)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pVal.X2) == (int32(_enc) & i32(-9)) {
return (unsafe.Pointer)(_pVal.X5)
}
return nil
}
var _valueToTextØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_valueToTextØ00__func__Ø000[0], str(4583), 12)
}
func _sqlite3VdbeMemExpandBlob(tls *crt.TLS, _pMem *XMem) (r0 int32) {
var _nByte int32
func() {
if (int32(_pMem.X1) & i32(16384)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69923), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000))), unsafe.Pointer(str(4595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000))), unsafe.Pointer(str(4618)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000))), unsafe.Pointer(str(4639)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemExpandBlobØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
_nByte = (_pMem.X4) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
if _nByte <= i32(0) {
_nByte = i32(1)
}
if _sqlite3VdbeMemGrow(tls, _pMem, _nByte, i32(1)) != 0 {
return _sqlite3NomemError(tls, i32(69934))
}
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5))+1*uintptr(_pMem.X4)))), i32(0), uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))))
{
p := (*int32)(unsafe.Pointer(&(_pMem.X4)))
*p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
sink1 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-16897))
sink14 = *p
}
return i32(0)
}
var _sqlite3VdbeMemExpandBlobØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemExpandBlobØ00__func__Ø000[0], str(4718), 25)
}
// Make sure pMem->z points to a writable allocation of at least
// min(n,32) bytes.
//
// If the bPreserve argument is true, then copy of the content of
// pMem->z into the new allocation. pMem must be either a string or
// blob if bPreserve is true. If bPreserve is false, any prior content
// in pMem->z is discarded.
func _sqlite3VdbeMemGrow(tls *crt.TLS, _pMem *XMem, _n int32, _bPreserve int32) (r0 int32) {
func() {
if _sqlite3VdbeCheckMemInvariants(tls, _pMem) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4743)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69823), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4639)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _bPreserve != i32(0) && (int32(_pMem.X1)&i32(18)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69828), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pMem.X7) != i32(0) && (_pMem.X7) != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69831), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4826)))
crt.X__builtin_abort(tls)
}
}()
if _n < i32(32) {
_n = i32(32)
}
if (_bPreserve != 0 && ((_pMem.X7) > i32(0))) && ((_pMem.X5) == (_pMem.X6)) {
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = store0((**int8)(unsafe.Pointer(&(_pMem.X6))), (*int8)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X5), uint64(_n))))
_bPreserve = i32(0)
goto _14
}
if (_pMem.X7) > i32(0) {
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6))
}
*(**int8)(unsafe.Pointer(&(_pMem.X6))) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.X9), uint64(_n)))
_14:
if (_pMem.X6) == nil {
_sqlite3VdbeMemSetNull(tls, _pMem)
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0)
return _sqlite3NomemError(tls, i32(69845))
}
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6))
if (_bPreserve != 0 && ((_pMem.X5) != nil)) && func() int32 {
if (_pMem.X5) != (_pMem.X6) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69850), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem.X6), (unsafe.Pointer)(_pMem.X5), uint32(_pMem.X4))
}
if (int32(_pMem.X1) & i32(1024)) != i32(0) {
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pMem.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil})) || *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pMem.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemGrowØ00__func__Ø000))), unsafe.Pointer(str(4910)))
crt.X__builtin_abort(tls)
}
}()
(_pMem.X10)(tls, (unsafe.Pointer)(_pMem.X5))
}
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = _pMem.X6
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-7169))
sink14 = *p
}
return i32(0)
}
// Check invariants on a Mem object.
//
// This routine is intended for use inside of assert() statements, like
// this: assert( sqlite3VdbeCheckMemInvariants(pMem) );
func _sqlite3VdbeCheckMemInvariants(tls *crt.TLS, _p *XMem) (r0 int32) {
func() {
if (int32(_p.X1)&i32(1024)) != i32(0) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69733), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(4954)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_p.X1)&i32(1024)) != i32(0) && (_p.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(4992)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_p.X1) & i32(12)) == i32(12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69742), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(5034)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_p.X1)&i32(1)) != i32(0) && (int32(_p.X1)&i32(30)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69745), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(5086)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X7) != i32(0) && (_p.X7) != _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X9), (unsafe.Pointer)(_p.X6)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(5166)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X1)&i32(18)) != 0 && ((_p.X4) > i32(0)) {
func() {
if (((func() int32 {
if ((_p.X7) > i32(0)) && ((_p.X5) == (_p.X6)) {
return i32(1)
}
return i32(0)
}() + func() int32 {
if (int32(_p.X1) & i32(1024)) != i32(0) {
return i32(1)
}
return i32(0)
}()) + func() int32 {
if (int32(_p.X1) & i32(4096)) != i32(0) {
return i32(1)
}
return i32(0)
}()) + func() int32 {
if (int32(_p.X1) & i32(2048)) != i32(0) {
return i32(1)
}
return i32(0)
}()) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69761), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000))), unsafe.Pointer(str(5235)))
crt.X__builtin_abort(tls)
}
}()
}
return i32(1)
}
var _sqlite3VdbeCheckMemInvariantsØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeCheckMemInvariantsØ00__func__Ø000[0], str(5392), 30)
}
var _sqlite3VdbeMemGrowØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemGrowØ00__func__Ø000[0], str(5422), 19)
}
// Attempt to reallocate p. If the reallocation fails, then free p
// and set the mallocFailed flag in the database connection.
func _sqlite3DbReallocOrFree(tls *crt.TLS, _db *Xsqlite3, _p unsafe.Pointer, _n uint64) (r0 unsafe.Pointer) {
var _pNew unsafe.Pointer
_pNew = _sqlite3DbRealloc(tls, _db, _p, _n)
if _pNew == nil {
_sqlite3DbFree(tls, _db, _p)
}
return _pNew
}
// 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 _sqlite3DbMallocRaw(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
if _db != nil {
return _sqlite3DbMallocRawNN(tls, _db, _n)
}
_p = _sqlite3Malloc(tls, _n)
return _p
}
// Delete any previous value and set the value stored in *pMem to NULL.
//
// This routine calls the Mem.xDel destructor to dispose of values that
// require the destructor. But it preserves the Mem.zMalloc memory allocation.
// To free all resources, use sqlite3VdbeMemRelease(), which both calls this
// routine to invoke the destructor and deallocates Mem.zMalloc.
//
// Use this routine to reset the Mem prior to insert a new value.
//
// Use sqlite3VdbeMemRelease() to complete erase the Mem prior to abandoning it.
func _sqlite3VdbeMemSetNull(tls *crt.TLS, _pMem *XMem) {
if (int32(_pMem.X1) & i32(9312)) != i32(0) {
_vdbeMemClearExternAndSetNull(tls, _pMem)
goto _1
}
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1))
_1:
}
// If the memory cell contains a value that must be freed by
// invoking the external callback in Mem.xDel, then this routine
// will free that value. It also sets Mem.flags to MEM_Null.
//
// This is a helper routine for sqlite3VdbeMemSetNull() and
// for sqlite3VdbeMemRelease(). Use those other routines as the
// entry point for releasing Mem resources.
func _vdbeMemClearExternAndSetNull(tls *crt.TLS, _p *XMem) {
var _4_pFrame *XVdbeFrame
func() {
if (*Xsqlite3)(_p.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70064), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5441)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_p.X1) & i32(9312)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70065), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5486)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X1) & i32(8192)) != 0 {
_sqlite3VdbeMemFinalize(tls, _p, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))))
func() {
if (int32(_p.X1) & i32(8192)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70068), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5504)))
crt.X__builtin_abort(tls)
}
}()
}
if (int32(_p.X1) & i32(1024)) != 0 {
func() {
if (int32(_p.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70072), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5528)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) || *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_p.X10)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70073), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMemClearExternAndSetNullØ00__func__Ø000))), unsafe.Pointer(str(5553)))
crt.X__builtin_abort(tls)
}
}()
(_p.X10)(tls, (unsafe.Pointer)(_p.X5))
goto _17
}
if (int32(_p.X1) & i32(32)) != 0 {
_sqlite3RowSetClear(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0)))))))
goto _17
}
if (int32(_p.X1) & i32(64)) != 0 {
_4_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pFrame.X1))))) = (*XVdbeFrame)((*TVdbe)(_4_pFrame.X0).X39)
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_4_pFrame.X0).X39))))) = _4_pFrame
}
_17:
*(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(1))
}
var _vdbeMemClearExternAndSetNullØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_vdbeMemClearExternAndSetNullØ00__func__Ø000[0], str(5591), 29)
}
// Memory cell pMem contains the context of an aggregate function.
// This routine calls the finalize method for that function. The
// result of the aggregate is stored back into pMem.
//
// Return SQLITE_ERROR if the finalizer reports an error. SQLITE_OK
// otherwise.
func _sqlite3VdbeMemFinalize(tls *crt.TLS, _pMem *XMem, _pFunc *XFuncDef) (r0 int32) {
var _rc int32
var _1_ctx Xsqlite3_context
var _1_t XMem
_rc = i32(0)
if func() int32 {
if (_pFunc != nil) && ((*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pFunc.X5)}))) != nil) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70033), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _3
}
func() {
if (int32(_pMem.X1)&i32(1)) == i32(0) && _pFunc != (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70036), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(5620)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70037), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_1_ctx), i32(0), u32(32))
crt.Xmemset(tls, (unsafe.Pointer)(&_1_t), i32(0), u32(48))
*(*uint16)(unsafe.Pointer(&(_1_t.X1))) = uint16(i32(1))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_t.X9))))) = (*Xsqlite3)(_pMem.X9)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X0))))) = &_1_t
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X2))))) = _pMem
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_ctx.X1))))) = _pFunc
(*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pFunc.X5)})))(tls, &_1_ctx)
func() {
if (int32(_pMem.X1) & i32(1024)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFinalizeØ00__func__Ø000))), unsafe.Pointer(str(5671)))
crt.X__builtin_abort(tls)
}
}()
if (_pMem.X7) > i32(0) {
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem), (unsafe.Pointer)(&_1_t), u32(48))
_rc = _1_ctx.X5
_3:
return _rc
_ = _1_ctx
_ = _1_t
panic(0)
}
var _sqlite3VdbeMemFinalizeØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemFinalizeØ00__func__Ø000[0], str(5698), 23)
}
// Deallocate all chunks from a RowSet. This frees all memory that
// the RowSet has allocated over its lifetime. This routine is
// the destructor for the RowSet.
func _sqlite3RowSetClear(tls *crt.TLS, _p *XRowSet) {
var _pChunk, _pNextChunk *TRowSetChunk
_pChunk = (*TRowSetChunk)(_p.X0)
_0:
if _pChunk == nil {
goto _3
}
_pNextChunk = (*TRowSetChunk)(_pChunk.X0)
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X1), (unsafe.Pointer)(_pChunk))
_pChunk = _pNextChunk
goto _0
_3:
*(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil
*(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(i32(0))
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil
*(*uint16)(unsafe.Pointer(&(_p.X7))) = uint16(i32(1))
}
// If pMem is an object with a valid string representation, this routine
// ensures the internal encoding for the string representation is
// 'desiredEnc', one of SQLITE_UTF8, SQLITE_UTF16LE or SQLITE_UTF16BE.
//
// If pMem is not a string object, or the encoding of the string
// representation is already stored using the requested encoding, then this
// routine is a no-op.
//
// SQLITE_OK is returned if the conversion is successful (or not required).
// SQLITE_NOMEM may be returned if a malloc() fails during conversion
// between formats.
func _sqlite3VdbeChangeEncoding(tls *crt.TLS, _pMem *XMem, _desiredEnc int32) (r0 int32) {
var _rc int32
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69790), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(4639)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _desiredEnc != i32(1) && _desiredEnc != i32(2) && _desiredEnc != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69791), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(5721)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pMem.X1) & i32(2)) == 0) || (int32(_pMem.X2) == _desiredEnc) {
return i32(0)
}
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeMemTranslate(tls, _pMem, uint8(_desiredEnc))
func() {
if _rc != i32(0) && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69805), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(0) && int32(_pMem.X2) == _desiredEnc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(5839)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(7) && int32(_pMem.X2) != _desiredEnc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69807), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeEncodingØ00__func__Ø000))), unsafe.Pointer(str(5878)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3VdbeChangeEncodingØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeChangeEncodingØ00__func__Ø000[0], str(5920), 26)
}
// This routine transforms the internal text encoding used by pMem to
// desiredEnc. It is an error if the string is already of the desired
// encoding, or if *pMem does not contain a string value.
func _sqlite3VdbeMemTranslate(tls *crt.TLS, _pMem *XMem, _desiredEnc uint8) (r0 int32) {
var _len, _1_rc, _28_c2, _37_c2 int32
var _c uint32
var _1_temp uint8
var _zOut, _zIn, _zTerm, _z *uint8
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27333), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27334), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(5946)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pMem.X2) == int32(_desiredEnc) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27335), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(5966)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pMem.X2) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27336), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(5988)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pMem.X4) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6001)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pMem.X2) == i32(1) || int32(_desiredEnc) == i32(1) {
goto _12
}
_1_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
if _1_rc != i32(0) {
func() {
if _1_rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27356), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6012)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3NomemError(tls, i32(27357))
}
_zIn = (*uint8)(unsafe.Pointer(_pMem.X5))
_zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr((_pMem.X4)&i32(-2))))
_16:
if uintptr(unsafe.Pointer(_zIn)) < uintptr(unsafe.Pointer(_zTerm)) {
_1_temp = *_zIn
*_zIn = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zIn)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(1))))))))
*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
*postInc13(&_zIn, 1) = _1_temp
goto _16
}
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _desiredEnc
goto _translate_out
_12:
if int32(_desiredEnc) == i32(1) {
{
p := (*int32)(unsafe.Pointer(&(_pMem.X4)))
*p = (*p) & i32(-2)
sink1 = *p
}
_len = ((_pMem.X4) * i32(2)) + i32(1)
goto _19
}
_len = ((_pMem.X4) * i32(2)) + i32(2)
_19:
_zIn = (*uint8)(unsafe.Pointer(_pMem.X5))
_zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_pMem.X4)))
_zOut = (*uint8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pMem.X9), uint64(_len)))
if _zOut == nil {
return _sqlite3NomemError(tls, i32(27399))
}
_z = _zOut
if int32(_pMem.X2) != i32(1) {
goto _21
}
if int32(_desiredEnc) != i32(2) {
goto _22
}
_23:
if uintptr(unsafe.Pointer(_zIn)) >= uintptr(unsafe.Pointer(_zTerm)) {
goto _24
}
_c = uint32(*postInc13(&_zIn, 1))
if _c < uint32(i32(192)) {
goto _25
}
_c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192))))))
_26:
if (_zIn != _zTerm) && ((int32(*_zIn) & i32(192)) == i32(128)) {
_c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(&_zIn, 1)))
goto _26
}
if ((_c < uint32(i32(128))) || ((_c & u32(4294965248)) == uint32(i32(55296)))) || ((_c & u32(4294967294)) == uint32(i32(65534))) {
_c = uint32(i32(65533))
}
_25:
if _c <= uint32(i32(65535)) {
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
*postInc13(&_z, 1) = uint8((_c >> uint(i32(8))) & uint32(i32(255)))
goto _33
}
*postInc13(&_z, 1) = uint8(((_c >> uint(i32(10))) & uint32(i32(63))) + (((_c - uint32(i32(65536))) >> uint(i32(10))) & uint32(i32(192))))
*postInc13(&_z, 1) = uint8(uint32(i32(216)) + (((_c - uint32(i32(65536))) >> uint(i32(18))) & uint32(i32(3))))
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
*postInc13(&_z, 1) = uint8(uint32(i32(220)) + ((_c >> uint(i32(8))) & uint32(i32(3))))
_33:
goto _23
_24:
goto _34
_22:
func() {
if int32(_desiredEnc) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27411), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6029)))
crt.X__builtin_abort(tls)
}
}()
_37:
if uintptr(unsafe.Pointer(_zIn)) >= uintptr(unsafe.Pointer(_zTerm)) {
goto _38
}
_c = uint32(*postInc13(&_zIn, 1))
if _c < uint32(i32(192)) {
goto _39
}
_c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192))))))
_40:
if (_zIn != _zTerm) && ((int32(*_zIn) & i32(192)) == i32(128)) {
_c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(&_zIn, 1)))
goto _40
}
if ((_c < uint32(i32(128))) || ((_c & u32(4294965248)) == uint32(i32(55296)))) || ((_c & u32(4294967294)) == uint32(i32(65534))) {
_c = uint32(i32(65533))
}
_39:
if _c <= uint32(i32(65535)) {
*postInc13(&_z, 1) = uint8((_c >> uint(i32(8))) & uint32(i32(255)))
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
goto _47
}
*postInc13(&_z, 1) = uint8(uint32(i32(216)) + (((_c - uint32(i32(65536))) >> uint(i32(18))) & uint32(i32(3))))
*postInc13(&_z, 1) = uint8(((_c >> uint(i32(10))) & uint32(i32(63))) + (((_c - uint32(i32(65536))) >> uint(i32(10))) & uint32(i32(192))))
*postInc13(&_z, 1) = uint8(uint32(i32(220)) + ((_c >> uint(i32(8))) & uint32(i32(3))))
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
_47:
goto _37
_38:
_34:
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)
*postInc13(&_z, 1) = uint8(i32(0))
goto _48
_21:
func() {
if int32(_desiredEnc) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27421), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6056)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pMem.X2) != i32(2) {
goto _51
}
_52:
if uintptr(unsafe.Pointer(_zIn)) >= uintptr(unsafe.Pointer(_zTerm)) {
goto _53
}
_c = uint32(*postInc13(&_zIn, 1))
{
p := &_c
*p = (*p) + uint32(int32(*postInc13(&_zIn, 1))<= uint32(i32(55296))) && (_c < uint32(i32(57344)))) && (uintptr(unsafe.Pointer(_zIn)) < uintptr(unsafe.Pointer(_zTerm))) {
_28_c2 = int32(*postInc13(&_zIn, 1))
{
p := &_28_c2
*p = (*p) + (int32(*postInc13(&_zIn, 1)) << uint(i32(8)))
sink1 = *p
}
_c = (uint32(_28_c2&i32(1023)) + ((_c & uint32(i32(63))) << uint(i32(10)))) + (((_c & uint32(i32(960))) + uint32(i32(64))) << uint(i32(10)))
}
if _c < uint32(i32(128)) {
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
goto _62
}
if _c < uint32(i32(2048)) {
*postInc13(&_z, 1) = uint8(i32(192) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(31)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
goto _62
}
if _c < uint32(i32(65536)) {
*postInc13(&_z, 1) = uint8(i32(224) + int32(uint8((_c>>uint(i32(12)))&uint32(i32(15)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
goto _62
}
*postInc13(&_z, 1) = uint8(i32(240) + int32(uint8((_c>>uint(i32(18)))&uint32(i32(7)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(12)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
_62:
goto _52
_53:
goto _63
_51:
_64:
if uintptr(unsafe.Pointer(_zIn)) >= uintptr(unsafe.Pointer(_zTerm)) {
goto _65
}
_c = uint32(int32(*postInc13(&_zIn, 1)) << uint(i32(8)))
{
p := &_c
*p = (*p) + uint32(*postInc13(&_zIn, 1))
sink5 = *p
}
if ((_c >= uint32(i32(55296))) && (_c < uint32(i32(57344)))) && (uintptr(unsafe.Pointer(_zIn)) < uintptr(unsafe.Pointer(_zTerm))) {
_37_c2 = int32(*postInc13(&_zIn, 1)) << uint(i32(8))
{
p := &_37_c2
*p = (*p) + int32(*postInc13(&_zIn, 1))
sink1 = *p
}
_c = (uint32(_37_c2&i32(1023)) + ((_c & uint32(i32(63))) << uint(i32(10)))) + (((_c & uint32(i32(960))) + uint32(i32(64))) << uint(i32(10)))
}
if _c < uint32(i32(128)) {
*postInc13(&_z, 1) = uint8(_c & uint32(i32(255)))
goto _74
}
if _c < uint32(i32(2048)) {
*postInc13(&_z, 1) = uint8(i32(192) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(31)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
goto _74
}
if _c < uint32(i32(65536)) {
*postInc13(&_z, 1) = uint8(i32(224) + int32(uint8((_c>>uint(i32(12)))&uint32(i32(15)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
goto _74
}
*postInc13(&_z, 1) = uint8(i32(240) + int32(uint8((_c>>uint(i32(18)))&uint32(i32(7)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(12)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8((_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_z, 1) = uint8(i32(128) + int32(uint8(_c&uint32(i32(63)))))
_74:
goto _64
_65:
_63:
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer(_zOut))) / 1)
_48:
*_z = uint8(i32(0))
func() {
if ((_pMem.X4) + func() int32 {
if int32(_desiredEnc) == i32(1) {
return i32(1)
}
return i32(2)
}()) > _len {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTranslateØ00__func__Ø000))), unsafe.Pointer(str(6080)))
crt.X__builtin_abort(tls)
}
}()
_c = uint32(_pMem.X1)
_sqlite3VdbeMemRelease(tls, _pMem)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(uint32(i32(514)) | (_c & uint32(i32(32799))))
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _desiredEnc
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = (*int8)(unsafe.Pointer(_zOut))
*(**int8)(unsafe.Pointer(&(_pMem.X6))) = _pMem.X5
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X5))
_translate_out:
return i32(0)
}
var _sqlite3VdbeMemTranslateØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemTranslateØ00__func__Ø000[0], str(6125), 24)
}
// Change pMem so that its MEM_Str or MEM_Blob value is stored in
// MEM.zMalloc, where it can be safely written.
//
// Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails.
func _sqlite3VdbeMemMakeWriteable(tls *crt.TLS, _pMem *XMem) (r0 int32) {
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69895), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemMakeWriteableØ00__func__Ø000))), unsafe.Pointer(str(4639)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pMem.X1) & i32(18)) == i32(0) {
goto _5
}
if func() int32 {
if (int32(_pMem.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pMem)
}
return i32(0)
}() != 0 {
return i32(7)
}
if (_pMem.X7) != i32(0) && (_pMem.X5) == (_pMem.X6) {
goto _10
}
if _sqlite3VdbeMemGrow(tls, _pMem, (_pMem.X4)+i32(2), i32(1)) != 0 {
return _sqlite3NomemError(tls, i32(69901))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0))
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
_10:
_5:
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-4097))
sink14 = *p
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X11))))) = nil
return i32(0)
}
var _sqlite3VdbeMemMakeWriteableØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemMakeWriteableØ00__func__Ø000[0], str(6149), 28)
}
var _sqlite3Utf8Trans1 [64]uint8
func init() {
_sqlite3Utf8Trans1 = [64]uint8{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 0, 1, 0, 0}
}
// Release any memory resources held by the Mem. Both the memory that is
// free by Mem.xDel and the Mem.zMalloc allocation are freed.
//
// Use this routine prior to clean up prior to abandoning a Mem, or to
// reset a Mem back to its minimum memory utilization.
//
// Use sqlite3VdbeMemSetNull() to release just the Mem.xDel space
// prior to inserting new content into the Mem.
func _sqlite3VdbeMemRelease(tls *crt.TLS, _p *XMem) {
func() {
if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70115), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemReleaseØ00__func__Ø000))), unsafe.Pointer(str(6177)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_p.X1) & i32(9312)) != i32(0)) || (_p.X7) != 0 {
_vdbeMemClear(tls, _p)
}
}
var _sqlite3VdbeMemReleaseØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemReleaseØ00__func__Ø000[0], str(6210), 22)
}
// Release memory held by the Mem p, both external memory cleared
// by p->xDel and memory in p->zMalloc.
//
// This is a helper routine invoked by sqlite3VdbeMemRelease() in
// the unusual case where there really is memory in p that needs
// to be freed.
func _vdbeMemClear(tls *crt.TLS, _p *XMem) {
if (int32(_p.X1) & i32(9312)) != i32(0) {
_vdbeMemClearExternAndSetNull(tls, _p)
}
if (_p.X7) != 0 {
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X9), (unsafe.Pointer)(_p.X6))
*(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0)
}
*(**int8)(unsafe.Pointer(&(_p.X5))) = nil
}
// Make sure the given Mem is \u0000 terminated.
func _sqlite3VdbeMemNulTerminate(tls *crt.TLS, _pMem *XMem) (r0 int32) {
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69962), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemNulTerminateØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pMem.X1) & i32(514)) != i32(2) {
return i32(0)
}
return _vdbeMemAddTerminator(tls, _pMem)
}
var _sqlite3VdbeMemNulTerminateØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemNulTerminateØ00__func__Ø000[0], str(6232), 27)
}
// It is already known that pMem contains an unterminated string.
// Add the zero terminator.
func _vdbeMemAddTerminator(tls *crt.TLS, _pMem *XMem) (r0 int32) {
if _sqlite3VdbeMemGrow(tls, _pMem, (_pMem.X4)+i32(2), i32(1)) != 0 {
return _sqlite3NomemError(tls, i32(69950))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0))
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
return i32(0)
}
// Add MEM_Str to the set of representations for the given Mem. Numbers
// are converted using sqlite3_snprintf(). Converting a BLOB to a string
// is a no-op.
//
// Existing representations MEM_Int and MEM_Real are invalidated if
// bForce is true but are retained if bForce is false.
//
// A MEM_Null value will never be passed to this function. This function is
// used for converting values to text for returning to the user (i.e. via
// sqlite3_value_text()), or for ensuring that values to be used as btree
// keys are strings. In the former case a NULL pointer is returned the
// user and the latter is an internal programming error.
func _sqlite3VdbeMemStringify(tls *crt.TLS, _pMem *XMem, _enc uint8, _bForce uint8) (r0 int32) {
var _fg, _nByte int32
_fg = int32(_pMem.X1)
_nByte = i32(32)
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69990), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_fg & i32(16384)) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69991), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(6259)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_fg & i32(18)) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69992), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(6274)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_fg & i32(12)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69993), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(6299)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(4639)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) != 0 {
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(0))
return _sqlite3NomemError(tls, i32(70000))
}
if (_fg & i32(4)) != 0 {
Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
goto _15
}
func() {
if (_fg & i32(8)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemStringifyØ00__func__Ø000))), unsafe.Pointer(str(6353)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_snprintf(tls, _nByte, _pMem.X5, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
_15:
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5)
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) | i32(514))
sink14 = *p
}
if _bForce != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-13))
sink14 = *p
}
}
_sqlite3VdbeChangeEncoding(tls, _pMem, int32(_enc))
return i32(0)
}
var _sqlite3VdbeMemStringifyØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemStringifyØ00__func__Ø000[0], str(6374), 24)
}
// Change the pMem->zMalloc allocation to be at least szNew bytes.
// If pMem->zMalloc already meets or exceeds the requested size, this
// routine is a no-op.
//
// Any prior string or blob content in the pMem object may be discarded.
// The pMem->xDel destructor is called, if it exists. Though MEM_Str
// and MEM_Blob values may be discarded, MEM_Int, MEM_Real, and MEM_Null
// values are preserved.
//
// Return SQLITE_OK on success or an error code (probably SQLITE_NOMEM)
// if unable to complete the resizing.
func _sqlite3VdbeMemClearAndResize(tls *crt.TLS, _pMem *XMem, _szNew int32) (r0 int32) {
func() {
if _szNew <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000))), unsafe.Pointer(str(6398)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1)&i32(1024)) != i32(0) && (_pMem.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69878), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000))), unsafe.Pointer(str(6406)))
crt.X__builtin_abort(tls)
}
}()
if (_pMem.X7) < _szNew {
return _sqlite3VdbeMemGrow(tls, _pMem, _szNew, i32(0))
}
func() {
if (int32(_pMem.X1) & i32(1024)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69882), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemClearAndResizeØ00__func__Ø000))), unsafe.Pointer(str(5671)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = _pMem.X6
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(13))
sink14 = *p
}
return i32(0)
}
var _sqlite3VdbeMemClearAndResizeØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemClearAndResizeØ00__func__Ø000[0], str(6454), 29)
}
func Xsqlite3_snprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, args ...interface{}) (r0 *int8) {
var _z *int8
var _ap []interface{}
_ap = args
_z = Xsqlite3_vsnprintf(tls, _n, _zBuf, _zFormat, _ap)
_ap = nil
return _z
}
// sqlite3_snprintf() works like snprintf() except that it ignores the
// current locale settings. This is important for SQLite because we
// are not able to use a "," as the decimal point in place of "." as
// specified by some locales.
//
// Oops: The first two arguments of sqlite3_snprintf() are backwards
// from the snprintf() standard. Unfortunately, it is too late to change
// this without breaking compatibility, so we just have to live with the
// mistake.
//
// sqlite3_vsnprintf() is the varargs version.
func Xsqlite3_vsnprintf(tls *crt.TLS, _n int32, _zBuf *int8, _zFormat *int8, _ap []interface{}) (r0 *int8) {
var _acc XStrAccum
if _n <= i32(0) {
return _zBuf
}
if _zBuf != nil && _zFormat != nil {
goto _2
}
_sqlite3MisuseError(tls, i32(26087))
if _zBuf != nil {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0))
}
return _zBuf
_2:
_sqlite3StrAccumInit(tls, &_acc, nil, _zBuf, _n, i32(0))
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_acc.X3))) = int8(i32(0))
return _zBuf
_ = _acc
panic(0)
}
// Extract the user data from a sqlite3_context structure and return a
// pointer to it.
//
// IMPLEMENTATION-OF: R-46798-50301 The sqlite3_context_db_handle() interface
// returns a copy of the pointer to the database connection (the 1st
// parameter) of the sqlite3_create_function() and
// sqlite3_create_function16() routines that originally registered the
// application defined function.
func Xsqlite3_context_db_handle(tls *crt.TLS, _p *Xsqlite3_context) (r0 *Xsqlite3) {
func() {
if _p == nil || (*XMem)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_context_db_handleØ00__func__Ø000))), unsafe.Pointer(str(6483)))
crt.X__builtin_abort(tls)
}
}()
return (*Xsqlite3)((*XMem)(_p.X0).X9)
}
var _sqlite3_context_db_handleØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_context_db_handleØ00__func__Ø000[0], str(6496), 26)
}
// Return the length (in bytes) of the token that begins at z[0].
// Store the token type in *tokenType before returning.
func _sqlite3GetToken(tls *crt.TLS, _z *uint8, _tokenType *int32) (r0 int32) {
var _i, _c, _35_delim, _58_n int32
switch int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiClass)) + 1*uintptr(*_z)))) {
case i32(0):
goto _26
case i32(1):
goto _25
case i32(2):
goto _27
case i32(3):
goto _20
case i32(4):
goto _23
case i32(5):
goto _23
case i32(6):
goto _22
case i32(7):
goto _1
case i32(8):
goto _18
case i32(9):
goto _21
case i32(10):
goto _14
case i32(11):
goto _2
case i32(12):
goto _11
case i32(13):
goto _12
case i32(14):
goto _10
case i32(15):
goto _13
case i32(16):
goto _8
case i32(17):
goto _3
case i32(18):
goto _4
case i32(19):
goto _5
case i32(20):
goto _6
case i32(21):
goto _7
case i32(22):
goto _9
case i32(23):
goto _15
case i32(24):
goto _16
case i32(25):
goto _17
case i32(26):
goto _19
default:
goto _28
}
_1:
_i = i32(1)
_29:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(1)) == 0 {
goto _32
}
_i += 1
goto _29
_32:
*_tokenType = i32(163)
return _i
_2:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(45) {
goto _33
}
_i = i32(2)
_34:
if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) || _c == i32(10) {
goto _38
}
_i += 1
goto _34
_38:
*_tokenType = i32(163)
return _i
_33:
*_tokenType = i32(89)
return i32(1)
_3:
*_tokenType = i32(22)
return i32(1)
_4:
*_tokenType = i32(23)
return i32(1)
_5:
*_tokenType = i32(1)
return i32(1)
_6:
*_tokenType = i32(88)
return i32(1)
_7:
*_tokenType = i32(90)
return i32(1)
_8:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(42)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2))))) == i32(0)) {
*_tokenType = i32(91)
return i32(1)
}
*func() *int32 { _i = i32(3); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2)))))
_41:
if _c == i32(42) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(47) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) {
goto _46
}
_i += 1
goto _41
_46:
if _c != 0 {
_i += 1
}
*_tokenType = i32(163)
return _i
_9:
*_tokenType = i32(92)
return i32(1)
_10:
*_tokenType = i32(78)
return i32(1) + bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) == i32(61))
_11:
if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))) == i32(61) {
*_tokenType = i32(80)
return i32(2)
}
if _c == i32(62) {
*_tokenType = i32(77)
return i32(2)
}
if _c == i32(60) {
*_tokenType = i32(86)
return i32(2)
}
*_tokenType = i32(81)
return i32(1)
_12:
if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))) == i32(61) {
*_tokenType = i32(82)
return i32(2)
}
if _c == i32(62) {
*_tokenType = i32(87)
return i32(2)
}
*_tokenType = i32(79)
return i32(1)
_13:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(61) {
*_tokenType = i32(164)
return i32(1)
}
*_tokenType = i32(77)
return i32(2)
_14:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(124) {
*_tokenType = i32(85)
return i32(1)
}
*_tokenType = i32(93)
return i32(2)
_15:
*_tokenType = i32(26)
return i32(1)
_16:
*_tokenType = i32(84)
return i32(1)
_17:
*_tokenType = i32(95)
return i32(1)
_18:
_35_delim = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))
_i = i32(1)
_62:
if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) {
goto _65
}
if _c != _35_delim {
goto _66
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == _35_delim {
_i += 1
goto _68
}
goto _65
_68:
_66:
_i += 1
goto _62
_65:
if _c == i32(39) {
*_tokenType = i32(97)
return _i + i32(1)
}
if _c != i32(0) {
*_tokenType = i32(27)
return _i + i32(1)
}
*_tokenType = i32(164)
return _i
_19:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1)))))))) & i32(4)) == 0 {
*_tokenType = i32(122)
return i32(1)
}
_20:
*_tokenType = i32(134)
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(2))))))))&i32(8)) == 0 {
goto _77
}
_i = i32(3)
_78:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 {
goto _81
}
_i += 1
goto _78
_81:
return _i
_77:
_i = i32(0)
_82:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 {
goto _85
}
_i += 1
goto _82
_85:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(46) {
goto _86
}
_i += 1
_87:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 {
_i += 1
goto _87
}
*_tokenType = i32(132)
_86:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(101) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(69) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))))))&i32(4)) == 0 && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) != i32(43) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) != i32(45) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(2))))))))&i32(4)) == 0) {
goto _94
}
{
p := &_i
*p = (*p) + i32(2)
sink1 = *p
}
_95:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) != 0 {
_i += 1
goto _95
}
*_tokenType = i32(132)
_94:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) {
*_tokenType = i32(164)
_i += 1
goto _94
}
return _i
_21:
*func() *int32 { _i = i32(1); return &_c }() = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))
_99:
if _c == i32(93) || store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) {
goto _103
}
_i += 1
goto _99
_103:
*_tokenType = func() int32 {
if _c == i32(93) {
return i32(27)
}
return i32(164)
}()
return _i
_22:
*_tokenType = i32(135)
_i = i32(1)
_106:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(4)) == 0 {
goto _109
}
_i += 1
goto _106
_109:
return _i
_23:
_58_n = i32(0)
*_tokenType = i32(135)
_i = i32(1)
_110:
if store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) == i32(0) {
goto _113
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(70)) != i32(0) {
_58_n += 1
goto _126
}
if _c != i32(40) || _58_n <= i32(0) {
goto _117
}
_118:
_i += 1
if ((store1(&_c, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))) != i32(0)) && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(1)) == 0)) && (_c != i32(41)) {
goto _118
}
if _c == i32(41) {
_i += 1
goto _122
}
*_tokenType = i32(164)
_122:
goto _113
_117:
if (_c == i32(58)) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == i32(58)) {
_i += 1
goto _126
}
goto _113
_126:
_i += 1
goto _110
_113:
if _58_n == i32(0) {
*_tokenType = i32(164)
}
return _i
_25:
_i = i32(1)
_128:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiClass)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) > i32(1) {
goto _131
}
_i += 1
goto _128
_131:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) {
_i += 1
goto _133
}
*_tokenType = i32(27)
return _keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _i, _tokenType)
_26:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(39) {
goto _134
}
*_tokenType = i32(133)
_i = i32(2)
_135:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(8)) == 0 {
goto _138
}
_i += 1
goto _135
_138:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == i32(39) && (_i%i32(2)) == 0 {
goto _140
}
*_tokenType = i32(164)
_141:
if ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != i32(39)) {
_i += 1
goto _141
}
_140:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0 {
_i += 1
}
return _i
_134:
_27:
_i = i32(1)
goto _133
_28:
*_tokenType = i32(164)
return i32(1)
_133:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))))))) & i32(70)) != i32(0) {
_i += 1
goto _133
}
*_tokenType = i32(27)
return _i
}
var _aiClass [256]uint8
func init() {
_aiClass = [256]uint8{27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 7, 27, 7, 7, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 7, 15, 8, 5, 4, 22, 24, 8, 17, 18, 21, 20, 23, 11, 26, 16, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 19, 12, 14, 13, 6, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 9, 27, 27, 27, 1, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 27, 10, 27, 25, 27, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}
}
var _sqlite3CtypeMap [256]uint8
func init() {
_sqlite3CtypeMap = [256]uint8{0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 128, 0, 64, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 128, 0, 0, 0, 64, 128, 42, 42, 42, 42, 42, 42, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 0, 0, 0, 0, 0, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}
}
// The sqlite3KeywordCode function looks up an identifier to determine if
// it is a keyword. If it is a keyword, the token code of that keyword is
// returned. If the input is not a keyword, TK_ID is returned.
//
// The implementation of this routine was generated by a program,
// mkkeywordhash.c, located in the tool subdirectory of the distribution.
// The output of the mkkeywordhash.c program is written into a file
// named keywordhash.h and then included into this source file by
// the #include below.
// ************* Include keywordhash.h in the middle of tokenize.c ***********
// ************* Begin file keywordhash.h ************************************
// **** This file contains automatically generated code ******
//
// The code in this file has been automatically generated by
//
// sqlite/tool/mkkeywordhash.c
//
// The code in this file implements a function that determines whether
// or not a given identifier is really an SQL keyword. The same thing
// might be implemented more directly using a hand-written hash table.
// But by using this automatically generated code, the size of the code
// is substantially reduced. This is important for embedded applications
// on platforms with limited memory.
// Hash score: 182
func _keywordCode(tls *crt.TLS, _z *int8, _n int32, _pType *int32) (r0 int32) {
var _i, _j int32
var _zKW *int8
if _n < i32(2) {
goto _0
}
_i = (((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))))))) * i32(4)) ^ (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) * i32(3))) ^ _n) % i32(127)
_i = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aHashØ002)) + 1*uintptr(_i)))) - i32(1)
_1:
if _i < i32(0) {
goto _4
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aLenØ004)) + 1*uintptr(_i)))) != _n {
goto _2
}
_j = i32(0)
_zKW = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00zTextØ001)) + 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aOffsetØ005)) + 2*uintptr(_i))))))
_6:
if (_j < _n) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j)))) & i32(-33)) == int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zKW)) + 1*uintptr(_j))))) {
_j += 1
goto _6
}
if _j < _n {
goto _2
}
*_pType = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aCodeØ006)) + 1*uintptr(_i))))
goto _4
_2:
_i = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_keywordCodeØ00aNextØ003)) + 1*uintptr(_i)))) - i32(1)
goto _1
_4:
_0:
return _n
}
var _keywordCodeØ00aHashØ002 [127]uint8
func init() {
_keywordCodeØ00aHashØ002 = [127]uint8{76, 105, 117, 74, 0, 45, 0, 0, 82, 0, 77, 0, 0, 42, 12, 78, 15, 0, 116, 85, 54, 112, 0, 19, 0, 0, 121, 0, 119, 115, 0, 22, 93, 0, 9, 0, 0, 70, 71, 0, 69, 6, 0, 48, 90, 102, 0, 118, 101, 0, 0, 44, 0, 103, 24, 0, 17, 0, 122, 53, 23, 0, 5, 110, 25, 96, 0, 0, 124, 106, 60, 123, 57, 28, 55, 0, 91, 0, 100, 26, 0, 99, 0, 0, 0, 95, 92, 97, 88, 109, 14, 39, 108, 0, 81, 0, 18, 89, 111, 32, 0, 120, 80, 113, 62, 46, 84, 0, 0, 94, 40, 59, 114, 0, 36, 0, 0, 29, 0, 86, 63, 64, 0, 20, 61, 0, 56}
}
var _keywordCodeØ00aLenØ004 [124]uint8
func init() {
_keywordCodeØ00aLenØ004 = [124]uint8{7, 7, 5, 4, 6, 4, 5, 3, 6, 7, 3, 6, 6, 7, 7, 3, 8, 2, 6, 5, 4, 4, 3, 10, 4, 6, 11, 6, 2, 7, 5, 5, 9, 6, 9, 9, 7, 10, 10, 4, 6, 2, 3, 9, 4, 2, 6, 5, 7, 4, 5, 7, 6, 6, 5, 6, 5, 5, 9, 7, 7, 3, 2, 4, 4, 7, 3, 6, 4, 7, 6, 12, 6, 9, 4, 6, 5, 4, 7, 6, 5, 6, 7, 5, 4, 5, 6, 5, 7, 3, 7, 13, 2, 2, 4, 6, 6, 8, 5, 17, 12, 7, 8, 8, 2, 4, 4, 4, 4, 4, 2, 2, 6, 5, 8, 5, 8, 3, 5, 5, 6, 4, 9, 3}
}
var _keywordCodeØ00zTextØ001 [553]int8
func init() {
_keywordCodeØ00zTextØ001 = [553]int8{82, 69, 73, 78, 68, 69, 88, 69, 68, 69, 83, 67, 65, 80, 69, 65, 67, 72, 69, 67, 75, 69, 89, 66, 69, 70, 79, 82, 69, 73, 71, 78, 79, 82, 69, 71, 69, 88, 80, 76, 65, 73, 78, 83, 84, 69, 65, 68, 68, 65, 84, 65, 66, 65, 83, 69, 76, 69, 67, 84, 65, 66, 76, 69, 70, 84, 72, 69, 78, 68, 69, 70, 69, 82, 82, 65, 66, 76, 69, 76, 83, 69, 88, 67, 69, 80, 84, 82, 65, 78, 83, 65, 67, 84, 73, 79, 78, 65, 84, 85, 82, 65, 76, 84, 69, 82, 65, 73, 83, 69, 88, 67, 76, 85, 83, 73, 86, 69, 88, 73, 83, 84, 83, 65, 86, 69, 80, 79, 73, 78, 84, 69, 82, 83, 69, 67, 84, 82, 73, 71, 71, 69, 82, 69, 70, 69, 82, 69, 78, 67, 69, 83, 67, 79, 78, 83, 84, 82, 65, 73, 78, 84, 79, 70, 70, 83, 69, 84, 69, 77, 80, 79, 82, 65, 82, 89, 85, 78, 73, 81, 85, 69, 82, 89, 87, 73, 84, 72, 79, 85, 84, 69, 82, 69, 76, 69, 65, 83, 69, 65, 84, 84, 65, 67, 72, 65, 86, 73, 78, 71, 82, 79, 85, 80, 68, 65, 84, 69, 66, 69, 71, 73, 78, 78, 69, 82, 69, 67, 85, 82, 83, 73, 86, 69, 66, 69, 84, 87, 69, 69, 78, 79, 84, 78, 85, 76, 76, 73, 75, 69, 67, 65, 83, 67, 65, 68, 69, 76, 69, 84, 69, 67, 65, 83, 69, 67, 79, 76, 76, 65, 84, 69, 67, 82, 69, 65, 84, 69, 67, 85, 82, 82, 69, 78, 84, 95, 68, 65, 84, 69, 68, 69, 84, 65, 67, 72, 73, 77, 77, 69, 68, 73, 65, 84, 69, 74, 79, 73, 78, 83, 69, 82, 84, 77, 65, 84, 67, 72, 80, 76, 65, 78, 65, 76, 89, 90, 69, 80, 82, 65, 71, 77, 65, 66, 79, 82, 84, 86, 65, 76, 85, 69, 83, 86, 73, 82, 84, 85, 65, 76, 73, 77, 73, 84, 87, 72, 69, 78, 87, 72, 69, 82, 69, 78, 65, 77, 69, 65, 70, 84, 69, 82, 69, 80, 76, 65, 67, 69, 65, 78, 68, 69, 70, 65, 85, 76, 84, 65, 85, 84, 79, 73, 78, 67, 82, 69, 77, 69, 78, 84, 67, 65, 83, 84, 67, 79, 76, 85, 77, 78, 67, 79, 77, 77, 73, 84, 67, 79, 78, 70, 76, 73, 67, 84, 67, 82, 79, 83, 83, 67, 85, 82, 82, 69, 78, 84, 95, 84, 73, 77, 69, 83, 84, 65, 77, 80, 82, 73, 77, 65, 82, 89, 68, 69, 70, 69, 82, 82, 69, 68, 73, 83, 84, 73, 78, 67, 84, 68, 82, 79, 80, 70, 65, 73, 76, 70, 82, 79, 77, 70, 85, 76, 76, 71, 76, 79, 66, 89, 73, 70, 73, 83, 78, 85, 76, 76, 79, 82, 68, 69, 82, 69, 83, 84, 82, 73, 67, 84, 82, 73, 71, 72, 84, 82, 79, 76, 76, 66, 65, 67, 75, 82, 79, 87, 85, 78, 73, 79, 78, 85, 83, 73, 78, 71, 86, 65, 67, 85, 85, 77, 86, 73, 69, 87, 73, 78, 73, 84, 73, 65, 76, 76, 89}
}
var _keywordCodeØ00aOffsetØ005 [124]uint16
func init() {
_keywordCodeØ00aOffsetØ005 = [124]uint16{u16(0), u16(2), u16(2), u16(8), u16(9), u16(14), u16(16), u16(20), u16(23), u16(25), u16(25), u16(29), u16(33), u16(36), u16(41), u16(46), u16(48), u16(53), u16(54), u16(59), u16(62), u16(65), u16(67), u16(69), u16(78), u16(81), u16(86), u16(91), u16(95), u16(96), u16(101), u16(105), u16(109), u16(117), u16(122), u16(128), u16(136), u16(142), u16(152), u16(159), u16(162), u16(162), u16(165), u16(167), u16(167), u16(171), u16(176), u16(179), u16(184), u16(184), u16(188), u16(192), u16(199), u16(204), u16(209), u16(212), u16(218), u16(221), u16(225), u16(234), u16(240), u16(240), u16(240), u16(243), u16(246), u16(250), u16(251), u16(255), u16(261), u16(265), u16(272), u16(278), u16(290), u16(296), u16(305), u16(307), u16(313), u16(318), u16(320), u16(327), u16(332), u16(337), u16(343), u16(349), u16(354), u16(358), u16(361), u16(367), u16(371), u16(378), u16(380), u16(387), u16(389), u16(391), u16(400), u16(404), u16(410), u16(416), u16(424), u16(429), u16(429), u16(445), u16(452), u16(459), u16(460), u16(467), u16(471), u16(475), u16(479), u16(483), u16(486), u16(488), u16(490), u16(496), u16(500), u16(508), u16(513), u16(521), u16(524), u16(529), u16(534), u16(540), u16(544), u16(549)}
}
var _keywordCodeØ00aCodeØ006 [124]uint8
func init() {
_keywordCodeØ00aCodeØ006 = [124]uint8{66, 96, 140, 41, 83, 43, 104, 52, 34, 113, 45, 46, 49, 2, 48, 142, 40, 24, 119, 16, 98, 138, 11, 112, 139, 117, 6, 29, 107, 98, 141, 56, 9, 20, 13, 118, 61, 105, 99, 131, 54, 53, 111, 21, 21, 70, 103, 3, 25, 65, 98, 14, 33, 128, 127, 110, 5, 98, 57, 73, 76, 19, 51, 101, 49, 36, 32, 109, 136, 94, 17, 68, 42, 8, 124, 108, 50, 4, 31, 55, 28, 120, 64, 129, 137, 130, 67, 30, 58, 71, 100, 106, 15, 74, 37, 38, 10, 39, 98, 68, 68, 102, 7, 121, 72, 114, 44, 123, 98, 49, 35, 18, 75, 126, 59, 98, 12, 60, 115, 125, 62, 63, 47, 116}
}
var _keywordCodeØ00aNextØ003 [124]uint8
func init() {
_keywordCodeØ00aNextØ003 = [124]uint8{0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 0, 21, 0, 0, 0, 0, 0, 50, 0, 43, 3, 47, 0, 0, 0, 0, 30, 0, 58, 0, 38, 0, 0, 0, 1, 66, 0, 0, 67, 0, 41, 0, 0, 0, 0, 0, 0, 49, 65, 0, 0, 0, 0, 31, 52, 16, 34, 10, 0, 0, 0, 0, 0, 0, 0, 11, 72, 79, 0, 8, 0, 104, 98, 0, 107, 0, 87, 0, 75, 51, 0, 27, 37, 73, 83, 0, 35, 68, 0, 0}
}
var _renameTableFuncØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_renameTableFuncØ00__func__Ø000[0], str(6522), 16)
}
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
func _sqlite3MPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, args ...interface{}) (r0 *int8) {
var _z *int8
var _ap []interface{}
_ap = args
_z = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
_ap = nil
return _z
}
// Print into memory obtained from sqliteMalloc(). Use the internal
// %-conversion extensions.
func _sqlite3VMPrintf(tls *crt.TLS, _db *Xsqlite3, _zFormat *int8, _ap []interface{}) (r0 *int8) {
var _z *int8
var _acc XStrAccum
var _zBase [70]int8
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26004), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VMPrintfØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StrAccumInit(tls, &_acc, _db, (*int8)(unsafe.Pointer(&_zBase)), int32(u32(70)), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0)))))
*(*uint8)(unsafe.Pointer(&(_acc.X7))) = uint8(i32(1))
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
_z = _sqlite3StrAccumFinish(tls, &_acc)
if int32(_acc.X6) == i32(1) {
_sqlite3OomFault(tls, _db)
}
return _z
_ = _zBase
_ = _acc
panic(0)
}
var _sqlite3VMPrintfØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VMPrintfØ00__func__Ø000[0], str(6538), 16)
}
func _sqlite3StrAccumFinish(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
if (_p.X2) == nil {
goto _0
}
func() {
if ((_p.X2) == (_p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25951), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StrAccumFinishØ00__func__Ø000))), unsafe.Pointer(str(6554)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 1*uintptr(_p.X3))) = int8(i32(0))
if ((_p.X5) > uint32(i32(0))) && ((int32(_p.X7) & i32(4)) == i32(0)) {
return _strAccumFinishRealloc(tls, _p)
}
_0:
return _p.X2
}
var _sqlite3StrAccumFinishØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StrAccumFinishØ00__func__Ø000[0], str(6591), 22)
}
// Finish off a string by making sure it is zero-terminated.
// Return a pointer to the resulting string. Return a NULL
// pointer if any kind of error was encountered.
func _strAccumFinishRealloc(tls *crt.TLS, _p *XStrAccum) (r0 *int8) {
func() {
if (_p.X5) <= uint32(i32(0)) || (int32(_p.X7)&i32(4)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25939), unsafe.Pointer((*int8)(unsafe.Pointer(&_strAccumFinishReallocØ00__func__Ø000))), unsafe.Pointer(str(6613)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_p.X2))) = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_p.X0), uint64((_p.X3)+uint32(i32(1)))))
if (_p.X2) != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(_p.X2), (unsafe.Pointer)(_p.X1), (_p.X3)+uint32(i32(1)))
{
p := (*uint8)(unsafe.Pointer(&(_p.X7)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
goto _4
}
_setStrAccumError(tls, _p, uint8(i32(1)))
_4:
return _p.X2
}
var _strAccumFinishReallocØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_strAccumFinishReallocØ00__func__Ø000[0], str(6644), 22)
}
func Xsqlite3_result_text(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76488), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_textØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_setResultStrOrError(tls, _pCtx, _z, _n, uint8(i32(1)), _xDel)
}
var _sqlite3_result_textØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_textØ00__func__Ø000[0], str(6708), 20)
}
// *************************** sqlite3_result_ *******************************
// The following routines are used by user-defined functions to specify
// the function result.
//
// The setStrOrError() function calls sqlite3VdbeMemSetStr() to store the
// result as a string or blob but if the string or blob is too large, it
// then sets the error code to SQLITE_TOOBIG
//
// The invokeValueDestructor(P,X) routine invokes destructor function X()
// on value P is not going to be used and need to be destroyed.
func _setResultStrOrError(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
if _sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _z, _n, _enc, _xDel) == i32(18) {
Xsqlite3_result_error_toobig(tls, _pCtx)
}
}
// Change the value of a Mem to be a string or a BLOB.
//
// The memory management strategy depends on the value of the xDel
// parameter. If the value passed is SQLITE_TRANSIENT, then the
// string is copied into a (possibly existing) buffer managed by the
// Mem structure. Otherwise, any existing buffer is freed and the
// pointer copied.
//
// If the string is too large (if it exceeds the SQLITE_LIMIT_LENGTH
// size limit) then no memory allocation occurs. If the string can be
// stored without allocating memory, then it is. If a memory allocation
// is required to store the string, then value of pMem is unchanged. In
// either case, SQLITE_TOOBIG is returned.
func _sqlite3VdbeMemSetStr(tls *crt.TLS, _pMem *XMem, _z *int8, _n int32, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _nByte, _iLimit, _8_nAlloc int32
var _flags uint16
_nByte = _n
_flags = u16(0)
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000))), unsafe.Pointer(str(6728)))
crt.X__builtin_abort(tls)
}
}()
if _z == nil {
_sqlite3VdbeMemSetNull(tls, _pMem)
return i32(0)
}
if (*Xsqlite3)(_pMem.X9) != nil {
_iLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pMem.X9).X31))))) + 4*uintptr(i32(0))))
goto _7
}
_iLimit = i32(1000000000)
_7:
_flags = uint16(func() int32 {
if int32(_enc) == i32(0) {
return i32(16)
}
return i32(2)
}())
if _nByte >= i32(0) {
goto _10
}
func() {
if int32(_enc) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetStrØ00__func__Ø000))), unsafe.Pointer(str(6758)))
crt.X__builtin_abort(tls)
}
}()
if int32(_enc) != i32(1) {
goto _13
}
_nByte = _sqlite3Strlen30(tls, _z)
if _nByte > _iLimit {
_nByte = _iLimit + i32(1)
}
goto _15
_13:
_nByte = i32(0)
_16:
if _nByte > _iLimit || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte))))|int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte+i32(1)))))) == 0 {
goto _20
}
{
p := &_nByte
*p = (*p) + i32(2)
sink1 = *p
}
goto _16
_20:
_15:
{
p := &_flags
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
_10:
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))})) {
goto _21
}
_8_nAlloc = _nByte
if (int32(_flags) & i32(512)) != 0 {
{
p := &_8_nAlloc
*p = (*p) + func() int32 {
if int32(_enc) == i32(1) {
return i32(1)
}
return i32(2)
}()
sink1 = *p
}
}
if _nByte > _iLimit {
return i32(18)
}
if _sqlite3VdbeMemClearAndResize(tls, _pMem, func() int32 {
if _8_nAlloc > i32(32) {
return _8_nAlloc
}
return i32(32)
}()) != 0 {
return _sqlite3NomemError(tls, i32(70613))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pMem.X5), (unsafe.Pointer)(_z), uint32(_8_nAlloc))
goto _31
_21:
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
_sqlite3VdbeMemRelease(tls, _pMem)
*(**int8)(unsafe.Pointer(&(_pMem.X6))) = store0((**int8)(unsafe.Pointer(&(_pMem.X5))), _z)
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_pMem.X9), (unsafe.Pointer)(_pMem.X6))
goto _31
}
_sqlite3VdbeMemRelease(tls, _pMem)
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = _z
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pMem.X10))) = _xDel
{
p := &_flags
*p = uint16(int32(*p) | func() int32 {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil})) {
return i32(2048)
}
return i32(1024)
}())
sink14 = *p
}
_31:
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = _nByte
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = _flags
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(func() int32 {
if int32(_enc) == i32(0) {
return i32(1)
}
return int32(_enc)
}())
if (int32(_pMem.X2) != i32(1)) && _sqlite3VdbeMemHandleBom(tls, _pMem) != 0 {
return _sqlite3NomemError(tls, i32(70633))
}
if _nByte > _iLimit {
return i32(18)
}
return i32(0)
}
var _sqlite3VdbeMemSetStrØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemSetStrØ00__func__Ø000[0], str(6765), 21)
}
// This routine checks for a byte-order mark at the beginning of the
// UTF-16 string stored in *pMem. If one is present, it is removed and
// the encoding of the Mem adjusted. This routine does not do any
// byte-swapping, it just sets Mem.enc appropriately.
//
// The allocation (static, dynamic etc.) and encoding of the Mem may be
// changed by this function.
func _sqlite3VdbeMemHandleBom(tls *crt.TLS, _pMem *XMem) (r0 int32) {
var _rc int32
var _bom, _1_b1, _1_b2 uint8
_rc = i32(0)
_bom = u8(0)
func() {
if (_pMem.X4) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27472), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemHandleBomØ00__func__Ø000))), unsafe.Pointer(str(6001)))
crt.X__builtin_abort(tls)
}
}()
if (_pMem.X4) <= i32(1) {
goto _2
}
_1_b1 = *(*uint8)(unsafe.Pointer(_pMem.X5))
_1_b2 = *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pMem.X5)))) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(1))))))))
if (int32(_1_b1) == i32(254)) && (int32(_1_b2) == i32(255)) {
_bom = uint8(i32(3))
}
if (int32(_1_b1) == i32(255)) && (int32(_1_b2) == i32(254)) {
_bom = uint8(i32(2))
}
_2:
if _bom == 0 {
goto _7
}
_rc = _sqlite3VdbeMemMakeWriteable(tls, _pMem)
if _rc == i32(0) {
{
p := (*int32)(unsafe.Pointer(&(_pMem.X4)))
*p = (*p) - i32(2)
sink1 = *p
}
crt.Xmemmove(tls, (unsafe.Pointer)(_pMem.X5), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5))+1*uintptr(i32(2))))), uint32(_pMem.X4))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_pMem.X4))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr((_pMem.X4)+i32(1)))) = int8(i32(0))
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _bom
}
_7:
return _rc
}
var _sqlite3VdbeMemHandleBomØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemHandleBomØ00__func__Ø000[0], str(6786), 24)
}
// Force an SQLITE_TOOBIG error.
func Xsqlite3_result_error_toobig(tls *crt.TLS, _pCtx *Xsqlite3_context) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76567), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_error_toobigØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(18)
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), str(6810), i32(-1), uint8(i32(1)), nil)
}
var _sqlite3_result_error_toobigØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_error_toobigØ00__func__Ø000[0], str(6833), 28)
}
// This function is used by SQL generated to implement the
// ALTER TABLE command. The first argument is the text of a CREATE TRIGGER
// statement. The second is a table name. The table name in the CREATE
// TRIGGER statement is replaced with the third argument and the result
// returned. This is analagous to renameTableFunc() above, except for CREATE
// TRIGGER, not CREATE INDEX and CREATE TABLE.
func _renameTriggerFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _token, _dist, _len int32
var _zRet *int8
var _zSql, _zTableName, _zCsr *uint8
var _tname XToken
var _db *Xsqlite3
_zSql = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_zTableName = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
_dist = i32(3)
_zCsr = _zSql
_len = i32(0)
_db = Xsqlite3_context_db_handle(tls, _context)
if _zSql == nil {
goto _0
}
_1:
if (*_zCsr) == 0 {
return
}
*(**int8)(unsafe.Pointer(&(_tname.X0))) = (*int8)(unsafe.Pointer(_zCsr))
*(*uint32)(unsafe.Pointer(&(_tname.X1))) = uint32(_len)
_3:
{
p := &_zCsr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_len)))
sink13 = *p
}
_len = _sqlite3GetToken(tls, _zCsr, &_token)
if _token == i32(163) {
goto _3
}
func() {
if _len <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96310), unsafe.Pointer((*int8)(unsafe.Pointer(&_renameTriggerFuncØ00__func__Ø000))), unsafe.Pointer(str(4235)))
crt.X__builtin_abort(tls)
}
}()
_dist += 1
if (_token == i32(122)) || (_token == i32(107)) {
_dist = i32(0)
}
if (_dist != i32(2)) || (((_token != i32(137)) && (_token != i32(45))) && (_token != i32(5))) {
goto _1
}
_zRet = _sqlite3MPrintf(tls, _db, str(4241), int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_tname.X0))))-uintptr(unsafe.Pointer(_zSql)))/1), unsafe.Pointer(_zSql), unsafe.Pointer(_zTableName), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_tname.X0))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_tname.X1)))))))))
Xsqlite3_result_text(tls, _context, _zRet, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_0:
_ = _tname
}
var _renameTriggerFuncØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_renameTriggerFuncØ00__func__Ø000[0], str(6861), 18)
}
func _renameParentFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _n, _token int32
var _zOutput, _zResult, _2_zParent, _4_zOut *int8
var _zInput, _zOld, _zNew, _z *uint8
var _db *Xsqlite3
_db = Xsqlite3_context_db_handle(tls, _context)
_zOutput = nil
_zInput = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_zOld = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
_zNew = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))))
if (_zInput == nil) || (_zOld == nil) {
return
}
_z = _zInput
_2:
if (*_z) == 0 {
goto _5
}
_n = _sqlite3GetToken(tls, _z, &_token)
if _token != i32(105) {
goto _6
}
_7:
{
p := &_z
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink13 = *p
}
_n = _sqlite3GetToken(tls, _z, &_token)
if _token == i32(163) {
goto _7
}
if _token == i32(164) {
goto _5
}
_2_zParent = _sqlite3DbStrNDup(tls, _db, (*int8)(unsafe.Pointer(_z)), uint64(_n))
if _2_zParent == nil {
goto _5
}
_sqlite3Dequote(tls, _2_zParent)
if i32(0) == _sqlite3StrICmp(tls, (*int8)(unsafe.Pointer(_zOld)), _2_zParent) {
_4_zOut = _sqlite3MPrintf(tls, _db, str(6879), unsafe.Pointer(func() *int8 {
if _zOutput != nil {
return _zOutput
}
return str(0)
}()), int32((uintptr(unsafe.Pointer(_z))-uintptr(unsafe.Pointer(_zInput)))/1), unsafe.Pointer(_zInput), unsafe.Pointer((*int8)(unsafe.Pointer(_zNew))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zOutput))
_zOutput = _4_zOut
_zInput = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_zParent))
_6:
_z = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_n)))))))
goto _2
_5:
Xsqlite3_result_text(tls, func() *Xsqlite3_context {
_zResult = _sqlite3MPrintf(tls, _db, str(6890), unsafe.Pointer(func() *int8 {
if _zOutput != nil {
return _zOutput
}
return str(0)
}()), unsafe.Pointer(_zInput))
return _context
}(), _zResult, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zOutput))
}
func _sqlite3DbStrNDup(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n uint64) (r0 *int8) {
var _zNew *int8
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24971), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _z == nil {
return nil
}
func() {
if (_n & uint64(i32(2147483647))) != _n {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DbStrNDupØ00__func__Ø000))), unsafe.Pointer(str(6895)))
crt.X__builtin_abort(tls)
}
}()
_zNew = (*int8)(_sqlite3DbMallocRawNN(tls, _db, _n+uint64(i32(1))))
if _zNew != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_z), uint32(_n))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNew)) + 1*uintptr(_n))) = int8(i32(0))
}
return _zNew
}
var _sqlite3DbStrNDupØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DbStrNDupØ00__func__Ø000[0], str(6913), 17)
}
// 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-Feb-14: This routine is extended to remove MS-Access style
// brackets from around identifiers. For example: "[a-b-c]" becomes
// "a-b-c".
func _sqlite3Dequote(tls *crt.TLS, _z *int8) {
var _i, _j int32
var _quote int8
if _z == nil {
return
}
_quote = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_quote))))) & i32(128)) == 0 {
return
}
if int32(_quote) == i32(91) {
_quote = int8(i32(93))
}
*func() *int32 { _i = i32(1); return &_j }() = i32(0)
_3:
func() {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27909), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DequoteØ00__func__Ø000))), unsafe.Pointer(str(6930)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != int32(_quote) {
goto _8
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))) == int32(_quote) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_j, int32(1))))) = _quote
_i += 1
goto _10
}
goto _5
_10:
goto _11
_8:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_j, int32(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))
_11:
_i += 1
goto _3
_5:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j))) = int8(i32(0))
}
var _sqlite3DequoteØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DequoteØ00__func__Ø000[0], str(6935), 15)
}
// This function registered all of the above C functions as SQL
// functions. This should be the only routine in this file with
// external linkage.
func _sqlite3RegisterDateTimeFunctions(tls *crt.TLS) {
_sqlite3InsertBuiltinFuncs(tls, (*XFuncDef)(unsafe.Pointer(&_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001)), i32(8))
}
var _sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 [8]XFuncDef
func init() {
_sqlite3RegisterDateTimeFunctionsØ00aDateTimeFuncsØ001 = [8]XFuncDef{XFuncDef{X0: i8(-1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_juliandayFunc})), X5: nil, X6: str(6950), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_dateFunc})), X5: nil, X6: str(6960), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_timeFunc})), X5: nil, X6: str(6965), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_datetimeFunc})), X5: nil, X6: str(6970), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_strftimeFunc})), X5: nil, X6: str(6979), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_ctimeFunc})), X5: nil, X6: str(6988), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_ctimestampFunc})), X5: nil, X6: str(7001), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_cdateFunc})), X5: nil, X6: str(7019), X7: t12{}}}
}
// julianday( TIMESTRING, MOD, MOD, ...)
//
// Return the julian day number of the date specified in the arguments
func _juliandayFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _x XDateTime
if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) {
_computeJD(tls, &_x)
Xsqlite3_result_double(tls, _context, float64(_x.X0)/(8.64e+07))
}
_ = _x
}
// Process time function arguments. argv[0] is a date-time stamp.
// argv[1] and following are modifiers. Parse them all and write
// the resulting time into the DateTime structure p. Return 0
// on success and 1 if there are any errors.
//
// If there are zero parameters (if even argv[0] is undefined)
// then assume a default value of "now" for argv[0].
func _isDate(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem, _p *XDateTime) (r0 int32) {
var _i, _n, _eType int32
var _z *uint8
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(48))
if _argc == i32(0) {
return _setDateTimeToCurrent(tls, _context, _p)
}
if (store1(&_eType, Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))) == i32(2)) || (_eType == i32(1)) {
_setRawDateNumber(tls, _p, Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
goto _3
}
_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if (_z == nil) || _parseDateOrTime(tls, _context, (*int8)(unsafe.Pointer(_z)), _p) != 0 {
return i32(1)
}
_3:
_i = i32(1)
_6:
if _i >= _argc {
goto _9
}
_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i))))
_n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i))))
if (_z == nil) || _parseModifier(tls, _context, (*int8)(unsafe.Pointer(_z)), _n, _p) != 0 {
return i32(1)
}
_i += 1
goto _6
_9:
_computeJD(tls, _p)
if ((_p.X14) != 0) || (_validJulianDay(tls, _p.X0) == 0) {
return i32(1)
}
return i32(0)
}
// Set the time to the current time reported by the VFS.
//
// Return the number of errors.
func _setDateTimeToCurrent(tls *crt.TLS, _context *Xsqlite3_context, _p *XDateTime) (r0 int32) {
*(*int64)(unsafe.Pointer(&(_p.X0))) = _sqlite3StmtCurrentTime(tls, _context)
if (_p.X0) > int64(i32(0)) {
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1))
return i32(0)
}
return i32(1)
}
// Return the current time for a statement. If the current time
// is requested more than once within the same run of a single prepared
// statement, the exact same time is returned for each invocation regardless
// of the amount of time that elapses between invocations. In other words,
// the time returned is always the time of the first call.
func _sqlite3StmtCurrentTime(tls *crt.TLS, _p *Xsqlite3_context) (r0 int64) {
var _rc int32
var _piTime *int64
_piTime = (*int64)(unsafe.Pointer(&((*TVdbe)(_p.X3).X13)))
func() {
if (*TVdbe)(_p.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76829), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StmtCurrentTimeØ00__func__Ø000))), unsafe.Pointer(str(7032)))
crt.X__builtin_abort(tls)
}
}()
if (*_piTime) != int64(i32(0)) {
goto _2
}
_rc = _sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)((*Xsqlite3)((*XMem)(_p.X0).X9).X0), _piTime)
if _rc != 0 {
*_piTime = int64(i32(0))
}
_2:
return *_piTime
}
var _sqlite3StmtCurrentTimeØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StmtCurrentTimeØ00__func__Ø000[0], str(7044), 23)
}
func _sqlite3OsCurrentTimeInt64(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pTimeOut *int64) (r0 int32) {
var _rc int32
var _2_r float64
if ((_pVfs.X0) >= i32(2)) && ((*(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int64) int32
}{(_pVfs.X18)}))) != nil) {
_rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int64) int32
}{(_pVfs.X18)})))(tls, _pVfs, _pTimeOut)
goto _2
}
_rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *float64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *float64) int32
}{(_pVfs.X16)})))(tls, _pVfs, &_2_r)
*_pTimeOut = int64(_2_r * (8.64e+07))
_2:
return _rc
}
// SQLITE_OMIT_UTF16
// EVIDENCE-OF: R-12793-43283 Every value in SQLite has one of five
// fundamental datatypes: 64-bit signed integer 64-bit IEEE floating
// point number string BLOB NULL
func Xsqlite3_value_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_value_typeØ00aTypeØ001)) + 1*uintptr(int32(_pVal.X1)&i32(31)))))
}
var _sqlite3_value_typeØ00aTypeØ001 [32]uint8
func init() {
_sqlite3_value_typeØ00aTypeØ001 = [32]uint8{4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5, 4, 5, 3, 5, 1, 5, 1, 5, 2, 5, 2, 5, 1, 5, 1, 5}
}
// Input "r" is a numeric quantity which might be a julian day number,
// or the number of seconds since 1970. If the value if r is within
// range of a julian day number, install it as such and set validJD.
// If the value is a valid unix timestamp, put it in p->s and set p->rawS.
func _setRawDateNumber(tls *crt.TLS, _p *XDateTime, _r float64) {
*(*float64)(unsafe.Pointer(&(_p.X7))) = _r
*(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(1))
if (_r >= float64(0)) && (_r < (5.3734845e+06)) {
*(*int64)(unsafe.Pointer(&(_p.X0))) = int64((_r * (8.64e+07)) + (0.5))
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1))
}
}
func Xsqlite3_value_double(tls *crt.TLS, _pVal *XMem) (r0 float64) {
return _sqlite3VdbeRealValue(tls, _pVal)
}
func _sqlite3VdbeRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70198), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRealValueØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pMem.X1) & i32(8)) != 0 {
return *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))
}
if (int32(_pMem.X1) & i32(4)) != 0 {
return float64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
}
if (int32(_pMem.X1) & i32(18)) != 0 {
return _memRealValue(tls, _pMem)
}
return float64(0)
}
var _sqlite3VdbeRealValueØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeRealValueØ00__func__Ø000[0], str(7067), 21)
}
// Return the best representation of pMem that we can get into a
// double. If pMem is already a double or an integer, return its
// value. If it is a string or blob, try to convert it to a double.
// If it is a NULL, return 0.0.
func _memRealValue(tls *crt.TLS, _pMem *XMem) (r0 float64) {
var _val float64
_val = 0
_sqlite3AtoF(tls, _pMem.X5, &_val, _pMem.X4, _pMem.X2)
return _val
}
// 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. 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 _sqlite3AtoF(tls *crt.TLS, _z *int8, _pResult *float64, _length int32, _enc uint8) (r0 int32) {
var _incr, _sign, _d, _esign, _e, _eValid, _nDigits, _nonNum, _2_i int32
var _s int64
var _zEnd *int8
var _result, _22_scale float64
_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_length)))))))
_sign = i32(1)
_s = i64(0)
_d = i32(0)
_esign = i32(1)
_e = i32(0)
_eValid = i32(1)
_nDigits = i32(0)
_nonNum = i32(0)
func() {
if int32(_enc) != i32(1) && int32(_enc) != i32(2) && int32(_enc) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28016), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000))), unsafe.Pointer(str(7088)))
crt.X__builtin_abort(tls)
}
}()
*_pResult = float64(0)
if int32(_enc) == i32(1) {
_incr = i32(1)
goto _5
}
_incr = i32(2)
i32(0)
_2_i = i32(3) - int32(_enc)
_6:
if _2_i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_2_i)))) != i32(0) {
goto _10
}
{
p := &_2_i
*p = (*p) + i32(2)
sink1 = *p
}
goto _6
_10:
_nonNum = bool2int(_2_i < _length)
_zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_2_i^i32(1))))
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(int32(_enc)&i32(1))))
sink0 = *p
}
_5:
if (uintptr(unsafe.Pointer(_z)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _5
}
if uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zEnd)) {
return i32(0)
}
if int32(*_z) == i32(45) {
_sign = i32(-1)
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _17
}
if int32(*_z) == i32(43) {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
}
_17:
if ((uintptr(unsafe.Pointer(_z)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0) && (_s < i64(922337203685477579)) {
_s = (_s * int64(i32(10))) + int64(int32(*_z)-i32(48))
*func() *int32 {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
return &_nDigits
}() += 1
goto _17
}
_19:
if (uintptr(unsafe.Pointer(_z)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 {
*func() *int32 {
*func() *int32 {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
return &_nDigits
}() += 1
return &_d
}() += 1
goto _19
}
if uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zEnd)) {
goto _do_atof_calc
}
if int32(*_z) != i32(46) {
goto _26
}
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
_27:
if uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zEnd)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) == 0 {
goto _28
}
if _s < i64(922337203685477579) {
_s = (_s * int64(i32(10))) + int64(int32(*_z)-i32(48))
_d -= 1
}
*func() *int32 {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
return &_nDigits
}() += 1
goto _27
_28:
_26:
if uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zEnd)) {
goto _do_atof_calc
}
if int32(*_z) != i32(101) && int32(*_z) != i32(69) {
goto _33
}
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
_eValid = i32(0)
if uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zEnd)) {
goto _do_atof_calc
}
if int32(*_z) == i32(45) {
_esign = i32(-1)
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _37
}
if int32(*_z) == i32(43) {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
}
_37:
if (uintptr(unsafe.Pointer(_z)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(4)) != 0 {
_e = func() int32 {
if _e < i32(10000) {
return ((_e * i32(10)) + (int32(*_z) - i32(48)))
}
return i32(10000)
}()
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
_eValid = i32(1)
goto _37
}
_33:
if (uintptr(unsafe.Pointer(_z)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z)))))&i32(1)) != 0 {
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _33
}
_do_atof_calc:
_e = (_e * _esign) + _d
if _e < i32(0) {
_esign = i32(-1)
{
p := &_e
*p = (*p) * i32(-1)
sink1 = *p
}
goto _47
}
_esign = i32(1)
_47:
if _s == int64(i32(0)) {
_result = func() float64 {
if _sign < i32(0) {
return (-0)
}
return float64(0)
}()
goto _51
}
_52:
if _e <= i32(0) {
goto _53
}
if _esign <= i32(0) {
goto _54
}
if _s >= i64(922337203685477580) {
goto _53
}
{
p := &_s
*p = (*p) * int64(i32(10))
sink6 = *p
}
goto _56
_54:
if (_s % int64(i32(10))) != int64(i32(0)) {
goto _53
}
{
p := &_s
*p = (*p) / int64(i32(10))
sink6 = *p
}
_56:
_e -= 1
goto _52
_53:
_s = func() int64 {
if _sign < i32(0) {
return (-_s)
}
return _s
}()
if _e == i32(0) {
_result = float64(_s)
goto _61
}
_22_scale = 1
if _e <= i32(307) {
goto _62
}
if _e >= i32(342) {
goto _63
}
_64:
if (_e % i32(308)) != 0 {
{
p := &_22_scale
*p = (*p) * float64(10)
sink4 = *p
}
{
p := &_e
*p = (*p) - i32(1)
sink1 = *p
}
goto _64
}
if _esign < i32(0) {
_result = float64(_s) / _22_scale
{
p := &_result
*p = (*p) / float64(1e+308)
sink4 = *p
}
goto _67
}
_result = float64(_s) * _22_scale
{
p := &_result
*p = (*p) * float64(1e+308)
sink4 = *p
}
_67:
goto _68
_63:
func() {
if _e < i32(342) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AtoFØ00__func__Ø000))), unsafe.Pointer(str(7151)))
crt.X__builtin_abort(tls)
}
}()
if _esign < i32(0) {
_result = float64(0) * float64(_s)
goto _72
}
_result = inf * float64(_s)
_72:
_68:
goto _73
_62:
_74:
if (_e % i32(22)) != 0 {
{
p := &_22_scale
*p = (*p) * float64(10)
sink4 = *p
}
{
p := &_e
*p = (*p) - i32(1)
sink1 = *p
}
goto _74
}
_75:
if _e > i32(0) {
{
p := &_22_scale
*p = (*p) * float64(1e+22)
sink4 = *p
}
{
p := &_e
*p = (*p) - i32(22)
sink1 = *p
}
goto _75
}
if _esign < i32(0) {
_result = float64(_s) / _22_scale
goto _79
}
_result = float64(_s) * _22_scale
_79:
_73:
_61:
_51:
*_pResult = _result
return bool2int((((_z == _zEnd) && (_nDigits > i32(0))) && _eValid != 0) && (_nonNum == i32(0)))
}
var _sqlite3AtoFØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AtoFØ00__func__Ø000[0], str(7158), 12)
}
// Attempt to parse the given string into a julian day number. Return
// the number of errors.
//
// The following are acceptable forms for the input string:
//
// YYYY-MM-DD HH:MM:SS.FFF +/-HH:MM
// DDDD.DD
// now
//
// In the first form, the +/-HH:MM is always optional. The fractional
// seconds extension (the ".FFF") is optional. The seconds portion
// (":SS.FFF") is option. The year and date can be omitted as long
// as there is a time string. The time string can be omitted as long
// as there is a year and date.
func _parseDateOrTime(tls *crt.TLS, _context *Xsqlite3_context, _zDate *int8, _p *XDateTime) (r0 int32) {
var _r float64
if _parseYyyyMmDd(tls, _zDate, _p) == i32(0) {
return i32(0)
}
if _parseHhMmSs(tls, _zDate, _p) == i32(0) {
return i32(0)
}
if _sqlite3StrICmp(tls, _zDate, str(7170)) == i32(0) {
return _setDateTimeToCurrent(tls, _context, _p)
}
if _sqlite3AtoF(tls, _zDate, &_r, _sqlite3Strlen30(tls, _zDate), uint8(i32(1))) != 0 {
_setRawDateNumber(tls, _p, _r)
return i32(0)
}
return i32(1)
}
// Parse dates of the form
//
// YYYY-MM-DD HH:MM:SS.FFF
// YYYY-MM-DD HH:MM:SS
// YYYY-MM-DD HH:MM
// YYYY-MM-DD
//
// Write the result into the DateTime structure and return 0
// on success and 1 if the input string is not a well-formed
// date.
func _parseYyyyMmDd(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
var _Y, _M, _D, _neg int32
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDate)) + 1*uintptr(i32(0))))) == i32(45) {
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
_neg = i32(1)
goto _1
}
_neg = i32(0)
_1:
if _getDigits(tls, _zDate, str(7174), unsafe.Pointer(&_Y), unsafe.Pointer(&_M), unsafe.Pointer(&_D)) != i32(3) {
return i32(1)
}
{
p := &_zDate
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(10))))
sink0 = *p
}
_3:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate)))))&i32(1)) != 0 || (i32(84) == int32(*(*uint8)(unsafe.Pointer(_zDate)))) {
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _3
}
if _parseHhMmSs(tls, _zDate, _p) == i32(0) {
goto _9
}
if int32(*_zDate) == i32(0) {
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0))
goto _9
}
return i32(1)
_9:
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X1))) = func() int32 {
if _neg != 0 {
return (-_Y)
}
return _Y
}()
*(*int32)(unsafe.Pointer(&(_p.X2))) = _M
*(*int32)(unsafe.Pointer(&(_p.X3))) = _D
if (_p.X12) != 0 {
_computeJD(tls, _p)
}
return i32(0)
}
// Convert zDate into one or more integers according to the conversion
// specifier zFormat.
//
// zFormat[] contains 4 characters for each integer converted, except for
// the last integer which is specified by three characters. The meaning
// of a four-character format specifiers ABCD is:
//
// A: number of digits to convert. Always "2" or "4".
// B: minimum value. Always "0" or "1".
// C: maximum value, decoded as:
// a: 12
// b: 14
// c: 24
// d: 31
// e: 59
// f: 9999
// D: the separator character, or \000 to indicate this is the
// last number to convert.
//
// Example: To translate an ISO-8601 date YYYY-MM-DD, the format would
// be "40f-21a-20c". The "40f-" indicates the 4-digit year followed by "-".
// The "21a-" indicates the 2-digit month followed by "-". The "20c" indicates
// the 2-digit day which is the last integer in the set.
//
// The function returns the number of successful conversions.
func _getDigits(tls *crt.TLS, _zDate *int8, _zFormat *int8, args ...interface{}) (r0 int32) {
var _cnt, _1_val int32
var _nextC, _1_N, _1_min int8
var _1_max uint16
var _ap []interface{}
_cnt = i32(0)
_ap = args
_0:
_1_N = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(0))))) - i32(48))
_1_min = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(1))))) - i32(48))
_1_val = i32(0)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2))))) < i32(97) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2))))) > i32(102) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18950), unsafe.Pointer((*int8)(unsafe.Pointer(&_getDigitsØ00__func__Ø000))), unsafe.Pointer(str(7186)))
crt.X__builtin_abort(tls)
}
}()
_1_max = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getDigitsØ00aMxØ001)) + 2*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(2)))))-i32(97))))
_nextC = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFormat)) + 1*uintptr(i32(3))))
_1_val = i32(0)
_4:
if postInc3(&_1_N, int8(-1)) == 0 {
goto _5
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) == 0 {
goto _end_getDigits
}
_1_val = ((_1_val * i32(10)) + int32(*_zDate)) - i32(48)
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _4
_5:
if ((_1_val < int32(_1_min)) || (_1_val > int32(_1_max))) || ((int32(_nextC) != i32(0)) && (int32(_nextC) != int32(*_zDate))) {
goto _end_getDigits
}
*(*int32)(crt.VAPointer(&_ap)) = _1_val
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
_cnt += 1
{
p := &_zFormat
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(4))))
sink0 = *p
}
if _nextC != 0 {
goto _0
}
_end_getDigits:
_ap = nil
return _cnt
_ = _1_N
panic(0)
}
var _getDigitsØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_getDigitsØ00__func__Ø000[0], str(7221), 10)
}
var _getDigitsØ00aMxØ001 [6]uint16
func init() {
_getDigitsØ00aMxØ001 = [6]uint16{u16(12), u16(14), u16(24), u16(31), u16(59), u16(9999)}
}
// Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF.
// The HH, MM, and SS must each be exactly 2 digits. The
// fractional seconds FFFF can be one or more digits.
//
// Return 1 if there is a parsing error and 0 on success.
func _parseHhMmSs(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
var _h, _m, _s int32
var _ms, _4_rScale float64
_ms = 0
if _getDigits(tls, _zDate, str(7231), unsafe.Pointer(&_h), unsafe.Pointer(&_m)) != i32(2) {
return i32(1)
}
{
p := &_zDate
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(5))))
sink0 = *p
}
if int32(*_zDate) != i32(58) {
goto _1
}
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
if _getDigits(tls, _zDate, str(7239), unsafe.Pointer(&_s)) != i32(1) {
return i32(1)
}
{
p := &_zDate
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink0 = *p
}
if int32(*_zDate) != i32(46) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDate)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 {
goto _4
}
_4_rScale = 1
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
_5:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(4)) != 0 {
_ms = ((_ms * float64(10)) + float64(*_zDate)) - float64(i32(48))
{
p := &_4_rScale
*p = (*p) * float64(10)
sink4 = *p
}
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _5
}
{
p := &_ms
*p = (*p) / _4_rScale
sink4 = *p
}
_4:
goto _7
_1:
_s = i32(0)
_7:
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X4))) = _h
*(*int32)(unsafe.Pointer(&(_p.X5))) = _m
*(*float64)(unsafe.Pointer(&(_p.X7))) = float64(_s) + _ms
if _parseTimezone(tls, _zDate, _p) != 0 {
return i32(1)
}
*(*int8)(unsafe.Pointer(&(_p.X12))) = int8(func() int32 {
if (_p.X6) != i32(0) {
return i32(1)
}
return i32(0)
}())
return i32(0)
}
// Parse a timezone extension on the end of a date-time.
// The extension is of the form:
//
// (+/-)HH:MM
//
// Or the "zulu" notation:
//
// Z
//
// If the parse is successful, write the number of minutes
// of change in p->tz and return 0. If a parser error occurs,
// return non-zero.
//
// A missing specifier is not considered an error.
func _parseTimezone(tls *crt.TLS, _zDate *int8, _p *XDateTime) (r0 int32) {
var _sgn, _nHr, _nMn, _c int32
_sgn = i32(0)
_0:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 {
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _0
}
*(*int32)(unsafe.Pointer(&(_p.X6))) = i32(0)
_c = int32(*_zDate)
if _c == i32(45) {
_sgn = i32(-1)
goto _5
}
if _c == i32(43) {
_sgn = i32(1)
goto _5
}
if (_c == i32(90)) || (_c == i32(122)) {
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _zulu_time
}
return bool2int(_c != i32(0))
_5:
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
if _getDigits(tls, _zDate, str(7243), unsafe.Pointer(&_nHr), unsafe.Pointer(&_nMn)) != i32(2) {
return i32(1)
}
{
p := &_zDate
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(5))))
sink0 = *p
}
*(*int32)(unsafe.Pointer(&(_p.X6))) = _sgn * (_nMn + (_nHr * i32(60)))
_zulu_time:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zDate))))) & i32(1)) != 0 {
*(*uintptr)(unsafe.Pointer(&_zDate)) += uintptr(1)
goto _zulu_time
}
*(*int8)(unsafe.Pointer(&(_p.X13))) = int8(i32(1))
return bool2int(int32(*_zDate) != i32(0))
}
// Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume
// that the YYYY-MM-DD is according to the Gregorian calendar.
//
// Reference: Meeus page 61
func _computeJD(tls *crt.TLS, _p *XDateTime) {
var _Y, _M, _D, _A, _B, _X1, _X2 int32
if (_p.X8) != 0 {
return
}
if (_p.X10) != 0 {
_Y = _p.X1
_M = _p.X2
_D = _p.X3
goto _2
}
_Y = i32(2000)
_M = i32(1)
_D = i32(1)
_2:
if ((_Y < i32(-4713)) || (_Y > i32(9999))) || ((_p.X9) != 0) {
_datetimeError(tls, _p)
return
}
if _M <= i32(2) {
_Y -= 1
{
p := &_M
*p = (*p) + i32(12)
sink1 = *p
}
}
_A = _Y / i32(100)
_B = (i32(2) - _A) + (_A / i32(4))
_X1 = (i32(36525) * (_Y + i32(4716))) / i32(100)
_X2 = (i32(306001) * (_M + i32(1))) / i32(10000)
*(*int64)(unsafe.Pointer(&(_p.X0))) = int64((float64(((_X1+_X2)+_D)+_B) - (1524.5)) * float64(i32(86400000)))
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1))
if (_p.X11) == 0 {
goto _7
}
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + (int64(((_p.X4)*i32(3600000))+((_p.X5)*i32(60000))) + int64((_p.X7)*float64(i32(1000))))
sink6 = *p
}
if (_p.X12) != 0 {
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) - int64((_p.X6)*i32(60000))
sink6 = *p
}
*(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0))
}
_7:
}
// Put the DateTime object into its error state.
func _datetimeError(tls *crt.TLS, _p *XDateTime) {
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(48))
*(*int8)(unsafe.Pointer(&(_p.X14))) = int8(i32(1))
}
func Xsqlite3_value_bytes(tls *crt.TLS, _pVal *XMem) (r0 int32) {
return _sqlite3ValueBytes(tls, _pVal, uint8(i32(1)))
}
func _sqlite3ValueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
var _p *XMem
_p = _pVal
func() {
if (int32(_p.X1)&i32(1)) != i32(0) && (int32(_p.X1)&i32(18)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ValueBytesØ00__func__Ø000))), unsafe.Pointer(str(7251)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_p.X1) & i32(2)) != i32(0)) && (int32(_pVal.X2) == int32(_enc)) {
return _p.X4
}
if (int32(_p.X1) & i32(16)) == i32(0) {
goto _5
}
if (int32(_p.X1) & i32(16384)) != 0 {
return (_p.X4) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
}
return _p.X4
_5:
if (int32(_p.X1) & i32(1)) != 0 {
return i32(0)
}
return _valueBytes(tls, _pVal, _enc)
}
var _sqlite3ValueBytesØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ValueBytesØ00__func__Ø000[0], str(7314), 18)
}
// The sqlite3ValueBytes() routine returns the number of bytes in the
// sqlite3_value object assuming that it uses the encoding "enc".
// The valueBytes() routine is a helper function.
func _valueBytes(tls *crt.TLS, _pVal *XMem, _enc uint8) (r0 int32) {
return func() int32 {
if _valueToText(tls, _pVal, _enc) != nil {
return (_pVal.X4)
}
return i32(0)
}()
}
// Process a modifier to a date-time stamp. The modifiers are
// as follows:
//
// NNN days
// NNN hours
// NNN minutes
// NNN.NNNN seconds
// NNN months
// NNN years
// start of month
// start of year
// start of week
// start of day
// weekday N
// unixepoch
// localtime
// utc
//
// Return 0 on success and 1 if there is any kind of error. If the error
// is in a system call (i.e. localtime()), then an error message is written
// to context pCtx. If the error is an unrecognized modifier, no error is
// written to pCtx.
func _parseModifier(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32, _p *XDateTime) (r0 int32) {
var _rc, _17_i, _24_x, _25_y int32
var _8_c1, _12_Z, _20_day int64
var _20_z2 *int8
var _r, _17_rRounder float64
var _20_tx XDateTime
_rc = i32(1)
switch int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))))))) {
case i32(43):
goto _5
case i32(45):
goto _5
case i32(48):
goto _5
case i32(49):
goto _5
case i32(50):
goto _5
case i32(51):
goto _5
case i32(52):
goto _5
case i32(53):
goto _5
case i32(54):
goto _5
case i32(55):
goto _5
case i32(56):
goto _5
case i32(57):
goto _5
case i32(108):
goto _1
case i32(115):
goto _4
case i32(117):
goto _2
case i32(119):
goto _3
default:
goto _17
}
_1:
if Xsqlite3_stricmp(tls, _z, str(7332)) == i32(0) {
_computeJD(tls, _p)
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + _localtimeOffset(tls, _p, _pCtx, &_rc)
sink6 = *p
}
_clearYMD_HMS_TZ(tls, _p)
}
goto _19
_2:
if Xsqlite3_stricmp(tls, _z, str(7342)) != i32(0) || (_p.X9) == 0 {
goto _21
}
_r = ((_p.X7) * float64(1000)) + (2.1086676e+14)
if (_r >= float64(0)) && (_r < (4.642690608e+14)) {
_clearYMD_HMS_TZ(tls, _p)
*(*int64)(unsafe.Pointer(&(_p.X0))) = int64(_r)
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(1))
*(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0))
_rc = i32(0)
}
goto _25
_21:
if Xsqlite3_stricmp(tls, _z, str(7352)) != i32(0) {
goto _25
}
if int32(_p.X13) != i32(0) {
goto _26
}
_computeJD(tls, _p)
_8_c1 = _localtimeOffset(tls, _p, _pCtx, &_rc)
if _rc == i32(0) {
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) - _8_c1
sink6 = *p
}
_clearYMD_HMS_TZ(tls, _p)
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + (_8_c1 - _localtimeOffset(tls, _p, _pCtx, &_rc))
sink6 = *p
}
}
*(*int8)(unsafe.Pointer(&(_p.X13))) = int8(i32(1))
goto _28
_26:
_rc = i32(0)
_28:
_25:
goto _19
_3:
if Xsqlite3_strnicmp(tls, _z, str(7356), i32(8)) != i32(0) || _sqlite3AtoF(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(8)))), &_r, _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(8))))), uint8(i32(1))) == 0 || float64(store1(&_n, int32(_r))) != _r || _n < i32(0) || _r >= float64(i32(7)) {
goto _33
}
_computeYMD_HMS(tls, _p)
*(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
_computeJD(tls, _p)
_12_Z = (((_p.X0) + int64(i32(129600000))) / int64(i32(86400000))) % int64(i32(7))
if _12_Z > int64(_n) {
{
p := &_12_Z
*p = (*p) - int64(i32(7))
sink6 = *p
}
}
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + ((int64(_n) - _12_Z) * int64(i32(86400000)))
sink6 = *p
}
_clearYMD_HMS_TZ(tls, _p)
_rc = i32(0)
_33:
goto _19
_4:
if Xsqlite3_strnicmp(tls, _z, str(7365), i32(9)) != i32(0) {
goto _19
}
if (((_p.X8) == 0) && ((_p.X10) == 0)) && ((_p.X11) == 0) {
goto _19
}
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(9))))
sink0 = *p
}
_computeYMD(tls, _p)
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X5))), i32(0))
*(*float64)(unsafe.Pointer(&(_p.X7))) = float64(0)
*(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
if Xsqlite3_stricmp(tls, _z, str(7375)) == i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1)
_rc = i32(0)
goto _43
}
if Xsqlite3_stricmp(tls, _z, str(7381)) == i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X2))) = i32(1)
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1)
_rc = i32(0)
goto _43
}
if Xsqlite3_stricmp(tls, _z, str(7386)) == i32(0) {
_rc = i32(0)
}
_43:
goto _19
_5:
_n = i32(1)
_44:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) == i32(58) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n))))))))&i32(1)) != 0 {
goto _49
}
_n += 1
goto _44
_49:
if _sqlite3AtoF(tls, _z, &_r, _n, uint8(i32(1))) == 0 {
_rc = i32(1)
goto _19
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n)))) != i32(58) {
goto _51
}
_20_z2 = _z
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_20_z2))))) & i32(4)) == 0 {
*(*uintptr)(unsafe.Pointer(&_20_z2)) += uintptr(1)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_20_tx), i32(0), u32(48))
if _parseHhMmSs(tls, _20_z2, &_20_tx) != 0 {
goto _19
}
_computeJD(tls, &_20_tx)
{
p := (*int64)(unsafe.Pointer(&(_20_tx.X0)))
*p = (*p) - int64(i32(43200000))
sink6 = *p
}
_20_day = (_20_tx.X0) / int64(i32(86400000))
{
p := (*int64)(unsafe.Pointer(&(_20_tx.X0)))
*p = (*p) - (_20_day * int64(i32(86400000)))
sink6 = *p
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(45) {
*(*int64)(unsafe.Pointer(&(_20_tx.X0))) = -(_20_tx.X0)
}
_computeJD(tls, _p)
_clearYMD_HMS_TZ(tls, _p)
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + (_20_tx.X0)
sink6 = *p
}
_rc = i32(0)
goto _19
_51:
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink0 = *p
}
_55:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _55
}
_n = _sqlite3Strlen30(tls, _z)
if (_n > i32(10)) || (_n < i32(3)) {
goto _19
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) == i32(115) {
_n -= 1
}
_computeJD(tls, _p)
_rc = i32(1)
_17_rRounder = func() float64 {
if _r < float64(i32(0)) {
return (-0.5)
}
return (0.5)
}()
_17_i = i32(0)
_62:
if _17_i >= i32(6) {
goto _65
}
if int32((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+24*uintptr(_17_i))).X1) != _n || Xsqlite3_strnicmp(tls, (*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+24*uintptr(_17_i))).X2, _z, _n) != i32(0) || _r <= (-((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType)) + 24*uintptr(_17_i))).X3)) || _r >= ((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+24*uintptr(_17_i))).X3) {
goto _69
}
switch int32((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType)) + 24*uintptr(_17_i))).X0) {
case i32(1):
goto _71
case i32(2):
goto _72
default:
goto _73
}
_71:
_computeYMD_HMS(tls, _p)
{
p := (*int32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) + int32(_r)
sink1 = *p
}
_24_x = func() int32 {
if (_p.X2) > i32(0) {
return (((_p.X2) - i32(1)) / i32(12))
}
return (((_p.X2) - i32(12)) / i32(12))
}()
{
p := (*int32)(unsafe.Pointer(&(_p.X1)))
*p = (*p) + _24_x
sink1 = *p
}
{
p := (*int32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) - (_24_x * i32(12))
sink1 = *p
}
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
{
p := &_r
*p = (*p) - float64(int32(_r))
sink4 = *p
}
goto _73
_72:
_25_y = int32(_r)
_computeYMD_HMS(tls, _p)
{
p := (*int32)(unsafe.Pointer(&(_p.X1)))
*p = (*p) + _25_y
sink1 = *p
}
*(*int8)(unsafe.Pointer(&(_p.X8))) = int8(i32(0))
{
p := &_r
*p = (*p) - float64(int32(_r))
sink4 = *p
}
goto _73
_73:
_computeJD(tls, _p)
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64((_r*((*t16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aXformType))+24*uintptr(_17_i))).X4))+_17_rRounder)
sink6 = *p
}
_rc = i32(0)
goto _65
_69:
_17_i += 1
goto _62
_65:
_clearYMD_HMS_TZ(tls, _p)
goto _19
_17:
goto _19
_19:
return _rc
_ = _20_tx
panic(0)
}
// Some systems have stricmp(). Others have strcasecmp(). Because
// there is no consistency, we will define our own.
//
// IMPLEMENTATION-OF: R-30243-02494 The sqlite3_stricmp() and
// sqlite3_strnicmp() APIs allow applications and extensions to compare
// the contents of two buffers containing UTF-8 strings in a
// case-independent fashion, using the same definition of "case
// independence" that SQLite uses internally when comparing identifiers.
func Xsqlite3_stricmp(tls *crt.TLS, _zLeft *int8, _zRight *int8) (r0 int32) {
if _zLeft == nil {
return func() int32 {
if _zRight != nil {
return i32(-1)
}
return i32(0)
}()
}
if _zRight == nil {
return i32(1)
}
return _sqlite3StrICmp(tls, _zLeft, _zRight)
}
// Compute the difference (in milliseconds) between localtime and UTC
// (a.k.a. GMT) for the time value p where p is in UTC. If no error occurs,
// return this value and set *pRc to SQLITE_OK.
//
// Or, if an error does occur, set *pRc to SQLITE_ERROR. The returned value
// is undefined in this case.
func _localtimeOffset(tls *crt.TLS, _p *XDateTime, _pCtx *Xsqlite3_context, _pRc *int32) (r0 int64) {
var _t, _2_s int32
var _sLocal crt.Xtm
var _x, _y XDateTime
crt.Xmemset(tls, (unsafe.Pointer)(&_sLocal), i32(0), u32(44))
_x = *_p
_computeYMD_HMS(tls, &_x)
if ((_x.X1) < i32(1971)) || ((_x.X1) >= i32(2038)) {
*(*int32)(unsafe.Pointer(&(_x.X1))) = i32(2000)
*(*int32)(unsafe.Pointer(&(_x.X2))) = i32(1)
*(*int32)(unsafe.Pointer(&(_x.X3))) = i32(1)
*(*int32)(unsafe.Pointer(&(_x.X4))) = i32(0)
*(*int32)(unsafe.Pointer(&(_x.X5))) = i32(0)
*(*float64)(unsafe.Pointer(&(_x.X7))) = float64(0)
goto _2
}
_2_s = int32((_x.X7) + (0.5))
*(*float64)(unsafe.Pointer(&(_x.X7))) = float64(_2_s)
_2:
*(*int32)(unsafe.Pointer(&(_x.X6))) = i32(0)
*(*int8)(unsafe.Pointer(&(_x.X8))) = int8(i32(0))
_computeJD(tls, &_x)
_t = int32(((_x.X0) / int64(i32(1000))) - i64(210866760000))
if _osLocaltime(tls, &_t, &_sLocal) != 0 {
Xsqlite3_result_error(tls, _pCtx, str(7390), i32(-1))
*_pRc = i32(1)
return int64(i32(0))
}
*(*int32)(unsafe.Pointer(&(_y.X1))) = (_sLocal.X5) + i32(1900)
*(*int32)(unsafe.Pointer(&(_y.X2))) = (_sLocal.X4) + i32(1)
*(*int32)(unsafe.Pointer(&(_y.X3))) = _sLocal.X3
*(*int32)(unsafe.Pointer(&(_y.X4))) = _sLocal.X2
*(*int32)(unsafe.Pointer(&(_y.X5))) = _sLocal.X1
*(*float64)(unsafe.Pointer(&(_y.X7))) = float64(_sLocal.X0)
*(*int8)(unsafe.Pointer(&(_y.X10))) = int8(i32(1))
*(*int8)(unsafe.Pointer(&(_y.X11))) = int8(i32(1))
*(*int8)(unsafe.Pointer(&(_y.X8))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_y.X9))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_y.X12))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_y.X14))) = int8(i32(0))
_computeJD(tls, &_y)
*_pRc = i32(0)
return (_y.X0) - (_x.X0)
_ = _x
_ = _y
_ = _t
_ = _sLocal
panic(0)
}
// Compute both YMD and HMS
func _computeYMD_HMS(tls *crt.TLS, _p *XDateTime) {
_computeYMD(tls, _p)
_computeHMS(tls, _p)
}
// Compute the Year, Month, and Day from the julian day number.
func _computeYMD(tls *crt.TLS, _p *XDateTime) {
var _Z, _A, _B, _C, _D, _E, _X1 int32
if (_p.X10) != 0 {
return
}
if (_p.X8) == 0 {
*(*int32)(unsafe.Pointer(&(_p.X1))) = i32(2000)
*(*int32)(unsafe.Pointer(&(_p.X2))) = i32(1)
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1)
goto _4
}
if _validJulianDay(tls, _p.X0) == 0 {
_datetimeError(tls, _p)
return
}
_Z = int32(((_p.X0) + int64(i32(43200000))) / int64(i32(86400000)))
_A = int32((float64(_Z) - (1.86721625e+06)) / (36524.25))
_A = ((_Z + i32(1)) + _A) - (_A / i32(4))
_B = _A + i32(1524)
_C = int32((float64(_B) - (122.1)) / (365.25))
_D = (i32(36525) * (_C & i32(32767))) / i32(100)
_E = int32(float64(_B-_D) / (30.6001))
_X1 = int32((30.6001) * float64(_E))
*(*int32)(unsafe.Pointer(&(_p.X3))) = (_B - _D) - _X1
*(*int32)(unsafe.Pointer(&(_p.X2))) = func() int32 {
if _E < i32(14) {
return (_E - i32(1))
}
return (_E - i32(13))
}()
*(*int32)(unsafe.Pointer(&(_p.X1))) = func() int32 {
if (_p.X2) > i32(2) {
return (_C - i32(4716))
}
return (_C - i32(4715))
}()
_4:
*(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(1))
}
// Return TRUE if the given julian day number is within range.
//
// The input is the JulianDay times 86400000.
func _validJulianDay(tls *crt.TLS, _iJD int64) (r0 int32) {
return bool2int((_iJD >= int64(i32(0))) && (_iJD <= i64(464269060799999)))
}
// Compute the Hour, Minute, and Seconds from the julian day number.
func _computeHMS(tls *crt.TLS, _p *XDateTime) {
var _s int32
if (_p.X11) != 0 {
return
}
_computeJD(tls, _p)
_s = int32(((_p.X0) + int64(i32(43200000))) % int64(i32(86400000)))
*(*float64)(unsafe.Pointer(&(_p.X7))) = float64(_s) / float64(1000)
_s = int32(_p.X7)
{
p := (*float64)(unsafe.Pointer(&(_p.X7)))
*p = (*p) - float64(_s)
sink4 = *p
}
*(*int32)(unsafe.Pointer(&(_p.X4))) = _s / i32(3600)
{
p := &_s
*p = (*p) - ((_p.X4) * i32(3600))
sink1 = *p
}
*(*int32)(unsafe.Pointer(&(_p.X5))) = _s / i32(60)
{
p := (*float64)(unsafe.Pointer(&(_p.X7)))
*p = (*p) + float64(_s-((_p.X5)*i32(60)))
sink4 = *p
}
*(*int8)(unsafe.Pointer(&(_p.X9))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(1))
}
// The following routine implements the rough equivalent of localtime_r()
// using whatever operating-system specific localtime facility that
// is available. This routine returns 0 on success and
// non-zero on any kind of error.
//
// If the sqlite3GlobalConfig.bLocaltimeFault variable is true then this
// routine will always fail.
//
// EVIDENCE-OF: R-62172-00036 In this implementation, the standard C
// library function localtime_r() is used to assist in the calculation of
// local time.
func _osLocaltime(tls *crt.TLS, _t *int32, _pTm *crt.Xtm) (r0 int32) {
var _rc int32
var _mutex *Xsqlite3_mutex
var _pX *crt.Xtm
_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _mutex)
_pX = crt.Xlocaltime(tls, _t)
if (_sqlite3Config.X38) != 0 {
_pX = nil
}
if _pX != nil {
*_pTm = *_pX
}
Xsqlite3_mutex_leave(tls, _mutex)
_rc = bool2int(_pX == nil)
return _rc
}
func Xsqlite3_result_error(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n int32) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76451), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_errorØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(1)
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _z, _n, uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
var _sqlite3_result_errorØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_errorØ00__func__Ø000[0], str(7413), 21)
}
// Clear the YMD and HMS and the TZ
func _clearYMD_HMS_TZ(tls *crt.TLS, _p *XDateTime) {
*(*int8)(unsafe.Pointer(&(_p.X10))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X11))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_p.X12))) = int8(i32(0))
}
func Xsqlite3_strnicmp(tls *crt.TLS, _zLeft *int8, _zRight *int8, _N int32) (r0 int32) {
var _a, _b *uint8
if _zLeft == nil {
return func() int32 {
if _zRight != nil {
return i32(-1)
}
return i32(0)
}()
}
if _zRight == nil {
return i32(1)
}
_a = (*uint8)(unsafe.Pointer(_zLeft))
_b = (*uint8)(unsafe.Pointer(_zRight))
_5:
if ((postInc1(&_N, int32(-1)) > i32(0)) && (int32(*_a) != i32(0))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b))))) {
*(*uintptr)(unsafe.Pointer(&_a)) += uintptr(1)
*(*uintptr)(unsafe.Pointer(&_b)) += uintptr(1)
goto _5
}
return func() int32 {
if _N < i32(0) {
return i32(0)
}
return (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_a)))) - int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_b)))))
}()
}
var _aXformType [6]struct {
X0 uint8
X1 uint8
X2 *int8
X3 float64
X4 float64
}
func init() {
_aXformType = [6]struct {
X0 uint8
X1 uint8
X2 *int8
X3 float64
X4 float64
}{t16{X0: u8(0), X1: u8(6), X2: str(7434), X3: 4.642690608e+11, X4: 1000}, t16{X0: u8(0), X1: u8(6), X2: str(7441), X3: 7.73781768e+09, X4: 60000}, t16{X0: u8(0), X1: u8(4), X2: str(7448), X3: 1.28963628e+08, X4: 3.6e+06}, t16{X0: u8(0), X1: u8(3), X2: str(7386), X3: 5.373485e+06, X4: 8.64e+07}, t16{X0: u8(1), X1: u8(5), X2: str(7375), X3: 176546, X4: 2.592e+09}, t16{X0: u8(2), X1: u8(4), X2: str(7381), X3: 14713, X4: 3.1536e+10}}
}
func Xsqlite3_result_double(tls *crt.TLS, _pCtx *Xsqlite3_context, _rVal float64) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_doubleØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetDouble(tls, (*XMem)(_pCtx.X0), _rVal)
}
var _sqlite3_result_doubleØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_doubleØ00__func__Ø000[0], str(7453), 22)
}
// Delete any previous value and set the value stored in *pMem to val,
// manifest type REAL.
func _sqlite3VdbeMemSetDouble(tls *crt.TLS, _pMem *XMem, _val float64) {
_sqlite3VdbeMemSetNull(tls, _pMem)
if _sqlite3IsNaN(tls, _val) == 0 {
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(8))
}
}
// Return true if the floating point value is Not a Number (NaN).
//
// Use the math library isnan() function if compiled with SQLITE_HAVE_ISNAN.
// Otherwise, we have our own implementation that works on most systems.
func _sqlite3IsNaN(tls *crt.TLS, _x float64) (r0 int32) {
var _rc int32
var _y, _z float64
_y = _x
_z = _y
_rc = bool2int(_y != _z)
return _rc
}
// date( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD
func _dateFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _x XDateTime
var _1_zBuf [100]int8
if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) {
_computeYMD(tls, &_x)
Xsqlite3_snprintf(tls, int32(u32(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7475), _x.X1, _x.X2, _x.X3)
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
_ = _x
_ = _1_zBuf
}
// time( TIMESTRING, MOD, MOD, ...)
//
// Return HH:MM:SS
func _timeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _x XDateTime
var _1_zBuf [100]int8
if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) {
_computeHMS(tls, &_x)
Xsqlite3_snprintf(tls, int32(u32(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7490), _x.X4, _x.X5, int32(_x.X7))
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
_ = _x
_ = _1_zBuf
}
// datetime( TIMESTRING, MOD, MOD, ...)
//
// Return YYYY-MM-DD HH:MM:SS
func _datetimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _x XDateTime
var _1_zBuf [100]int8
if _isDate(tls, _context, _argc, _argv, &_x) == i32(0) {
_computeYMD_HMS(tls, &_x)
Xsqlite3_snprintf(tls, int32(u32(100)), (*int8)(unsafe.Pointer(&_1_zBuf)), str(7505), _x.X1, _x.X2, _x.X3, _x.X4, _x.X5, int32(_x.X7))
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_1_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
_ = _x
_ = _1_zBuf
}
// strftime( FORMAT, TIMESTRING, MOD, MOD, ...)
//
// Return a string described by FORMAT. Conversions as follows:
//
// %d day of month
// %f ** fractional seconds SS.SSS
// %H hour 00-24
// %j day of year 000-366
// %J ** julian day number
// %m month 01-12
// %M minute 00-59
// %s seconds since 1970-01-01
// %S seconds 00-59
// %w day of week 0-6 sunday==0
// %W week of year 00-53
// %Y year 0000-9999
// %% %
func _strftimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _13_nDay, _14_wd int32
var _i, _j uint32
var _n uint64
var _z, _zFmt *int8
var _12_s float64
var _db *Xsqlite3
var _x, _13_y XDateTime
var _zBuf [100]int8
if _argc == i32(0) {
return
}
_zFmt = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
if (_zFmt == nil) || _isDate(tls, _context, _argc-i32(1), (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv))+uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(4))))))))))), &_x) != 0 {
return
}
_db = Xsqlite3_context_db_handle(tls, _context)
*func() *uint64 { _i = uint32(i32(0)); return &_n }() = uint64(i32(1))
_3:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == 0 {
goto _6
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) != i32(37) {
goto _7
}
switch int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i+uint32(i32(1)))))) {
case i32(37):
goto _15
case i32(72):
goto _9
case i32(74):
goto _20
case i32(77):
goto _9
case i32(83):
goto _9
case i32(87):
goto _9
case i32(89):
goto _19
case i32(100):
goto _9
case i32(102):
goto _17
case i32(106):
goto _18
case i32(109):
goto _9
case i32(115):
goto _20
case i32(119):
goto _15
default:
goto _22
}
_9:
_n += 1
_15:
goto _23
_17:
{
p := &_n
*p = (*p) + uint64(i32(8))
sink17 = *p
}
goto _23
_18:
{
p := &_n
*p = (*p) + uint64(i32(3))
sink17 = *p
}
goto _23
_19:
{
p := &_n
*p = (*p) + uint64(i32(8))
sink17 = *p
}
goto _23
_20:
{
p := &_n
*p = (*p) + uint64(i32(50))
sink17 = *p
}
goto _23
_22:
return
_23:
_i += 1
_7:
*func() *uint64 { _i += 1; return &_n }() += 1
goto _3
_6:
if _n < uint64(u32(100)) {
_z = (*int8)(unsafe.Pointer(&_zBuf))
goto _27
}
if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
Xsqlite3_result_error_toobig(tls, _context)
return
}
_z = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(int32(_n))))
if _z == nil {
Xsqlite3_result_error_nomem(tls, _context)
return
}
_27:
_computeJD(tls, &_x)
_computeYMD_HMS(tls, &_x)
_i = store5(&_j, uint32(i32(0)))
_29:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == 0 {
goto _32
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) != i32(37) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc5(&_j, uint32(1))))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))
goto _34
}
_i += 1
switch int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) {
case i32(72):
goto _38
case i32(74):
goto _41
case i32(77):
goto _43
case i32(83):
goto _45
case i32(87):
goto _39
case i32(89):
goto _47
case i32(100):
goto _36
case i32(102):
goto _37
case i32(106):
goto _39
case i32(109):
goto _42
case i32(115):
goto _44
case i32(119):
goto _46
default:
goto _48
}
_36:
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X3)
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _49
_37:
_12_s = _x.X7
if _12_s > (59.999) {
_12_s = 59.999
}
Xsqlite3_snprintf(tls, i32(7), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7540), _12_s)
{
p := &_j
*p = (*p) + uint32(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j)))))
sink5 = *p
}
goto _49
_38:
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X4)
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _49
_39:
_13_y = _x
*(*int8)(unsafe.Pointer(&(_13_y.X8))) = int8(i32(0))
*(*int32)(unsafe.Pointer(&(_13_y.X2))) = i32(1)
*(*int32)(unsafe.Pointer(&(_13_y.X3))) = i32(1)
_computeJD(tls, &_13_y)
_13_nDay = int32((((_x.X0) - (_13_y.X0)) + int64(i32(43200000))) / int64(i32(86400000)))
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFmt)) + 1*uintptr(_i)))) == i32(87) {
_14_wd = int32((((_x.X0) + int64(i32(43200000))) / int64(i32(86400000))) % int64(i32(7)))
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), ((_13_nDay+i32(7))-_14_wd)/i32(7))
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _52
}
Xsqlite3_snprintf(tls, i32(4), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7547), _13_nDay+i32(1))
{
p := &_j
*p = (*p) + uint32(i32(3))
sink5 = *p
}
_52:
goto _49
_41:
Xsqlite3_snprintf(tls, i32(20), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7552), float64(_x.X0)/(8.64e+07))
{
p := &_j
*p = (*p) + uint32(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j)))))
sink5 = *p
}
goto _49
_42:
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X2)
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _49
_43:
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), _x.X5)
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _49
_44:
Xsqlite3_snprintf(tls, i32(30), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(6348), ((_x.X0)/int64(i32(1000)))-i64(210866760000))
{
p := &_j
*p = (*p) + uint32(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j)))))
sink5 = *p
}
goto _49
_45:
Xsqlite3_snprintf(tls, i32(3), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7535), int32(_x.X7))
{
p := &_j
*p = (*p) + uint32(i32(2))
sink5 = *p
}
goto _49
_46:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc5(&_j, uint32(1))))) = int8(int32(int8((((_x.X0)+int64(i32(129600000)))/int64(i32(86400000)))%int64(i32(7)))) + i32(48))
goto _49
_47:
Xsqlite3_snprintf(tls, i32(5), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j))), str(7558), _x.X1)
{
p := &_j
*p = (*p) + uint32(_sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_j)))))
sink5 = *p
}
goto _49
_48:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc5(&_j, uint32(1))))) = int8(i32(37))
goto _49
_49:
_34:
_i += 1
goto _29
_32:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_j))) = int8(i32(0))
Xsqlite3_result_text(tls, _context, _z, i32(-1), func() func(*crt.TLS, unsafe.Pointer) {
if _z == (*int8)(unsafe.Pointer(&_zBuf)) {
return (*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
return (*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
}())
_ = _zBuf
_ = _13_y
}
// An SQLITE_NOMEM error.
func Xsqlite3_result_error_nomem(tls *crt.TLS, _pCtx *Xsqlite3_context) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_error_nomemØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.X0))
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = _sqlite3NomemError(tls, i32(76578))
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
_sqlite3OomFault(tls, (*Xsqlite3)((*XMem)(_pCtx.X0).X9))
}
var _sqlite3_result_error_nomemØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_error_nomemØ00__func__Ø000[0], str(7563), 27)
}
// current_time()
//
// This function returns the same value as time('now').
func _ctimeFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
_ = _NotUsed2
_timeFunc(tls, _context, i32(0), nil)
}
// current_timestamp()
//
// This function returns the same value as datetime('now').
func _ctimestampFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
_ = _NotUsed2
_datetimeFunc(tls, _context, i32(0), nil)
}
// current_date()
//
// This function returns the same value as date('now').
func _cdateFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
_ = _NotUsed2
_dateFunc(tls, _context, i32(0), nil)
}
var _sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 [60]XFuncDef
func init() {
_sqlite3RegisterBuiltinFunctionsØ00aBuiltinFuncØ001 = [60]XFuncDef{XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_loadExt})), X5: nil, X6: str(7590), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_loadExt})), X5: nil, X6: str(7590), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_compileoptionusedFunc})), X5: nil, X6: str(7605), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_compileoptiongetFunc})), X5: nil, X6: str(7631), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(3073), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7656), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(3073), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7665), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(3073), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7676), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(18433), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7683), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(1)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7692), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(1)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7692), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(2)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7698), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(2)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7698), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(3)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7704), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: (unsafe.Pointer)(uintptr(3)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_trimFunc})), X5: nil, X6: str(7704), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(2081), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_minmaxFunc})), X5: nil, X6: str(7709), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(2081), X2: nil, X3: nil, X4: nil, X5: nil, X6: str(7709), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(4129), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_minmaxStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_minMaxFinalize})), X6: str(7709), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(2081), X2: (unsafe.Pointer)(uintptr(1)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_minmaxFunc})), X5: nil, X6: str(7713), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(2081), X2: (unsafe.Pointer)(uintptr(1)), X3: nil, X4: nil, X5: nil, X6: str(7713), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(4129), X2: (unsafe.Pointer)(uintptr(1)), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_minmaxStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_minMaxFinalize})), X6: str(7713), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2177), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_typeofFunc})), X5: nil, X6: str(7717), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2113), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_lengthFunc})), X5: nil, X6: str(7724), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_instrFunc})), X5: nil, X6: str(7731), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_printfFunc})), X5: nil, X6: str(7737), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_unicodeFunc})), X5: nil, X6: str(7744), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_charFunc})), X5: nil, X6: str(7752), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_absFunc})), X5: nil, X6: str(7757), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_roundFunc})), X5: nil, X6: str(7761), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_roundFunc})), X5: nil, X6: str(7761), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_upperFunc})), X5: nil, X6: str(7767), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_lowerFunc})), X5: nil, X6: str(7773), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_hexFunc})), X5: nil, X6: str(7779), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2561), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7783), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_randomFunc})), X5: nil, X6: str(7790), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_randomBlob})), X5: nil, X6: str(7797), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2081), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_nullifFunc})), X5: nil, X6: str(7808), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7815), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(8193), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_sourceidFunc})), X5: nil, X6: str(7830), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_errlogFunc})), X5: nil, X6: str(7847), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_quoteFunc})), X5: nil, X6: str(7858), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_last_insert_rowid})), X5: nil, X6: str(7864), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_changes})), X5: nil, X6: str(7882), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_total_changes})), X5: nil, X6: str(7890), X7: t12{}}, XFuncDef{X0: i8(3), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_replaceFunc})), X5: nil, X6: str(7904), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_zeroblobFunc})), X5: nil, X6: str(7912), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_substrFunc})), X5: nil, X6: str(7921), X7: t12{}}, XFuncDef{X0: i8(3), X1: u16(2049), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_substrFunc})), X5: nil, X6: str(7921), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_sumStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_sumFinalize})), X6: str(7928), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_sumStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_totalFinalize})), X6: str(7932), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_sumStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_avgFinalize})), X6: str(7938), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(257), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_countStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_countFinalize})), X6: str(7942), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_countStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_countFinalize})), X6: str(7942), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_groupConcatStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_groupConcatFinalize})), X6: str(7948), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_groupConcatStep})), X5: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{_groupConcatFinalize})), X6: str(7948), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2061), X2: unsafe.Pointer(&_globInfo), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_likeFunc})), X5: nil, X6: str(7961), X7: t12{}}, XFuncDef{X0: i8(2), X1: u16(2053), X2: unsafe.Pointer(&_likeInfoNorm), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_likeFunc})), X5: nil, X6: str(7966), X7: t12{}}, XFuncDef{X0: i8(3), X1: u16(2053), X2: unsafe.Pointer(&_likeInfoNorm), X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_likeFunc})), X5: nil, X6: str(7966), X7: t12{}}, XFuncDef{X0: i8(1), X1: u16(2049), X2: nil, X3: nil, X4: nil, X5: nil, X6: str(7971), X7: t12{}}, XFuncDef{X0: i8(0), X1: u16(2049), X2: nil, X3: nil, X4: nil, X5: nil, X6: str(7971), X7: t12{}}, XFuncDef{X0: i8(-1), X1: u16(2561), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_versionFunc})), X5: nil, X6: str(7971), X7: t12{}}}
}
// A function that loads a shared-library extension then returns NULL.
func _loadExt(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _zFile, _zProc, _zErrMsg *int8
var _db *Xsqlite3
_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_db = Xsqlite3_context_db_handle(tls, _context)
_zErrMsg = nil
if ((_db.X6) & i32(8388608)) == i32(0) {
Xsqlite3_result_error(tls, _context, str(7980), i32(-1))
return
}
if _argc == i32(2) {
_zProc = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))))
goto _2
}
_zProc = nil
_2:
if (_zFile != nil) && Xsqlite3_load_extension(tls, _db, _zFile, _zProc, &_zErrMsg) != 0 {
Xsqlite3_result_error(tls, _context, _zErrMsg, i32(-1))
Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg))
}
}
func Xsqlite3_load_extension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
var _rc int32
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_rc = _sqlite3LoadExtension(tls, _db, _zFile, _zProc, _pzErrMsg)
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// Attempt to load an SQLite extension library contained in the file
// zFile. The entry point is zProc. zProc may be 0 in which case a
// default entry point name (sqlite3_extension_init) is used. Use
// of the default name is recommended.
//
// Return SQLITE_OK on success and SQLITE_ERROR if something goes wrong.
//
// If an error occurs and pzErrMsg is not 0, then fill *pzErrMsg with
// error message text. The calling function should free this memory
// by calling sqlite3DbFree(db, ).
func _sqlite3LoadExtension(tls *crt.TLS, _db *Xsqlite3, _zFile *int8, _zProc *int8, _pzErrMsg **int8) (r0 int32) {
var _ii, _rc, _7_iFile, _7_iEntry, _7_c, _7_ncFile int32
var _nMsg uint64
var _zErrmsg, _zEntry, _zAltEntry, _3_zAltFile *int8
var _handle unsafe.Pointer
var _aHandle *unsafe.Pointer
var _pVfs *Xsqlite3_vfs
var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
_pVfs = (*Xsqlite3_vfs)(_db.X0)
_zErrmsg = nil
_zAltEntry = nil
_nMsg = uint64(i32(300) + _sqlite3Strlen30(tls, _zFile))
if _pzErrMsg != nil {
*_pzErrMsg = nil
}
if ((_db.X6) & i32(4194304)) != i32(0) {
goto _1
}
if _pzErrMsg != nil {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(7980))
}
return i32(1)
_1:
_zEntry = func() *int8 {
if _zProc != nil {
return _zProc
}
return str(7995)
}()
_handle = _sqlite3OsDlOpen(tls, _pVfs, _zFile)
_ii = i32(0)
_5:
if _ii >= i32(1) || _handle != nil {
goto _9
}
_3_zAltFile = Xsqlite3_mprintf(tls, str(8018), unsafe.Pointer(_zFile), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LoadExtensionØ00azEndingsØ001)) + 4*uintptr(_ii)))))
if _3_zAltFile == nil {
return _sqlite3NomemError(tls, i32(112306))
}
_handle = _sqlite3OsDlOpen(tls, _pVfs, _3_zAltFile)
Xsqlite3_free(tls, (unsafe.Pointer)(_3_zAltFile))
_ii += 1
goto _5
_9:
if _handle != nil {
goto _11
}
if _pzErrMsg == nil {
goto _12
}
*_pzErrMsg = store0(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
if _zErrmsg != nil {
Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(8024), unsafe.Pointer(_zFile))
_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(i32(1))), _zErrmsg)
}
_12:
return i32(1)
_11:
_xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)}))
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
}{_xInit})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
}{nil})) || _zProc != nil {
goto _15
}
_7_ncFile = _sqlite3Strlen30(tls, _zFile)
_zAltEntry = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_ncFile+i32(30))))
if _zAltEntry == nil {
_sqlite3OsDlClose(tls, _pVfs, _handle)
return _sqlite3NomemError(tls, i32(112341))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_zAltEntry), (unsafe.Pointer)(str(8059)), uint32(i32(8)))
_7_iFile = _7_ncFile - i32(1)
_17:
if _7_iFile < i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_7_iFile)))) == i32(47) {
goto _21
}
_7_iFile -= 1
goto _17
_21:
_7_iFile += 1
if Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zFile))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_7_iFile))))))), str(8068), i32(3)) == i32(0) {
{
p := &_7_iFile
*p = (*p) + i32(3)
sink1 = *p
}
}
_7_iEntry = i32(8)
_23:
if store1(&_7_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_7_iFile))))) == i32(0) || _7_c == i32(46) {
goto _27
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_7_c))))) & i32(2)) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAltEntry)) + 1*uintptr(postInc1(&_7_iEntry, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint32(_7_c)))))
}
_7_iFile += 1
goto _23
_27:
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zAltEntry))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_7_iEntry)))))))), (unsafe.Pointer)(str(8072)), uint32(i32(6)))
_zEntry = _zAltEntry
_xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_sqlite3OsDlSym(tls, _pVfs, _handle, _zEntry)}))
_15:
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
}{_xInit})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
}{nil})) {
goto _29
}
if _pzErrMsg == nil {
goto _30
}
{
p := &_nMsg
*p = (*p) + uint64(_sqlite3Strlen30(tls, _zEntry))
sink17 = *p
}
*_pzErrMsg = store0(&_zErrmsg, (*int8)(Xsqlite3_malloc64(tls, _nMsg)))
if _zErrmsg != nil {
Xsqlite3_snprintf(tls, int32(_nMsg), _zErrmsg, str(8078), unsafe.Pointer(_zEntry), unsafe.Pointer(_zFile))
_sqlite3OsDlError(tls, _pVfs, int32(_nMsg-uint64(i32(1))), _zErrmsg)
}
_30:
_sqlite3OsDlClose(tls, _pVfs, _handle)
Xsqlite3_free(tls, (unsafe.Pointer)(_zAltEntry))
return i32(1)
_29:
Xsqlite3_free(tls, (unsafe.Pointer)(_zAltEntry))
_rc = _xInit(tls, _db, &_zErrmsg, &_sqlite3Apis)
if _rc == 0 {
goto _32
}
if _rc == i32(256) {
return i32(0)
}
if _pzErrMsg != nil {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(8121), unsafe.Pointer(_zErrmsg))
}
Xsqlite3_free(tls, (unsafe.Pointer)(_zErrmsg))
_sqlite3OsDlClose(tls, _pVfs, _handle)
return i32(1)
_32:
_aHandle = (*unsafe.Pointer)(_sqlite3DbMallocZero(tls, _db, uint64(u32(4)*uint32((_db.X39)+i32(1)))))
if _aHandle == nil {
return _sqlite3NomemError(tls, i32(112385))
}
if (_db.X39) > i32(0) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_aHandle), (unsafe.Pointer)(_db.X40), u32(4)*uint32(_db.X39))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_db.X40))
*(**unsafe.Pointer)(unsafe.Pointer(&(_db.X40))) = _aHandle
*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X40)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_db.X39))), int32(1))))) = _handle
return i32(0)
}
// Print into memory obtained from sqlite3_malloc()(). Omit the internal
// %-conversion extensions.
func Xsqlite3_mprintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) (r0 *int8) {
var _z *int8
var _ap []interface{}
if Xsqlite3_initialize(tls) != 0 {
return nil
}
_ap = args
_z = Xsqlite3_vmprintf(tls, _zFormat, _ap)
_ap = nil
return _z
}
// Print into memory obtained from sqlite3_malloc(). Omit the internal
// %-conversion extensions.
func Xsqlite3_vmprintf(tls *crt.TLS, _zFormat *int8, _ap []interface{}) (r0 *int8) {
var _z *int8
var _acc XStrAccum
var _zBase [70]int8
if _zFormat == nil {
_sqlite3MisuseError(tls, i32(26040))
return nil
}
if Xsqlite3_initialize(tls) != 0 {
return nil
}
_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(u32(70)), i32(1000000000))
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
_z = _sqlite3StrAccumFinish(tls, &_acc)
return _z
_ = _zBase
_ = _acc
panic(0)
}
func _sqlite3OsDlOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8) (r0 unsafe.Pointer) {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer
}{(_pVfs.X10)})))(tls, _pVfs, _zPath)
}
var _sqlite3LoadExtensionØ00azEndingsØ001 [1]*int8
func init() {
_sqlite3LoadExtensionØ00azEndingsØ001 = [1]*int8{str(8153)}
}
func Xsqlite3_malloc64(tls *crt.TLS, _n uint64) (r0 unsafe.Pointer) {
if Xsqlite3_initialize(tls) != 0 {
return nil
}
return _sqlite3Malloc(tls, _n)
}
func _sqlite3OsDlError(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) {
(*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8)
}{(_pVfs.X11)})))(tls, _pVfs, _nByte, _zBufOut)
}
func _sqlite3OsDlSym(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHdle unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS)
}{(_pVfs.X12)})))(tls, _pVfs, _pHdle, _zSym)
}
func _sqlite3OsDlClose(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
(*(*func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
}{(_pVfs.X13)})))(tls, _pVfs, _pHandle)
}
var _sqlite3Apis Xsqlite3_api_routines
func init() {
_sqlite3Apis = Xsqlite3_api_routines{X0: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
}{Xsqlite3_aggregate_context})), X1: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context) int32
}{Xsqlite3_aggregate_count})), X2: Xsqlite3_bind_blob, X3: Xsqlite3_bind_double, X4: Xsqlite3_bind_int, X5: Xsqlite3_bind_int64, X6: Xsqlite3_bind_null, X7: Xsqlite3_bind_parameter_count, X8: Xsqlite3_bind_parameter_index, X9: Xsqlite3_bind_parameter_name, X10: Xsqlite3_bind_text, X11: Xsqlite3_bind_text16, X12: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *XMem) int32
}{Xsqlite3_bind_value})), X13: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
}{Xsqlite3_busy_handler})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32) int32
}{Xsqlite3_busy_timeout})), X15: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_changes})), X16: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_close})), X17: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) int32
}{Xsqlite3_collation_needed})), X18: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) int32
}{Xsqlite3_collation_needed16})), X19: Xsqlite3_column_blob, X20: Xsqlite3_column_bytes, X21: Xsqlite3_column_bytes16, X22: Xsqlite3_column_count, X23: nil, X24: nil, X25: Xsqlite3_column_decltype, X26: Xsqlite3_column_decltype16, X27: Xsqlite3_column_double, X28: Xsqlite3_column_int, X29: Xsqlite3_column_int64, X30: Xsqlite3_column_name, X31: Xsqlite3_column_name16, X32: nil, X33: nil, X34: nil, X35: nil, X36: Xsqlite3_column_text, X37: Xsqlite3_column_text16, X38: Xsqlite3_column_type, X39: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) *XMem
}{Xsqlite3_column_value})), X40: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_commit_hook})), X41: Xsqlite3_complete, X42: Xsqlite3_complete16, X43: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
}{Xsqlite3_create_collation})), X44: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
}{Xsqlite3_create_collation16})), X45: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context)) int32
}{Xsqlite3_create_function})), X46: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context)) int32
}{Xsqlite3_create_function16})), X47: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer) int32
}{Xsqlite3_create_module})), X48: Xsqlite3_data_count, X49: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) *Xsqlite3
}{Xsqlite3_db_handle})), X50: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8) int32
}{Xsqlite3_declare_vtab})), X51: Xsqlite3_enable_shared_cache, X52: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_errcode})), X53: *(*func(*crt.TLS, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) *int8
}{Xsqlite3_errmsg})), X54: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) unsafe.Pointer
}{Xsqlite3_errmsg16})), X55: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
}{Xsqlite3_exec})), X56: Xsqlite3_expired, X57: Xsqlite3_finalize, X58: Xsqlite3_free, X59: Xsqlite3_free_table, X60: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_get_autocommit})), X61: *(*func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32) unsafe.Pointer
}{Xsqlite3_get_auxdata})), X62: *(*func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, ***int8, *int32, *int32, **int8) int32
}{Xsqlite3_get_table})), X63: nil, X64: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f func(*crt.TLS, *Xsqlite3) }{Xsqlite3_interrupt})), X65: *(*func(*crt.TLS, unsafe.Pointer) int64)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int64
}{Xsqlite3_last_insert_rowid})), X66: Xsqlite3_libversion, X67: Xsqlite3_libversion_number, X68: Xsqlite3_malloc, X69: Xsqlite3_mprintf, X70: *(*func(*crt.TLS, *int8, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, **Xsqlite3) int32
}{Xsqlite3_open})), X71: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, **Xsqlite3) int32
}{Xsqlite3_open16})), X72: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
}{Xsqlite3_prepare})), X73: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
}{Xsqlite3_prepare16})), X74: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_profile})), X75: *(*func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
}{Xsqlite3_progress_handler})), X76: Xsqlite3_realloc, X77: Xsqlite3_reset, X78: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_blob})), X79: *(*func(*crt.TLS, unsafe.Pointer, float64))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, float64)
}{Xsqlite3_result_double})), X80: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, *int8, int32)
}{Xsqlite3_result_error})), X81: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32)
}{Xsqlite3_result_error16})), X82: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32)
}{Xsqlite3_result_int})), X83: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int64)
}{Xsqlite3_result_int64})), X84: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{Xsqlite3_result_null})), X85: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, *int8, int32, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_text})), X86: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_text16})), X87: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_text16be})), X88: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_text16le})), X89: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, *XMem)
}{Xsqlite3_result_value})), X90: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_rollback_hook})), X91: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
}{Xsqlite3_set_authorizer})), X92: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_set_auxdata})), X93: Xsqlite3_snprintf, X94: Xsqlite3_step, X95: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
}{Xsqlite3_table_column_metadata})), X96: Xsqlite3_thread_cleanup, X97: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_total_changes})), X98: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_trace})), X99: Xsqlite3_transfer_bindings, X100: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_update_hook})), X101: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context) unsafe.Pointer
}{Xsqlite3_user_data})), X102: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XMem) unsafe.Pointer
}{Xsqlite3_value_blob})), X103: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_bytes})), X104: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_bytes16})), X105: *(*func(*crt.TLS, unsafe.Pointer) float64)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) float64 }{Xsqlite3_value_double})), X106: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_int})), X107: *(*func(*crt.TLS, unsafe.Pointer) int64)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int64 }{Xsqlite3_value_int64})), X108: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_numeric_type})), X109: *(*func(*crt.TLS, unsafe.Pointer) *uint8)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), X110: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XMem) unsafe.Pointer
}{Xsqlite3_value_text16})), X111: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XMem) unsafe.Pointer
}{Xsqlite3_value_text16be})), X112: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XMem) unsafe.Pointer
}{Xsqlite3_value_text16le})), X113: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) int32 }{Xsqlite3_value_type})), X114: *(*func(*crt.TLS, *int8, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, []interface{}) *int8
}{Xsqlite3_vmprintf})), X115: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32) int32
}{Xsqlite3_overload_function})), X116: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, *unsafe.Pointer, **int8) int32
}{Xsqlite3_prepare_v2})), X117: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
}{Xsqlite3_prepare16_v2})), X118: Xsqlite3_clear_bindings, X119: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3_module, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
}{Xsqlite3_create_module_v2})), X120: Xsqlite3_bind_zeroblob, X121: Xsqlite3_blob_bytes, X122: Xsqlite3_blob_close, X123: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
}{Xsqlite3_blob_open})), X124: Xsqlite3_blob_read, X125: Xsqlite3_blob_write, X126: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32
}{Xsqlite3_create_collation_v2})), X127: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, unsafe.Pointer) int32
}{Xsqlite3_file_control})), X128: Xsqlite3_memory_highwater, X129: Xsqlite3_memory_used, X130: *(*func(*crt.TLS, int32) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) *Xsqlite3_mutex
}{Xsqlite3_mutex_alloc})), X131: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{Xsqlite3_mutex_enter})), X132: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{Xsqlite3_mutex_free})), X133: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex)
}{Xsqlite3_mutex_leave})), X134: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_mutex) int32
}{Xsqlite3_mutex_try})), X135: *(*func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, **Xsqlite3, int32, *int8) int32
}{Xsqlite3_open_v2})), X136: Xsqlite3_release_memory, X137: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{Xsqlite3_result_error_nomem})), X138: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{Xsqlite3_result_error_toobig})), X139: Xsqlite3_sleep, X140: Xsqlite3_soft_heap_limit, X141: *(*func(*crt.TLS, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8) *Xsqlite3_vfs
}{Xsqlite3_vfs_find})), X142: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
}{Xsqlite3_vfs_register})), X143: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs) int32
}{Xsqlite3_vfs_unregister})), X144: Xsqlite3_threadsafe, X145: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32)
}{Xsqlite3_result_zeroblob})), X146: *(*func(*crt.TLS, unsafe.Pointer, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32)
}{Xsqlite3_result_error_code})), X147: Xsqlite3_test_control, X148: Xsqlite3_randomness, X149: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context) *Xsqlite3
}{Xsqlite3_context_db_handle})), X150: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32) int32
}{Xsqlite3_extended_result_codes})), X151: *(*func(*crt.TLS, unsafe.Pointer, int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32, int32) int32
}{Xsqlite3_limit})), X152: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_next_stmt})), X153: Xsqlite3_sql, X154: Xsqlite3_status, X155: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_backup) int32
}{Xsqlite3_backup_finish})), X156: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *Xsqlite3, *int8) *Xsqlite3_backup
}{Xsqlite3_backup_init})), X157: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_backup) int32
}{Xsqlite3_backup_pagecount})), X158: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_backup) int32
}{Xsqlite3_backup_remaining})), X159: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_backup, int32) int32
}{Xsqlite3_backup_step})), X160: Xsqlite3_compileoption_get, X161: Xsqlite3_compileoption_used, X162: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context, int32, **XMem), func(*crt.TLS, *Xsqlite3_context), func(*crt.TLS, unsafe.Pointer)) int32
}{Xsqlite3_create_function_v2})), X163: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
}{Xsqlite3_db_config})), X164: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) *Xsqlite3_mutex
}{Xsqlite3_db_mutex})), X165: *(*func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32, *int32, *int32, int32) int32
}{Xsqlite3_db_status})), X166: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_extended_errcode})), X167: Xsqlite3_log, X168: Xsqlite3_soft_heap_limit64, X169: Xsqlite3_sourceid, X170: Xsqlite3_stmt_status, X171: Xsqlite3_strnicmp, X172: nil, X173: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32) int32
}{Xsqlite3_wal_autocheckpoint})), X174: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8) int32
}{Xsqlite3_wal_checkpoint})), X175: *(*func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
}{Xsqlite3_wal_hook})), X176: Xsqlite3_blob_reopen, X177: *(*func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int32, ...interface{}) int32
}{Xsqlite3_vtab_config})), X178: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_vtab_on_conflict})), X179: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_close_v2})), X180: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8) *int8
}{Xsqlite3_db_filename})), X181: *(*func(*crt.TLS, unsafe.Pointer, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8) int32
}{Xsqlite3_db_readonly})), X182: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_db_release_memory})), X183: Xsqlite3_errstr, X184: Xsqlite3_stmt_busy, X185: Xsqlite3_stmt_readonly, X186: Xsqlite3_stricmp, X187: Xsqlite3_uri_boolean, X188: Xsqlite3_uri_int64, X189: Xsqlite3_uri_parameter, X190: *(*func(*crt.TLS, int32, *int8, *int8, unsafe.Pointer) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, *int8, *int8, []interface{}) *int8
}{Xsqlite3_vsnprintf})), X191: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, int32, *int32, *int32) int32
}{Xsqlite3_wal_checkpoint_v2})), X192: Xsqlite3_auto_extension, X193: Xsqlite3_bind_blob64, X194: Xsqlite3_bind_text64, X195: Xsqlite3_cancel_auto_extension, X196: *(*func(*crt.TLS, unsafe.Pointer, *int8, *int8, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, *int8, *int8, **int8) int32
}{Xsqlite3_load_extension})), X197: Xsqlite3_malloc64, X198: Xsqlite3_msize, X199: Xsqlite3_realloc64, X200: Xsqlite3_reset_auto_extension, X201: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer)))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
}{Xsqlite3_result_blob64})), X202: *(*func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
}{Xsqlite3_result_text64})), X203: Xsqlite3_strglob, X204: *(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *XMem }{Xsqlite3_value_dup})), X205: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) }{Xsqlite3_value_free})), X206: *(*func(*crt.TLS, unsafe.Pointer, uint64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, uint64) int32
}{Xsqlite3_result_zeroblob64})), X207: Xsqlite3_bind_zeroblob64, X208: *(*func(*crt.TLS, unsafe.Pointer) uint32)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) uint32 }{Xsqlite3_value_subtype})), X209: *(*func(*crt.TLS, unsafe.Pointer, uint32))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, uint32)
}{Xsqlite3_result_subtype})), X210: Xsqlite3_status64, X211: Xsqlite3_strlike, X212: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_db_cacheflush})), X213: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3) int32
}{Xsqlite3_system_errno})), X214: *(*func(*crt.TLS, unsafe.Pointer, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
}{Xsqlite3_trace_v2})), X215: Xsqlite3_expanded_sql, X216: *(*func(*crt.TLS, unsafe.Pointer, int64))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, int64)
}{Xsqlite3_set_last_insert_rowid}))}
}
// Allocate or return the aggregate context for a user function. A new
// context is allocated on the first call. Subsequent calls return the
// same context that was returned on prior calls.
func Xsqlite3_aggregate_context(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
func() {
if _p == nil || (*XFuncDef)(_p.X1) == nil || (*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*XFuncDef)(_p.X1).X5)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76890), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_aggregate_contextØ00__func__Ø000))), unsafe.Pointer(str(8156)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_p.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_aggregate_contextØ00__func__Ø000))), unsafe.Pointer(str(8193)))
crt.X__builtin_abort(tls)
}
}()
if (int32((*XMem)(_p.X2).X1) & i32(8192)) == i32(0) {
return _createAggContext(tls, _p, _nByte)
}
return (unsafe.Pointer)((*XMem)(_p.X2).X5)
}
var _sqlite3_aggregate_contextØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_aggregate_contextØ00__func__Ø000[0], str(8232), 26)
}
// Create a new aggregate context for p and return a pointer to
// its pMem->z element.
func _createAggContext(tls *crt.TLS, _p *Xsqlite3_context, _nByte int32) (r0 unsafe.Pointer) {
var _pMem *XMem
_pMem = (*XMem)(_p.X2)
func() {
if (int32(_pMem.X1) & i32(8192)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76869), unsafe.Pointer((*int8)(unsafe.Pointer(&_createAggContextØ00__func__Ø000))), unsafe.Pointer(str(8258)))
crt.X__builtin_abort(tls)
}
}()
if _nByte <= i32(0) {
_sqlite3VdbeMemSetNull(tls, _pMem)
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil
goto _3
}
_sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(8192))
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))) = (*XFuncDef)(_p.X1)
if (_pMem.X5) != nil {
crt.Xmemset(tls, (unsafe.Pointer)(_pMem.X5), i32(0), uint32(_nByte))
}
_3:
return (unsafe.Pointer)(_pMem.X5)
}
var _createAggContextØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_createAggContextØ00__func__Ø000[0], str(8285), 17)
}
// Return the number of times the Step function of an aggregate has been
// called.
//
// This function is deprecated. Do not use it for new code. It is
// provide only to avoid breaking legacy code. New aggregate function
// implementations should keep their own counts within their aggregate
// context.
func Xsqlite3_aggregate_count(tls *crt.TLS, _p *Xsqlite3_context) (r0 int32) {
func() {
if _p == nil || (*XMem)(_p.X2) == nil || (*XFuncDef)(_p.X1) == nil || (*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*XFuncDef)(_p.X1).X5)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_aggregate_countØ00__func__Ø000))), unsafe.Pointer(str(8302)))
crt.X__builtin_abort(tls)
}
}()
return (*XMem)(_p.X2).X4
}
var _sqlite3_aggregate_countØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_aggregate_countØ00__func__Ø000[0], str(8350), 24)
}
// Bind a blob value to an SQL statement variable.
func Xsqlite3_bind_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
if _nData < i32(0) {
return _sqlite3MisuseError(tls, i32(77424))
}
return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(i32(0)))
}
// Bind a text or BLOB value.
func _bindText(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer), _encoding uint8) (r0 int32) {
var _rc int32
var _p *TVdbe
var _pVar *XMem
_p = (*TVdbe)(_pStmt)
_rc = _vdbeUnbind(tls, _p, _i)
if _rc != i32(0) {
goto _0
}
if _zData == nil {
goto _1
}
_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 48*uintptr(_i-i32(1))))
_rc = _sqlite3VdbeMemSetStr(tls, _pVar, (*int8)(_zData), _nData, _encoding, _xDel)
if (_rc == i32(0)) && (int32(_encoding) != i32(0)) {
_rc = _sqlite3VdbeChangeEncoding(tls, _pVar, int32((*Xsqlite3)(_p.X0).X14))
}
_sqlite3Error(tls, (*Xsqlite3)(_p.X0), _rc)
_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _rc)
_1:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
goto _6
_0:
if (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil}))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))}))) {
_xDel(tls, _zData)
}
_6:
return _rc
}
// ****************************** sqlite3_bind_ ***************************
//
// Routines used to attach values to wildcards in a compiled SQL statement.
// Unbind the value bound to variable i in virtual machine p. This is the
// the same as binding a NULL value to the column. If the "i" parameter is
// out of range, then SQLITE_RANGE is returned. Othewise SQLITE_OK.
//
// A successful evaluation of this routine acquires the mutex on p.
// the mutex is released if any kind of error occurs.
//
// The error code stored in database p->db is overwritten with the return
// value in any case.
func _vdbeUnbind(tls *crt.TLS, _p *TVdbe, _i int32) (r0 int32) {
var _pVar *XMem
if _vdbeSafetyNotNull(tls, _p) != 0 {
return _sqlite3MisuseError(tls, i32(77342))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
if ((_p.X5) != uint32(i32(770837923))) || ((_p.X9) >= i32(0)) {
_sqlite3Error(tls, (*Xsqlite3)(_p.X0), i32(21))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
Xsqlite3_log(tls, i32(21), str(8374), unsafe.Pointer(_p.X36))
return _sqlite3MisuseError(tls, i32(77350))
}
if (_i < i32(1)) || (_i > int32(_p.X4)) {
_sqlite3Error(tls, (*Xsqlite3)(_p.X0), i32(25))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
return i32(25)
}
_i -= 1
_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 48*uintptr(_i)))
_sqlite3VdbeMemRelease(tls, _pVar)
*(*uint16)(unsafe.Pointer(&(_pVar.X1))) = uint16(i32(1))
_sqlite3Error(tls, (*Xsqlite3)(_p.X0), i32(0))
func() {
if ((uint32((_p.X32)>>uint(i32(9)))<>uint(i32(31))) == 0 && (_p.X41) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77372), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeUnbindØ00__func__Ø000))), unsafe.Pointer(str(8414)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X41) != uint32(i32(0))) && (((_p.X41) & func() uint32 {
if _i >= i32(31) {
return u32(2147483648)
}
return (u32(1) << uint(_i))
}()) != uint32(i32(0))) {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
}
return i32(0)
}
func _vdbeSafetyNotNull(tls *crt.TLS, _p *TVdbe) (r0 int32) {
if _p == nil {
Xsqlite3_log(tls, i32(21), str(8446))
return i32(1)
}
return _vdbeSafety(tls, _p)
}
// Check on a Vdbe to make sure it has not been finalized. Log
// an error and return true if it has been finalized (or is otherwise
// invalid). Return false if it is ok.
func _vdbeSafety(tls *crt.TLS, _p *TVdbe) (r0 int32) {
if (*Xsqlite3)(_p.X0) == nil {
Xsqlite3_log(tls, i32(21), str(8486))
return i32(1)
}
return i32(0)
}
// 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 _sqlite3Error(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ErrorØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_db.X10))) = _err_code
if _err_code != 0 || ((*XMem)(_db.X56) != nil) {
_sqlite3ErrorFinish(tls, _db, _err_code)
}
}
var _sqlite3ErrorØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ErrorØ00__func__Ø000[0], str(8531), 13)
}
// Helper function for sqlite3Error() - called rarely. Broken out into
// a separate routine to avoid unnecessary register saves on entry to
// sqlite3Error().
func _sqlite3ErrorFinish(tls *crt.TLS, _db *Xsqlite3, _err_code int32) {
if (*XMem)(_db.X56) != nil {
_sqlite3ValueSetNull(tls, (*XMem)(_db.X56))
}
_sqlite3SystemError(tls, _db, _err_code)
}
func _sqlite3ValueSetNull(tls *crt.TLS, _p *XMem) {
_sqlite3VdbeMemSetNull(tls, _p)
}
// Load the sqlite3.iSysErrno field if that is an appropriate thing
// to do based on the SQLite error code in rc.
func _sqlite3SystemError(tls *crt.TLS, _db *Xsqlite3, _rc int32) {
if _rc == i32(3082) {
return
}
{
p := &_rc
*p = (*p) & i32(255)
sink1 = *p
}
if (_rc == i32(14)) || (_rc == i32(10)) {
*(*int32)(unsafe.Pointer(&(_db.X12))) = _sqlite3OsGetLastError(tls, (*Xsqlite3_vfs)(_db.X0))
}
}
func _sqlite3OsGetLastError(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
return func() int32 {
if (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
}{(_pVfs.X17)}))) != nil {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
}{(_pVfs.X17)})))(tls, _pVfs, i32(0), nil)
}
return i32(0)
}()
}
var _vdbeUnbindØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_vdbeUnbindØ00__func__Ø000[0], str(8544), 11)
}
// 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 _sqlite3ApiExit(tls *crt.TLS, _db *Xsqlite3, _rc int32) (r0 int32) {
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25050), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25051), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ApiExitØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X17) != 0) || (_rc == i32(3082)) {
return _apiOomError(tls, _db)
}
return _rc & (_db.X11)
}
var _sqlite3ApiExitØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ApiExitØ00__func__Ø000[0], str(8555), 15)
}
// Take actions at the end of an API call to indicate an OOM error
func _apiOomError(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
_sqlite3OomClear(tls, _db)
_sqlite3Error(tls, _db, i32(7))
return _sqlite3NomemError(tls, i32(25030))
}
// 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 _sqlite3OomClear(tls *crt.TLS, _db *Xsqlite3) {
if ((_db.X17) != 0) && ((_db.X37) == i32(0)) {
*(*uint8)(unsafe.Pointer(&(_db.X17))) = uint8(i32(0))
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0)
func() {
if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25019), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OomClearØ00__func__Ø000))), unsafe.Pointer(str(8570)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1
}
}
var _sqlite3OomClearØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OomClearØ00__func__Ø000[0], str(8595), 16)
}
func Xsqlite3_bind_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _rValue float64) (r0 int32) {
var _rc int32
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
_rc = _vdbeUnbind(tls, _p, _i)
if _rc == i32(0) {
_sqlite3VdbeMemSetDouble(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X24)+48*uintptr(_i-i32(1)))), _rValue)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
return _rc
}
func Xsqlite3_bind_int(tls *crt.TLS, _p unsafe.Pointer, _i int32, _iValue int32) (r0 int32) {
return Xsqlite3_bind_int64(tls, _p, _i, int64(_iValue))
}
func Xsqlite3_bind_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _iValue int64) (r0 int32) {
var _rc int32
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
_rc = _vdbeUnbind(tls, _p, _i)
if _rc == i32(0) {
_sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X24)+48*uintptr(_i-i32(1)))), _iValue)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
return _rc
}
// Delete any previous value and set the value stored in *pMem to val,
// manifest type INTEGER.
func _sqlite3VdbeMemSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
if (int32(_pMem.X1) & i32(9312)) != i32(0) {
_vdbeReleaseAndSetInt64(tls, _pMem, _val)
goto _1
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
_1:
}
// The pMem is known to contain content that needs to be destroyed prior
// to a value change. So invoke the destructor, then set the value to
// a 64-bit integer.
func _vdbeReleaseAndSetInt64(tls *crt.TLS, _pMem *XMem, _val int64) {
_sqlite3VdbeMemSetNull(tls, _pMem)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _val
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
}
func Xsqlite3_bind_null(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
var _rc int32
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
_rc = _vdbeUnbind(tls, _p, _i)
if _rc == i32(0) {
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
return _rc
}
// Return the number of wildcards that can be potentially bound to.
// This routine is added to support DBD::SQLite.
func Xsqlite3_bind_parameter_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
return func() int32 {
if _p != nil {
return int32(_p.X4)
}
return i32(0)
}()
}
func Xsqlite3_bind_parameter_index(tls *crt.TLS, _pStmt unsafe.Pointer, _zName *int8) (r0 int32) {
return _sqlite3VdbeParameterIndex(tls, (*TVdbe)(_pStmt), _zName, _sqlite3Strlen30(tls, _zName))
}
// Given a wildcard parameter name, return the index of the variable
// with that name. If there is no variable with the given name,
// return 0.
func _sqlite3VdbeParameterIndex(tls *crt.TLS, _p *TVdbe, _zName *int8, _nName int32) (r0 int32) {
if (_p == nil) || (_zName == nil) {
return i32(0)
}
return _sqlite3VListNameToNum(tls, _p.X25, _zName, _nName)
}
// Return the number of the variable named zName, if it is in VList.
// or return 0 if there is no such variable.
func _sqlite3VListNameToNum(tls *crt.TLS, _pIn *int32, _zName *int8, _nName int32) (r0 int32) {
var _i, _mx int32
var _1_z *int8
if _pIn == nil {
return i32(0)
}
_mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1))))
_i = i32(2)
_1:
_1_z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2))))))
if (crt.Xstrncmp(tls, _1_z, _zName, uint32(_nName)) == i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(_nName)))) == i32(0)) {
return *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i)))
}
{
p := &_i
*p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1)))))
sink1 = *p
}
if _i < _mx {
goto _1
}
return i32(0)
}
// Return the name of a wildcard parameter. Return NULL if the index
// is out of range or if the wildcard is unnamed.
//
// The result is always UTF-8.
func Xsqlite3_bind_parameter_name(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *int8) {
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
if _p == nil {
return nil
}
return _sqlite3VListNumToName(tls, _p.X25, _i)
}
// Return a pointer to the name of a variable in the given VList that
// has the value iVal. Or return a NULL if there is no such variable in
// the list
func _sqlite3VListNumToName(tls *crt.TLS, _pIn *int32, _iVal int32) (r0 *int8) {
var _i, _mx int32
if _pIn == nil {
return nil
}
_mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1))))
_i = i32(2)
_1:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i)))) == _iVal {
return (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2))))))
}
{
p := &_i
*p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1)))))
sink1 = *p
}
if _i < _mx {
goto _1
}
return nil
}
func Xsqlite3_bind_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
return _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_zData), _nData, _xDel, uint8(i32(1)))
}
func Xsqlite3_bind_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
return _bindText(tls, _pStmt, _i, _zData, _nData, _xDel, uint8(i32(2)))
}
// SQLITE_OMIT_UTF16
func Xsqlite3_bind_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _pValue *XMem) (r0 int32) {
var _rc int32
switch Xsqlite3_value_type(tls, _pValue) {
case i32(1):
goto _1
case i32(2):
goto _2
case i32(3):
goto _4
case i32(4):
goto _3
default:
goto _5
}
_1:
_rc = Xsqlite3_bind_int64(tls, _pStmt, _i, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0))))))
goto _6
_2:
_rc = Xsqlite3_bind_double(tls, _pStmt, _i, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0))))))
goto _6
_3:
if (int32(_pValue.X1) & i32(16384)) != 0 {
_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pValue.X0))))))
goto _8
}
_rc = Xsqlite3_bind_blob(tls, _pStmt, _i, (unsafe.Pointer)(_pValue.X5), _pValue.X4, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_8:
goto _6
_4:
_rc = _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_pValue.X5), _pValue.X4, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})), _pValue.X2)
goto _6
_5:
_rc = Xsqlite3_bind_null(tls, _pStmt, _i)
goto _6
_6:
return _rc
}
func Xsqlite3_bind_zeroblob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n int32) (r0 int32) {
var _rc int32
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
_rc = _vdbeUnbind(tls, _p, _i)
if _rc == i32(0) {
_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X24)+48*uintptr(_i-i32(1)))), _n)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
return _rc
}
// Delete any previous value and set the value to be a BLOB of length
// n containing all zeros.
func _sqlite3VdbeMemSetZeroBlob(tls *crt.TLS, _pMem *XMem, _n int32) {
_sqlite3VdbeMemRelease(tls, _pMem)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(16400))
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(0)
if _n < i32(0) {
_n = i32(0)
}
*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _n
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil
}
// This routine sets the busy callback for an Sqlite database to the
// given callback function with the given argument.
func Xsqlite3_busy_handler(tls *crt.TLS, _db *Xsqlite3, _xBusy func(*crt.TLS, unsafe.Pointer, int32) int32, _pArg unsafe.Pointer) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(141988))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X0))) = _xBusy
*(*unsafe.Pointer)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X1))) = _pArg
*(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0)
*(*int32)(unsafe.Pointer(&(_db.X74))) = i32(0)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// This routine installs a default busy handler that waits for the
// specified number of milliseconds before returning 0.
func Xsqlite3_busy_timeout(tls *crt.TLS, _db *Xsqlite3, _ms int32) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(142038))
}
if _ms > i32(0) {
Xsqlite3_busy_handler(tls, _db, _sqliteDefaultBusyCallback, (unsafe.Pointer)(_db))
*(*int32)(unsafe.Pointer(&(_db.X74))) = _ms
goto _2
}
Xsqlite3_busy_handler(tls, _db, nil, nil)
_2:
return i32(0)
}
// This routine implements a busy callback that sleeps and tries
// again until a timeout value is reached. The timeout value is
// an integer number of milliseconds passed in as the first
// argument.
func _sqliteDefaultBusyCallback(tls *crt.TLS, _ptr unsafe.Pointer, _count int32) (r0 int32) {
var _timeout, _delay, _prior int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_ptr)
_timeout = _db.X74
func() {
if _count < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141934), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqliteDefaultBusyCallbackØ00__func__Ø000))), unsafe.Pointer(str(8611)))
crt.X__builtin_abort(tls)
}
}()
if _count < i32(12) {
_delay = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(_count))))
_prior = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(_count))))
goto _3
}
_delay = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00delaysØ001)) + 1*uintptr(i32(11)))))
_prior = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqliteDefaultBusyCallbackØ00totalsØ002)) + 1*uintptr(i32(11))))) + (_delay * (_count - i32(11)))
_3:
if (_prior + _delay) <= _timeout {
goto _4
}
_delay = _timeout - _prior
if _delay <= i32(0) {
return i32(0)
}
_4:
_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_db.X0), _delay*i32(1000))
return i32(1)
}
var _sqliteDefaultBusyCallbackØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqliteDefaultBusyCallbackØ00__func__Ø000[0], str(8620), 26)
}
var _sqliteDefaultBusyCallbackØ00delaysØ001 [12]uint8
func init() {
_sqliteDefaultBusyCallbackØ00delaysØ001 = [12]uint8{1, 2, 5, 10, 15, 20, 25, 25, 25, 50, 50, 100}
}
var _sqliteDefaultBusyCallbackØ00totalsØ002 [12]uint8
func init() {
_sqliteDefaultBusyCallbackØ00totalsØ002 = [12]uint8{0, 1, 3, 8, 18, 33, 53, 78, 103, 128, 178, 228}
}
func _sqlite3OsSleep(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nMicro int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_pVfs.X15)})))(tls, _pVfs, _nMicro)
}
// Return the number of changes in the most recent call to sqlite3_exec().
func Xsqlite3_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(141413))
return i32(0)
}
return _db.X29
}
// Two variations on the public interface for closing a database
// connection. The sqlite3_close() version returns SQLITE_BUSY and
// leaves the connection option if there are unfinalized prepared
// statements or unfinished sqlite3_backups. The sqlite3_close_v2()
// version forces the connection to become a zombie if there are
// unclosed resources, and arranges for deallocation when the last
// prepare statement or sqlite3_backup closes.
func Xsqlite3_close(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
return _sqlite3Close(tls, _db, i32(0))
}
// Close an existing SQLite database
func _sqlite3Close(tls *crt.TLS, _db *Xsqlite3, _forceZombie int32) (r0 int32) {
if _db == nil {
return i32(0)
}
if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(141522))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if (int32(_db.X24) & i32(8)) != 0 {
(_db.X41)(tls, uint32(i32(8)), _db.X42, (unsafe.Pointer)(_db), nil)
}
_disconnectAllVtab(tls, _db)
_sqlite3VtabRollback(tls, _db)
if (_forceZombie == 0) && _connectionIsBusy(tls, _db) != 0 {
_sqlite3ErrorWithMsg(tls, _db, i32(5), str(8646))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(5)
}
*(*uint32)(unsafe.Pointer(&(_db.X28))) = uint32(i32(1691352191))
_sqlite3LeaveMutexAndCloseZombie(tls, _db)
return i32(0)
}
func _sqlite3SafetyCheckSickOrOk(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _magic uint32
_magic = _db.X28
if ((_magic != uint32(i32(1266094736))) && (_magic != u32(2687084183))) && (_magic != u32(4030429446)) {
_logBadConnection(tls, str(8714))
return i32(0)
}
return i32(1)
}
// Disconnect all sqlite3_vtab objects that belong to database connection
// db. This is called when db is being closed.
func _disconnectAllVtab(tls *crt.TLS, _db *Xsqlite3) {
var _i int32
var _1_pSchema *XSchema
var _p *XHashElem
var _3_pTab *XTable
var _4_pMod *XModule
_sqlite3BtreeEnterAll(tls, _db)
_i = i32(0)
_0:
if _i >= (_db.X5) {
goto _3
}
_1_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X4)
if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X4) == nil {
goto _4
}
_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_1_pSchema.X2))).X2)
_5:
if _p == nil {
goto _8
}
_3_pTab = (*XTable)(_p.X2)
if (_3_pTab.X16) != 0 {
_sqlite3VtabDisconnect(tls, _db, _3_pTab)
}
_p = (*XHashElem)(_p.X0)
goto _5
_8:
_4:
_i += 1
goto _0
_3:
_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X65))).X2)
_10:
if _p == nil {
goto _13
}
_4_pMod = (*XModule)(_p.X2)
if (*XTable)(_4_pMod.X4) != nil {
_sqlite3VtabDisconnect(tls, _db, (*XTable)(_4_pMod.X4))
}
_p = (*XHashElem)(_p.X0)
goto _10
_13:
_sqlite3VtabUnlockList(tls, _db)
_sqlite3BtreeLeaveAll(tls, _db)
}
func _sqlite3BtreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
if int32(_db.X25) == i32(0) {
_btreeEnterAll(tls, _db)
}
}
// Enter the mutex on every Btree associated with a database
// connection. This is needed (for example) prior to parsing
// a statement since we will be comparing table and column names
// against all schemas and we do not want those schemas being
// reset out from under us.
//
// There is a corresponding leave-all procedures.
//
// Enter the mutexes in accending order by BtShared pointer address
// to avoid the possibility of deadlock when two threads with
// two or more btrees in common both try to lock all their btrees
// at the same instant.
func _btreeEnterAll(tls *crt.TLS, _db *Xsqlite3) {
var _i, _skipOk int32
var _p *XBtree
_skipOk = i32(1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58913), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeEnterAllØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= (_db.X5) {
goto _5
}
_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if (_p != nil) && ((_p.X3) != 0) {
_sqlite3BtreeEnter(tls, _p)
_skipOk = i32(0)
}
_i += 1
goto _2
_5:
*(*uint8)(unsafe.Pointer(&(_db.X25))) = uint8(_skipOk)
}
var _btreeEnterAllØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_btreeEnterAllØ00__func__Ø000[0], str(8722), 14)
}
// 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 _sqlite3BtreeEnter(tls *crt.TLS, _p *XBtree) {
func() {
if (*XBtree)(_p.X9) != nil && uintptr(unsafe.Pointer((*XBtShared)((*XBtree)(_p.X9).X1))) <= uintptr(unsafe.Pointer((*XBtShared)(_p.X1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8736)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)(_p.X10) != nil && uintptr(unsafe.Pointer((*XBtShared)((*XBtree)(_p.X10).X1))) >= uintptr(unsafe.Pointer((*XBtShared)(_p.X1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8772)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)(_p.X9) != nil && (*Xsqlite3)((*XBtree)(_p.X9).X0) != (*Xsqlite3)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8808)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)(_p.X10) != nil && (*Xsqlite3)((*XBtree)(_p.X10).X0) != (*Xsqlite3)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58802), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X3) == 0 && ((*XBtree)(_p.X9) != nil || (*XBtree)(_p.X10) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8878)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X4) != 0 && (_p.X6) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8922)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X3) == 0 && (_p.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58807), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8952)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58810), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_p.X4) != i32(0) || (_p.X3) == 0) && (*Xsqlite3)((*XBtShared)(_p.X1).X1) != (*Xsqlite3)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeEnterØ00__func__Ø000))), unsafe.Pointer(str(9017)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) == 0 {
return
}
*(*int32)(unsafe.Pointer(&(_p.X6))) += 1
if (_p.X4) != 0 {
return
}
_btreeLockCarefully(tls, _p)
}
var _sqlite3BtreeEnterØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeEnterØ00__func__Ø000[0], str(9068), 18)
}
// This is a helper function for sqlite3BtreeLock(). By moving
// complex, but seldom used logic, out of sqlite3BtreeLock() and
// into this routine, we avoid unnecessary stack pointer changes
// and thus help the sqlite3BtreeLock() routine to run much faster
// in the common case.
func _btreeLockCarefully(tls *crt.TLS, _p *XBtree) {
var _pLater *XBtree
if Xsqlite3_mutex_try(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) == i32(0) {
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtShared)(_p.X1).X1))))) = (*Xsqlite3)(_p.X0)
*(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1))
return
}
_pLater = (*XBtree)(_p.X9)
_1:
if _pLater == nil {
goto _4
}
func() {
if (_pLater.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58847), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000))), unsafe.Pointer(str(9086)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)(_pLater.X9) != nil && uintptr(unsafe.Pointer((*XBtShared)((*XBtree)(_pLater.X9).X1))) <= uintptr(unsafe.Pointer((*XBtShared)(_pLater.X1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58848), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000))), unsafe.Pointer(str(9103)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pLater.X4) != 0 && (_pLater.X6) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58849), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLockCarefullyØ00__func__Ø000))), unsafe.Pointer(str(9154)))
crt.X__builtin_abort(tls)
}
}()
if (_pLater.X4) != 0 {
_unlockBtreeMutex(tls, _pLater)
}
_pLater = (*XBtree)(_pLater.X9)
goto _1
_4:
_lockBtreeMutex(tls, _p)
_pLater = (*XBtree)(_p.X9)
_14:
if _pLater == nil {
goto _17
}
if (_pLater.X6) != 0 {
_lockBtreeMutex(tls, _pLater)
}
_pLater = (*XBtree)(_pLater.X9)
goto _14
_17:
}
// Obtain the mutex p. If successful, return SQLITE_OK. Otherwise, if another
// thread holds the mutex and it cannot be obtained, return SQLITE_BUSY.
func Xsqlite3_mutex_try(tls *crt.TLS, _p *Xsqlite3_mutex) (r0 int32) {
var _rc int32
_rc = i32(0)
if _p != nil {
func() {
if (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X5)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_tryØ00__func__Ø000))), unsafe.Pointer(str(9194)))
crt.X__builtin_abort(tls)
}
}()
return (*(*func(*crt.TLS, *Xsqlite3_mutex) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X5)})))(tls, _p)
}
return _rc
}
var _sqlite3_mutex_tryØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_tryØ00__func__Ø000[0], str(9230), 18)
}
var _btreeLockCarefullyØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_btreeLockCarefullyØ00__func__Ø000[0], str(9248), 19)
}
// Release the BtShared mutex associated with B-Tree handle p and
// clear the p->locked boolean.
func _unlockBtreeMutex(tls *crt.TLS, _p *XBtree) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
func() {
if int32(_p.X4) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58766), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(9267)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58767), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58768), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_p.X0) != (*Xsqlite3)(_pBt.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58769), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(9311)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pBt.X21))
*(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(0))
}
var _unlockBtreeMutexØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_unlockBtreeMutexØ00__func__Ø000[0], str(9326), 17)
}
// Obtain the BtShared mutex associated with B-Tree handle p. Also,
// set BtShared.db to the database handle associated with p and the
// p->locked boolean to true.
func _lockBtreeMutex(tls *crt.TLS, _p *XBtree) {
func() {
if int32(_p.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58751), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(9343)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58752), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(9356)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58753), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeMutexØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtShared)(_p.X1).X1))))) = (*Xsqlite3)(_p.X0)
*(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1))
}
var _lockBtreeMutexØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_lockBtreeMutexØ00__func__Ø000[0], str(9393), 15)
}
// Table *p is a virtual table. This function removes the VTable object
// for table *p associated with database connection db from the linked
// list in p->pVTab. It also decrements the VTable ref count. This is
// used when closing database connection db to free all of its VTable
// objects without disturbing the rest of the Schema object (which may
// be being used by other shared-cache connections).
func _sqlite3VtabDisconnect(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
var _2_pVTab *XVTable
var _ppVTab **XVTable
func() {
if (_p.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125207), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000))), unsafe.Pointer(str(9408)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125208), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125209), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabDisconnectØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_ppVTab = (**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18)))))
_6:
if (*_ppVTab) == nil {
goto _9
}
if (*Xsqlite3)((*_ppVTab).X0) == _db {
_2_pVTab = *_ppVTab
*_ppVTab = (*XVTable)(_2_pVTab.X6)
_sqlite3VtabUnlock(tls, _2_pVTab)
goto _9
}
_ppVTab = (**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_ppVTab).X6)))))
goto _6
_9:
}
var _sqlite3VtabDisconnectØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabDisconnectØ00__func__Ø000[0], str(9453), 22)
}
// Return true if the current thread holds the database connection
// mutex and all required BtShared mutexes.
//
// This routine is used inside assert() statements only.
func _sqlite3BtreeHoldsAllMutexes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _i int32
var _2_p *XBtree
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
return i32(0)
}
_i = i32(0)
_1:
if _i >= (_db.X5) {
goto _4
}
_2_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if ((_2_p != nil) && ((_2_p.X3) != 0)) && (((_2_p.X6) == i32(0)) || (Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_2_p.X1).X21)) == 0)) {
return i32(0)
}
_i += 1
goto _1
_4:
return i32(1)
}
// Decrement the ref-count on a virtual table object. When the ref-count
// reaches zero, call the xDisconnect() method to delete the object.
func _sqlite3VtabUnlock(tls *crt.TLS, _pVTab *XVTable) {
var _db *Xsqlite3
var _1_p *Xsqlite3_vtab
_db = (*Xsqlite3)(_pVTab.X0)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125143), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000))), unsafe.Pointer(str(9475)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pVTab.X3) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000))), unsafe.Pointer(str(9478)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X28) != u32(2687084183) && (_db.X28) != uint32(i32(1691352191)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockØ00__func__Ø000))), unsafe.Pointer(str(9492)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pVTab.X3))) -= 1
if (_pVTab.X3) != i32(0) {
goto _7
}
_1_p = (*Xsqlite3_vtab)(_pVTab.X2)
if _1_p != nil {
(*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_module)(_1_p.X0).X4)})))(tls, _1_p)
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pVTab))
_7:
}
var _sqlite3VtabUnlockØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabUnlockØ00__func__Ø000[0], str(9555), 18)
}
// Disconnect all the virtual table objects in the sqlite3.pDisconnect list.
//
// This function may only be called when the mutexes associated with all
// shared b-tree databases opened using connection db are held by the
// caller. This is done to protect the sqlite3.pDisconnect list. The
// sqlite3.pDisconnect list is accessed only as follows:
//
// 1) By this function. In this case, all BtShared mutexes and the mutex
// associated with the database handle itself must be held.
//
// 2) By function vtabDisconnectAll(), when it adds a VTable entry to
// the sqlite3.pDisconnect list. In this case either the BtShared mutex
// associated with the database the virtual table is stored in is held
// or, if the virtual table is stored in a non-sharable database, then
// the database handle mutex is held.
//
// As a result, a sqlite3.pDisconnect cannot be accessed simultaneously
// by multiple threads. It is thread-safe.
func _sqlite3VtabUnlockList(tls *crt.TLS, _db *Xsqlite3) {
var _p, _2_pNext *XVTable
_p = (*XVTable)(_db.X68)
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X68))))) = nil
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125246), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125247), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabUnlockListØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
goto _4
}
_sqlite3ExpirePreparedStatements(tls, _db)
_5:
_2_pNext = (*XVTable)(_p.X6)
_sqlite3VtabUnlock(tls, _p)
_p = _2_pNext
if _p != nil {
goto _5
}
_4:
}
var _sqlite3VtabUnlockListØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabUnlockListØ00__func__Ø000[0], str(9573), 22)
}
// 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.
func _sqlite3ExpirePreparedStatements(tls *crt.TLS, _db *Xsqlite3) {
var _p *TVdbe
_p = (*TVdbe)(_db.X1)
_0:
if _p == nil {
goto _3
}
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
_p = (*TVdbe)(_p.X2)
goto _0
_3:
}
func _sqlite3BtreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
if int32(_db.X25) == i32(0) {
_btreeLeaveAll(tls, _db)
}
}
func _btreeLeaveAll(tls *crt.TLS, _db *Xsqlite3) {
var _i int32
var _p *XBtree
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58929), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeLeaveAllØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= (_db.X5) {
goto _5
}
_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _p != nil {
_sqlite3BtreeLeave(tls, _p)
}
_i += 1
goto _2
_5:
}
var _btreeLeaveAllØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_btreeLeaveAllØ00__func__Ø000[0], str(9595), 14)
}
// Exit the recursive mutex on a Btree.
func _sqlite3BtreeLeave(tls *crt.TLS, _p *XBtree) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58867), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) == 0 {
goto _2
}
func() {
if (_p.X6) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58869), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLeaveØ00__func__Ø000))), unsafe.Pointer(str(9609)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X6))) -= 1
if (_p.X6) == i32(0) {
_unlockBtreeMutex(tls, _p)
}
_2:
}
var _sqlite3BtreeLeaveØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeLeaveØ00__func__Ø000[0], str(9625), 18)
}
// Invoke the xRollback method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
func _sqlite3VtabRollback(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
_callFinaliser(tls, _db, int32(u32(68)))
return i32(0)
}
// This function invokes either the xRollback or xCommit method
// of each of the virtual tables in the sqlite3.aVTrans array. The method
// called is identified by the second argument, "offset", which is
// the offset of the method to call in the sqlite3_module structure.
//
// The array is cleared after invoking the callbacks.
func _callFinaliser(tls *crt.TLS, _db *Xsqlite3, _offset int32) {
var _i int32
var _2_pVTab *XVTable
var _2_p *Xsqlite3_vtab
var _1_aVTrans **XVTable
var _3_x func(*crt.TLS, *Xsqlite3_vtab) int32
if (**XVTable)(unsafe.Pointer(_db.X67)) == nil {
goto _0
}
_1_aVTrans = (**XVTable)(unsafe.Pointer(_db.X67))
*(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = nil
_i = i32(0)
_1:
if _i >= (_db.X64) {
goto _4
}
_2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aVTrans)) + 4*uintptr(_i)))
_2_p = (*Xsqlite3_vtab)(_2_pVTab.X2)
if _2_p == nil {
goto _5
}
_3_x = *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*Xsqlite3_module)(_2_p.X0))))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_offset)))))))))
if _3_x != nil {
_3_x(tls, _2_p)
}
_5:
*(*int32)(unsafe.Pointer(&(_2_pVTab.X5))) = i32(0)
_sqlite3VtabUnlock(tls, _2_pVTab)
_i += 1
goto _1
_4:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_aVTrans))
*(*int32)(unsafe.Pointer(&(_db.X64))) = i32(0)
_0:
}
// Return TRUE if database connection db has unfinalized prepared
// statements or unfinished sqlite3_backup objects.
func _connectionIsBusy(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _j int32
var _1_pBt *XBtree
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141503), unsafe.Pointer((*int8)(unsafe.Pointer(&_connectionIsBusyØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if (*TVdbe)(_db.X1) != nil {
return i32(1)
}
_j = i32(0)
_3:
if _j >= (_db.X5) {
goto _6
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_j))).X1)
if (_1_pBt != nil) && _sqlite3BtreeIsInBackup(tls, _1_pBt) != 0 {
return i32(1)
}
_j += 1
goto _3
_6:
return i32(0)
}
var _connectionIsBusyØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_connectionIsBusyØ00__func__Ø000[0], str(9643), 17)
}
func _sqlite3BtreeIsInBackup(tls *crt.TLS, _p *XBtree) (r0 int32) {
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000))), unsafe.Pointer(str(9660)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68681), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIsInBackupØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((_p.X7) != i32(0))
}
var _sqlite3BtreeIsInBackupØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIsInBackupØ00__func__Ø000[0], str(9662), 23)
}
// 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 _sqlite3ErrorWithMsg(tls *crt.TLS, _db *Xsqlite3, _err_code int32, _zFormat *int8, args ...interface{}) {
var _2_z *int8
var _2_ap []interface{}
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27835), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ErrorWithMsgØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_db.X10))) = _err_code
_sqlite3SystemError(tls, _db, _err_code)
if _zFormat == nil {
_sqlite3Error(tls, _db, _err_code)
goto _5
}
if ((*XMem)(_db.X56) != nil) || (store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X56))))), _sqlite3ValueNew(tls, _db)) != nil) {
_2_ap = args
_2_z = _sqlite3VMPrintf(tls, _db, _zFormat, _2_ap)
_2_ap = nil
_sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), (unsafe.Pointer)(_2_z), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
}
_5:
}
var _sqlite3ErrorWithMsgØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ErrorWithMsgØ00__func__Ø000[0], str(9685), 20)
}
// Create a new sqlite3_value object.
func _sqlite3ValueNew(tls *crt.TLS, _db *Xsqlite3) (r0 *XMem) {
var _p *XMem
_p = (*XMem)(_sqlite3DbMallocZero(tls, _db, uint64(u32(48))))
if _p != nil {
*(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(1))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _db
}
return _p
}
// Allocate and zero memory. If the allocation fails, make
// the mallocFailed flag in the connection pointer.
func _sqlite3DbMallocZero(tls *crt.TLS, _db *Xsqlite3, _n uint64) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
_p = _sqlite3DbMallocRaw(tls, _db, _n)
if _p != nil {
crt.Xmemset(tls, _p, i32(0), uint32(_n))
}
return _p
}
// Change the string value of an sqlite3_value object
func _sqlite3ValueSetStr(tls *crt.TLS, _v *XMem, _n int32, _z unsafe.Pointer, _enc uint8, _xDel func(*crt.TLS, unsafe.Pointer)) {
if _v != nil {
_sqlite3VdbeMemSetStr(tls, _v, (*int8)(_z), _n, _enc, _xDel)
}
}
// 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 _sqlite3LeaveMutexAndCloseZombie(tls *crt.TLS, _db *Xsqlite3) {
var _j int32
var _2_pDb *XDb
var _i *XHashElem
var _6_pNext, _6_p *XFuncDef
var _8_pColl *XCollSeq
var _11_pMod *XModule
if ((_db.X28) != uint32(i32(1691352191))) || _connectionIsBusy(tls, _db) != 0 {
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return
}
_sqlite3RollbackAll(tls, _db, i32(0))
_sqlite3CloseSavepoints(tls, _db)
_j = i32(0)
_2:
if _j >= (_db.X5) {
goto _5
}
_2_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_j)))
if (*XBtree)(_2_pDb.X1) == nil {
goto _6
}
_sqlite3BtreeClose(tls, (*XBtree)(_2_pDb.X1))
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pDb.X1))))) = nil
if _j != i32(1) {
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pDb.X4))))) = nil
}
_6:
_j += 1
goto _2
_5:
if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4) != nil {
_sqlite3SchemaClear(tls, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4)
}
_sqlite3VtabUnlockList(tls, _db)
_sqlite3CollapseDatabaseArray(tls, _db)
func() {
if (_db.X5) > i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141633), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9705)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9716)))
crt.X__builtin_abort(tls)
}
}()
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X69))).X2)
_13:
if _i == nil {
goto _16
}
_6_p = (*XFuncDef)(_i.X2)
_17:
_functionDestroy(tls, _db, _6_p)
_6_pNext = (*XFuncDef)(_6_p.X3)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_6_p))
_6_p = _6_pNext
if _6_p != nil {
goto _17
}
_i = (*XHashElem)(_i.X0)
goto _13
_16:
_sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X69))))
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X70))).X2)
_18:
if _i == nil {
goto _21
}
_8_pColl = (*XCollSeq)(_i.X2)
_j = i32(0)
_22:
if _j >= i32(3) {
goto _25
}
if ((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl)) + 20*uintptr(_j))).X4) != nil {
((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl)) + 20*uintptr(_j))).X4)(tls, (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pColl))+20*uintptr(_j))).X2)
}
_j += 1
goto _22
_25:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_8_pColl))
_i = (*XHashElem)(_i.X0)
goto _18
_21:
_sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X70))))
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X65))).X2)
_27:
if _i == nil {
goto _30
}
_11_pMod = (*XModule)(_i.X2)
if (_11_pMod.X3) != nil {
(_11_pMod.X3)(tls, _11_pMod.X2)
}
_sqlite3VtabEponymousTableClear(tls, _db, _11_pMod)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_11_pMod))
_i = (*XHashElem)(_i.X0)
goto _27
_30:
_sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_db.X65))))
_sqlite3Error(tls, _db, i32(0))
_sqlite3ValueFree(tls, (*XMem)(_db.X56))
_sqlite3CloseExtensions(tls, _db)
*(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(3040180528)
_sqlite3DbFree(tls, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
*(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(2671521075)
Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000))), unsafe.Pointer(str(9739)))
crt.X__builtin_abort(tls)
}
}()
if ((*t7)(unsafe.Pointer(&(_db.X58))).X2) != 0 {
Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&(_db.X58))).X7)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_db))
}
// Rollback all database files. If tripCode is not SQLITE_OK, then
// any write cursors are invalidated ("tripped" - as in "tripping a circuit
// breaker") and made to return tripCode if there are any further
// attempts to use that cursor. Read cursors remain open and valid
// but are "saved" in case the table pages are moved around.
func _sqlite3RollbackAll(tls *crt.TLS, _db *Xsqlite3, _tripCode int32) {
var _i, _inTrans, _schemaChange int32
var _1_p *XBtree
_inTrans = i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141713), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RollbackAllØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BeginBenignMalloc(tls)
_sqlite3BtreeEnterAll(tls, _db)
_schemaChange = bool2int((((_db.X6) & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0)))
_i = i32(0)
_3:
if _i >= (_db.X5) {
goto _6
}
_1_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_p == nil {
goto _7
}
if _sqlite3BtreeIsInTrans(tls, _1_p) != 0 {
_inTrans = i32(1)
}
_sqlite3BtreeRollback(tls, _1_p, _tripCode, bool2int(_schemaChange == 0))
_7:
_i += 1
goto _3
_6:
_sqlite3VtabRollback(tls, _db)
_sqlite3EndBenignMalloc(tls)
if (((_db.X6) & i32(2)) != i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0)) {
_sqlite3ExpirePreparedStatements(tls, _db)
_sqlite3ResetAllSchemasOfConnection(tls, _db)
}
_sqlite3BtreeLeaveAll(tls, _db)
*(*int64)(unsafe.Pointer(&(_db.X77))) = int64(i32(0))
*(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0))
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-33554433)
sink1 = *p
}
if ((_db.X48) != nil) && (_inTrans != 0 || ((_db.X15) == 0)) {
(_db.X48)(tls, _db.X47)
}
}
var _sqlite3RollbackAllØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RollbackAllØ00__func__Ø000[0], str(9761), 19)
}
// Return non-zero if a transaction is active.
func _sqlite3BtreeIsInTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
func() {
if _p != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68641), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIsInTransØ00__func__Ø000))), unsafe.Pointer(str(9780)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((_p != nil) && (int32(_p.X2) == i32(2)))
}
var _sqlite3BtreeIsInTransØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIsInTransØ00__func__Ø000[0], str(9821), 22)
}
// 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 _sqlite3BtreeRollback(tls *crt.TLS, _p *XBtree, _tripCode int32, _writeOnly int32) (r0 int32) {
var _rc, _3_rc2, _4_rc2, _6_nPage int32
var _pBt *XBtShared
var _pPage1 *XMemPage
_pBt = (*XBtShared)(_p.X1)
func() {
if _writeOnly != i32(1) && _writeOnly != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63037), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(9843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _tripCode != i32(516) && _tripCode != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63038), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(9872)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
if _tripCode != i32(0) {
goto _6
}
_rc = store1(&_tripCode, _saveAllCursors(tls, _pBt, uint32(i32(0)), nil))
if _rc != 0 {
_writeOnly = i32(0)
}
goto _8
_6:
_rc = i32(0)
_8:
if _tripCode == 0 {
goto _9
}
_3_rc2 = _sqlite3BtreeTripAllCursors(tls, _p, _tripCode, _writeOnly)
func() {
if _rc != i32(0) && (_writeOnly != i32(0) || _3_rc2 != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63048), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(9927)))
crt.X__builtin_abort(tls)
}
}()
if _3_rc2 != i32(0) {
_rc = _3_rc2
}
_9:
func() {
if int32((*XBtShared)(_p.X1).X8) == i32(0) && ((*XBtShared)(_p.X1).X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63051), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(9977)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtShared)(_p.X1).X8) < int32(_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63051), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(10038)))
crt.X__builtin_abort(tls)
}
}()
if int32(_p.X2) != i32(2) {
goto _20
}
func() {
if i32(2) != int32(_pBt.X8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63056), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(10072)))
crt.X__builtin_abort(tls)
}
}()
_4_rc2 = _sqlite3PagerRollback(tls, (*XPager)(_pBt.X0))
if _4_rc2 != i32(0) {
_rc = _4_rc2
}
if _btreeGetPage(tls, _pBt, uint32(i32(1)), &_pPage1, i32(0)) != i32(0) {
goto _24
}
_6_nPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(28))))))+uintptr(unsafe.Pointer(_pPage1.X19))))))
if _6_nPage == i32(0) {
_sqlite3PagerPagecount(tls, (*XPager)(_pBt.X0), &_6_nPage)
}
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(_6_nPage)
_releasePage(tls, _pPage1)
_24:
func() {
if _countValidCursors(tls, _pBt, i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63073), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRollbackØ00__func__Ø000))), unsafe.Pointer(str(10104)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pBt.X8))) = uint8(i32(1))
_btreeClearHasContent(tls, _pBt)
_20:
_btreeEndTransaction(tls, _p)
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeRollbackØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeRollbackØ00__func__Ø000[0], str(10133), 21)
}
// Save the positions of all cursors (except pExcept) that are open on
// the table with root-page iRoot. "Saving the cursor position" means that
// the location in the btree is remembered in such a way that it can be
// moved back to the same spot after the btree has been modified. This
// routine is called just before cursor pExcept is used to modify the
// table, for example in BtreeDelete() or BtreeInsert().
//
// If there are two or more cursors on the same btree, then all such
// cursors should have their BTCF_Multiple flag set. The btreeCursor()
// routine enforces that rule. This routine only needs to be called in
// the uncommon case when pExpect has the BTCF_Multiple flag set.
//
// If pExpect!=NULL and if no other cursors are found on the same root-page,
// then the BTCF_Multiple flag on pExpect is cleared, to avoid another
// pointless call to this routine.
//
// Implementation note: This routine merely checks to see if any cursors
// need to be saved. It calls out to saveCursorsOnList() in the (unusual)
// event that cursors are in need to being saved.
func _saveAllCursors(tls *crt.TLS, _pBt *XBtShared, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
var _p *XBtCursor
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59740), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pExcept != nil && (*XBtShared)(_pExcept.X1) != _pBt {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59741), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(10154)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XBtCursor)(_pBt.X2)
_5:
if _p == nil {
goto _8
}
if (_p != _pExcept) && ((uint32(i32(0)) == _iRoot) || ((_p.X7) == _iRoot)) {
goto _8
}
_p = (*XBtCursor)(_p.X2)
goto _5
_8:
if _p != nil {
return _saveCursorsOnList(tls, _p, _iRoot, _pExcept)
}
if _pExcept != nil {
{
p := (*uint8)(unsafe.Pointer(&(_pExcept.X10)))
*p = uint8(int32(*p) & i32(-33))
sink2 = *p
}
}
return i32(0)
}
var _saveAllCursorsØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_saveAllCursorsØ00__func__Ø000[0], str(10186), 15)
}
// This helper routine to saveAllCursors does the actual work of saving
// the cursors if and when a cursor is found that actually requires saving.
// The common case is that no cursors need to be saved, so this routine is
// broken out from its caller to avoid unnecessary stack pointer movement.
func _saveCursorsOnList(tls *crt.TLS, _p *XBtCursor, _iRoot uint32, _pExcept *XBtCursor) (r0 int32) {
var _3_rc int32
_0:
if _p == _pExcept || uint32(i32(0)) != _iRoot && (_p.X7) != _iRoot {
goto _3
}
if int32(_p.X12) != i32(1) && int32(_p.X12) != i32(2) {
goto _5
}
_3_rc = _saveCursorPosition(tls, _p)
if i32(0) != _3_rc {
return _3_rc
}
goto _7
_5:
_btreeReleaseAllCursorPages(tls, _p)
_7:
_3:
_p = (*XBtCursor)(_p.X2)
if _p != nil {
goto _0
}
return i32(0)
}
// Save the current cursor position in the variables BtCursor.nKey
// and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK.
//
// The caller must ensure that the cursor is valid (has eState==CURSOR_VALID)
// prior to calling this routine.
func _saveCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc int32
func() {
if i32(1) != int32(_pCur.X12) && i32(2) != int32(_pCur.X12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59694), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(10201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if unsafe.Pointer(nil) != (_pCur.X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59695), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(10261)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _cursorHoldsMutex(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59696), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(10275)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(2) {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1))
goto _8
}
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0)
_8:
_rc = _saveCursorKey(tls, _pCur)
if _rc == i32(0) {
_btreeReleaseAllCursorPages(tls, _pCur)
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3))
}
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-15))
sink2 = *p
}
return _rc
}
var _saveCursorPositionØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_saveCursorPositionØ00__func__Ø000[0], str(10298), 19)
}
func _cursorHoldsMutex(tls *crt.TLS, _p *XBtCursor) (r0 int32) {
return Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21))
}
// The cursor passed as the only argument must point to a valid entry
// when this function is called (i.e. have eState==CURSOR_VALID). This
// function saves the current cursor key in variables pCur->nKey and
// pCur->pKey. SQLITE_OK is returned if successful or an SQLite error
// code otherwise.
//
// If the cursor is open on an intkey table, then the integer key
// (the rowid) is stored in pCur->nKey and pCur->pKey is left set to
// NULL. If the cursor is open on a non-intkey table, then pCur->pKey is
// set to point to a malloced buffer pCur->nKey bytes in size containing
// the key.
func _saveCursorKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc int32
var _2_pKey unsafe.Pointer
_rc = i32(0)
func() {
if i32(1) != int32(_pCur.X12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59657), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10317)))
crt.X__builtin_abort(tls)
}
}()
func() {
if unsafe.Pointer(nil) != (_pCur.X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59658), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10261)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _cursorHoldsMutex(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59659), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10275)))
crt.X__builtin_abort(tls)
}
}()
if (_pCur.X15) != 0 {
*(*int64)(unsafe.Pointer(&(_pCur.X5))) = _sqlite3BtreeIntegerKey(tls, _pCur)
goto _7
}
*(*int64)(unsafe.Pointer(&(_pCur.X5))) = int64(_sqlite3BtreePayloadSize(tls, _pCur))
_2_pKey = _sqlite3Malloc(tls, uint64(_pCur.X5))
if _2_pKey == nil {
goto _8
}
_rc = _sqlite3BtreePayload(tls, _pCur, uint32(i32(0)), uint32(int32(_pCur.X5)), _2_pKey)
if _rc == i32(0) {
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = _2_pKey
goto _10
}
Xsqlite3_free(tls, _2_pKey)
_10:
goto _11
_8:
_rc = _sqlite3NomemError(tls, i32(59677))
_11:
_7:
func() {
if (_pCur.X15) != 0 && (_pCur.X6) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59680), unsafe.Pointer((*int8)(unsafe.Pointer(&_saveCursorKeyØ00__func__Ø000))), unsafe.Pointer(str(10344)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _saveCursorKeyØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_saveCursorKeyØ00__func__Ø000[0], str(10376), 14)
}
// Return the value of the integer key or "rowid" for a table btree.
// This routine is only valid for a cursor that is pointing into a
// ordinary table btree. If the cursor points to an index btree or
// is invalid, the result of this routine is undefined.
func _sqlite3BtreeIntegerKey(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
func() {
if _cursorHoldsMutex(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63392), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000))), unsafe.Pointer(str(10275)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63393), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X15) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63394), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegerKeyØ00__func__Ø000))), unsafe.Pointer(str(10417)))
crt.X__builtin_abort(tls)
}
}()
_getCellInfo(tls, _pCur)
return (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0
}
var _sqlite3BtreeIntegerKeyØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIntegerKeyØ00__func__Ø000[0], str(10433), 23)
}
func _getCellInfo(tls *crt.TLS, _pCur *XBtCursor) {
var _1_iPage int32
if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) == i32(0) {
_1_iPage = int32(_pCur.X14)
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
_btreeParseCell(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_1_iPage))), int32(_pCur.X16), (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))))
goto _1
}
_assertCellInfo(tls, _pCur)
_1:
}
func _btreeParseCell(tls *crt.TLS, _pPage *XMemPage, _iCell int32, _pInfo *XCellInfo) {
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63758), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePayloadØ00__func__Ø000))), unsafe.Pointer(str(10597)))
crt.X__builtin_abort(tls)
}
}()
return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), i32(0))
}
var _sqlite3BtreePayloadØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreePayloadØ00__func__Ø000[0], str(10639), 20)
}
// This function is used to read or overwrite payload information
// for the entry that the pCur cursor is pointing to. The eOp
// argument is interpreted as follows:
//
// 0: The operation is a read. Populate the overflow cache.
// 1: The operation is a write. Populate the overflow cache.
//
// A total of "amt" bytes are read or written beginning at "offset".
// Data is read to or from the buffer pBuf.
//
// The content being read or written might appear on the main page
// or be scattered out on multiple overflow pages.
//
// If the current cursor entry uses one or more overflow pages
// this function may allocate space for and lazily populate
// the overflow page-list cache array (BtCursor.aOverflow).
// Subsequent calls use this cache to make seeking to the supplied offset
// more efficient.
//
// Once an overflow page-list cache has been allocated, it must be
// invalidated if some other cursor writes to the same table, or if
// the cursor is moved to a different row. Additionally, in auto-vacuum
// mode, the following events may invalidate an overflow page-list cache.
//
// * An incremental vacuum,
// * A commit in auto_vacuum="full" mode,
// * Creating a table (may require moving an overflow page).
func _accessPayload(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf *uint8, _eOp int32) (r0 int32) {
var _rc, _iIdx, _2_a, _6_nOvfl, _16_a int32
var _5_ovflSize, _5_nextPage uint32
var _aPayload *uint8
var _7_aNew *uint32
var _18_pDbPage *XPgHdr
var _pBt *XBtShared
var _pPage *XMemPage
_rc = i32(0)
_iIdx = i32(0)
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
_pBt = (*XBtShared)(_pCur.X1)
func() {
if _pPage == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63568), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10659)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eOp != i32(0) && _eOp != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63569), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10665)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63570), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X16) >= int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63571), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10682)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _cursorHoldsMutex(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63572), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10275)))
crt.X__builtin_abort(tls)
}
}()
_getCellInfo(tls, _pCur)
_aPayload = (*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1
func() {
if (_offset + _amt) > ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63576), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10704)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_aPayload)) <= uintptr(unsafe.Pointer(_pPage.X19)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63578), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10738)))
crt.X__builtin_abort(tls)
}
}()
if uint32(int32((uintptr(unsafe.Pointer(_aPayload))-uintptr(unsafe.Pointer(_pPage.X19)))/1)) > ((_pBt.X16) - uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)) {
return _sqlite3CorruptError(tls, i32(63585))
}
if _offset >= uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) {
goto _16
}
_2_a = int32(_amt)
if (uint32(_2_a) + _offset) > uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) {
_2_a = int32(uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) - _offset)
}
_rc = _copyPayload(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr(_offset)))), (unsafe.Pointer)(_pBuf), _2_a, _eOp, (*XPgHdr)(_pPage.X23))
_offset = uint32(i32(0))
{
p := &_pBuf
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_2_a)))
sink13 = *p
}
{
p := &_amt
*p = (*p) - uint32(_2_a)
sink5 = *p
}
goto _18
_16:
{
p := &_offset
*p = (*p) - uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)
sink5 = *p
}
_18:
if _rc != i32(0) || _amt <= uint32(i32(0)) {
goto _20
}
_5_ovflSize = (_pBt.X16) - uint32(i32(4))
_5_nextPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3))))
if (int32(_pCur.X10) & i32(4)) != i32(0) {
goto _21
}
_6_nOvfl = int32((((((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X2) - uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)) + _5_ovflSize) - uint32(i32(1))) / _5_ovflSize)
if _6_nOvfl <= (_pCur.X8) {
goto _22
}
_7_aNew = (*uint32)(_sqlite3Realloc(tls, (unsafe.Pointer)(_pCur.X3), uint64(uint32(_6_nOvfl*i32(2))*u32(4))))
if _7_aNew == nil {
return _sqlite3NomemError(tls, i32(63623))
}
*(*int32)(unsafe.Pointer(&(_pCur.X8))) = _6_nOvfl * i32(2)
*(**uint32)(unsafe.Pointer(&(_pCur.X3))) = _7_aNew
_22:
crt.Xmemset(tls, (unsafe.Pointer)(_pCur.X3), i32(0), uint32(_6_nOvfl)*u32(4))
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
goto _25
_21:
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_offset/_5_ovflSize)))) != 0 {
_iIdx = int32(_offset / _5_ovflSize)
_5_nextPage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx)))
_offset = _offset % _5_ovflSize
}
_25:
func() {
if _rc != i32(0) || _amt <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63643), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10762)))
crt.X__builtin_abort(tls)
}
}()
_30:
if _5_nextPage == 0 {
goto _31
}
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx)))) != uint32(i32(0)) && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx)))) != _5_nextPage && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63646), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10785)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx))) = _5_nextPage
if _offset < _5_ovflSize {
goto _36
}
func() {
if (int32(_pCur.X10) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63658), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10859)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)((*XBtree)(_pCur.X0).X0) != (*Xsqlite3)(_pBt.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63659), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadØ00__func__Ø000))), unsafe.Pointer(str(10891)))
crt.X__builtin_abort(tls)
}
}()
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx+i32(1))))) != 0 {
_5_nextPage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCur.X3)) + 4*uintptr(_iIdx+i32(1))))
goto _42
}
_rc = _getOverflowPage(tls, _pBt, _5_nextPage, nil, &_5_nextPage)
_42:
{
p := &_offset
*p = (*p) - _5_ovflSize
sink5 = *p
}
goto _43
_36:
_16_a = int32(_amt)
if (uint32(_16_a) + _offset) > _5_ovflSize {
_16_a = int32(_5_ovflSize - _offset)
}
_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.X0), _5_nextPage, &_18_pDbPage, func() int32 {
if _eOp == i32(0) {
return i32(2)
}
return i32(0)
}())
if _rc == i32(0) {
_aPayload = (*uint8)(_sqlite3PagerGetData(tls, _18_pDbPage))
_5_nextPage = _sqlite3Get4byte(tls, _aPayload)
_rc = _copyPayload(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPayload))+1*uintptr(_offset+uint32(i32(4)))))), (unsafe.Pointer)(_pBuf), _16_a, _eOp, _18_pDbPage)
_sqlite3PagerUnref(tls, _18_pDbPage)
_offset = uint32(i32(0))
}
{
p := &_amt
*p = (*p) - uint32(_16_a)
sink5 = *p
}
if _amt == uint32(i32(0)) {
return _rc
}
{
p := &_pBuf
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_16_a)))
sink13 = *p
}
_43:
if _rc != 0 {
goto _31
}
_iIdx += 1
goto _30
_31:
_20:
if (_rc == i32(0)) && (_amt > uint32(i32(0))) {
return _sqlite3CorruptError(tls, i32(63732))
}
return _rc
}
var _accessPayloadØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_accessPayloadØ00__func__Ø000[0], str(10917), 14)
}
func _sqlite3CorruptError(tls *crt.TLS, _lineno int32) (r0 int32) {
return _reportError(tls, i32(11), _lineno, str(10931))
}
// Copy data from a buffer to a page, or from a page to a buffer.
//
// pPayload is a pointer to data stored on database page pDbPage.
// If argument eOp is false, then nByte bytes of data are copied
// from pPayload to the buffer pointed at by pBuf. If eOp is true,
// then sqlite3PagerWrite() is called on pDbPage and nByte bytes
// of data are copied from the buffer pBuf to pPayload.
//
// SQLITE_OK is returned on success, otherwise an error code.
func _copyPayload(tls *crt.TLS, _pPayload unsafe.Pointer, _pBuf unsafe.Pointer, _nByte int32, _eOp int32, _pDbPage *XPgHdr) (r0 int32) {
var _1_rc int32
if _eOp == 0 {
goto _0
}
_1_rc = _sqlite3PagerWrite(tls, _pDbPage)
if _1_rc != i32(0) {
return _1_rc
}
crt.Xmemcpy(tls, _pPayload, _pBuf, uint32(_nByte))
goto _2
_0:
crt.Xmemcpy(tls, _pBuf, _pPayload, uint32(_nByte))
_2:
return i32(0)
}
// Mark a data page as writeable. This routine must be called before
// making changes to a page. The caller must check the return value
// of this function and be careful not to change any page data unless
// this routine returns SQLITE_OK.
//
// The difference between this function and pager_write() is that this
// function also deals with the special case where 2 or more pages
// fit on a single disk sector. In this case all co-resident pages
// must have been written to the journal file before returning.
//
// If an error occurs, SQLITE_NOMEM or an IO error code is returned
// as appropriate. Otherwise, SQLITE_OK.
func _sqlite3PagerWrite(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
func() {
if (int32(_pPg.X6) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52989), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000))), unsafe.Pointer(str(10951)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52990), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000))), unsafe.Pointer(str(10980)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52991), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pPg.X6)&i32(4)) == i32(0) || (_pPager.X22) < (_pPg.X5) {
goto _7
}
if (_pPager.X38) != 0 {
return _subjournalPageIfRequired(tls, _pPg)
}
return i32(0)
_7:
if (_pPager.X26) != 0 {
return _pPager.X26
}
if (_pPager.X47) > uint32(_pPager.X48) {
func() {
if int32(_pPager.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52998), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerWriteØ00__func__Ø000))), unsafe.Pointer(str(11043)))
crt.X__builtin_abort(tls)
}
}()
return _pagerWriteLargeSector(tls, _pPg)
}
return _pager_write(tls, _pPg)
}
var _sqlite3PagerWriteØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerWriteØ00__func__Ø000[0], str(11063), 18)
}
// Usage:
//
// assert( assert_pager_state(pPager) );
//
// This function runs many asserts to try to find inconsistencies in
// the internal state of the Pager object.
func _assert_pager_state(tls *crt.TLS, _p *XPager) (r0 int32) {
var _pPager *XPager
_pPager = _p
func() {
if int32(_p.X14) != i32(0) && int32(_p.X14) != i32(1) && int32(_p.X14) != i32(2) && int32(_p.X14) != i32(3) && int32(_p.X14) != i32(4) && int32(_p.X14) != i32(5) && int32(_p.X14) != i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47769), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11081)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X10) != i32(0) && int32(_p.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47782), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11295)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X10) != i32(0) && (_pPager.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47783), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11338)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) != i32(2) && (_p.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47788), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11380)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) == i32(2) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X32).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47789), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11435)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X13) != 0 {
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X31).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47800), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11492)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47801), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11507)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) != i32(2) && int32(_p.X2) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47802), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11517)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X14) == i32(6) || int32(_p.X14) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47805), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11599)))
crt.X__builtin_abort(tls)
}
}()
func() {
if bool2int((*XWal)(_p.X60) != nil) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47806), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11647)))
crt.X__builtin_abort(tls)
}
}()
}
func() {
if int32(_pPager.X16) != i32(0) && int32(_pPager.X15) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47812), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11665)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X15) == i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47813), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11724)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_p.X14) {
case i32(0):
goto _39
case i32(1):
goto _40
case i32(2):
goto _41
case i32(3):
goto _42
case i32(4):
goto _43
case i32(5):
goto _44
case i32(6):
goto _45
default:
goto _46
}
_39:
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47817), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47818), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47819), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11781)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_40:
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47823), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X15) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47824), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X15) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47825), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11866)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_41:
func() {
if int32(_p.X15) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47829), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47830), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
if (*XWal)(_pPager.X60) == nil {
func() {
if int32(_p.X15) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47832), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11888)))
crt.X__builtin_abort(tls)
}
}()
}
func() {
if (_pPager.X22) != (_pPager.X23) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47834), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11912)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X23) != (_pPager.X24) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47835), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11947)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X23) != (_pPager.X25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47836), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11986)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47837), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12025)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_42:
func() {
if int32(_p.X15) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47841), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47842), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
if (*XWal)(_pPager.X60) == nil {
func() {
if int32(_p.X15) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47849), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11888)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X32).X0) == nil && int32(_p.X2) != i32(2) && int32(_p.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47850), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12046)))
crt.X__builtin_abort(tls)
}
}()
}
func() {
if (_pPager.X23) != (_pPager.X24) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47855), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11947)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X23) != (_pPager.X25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47856), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11986)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_43:
func() {
if int32(_p.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47860), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12143)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47861), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47862), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X15) < i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47863), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12189)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X32).X0) == nil && int32(_p.X2) != i32(2) && int32(_p.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47864), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X23) > (_pPager.X25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47868), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12214)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_44:
func() {
if int32(_p.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47872), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12143)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47873), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47874), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_p.X32).X0) == nil && int32(_p.X2) != i32(2) && int32(_p.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47875), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12046)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_45:
func() {
if (_pPager.X26) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47886), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12253)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) <= i32(0) && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(47887), unsafe.Pointer((*int8)(unsafe.Pointer(&_assert_pager_stateØ00__func__Ø000))), unsafe.Pointer(str(12280)))
crt.X__builtin_abort(tls)
}
}()
goto _46
_46:
return i32(1)
}
var _assert_pager_stateØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_assert_pager_stateØ00__func__Ø000[0], str(12341), 19)
}
// Return the total number of references to all pages held by the cache.
//
// This is not the total number of pages referenced, but the sum of the
// reference count for all pages.
func _sqlite3PcacheRefCount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
return _pCache.X3
}
func _subjournalPageIfRequired(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
if _subjRequiresPage(tls, _pPg) != 0 {
return _subjournalPage(tls, _pPg)
}
return i32(0)
}
// Return true if it is necessary to write page *pPg into the sub-journal.
// A page needs to be written into the sub-journal if there exists one
// or more open savepoints for which:
//
// * The page-number is less than or equal to PagerSavepoint.nOrig, and
// * The bit corresponding to the page-number is not set in
// PagerSavepoint.pInSavepoint.
func _subjRequiresPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _i int32
var _pgno uint32
var _pPager *XPager
var _p *XPagerSavepoint
_pPager = (*XPager)(_pPg.X4)
_pgno = _pPg.X5
_i = i32(0)
_0:
if _i >= (_pPager.X38) {
goto _3
}
_p = (*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 44*uintptr(_i)))
if ((_p.X3) >= _pgno) && (i32(0) == _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_p.X2), _pgno)) {
return i32(1)
}
_i += 1
goto _0
_3:
return i32(0)
}
// 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 _sqlite3BitvecTestNotNull(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
var _1_bin, _4_h uint32
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(43840), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BitvecTestNotNullØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
_i -= 1
if _i >= (_p.X0) {
return i32(0)
}
_2:
if (_p.X2) == 0 {
goto _4
}
_1_bin = _i / (_p.X2)
_i = _i % (_p.X2)
_p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin)))
if _p == nil {
return i32(0)
}
goto _2
_4:
if (_p.X0) <= u32(4000) {
return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[500]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8)))))) & (i32(1) << uint(int32(_i&uint32(i32(7)))))) != i32(0))
}
_4_h = (postInc5(&_i, uint32(1)) * uint32(i32(1))) % u32(125)
_8:
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_4_h)))) == 0 {
goto _9
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_4_h)))) == _i {
return i32(1)
}
_4_h = (_4_h + uint32(i32(1))) % u32(125)
goto _8
_9:
return i32(0)
}
var _sqlite3BitvecTestNotNullØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BitvecTestNotNullØ00__func__Ø000[0], str(12360), 25)
}
// Append a record of the current state of page pPg to the sub-journal.
//
// If successful, set the bit corresponding to pPg->pgno in the bitvecs
// for all open savepoints before returning.
//
// This function returns SQLITE_OK if everything is successful, an IO
// error code if the attempt to write to the sub-journal fails, or
// SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint
// bitvec.
func _subjournalPage(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _rc int32
var _2_offset int64
var _2_pData2 *int8
var _2_pData unsafe.Pointer
var _pPager *XPager
_rc = i32(0)
_pPager = (*XPager)(_pPg.X4)
if int32(_pPager.X2) == i32(2) {
goto _0
}
func() {
if (_pPager.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51384), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12385)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil && (*XWal)(_pPager.X60) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51385), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12404)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) == nil && (_pPager.X29) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51386), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12447)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) == nil && _pageInJournal(tls, _pPager, _pPg) == 0 && (_pPg.X5) <= (_pPager.X23) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51387), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12490)))
crt.X__builtin_abort(tls)
}
}()
_rc = _openSubJournal(tls, _pPager)
if _rc != i32(0) {
goto _13
}
_2_pData = _pPg.X1
_2_offset = int64(_pPager.X29) * int64(i32(4)+(_pPager.X48))
_2_pData2 = (*int8)(_2_pData)
_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.X33), _2_offset, _pPg.X5)
if _rc == i32(0) {
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X33), (unsafe.Pointer)(_2_pData2), _pPager.X48, _2_offset+int64(i32(4)))
}
_13:
_0:
if _rc == i32(0) {
*(*uint32)(unsafe.Pointer(&(_pPager.X29))) += 1
func() {
if (_pPager.X38) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51415), unsafe.Pointer((*int8)(unsafe.Pointer(&_subjournalPageØ00__func__Ø000))), unsafe.Pointer(str(12572)))
crt.X__builtin_abort(tls)
}
}()
_rc = _addToSavepointBitvecs(tls, _pPager, _pPg.X5)
}
return _rc
}
var _subjournalPageØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_subjournalPageØ00__func__Ø000[0], str(12593), 15)
}
// Return true if the page is already in the journal file.
func _pageInJournal(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr) (r0 int32) {
return _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.X30), _pPg.X5)
}
func _sqlite3BitvecTest(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
return bool2int((_p != nil) && _sqlite3BitvecTestNotNull(tls, _p, _i) != 0)
}
// Ensure that the sub-journal file is open. If it is already open, this
// function is a no-op.
//
// SQLITE_OK is returned if everything goes according to plan. An
// SQLITE_IOERR_XXX error code is returned if a call to sqlite3OsOpen()
// fails.
func _openSubJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _1_flags, _1_nStmtSpill int32
_rc = i32(0)
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) != nil {
goto _0
}
_1_flags = i32(8222)
_1_nStmtSpill = _sqlite3Config.X9
if (int32(_pPager.X2) == i32(4)) || ((_pPager.X19) != 0) {
_1_nStmtSpill = i32(-1)
}
_rc = _sqlite3JournalOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), nil, (*Xsqlite3_file)(_pPager.X33), _1_flags, _1_nStmtSpill)
_0:
return _rc
}
// 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 _sqlite3JournalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zName *int8, _pJfd *Xsqlite3_file, _flags int32, _nSpill int32) (r0 int32) {
var _p *XMemJournal
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(56))
if _nSpill == i32(0) {
return _sqlite3OsOpen(tls, _pVfs, _zName, _pJfd, _flags, nil)
}
if _nSpill > i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X1))) = _nSpill
goto _2
}
*(*int32)(unsafe.Pointer(&(_p.X1))) = int32(u32(1020))
func() {
if uint32(i32(1024)) != (u32(12) + uint32((_p.X1)-i32(8))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3JournalOpenØ00__func__Ø000))), unsafe.Pointer(str(12608)))
crt.X__builtin_abort(tls)
}
}()
_2:
*(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = &_MemJournalMethods
*(*int32)(unsafe.Pointer(&(_p.X2))) = _nSpill
*(*int32)(unsafe.Pointer(&(_p.X7))) = _flags
*(**int8)(unsafe.Pointer(&(_p.X9))) = _zName
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pVfs
return i32(0)
}
// The next group of routines are convenience wrappers around the
// VFS methods.
func _sqlite3OsOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pFlagsOut *int32) (r0 int32) {
var _rc int32
_rc = (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32
}{(_pVfs.X6)})))(tls, _pVfs, _zPath, _pFile, _flags&i32(556927), _pFlagsOut)
func() {
if _rc != i32(0) && (*Xsqlite3_io_methods)(_pFile.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20292), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OsOpenØ00__func__Ø000))), unsafe.Pointer(str(12668)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3OsOpenØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OsOpenØ00__func__Ø000[0], str(12704), 14)
}
var _sqlite3JournalOpenØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3JournalOpenØ00__func__Ø000[0], str(12718), 19)
}
var _MemJournalMethods Xsqlite3_io_methods
func init() {
_MemJournalMethods = Xsqlite3_io_methods{X0: i32(1), X1: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_memjrnlClose})), X2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_memjrnlRead})), X3: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_memjrnlWrite})), X4: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64) int32
}{_memjrnlTruncate})), X5: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_memjrnlSync})), X6: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int64) int32
}{_memjrnlFileSize})), X7: nil, X8: nil, X9: nil, X10: nil, X11: nil, X12: nil, X13: nil, X14: nil, X15: nil, X16: nil, X17: nil, X18: nil}
}
// Close the file.
func _memjrnlClose(tls *crt.TLS, _pJfd *Xsqlite3_file) (r0 int32) {
var _p *XMemJournal
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
_memjrnlFreeChunks(tls, _p)
return i32(0)
}
// Free the list of FileChunk structures headed at MemJournal.pFirst.
func _memjrnlFreeChunks(tls *crt.TLS, _p *XMemJournal) {
var _pIter, _pNext *XFileChunk
_pIter = (*XFileChunk)(_p.X4)
_0:
if _pIter == nil {
goto _3
}
_pNext = (*XFileChunk)(_pIter.X0)
Xsqlite3_free(tls, (unsafe.Pointer)(_pIter))
_pIter = _pNext
goto _0
_3:
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = nil
}
// Read data from the in-memory journal file. This is the implementation
// of the sqlite3_vfs.xRead method.
func _memjrnlRead(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
var _nRead, _iChunkOffset, _4_iSpace, _4_nCopy int32
var _1_iOff int64
var _zOut *uint8
var _p *XMemJournal
var _pChunk *XFileChunk
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
_zOut = (*uint8)(_zBuf)
_nRead = _iAmt
func() {
if (int64(_iAmt) + _iOfst) > ((*t23)(unsafe.Pointer(&(_p.X5))).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88870), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12737)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*t23)(unsafe.Pointer(&(_p.X6))).X0) != int64(i32(0)) && (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X6))).X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88871), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12771)))
crt.X__builtin_abort(tls)
}
}()
if ((*t23)(unsafe.Pointer(&(_p.X6))).X0) == _iOfst && _iOfst != int64(i32(0)) {
goto _6
}
_1_iOff = i64(0)
_pChunk = (*XFileChunk)(_p.X4)
_7:
if func() int32 {
if _pChunk != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88875), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || (_1_iOff+int64(_p.X1)) > _iOfst {
goto _13
}
{
p := &_1_iOff
*p = (*p) + int64(_p.X1)
sink6 = *p
}
_pChunk = (*XFileChunk)(_pChunk.X0)
goto _7
_13:
goto _14
_6:
_pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X6))).X1)
func() {
if _pChunk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88882), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlReadØ00__func__Ø000))), unsafe.Pointer(str(12821)))
crt.X__builtin_abort(tls)
}
}()
_14:
_iChunkOffset = int32(_iOfst % int64(_p.X1))
_17:
_4_iSpace = (_p.X1) - _iChunkOffset
_4_nCopy = func() int32 {
if _nRead < ((_p.X1) - _iChunkOffset) {
return _nRead
}
return ((_p.X1) - _iChunkOffset)
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_zOut), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&(_pChunk.X1)))))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_iChunkOffset)))))))), uint32(_4_nCopy))
{
p := &_zOut
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_4_nCopy)))
sink13 = *p
}
{
p := &_nRead
*p = (*p) - _4_iSpace
sink1 = *p
}
_iChunkOffset = i32(0)
if ((_nRead >= i32(0)) && (store24(&_pChunk, (*XFileChunk)(_pChunk.X0)) != nil)) && (_nRead > i32(0)) {
goto _17
}
*(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X0))) = func() int64 {
if _pChunk != nil {
return (_iOfst + int64(_iAmt))
}
return int64(i32(0))
}()
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X1))))) = _pChunk
return i32(0)
}
var _memjrnlReadØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_memjrnlReadØ00__func__Ø000[0], str(12831), 12)
}
// Write data to the file.
func _memjrnlWrite(tls *crt.TLS, _pJfd *Xsqlite3_file, _zBuf unsafe.Pointer, _iAmt int32, _iOfst int64) (r0 int32) {
var _nWrite, _1_rc, _5_iChunkOffset, _5_iSpace int32
var _zWrite *uint8
var _p *XMemJournal
var _5_pChunk, _6_pNew *XFileChunk
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
_nWrite = _iAmt
_zWrite = (*uint8)(_zBuf)
if (_p.X2) <= i32(0) || (int64(_iAmt)+_iOfst) <= int64(_p.X2) {
goto _1
}
_1_rc = _memjrnlCreateFile(tls, _p)
if _1_rc == i32(0) {
_1_rc = _sqlite3OsWrite(tls, _pJfd, _zBuf, _iAmt, _iOfst)
}
return _1_rc
_1:
func() {
if _iOfst != ((*t23)(unsafe.Pointer(&(_p.X5))).X0) && _iOfst != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88982), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iOfst <= int64(i32(0)) && (*XFileChunk)(_p.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88989), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12882)))
crt.X__builtin_abort(tls)
}
}()
_10:
if _nWrite <= i32(0) {
goto _11
}
_5_pChunk = (*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X5))).X1)
_5_iChunkOffset = int32(((*t23)(unsafe.Pointer(&(_p.X5))).X0) % int64(_p.X1))
_5_iSpace = func() int32 {
if _nWrite < ((_p.X1) - _5_iChunkOffset) {
return _nWrite
}
return ((_p.X1) - _5_iChunkOffset)
}()
if _5_iChunkOffset != i32(0) {
goto _14
}
_6_pNew = (*XFileChunk)(Xsqlite3_malloc(tls, int32(u32(12)+uint32((_p.X1)-i32(8)))))
if _6_pNew == nil {
return _sqlite3IoerrnomemError(tls, i32(89001))
}
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X0))))) = nil
if _5_pChunk != nil {
func() {
if (*XFileChunk)(_p.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89005), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12906)))
crt.X__builtin_abort(tls)
}
}()
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pChunk.X0))))) = _6_pNew
goto _19
}
func() {
if (*XFileChunk)(_p.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89008), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlWriteØ00__func__Ø000))), unsafe.Pointer(str(12916)))
crt.X__builtin_abort(tls)
}
}()
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _6_pNew
_19:
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X1))))) = _6_pNew
_14:
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*[8]uint8)(unsafe.Pointer(&((*XFileChunk)((*t23)(unsafe.Pointer(&(_p.X5))).X1).X1)))))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_5_iChunkOffset)))))))), (unsafe.Pointer)(_zWrite), uint32(_5_iSpace))
{
p := &_zWrite
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_5_iSpace)))
sink13 = *p
}
{
p := &_nWrite
*p = (*p) - _5_iSpace
sink1 = *p
}
{
p := (*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X0)))
*p = (*p) + int64(_5_iSpace)
sink6 = *p
}
goto _10
_11:
*(*int32)(unsafe.Pointer(&(_p.X3))) = int32(int64(_iAmt) + _iOfst)
return i32(0)
}
// Flush the contents of memory to a real file on disk.
func _memjrnlCreateFile(tls *crt.TLS, _p *XMemJournal) (r0 int32) {
var _rc, _1_nChunk int32
var _1_iOff int64
var _pReal *Xsqlite3_file
var _copy XMemJournal
var _1_pIter *XFileChunk
_pReal = (*Xsqlite3_file)(unsafe.Pointer(_p))
_copy = *_p
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(56))
_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_copy.X8), _copy.X9, _pReal, _copy.X7, nil)
if _rc != i32(0) {
goto _0
}
_1_nChunk = _copy.X1
_1_iOff = i64(0)
_1_pIter = (*XFileChunk)(_copy.X4)
_1:
if _1_pIter == nil {
goto _4
}
if (_1_iOff + int64(_1_nChunk)) > ((*t23)(unsafe.Pointer(&(_copy.X5))).X0) {
_1_nChunk = int32(((*t23)(unsafe.Pointer(&(_copy.X5))).X0) - _1_iOff)
}
_rc = _sqlite3OsWrite(tls, _pReal, (unsafe.Pointer)((*[8]uint8)(unsafe.Pointer(&(_1_pIter.X1)))), _1_nChunk, _1_iOff)
if _rc != 0 {
goto _4
}
{
p := &_1_iOff
*p = (*p) + int64(_1_nChunk)
sink6 = *p
}
_1_pIter = (*XFileChunk)(_1_pIter.X0)
goto _1
_4:
if _rc == i32(0) {
_memjrnlFreeChunks(tls, &_copy)
}
_0:
if _rc != i32(0) {
_sqlite3OsClose(tls, _pReal)
*_p = _copy
}
return _rc
}
func _sqlite3OsWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
}{((*Xsqlite3_io_methods)(_id.X0).X3)})))(tls, _id, _pBuf, _amt, _offset)
}
// 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 _sqlite3OsClose(tls *crt.TLS, _pId *Xsqlite3_file) {
if (*Xsqlite3_io_methods)(_pId.X0) != nil {
(*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_pId.X0).X1)})))(tls, _pId)
*(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pId.X0))))) = nil
}
}
var _memjrnlWriteØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_memjrnlWriteØ00__func__Ø000[0], str(12927), 13)
}
// This version of the memory allocation is for use by the application.
// First make sure the memory subsystem is initialized, then do the
// allocation.
func Xsqlite3_malloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
if Xsqlite3_initialize(tls) != 0 {
return nil
}
return func() unsafe.Pointer {
if _n <= i32(0) {
return unsafe.Pointer(nil)
}
return _sqlite3Malloc(tls, uint64(_n))
}()
}
func _sqlite3IoerrnomemError(tls *crt.TLS, _lineno int32) (r0 int32) {
return _reportError(tls, i32(3082), _lineno, str(12940))
}
// Truncate the file.
//
// If the journal file is already on disk, truncate it there. Or, if it
// is still in main memory but is being truncated to zero bytes in size,
// ignore
func _memjrnlTruncate(tls *crt.TLS, _pJfd *Xsqlite3_file, _size int64) (r0 int32) {
var _p *XMemJournal
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
if func() int32 {
if _size == int64(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89035), unsafe.Pointer((*int8)(unsafe.Pointer(&_memjrnlTruncateØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_memjrnlFreeChunks(tls, _p)
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(0)
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X1))))) = nil
*(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X5))).X0))) = int64(i32(0))
*(**XFileChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X1))))) = nil
*(*int64)(unsafe.Pointer(&((*t23)(unsafe.Pointer(&(_p.X6))).X0))) = int64(i32(0))
}
return i32(0)
}
var _memjrnlTruncateØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_memjrnlTruncateØ00__func__Ø000[0], str(12954), 16)
}
// Sync the file.
//
// If the real file has been created, call its xSync method. Otherwise,
// syncing an in-memory journal is a no-op.
func _memjrnlSync(tls *crt.TLS, _pJfd *Xsqlite3_file, _flags int32) (r0 int32) {
_ = _flags
return i32(0)
}
// Query the size of the file in bytes.
func _memjrnlFileSize(tls *crt.TLS, _pJfd *Xsqlite3_file, _pSize *int64) (r0 int32) {
var _p *XMemJournal
_p = (*XMemJournal)(unsafe.Pointer(_pJfd))
*_pSize = (*t23)(unsafe.Pointer(&(_p.X5))).X0
return i32(0)
}
// Write a 32-bit integer into the given file descriptor. Return SQLITE_OK
// on success or an error code is something goes wrong.
func _write32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _val uint32) (r0 int32) {
var _ac [4]int8
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(&_ac)))), _val)
return _sqlite3OsWrite(tls, _fd, (unsafe.Pointer)(&_ac), i32(4), _offset)
_ = _ac
panic(0)
}
func _sqlite3Put4byte(tls *crt.TLS, _p *uint8, _v uint32) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(_v >> uint(i32(24)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))) = uint8(_v >> uint(i32(16)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(2)))) = uint8(_v >> uint(i32(8)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(3)))) = uint8(_v)
}
// Set the bit number pgno in the PagerSavepoint.pInSavepoint
// bitvecs of all open savepoints. Return SQLITE_OK if successful
// or SQLITE_NOMEM if a malloc failure occurs.
func _addToSavepointBitvecs(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 int32) {
var _ii, _rc int32
var _1_p *XPagerSavepoint
_rc = i32(0)
_ii = i32(0)
_0:
if _ii >= (_pPager.X38) {
goto _3
}
_1_p = (*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 44*uintptr(_ii)))
if _pgno <= (_1_p.X3) {
{
p := &_rc
*p = (*p) | _sqlite3BitvecSet(tls, (*XBitvec)(_1_p.X2), _pgno)
sink1 = *p
}
func() {
if _rc != i32(0) && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48693), unsafe.Pointer((*int8)(unsafe.Pointer(&_addToSavepointBitvecsØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
}
_ii += 1
goto _0
_3:
return _rc
}
// 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 _sqlite3BitvecSet(tls *crt.TLS, _p *XBitvec, _i uint32) (r0 int32) {
var _8_rc int32
var _h, _1_bin, _8_j uint32
var _8_aiValues *uint32
if _p == nil {
return i32(0)
}
func() {
if _i <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(43881), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000))), unsafe.Pointer(str(12970)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _i > (_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(43882), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BitvecSetØ00__func__Ø000))), unsafe.Pointer(str(12974)))
crt.X__builtin_abort(tls)
}
}()
_i -= 1
_5:
if (_p.X0) <= u32(4000) || (_p.X2) == 0 {
goto _6
}
_1_bin = _i / (_p.X2)
_i = _i % (_p.X2)
if (*(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin)))) != nil {
goto _8
}
*(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin))) = _sqlite3BitvecCreate(tls, _p.X2)
if (*(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin)))) == nil {
return _sqlite3NomemError(tls, i32(43889))
}
_8:
_p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin)))
goto _5
_6:
if (_p.X0) <= u32(4000) {
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[500]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8)))))
*p = uint8(int32(*p) | (i32(1) << uint(int32(_i&uint32(i32(7))))))
sink2 = *p
}
return i32(0)
}
_h = (postInc5(&_i, uint32(1)) * uint32(i32(1))) % u32(125)
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) != 0 {
goto _11
}
if (_p.X1) < u32(124) {
goto _bitvec_set_end
}
goto _bitvec_set_rehash
_11:
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) == _i {
return i32(0)
}
_h += 1
if _h >= u32(125) {
_h = uint32(i32(0))
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h)))) != 0 {
goto _11
}
_bitvec_set_rehash:
if (_p.X1) < u32(62) {
goto _bitvec_set_end
}
_8_aiValues = (*uint32)(_sqlite3DbMallocRaw(tls, nil, uint64(u32(500))))
if _8_aiValues == nil {
return _sqlite3NomemError(tls, i32(43924))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_8_aiValues), (unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), u32(500))
crt.Xmemset(tls, (unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), i32(0), u32(500))
*(*uint32)(unsafe.Pointer(&(_p.X2))) = (((_p.X0) + u32(125)) - uint32(i32(1))) / u32(125)
_8_rc = _sqlite3BitvecSet(tls, _p, _i)
_8_j = uint32(i32(0))
_20:
if _8_j >= u32(125) {
goto _23
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aiValues)) + 4*uintptr(_8_j)))) != 0 {
{
p := &_8_rc
*p = (*p) | _sqlite3BitvecSet(tls, _p, *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aiValues)) + 4*uintptr(_8_j))))
sink1 = *p
}
}
_8_j += 1
goto _20
_23:
_sqlite3DbFree(tls, nil, (unsafe.Pointer)(_8_aiValues))
return _8_rc
_bitvec_set_end:
*(*uint32)(unsafe.Pointer(&(_p.X1))) += 1
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_h))) = _i
return i32(0)
}
var _sqlite3BitvecSetØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BitvecSetØ00__func__Ø000[0], str(12986), 17)
}
// 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 _sqlite3BitvecCreate(tls *crt.TLS, _iSize uint32) (r0 *XBitvec) {
var _p *XBitvec
i32(0)
_p = (*XBitvec)(_sqlite3MallocZero(tls, uint64(u32(512))))
if _p != nil {
*(*uint32)(unsafe.Pointer(&(_p.X0))) = _iSize
}
return _p
}
var _addToSavepointBitvecsØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_addToSavepointBitvecsØ00__func__Ø000[0], str(13003), 22)
}
// This is a variant of sqlite3PagerWrite() that runs when the sector size
// is larger than the page size. SQLite makes the (reasonable) assumption that
// all bytes of a sector are written together by hardware. Hence, all bytes of
// a sector need to be journalled in case of a power loss in the middle of
// a write.
//
// Usually, the sector size is less than or equal to the page size, in which
// case pages can be individually written. This routine only runs in the
// exceptional case where the page size is smaller than the sector size.
func _pagerWriteLargeSector(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _rc, _nPage, _ii, _needSync int32
var _nPageCount, _pg1, _nPagePerSector, _4_pg uint32
var _pPager *XPager
var _4_pPage, _12_pPage *XPgHdr
_rc = i32(0)
_nPage = i32(0)
_needSync = i32(0)
_pPager = (*XPager)(_pPg.X4)
_nPagePerSector = (_pPager.X47) / uint32(_pPager.X48)
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52907), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pPager.X18) & i32(4)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52908), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13025)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
_pg1 = (((_pPg.X5) - uint32(i32(1))) & (^(_nPagePerSector - uint32(i32(1))))) + uint32(i32(1))
_nPageCount = _pPager.X22
if (_pPg.X5) > _nPageCount {
_nPage = int32(((_pPg.X5) - _pg1) + uint32(i32(1)))
goto _7
}
if ((_pg1 + _nPagePerSector) - uint32(i32(1))) > _nPageCount {
_nPage = int32((_nPageCount + uint32(i32(1))) - _pg1)
goto _7
}
_nPage = int32(_nPagePerSector)
_7:
func() {
if _nPage <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52925), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13068)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pg1 > (_pPg.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52926), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13076)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pg1 + uint32(_nPage)) <= (_pPg.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52927), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13091)))
crt.X__builtin_abort(tls)
}
}()
_ii = i32(0)
_14:
if _ii >= _nPage || _rc != i32(0) {
goto _18
}
_4_pg = _pg1 + uint32(_ii)
if _4_pg != (_pPg.X5) && _sqlite3BitvecTest(tls, (*XBitvec)(_pPager.X30), _4_pg) != 0 {
goto _20
}
if _4_pg == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) {
goto _21
}
_rc = _sqlite3PagerGet(tls, _pPager, _4_pg, &_4_pPage, i32(0))
if _rc != i32(0) {
goto _22
}
_rc = _pager_write(tls, _4_pPage)
if (int32(_4_pPage.X6) & i32(8)) != 0 {
_needSync = i32(1)
}
_sqlite3PagerUnrefNotNull(tls, _4_pPage)
_22:
_21:
goto _25
_20:
if store25(&_4_pPage, _sqlite3PagerLookup(tls, _pPager, _4_pg)) == nil {
goto _25
}
if (int32(_4_pPage.X6) & i32(8)) != 0 {
_needSync = i32(1)
}
_sqlite3PagerUnrefNotNull(tls, _4_pPage)
_25:
_ii += 1
goto _14
_18:
if _rc != i32(0) || _needSync == 0 {
goto _28
}
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52958), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
_ii = i32(0)
_31:
if _ii >= _nPage {
goto _34
}
_12_pPage = _sqlite3PagerLookup(tls, _pPager, _pg1+uint32(_ii))
if _12_pPage != nil {
{
p := (*uint16)(unsafe.Pointer(&(_12_pPage.X6)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
_sqlite3PagerUnrefNotNull(tls, _12_pPage)
}
_ii += 1
goto _31
_34:
_28:
func() {
if (int32(_pPager.X18) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52968), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWriteLargeSectorØ00__func__Ø000))), unsafe.Pointer(str(13113)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) & i32(-5))
sink2 = *p
}
return _rc
}
var _pagerWriteLargeSectorØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pagerWriteLargeSectorØ00__func__Ø000[0], str(13156), 22)
}
var _sqlite3PendingByte int32
func init() {
_sqlite3PendingByte = i32(1073741824)
}
// Dispatch all page fetch requests to the appropriate getter method.
func _sqlite3PagerGet(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
return (*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32
}{(_pPager.X57)})))(tls, _pPager, _pgno, _ppPage, _flags)
}
// Mark a single data page as writeable. The page is written into the
// main journal or sub-journal as required. If the page is written into
// one of the journals, the corresponding bit is set in the
// Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs
// of any open savepoints as appropriate.
func _pager_write(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _rc int32
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
_rc = i32(0)
func() {
if int32(_pPager.X14) != i32(2) && int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52809), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13178)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52813), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52814), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13293)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52815), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13312)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X14) != i32(2) {
goto _10
}
_rc = _pager_open_journal(tls, _pPager)
if _rc != i32(0) {
return _rc
}
_10:
func() {
if int32(_pPager.X14) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52831), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13332)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52832), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3PcacheMakeDirty(tls, _pPg)
func() {
if ((*XBitvec)(_pPager.X30) != nil) != ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52841), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13370)))
crt.X__builtin_abort(tls)
}
}()
if (*XBitvec)(_pPager.X30) == nil || _sqlite3BitvecTestNotNull(tls, (*XBitvec)(_pPager.X30), _pPg.X5) != i32(0) {
goto _19
}
func() {
if bool2int((*XWal)(_pPager.X60) != nil) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52845), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_writeØ00__func__Ø000))), unsafe.Pointer(str(13417)))
crt.X__builtin_abort(tls)
}
}()
if (_pPg.X5) > (_pPager.X23) {
goto _22
}
_rc = _pagerAddPageToRollbackJournal(tls, _pPg)
if _rc != i32(0) {
return _rc
}
goto _24
_22:
if int32(_pPager.X14) != i32(4) {
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
}
_24:
_19:
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
if (_pPager.X38) > i32(0) {
_rc = _subjournalPageIfRequired(tls, _pPg)
}
if (_pPager.X22) < (_pPg.X5) {
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _pPg.X5
}
return _rc
}
var _pager_writeØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pager_writeØ00__func__Ø000[0], str(13440), 12)
}
// This function is called at the start of every write transaction.
// There must already be a RESERVED or EXCLUSIVE lock on the database
// file when this routine is called.
//
// Open the journal file for pager pPager and write a journal header
// to the start of it. If there are active savepoints, open the sub-journal
// as well. This function is only used when the journal file is being
// opened to write a rollback log for a transaction. It is not used
// when opening a hot journal file to roll it back.
//
// If the journal file is already open (as it may be in exclusive mode),
// then this function just writes a journal header to the start of the
// already open file.
//
// Whether or not the journal file is opened by this function, the
// Pager.pInJournal bitvec structure is allocated.
//
// Return SQLITE_OK if everything is successful. Otherwise, return
// SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or
// an IO error code if opening or writing the journal file fails.
func _pager_open_journal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _5_flags, _5_nSpill int32
var _pVfs *Xsqlite3_vfs
_rc = i32(0)
_pVfs = (*Xsqlite3_vfs)(_pPager.X0)
func() {
if int32(_pPager.X14) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52590), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(13452)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52591), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBitvec)(_pPager.X30) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52592), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(13488)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (_pPager.X26) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52597), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _pPager.X26
}
if (*XWal)(_pPager.X60) != nil || int32(_pPager.X2) == i32(2) {
goto _10
}
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = _sqlite3BitvecCreate(tls, _pPager.X22)
if (*XBitvec)(_pPager.X30) == nil {
return _sqlite3NomemError(tls, i32(52602))
}
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil {
goto _12
}
if int32(_pPager.X2) == i32(4) {
_sqlite3MemJournalOpen(tls, (*Xsqlite3_file)(_pPager.X32))
goto _14
}
_5_flags = i32(6)
if (_pPager.X10) != 0 {
{
p := &_5_flags
*p = (*p) | i32(4104)
sink1 = *p
}
_5_nSpill = _sqlite3Config.X9
goto _16
}
{
p := &_5_flags
*p = (*p) | i32(2048)
sink1 = *p
}
_5_nSpill = i32(0)
_16:
_rc = _databaseIsUnmoved(tls, _pPager)
if _rc == i32(0) {
_rc = _sqlite3JournalOpen(tls, _pVfs, _pPager.X52, (*Xsqlite3_file)(_pPager.X32), _5_flags, _5_nSpill)
}
_14:
func() {
if _rc == i32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52630), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(13510)))
crt.X__builtin_abort(tls)
}
}()
_12:
if _rc == i32(0) {
*(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0)
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0))
*(*int64)(unsafe.Pointer(&(_pPager.X35))) = int64(i32(0))
_rc = _writeJournalHdr(tls, _pPager)
}
_10:
if _rc != i32(0) {
_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30))
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil
goto _23
}
func() {
if int32(_pPager.X14) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52651), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_open_journalØ00__func__Ø000))), unsafe.Pointer(str(13452)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(3))
_23:
return _rc
}
var _pager_open_journalØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_pager_open_journalØ00__func__Ø000[0], str(13547), 19)
}
// Open an in-memory journal file.
func _sqlite3MemJournalOpen(tls *crt.TLS, _pJfd *Xsqlite3_file) {
_sqlite3JournalOpen(tls, nil, nil, _pJfd, i32(0), i32(-1))
}
// Verify that the database file has not be deleted or renamed out from
// under the pager. Return SQLITE_OK if the database is still were it ought
// to be on disk. Return non-zero (SQLITE_READONLY_DBMOVED or some other error
// code from sqlite3OsAccess()) if the database has gone missing.
func _databaseIsUnmoved(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _bHasMoved, _rc int32
_bHasMoved = i32(0)
if (_pPager.X10) != 0 {
return i32(0)
}
if (_pPager.X22) == uint32(i32(0)) {
return i32(0)
}
func() {
if (_pPager.X51) == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X51)) + 1*uintptr(i32(0))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51865), unsafe.Pointer((*int8)(unsafe.Pointer(&_databaseIsUnmovedØ00__func__Ø000))), unsafe.Pointer(str(13566)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(20), (unsafe.Pointer)(&_bHasMoved))
if _rc == i32(12) {
_rc = i32(0)
goto _8
}
if (_rc == i32(0)) && _bHasMoved != 0 {
_rc = i32(1032)
}
_8:
return _rc
}
var _databaseIsUnmovedØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_databaseIsUnmovedØ00__func__Ø000[0], str(13608), 18)
}
// 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 _sqlite3OsFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X10)})))(tls, _id, _op, _pArg)
}
// The journal file must be open when this routine is called. A journal
// header (JOURNAL_HDR_SZ bytes) is written into the journal file at the
// current location.
//
// The format for the journal header is as follows:
// - 8 bytes: Magic identifying journal format.
// - 4 bytes: Number of records in journal, or -1 no-sync mode is on.
// - 4 bytes: Random number used for page hash.
// - 4 bytes: Initial database page count.
// - 4 bytes: Sector size used by the process that wrote this journal.
// - 4 bytes: Database page size.
//
// Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space.
func _writeJournalHdr(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _ii int32
var _nHeader, _nWrite uint32
var _zHeader *int8
_rc = i32(0)
_zHeader = _pPager.X58
_nHeader = uint32(_pPager.X48)
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48342), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13626)))
crt.X__builtin_abort(tls)
}
}()
if _nHeader > (_pPager.X47) {
_nHeader = _pPager.X47
}
_ii = i32(0)
_3:
if _ii >= (_pPager.X38) {
goto _6
}
if ((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 44*uintptr(_ii))).X1) == int64(i32(0)) {
*(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 44*uintptr(_ii))).X1))) = _pPager.X34
}
_ii += 1
goto _3
_6:
*(*int64)(unsafe.Pointer(&(_pPager.X35))) = store6((*int64)(unsafe.Pointer(&(_pPager.X34))), _journalHdrOffset(tls, _pPager))
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48380), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13646)))
crt.X__builtin_abort(tls)
}
}()
if (((_pPager.X4) != 0) || (int32(_pPager.X2) == i32(4))) || (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))&i32(512)) != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)(_zHeader), (unsafe.Pointer)(&_aJournalMagic), u32(8))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(8)))))), u32(4294967295))
goto _14
}
crt.Xmemset(tls, (unsafe.Pointer)(_zHeader), i32(0), u32(12))
_14:
Xsqlite3_randomness(tls, int32(u32(4)), (unsafe.Pointer)((*uint32)(unsafe.Pointer(&(_pPager.X28)))))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(12)))))), _pPager.X28)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(16)))))), _pPager.X23)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(20)))))), _pPager.X47)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(24)))))), uint32(_pPager.X48))
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHeader))+1*uintptr(u32(28))))), i32(0), _nHeader-u32(28))
_nWrite = uint32(i32(0))
_15:
if _rc != i32(0) || _nWrite >= (_pPager.X47) {
goto _19
}
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_zHeader), int32(_nHeader), _pPager.X34)
func() {
if (_pPager.X35) > (_pPager.X34) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48429), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13683)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*int64)(unsafe.Pointer(&(_pPager.X34)))
*p = (*p) + int64(_nHeader)
sink6 = *p
}
{
p := &_nWrite
*p = (*p) + _nHeader
sink5 = *p
}
goto _15
_19:
return _rc
}
var _writeJournalHdrØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_writeJournalHdrØ00__func__Ø000[0], str(13724), 16)
}
// Return the offset of the sector boundary at or immediately
// following the value in pPager->journalOff, assuming a sector
// size of pPager->sectorSize bytes.
//
// i.e for a sector size of 512:
//
// Pager.journalOff Return value
// ---------------------------------------
// 0 0
// 512 512
// 100 512
// 2000 2048
//
func _journalHdrOffset(tls *crt.TLS, _pPager *XPager) (r0 int64) {
var _offset, _c int64
_offset = i64(0)
_c = _pPager.X34
if _c != 0 {
_offset = (((_c - int64(i32(1))) / int64(_pPager.X47)) + int64(i32(1))) * int64(_pPager.X47)
}
func() {
if (_offset % int64(_pPager.X47)) != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48258), unsafe.Pointer((*int8)(unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000))), unsafe.Pointer(str(13740)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _offset < _c {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48259), unsafe.Pointer((*int8)(unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000))), unsafe.Pointer(str(13773)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_offset - _c) >= int64(_pPager.X47) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48260), unsafe.Pointer((*int8)(unsafe.Pointer(&_journalHdrOffsetØ00__func__Ø000))), unsafe.Pointer(str(13783)))
crt.X__builtin_abort(tls)
}
}()
return _offset
}
var _journalHdrOffsetØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_journalHdrOffsetØ00__func__Ø000[0], str(13817), 17)
}
func _sqlite3OsDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X12)})))(tls, _id)
}
var _aJournalMagic [8]uint8
func init() {
_aJournalMagic = [8]uint8{217, 213, 5, 249, 32, 161, 99, 215}
}
// Return N random bytes.
func Xsqlite3_randomness(tls *crt.TLS, _N int32, _pBuf unsafe.Pointer) {
var _2_i int32
var _t uint8
var _zBuf *uint8
var _mutex *Xsqlite3_mutex
var _2_k [256]int8
_zBuf = (*uint8)(_pBuf)
if Xsqlite3_initialize(tls) != 0 {
return
}
_mutex = _sqlite3MutexAlloc(tls, i32(5))
Xsqlite3_mutex_enter(tls, _mutex)
if (_N <= i32(0)) || (_pBuf == nil) {
*(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X0))) = uint8(i32(0))
Xsqlite3_mutex_leave(tls, _mutex)
return
}
if (_sqlite3Prng.X0) != 0 {
goto _3
}
*(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X1))) = uint8(i32(0))
_sqlite3OsRandomness(tls, Xsqlite3_vfs_find(tls, nil), i32(256), (*int8)(unsafe.Pointer(&_2_k)))
_2_i = i32(0)
_4:
if _2_i >= i32(256) {
goto _7
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i))) = uint8(_2_i)
_2_i += 1
goto _4
_7:
_2_i = i32(0)
_8:
if _2_i >= i32(256) {
goto _11
}
{
p := (*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2)))
*p = uint8(int32(*p) + (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i)))) + int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_2_k)) + 1*uintptr(_2_i))))))
sink2 = *p
}
_t = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_2_i))) = _t
_2_i += 1
goto _8
_11:
*(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X0))) = uint8(i32(1))
_3:
func() {
if _N <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26805), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_randomnessØ00__func__Ø000))), unsafe.Pointer(str(13834)))
crt.X__builtin_abort(tls)
}
}()
_14:
*(*uint8)(unsafe.Pointer(&(_sqlite3Prng.X1))) += 1
_t = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1)))
{
p := (*uint8)(unsafe.Pointer(&(_sqlite3Prng.X2)))
*p = uint8(int32(*p) + int32(_t))
sink2 = *p
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X2))) = _t
{
p := &_t
*p = uint8(int32(*p) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_sqlite3Prng.X1)))))
sink2 = *p
}
*postInc13(&_zBuf, 1) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[256]uint8)(unsafe.Pointer(&(_sqlite3Prng.X3))))) + 1*uintptr(_t)))
if preInc1(&_N, -1) != 0 {
goto _14
}
Xsqlite3_mutex_leave(tls, _mutex)
_ = _zBuf
_ = _2_k
}
var _sqlite3Prng Tsqlite3PrngType
// SQLITE_OMIT_LOAD_EXTENSION
func _sqlite3OsRandomness(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _nByte int32, _zBufOut *int8) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
}{(_pVfs.X14)})))(tls, _pVfs, _nByte, _zBufOut)
}
// Locate a VFS by name. If no name is given, simply return the
// first VFS on the list.
func Xsqlite3_vfs_find(tls *crt.TLS, _zVfs *int8) (r0 *Xsqlite3_vfs) {
var _rc int32
var _mutex *Xsqlite3_mutex
var _pVfs *Xsqlite3_vfs
_pVfs = nil
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return nil
}
_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _mutex)
_pVfs = _vfsList
_1:
if _pVfs == nil {
goto _4
}
if _zVfs == nil {
goto _4
}
if crt.Xstrcmp(tls, _zVfs, _pVfs.X4) == i32(0) {
goto _4
}
_pVfs = (*Xsqlite3_vfs)(_pVfs.X3)
goto _1
_4:
Xsqlite3_mutex_leave(tls, _mutex)
return _pVfs
}
var _vfsList *Xsqlite3_vfs
var _sqlite3_randomnessØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_randomnessØ00__func__Ø000[0], str(13838), 19)
}
// Destroy a bitmap object. Reclaim all memory used.
func _sqlite3BitvecDestroy(tls *crt.TLS, _p *XBitvec) {
var _1_i uint32
if _p == nil {
return
}
if (_p.X2) == 0 {
goto _1
}
_1_i = uint32(i32(0))
_2:
if _1_i >= u32(125) {
goto _5
}
_sqlite3BitvecDestroy(tls, *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_i))))
_1_i += 1
goto _2
_5:
_1:
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
}
// Make sure the page is marked as dirty. If it isn't dirty already,
// make it so.
func _sqlite3PcacheMakeDirty(tls *crt.TLS, _p *XPgHdr) {
func() {
if int32(_p.X7) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X6) & i32(17)) == 0 {
goto _4
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) & i32(-17))
sink14 = *p
}
if (int32(_p.X6) & i32(1)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) ^ i32(3))
sink14 = *p
}
func() {
if (int32(_p.X6) & i32(3)) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44686), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000))), unsafe.Pointer(str(13894)))
crt.X__builtin_abort(tls)
}
}()
_pcacheManageDirtyList(tls, _p, uint8(i32(2)))
}
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44689), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeDirtyØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
_4:
}
var _sqlite3PcacheMakeDirtyØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheMakeDirtyØ00__func__Ø000[0], str(13946), 23)
}
func _sqlite3PcachePageSanity(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _pCache *XPCache
func() {
if _pPg == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44233), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(13969)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPg.X5) <= uint32(i32(0)) && (*XPager)(_pPg.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(13976)))
crt.X__builtin_abort(tls)
}
}()
_pCache = (*XPCache)(_pPg.X8)
func() {
if _pCache == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44236), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(14006)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pPg.X6) & i32(1)) != 0 {
func() {
if (int32(_pPg.X6) & i32(2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(14016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr)(_pCache.X0) == _pPg {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44239), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(14046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr)(_pCache.X1) == _pPg {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44240), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(14066)))
crt.X__builtin_abort(tls)
}
}()
}
if (int32(_pPg.X6) & i32(4)) != 0 {
func() {
if (int32(_pPg.X6) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44244), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePageSanityØ00__func__Ø000))), unsafe.Pointer(str(14090)))
crt.X__builtin_abort(tls)
}
}()
}
return i32(1)
}
var _sqlite3PcachePageSanityØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcachePageSanityØ00__func__Ø000[0], str(14115), 24)
}
// Manage pPage's participation on the dirty list. Bits of the addRemove
// argument determines what operation to do. The 0x01 bit means first
// remove pPage from the dirty list. The 0x02 means add pPage back to
// the dirty list. Doing both moves pPage to the front of the dirty list.
func _pcacheManageDirtyList(tls *crt.TLS, _pPage *XPgHdr, _addRemove uint8) {
var _p *XPCache
_p = (*XPCache)(_pPage.X8)
if (int32(_addRemove) & i32(1)) == 0 {
goto _0
}
func() {
if (*XPgHdr)(_pPage.X9) == nil && _pPage != (*XPgHdr)(_p.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44288), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14139)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr)(_pPage.X10) == nil && _pPage != (*XPgHdr)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44289), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14181)))
crt.X__builtin_abort(tls)
}
}()
if (*XPgHdr)(_p.X2) == _pPage {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*XPgHdr)(_pPage.X10)
}
if (*XPgHdr)(_pPage.X9) != nil {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X9).X10))))) = (*XPgHdr)(_pPage.X10)
goto _9
}
func() {
if _pPage != (*XPgHdr)(_p.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44299), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14219)))
crt.X__builtin_abort(tls)
}
}()
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XPgHdr)(_pPage.X10)
_9:
if (*XPgHdr)(_pPage.X10) != nil {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X10).X9))))) = (*XPgHdr)(_pPage.X9)
goto _13
}
func() {
if _pPage != (*XPgHdr)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44309), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14240)))
crt.X__builtin_abort(tls)
}
}()
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = (*XPgHdr)(_pPage.X9)
func() {
if (_p.X8) == 0 && int32(_p.X9) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44311), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14257)))
crt.X__builtin_abort(tls)
}
}()
if (*XPgHdr)(_p.X0) == nil {
func() {
if int32(_p.X8) != i32(0) && int32(_p.X9) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44313), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14288)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(2))
}
_13:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X9))))) = nil
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X10))))) = nil
_0:
if (int32(_addRemove) & i32(2)) == 0 {
goto _23
}
func() {
if (*XPgHdr)(_pPage.X9) != nil || (*XPgHdr)(_pPage.X10) != nil || (*XPgHdr)(_p.X0) == _pPage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44321), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14322)))
crt.X__builtin_abort(tls)
}
}()
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X9))))) = (*XPgHdr)(_p.X0)
if (*XPgHdr)(_pPage.X9) != nil {
func() {
if (*XPgHdr)((*XPgHdr)(_pPage.X9).X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44325), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14387)))
crt.X__builtin_abort(tls)
}
}()
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPgHdr)(_pPage.X9).X10))))) = _pPage
goto _31
}
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pPage
if (_p.X8) != 0 {
func() {
if int32(_p.X9) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44330), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheManageDirtyListØ00__func__Ø000))), unsafe.Pointer(str(14420)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(1))
}
_31:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pPage
if ((*XPgHdr)(_p.X2) == nil) && (i32(0) == (int32(_pPage.X6) & i32(8))) {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pPage
}
_23:
}
var _pcacheManageDirtyListØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pcacheManageDirtyListØ00__func__Ø000[0], str(14434), 22)
}
// Write page pPg onto the end of the rollback journal.
func _pagerAddPageToRollbackJournal(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
var _rc int32
var _iOff int64
var _cksum uint32
var _pData2 *int8
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
_iOff = _pPager.X34
func() {
if (_pPg.X5) == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52754), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14456)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X35) > (_pPager.X34) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52756), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14489)))
crt.X__builtin_abort(tls)
}
}()
_pData2 = (*int8)(_pPg.X1)
_cksum = _pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_pData2)))
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iOff, _pPg.X5)
if _rc != i32(0) {
return _rc
}
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_pData2), _pPager.X48, _iOff+int64(i32(4)))
if _rc != i32(0) {
return _rc
}
_rc = _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), (_iOff+int64(_pPager.X48))+int64(i32(4)), _cksum)
if _rc != i32(0) {
return _rc
}
{
p := (*int64)(unsafe.Pointer(&(_pPager.X34)))
*p = (*p) + int64(i32(8)+(_pPager.X48))
sink6 = *p
}
*(*int32)(unsafe.Pointer(&(_pPager.X27))) += 1
func() {
if (*XBitvec)(_pPager.X30) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52785), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(14528)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.X30), _pPg.X5)
func() {
if _rc != i32(0) && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52788), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_rc
*p = (*p) | _addToSavepointBitvecs(tls, _pPager, _pPg.X5)
sink1 = *p
}
func() {
if _rc != i32(0) && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52790), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAddPageToRollbackJournalØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _pagerAddPageToRollbackJournalØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_pagerAddPageToRollbackJournalØ00__func__Ø000[0], str(14550), 30)
}
// Parameter aData must point to a buffer of pPager->pageSize bytes
// of data. Compute and return a checksum based ont the contents of the
// page of data and the current value of pPager->cksumInit.
//
// This is not a real checksum. It is really just the sum of the
// random initial value (pPager->cksumInit) and every 200th byte
// of the page data, starting with byte offset (pPager->pageSize%200).
// Each byte is interpreted as an 8-bit unsigned integer.
//
// Changing the formula used to compute this checksum results in an
// incompatible journal file format.
//
// If journal corruption occurs due to a power failure, the most likely
// scenario is that one end or the other of the record will be changed.
// It is much less likely that the two ends of the journal record will be
// correct and the middle be corrupt. Thus, this "checksum" scheme,
// though fast and simple, catches the mostly likely kind of corruption.
func _pager_cksum(tls *crt.TLS, _pPager *XPager, _aData *uint8) (r0 uint32) {
var _i int32
var _cksum uint32
_cksum = _pPager.X28
_i = (_pPager.X48) - i32(200)
_0:
if _i > i32(0) {
{
p := &_cksum
*p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_i))))
sink5 = *p
}
{
p := &_i
*p = (*p) - i32(200)
sink1 = *p
}
goto _0
}
return _cksum
}
// Release a page reference.
//
// If the number of references to the page drop to zero, then the
// page is added to the LRU list. When all references to all pages
// are released, a rollback occurs and the lock on the database is
// removed.
func _sqlite3PagerUnrefNotNull(tls *crt.TLS, _pPg *XPgHdr) {
var _pPager *XPager
func() {
if _pPg == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52551), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerUnrefNotNullØ00__func__Ø000))), unsafe.Pointer(str(13969)))
crt.X__builtin_abort(tls)
}
}()
_pPager = (*XPager)(_pPg.X4)
if (int32(_pPg.X6) & i32(32)) != 0 {
_pagerReleaseMapPage(tls, _pPg)
goto _3
}
_sqlite3PcacheRelease(tls, _pPg)
_3:
_pagerUnlockIfUnused(tls, _pPager)
}
var _sqlite3PagerUnrefNotNullØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerUnrefNotNullØ00__func__Ø000[0], str(14580), 25)
}
// Release a reference to page pPg. pPg must have been returned by an
// earlier call to pagerAcquireMapPage().
func _pagerReleaseMapPage(tls *crt.TLS, _pPg *XPgHdr) {
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
*(*int32)(unsafe.Pointer(&(_pPager.X41))) -= 1
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X3))))) = (*XPgHdr)(_pPager.X43)
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X43))))) = _pPg
func() {
if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0).X0) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50978), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerReleaseMapPageØ00__func__Ø000))), unsafe.Pointer(str(14605)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64((_pPg.X5)-uint32(i32(1)))*int64(_pPager.X48), _pPg.X1)
}
var _pagerReleaseMapPageØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_pagerReleaseMapPageØ00__func__Ø000[0], str(14639), 20)
}
func _sqlite3OsUnfetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X18)})))(tls, _id, _iOff, _p)
}
// Decrement the reference count on a page. If the page is clean and the
// reference count drops to 0, then it is made eligible for recycling.
func _sqlite3PcacheRelease(tls *crt.TLS, _p *XPgHdr) {
func() {
if int32(_p.X7) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheReleaseØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) -= 1
if int32(preInc18((*int16)(unsafe.Pointer(&(_p.X7))), -1)) != i32(0) {
goto _2
}
if (int32(_p.X6) & i32(1)) != 0 {
_pcacheUnpin(tls, _p)
goto _5
}
if (*XPgHdr)(_p.X10) != nil {
_pcacheManageDirtyList(tls, _p, uint8(i32(3)))
}
_5:
_2:
}
var _sqlite3PcacheReleaseØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheReleaseØ00__func__Ø000[0], str(14659), 21)
}
// Wrapper around the pluggable caches xUnpin method. If the cache is
// being used for an in-memory database, this function is a no-op.
func _pcacheUnpin(tls *crt.TLS, _p *XPgHdr) {
if ((*XPCache)(_p.X8).X8) != 0 {
(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X8)})))(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(0))
}
}
func _pagerUnlockIfUnused(tls *crt.TLS, _pPager *XPager) {
if ((_pPager.X41) == i32(0)) && (_sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) == i32(0)) {
_pagerUnlockAndRollback(tls, _pPager)
}
}
// Execute a rollback if a transaction is active and unlock the
// database file.
//
// If the pager has already entered the ERROR state, do not attempt
// the rollback at this time. Instead, pager_unlock() is called. The
// call to pager_unlock() will discard all in-memory pages, unlock
// the database file and move the pager back to OPEN state. If this
// means that there is a hot-journal left in the file-system, the next
// connection to obtain a shared lock on the pager (which may be this one)
// will roll it back.
//
// If the pager has not already entered the ERROR state, but an IO or
// malloc error occurs during a rollback, then this will itself cause
// the pager to enter the ERROR state. Which will be cleared by the
// call to pager_unlock(), as described above.
func _pagerUnlockAndRollback(tls *crt.TLS, _pPager *XPager) {
if int32(_pPager.X14) == i32(6) || int32(_pPager.X14) == i32(0) {
goto _1
}
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49056), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X14) >= i32(2) {
_sqlite3BeginBenignMalloc(tls)
_sqlite3PagerRollback(tls, _pPager)
_sqlite3EndBenignMalloc(tls)
goto _6
}
if (_pPager.X1) == 0 {
func() {
if int32(_pPager.X14) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49062), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockAndRollbackØ00__func__Ø000))), unsafe.Pointer(str(14680)))
crt.X__builtin_abort(tls)
}
}()
_pager_end_transaction(tls, _pPager, i32(0), i32(0))
}
_6:
_1:
_pager_unlock(tls, _pPager)
}
var _pagerUnlockAndRollbackØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_pagerUnlockAndRollbackØ00__func__Ø000[0], str(14709), 23)
}
// If a write transaction is open, then all changes made within the
// transaction are reverted and the current write-transaction is closed.
// The pager falls back to PAGER_READER state if successful, or PAGER_ERROR
// state if an error occurs.
//
// If the pager is already in PAGER_ERROR state when this function is called,
// it returns Pager.errCode immediately. No work is performed in this case.
//
// Otherwise, in rollback mode, this function performs two functions:
//
// 1) It rolls back the journal file, restoring all database file and
// in-memory cache pages to the state they were in when the transaction
// was opened, and
//
// 2) It finalizes the journal file, so that it is not used for hot
// rollback at any point in the future.
//
// Finalization of the journal file (task 2) is only performed if the
// rollback is successful.
//
// In WAL mode, all cache-entries containing data modified within the
// current transaction are either expelled from the cache or reverted to
// their pre-transaction state by re-reading data from the database or
// WAL files. The WAL transaction is then closed.
func _sqlite3PagerRollback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _1_rc2, _2_eState int32
_rc = i32(0)
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53472), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X14) == i32(6) {
return _pPager.X26
}
if int32(_pPager.X14) <= i32(1) {
return i32(0)
}
if (*XWal)(_pPager.X60) == nil {
goto _4
}
_rc = _sqlite3PagerSavepoint(tls, _pPager, i32(2), i32(-1))
_1_rc2 = _pager_end_transaction(tls, _pPager, int32(_pPager.X17), i32(0))
if _rc == i32(0) {
_rc = _1_rc2
}
goto _11
_4:
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil && int32(_pPager.X14) != i32(2) {
goto _8
}
_2_eState = int32(_pPager.X14)
_rc = _pager_end_transaction(tls, _pPager, i32(0), i32(0))
if ((_pPager.X13) == 0) && (_2_eState > i32(2)) {
*(*int32)(unsafe.Pointer(&(_pPager.X26))) = i32(4)
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(6))
_setGetterMethod(tls, _pPager)
return _rc
}
goto _11
_8:
_rc = _pager_playback(tls, _pPager, i32(0))
_11:
func() {
if int32(_pPager.X14) != i32(1) && _rc == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53498), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000))), unsafe.Pointer(str(14732)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(0) && _rc != i32(13) && _rc != i32(11) && _rc != i32(7) && (_rc&i32(255)) != i32(10) && _rc != i32(14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerRollbackØ00__func__Ø000))), unsafe.Pointer(str(14778)))
crt.X__builtin_abort(tls)
}
}()
return _pager_error(tls, _pPager, _rc)
}
var _sqlite3PagerRollbackØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerRollbackØ00__func__Ø000[0], str(14903), 21)
}
func _sqlite3PagerSavepoint(tls *crt.TLS, _pPager *XPager, _op int32, _iSavepoint int32) (r0 int32) {
var _rc, _1_ii, _1_nNew int32
var _6_pSavepoint *XPagerSavepoint
_rc = _pPager.X26
func() {
if _op != i32(1) && _op != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53702), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000))), unsafe.Pointer(str(14924)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iSavepoint < i32(0) && _op != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53703), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000))), unsafe.Pointer(str(14972)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) || _iSavepoint >= (_pPager.X38) {
goto _7
}
_1_nNew = _iSavepoint + func() int32 {
if _op == i32(1) {
return i32(0)
}
return i32(1)
}()
_1_ii = _1_nNew
_10:
if _1_ii >= (_pPager.X38) {
goto _13
}
_sqlite3BitvecDestroy(tls, (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37)+44*uintptr(_1_ii))).X2))
_1_ii += 1
goto _10
_13:
*(*int32)(unsafe.Pointer(&(_pPager.X38))) = _1_nNew
if _op != i32(1) {
goto _14
}
if _1_nNew != i32(0) || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) == nil {
goto _16
}
if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X33)) != 0 {
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X33), int64(i32(0)))
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53726), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
}
*(*uint32)(unsafe.Pointer(&(_pPager.X29))) = uint32(i32(0))
_16:
goto _22
_14:
if ((*XWal)(_pPager.X60) != nil) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) {
_6_pSavepoint = func() *XPagerSavepoint {
if _1_nNew == i32(0) {
return nil
}
return (*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37) + 44*uintptr(_1_nNew-i32(1))))
}()
_rc = _pagerPlaybackSavepoint(tls, _pPager, _6_pSavepoint)
func() {
if _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSavepointØ00__func__Ø000))), unsafe.Pointer(str(15026)))
crt.X__builtin_abort(tls)
}
}()
}
_22:
_7:
return _rc
}
var _sqlite3PagerSavepointØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSavepointØ00__func__Ø000[0], str(15042), 22)
}
// 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 _sqlite3JournalIsInMemory(tls *crt.TLS, _p *Xsqlite3_file) (r0 int32) {
return bool2int((*Xsqlite3_io_methods)(_p.X0) == &_MemJournalMethods)
}
func _sqlite3OsTruncate(tls *crt.TLS, _id *Xsqlite3_file, _size int64) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int64) int32
}{((*Xsqlite3_io_methods)(_id.X0).X4)})))(tls, _id, _size)
}
// Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback
// the entire master journal file. The case pSavepoint==NULL occurs when
// a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction
// savepoint.
//
// When pSavepoint is not NULL (meaning a non-transaction savepoint is
// being rolled back), then the rollback consists of up to three stages,
// performed in the order specified:
//
// * Pages are played back from the main journal starting at byte
// offset PagerSavepoint.iOffset and continuing to
// PagerSavepoint.iHdrOffset, or to the end of the main journal
// file if PagerSavepoint.iHdrOffset is zero.
//
// * If PagerSavepoint.iHdrOffset is not zero, then pages are played
// back starting from the journal header immediately following
// PagerSavepoint.iHdrOffset to the end of the main journal file.
//
// * Pages are then played back from the sub-journal file, starting
// with the PagerSavepoint.iSubRec and continuing to the end of
// the journal file.
//
// Throughout the rollback process, each time a page is rolled back, the
// corresponding bit is set in a bitvec structure (variable pDone in the
// implementation below). This is used to ensure that a page is only
// rolled back the first time it is encountered in either journal.
//
// If pSavepoint is NULL, then pages are only played back from the main
// journal file. There is no need for a bitvec in this case.
//
// In either case, before playback commences the Pager.dbSize variable
// is reset to the value that it held at the start of the savepoint
// (or transaction). No page with a page-number greater than this value
// is played back. If one is encountered it is simply skipped.
func _pagerPlaybackSavepoint(tls *crt.TLS, _pPager *XPager, _pSavepoint *XPagerSavepoint) (r0 int32) {
var _rc int32
var _szJ, _iHdrOff, _10_offset int64
var _7_ii, _7_nJRec, _7_dummy, _10_ii uint32
var _pDone *XBitvec
_rc = i32(0)
_pDone = nil
func() {
if int32(_pPager.X14) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50292), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50293), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(10980)))
crt.X__builtin_abort(tls)
}
}()
if _pSavepoint == nil {
goto _4
}
_pDone = _sqlite3BitvecCreate(tls, _pSavepoint.X3)
if _pDone == nil {
return _sqlite3NomemError(tls, i32(50299))
}
_4:
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = func() uint32 {
if _pSavepoint != nil {
return (_pSavepoint.X3)
}
return (_pPager.X23)
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10
if (_pSavepoint == nil) && ((*XWal)(_pPager.X60) != nil) {
return _pagerRollbackWal(tls, _pPager)
}
_szJ = _pPager.X34
func() {
if bool2int((*XWal)(_pPager.X60) != nil) != i32(0) && _szJ != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50319), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15092)))
crt.X__builtin_abort(tls)
}
}()
if _pSavepoint == nil || (*XWal)(_pPager.X60) != nil {
goto _14
}
_iHdrOff = func() int64 {
if (_pSavepoint.X1) != 0 {
return (_pSavepoint.X1)
}
return _szJ
}()
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = _pSavepoint.X0
_17:
if (_rc == i32(0)) && ((_pPager.X34) < _iHdrOff) {
_rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), _pDone, i32(1), i32(1))
goto _17
}
func() {
if _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50334), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15026)))
crt.X__builtin_abort(tls)
}
}()
goto _22
_14:
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
_22:
if _rc != i32(0) || (_pPager.X34) >= _szJ {
goto _24
}
_7_nJRec = uint32(i32(0))
_rc = _readJournalHdr(tls, _pPager, i32(0), _szJ, &_7_nJRec, &_7_dummy)
func() {
if _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50349), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15026)))
crt.X__builtin_abort(tls)
}
}()
if (_7_nJRec == uint32(i32(0))) && (((_pPager.X35) + int64(_pPager.X47)) == (_pPager.X34)) {
_7_nJRec = uint32((_szJ - (_pPager.X34)) / int64((_pPager.X48)+i32(8)))
}
_7_ii = uint32(i32(0))
_30:
if _rc != i32(0) || _7_ii >= _7_nJRec || (_pPager.X34) >= _szJ {
goto _35
}
_rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), _pDone, i32(1), i32(1))
_7_ii += 1
goto _30
_35:
func() {
if _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50364), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15026)))
crt.X__builtin_abort(tls)
}
}()
goto _22
_24:
func() {
if _rc == i32(0) && (_pPager.X34) < _szJ {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50366), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15125)))
crt.X__builtin_abort(tls)
}
}()
if _pSavepoint == nil {
goto _41
}
_10_offset = int64(_pSavepoint.X4) * int64(i32(4)+(_pPager.X48))
if (*XWal)(_pPager.X60) != nil {
_rc = _sqlite3WalSavepointUndo(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&(_pSavepoint.X5))))))
}
_10_ii = _pSavepoint.X4
_43:
if _rc != i32(0) || _10_ii >= (_pPager.X29) {
goto _47
}
func() {
if _10_offset != (int64(_10_ii) * int64(i32(4)+(_pPager.X48))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50380), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15166)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pager_playback_one_page(tls, _pPager, &_10_offset, _pDone, i32(0), i32(1))
_10_ii += 1
goto _43
_47:
func() {
if _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50383), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPlaybackSavepointØ00__func__Ø000))), unsafe.Pointer(str(15026)))
crt.X__builtin_abort(tls)
}
}()
_41:
_sqlite3BitvecDestroy(tls, _pDone)
if _rc == i32(0) {
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = _szJ
}
return _rc
_ = _7_dummy
panic(0)
}
var _pagerPlaybackSavepointØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_pagerPlaybackSavepointØ00__func__Ø000[0], str(15203), 23)
}
// This function is called to rollback a transaction on a WAL database.
func _pagerRollbackWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
var _pList, _1_pNext *XPgHdr
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _pPager.X23
_rc = _sqlite3WalUndo(tls, (*XWal)(_pPager.X60), _pagerUndoCallback, (unsafe.Pointer)(_pPager))
_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59))
_0:
if (_pList != nil) && (_rc == i32(0)) {
_1_pNext = (*XPgHdr)(_pList.X3)
_rc = _pagerUndoCallback(tls, (unsafe.Pointer)(_pPager), _pList.X5)
_pList = _1_pNext
goto _0
}
return _rc
}
// If any data has been written (but not committed) to the log file, this
// function moves the write-pointer back to the start of the transaction.
//
// Additionally, the callback function is invoked for each frame written
// to the WAL since the start of the transaction. If the callback returns
// other than SQLITE_OK, it is not invoked again and the error code is
// returned to the caller.
//
// Otherwise, if the callback function does not return an error, this
// function returns SQLITE_OK.
func _sqlite3WalUndo(tls *crt.TLS, _pWal *XWal, _xUndo func(*crt.TLS, unsafe.Pointer, uint32) int32, _pUndoCtx unsafe.Pointer) (r0 int32) {
var _rc int32
var _1_iMax, _1_iFrame uint32
_rc = i32(0)
if func() int32 {
if (_pWal.X12) != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57261), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _2
}
_1_iMax = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), u32(48))
_1_iFrame = ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) + uint32(i32(1))
_3:
if func() int32 {
if _rc == i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57271), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || _1_iFrame > _1_iMax {
goto _9
}
func() {
if _walFramePgno(tls, _pWal, _1_iFrame) == uint32(i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57285), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalUndoØ00__func__Ø000))), unsafe.Pointer(str(15226)))
crt.X__builtin_abort(tls)
}
}()
_rc = _xUndo(tls, _pUndoCtx, _walFramePgno(tls, _pWal, _1_iFrame))
_1_iFrame += 1
goto _3
_9:
if _1_iMax != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
_walCleanupHash(tls, _pWal)
}
_2:
return _rc
}
var _sqlite3WalUndoØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalUndoØ00__func__Ø000[0], str(15256), 15)
}
// Return a pointer to the WalIndexHdr structure in the wal-index.
func _walIndexHdr(tls *crt.TLS, _pWal *XWal) (r0 *XWalIndexHdr) {
func() {
if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55066), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexHdrØ00__func__Ø000))), unsafe.Pointer(str(15271)))
crt.X__builtin_abort(tls)
}
}()
return (*XWalIndexHdr)(unsafe.Pointer(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0))))))
}
var _walIndexHdrØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_walIndexHdrØ00__func__Ø000[0], str(15308), 12)
}
// Return the page number associated with frame iFrame in this WAL.
func _walFramePgno(tls *crt.TLS, _pWal *XWal, _iFrame uint32) (r0 uint32) {
var _iHash int32
_iHash = _walFramePage(tls, _iFrame)
if _iHash == i32(0) {
return *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0)))))) + 4*uintptr((u32(34)+_iFrame)-uint32(i32(1)))))
}
return *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_iHash))))) + 4*uintptr(((_iFrame-uint32(i32(1)))-u32(4062))%uint32(i32(4096)))))
}
// Return the number of the wal-index page that contains the hash-table
// and page-number array that contain entries corresponding to WAL frame
// iFrame. The wal-index is broken up into 32KB pages. Wal-index pages
// are numbered starting from 0.
func _walFramePage(tls *crt.TLS, _iFrame uint32) (r0 int32) {
var _iHash int32
_iHash = int32((((_iFrame + uint32(i32(4096))) - u32(4062)) - uint32(i32(1))) / uint32(i32(4096)))
func() {
if _iHash != i32(0) && _iFrame <= u32(4062) || _iHash < i32(1) && _iFrame > u32(4062) || _iHash > i32(1) && _iFrame <= u32(8158) || _iHash < i32(2) && _iFrame > u32(8158) || _iHash > i32(2) && _iFrame <= u32(12254) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55378), unsafe.Pointer((*int8)(unsafe.Pointer(&_walFramePageØ00__func__Ø000))), unsafe.Pointer(str(15320)))
crt.X__builtin_abort(tls)
}
}()
return _iHash
}
var _walFramePageØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_walFramePageØ00__func__Ø000[0], str(15593), 13)
}
// Remove entries from the hash table that point to WAL slots greater
// than pWal->hdr.mxFrame.
//
// This function is called whenever pWal->hdr.mxFrame is decreased due
// to a rollback or savepoint.
//
// At most only the hash table containing pWal->hdr.mxFrame needs to be
// updated. Any later hash tables will be automatically cleared when
// pWal->hdr.mxFrame advances to the point where those hash tables are
// actually needed.
func _walCleanupHash(tls *crt.TLS, _pWal *XWal) {
var _iLimit, _nByte, _i int32
var _iZero uint32
var _aPgno *uint32
var _aHash *uint16
_aHash = nil
_aPgno = nil
_iZero = u32(0)
_iLimit = i32(0)
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55418), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) == uint32(i32(0)) {
return
}
func() {
if (_pWal.X5) <= _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55429), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15622)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55430), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15668)))
crt.X__builtin_abort(tls)
}
}()
_walHashGet(tls, _pWal, _walFramePage(tls, (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6), &_aHash, &_aPgno, &_iZero)
_iLimit = int32(((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) - _iZero)
func() {
if _iLimit <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55437), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCleanupHashØ00__func__Ø000))), unsafe.Pointer(str(15716)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_9:
if _i >= i32(8192) {
goto _12
}
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_i)))) > _iLimit {
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_i))) = uint16(i32(0))
}
_i += 1
goto _9
_12:
_nByte = int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_aHash)))) - uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(_iLimit+i32(1))))))))) / 1)
crt.Xmemset(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(_iLimit+i32(1))))), i32(0), uint32(_nByte))
}
var _walCleanupHashØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_walCleanupHashØ00__func__Ø000[0], str(15725), 15)
}
// Return pointers to the hash table and page number array stored on
// page iHash of the wal-index. The wal-index is broken into 32KB pages
// numbered starting from 0.
//
// Set output variable *paHash to point to the start of the hash table
// in the wal-index file. Set *piZero to one less than the frame
// number of the first frame indexed by this hash table. If a
// slot in the hash table is set to N, it refers to frame number
// (*piZero+N) in the log.
//
// Finally, set *paPgno so that *paPgno[1] is the page number of the
// first frame indexed by the hash table, frame (*piZero+1).
func _walHashGet(tls *crt.TLS, _pWal *XWal, _iHash int32, _paHash **uint16, _paPgno **uint32, _piZero *uint32) (r0 int32) {
var _rc int32
var _1_iZero uint32
var _aPgno *uint32
var _1_aHash *uint16
_rc = _walIndexPage(tls, _pWal, _iHash, &_aPgno)
func() {
if _rc != i32(0) && _iHash <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55349), unsafe.Pointer((*int8)(unsafe.Pointer(&_walHashGetØ00__func__Ø000))), unsafe.Pointer(str(15740)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) {
goto _3
}
_1_aHash = (*uint16)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(i32(4096))))))
if _iHash == i32(0) {
_aPgno = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(u32(34))))
_1_iZero = uint32(i32(0))
goto _5
}
_1_iZero = u32(4062) + uint32((_iHash-i32(1))*i32(4096))
_5:
*_paPgno = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(i32(-1))))
*_paHash = _1_aHash
*_piZero = _1_iZero
_3:
return _rc
}
// Obtain a pointer to the iPage'th page of the wal-index. The wal-index
// is broken into pages of WALINDEX_PGSZ bytes. Wal-index pages are
// numbered from zero.
//
// If this call is successful, *ppPage is set to point to the wal-index
// page and SQLITE_OK is returned. If an error (an OOM or VFS error) occurs,
// then an SQLite error code is returned and *ppPage is set to 0.
func _walIndexPage(tls *crt.TLS, _pWal *XWal, _iPage int32, _ppPage **uint32) (r0 int32) {
var _rc, _1_nByte int32
var _1_apNew **uint32
_rc = i32(0)
if (_pWal.X5) > _iPage {
goto _0
}
_1_nByte = int32(u32(4) * uint32(_iPage+i32(1)))
_1_apNew = (**uint32)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_pWal.X7), uint64(_1_nByte)))
if _1_apNew == nil {
*_ppPage = nil
return _sqlite3NomemError(tls, i32(55025))
}
crt.Xmemset(tls, (unsafe.Pointer)((**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_apNew))+4*uintptr(_pWal.X5)))), i32(0), u32(4)*uint32((_iPage+i32(1))-(_pWal.X5)))
*(***uint32)(unsafe.Pointer(&(_pWal.X7))) = _1_apNew
*(*int32)(unsafe.Pointer(&(_pWal.X5))) = _iPage + i32(1)
_0:
if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_iPage)))) != nil {
goto _2
}
if int32(_pWal.X11) != i32(2) {
goto _3
}
*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_iPage))) = (*uint32)(_sqlite3MallocZero(tls, uint64(u32(32768))))
if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_iPage)))) == nil {
_rc = _sqlite3NomemError(tls, i32(55037))
}
goto _5
_3:
_rc = _sqlite3OsShmMap(tls, (*Xsqlite3_file)(_pWal.X1), _iPage, int32(u32(32768)), int32(_pWal.X12), (*unsafe.Pointer)(unsafe.Pointer((**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7))+4*uintptr(_iPage))))))
if _rc == i32(8) {
{
p := (*uint8)(unsafe.Pointer(&(_pWal.X14)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
_rc = i32(0)
}
_5:
_2:
*_ppPage = *(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_iPage)))
func() {
if _iPage != i32(0) && (*_ppPage) == nil && _rc == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55050), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexPageØ00__func__Ø000))), unsafe.Pointer(str(15765)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
func _sqlite3OsShmMap(tls *crt.TLS, _id *Xsqlite3_file, _iPage int32, _pgsz int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X13)})))(tls, _id, _iPage, _pgsz, _bExtend, _pp)
}
var _walIndexPageØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_walIndexPageØ00__func__Ø000[0], str(15802), 13)
}
var _walHashGetØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_walHashGetØ00__func__Ø000[0], str(15815), 11)
}
// This function is invoked once for each page that has already been
// written into the log file when a WAL transaction is rolled back.
// Parameter iPg is the page number of said page. The pCtx argument
// is actually a pointer to the Pager structure.
//
// If page iPg is present in the cache, and has no outstanding references,
// it is discarded. Otherwise, if there are one or more outstanding
// references, the page content is reloaded from the database. If the
// attempt to reload content from the database is required and fails,
// return an SQLite error code. Otherwise, SQLITE_OK.
func _pagerUndoCallback(tls *crt.TLS, _pCtx unsafe.Pointer, _iPg uint32) (r0 int32) {
var _rc int32
var _3_iFrame uint32
var _pPager *XPager
var _pPg *XPgHdr
_rc = i32(0)
_pPager = (*XPager)(_pCtx)
func() {
if (*XWal)(_pPager.X60) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49991), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUndoCallbackØ00__func__Ø000))), unsafe.Pointer(str(15826)))
crt.X__builtin_abort(tls)
}
}()
_pPg = _sqlite3PagerLookup(tls, _pPager, _iPg)
if _pPg == nil {
goto _2
}
if _sqlite3PcachePageRefcount(tls, _pPg) == i32(1) {
_sqlite3PcacheDrop(tls, _pPg)
goto _4
}
_3_iFrame = u32(0)
_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.X60), _pPg.X5, &_3_iFrame)
if _rc == i32(0) {
_rc = _readDbPage(tls, _pPg, _3_iFrame)
}
if _rc == i32(0) {
(*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pPager.X56)})))(tls, _pPg)
}
_sqlite3PagerUnrefNotNull(tls, _pPg)
_4:
_2:
_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.X36))
return _rc
}
var _pagerUndoCallbackØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_pagerUndoCallbackØ00__func__Ø000[0], str(15846), 18)
}
// Acquire a page if it is already in the in-memory cache. Do
// not read the page from disk. Return a pointer to the page,
// or 0 if the page is not in cache.
//
// See also sqlite3PagerGet(). The difference between this routine
// and sqlite3PagerGet() is that _get() will go to the disk and read
// in the page if the page is not already in cache. This routine
// returns NULL if the page is not in cache or if a disk I/O error
// has ever happened.
func _sqlite3PagerLookup(tls *crt.TLS, _pPager *XPager, _pgno uint32) (r0 *XPgHdr) {
var _pPage *Xsqlite3_pcache_page
func() {
if _pPager == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52532), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000))), unsafe.Pointer(str(15864)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pgno == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52533), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000))), unsafe.Pointer(str(15874)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPCache)(_pPager.X59) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52534), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000))), unsafe.Pointer(str(15882)))
crt.X__builtin_abort(tls)
}
}()
_pPage = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.X59), _pgno, i32(0))
func() {
if _pPage != nil && (_pPager.X21) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLookupØ00__func__Ø000))), unsafe.Pointer(str(15901)))
crt.X__builtin_abort(tls)
}
}()
if _pPage == nil {
return nil
}
return _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.X59), _pgno, _pPage)
}
var _sqlite3PagerLookupØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerLookupØ00__func__Ø000[0], str(15939), 19)
}
// Try to obtain a page from the cache.
//
// This routine returns a pointer to an sqlite3_pcache_page object if
// such an object is already in cache, or if a new one is created.
// This routine returns a NULL pointer if the object was not in cache
// and could not be created.
//
// The createFlags should be 0 to check for existing pages and should
// be 3 (not 1, but 3) to try to create a new page.
//
// If the createFlag is 0, then NULL is always returned if the page
// is not already in the cache. If createFlag is 1, then a new page
// is created only if that can be done without spilling dirty pages
// and without exceeding the cache size limit.
//
// The caller needs to invoke sqlite3PcacheFetchFinish() to properly
// initialize the sqlite3_pcache_page object and convert it into a
// PgHdr object. The sqlite3PcacheFetch() and sqlite3PcacheFetchFinish()
// routines are split this way for performance reasons. When separated
// they can both (usually) operate without having to push values to
// the stack on entry and pop them back off on exit, which saves a
// lot of pushing and popping.
func _sqlite3PcacheFetch(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _createFlag int32) (r0 *Xsqlite3_pcache_page) {
var _eCreate int32
var _pRes *Xsqlite3_pcache_page
func() {
if _pCache == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(14006)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCache.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(15958)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _createFlag != i32(3) && _createFlag != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44497), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(15976)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCache.X9) != func() int32 {
if ((_pCache.X8) != 0) && ((*XPgHdr)(_pCache.X0) != nil) {
return i32(1)
}
return i32(2)
}() {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44498), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(16007)))
crt.X__builtin_abort(tls)
}
}()
_eCreate = _createFlag & int32(_pCache.X9)
func() {
if _eCreate != i32(0) && _eCreate != i32(1) && _eCreate != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44508), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(16073)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _createFlag != i32(0) && int32(_pCache.X9) != _eCreate {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44509), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(16112)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _createFlag != i32(0) && _eCreate != (i32(1)+bool2int(((_pCache.X8) == 0) || ((*XPgHdr)(_pCache.X0) == nil))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44510), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchØ00__func__Ø000))), unsafe.Pointer(str(16154)))
crt.X__builtin_abort(tls)
}
}()
_pRes = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, _pgno, _eCreate)
return _pRes
}
var _sqlite3PcacheFetchØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheFetchØ00__func__Ø000[0], str(16221), 19)
}
// This routine converts the sqlite3_pcache_page object returned by
// sqlite3PcacheFetch() into an initialized PgHdr object. This routine
// must be called after sqlite3PcacheFetch() in order to get a usable
// result.
func _sqlite3PcacheFetchFinish(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
var _pPgHdr *XPgHdr
func() {
if _pPage == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44617), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000))), unsafe.Pointer(str(2899)))
crt.X__builtin_abort(tls)
}
}()
_pPgHdr = (*XPgHdr)(_pPage.X1)
if (*Xsqlite3_pcache_page)(_pPgHdr.X0) == nil {
return _pcacheFetchFinishWithInit(tls, _pCache, _pgno, _pPage)
}
*(*int32)(unsafe.Pointer(&(_pCache.X3))) += 1
*(*int16)(unsafe.Pointer(&(_pPgHdr.X7))) += 1
func() {
if _sqlite3PcachePageSanity(tls, _pPgHdr) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44625), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheFetchFinishØ00__func__Ø000))), unsafe.Pointer(str(16240)))
crt.X__builtin_abort(tls)
}
}()
return _pPgHdr
}
var _sqlite3PcacheFetchFinishØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheFetchFinishØ00__func__Ø000[0], str(16272), 25)
}
// This is a helper routine for sqlite3PcacheFetchFinish()
//
// In the uncommon case where the page being fetched has not been
// initialized, this routine is invoked to do the initialization.
// This routine is broken out into a separate function since it
// requires extra stack manipulation that can be avoided in the common
// case.
func _pcacheFetchFinishWithInit(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _pPage *Xsqlite3_pcache_page) (r0 *XPgHdr) {
var _pPgHdr *XPgHdr
func() {
if _pPage == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44590), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000))), unsafe.Pointer(str(2899)))
crt.X__builtin_abort(tls)
}
}()
_pPgHdr = (*XPgHdr)(_pPage.X1)
func() {
if (*Xsqlite3_pcache_page)(_pPgHdr.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44592), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheFetchFinishWithInitØ00__func__Ø000))), unsafe.Pointer(str(16297)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X3)))), i32(0), u32(28))
*(**Xsqlite3_pcache_page)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X0))))) = _pPage
*(*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X1))) = _pPage.X0
*(*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X2))) = (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPgHdr)) + 40*uintptr(i32(1)))))
crt.Xmemset(tls, _pPgHdr.X2, i32(0), uint32(i32(8)))
*(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPgHdr.X8))))) = _pCache
*(*uint32)(unsafe.Pointer(&(_pPgHdr.X5))) = _pgno
*(*uint16)(unsafe.Pointer(&(_pPgHdr.X6))) = uint16(i32(1))
return _sqlite3PcacheFetchFinish(tls, _pCache, _pgno, _pPage)
}
var _pcacheFetchFinishWithInitØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_pcacheFetchFinishWithInitØ00__func__Ø000[0], str(16314), 26)
}
// Return the number of references to the page supplied as an argument.
func _sqlite3PcachePageRefcount(tls *crt.TLS, _p *XPgHdr) (r0 int32) {
return int32(_p.X7)
}
// Drop a page from the cache. There must be exactly one reference to the
// page. This function deletes that reference, so after it returns the
// page pointed to by p is invalid.
func _sqlite3PcacheDrop(tls *crt.TLS, _p *XPgHdr) {
func() {
if int32(_p.X7) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44665), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000))), unsafe.Pointer(str(16340)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheDropØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X6) & i32(2)) != 0 {
_pcacheManageDirtyList(tls, _p, uint8(i32(1)))
}
*(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) -= 1
(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, int32))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X8)})))(tls, (*XPCache)(_p.X8).X12, (*Xsqlite3_pcache_page)(_p.X0), i32(1))
}
var _sqlite3PcacheDropØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheDropØ00__func__Ø000[0], str(16351), 18)
}
// Search the wal file for page pgno. If found, set *piRead to the frame that
// contains the page. Otherwise, if pgno is not in the wal file, set *piRead
// to zero.
//
// Return SQLITE_OK if successful, or an error code if an error occurs. If an
// error does occur, the final value of *piRead is undefined.
func _sqlite3WalFindFrame(tls *crt.TLS, _pWal *XWal, _pgno uint32, _piRead *uint32) (r0 int32) {
var _iHash, _iMinHash, _2_iKey, _2_nCollide, _2_rc int32
var _iRead, _iLast, _2_iZero, _4_iFrame uint32
var _2_aPgno *uint32
var _2_aHash *uint16
_iRead = u32(0)
_iLast = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
func() {
if int32(_pWal.X9) < i32(0) && (_pWal.X23) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57067), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000))), unsafe.Pointer(str(16369)))
crt.X__builtin_abort(tls)
}
}()
if (_iLast == uint32(i32(0))) || (int32(_pWal.X9) == i32(0)) {
*_piRead = uint32(i32(0))
return i32(0)
}
_iMinHash = _walFramePage(tls, _pWal.X19)
_iHash = _walFramePage(tls, _iLast)
_5:
if _iHash < _iMinHash || _iRead != uint32(i32(0)) {
goto _9
}
_2_rc = _walHashGet(tls, _pWal, _iHash, &_2_aHash, &_2_aPgno, &_2_iZero)
if _2_rc != i32(0) {
return _2_rc
}
_2_nCollide = i32(8192)
_2_iKey = _walHash(tls, _pgno)
_11:
if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey)))) == 0 {
goto _14
}
_4_iFrame = uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey)))) + _2_iZero
if ((_4_iFrame <= _iLast) && (_4_iFrame >= (_pWal.X19))) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aPgno)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aHash)) + 2*uintptr(_2_iKey))))))) == _pgno) {
func() {
if _4_iFrame <= _iRead && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFindFrameØ00__func__Ø000))), unsafe.Pointer(str(16406)))
crt.X__builtin_abort(tls)
}
}()
_iRead = _4_iFrame
}
if postInc1(&_2_nCollide, int32(-1)) == i32(0) {
return _sqlite3CorruptError(tls, i32(57126))
}
_2_iKey = _walNextHash(tls, _2_iKey)
goto _11
_14:
_iHash -= 1
goto _5
_9:
*_piRead = _iRead
return i32(0)
_ = _2_nCollide
panic(0)
}
var _sqlite3WalFindFrameØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalFindFrameØ00__func__Ø000[0], str(16433), 20)
}
// Compute a hash on a page number. The resulting hash value must land
// between 0 and (HASHTABLE_NSLOT-1). The walHashNext() function advances
// the hash to the next value in the event of a collision.
func _walHash(tls *crt.TLS, _iPage uint32) (r0 int32) {
func() {
if _iPage <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55316), unsafe.Pointer((*int8)(unsafe.Pointer(&_walHashØ00__func__Ø000))), unsafe.Pointer(str(16453)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
return int32((_iPage * uint32(i32(383))) & uint32(i32(8191)))
}
var _walHashØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_walHashØ00__func__Ø000[0], str(16461), 8)
}
func _walNextHash(tls *crt.TLS, _iPriorHash int32) (r0 int32) {
return (_iPriorHash + i32(1)) & i32(8191)
}
// Read the content for page pPg out of the database file and into
// pPg->pData. A shared lock or greater must be held on the database
// file before this function is called.
//
// If page 1 is read, then the value of Pager.dbFileVers[] is set to
// the value read from the database file.
//
// If an IO error occurs, then the IO error is returned to the caller.
// Otherwise, SQLITE_OK is returned.
func _readDbPage(tls *crt.TLS, _pPg *XPgHdr, _iFrame uint32) (r0 int32) {
var _rc, _pgsz int32
var _2_iOffset int64
var _pgno uint32
var _6_dbFileVers *uint8
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
_pgno = _pPg.X5
_rc = i32(0)
_pgsz = _pPager.X48
func() {
if int32(_pPager.X14) < i32(1) || (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49903), unsafe.Pointer((*int8)(unsafe.Pointer(&_readDbPageØ00__func__Ø000))), unsafe.Pointer(str(16469)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49904), unsafe.Pointer((*int8)(unsafe.Pointer(&_readDbPageØ00__func__Ø000))), unsafe.Pointer(str(16508)))
crt.X__builtin_abort(tls)
}
}()
if _iFrame != 0 {
_rc = _sqlite3WalReadFrame(tls, (*XWal)(_pPager.X60), _iFrame, _pgsz, (*uint8)(_pPg.X1))
goto _6
}
_2_iOffset = int64(_pgno-uint32(i32(1))) * int64(_pPager.X48)
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), _pPg.X1, _pgsz, _2_iOffset)
if _rc == i32(522) {
_rc = i32(0)
}
_6:
if _pgno != uint32(i32(1)) {
goto _8
}
if _rc != 0 {
crt.Xmemset(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), i32(255), u32(16))
goto _10
}
_6_dbFileVers = (*uint8)(unsafe.Pointer(uintptr(_pPg.X1) + 1*uintptr(i32(24))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)(_6_dbFileVers), u32(16))
_10:
_8:
return _rc
}
var _readDbPageØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_readDbPageØ00__func__Ø000[0], str(16527), 11)
}
// Read the contents of frame iRead from the wal file into buffer pOut
// (which is nOut bytes in size). Return SQLITE_OK if successful, or an
// error code otherwise.
func _sqlite3WalReadFrame(tls *crt.TLS, _pWal *XWal, _iRead uint32, _nOut int32, _pOut *uint8) (r0 int32) {
var _sz int32
var _iOffset int64
_sz = int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5)
_sz = (_sz & i32(65024)) + ((_sz & i32(1)) << uint(i32(16)))
_iOffset = (int64(i32(32)) + (int64(_iRead-uint32(i32(1))) * int64(_sz+i32(24)))) + int64(i32(24))
return _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_pOut), func() int32 {
if _nOut > _sz {
return _sz
}
return _nOut
}(), _iOffset)
}
func _sqlite3OsRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
}{((*Xsqlite3_io_methods)(_id.X0).X2)})))(tls, _id, _pBuf, _amt, _offset)
}
// 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 _sqlite3BackupRestart(tls *crt.TLS, _pBackup *Xsqlite3_backup) {
var _p *Xsqlite3_backup
_p = _pBackup
_0:
if _p == nil {
goto _3
}
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)((*XBtree)(_p.X6).X1).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69631), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BackupRestartØ00__func__Ø000))), unsafe.Pointer(str(16538)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(i32(1))
_p = (*Xsqlite3_backup)(_p.X11)
goto _0
_3:
}
var _sqlite3BackupRestartØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BackupRestartØ00__func__Ø000[0], str(16578), 21)
}
// Return a list of all dirty pages in the cache, sorted by page number.
func _sqlite3PcacheDirtyList(tls *crt.TLS, _pCache *XPCache) (r0 *XPgHdr) {
var _p *XPgHdr
_p = (*XPgHdr)(_pCache.X0)
_0:
if _p == nil {
goto _3
}
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = (*XPgHdr)(_p.X9)
_p = (*XPgHdr)(_p.X9)
goto _0
_3:
return _pcacheSortDirtyList(tls, (*XPgHdr)(_pCache.X0))
}
func _pcacheSortDirtyList(tls *crt.TLS, _pIn *XPgHdr) (r0 *XPgHdr) {
var _i int32
var _p *XPgHdr
var _a [32]*XPgHdr
crt.Xmemset(tls, (unsafe.Pointer)(&_a), i32(0), u32(128))
_0:
if _pIn == nil {
goto _1
}
_p = _pIn
_pIn = (*XPgHdr)(_p.X3)
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil
_i = i32(0)
_2:
if func() int32 {
if _i < i32(31) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44866), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _7
}
if (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i)))) == nil {
*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))) = _p
goto _7
}
_p = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))), _p)
*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))) = nil
_i += 1
goto _2
_7:
if func() int32 {
if _i == i32(31) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44875), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheSortDirtyListØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))) = _pcacheMergeDirtyList(tls, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))), _p)
}
goto _0
_1:
_p = *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(i32(0))))
_i = i32(1)
_13:
if _i >= i32(32) {
goto _16
}
if (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i)))) == nil {
goto _14
}
_p = func() *XPgHdr {
if _p != nil {
return _pcacheMergeDirtyList(tls, _p, *(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))))
}
return (*(**XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_a)) + 4*uintptr(_i))))
}()
_14:
_i += 1
goto _13
_16:
return _p
_ = _a
panic(0)
}
var _pcacheSortDirtyListØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_pcacheSortDirtyListØ00__func__Ø000[0], str(16599), 20)
}
// Merge two lists of pages connected by pDirty and in pgno order.
// Do not bother fixing the pDirtyPrev pointers.
func _pcacheMergeDirtyList(tls *crt.TLS, _pA *XPgHdr, _pB *XPgHdr) (r0 *XPgHdr) {
var _result XPgHdr
var _pTail *XPgHdr
_pTail = &_result
func() {
if _pA == nil || _pB == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44824), unsafe.Pointer((*int8)(unsafe.Pointer(&_pcacheMergeDirtyListØ00__func__Ø000))), unsafe.Pointer(str(16619)))
crt.X__builtin_abort(tls)
}
}()
_3:
if (_pA.X5) >= (_pB.X5) {
goto _6
}
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pA
_pTail = _pA
_pA = (*XPgHdr)(_pA.X3)
if _pA == nil {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pB
goto _5
}
goto _8
_6:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pB
_pTail = _pB
_pB = (*XPgHdr)(_pB.X3)
if _pB == nil {
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X3))))) = _pA
goto _5
}
_8:
goto _3
_5:
return (*XPgHdr)(_result.X3)
_ = _result
panic(0)
}
var _pcacheMergeDirtyListØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_pcacheMergeDirtyListØ00__func__Ø000[0], str(16634), 21)
}
// Read a single page from either the journal file (if isMainJrnl==1) or
// from the sub-journal (if isMainJrnl==0) and playback that page.
// The page begins at offset *pOffset into the file. The *pOffset
// value is increased to the start of the next page in the journal.
//
// The main rollback journal uses checksums - the statement journal does
// not.
//
// If the page number of the page record read from the (sub-)journal file
// is greater than the current value of Pager.dbSize, then playback is
// skipped and SQLITE_OK is returned.
//
// If pDone is not NULL, then it is a record of pages that have already
// been played back. If the page at *pOffset has already been played back
// (if the corresponding pDone bit is set) then skip the playback.
// Make sure the pDone bit corresponding to the *pOffset page is set
// prior to returning.
//
// If the page record is successfully read from the (sub-)journal file
// and played back, then SQLITE_OK is returned. If an IO error occurs
// while reading the record from the (sub-)journal file or while writing
// to the database file, then the IO error code is returned. If data
// is successfully read from the (sub-)journal file but appears to be
// corrupted, SQLITE_DONE is returned. Data is considered corrupted in
// two circumstances:
//
// * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or
// * If the record is being rolled back from the main journal file
// and the checksum field does not match the record content.
//
// Neither of these two scenarios are possible during a savepoint rollback.
//
// If this is a savepoint rollback, then memory may have to be dynamically
// allocated by this function. If this is the case and an allocation fails,
// SQLITE_NOMEM is returned.
func _pager_playback_one_page(tls *crt.TLS, _pPager *XPager, _pOffset *int64, _pDone *XBitvec, _isMainJrnl int32, _isSavepnt int32) (r0 int32) {
var _rc, _isSynced int32
var _11_ofst int64
var _pgno, _cksum uint32
var _aData *int8
var _15_pData unsafe.Pointer
var _jfd *Xsqlite3_file
var _pPg *XPgHdr
func() {
if (_isMainJrnl & i32(-2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49184), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16655)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isSavepnt & i32(-2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49185), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16674)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isMainJrnl == 0 && _pDone == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49186), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16692)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isSavepnt == 0 && _pDone != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49187), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16712)))
crt.X__builtin_abort(tls)
}
}()
_aData = _pPager.X58
func() {
if _aData == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49190), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16734)))
crt.X__builtin_abort(tls)
}
}()
func() {
if bool2int((*XWal)(_pPager.X60) != nil) != i32(0) && (_isMainJrnl != 0 || _isSavepnt == 0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49191), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16740)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(3) && (int32(_pPager.X14) != i32(0) || int32(_pPager.X15) != i32(4)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49199), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16793)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(3) && _isMainJrnl == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49202), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16896)))
crt.X__builtin_abort(tls)
}
}()
_jfd = func() *Xsqlite3_file {
if _isMainJrnl != 0 {
return (*Xsqlite3_file)(_pPager.X32)
}
return (*Xsqlite3_file)(_pPager.X33)
}()
_rc = _read32bits(tls, _jfd, *_pOffset, &_pgno)
if _rc != i32(0) {
return _rc
}
_rc = _sqlite3OsRead(tls, _jfd, (unsafe.Pointer)(_aData), _pPager.X48, (*_pOffset)+int64(i32(4)))
if _rc != i32(0) {
return _rc
}
{
p := _pOffset
*p = (*p) + int64(((_pPager.X48)+i32(4))+(_isMainJrnl*i32(4)))
sink6 = *p
}
if (_pgno == uint32(i32(0))) || (_pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))) {
func() {
if _isSavepnt != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49220), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16948)))
crt.X__builtin_abort(tls)
}
}()
return i32(101)
}
if (_pgno > (_pPager.X22)) || _sqlite3BitvecTest(tls, _pDone, _pgno) != 0 {
return i32(0)
}
if _isMainJrnl == 0 {
goto _33
}
_rc = _read32bits(tls, _jfd, (*_pOffset)-int64(i32(4)), &_cksum)
if _rc != 0 {
return _rc
}
if (_isSavepnt == 0) && (_pager_cksum(tls, _pPager, (*uint8)(unsafe.Pointer(_aData))) != _cksum) {
return i32(101)
}
_33:
if (_pDone != nil) && (store1(&_rc, _sqlite3BitvecSet(tls, _pDone, _pgno)) != i32(0)) {
return _rc
}
if (_pgno == uint32(i32(1))) && (int32(_pPager.X45) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(20)))))) {
*(*int16)(unsafe.Pointer(&(_pPager.X45))) = int16(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(20)))))
}
if (*XWal)(_pPager.X60) != nil {
_pPg = nil
goto _42
}
_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
_42:
func() {
if _pPg == nil && (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49288), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16959)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) == i32(0) && _pPg != nil && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49289), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(16973)))
crt.X__builtin_abort(tls)
}
}()
if _isMainJrnl != 0 {
_isSynced = bool2int(((_pPager.X4) != 0) || ((*_pOffset) <= (_pPager.X35)))
goto _52
}
_isSynced = bool2int((_pPg == nil) || (i32(0) == (int32(_pPg.X6) & i32(8))))
_52:
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil || int32(_pPager.X14) < i32(4) && int32(_pPager.X14) != i32(0) || _isSynced == 0 {
goto _57
}
_11_ofst = int64(_pgno-uint32(i32(1))) * int64(_pPager.X48)
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49305), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_aData), _pPager.X48, _11_ofst)
if _pgno > (_pPager.X24) {
*(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _pgno
}
if (*Xsqlite3_backup)(_pPager.X36) != nil {
_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.X36), _pgno, (*uint8)(unsafe.Pointer(_aData)))
}
goto _64
_57:
if _isMainJrnl != 0 || _pPg != nil {
goto _64
}
func() {
if _isSavepnt == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49352), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(17030)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pPager.X18) & i32(2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49353), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(17040)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
_rc = _sqlite3PagerGet(tls, _pPager, _pgno, &_pPg, i32(1))
func() {
if (int32(_pPager.X18) & i32(2)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49356), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playback_one_pageØ00__func__Ø000))), unsafe.Pointer(str(17085)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) & i32(-3))
sink2 = *p
}
if _rc != i32(0) {
return _rc
}
_sqlite3PcacheMakeDirty(tls, _pPg)
_64:
if _pPg == nil {
goto _72
}
_15_pData = _pPg.X1
crt.Xmemcpy(tls, _15_pData, (unsafe.Pointer)(_aData), uint32(_pPager.X48))
(*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_pPager.X56)})))(tls, _pPg)
if _pgno == uint32(i32(1)) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_15_pData)+1*uintptr(i32(24))))), u32(16))
}
_sqlite3PcacheRelease(tls, _pPg)
_72:
return _rc
}
var _pager_playback_one_pageØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_pager_playback_one_pageØ00__func__Ø000[0], str(17130), 24)
}
// Read a 32-bit integer from the given file descriptor. Store the integer
// that is read in *pRes. Return SQLITE_OK if everything worked, or an
// error code is something goes wrong.
//
// All values are stored on disk as big-endian.
func _read32bits(tls *crt.TLS, _fd *Xsqlite3_file, _offset int64, _pRes *uint32) (r0 int32) {
var _rc int32
var _ac [4]uint8
_rc = _sqlite3OsRead(tls, _fd, (unsafe.Pointer)(&_ac), int32(u32(4)), _offset)
if _rc == i32(0) {
*_pRes = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(&_ac)))
}
return _rc
_ = _ac
panic(0)
}
// Read or write a four-byte big-endian integer value.
func _sqlite3Get4byte(tls *crt.TLS, _p *uint8) (r0 uint32) {
return (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))))<= (_p.X4) {
goto _6
}
func() {
if (*Xsqlite3)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69602), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupUpdateØ00__func__Ø000))), unsafe.Pointer(str(17154)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
_2_rc = _backupOnePage(tls, _p, _iPage, _aData, i32(1))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
func() {
if _2_rc == i32(5) || _2_rc == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69606), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupUpdateØ00__func__Ø000))), unsafe.Pointer(str(17165)))
crt.X__builtin_abort(tls)
}
}()
if _2_rc != i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X7))) = _2_rc
}
_6:
if store26(&_p, (*Xsqlite3_backup)(_p.X11)) != nil {
goto _2
}
}
var _backupUpdateØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_backupUpdateØ00__func__Ø000[0], str(17202), 13)
}
// Argument rc is an SQLite error code. Return true if this error is
// considered fatal if encountered during a backup operation. All errors
// are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED.
func _isFatalError(tls *crt.TLS, _rc int32) (r0 int32) {
return bool2int(((_rc != i32(0)) && (_rc != i32(5))) && func() int32 {
if _rc != i32(6) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69117), unsafe.Pointer((*int8)(unsafe.Pointer(&_isFatalErrorØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0)
}
var _isFatalErrorØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_isFatalErrorØ00__func__Ø000[0], str(17215), 13)
}
// Parameter zSrcData points to a buffer containing the data for
// page iSrcPg from the source database. Copy this data into the
// destination database.
func _backupOnePage(tls *crt.TLS, _p *Xsqlite3_backup, _iSrcPg uint32, _zSrcData *uint8, _bUpdate int32) (r0 int32) {
var _nSrcPgsz, _nDestPgsz, _nCopy, _rc int32
var _iEnd, _iOff int64
var _2_iDest uint32
var _3_zIn, _3_zDestData, _3_zOut *uint8
var _pDestPager *XPager
var _2_pDestPg *XPgHdr
_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.X1))
_nSrcPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6))
_nDestPgsz = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X1))
_nCopy = func() int32 {
if _nSrcPgsz < _nDestPgsz {
return _nSrcPgsz
}
return _nDestPgsz
}()
_iEnd = int64(_iSrcPg) * int64(_nSrcPgsz)
_rc = i32(0)
func() {
if _sqlite3BtreeGetReserveNoMutex(tls, (*XBtree)(_p.X6)) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69146), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17228)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69147), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17270)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isFatalError(tls, _p.X7) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69148), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17285)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.X6).X1).X15)) + uint32(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69149), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17306)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _zSrcData == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69150), unsafe.Pointer((*int8)(unsafe.Pointer(&_backupOnePageØ00__func__Ø000))), unsafe.Pointer(str(17346)))
crt.X__builtin_abort(tls)
}
}()
if (_nSrcPgsz != _nDestPgsz) && _sqlite3PagerIsMemdb(tls, _pDestPager) != 0 {
_rc = i32(8)
}
_iOff = _iEnd - int64(_nSrcPgsz)
_14:
if _rc != i32(0) || _iOff >= _iEnd {
goto _18
}
_2_pDestPg = nil
_2_iDest = uint32(_iOff/int64(_nDestPgsz)) + uint32(i32(1))
if _2_iDest == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.X1).X1).X15)) + uint32(i32(1))) {
goto _15
}
if i32(0) != store1(&_rc, _sqlite3PagerGet(tls, _pDestPager, _2_iDest, &_2_pDestPg, i32(0))) || i32(0) != store1(&_rc, _sqlite3PagerWrite(tls, _2_pDestPg)) {
goto _21
}
_3_zIn = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSrcData)) + 1*uintptr(_iOff%int64(_nSrcPgsz))))
_3_zDestData = (*uint8)(_sqlite3PagerGetData(tls, _2_pDestPg))
_3_zOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_zDestData)) + 1*uintptr(_iOff%int64(_nDestPgsz))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_3_zOut), (unsafe.Pointer)(_3_zIn), uint32(_nCopy))
*(*uint8)(unsafe.Pointer(uintptr(_sqlite3PagerGetExtra(tls, _2_pDestPg)) + 1*uintptr(i32(0)))) = uint8(i32(0))
if (_iOff == int64(i32(0))) && (_bUpdate == i32(0)) {
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_zOut))+1*uintptr(i32(28)))), _sqlite3BtreeLastPage(tls, (*XBtree)(_p.X6)))
}
_21:
_sqlite3PagerUnref(tls, _2_pDestPg)
_15:
{
p := &_iOff
*p = (*p) + int64(_nDestPgsz)
sink6 = *p
}
goto _14
_18:
return _rc
}
// Return the pager associated with a BTree. This routine is used for
// testing and debugging only.
func _sqlite3BtreePager(tls *crt.TLS, _p *XBtree) (r0 *XPager) {
return (*XPager)((*XBtShared)(_p.X1).X0)
}
// Return the currently defined page size
func _sqlite3BtreeGetPageSize(tls *crt.TLS, _p *XBtree) (r0 int32) {
return int32((*XBtShared)(_p.X1).X15)
}
// 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 _sqlite3BtreeGetReserveNoMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _n int32
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000))), unsafe.Pointer(str(17355)))
crt.X__builtin_abort(tls)
}
}()
_n = int32(((*XBtShared)(_p.X1).X15) - ((*XBtShared)(_p.X1).X16))
return _n
}
var _sqlite3BtreeGetReserveNoMutexØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeGetReserveNoMutexØ00__func__Ø000[0], str(17389), 30)
}
var _backupOnePageØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_backupOnePageØ00__func__Ø000[0], str(17419), 14)
}
// Return true if this is an in-memory or temp-file backed pager.
func _sqlite3PagerIsMemdb(tls *crt.TLS, _pPager *XPager) (r0 int32) {
return int32(_pPager.X10)
}
// Return a pointer to the data for the specified page.
func _sqlite3PagerGetData(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
func() {
if int32(_pPg.X7) <= i32(0) && ((*XPager)(_pPg.X4).X13) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54024), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerGetDataØ00__func__Ø000))), unsafe.Pointer(str(17433)))
crt.X__builtin_abort(tls)
}
}()
return _pPg.X1
}
var _sqlite3PagerGetDataØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerGetDataØ00__func__Ø000[0], str(17467), 20)
}
// Return a pointer to the Pager.nExtra bytes of "extra" space
// allocated along with the specified page.
func _sqlite3PagerGetExtra(tls *crt.TLS, _pPg *XPgHdr) (r0 unsafe.Pointer) {
return _pPg.X2
}
func _sqlite3BtreeLastPage(tls *crt.TLS, _p *XBtree) (r0 uint32) {
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61054), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (((*XBtShared)(_p.X1).X18) & uint32(i32(134217728))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61055), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastPageØ00__func__Ø000))), unsafe.Pointer(str(17513)))
crt.X__builtin_abort(tls)
}
}()
return _btreePagecount(tls, (*XBtShared)(_p.X1))
}
// Return true if the BtShared mutex is held on the btree, or if the
// B-Tree is not marked as sharable.
//
// This routine is used only from within assert() statements.
func _sqlite3BtreeHoldsMutex(tls *crt.TLS, _p *XBtree) (r0 int32) {
func() {
if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && (_p.X6) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58885), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000))), unsafe.Pointer(str(17544)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && (*Xsqlite3)(_p.X0) != (*Xsqlite3)((*XBtShared)(_p.X1).X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000))), unsafe.Pointer(str(17594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_p.X1).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000))), unsafe.Pointer(str(17646)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X3) != i32(0) && int32(_p.X4) != i32(0) && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58888), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeHoldsMutexØ00__func__Ø000))), unsafe.Pointer(str(17714)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((int32(_p.X3) == i32(0)) || ((_p.X4) != 0))
}
var _sqlite3BtreeHoldsMutexØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeHoldsMutexØ00__func__Ø000[0], str(17781), 23)
}
var _sqlite3BtreeLastPageØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeLastPageØ00__func__Ø000[0], str(17804), 21)
}
// Return the size of the database file in pages. If there is any kind of
// error, return ((unsigned int)-1).
func _btreePagecount(tls *crt.TLS, _pBt *XBtShared) (r0 uint32) {
return _pBt.X18
}
func _sqlite3PagerUnref(tls *crt.TLS, _pPg *XPgHdr) {
if _pPg != nil {
_sqlite3PagerUnrefNotNull(tls, _pPg)
}
}
// The journal file must be open when this is called. A journal header file
// (JOURNAL_HDR_SZ bytes) is read from the current location in the journal
// file. The current location in the journal file is given by
// pPager->journalOff. See comments above function writeJournalHdr() for
// a description of the journal header format.
//
// If the header is read successfully, *pNRec is set to the number of
// page records following this header and *pDbSize is set to the size of the
// database before the transaction began, in pages. Also, pPager->cksumInit
// is set to the value read from the journal header. SQLITE_OK is returned
// in this case.
//
// If the journal header file appears to be corrupted, SQLITE_DONE is
// returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes
// cannot be read from the journal file an error code is returned.
func _readJournalHdr(tls *crt.TLS, _pPager *XPager, _isHot int32, _journalSize int64, _pNRec *uint32, _pDbSize *uint32) (r0 int32) {
var _rc int32
var _iHdrOff int64
var _6_iPageSize, _6_iSectorSize uint32
var _aMagic [8]uint8
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48464), unsafe.Pointer((*int8)(unsafe.Pointer(&_readJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13626)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = _journalHdrOffset(tls, _pPager)
if ((_pPager.X34) + int64(_pPager.X47)) > _journalSize {
return i32(101)
}
_iHdrOff = _pPager.X34
if _isHot == 0 && _iHdrOff == (_pPager.X35) {
goto _4
}
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_aMagic), int32(u32(8)), _iHdrOff)
if _rc != 0 {
return _rc
}
if crt.Xmemcmp(tls, (unsafe.Pointer)(&_aMagic), (unsafe.Pointer)(&_aJournalMagic), u32(8)) != i32(0) {
return i32(101)
}
_4:
if ((i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(8)), _pNRec))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(12)), (*uint32)(unsafe.Pointer(&(_pPager.X28))))))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(16)), _pDbSize))) {
return _rc
}
if (_pPager.X34) != int64(i32(0)) {
goto _10
}
if (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(20)), &_6_iSectorSize))) || (i32(0) != store1(&_rc, _read32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff+int64(i32(24)), &_6_iPageSize))) {
return _rc
}
if _6_iPageSize == uint32(i32(0)) {
_6_iPageSize = uint32(_pPager.X48)
}
if (((((_6_iPageSize < uint32(i32(512))) || (_6_iSectorSize < uint32(i32(32)))) || (_6_iPageSize > uint32(i32(65536)))) || (_6_iSectorSize > uint32(i32(65536)))) || (((_6_iPageSize - uint32(i32(1))) & _6_iPageSize) != uint32(i32(0)))) || (((_6_iSectorSize - uint32(i32(1))) & _6_iSectorSize) != uint32(i32(0))) {
return i32(101)
}
_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_6_iPageSize, i32(-1))
*(*uint32)(unsafe.Pointer(&(_pPager.X47))) = _6_iSectorSize
_10:
{
p := (*int64)(unsafe.Pointer(&(_pPager.X34)))
*p = (*p) + int64(_pPager.X47)
sink6 = *p
}
return _rc
_ = _aMagic
panic(0)
}
var _readJournalHdrØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_readJournalHdrØ00__func__Ø000[0], str(17825), 15)
}
// Change the page size used by the Pager object. The new page size
// is passed in *pPageSize.
//
// If the pager is in the error state when this function is called, it
// is a no-op. The value returned is the error state error code (i.e.
// one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
//
// Otherwise, if all of the following are true:
//
// * the new page size (value of *pPageSize) is valid (a power
// of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and
//
// * there are no outstanding page references, and
//
// * the database is either not an in-memory database or it is
// an in-memory database that currently consists of zero pages.
//
// then the pager object page size is set to *pPageSize.
//
// If the page size is changed, then this function uses sqlite3PagerMalloc()
// to obtain a new Pager.pTmpSpace buffer. If this allocation attempt
// fails, SQLITE_NOMEM is returned and the page size remains unchanged.
// In all other cases, SQLITE_OK is returned.
//
// If the page size is not changed, either because one of the enumerated
// conditions above is not true, the pager was in error state when this
// function was called, or because the memory allocation attempt failed,
// then *pPageSize is set to the old, retained page size before returning.
func _sqlite3PagerSetPagesize(tls *crt.TLS, _pPager *XPager, _pPageSize *uint32, _nReserve int32) (r0 int32) {
var _rc int32
var _1_nByte int64
var _pageSize uint32
var _1_pNew *int8
_rc = i32(0)
_pageSize = *_pPageSize
func() {
if _pageSize != uint32(i32(0)) && (_pageSize < uint32(i32(512)) || _pageSize > uint32(i32(65536))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50655), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000))), unsafe.Pointer(str(17840)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X13) != i32(0) && (_pPager.X22) != uint32(i32(0)) || _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) || _pageSize == 0 || _pageSize == uint32(_pPager.X48) {
goto _8
}
_1_pNew = nil
_1_nByte = i64(0)
if (int32(_pPager.X14) > i32(0)) && ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil) {
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X31), &_1_nByte)
}
if _rc != i32(0) {
goto _11
}
_1_pNew = (*int8)(_sqlite3PageMalloc(tls, int32(_pageSize)))
if _1_pNew == nil {
_rc = _sqlite3NomemError(tls, i32(50668))
}
_11:
if _rc == i32(0) {
_pager_reset(tls, _pPager)
_rc = _sqlite3PcacheSetPageSize(tls, (*XPCache)(_pPager.X59), int32(_pageSize))
}
if _rc == i32(0) {
_sqlite3PageFree(tls, (unsafe.Pointer)(_pPager.X58))
*(**int8)(unsafe.Pointer(&(_pPager.X58))) = _1_pNew
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = uint32(((_1_nByte + int64(_pageSize)) - int64(i32(1))) / int64(_pageSize))
*(*int32)(unsafe.Pointer(&(_pPager.X48))) = int32(_pageSize)
goto _15
}
_sqlite3PageFree(tls, (unsafe.Pointer)(_1_pNew))
_15:
_8:
*_pPageSize = uint32(_pPager.X48)
if _rc != i32(0) {
goto _16
}
if _nReserve < i32(0) {
_nReserve = int32(_pPager.X45)
}
func() {
if _nReserve < i32(0) || _nReserve >= i32(1000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50688), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetPagesizeØ00__func__Ø000))), unsafe.Pointer(str(17905)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_pPager.X45))) = int16(_nReserve)
_pagerFixMaplimit(tls, _pPager)
_16:
return _rc
}
var _sqlite3PagerSetPagesizeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSetPagesizeØ00__func__Ø000[0], str(17934), 24)
}
func _sqlite3OsFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int64) int32
}{((*Xsqlite3_io_methods)(_id.X0).X6)})))(tls, _id, _pSize)
}
// Malloc function used by SQLite to obtain space from the buffer configured
// using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer
// exists, this function falls back to sqlite3Malloc().
func _sqlite3PageMalloc(tls *crt.TLS, _sz int32) (r0 unsafe.Pointer) {
return _pcache1Alloc(tls, _sz)
}
// Discard the entire contents of the in-memory page-cache.
func _pager_reset(tls *crt.TLS, _pPager *XPager) {
*(*uint32)(unsafe.Pointer(&(_pPager.X39))) += 1
_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.X36))
_sqlite3PcacheClear(tls, (*XPCache)(_pPager.X59))
}
// Discard the contents of the cache.
func _sqlite3PcacheClear(tls *crt.TLS, _pCache *XPCache) {
_sqlite3PcacheTruncate(tls, _pCache, uint32(i32(0)))
}
// Drop every cache entry whose page number is greater than "pgno". The
// caller must ensure that there are no outstanding references to any pages
// other than page 1 with a page number greater than pgno.
//
// If there is a reference to page 1 and the pgno parameter passed to this
// function is 0, then the data area associated with page 1 is zeroed, but
// the page object is not dropped.
func _sqlite3PcacheTruncate(tls *crt.TLS, _pCache *XPCache, _pgno uint32) {
var _1_p, _1_pNext *XPgHdr
var _4_pPage1 *Xsqlite3_pcache_page
if (_pCache.X12) == nil {
goto _0
}
_1_p = (*XPgHdr)(_pCache.X0)
_1:
if _1_p == nil {
goto _4
}
_1_pNext = (*XPgHdr)(_1_p.X9)
func() {
if (_1_p.X5) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000))), unsafe.Pointer(str(17958)))
crt.X__builtin_abort(tls)
}
}()
if (_1_p.X5) > _pgno {
func() {
if (int32(_1_p.X6) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000))), unsafe.Pointer(str(17968)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3PcacheMakeClean(tls, _1_p)
}
_1_p = _1_pNext
goto _1
_4:
if _pgno != uint32(i32(0)) || (_pCache.X3) == 0 {
goto _11
}
_4_pPage1 = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, uint32(i32(1)), i32(0))
if func() int32 {
if _4_pPage1 != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44791), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheTruncateØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
crt.Xmemset(tls, _4_pPage1.X0, i32(0), uint32(_pCache.X6))
_pgno = uint32(i32(1))
}
_11:
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X10)(tls, _pCache.X12, _pgno+uint32(i32(1)))
_0:
}
var _sqlite3PcacheTruncateØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheTruncateØ00__func__Ø000[0], str(17989), 22)
}
// Make sure the page is marked as clean. If it isn't clean already,
// make it so.
func _sqlite3PcacheMakeClean(tls *crt.TLS, _p *XPgHdr) {
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44698), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (int32(_p.X6) & i32(2)) != i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44699), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _4
}
func() {
if (int32(_p.X6) & i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44700), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000))), unsafe.Pointer(str(18011)))
crt.X__builtin_abort(tls)
}
}()
_pcacheManageDirtyList(tls, _p, uint8(i32(1)))
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) & i32(-15))
sink14 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44705), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMakeCleanØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
if int32(_p.X7) == i32(0) {
_pcacheUnpin(tls, _p)
}
_4:
}
var _sqlite3PcacheMakeCleanØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheMakeCleanØ00__func__Ø000[0], str(18039), 23)
}
// Change the page size for PCache object. The caller must ensure that there
// are no outstanding page references when this function is called.
func _sqlite3PcacheSetPageSize(tls *crt.TLS, _pCache *XPCache, _szPage int32) (r0 int32) {
var _1_pNew unsafe.Pointer
func() {
if (_pCache.X3) != i32(0) || (*XPgHdr)(_pCache.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44444), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(18062)))
crt.X__builtin_abort(tls)
}
}()
if (_pCache.X6) == 0 {
goto _3
}
_1_pNew = ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X4)(tls, _szPage, int32(uint32(_pCache.X7)+u32(40)), int32(_pCache.X8))
if _1_pNew == nil {
return _sqlite3NomemError(tls, i32(44451))
}
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X5)(tls, _1_pNew, _numberOfCachePages(tls, _pCache))
if (_pCache.X12) != nil {
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X11)(tls, _pCache.X12)
}
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X12))) = _1_pNew
*(*int32)(unsafe.Pointer(&(_pCache.X6))) = _szPage
_3:
return i32(0)
}
var _sqlite3PcacheSetPageSizeØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheSetPageSizeØ00__func__Ø000[0], str(18102), 25)
}
// Compute the number of pages of cache requested. p->szCache is the
// cache size requested by the "PRAGMA cache_size" statement.
func _numberOfCachePages(tls *crt.TLS, _p *XPCache) (r0 int32) {
if (_p.X4) >= i32(0) {
return _p.X4
}
return int32((int64(i32(-1024)) * int64(_p.X4)) / int64((_p.X6)+(_p.X7)))
}
// Free an allocated buffer obtained from sqlite3PageMalloc().
func _sqlite3PageFree(tls *crt.TLS, _p unsafe.Pointer) {
_pcache1Free(tls, _p)
}
// Invoke SQLITE_FCNTL_MMAP_SIZE based on the current value of szMmap.
func _pagerFixMaplimit(tls *crt.TLS, _pPager *XPager) {
var _1_sz int64
var _fd *Xsqlite3_file
_fd = (*Xsqlite3_file)(_pPager.X31)
if ((*Xsqlite3_io_methods)(_fd.X0) != nil) && (((*Xsqlite3_io_methods)(_fd.X0).X0) >= i32(3)) {
_1_sz = _pPager.X42
*(*uint8)(unsafe.Pointer(&(_pPager.X20))) = uint8(bool2int(_1_sz > int64(i32(0))))
_setGetterMethod(tls, _pPager)
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(18), (unsafe.Pointer)(&_1_sz))
}
}
// Set the Pager.xGet method for the appropriate routine used to fetch
// content from the pager.
func _setGetterMethod(tls *crt.TLS, _pPager *XPager) {
if (_pPager.X26) != 0 {
*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageError
goto _3
}
if (_pPager.X20) != 0 {
*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageMMap
goto _3
}
*(*func(*crt.TLS, *XPager, uint32, **XPgHdr, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pPager.X57))))) = _getPageNormal
_3:
}
// The page getter method for when the pager is an error state
func _getPageError(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
func() {
if (_pPager.X26) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52502), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageErrorØ00__func__Ø000))), unsafe.Pointer(str(12253)))
crt.X__builtin_abort(tls)
}
}()
*_ppPage = nil
return _pPager.X26
}
var _getPageErrorØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_getPageErrorØ00__func__Ø000[0], str(18127), 13)
}
// The page getter for when memory-mapped I/O is enabled
func _getPageMMap(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
var _rc, _bMmapOk int32
var _iFrame uint32
var _4_pData unsafe.Pointer
var _pPg *XPgHdr
_rc = i32(0)
_pPg = nil
_iFrame = u32(0)
_bMmapOk = bool2int((_pgno > uint32(i32(1))) && ((int32(_pPager.X14) == i32(1)) || (_flags&i32(2)) != 0))
func() {
if (_pPager.X20) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52440), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(18140)))
crt.X__builtin_abort(tls)
}
}()
if (_pgno <= uint32(i32(1))) && (_pgno == uint32(i32(0))) {
return _sqlite3CorruptError(tls, i32(52450))
}
func() {
if int32(_pPager.X14) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52452), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(18157)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52453), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X21) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52454), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(18186)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52455), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
if _bMmapOk == 0 || (*XWal)(_pPager.X60) == nil {
goto _15
}
_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.X60), _pgno, &_iFrame)
if _rc != i32(0) {
*_ppPage = nil
return _rc
}
_15:
if _bMmapOk == 0 || _iFrame != uint32(i32(0)) {
goto _18
}
_4_pData = nil
_rc = _sqlite3OsFetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(_pgno-uint32(i32(1)))*int64(_pPager.X48), _pPager.X48, &_4_pData)
if _rc != i32(0) || _4_pData == nil {
goto _20
}
if (int32(_pPager.X14) > i32(1)) || ((_pPager.X10) != 0) {
_pPg = _sqlite3PagerLookup(tls, _pPager, _pgno)
}
if _pPg == nil {
_rc = _pagerAcquireMapPage(tls, _pPager, _pgno, _4_pData, &_pPg)
goto _24
}
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(_pgno-uint32(i32(1)))*int64(_pPager.X48), _4_pData)
_24:
if _pPg != nil {
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52479), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageMMapØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
*_ppPage = _pPg
return i32(0)
}
_20:
if _rc != i32(0) {
*_ppPage = nil
return _rc
}
_18:
return _getPageNormal(tls, _pPager, _pgno, _ppPage, _flags)
}
var _getPageMMapØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_getPageMMapØ00__func__Ø000[0], str(18215), 12)
}
// The real implementation of xFetch and xUnfetch
func _sqlite3OsFetch(tls *crt.TLS, _id *Xsqlite3_file, _iOff int64, _iAmt int32, _pp *unsafe.Pointer) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X17)})))(tls, _id, _iOff, _iAmt, _pp)
}
// Obtain a reference to a memory mapped page object for page number pgno.
// The new object will use the pointer pData, obtained from xFetch().
// If successful, set *ppPage to point to the new page reference
// and return SQLITE_OK. Otherwise, return an SQLite error code and set
// *ppPage to zero.
//
// Page references obtained by calling this function should be released
// by calling pagerReleaseMapPage().
func _pagerAcquireMapPage(tls *crt.TLS, _pPager *XPager, _pgno uint32, _pData unsafe.Pointer, _ppPage **XPgHdr) (r0 int32) {
var _p *XPgHdr
if (*XPgHdr)(_pPager.X43) != nil {
*_ppPage = store25(&_p, (*XPgHdr)(_pPager.X43))
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X43))))) = (*XPgHdr)(_p.X3)
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil
func() {
if int32(_pPager.X44) < i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50940), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18227)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, _p.X2, i32(0), uint32(i32(8)))
goto _3
}
*_ppPage = store25(&_p, (*XPgHdr)(_sqlite3MallocZero(tls, uint64(u32(40)+uint32(_pPager.X44)))))
if _p == nil {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(_pgno-uint32(i32(1)))*int64(_pPager.X48), _pData)
return _sqlite3NomemError(tls, i32(50946))
}
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 40*uintptr(i32(1)))))
*(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(i32(32))
*(*int16)(unsafe.Pointer(&(_p.X7))) = int16(i32(1))
*(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _pPager
_3:
func() {
if _p.X2 != (unsafe.Pointer)((*XPgHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+40*uintptr(i32(1))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50954), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18245)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_pcache_page)(_p.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50955), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18270)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X6) != i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50956), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18282)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPager)(_p.X4) != _pPager {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50957), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(18303)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X7) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50958), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerAcquireMapPageØ00__func__Ø000))), unsafe.Pointer(str(16340)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X5))) = _pgno
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))) = _pData
*(*int32)(unsafe.Pointer(&(_pPager.X41))) += 1
return i32(0)
}
var _pagerAcquireMapPageØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_pagerAcquireMapPageØ00__func__Ø000[0], str(18321), 20)
}
// The page getter methods each try to acquire a reference to a
// page with page number pgno. If the requested reference is
// successfully obtained, it is copied to *ppPage and SQLITE_OK returned.
//
// There are different implementations of the getter method depending
// on the current state of the pager.
//
// getPageNormal() -- The normal getter
// getPageError() -- Used if the pager is in an error state
// getPageMmap() -- Used if memory-mapped I/O is enabled
//
// If the requested page is already in the cache, it is returned.
// Otherwise, a new page object is allocated and populated with data
// read from the database file. In some cases, the pcache module may
// choose not to allocate a new page object and may reuse an existing
// object with no outstanding references.
//
// The extra data appended to a page is always initialized to zeros the
// first time a page is loaded into memory. If the page requested is
// already in the cache when this function is called, then the extra
// data is left as it was when the page object was last used.
//
// If the database image is smaller than the requested page or if
// the flags parameter contains the PAGER_GET_NOCONTENT bit and the
// requested page is not already stored in the cache, then no
// actual disk read occurs. In this case the memory image of the
// page is initialized to all zeros.
//
// If PAGER_GET_NOCONTENT is true, it means that we do not care about
// the contents of the page. This occurs in two scenarios:
//
// a) When reading a free-list leaf page from the database, and
//
// b) When a savepoint is being rolled back and we need to load
// a new page into the cache to be filled with the data read
// from the savepoint journal.
//
// If PAGER_GET_NOCONTENT is true, then the data returned is zeroed instead
// of being read from the database. Additionally, the bits corresponding
// to pgno in Pager.pInJournal (bitvec of pages already written to the
// journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open
// savepoints are set. This means if the page is made writable at any
// point in the future, using a call to sqlite3PagerWrite(), its contents
// will not be journaled. This saves IO.
//
// The acquisition might fail for several reasons. In all cases,
// an appropriate error code is returned and *ppPage is set to NULL.
//
// See also sqlite3PagerLookup(). Both this routine and Lookup() attempt
// to find a page in the in-memory cache first. If the page is not already
// in memory, this routine goes to disk to read it in whereas Lookup()
// just returns 0. This routine acquires a read-lock the first time it
// has to go to disk, and could also playback an old journal if necessary.
// Since Lookup() never goes to disk, it never has to deal with locks
// or journal files.
func _getPageNormal(tls *crt.TLS, _pPager *XPager, _pgno uint32, _ppPage **XPgHdr, _flags int32) (r0 int32) {
var _rc int32
var _10_iFrame uint32
var _noContent uint8
var _pPg *XPgHdr
var _pBase *Xsqlite3_pcache_page
_rc = i32(0)
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52326), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52327), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18157)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52328), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X21) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52329), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18186)))
crt.X__builtin_abort(tls)
}
}()
if _pgno == uint32(i32(0)) {
return _sqlite3CorruptError(tls, i32(52331))
}
_pBase = _sqlite3PcacheFetch(tls, (*XPCache)(_pPager.X59), _pgno, i32(3))
if _pBase != nil {
goto _9
}
_pPg = nil
_rc = _sqlite3PcacheFetchStress(tls, (*XPCache)(_pPager.X59), _pgno, &_pBase)
if _rc != i32(0) {
goto _pager_acquire_err
}
if _pBase == nil {
_rc = _sqlite3NomemError(tls, i32(52338))
goto _pager_acquire_err
}
_9:
_pPg = store25(_ppPage, _sqlite3PcacheFetchFinish(tls, (*XPCache)(_pPager.X59), _pgno, _pBase))
func() {
if _pPg != (*_ppPage) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52343), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18341)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPg.X5) != _pgno {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52344), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18356)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPager)(_pPg.X4) != _pPager && (*XPager)(_pPg.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52345), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18372)))
crt.X__builtin_abort(tls)
}
}()
_noContent = uint8(bool2int((_flags & i32(1)) != i32(0)))
if ((*XPager)(_pPg.X4) != nil) && (_noContent == 0) {
func() {
if _pgno > uint32(i32(2147483647)) || _pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52351), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18410)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(0)))) += 1
return i32(0)
}
if (_pgno > uint32(i32(2147483647))) || (_pgno == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))) {
_rc = _sqlite3CorruptError(tls, i32(52363))
goto _pager_acquire_err
}
*(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X4))))) = _pPager
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52369), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18462)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil && (_pPager.X22) >= _pgno && _noContent == 0 {
goto _32
}
if _pgno > (_pPager.X49) {
_rc = i32(13)
goto _pager_acquire_err
}
if _noContent == 0 {
goto _34
}
_sqlite3BeginBenignMalloc(tls)
if _pgno <= (_pPager.X23) {
_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pPager.X30), _pgno)
}
_rc = _addToSavepointBitvecs(tls, _pPager, _pgno)
_sqlite3EndBenignMalloc(tls)
_34:
crt.Xmemset(tls, _pPg.X1, i32(0), uint32(_pPager.X48))
goto _36
_32:
_10_iFrame = u32(0)
if (*XWal)(_pPager.X60) == nil {
goto _37
}
_rc = _sqlite3WalFindFrame(tls, (*XWal)(_pPager.X60), _pgno, &_10_iFrame)
if _rc != i32(0) {
goto _pager_acquire_err
}
_37:
func() {
if (*XPager)(_pPg.X4) != _pPager {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52399), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18492)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(1)))) += 1
_rc = _readDbPage(tls, _pPg, _10_iFrame)
if _rc != i32(0) {
goto _pager_acquire_err
}
_36:
return i32(0)
_pager_acquire_err:
func() {
if _rc == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52411), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageNormalØ00__func__Ø000))), unsafe.Pointer(str(18512)))
crt.X__builtin_abort(tls)
}
}()
if _pPg != nil {
_sqlite3PcacheDrop(tls, _pPg)
}
_pagerUnlockIfUnused(tls, _pPager)
*_ppPage = nil
return _rc
}
var _getPageNormalØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_getPageNormalØ00__func__Ø000[0], str(18526), 14)
}
// If the sqlite3PcacheFetch() routine is unable to allocate a new
// page because no clean pages are available for reuse and the cache
// size limit has been reached, then this routine can be invoked to
// try harder to allocate a page. This routine might invoke the stress
// callback to spill dirty pages to the journal. It will then try to
// allocate the new page and will only fail to allocate a new page on
// an OOM error.
//
// This routine should be invoked only after sqlite3PcacheFetch() fails.
func _sqlite3PcacheFetchStress(tls *crt.TLS, _pCache *XPCache, _pgno uint32, _ppPage **Xsqlite3_pcache_page) (r0 int32) {
var _3_rc int32
var _pPg *XPgHdr
if int32(_pCache.X9) == i32(2) {
return i32(0)
}
if _sqlite3PcachePagecount(tls, _pCache) <= (_pCache.X5) {
goto _1
}
_pPg = (*XPgHdr)(_pCache.X2)
_2:
if _pPg == nil || (_pPg.X7) == 0 && (int32(_pPg.X6)&i32(8)) == 0 {
goto _7
}
_pPg = (*XPgHdr)(_pPg.X10)
goto _2
_7:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = _pPg
if _pPg != nil {
goto _8
}
_pPg = (*XPgHdr)(_pCache.X1)
_9:
if _pPg == nil || (_pPg.X7) == 0 {
goto _13
}
_pPg = (*XPgHdr)(_pPg.X10)
goto _9
_13:
_8:
if _pPg == nil {
goto _14
}
_3_rc = (*(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{(_pCache.X10)})))(tls, _pCache.X11, _pPg)
if (_3_rc != i32(0)) && (_3_rc != i32(5)) {
return _3_rc
}
_14:
_1:
*_ppPage = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32) *Xsqlite3_pcache_page)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X7)})))(tls, _pCache.X12, _pgno, i32(2))
return func() int32 {
if (*_ppPage) == nil {
return _sqlite3NomemError(tls, i32(44572))
}
return i32(0)
}()
}
// Return the total number of pages in the cache.
func _sqlite3PcachePagecount(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
func() {
if (_pCache.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44922), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcachePagecountØ00__func__Ø000))), unsafe.Pointer(str(15958)))
crt.X__builtin_abort(tls)
}
}()
return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X6)(tls, _pCache.X12)
}
var _sqlite3PcachePagecountØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcachePagecountØ00__func__Ø000[0], str(18540), 23)
}
func _sqlite3OsFileControlHint(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) {
(*(*func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X10)})))(tls, _id, _op, _pArg)
}
// Move the write position of the WAL back to the point identified by
// the values in the aWalData[] array. aWalData must point to an array
// of WAL_SAVEPOINT_NDATA u32 values that has been previously populated
// by a call to WalSavepoint().
func _sqlite3WalSavepointUndo(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57316), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3))))) == (_pWal.X22) && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0))))) > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57317), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointUndoØ00__func__Ø000))), unsafe.Pointer(str(18563)))
crt.X__builtin_abort(tls)
}
}()
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3))))) != (_pWal.X22) {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0)))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0))))) < ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(1))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(2))))
_walCleanupHash(tls, _pWal)
}
return _rc
}
var _sqlite3WalSavepointUndoØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalSavepointUndoØ00__func__Ø000[0], str(18622), 24)
}
// This routine ends a transaction. A transaction is usually ended by
// either a COMMIT or a ROLLBACK operation. This routine may be called
// after rollback of a hot-journal, or if an error occurs while opening
// the journal file or writing the very first journal-header of a
// database transaction.
//
// This routine is never called in PAGER_ERROR state. If it is called
// in PAGER_NONE or PAGER_SHARED state and the lock held is less
// exclusive than a RESERVED lock, it is a no-op.
//
// Otherwise, any active savepoints are released.
//
// If the journal file is open, then it is "finalized". Once a journal
// file has been finalized it is not possible to use it to roll back a
// transaction. Nor will it be considered to be a hot-journal by this
// or any other database connection. Exactly how a journal is finalized
// depends on whether or not the pager is running in exclusive mode and
// the current journal-mode (Pager.journalMode value), as follows:
//
// journalMode==MEMORY
// Journal file descriptor is simply closed. This destroys an
// in-memory journal.
//
// journalMode==TRUNCATE
// Journal file is truncated to zero bytes in size.
//
// journalMode==PERSIST
// The first 28 bytes of the journal file are zeroed. This invalidates
// the first journal header in the file, and hence the entire journal
// file. An invalid journal file cannot be rolled back.
//
// journalMode==DELETE
// The journal file is closed and deleted using sqlite3OsDelete().
//
// If the pager is running in exclusive mode, this method of finalizing
// the journal file is never used. Instead, if the journalMode is
// DELETE and the pager is in exclusive mode, the method described under
// journalMode==PERSIST is used instead.
//
// After the journal is finalized, the pager moves to PAGER_READER state.
// If running in non-exclusive rollback mode, the lock on the file is
// downgraded to a SHARED_LOCK.
//
// SQLITE_OK is returned if no error occurs. If an error occurs during
// any of the IO operations to finalize the journal file or unlock the
// database then the IO error code is returned to the user. If the
// operation to finalize the journal file fails, then the code still
// tries to unlock the database file if not in exclusive mode. If the
// unlock operation fails as well, then the first error code related
// to the first error encountered (the journal finalization one) is
// returned.
func _pager_end_transaction(tls *crt.TLS, _pPager *XPager, _hasMaster int32, _bCommit int32) (r0 int32) {
var _rc, _rc2, _9_bDelete int32
_rc = i32(0)
_rc2 = i32(0)
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48925), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48926), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(15064)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pPager.X14) < i32(2)) && (int32(_pPager.X15) < i32(2)) {
return i32(0)
}
_releaseAllSavepoints(tls, _pPager)
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil && (*XBitvec)(_pPager.X30) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48932), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18646)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
goto _9
}
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48934), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X32)) != 0 {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
goto _24
}
if int32(_pPager.X2) != i32(3) {
goto _14
}
if (_pPager.X34) == int64(i32(0)) {
_rc = i32(0)
goto _16
}
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), int64(i32(0)))
if (_rc == i32(0)) && ((_pPager.X5) != 0) {
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), int32(_pPager.X9))
}
_16:
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
goto _24
_14:
if (int32(_pPager.X2) == i32(1)) || (((_pPager.X1) != 0) && (int32(_pPager.X2) != i32(5))) {
_rc = _zeroJournalHdr(tls, _pPager, bool2int(_hasMaster != 0 || ((_pPager.X10) != 0)))
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
goto _24
}
_9_bDelete = bool2int((_pPager.X10) == 0)
func() {
if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48967), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18691)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X2) != i32(0) && int32(_pPager.X2) != i32(4) && int32(_pPager.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48968), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18732)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
if _9_bDelete != 0 {
_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X52, int32(_pPager.X6))
}
_24:
_9:
_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30))
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil
*(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0)
if _rc != i32(0) {
goto _32
}
if ((_pPager.X13) != 0) || _pagerFlushOnCommit(tls, _pPager, _bCommit) != 0 {
_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.X59))
goto _35
}
_sqlite3PcacheClearWritable(tls, (*XPCache)(_pPager.X59))
_35:
_sqlite3PcacheTruncate(tls, (*XPCache)(_pPager.X59), _pPager.X22)
_32:
if (*XWal)(_pPager.X60) != nil {
_rc2 = _sqlite3WalEndWriteTransaction(tls, (*XWal)(_pPager.X60))
func() {
if _rc2 != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49008), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18873)))
crt.X__builtin_abort(tls)
}
}()
goto _42
}
if ((_rc == i32(0)) && _bCommit != 0) && ((_pPager.X24) > (_pPager.X22)) {
func() {
if int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49016), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_end_transactionØ00__func__Ø000))), unsafe.Pointer(str(18888)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pager_truncate(tls, _pPager, _pPager.X22)
}
_42:
if _rc != i32(0) || _bCommit == 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
goto _47
}
_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(22), nil)
if _rc == i32(12) {
_rc = i32(0)
}
_47:
if ((_pPager.X1) == 0) && (((*XWal)(_pPager.X60) == nil) || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(0)) != 0) {
_rc2 = _pagerUnlockDb(tls, _pPager, i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0))
}
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0))
return func() int32 {
if _rc == i32(0) {
return _rc2
}
return _rc
}()
}
var _pager_end_transactionØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pager_end_transactionØ00__func__Ø000[0], str(18918), 22)
}
// Free all structures in the Pager.aSavepoint[] array and set both
// Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal
// if it is open and the pager is not in exclusive mode.
func _releaseAllSavepoints(tls *crt.TLS, _pPager *XPager) {
var _ii int32
_ii = i32(0)
_0:
if _ii >= (_pPager.X38) {
goto _3
}
_sqlite3BitvecDestroy(tls, (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr(_pPager.X37)+44*uintptr(_ii))).X2))
_ii += 1
goto _0
_3:
if ((_pPager.X1) == 0) || _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X33)) != 0 {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X33))
}
Xsqlite3_free(tls, _pPager.X37)
*(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X37))))) = nil
*(*int32)(unsafe.Pointer(&(_pPager.X38))) = i32(0)
*(*uint32)(unsafe.Pointer(&(_pPager.X29))) = uint32(i32(0))
}
func _sqlite3OsSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X5)})))(tls, _id, _flags)
}
// The journal file must be open when this function is called.
//
// This function is a no-op if the journal file has not been written to
// within the current transaction (i.e. if Pager.journalOff==0).
//
// If doTruncate is non-zero or the Pager.journalSizeLimit variable is
// set to 0, then truncate the journal file to zero bytes in size. Otherwise,
// zero the 28-byte header at the start of the journal file. In either case,
// if the pager is not in no-sync mode, sync the journal file immediately
// after writing or truncating it.
//
// If Pager.journalSizeLimit is set to a positive, non-zero value, and
// following the truncation or zeroing described above the size of the
// journal file in bytes is larger than this value, then truncate the
// journal file to Pager.journalSizeLimit bytes. The journal file does
// not need to be synced following this operation.
//
// If an IO error occurs, abandon processing and return the IO error code.
// Otherwise, return SQLITE_OK.
func _zeroJournalHdr(tls *crt.TLS, _pPager *XPager, _doTruncate int32) (r0 int32) {
var _rc int32
var _1_iLimit, _5_sz int64
_rc = i32(0)
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48287), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(13626)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3JournalIsInMemory(tls, (*Xsqlite3_file)(_pPager.X32)) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48288), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroJournalHdrØ00__func__Ø000))), unsafe.Pointer(str(18940)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X34) == 0 {
goto _4
}
_1_iLimit = _pPager.X50
if _doTruncate != 0 || (_1_iLimit == int64(i32(0))) {
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), int64(i32(0)))
goto _7
}
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_zeroJournalHdrØ00zeroHdrØ001), int32(u32(28)), int64(i32(0)))
_7:
if (_rc == i32(0)) && ((_pPager.X4) == 0) {
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), i32(16)|int32(_pPager.X9))
}
if _rc != i32(0) || _1_iLimit <= int64(i32(0)) {
goto _11
}
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), &_5_sz)
if (_rc == i32(0)) && (_5_sz > _1_iLimit) {
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), _1_iLimit)
}
_11:
_4:
return _rc
}
var _zeroJournalHdrØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_zeroJournalHdrØ00__func__Ø000[0], str(18979), 15)
}
var _zeroJournalHdrØ00zeroHdrØ001 [28]int8
func _sqlite3OsDelete(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
func() {
if _dirSync != i32(0) && _dirSync != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20297), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OsDeleteØ00__func__Ø000))), unsafe.Pointer(str(18994)))
crt.X__builtin_abort(tls)
}
}()
return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
}{(_pVfs.X7)})))(tls, _pVfs, _zPath, _dirSync)
}
var _sqlite3OsDeleteØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OsDeleteØ00__func__Ø000[0], str(19019), 16)
}
// The write transaction open on pPager is being committed (bCommit==1)
// or rolled back (bCommit==0).
//
// Return TRUE if and only if all dirty pages should be flushed to disk.
//
// Rules:
//
// * For non-TEMP databases, always sync to disk. This is necessary
// for transactions to be durable.
//
// * Sync TEMP database only on a COMMIT (not a ROLLBACK) when the backing
// file has been created already (via a spill on pagerStress()) and
// when the number of dirty pages in memory exceeds 25% of the total
// cache size.
func _pagerFlushOnCommit(tls *crt.TLS, _pPager *XPager, _bCommit int32) (r0 int32) {
if int32(_pPager.X10) == i32(0) {
return i32(1)
}
if _bCommit == 0 {
return i32(0)
}
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
return i32(0)
}
return bool2int(_sqlite3PCachePercentDirty(tls, (*XPCache)(_pPager.X59)) >= i32(25))
}
// Return the number of dirty pages currently in the cache, as a percentage
// of the configured cache size.
func _sqlite3PCachePercentDirty(tls *crt.TLS, _pCache *XPCache) (r0 int32) {
var _nDirty, _nCache int32
var _pDirty *XPgHdr
_nDirty = i32(0)
_nCache = _numberOfCachePages(tls, _pCache)
_pDirty = (*XPgHdr)(_pCache.X0)
_0:
if _pDirty == nil {
goto _3
}
_nDirty += 1
_pDirty = (*XPgHdr)(_pDirty.X9)
goto _0
_3:
return func() int32 {
if _nCache != 0 {
return int32((int64(_nDirty) * int64(i32(100))) / int64(_nCache))
}
return i32(0)
}()
}
// Make every page in the cache clean.
func _sqlite3PcacheCleanAll(tls *crt.TLS, _pCache *XPCache) {
var _p *XPgHdr
_0:
if store25(&_p, (*XPgHdr)(_pCache.X0)) != nil {
_sqlite3PcacheMakeClean(tls, _p)
goto _0
}
}
// Clear the PGHDR_NEED_SYNC and PGHDR_WRITEABLE flag from all dirty pages.
func _sqlite3PcacheClearWritable(tls *crt.TLS, _pCache *XPCache) {
var _p *XPgHdr
_p = (*XPgHdr)(_pCache.X0)
_0:
if _p == nil {
goto _3
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) & i32(-13))
sink14 = *p
}
_p = (*XPgHdr)(_p.X9)
goto _0
_3:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = (*XPgHdr)(_pCache.X1)
}
// End a write transaction. The commit has already been done. This
// routine merely releases the lock.
func _sqlite3WalEndWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
if (_pWal.X12) != 0 {
_walUnlockExclusive(tls, _pWal, i32(0), i32(1))
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_pWal.X20))) = uint32(i32(0))
*(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(0))
}
return i32(0)
}
func _walUnlockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) {
if (_pWal.X11) != 0 {
return
}
_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, _n, i32(9))
}
func _sqlite3OsShmLock(tls *crt.TLS, _id *Xsqlite3_file, _offset int32, _n int32, _flags int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X14)})))(tls, _id, _offset, _n, _flags)
}
// This function is used to change the actual size of the database
// file in the file-system. This only happens when committing a transaction,
// or rolling back a transaction (including rolling back a hot-journal).
//
// If the main database file is not open, or the pager is not in either
// DBMOD or OPEN state, this function is a no-op. Otherwise, the size
// of the file is changed to nPage pages (nPage*pPager->pageSize bytes).
// If the file on disk is currently larger than nPage pages, then use the VFS
// xTruncate() method to truncate it.
//
// Or, it might be the case that the file on disk is smaller than
// nPage pages. Some operating system implementations can get confused if
// you try to truncate a file to some size that is larger than it
// currently is, so detect this case and write a single zero byte to
// the end of the new file instead.
//
// If successful, return SQLITE_OK. If an IO error occurs while modifying
// the database file, return the error code to the caller.
func _pager_truncate(tls *crt.TLS, _pPager *XPager, _nPage uint32) (r0 int32) {
var _rc, _1_szPage int32
var _1_currentSize, _1_newSize int64
var _4_pTmp *int8
_rc = i32(0)
func() {
if int32(_pPager.X14) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49548), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_truncateØ00__func__Ø000))), unsafe.Pointer(str(15064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49549), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_truncateØ00__func__Ø000))), unsafe.Pointer(str(19035)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil || int32(_pPager.X14) < i32(4) && int32(_pPager.X14) != i32(0) {
goto _6
}
_1_szPage = _pPager.X48
func() {
if int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49556), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_truncateØ00__func__Ø000))), unsafe.Pointer(str(18888)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X31), &_1_currentSize)
_1_newSize = int64(_1_szPage) * int64(_nPage)
if _rc != i32(0) || _1_currentSize == _1_newSize {
goto _10
}
if _1_currentSize > _1_newSize {
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X31), _1_newSize)
goto _13
}
if (_1_currentSize + int64(_1_szPage)) <= _1_newSize {
_4_pTmp = _pPager.X58
crt.Xmemset(tls, (unsafe.Pointer)(_4_pTmp), i32(0), uint32(_1_szPage))
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_4_pTmp), _1_szPage, _1_newSize-int64(_1_szPage))
}
_13:
if _rc == i32(0) {
*(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _nPage
}
_10:
_6:
return _rc
}
var _pager_truncateØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pager_truncateØ00__func__Ø000[0], str(19064), 15)
}
// This function is called to change the WAL subsystem into or out
// of locking_mode=EXCLUSIVE.
//
// If op is zero, then attempt to change from locking_mode=EXCLUSIVE
// into locking_mode=NORMAL. This means that we must acquire a lock
// on the pWal->readLock byte. If the WAL is already in locking_mode=NORMAL
// or if the acquisition of the lock fails, then return 0. If the
// transition out of exclusive-mode is successful, return 1. This
// operation must occur while the pager is still holding the exclusive
// lock on the main database file.
//
// If op is one, then change from locking_mode=NORMAL into
// locking_mode=EXCLUSIVE. This means that the pWal->readLock must
// be released. Return 1 if the transition is made and 0 if the
// WAL is already in exclusive-locking mode - meaning that this
// routine is a no-op. The pager must already hold the exclusive lock
// on the main database file before invoking this operation.
//
// If op is negative, then do a dry-run of the op==1 case but do
// not actually change anything. The pager uses this to see if it
// should acquire the database exclusive lock prior to invoking
// the op==1 case.
func _sqlite3WalExclusiveMode(tls *crt.TLS, _pWal *XWal, _op int32) (r0 int32) {
var _rc int32
func() {
if int32(_pWal.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(19079)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X11) == i32(2) && _op != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57903), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(19098)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X9) < i32(0) && (_pWal.X23) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57911), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(16369)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X9) < i32(0) && (_op > i32(0) || int32(_pWal.X11) != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57912), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(19149)))
crt.X__builtin_abort(tls)
}
}()
if _op != i32(0) {
goto _12
}
if (_pWal.X11) == 0 {
goto _13
}
*(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(0))
if _walLockShared(tls, _pWal, i32(3)+int32(_pWal.X9)) != i32(0) {
*(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1))
}
_rc = bool2int(int32(_pWal.X11) == i32(0))
goto _15
_13:
_rc = i32(0)
_15:
goto _22
_12:
if _op > i32(0) {
func() {
if int32(_pWal.X11) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(19204)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X9) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57927), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalExclusiveModeØ00__func__Ø000))), unsafe.Pointer(str(19227)))
crt.X__builtin_abort(tls)
}
}()
_walUnlockShared(tls, _pWal, i32(3)+int32(_pWal.X9))
*(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1))
_rc = i32(1)
goto _22
}
_rc = bool2int(int32(_pWal.X11) == i32(0))
_22:
return _rc
}
var _sqlite3WalExclusiveModeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalExclusiveModeØ00__func__Ø000[0], str(19245), 24)
}
// Set or release locks on the WAL. Locks are either shared or exclusive.
// A lock cannot be moved directly between shared and exclusive - it must go
// through the unlocked state first.
//
// In locking_mode=EXCLUSIVE, all of these routines become no-ops.
func _walLockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) (r0 int32) {
var _rc int32
if (_pWal.X11) != 0 {
return i32(0)
}
_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, i32(1), i32(6))
*(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5))))
return _rc
}
func _walUnlockShared(tls *crt.TLS, _pWal *XWal, _lockIdx int32) {
if (_pWal.X11) != 0 {
return
}
_sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, i32(1), i32(5))
}
// Unlock the database file to level eLock, which must be either NO_LOCK
// or SHARED_LOCK. Regardless of whether or not the call to xUnlock()
// succeeds, set the Pager.eLock variable to match the (attempted) new lock.
//
// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
// called, do not modify it. See the comment above the #define of
// UNKNOWN_LOCK for an explanation of this.
func _pagerUnlockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if (_pPager.X1) != 0 && int32(_pPager.X15) != _eLock {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48049), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000))), unsafe.Pointer(str(19269)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eLock != i32(0) && _eLock != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48050), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000))), unsafe.Pointer(str(19316)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eLock == i32(0) && bool2int((*XWal)(_pPager.X60) != nil) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48051), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000))), unsafe.Pointer(str(19353)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
goto _9
}
func() {
if int32(_pPager.X15) < _eLock {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48053), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerUnlockDbØ00__func__Ø000))), unsafe.Pointer(str(19394)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if (_pPager.X11) != 0 {
return i32(0)
}
return _sqlite3OsUnlock(tls, (*Xsqlite3_file)(_pPager.X31), _eLock)
}()
if int32(_pPager.X15) != i32(5) {
*(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(_eLock)
}
_9:
return _rc
}
var _pagerUnlockDbØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_pagerUnlockDbØ00__func__Ø000[0], str(19415), 14)
}
func _sqlite3OsUnlock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X8)})))(tls, _id, _lockType)
}
// Playback the journal and thus restore the database file to
// the state it was in before we started making changes.
//
// The journal file format is as follows:
//
// (1) 8 byte prefix. A copy of aJournalMagic[].
// (2) 4 byte big-endian integer which is the number of valid page records
// in the journal. If this value is 0xffffffff, then compute the
// number of page records from the journal size.
// (3) 4 byte big-endian integer which is the initial value for the
// sanity checksum.
// (4) 4 byte integer which is the number of pages to truncate the
// database to during a rollback.
// (5) 4 byte big-endian integer which is the sector size. The header
// is this many bytes in size.
// (6) 4 byte big-endian integer which is the page size.
// (7) zero padding out to the next sector size.
// (8) Zero or more pages instances, each as follows:
// + 4 byte page number.
// + pPager->pageSize bytes of data.
// + 4 byte checksum
//
// When we speak of the journal header, we mean the first 7 items above.
// Each entry in the journal is an instance of the 8th item.
//
// Call the value from the second bullet "nRec". nRec is the number of
// valid page entries in the journal. In most cases, you can compute the
// value of nRec from the size of the journal file. But if a power
// failure occurred while the journal was being written, it could be the
// case that the size of the journal file had already been increased but
// the extra entries had not yet made it safely to disk. In such a case,
// the value of nRec computed from the file size would be too large. For
// that reason, we always use the nRec value in the header.
//
// If the nRec value is 0xffffffff it means that nRec should be computed
// from the file size. This value is used when the user selects the
// no-sync option for the journal. A power failure could lead to corruption
// in this case. But for things like temporary table (which will be
// deleted when the power is restored) we don't care.
//
// If the file opened as the journal file is not a well-formed
// journal file then all pages up to the first corrupted page are rolled
// back (or no pages if the journal header is corrupted). The journal file
// is then deleted and SQLITE_OK returned, just as if no corruption had
// been encountered.
//
// If an I/O or malloc() error occurs, the journal-file is not deleted
// and an error code is returned.
//
// The isHot parameter indicates that we are trying to rollback a journal
// that might be a hot journal. Or, it could be that the journal is
// preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE.
// If the journal really is hot, reset the pager cache prior rolling
// back any content. If the journal is merely persistent, no reset is
// needed.
func _pager_playback(tls *crt.TLS, _pPager *XPager, _isHot int32) (r0 int32) {
var _rc, _res, _needPagerReset, _nPlayback int32
var _szJ int64
var _nRec, _u, _mxPg uint32
var _zMaster *int8
var _pVfs *Xsqlite3_vfs
_pVfs = (*Xsqlite3_vfs)(_pPager.X0)
_mxPg = u32(0)
_res = i32(1)
_zMaster = nil
_nPlayback = i32(0)
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49704), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playbackØ00__func__Ø000))), unsafe.Pointer(str(13626)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), &_szJ)
if _rc != i32(0) {
goto _end_playback
}
_zMaster = _pPager.X58
_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.X32), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.X0).X2)+i32(1)))
if (_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != 0) {
_rc = _sqlite3OsAccess(tls, _pVfs, _zMaster, i32(0), &_res)
}
_zMaster = nil
if (_rc != i32(0)) || (_res == 0) {
goto _end_playback
}
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
_needPagerReset = _isHot
_7:
_rc = _readJournalHdr(tls, _pPager, _isHot, _szJ, &_nRec, &_mxPg)
if _rc == i32(0) {
goto _9
}
if _rc == i32(101) {
_rc = i32(0)
}
goto _end_playback
_9:
if _nRec == u32(4294967295) {
func() {
if (_pPager.X34) != int64(_pPager.X47) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49757), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_playbackØ00__func__Ø000))), unsafe.Pointer(str(19429)))
crt.X__builtin_abort(tls)
}
}()
_nRec = uint32(int32((_szJ - int64(_pPager.X47)) / int64((_pPager.X48)+i32(8))))
}
if ((_nRec == uint32(i32(0))) && (_isHot == 0)) && (((_pPager.X35) + int64(_pPager.X47)) == (_pPager.X34)) {
_nRec = uint32(int32((_szJ - (_pPager.X34)) / int64((_pPager.X48)+i32(8))))
}
if (_pPager.X34) != int64(_pPager.X47) {
goto _17
}
_rc = _pager_truncate(tls, _pPager, _mxPg)
if _rc != i32(0) {
goto _end_playback
}
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _mxPg
_17:
_u = uint32(i32(0))
_19:
if _u >= _nRec {
goto _22
}
if _needPagerReset != 0 {
_pager_reset(tls, _pPager)
_needPagerReset = i32(0)
}
_rc = _pager_playback_one_page(tls, _pPager, (*int64)(unsafe.Pointer(&(_pPager.X34))), nil, i32(1), i32(0))
if _rc == i32(0) {
_nPlayback += 1
goto _25
}
if _rc == i32(101) {
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = _szJ
goto _22
}
if _rc == i32(522) {
_rc = i32(0)
goto _end_playback
}
goto _end_playback
_25:
_u += 1
goto _19
_22:
goto _7
_end_playback:
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil {
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), int32(u32(3389603744)), nil)
}
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10
if _rc == i32(0) {
_zMaster = _pPager.X58
_rc = _readMasterJournal(tls, (*Xsqlite3_file)(_pPager.X32), _zMaster, uint32(((*Xsqlite3_vfs)(_pPager.X0).X2)+i32(1)))
}
if (_rc == i32(0)) && ((int32(_pPager.X14) >= i32(4)) || (int32(_pPager.X14) == i32(0))) {
_rc = _sqlite3PagerSync(tls, _pPager, nil)
}
if _rc == i32(0) {
_rc = _pager_end_transaction(tls, _pPager, bool2int(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != i32(0)), i32(0))
}
if ((_rc == i32(0)) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0))))) != 0)) && _res != 0 {
_rc = _pager_delmaster(tls, _pPager, _zMaster)
}
if _isHot != 0 && _nPlayback != 0 {
Xsqlite3_log(tls, i32(539), str(19472), _nPlayback, unsafe.Pointer(_pPager.X52))
}
_setSectorSize(tls, _pPager)
return _rc
}
var _pager_playbackØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pager_playbackØ00__func__Ø000[0], str(19499), 15)
}
// When this is called the journal file for pager pPager must be open.
// This function attempts to read a master journal file name from the
// end of the file and, if successful, copies it into memory supplied
// by the caller. See comments above writeMasterJournal() for the format
// used to store a master journal file name at the end of a journal file.
//
// zMaster must point to a buffer of at least nMaster bytes allocated by
// the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is
// enough space to write the master journal name). If the master journal
// name in the journal is longer than nMaster bytes (including a
// nul-terminator), then this is handled as if no master journal name
// were present in the journal.
//
// If a master journal file name is present at the end of the journal
// file, then it is copied into the buffer pointed to by zMaster. A
// nul-terminator byte is appended to the buffer following the master
// journal file name.
//
// If it is determined that no master journal file name is present
// zMaster[0] is set to 0 and SQLITE_OK returned.
//
// If an error occurs while reading from the journal file, an SQLite
// error code is returned.
func _readMasterJournal(tls *crt.TLS, _pJrnl *Xsqlite3_file, _zMaster *int8, _nMaster uint32) (r0 int32) {
var _rc int32
var _szJ int64
var _len, _cksum, _u uint32
var _aMagic [8]uint8
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(i32(0)))) = int8(i32(0))
if ((((((((i32(0) != store1(&_rc, _sqlite3OsFileSize(tls, _pJrnl, &_szJ))) || (_szJ < int64(i32(16)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(16)), &_len)))) || (_len >= _nMaster)) || (_len == uint32(i32(0)))) || (i32(0) != store1(&_rc, _read32bits(tls, _pJrnl, _szJ-int64(i32(12)), &_cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, (unsafe.Pointer)(&_aMagic), i32(8), _szJ-int64(i32(8)))))) || crt.Xmemcmp(tls, (unsafe.Pointer)(&_aMagic), (unsafe.Pointer)(&_aJournalMagic), uint32(i32(8))) != 0) || (i32(0) != store1(&_rc, _sqlite3OsRead(tls, _pJrnl, (unsafe.Pointer)(_zMaster), int32(_len), (_szJ-int64(i32(16)))-int64(_len)))) {
return _rc
}
_u = uint32(i32(0))
_9:
if _u >= _len {
goto _12
}
{
p := &_cksum
*p = (*p) - uint32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_u))))
sink5 = *p
}
_u += 1
goto _9
_12:
if _cksum != 0 {
_len = uint32(i32(0))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_len))) = int8(i32(0))
return i32(0)
_ = _aMagic
panic(0)
}
func _sqlite3OsAccess(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32
}{(_pVfs.X8)})))(tls, _pVfs, _zPath, _flags, _pResOut)
}
// Sync the database file to disk. This is a no-op for in-memory databases
// or pages with the Pager.noSync flag set.
//
// If successful, or if called on a pager for which it is a no-op, this
// function returns SQLITE_OK. Otherwise, an IO error code is returned.
func _sqlite3PagerSync(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
var _rc int32
var _1_pArg unsafe.Pointer
_rc = i32(0)
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
goto _0
}
_1_pArg = (unsafe.Pointer)(_zMaster)
_rc = _sqlite3OsFileControl(tls, (*Xsqlite3_file)(_pPager.X31), i32(21), _1_pArg)
if _rc == i32(12) {
_rc = i32(0)
}
_0:
if (_rc == i32(0)) && ((_pPager.X4) == 0) {
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53162), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSyncØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X31), int32(_pPager.X9))
}
return _rc
}
var _sqlite3PagerSyncØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSyncØ00__func__Ø000[0], str(19514), 17)
}
// Parameter zMaster is the name of a master journal file. A single journal
// file that referred to the master journal file has just been rolled back.
// This routine checks if it is possible to delete the master journal file,
// and does so if it is.
//
// Argument zMaster may point to Pager.pTmpSpace. So that buffer is not
// available for use within this function.
//
// When a master journal file is created, it is populated with the names
// of all of its child journals, one after another, formatted as utf-8
// encoded text. The end of each child journal file is marked with a
// nul-terminator byte (0x00). i.e. the entire contents of a master journal
// file for a transaction involving two databases might be:
//
// "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00"
//
// A master journal file may only be deleted once all of its child
// journals have been rolled back.
//
// This function reads the contents of the master-journal file into
// memory and loops through each of the child journal names. For
// each child journal, it checks if:
//
// * if the child journal exists, and if so
// * if the child journal contains a reference to master journal
// file zMaster
//
// If a child journal can be found that matches both of the criteria
// above, this function returns without doing anything. Otherwise, if
// no such child journal can be found, file zMaster is deleted from
// the file-system using sqlite3OsDelete().
//
// If an IO error within this function, an error code is returned. This
// function allocates memory by calling sqlite3Malloc(). If an allocation
// fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors
// occur, SQLITE_OK is returned.
//
// TODO: This function allocates a single block of memory to load
// the entire contents of the master journal file. This could be
// a couple of kilobytes or so - potentially larger than the page
// size.
func _pager_delmaster(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
var _rc, _nMasterPtr, _2_flags, _4_exists, _6_c, _6_flags int32
var _nMasterJournal int64
var _zMasterJournal, _zJournal, _zMasterPtr *int8
var _pMaster, _pJournal *Xsqlite3_file
var _pVfs *Xsqlite3_vfs
_pVfs = (*Xsqlite3_vfs)(_pPager.X0)
_zMasterJournal = nil
_pMaster = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64((_pVfs.X1)*i32(2))))
_pJournal = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pMaster)))) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pVfs.X1)))))))))
if _pMaster == nil {
_rc = _sqlite3NomemError(tls, i32(49453))
goto _1
}
_2_flags = i32(16385)
_rc = _sqlite3OsOpen(tls, _pVfs, _zMaster, _pMaster, _2_flags, nil)
_1:
if _rc != i32(0) {
goto _delmaster_out
}
_rc = _sqlite3OsFileSize(tls, _pMaster, &_nMasterJournal)
if _rc != i32(0) {
goto _delmaster_out
}
_nMasterPtr = (_pVfs.X2) + i32(1)
_zMasterJournal = (*int8)(_sqlite3Malloc(tls, uint64((_nMasterJournal+int64(_nMasterPtr))+int64(i32(1)))))
if _zMasterJournal == nil {
_rc = _sqlite3NomemError(tls, i32(49470))
goto _delmaster_out
}
_zMasterPtr = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterJournal)) + 1*uintptr(_nMasterJournal+int64(i32(1)))))
_rc = _sqlite3OsRead(tls, _pMaster, (unsafe.Pointer)(_zMasterJournal), int32(_nMasterJournal), int64(i32(0)))
if _rc != i32(0) {
goto _delmaster_out
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterJournal)) + 1*uintptr(_nMasterJournal))) = int8(i32(0))
_zJournal = _zMasterJournal
_6:
if int64(int32((uintptr(unsafe.Pointer(_zJournal))-uintptr(unsafe.Pointer(_zMasterJournal)))/1)) >= _nMasterJournal {
goto _7
}
_rc = _sqlite3OsAccess(tls, _pVfs, _zJournal, i32(0), &_4_exists)
if _rc != i32(0) {
goto _delmaster_out
}
if _4_exists == 0 {
goto _9
}
_6_flags = i32(2049)
_rc = _sqlite3OsOpen(tls, _pVfs, _zJournal, _pJournal, _6_flags, nil)
if _rc != i32(0) {
goto _delmaster_out
}
_rc = _readMasterJournal(tls, _pJournal, _zMasterPtr, uint32(_nMasterPtr))
_sqlite3OsClose(tls, _pJournal)
if _rc != i32(0) {
goto _delmaster_out
}
_6_c = bool2int((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMasterPtr)) + 1*uintptr(i32(0))))) != i32(0)) && (crt.Xstrcmp(tls, _zMasterPtr, _zMaster) == i32(0)))
if _6_c != 0 {
goto _delmaster_out
}
_9:
{
p := &_zJournal
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zJournal)+i32(1))))
sink0 = *p
}
goto _6
_7:
_sqlite3OsClose(tls, _pMaster)
_rc = _sqlite3OsDelete(tls, _pVfs, _zMaster, i32(0))
_delmaster_out:
Xsqlite3_free(tls, (unsafe.Pointer)(_zMasterJournal))
if _pMaster != nil {
_sqlite3OsClose(tls, _pMaster)
func() {
if (*Xsqlite3_io_methods)(_pJournal.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49519), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_delmasterØ00__func__Ø000))), unsafe.Pointer(str(19531)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_free(tls, (unsafe.Pointer)(_pMaster))
}
return _rc
}
var _pager_delmasterØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pager_delmasterØ00__func__Ø000[0], str(19549), 16)
}
// Set the value of the Pager.sectorSize variable for the given
// pager based on the value returned by the xSectorSize method
// of the open database file. The sector size will be used
// to determine the size and alignment of journal header and
// master journal pointers within created journal files.
//
// For temporary files the effective sector size is always 512 bytes.
//
// Otherwise, for non-temporary files, the effective sector size is
// the value returned by the xSectorSize() method rounded up to 32 if
// it is less than 32, or rounded down to MAX_SECTOR_SIZE if it
// is greater than MAX_SECTOR_SIZE.
//
// If the file has the SQLITE_IOCAP_POWERSAFE_OVERWRITE property, then set
// the effective sector size to its minimum value (512). The purpose of
// pPager->sectorSize is to define the "blast radius" of bytes that
// might change if a crash occurs while writing to a single byte in
// that range. But with POWERSAFE_OVERWRITE, the blast radius is zero
// (that is what POWERSAFE_OVERWRITE means), so we minimize the sector
// size. For backwards compatibility of the rollback journal file format,
// we cannot reduce the effective sector size below 512.
func _setSectorSize(tls *crt.TLS, _pPager *XPager) {
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(49617), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSectorSizeØ00__func__Ø000))), unsafe.Pointer(str(19565)))
crt.X__builtin_abort(tls)
}
}()
if ((_pPager.X10) != 0) || ((_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31)) & i32(4096)) != i32(0)) {
*(*uint32)(unsafe.Pointer(&(_pPager.X47))) = uint32(i32(512))
goto _5
}
*(*uint32)(unsafe.Pointer(&(_pPager.X47))) = uint32(_sqlite3SectorSize(tls, (*Xsqlite3_file)(_pPager.X31)))
_5:
}
var _setSectorSizeØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_setSectorSizeØ00__func__Ø000[0], str(19604), 14)
}
// Return a sanitized version of the sector-size of OS file pFile. The
// return value is guaranteed to lie between 32 and MAX_SECTOR_SIZE.
func _sqlite3SectorSize(tls *crt.TLS, _pFile *Xsqlite3_file) (r0 int32) {
var _iRet int32
_iRet = _sqlite3OsSectorSize(tls, _pFile)
if _iRet < i32(32) {
_iRet = i32(512)
goto _2
}
if _iRet > i32(65536) {
i32(0)
_iRet = i32(65536)
}
_2:
return _iRet
}
func _sqlite3OsSectorSize(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
var _xSectorSize func(*crt.TLS, *Xsqlite3_file) int32
_xSectorSize = *(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_io_methods)(_id.X0).X11)}))
return func() int32 {
if _xSectorSize != nil {
return _xSectorSize(tls, _id)
}
return i32(4096)
}()
}
// This function is called whenever an IOERR or FULL error that requires
// the pager to transition into the ERROR state may ahve occurred.
// The first argument is a pointer to the pager structure, the second
// the error-code about to be returned by a pager API function. The
// value returned is a copy of the second argument to this function.
//
// If the second argument is SQLITE_FULL, SQLITE_IOERR or one of the
// IOERR sub-codes, the pager enters the ERROR state and the error code
// is stored in Pager.errCode. While the pager remains in the ERROR state,
// all major API calls on the Pager will immediately return Pager.errCode.
//
// The ERROR state indicates that the contents of the pager-cache
// cannot be trusted. This state can be cleared by completely discarding
// the contents of the pager-cache. If a transaction was active when
// the persistent error occurred, then the rollback journal may need
// to be replayed to restore the contents of the database file (as if
// it were a hot-journal).
func _pager_error(tls *crt.TLS, _pPager *XPager, _rc int32) (r0 int32) {
var _rc2 int32
_rc2 = _rc & i32(255)
func() {
if _rc != i32(0) && (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48816), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_errorØ00__func__Ø000))), unsafe.Pointer(str(19618)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(13) && (_pPager.X26) != i32(0) && ((_pPager.X26)&i32(255)) != i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48817), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_errorØ00__func__Ø000))), unsafe.Pointer(str(19642)))
crt.X__builtin_abort(tls)
}
}()
if (_rc2 == i32(13)) || (_rc2 == i32(10)) {
*(*int32)(unsafe.Pointer(&(_pPager.X26))) = _rc
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(6))
_setGetterMethod(tls, _pPager)
}
return _rc
}
var _pager_errorØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pager_errorØ00__func__Ø000[0], str(19743), 12)
}
// This function is a no-op if the pager is in exclusive mode and not
// in the ERROR state. Otherwise, it switches the pager to PAGER_OPEN
// state.
//
// If the pager is not in exclusive-access mode, the database file is
// completely unlocked. If the file is unlocked and the file-system does
// not exhibit the UNDELETABLE_WHEN_OPEN property, the journal file is
// closed (if it is open).
//
// If the pager is in ERROR state when this function is called, the
// contents of the pager cache are discarded before switching back to
// the OPEN state. Regardless of whether the pager is in exclusive-mode
// or not, any journal file left in the file-system will be treated
// as a hot-journal and rolled back the next time a read-transaction
// is opened (by this or by any other connection).
func _pager_unlock(tls *crt.TLS, _pPager *XPager) {
var _2_rc, _2_iDc int32
func() {
if int32(_pPager.X14) != i32(1) && int32(_pPager.X14) != i32(0) && int32(_pPager.X14) != i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48718), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19755)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BitvecDestroy(tls, (*XBitvec)(_pPager.X30))
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X30))))) = nil
_releaseAllSavepoints(tls, _pPager)
if (*XWal)(_pPager.X60) != nil {
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48728), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19845)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.X60))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0))
goto _8
}
if (_pPager.X1) != 0 {
goto _8
}
_2_iDc = func() int32 {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil {
return _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))
}
return i32(0)
}()
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
if (i32(0) == (_2_iDc & i32(2048))) || (i32(1) != (int32(_pPager.X2) & i32(5))) {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
}
_2_rc = _pagerUnlockDb(tls, _pPager, i32(0))
if (_2_rc != i32(0)) && (int32(_pPager.X14) == i32(6)) {
*(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(i32(5))
}
func() {
if (_pPager.X26) == 0 && int32(_pPager.X14) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48766), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19866)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0))
_8:
func() {
if (_pPager.X26) != i32(0) && (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48776), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_unlockØ00__func__Ø000))), unsafe.Pointer(str(19913)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X26) == 0 {
goto _21
}
if int32(_pPager.X10) == i32(0) {
_pager_reset(tls, _pPager)
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0))
goto _23
}
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(func() int32 {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil {
return i32(0)
}
return i32(1)
}())
_23:
if (_pPager.X20) != 0 {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil)
}
*(*int32)(unsafe.Pointer(&(_pPager.X26))) = i32(0)
_setGetterMethod(tls, _pPager)
_21:
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
*(*int64)(unsafe.Pointer(&(_pPager.X35))) = int64(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(0))
}
var _pager_unlockØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pager_unlockØ00__func__Ø000[0], str(19950), 13)
}
// Finish with a read transaction. All this does is release the
// read-lock.
func _sqlite3WalEndReadTransaction(tls *crt.TLS, _pWal *XWal) {
_sqlite3WalEndWriteTransaction(tls, _pWal)
if int32(_pWal.X9) >= i32(0) {
_walUnlockShared(tls, _pWal, i32(3)+int32(_pWal.X9))
*(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(-1))
}
}
// Change the size of an existing memory allocation
func _sqlite3Realloc(tls *crt.TLS, _pOld unsafe.Pointer, _nBytes uint64) (r0 unsafe.Pointer) {
var _nOld, _nNew, _nDiff int32
var _pNew unsafe.Pointer
i32(0)
i32(0)
if _pOld == nil {
return _sqlite3Malloc(tls, _nBytes)
}
if _nBytes == uint64(i32(0)) {
Xsqlite3_free(tls, _pOld)
return nil
}
if _nBytes >= uint64(i32(2147483392)) {
return nil
}
_nOld = _sqlite3MallocSize(tls, _pOld)
_nNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, int32(_nBytes))
if _nOld == _nNew {
_pNew = _pOld
goto _11
}
if (_sqlite3Config.X0) == 0 {
goto _5
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_sqlite3StatusHighwater(tls, i32(5), int32(_nBytes))
_nDiff = _nNew - _nOld
if (_nDiff > i32(0)) && (_sqlite3StatusValue(tls, i32(0)) >= ((_mem0.X1) - int64(_nDiff))) {
_sqlite3MallocAlarm(tls, _nDiff)
}
_pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew)
if (_pNew == nil) && ((_mem0.X1) > int64(i32(0))) {
_sqlite3MallocAlarm(tls, int32(_nBytes))
_pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew)
}
if _pNew != nil {
_nNew = _sqlite3MallocSize(tls, _pNew)
_sqlite3StatusUp(tls, i32(0), _nNew-_nOld)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _11
_5:
_pNew = ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X2)(tls, _pOld, _nNew)
_11:
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(_pNew)))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24772), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReallocØ00__func__Ø000))), unsafe.Pointer(str(19963)))
crt.X__builtin_abort(tls)
}
}()
return _pNew
}
var _sqlite3ReallocØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ReallocØ00__func__Ø000[0], str(19990), 15)
}
// Given the page number of an overflow page in the database (parameter
// ovfl), this function finds the page number of the next page in the
// linked list of overflow pages. If possible, it uses the auto-vacuum
// pointer-map data instead of reading the content of page ovfl to do so.
//
// If an error occurs an SQLite error code is returned. Otherwise:
//
// The page number of the next overflow page in the linked list is
// written to *pPgnoNext. If page ovfl is the last page in its linked
// list, *pPgnoNext is set to zero.
//
// If ppPage is not NULL, and a reference to the MemPage object corresponding
// to page number pOvfl was obtained, then *ppPage is set to point to that
// reference. It is the responsibility of the caller to call releasePage()
// on *ppPage to free the reference. In no reference was obtained (because
// the pointer-map was used to obtain the value for *pPgnoNext), then
// *ppPage is set to zero.
func _getOverflowPage(tls *crt.TLS, _pBt *XBtShared, _ovfl uint32, _ppPage **XMemPage, _pPgnoNext *uint32) (r0 int32) {
var _rc int32
var _next, _1_pgno, _1_iGuess uint32
var _1_eType uint8
var _pPage *XMemPage
_next = u32(0)
_pPage = nil
_rc = i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63444), unsafe.Pointer((*int8)(unsafe.Pointer(&_getOverflowPageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pPgnoNext == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63445), unsafe.Pointer((*int8)(unsafe.Pointer(&_getOverflowPageØ00__func__Ø000))), unsafe.Pointer(str(20005)))
crt.X__builtin_abort(tls)
}
}()
if (_pBt.X5) == 0 {
goto _4
}
_1_iGuess = _ovfl + uint32(i32(1))
_5:
if (_ptrmapPageno(tls, _pBt, _1_iGuess) == _1_iGuess) || (_1_iGuess == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
_1_iGuess += 1
goto _5
}
if _1_iGuess > _btreePagecount(tls, _pBt) {
goto _8
}
_rc = _ptrmapGet(tls, _pBt, _1_iGuess, &_1_eType, &_1_pgno)
if ((_rc == i32(0)) && (int32(_1_eType) == i32(4))) && (_1_pgno == _ovfl) {
_next = _1_iGuess
_rc = i32(101)
}
_8:
_4:
func() {
if _next != uint32(i32(0)) && _rc != i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63473), unsafe.Pointer((*int8)(unsafe.Pointer(&_getOverflowPageØ00__func__Ø000))), unsafe.Pointer(str(20015)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) {
goto _15
}
_rc = _btreeGetPage(tls, _pBt, _ovfl, &_pPage, func() int32 {
if _ppPage == nil {
return i32(2)
}
return i32(0)
}())
func() {
if _rc != i32(0) && _pPage != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63476), unsafe.Pointer((*int8)(unsafe.Pointer(&_getOverflowPageØ00__func__Ø000))), unsafe.Pointer(str(20042)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(0) {
_next = _sqlite3Get4byte(tls, _pPage.X19)
}
_15:
*_pPgnoNext = _next
if _ppPage != nil {
*_ppPage = _pPage
goto _23
}
_releasePage(tls, _pPage)
_23:
return func() int32 {
if _rc == i32(101) {
return i32(0)
}
return _rc
}()
}
var _getOverflowPageØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_getOverflowPageØ00__func__Ø000[0], str(20068), 16)
}
// Given a page number of a regular database page, return the page
// number for the pointer-map page that contains the entry for the
// input page number.
//
// Return 0 (not a valid page) for pgno==1 since there is
// no pointer map associated with page 1. The integrity_check logic
// requires that ptrmapPageno(*,1)!=1.
func _ptrmapPageno(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 uint32) {
var _nPagesPerMapPage int32
var _iPtrMap, _ret uint32
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59937), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPagenoØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
if _pgno < uint32(i32(2)) {
return uint32(i32(0))
}
_nPagesPerMapPage = int32(((_pBt.X16) / uint32(i32(5))) + uint32(i32(1)))
_iPtrMap = (_pgno - uint32(i32(2))) / uint32(_nPagesPerMapPage)
_ret = (_iPtrMap * uint32(_nPagesPerMapPage)) + uint32(i32(2))
if _ret == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
_ret += 1
}
return _ret
}
var _ptrmapPagenoØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_ptrmapPagenoØ00__func__Ø000[0], str(20084), 13)
}
// Read an entry from the pointer map.
//
// This routine retrieves the pointer map entry for page 'key', writing
// the type and parent page number to *pEType and *pPgno respectively.
// An error code is returned if something goes wrong, otherwise SQLITE_OK.
func _ptrmapGet(tls *crt.TLS, _pBt *XBtShared, _key uint32, _pEType *uint8, _pPgno *uint32) (r0 int32) {
var _iPtrmap, _offset, _rc int32
var _pPtrmap *uint8
var _pDbPage *XPgHdr
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60017), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapGetØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_iPtrmap = int32(_ptrmapPageno(tls, _pBt, _key))
_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.X0), uint32(_iPtrmap), &_pDbPage, i32(0))
if _rc != i32(0) {
return _rc
}
_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
_offset = int32(uint32(i32(5)) * ((_key - uint32(_iPtrmap)) - uint32(i32(1))))
if _offset < i32(0) {
_sqlite3PagerUnref(tls, _pDbPage)
return _sqlite3CorruptError(tls, i32(60029))
}
func() {
if _offset > (int32(_pBt.X16) - i32(5)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60031), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapGetØ00__func__Ø000))), unsafe.Pointer(str(20097)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pEType == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60032), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapGetØ00__func__Ø000))), unsafe.Pointer(str(20130)))
crt.X__builtin_abort(tls)
}
}()
*_pEType = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset)))
if _pPgno != nil {
*_pPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1)))))
}
_sqlite3PagerUnref(tls, _pDbPage)
if (int32(*_pEType) < i32(1)) || (int32(*_pEType) > i32(5)) {
return _sqlite3CorruptError(tls, i32(60037))
}
return i32(0)
}
var _ptrmapGetØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_ptrmapGetØ00__func__Ø000[0], str(20140), 10)
}
// Get a page from the pager. Initialize the MemPage.pBt and
// MemPage.aData elements if needed. See also: btreeGetUnusedPage().
//
// If the PAGER_GET_NOCONTENT flag is set, it means that we do not care
// about the content of the page at this time. So do not go to the disk
// to fetch the content. Just fill in the content with zeros for now.
// If in the future we call sqlite3PagerWrite() on this page, that
// means we have started to be concerned about content and the disk
// read should occur at that point.
func _btreeGetPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
var _rc int32
var _pDbPage *XPgHdr
func() {
if _flags != i32(0) && _flags != i32(1) && _flags != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61023), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeGetPageØ00__func__Ø000))), unsafe.Pointer(str(20150)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61024), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeGetPageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.X0), _pgno, &_pDbPage, _flags)
if _rc != 0 {
return _rc
}
*_ppPage = _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
return i32(0)
}
var _btreeGetPageØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_btreeGetPageØ00__func__Ø000[0], str(20218), 13)
}
// Convert a DbPage obtained from the pager into a MemPage used by
// the btree layer.
func _btreePageFromDbPage(tls *crt.TLS, _pDbPage *XPgHdr, _pgno uint32, _pBt *XBtShared) (r0 *XMemPage) {
var _pPage *XMemPage
_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
if _pgno != (_pPage.X4) {
*(**uint8)(unsafe.Pointer(&(_pPage.X19))) = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X23))))) = _pDbPage
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPage.X18))))) = _pBt
*(*uint32)(unsafe.Pointer(&(_pPage.X4))) = _pgno
*(*uint8)(unsafe.Pointer(&(_pPage.X6))) = uint8(func() int32 {
if _pgno == uint32(i32(1)) {
return i32(100)
}
return i32(0)
}())
}
func() {
if (_pPage.X19) != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60999), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePageFromDbPageØ00__func__Ø000))), unsafe.Pointer(str(20231)))
crt.X__builtin_abort(tls)
}
}()
return _pPage
}
var _btreePageFromDbPageØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_btreePageFromDbPageØ00__func__Ø000[0], str(20274), 20)
}
func _releasePage(tls *crt.TLS, _pPage *XMemPage) {
if _pPage != nil {
_releasePageNotNull(tls, _pPage)
}
}
// Release a MemPage. This should be called once for each prior
// call to btreeGetPage.
func _releasePageNotNull(tls *crt.TLS, _pPage *XMemPage) {
func() {
if (_pPage.X19) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61127), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20294)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtShared)(_pPage.X18) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61128), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20307)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XPgHdr)(_pPage.X23) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61129), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20318)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61130), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20336)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage.X19) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61131), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20389)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61132), unsafe.Pointer((*int8)(unsafe.Pointer(&_releasePageNotNullØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3PagerUnrefNotNull(tls, (*XPgHdr)(_pPage.X23))
}
var _releasePageNotNullØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_releasePageNotNullØ00__func__Ø000[0], str(20477), 19)
}
// Release all of the apPage[] pages for a cursor.
func _btreeReleaseAllCursorPages(tls *crt.TLS, _pCur *XBtCursor) {
var _i int32
_i = i32(0)
_0:
if _i > int32(_pCur.X14) {
goto _3
}
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_i))))
*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_i))) = nil
_i += 1
goto _0
_3:
*(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(-1))
}
// 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 _sqlite3BtreeTripAllCursors(tls *crt.TLS, _pBtree *XBtree, _errCode int32, _writeOnly int32) (r0 int32) {
var _rc, _2_i int32
var _p *XBtCursor
_rc = i32(0)
func() {
if _writeOnly != i32(0) && _writeOnly != i32(1) || i32(1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62993), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeTripAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(20496)))
crt.X__builtin_abort(tls)
}
}()
if _pBtree == nil {
goto _4
}
_sqlite3BtreeEnter(tls, _pBtree)
_p = (*XBtCursor)((*XBtShared)(_pBtree.X1).X2)
_5:
if _p == nil {
goto _8
}
if _writeOnly == 0 || (int32(_p.X10)&i32(1)) != i32(0) {
goto _10
}
if int32(_p.X12) != i32(1) && int32(_p.X12) != i32(2) {
goto _12
}
_rc = _saveCursorPosition(tls, _p)
if _rc != i32(0) {
_sqlite3BtreeTripAllCursors(tls, _pBtree, _rc, i32(0))
goto _8
}
_12:
goto _14
_10:
_sqlite3BtreeClearCursor(tls, _p)
*(*uint8)(unsafe.Pointer(&(_p.X12))) = uint8(i32(4))
*(*int32)(unsafe.Pointer(&(_p.X9))) = _errCode
_14:
_2_i = i32(0)
_15:
if _2_i > int32(_p.X14) {
goto _18
}
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) + 4*uintptr(_2_i))))
*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) + 4*uintptr(_2_i))) = nil
_2_i += 1
goto _15
_18:
_p = (*XBtCursor)(_p.X2)
goto _5
_8:
_sqlite3BtreeLeave(tls, _pBtree)
_4:
return _rc
}
var _sqlite3BtreeTripAllCursorsØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeTripAllCursorsØ00__func__Ø000[0], str(20548), 27)
}
// Clear the current cursor position.
func _sqlite3BtreeClearCursor(tls *crt.TLS, _pCur *XBtCursor) {
func() {
if _cursorHoldsMutex(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59781), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeClearCursorØ00__func__Ø000))), unsafe.Pointer(str(10275)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_free(tls, _pCur.X6)
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = nil
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
}
var _sqlite3BtreeClearCursorØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeClearCursorØ00__func__Ø000[0], str(20575), 24)
}
// This function may only be called when a read-transaction is open on
// the pager. It returns the total number of pages in the database.
//
// However, if the file is between 1 and bytes in size, then
// this is considered a 1 page file.
func _sqlite3PagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *int32) {
func() {
if int32(_pPager.X14) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50791), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(18157)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(20599)))
crt.X__builtin_abort(tls)
}
}()
*_pnPage = int32(_pPager.X22)
}
var _sqlite3PagerPagecountØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerPagecountØ00__func__Ø000[0], str(20637), 22)
}
// Return the number of cursors open on pBt. This is for use
// in assert() expressions, so it is only compiled if NDEBUG is not
// defined.
//
// Only write cursors are counted if wrOnly is true. If wrOnly is
// false then all cursors are counted.
//
// For the purposes of this routine, a cursor is any cursor that
// is capable of reading or writing to the database. Cursors that
// have been tripped into the CURSOR_FAULT state are not counted.
func _countValidCursors(tls *crt.TLS, _pBt *XBtShared, _wrOnly int32) (r0 int32) {
var _r int32
var _pCur *XBtCursor
_r = i32(0)
_pCur = (*XBtCursor)(_pBt.X2)
_0:
if _pCur == nil {
goto _3
}
if ((_wrOnly == i32(0)) || ((int32(_pCur.X10) & i32(1)) != i32(0))) && (int32(_pCur.X12) != i32(4)) {
_r += 1
}
_pCur = (*XBtCursor)(_pCur.X2)
goto _0
_3:
return _r
}
// Clear (destroy) the BtShared.pHasContent bitvec. This should be
// invoked at the conclusion of each write-transaction.
func _btreeClearHasContent(tls *crt.TLS, _pBt *XBtShared) {
_sqlite3BitvecDestroy(tls, (*XBitvec)(_pBt.X22))
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X22))))) = nil
}
// This function is called from both BtreeCommitPhaseTwo() and BtreeRollback()
// at the conclusion of a transaction.
func _btreeEndTransaction(tls *crt.TLS, _p *XBtree) {
var _db *Xsqlite3
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_db = (*Xsqlite3)(_p.X0)
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62861), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(0))
if (int32(_p.X2) > i32(0)) && ((_db.X35) > i32(1)) {
_downgradeAllSharedCacheTableLocks(tls, _p)
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(1))
goto _4
}
if int32(_p.X2) == i32(0) {
goto _5
}
_clearAllSharedCacheTableLocks(tls, _p)
*(*int32)(unsafe.Pointer(&(_pBt.X17))) -= 1
if i32(0) == (_pBt.X17) {
*(*uint8)(unsafe.Pointer(&(_pBt.X8))) = uint8(i32(0))
}
_5:
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0))
_unlockBtreeIfUnused(tls, _pBt)
_4:
func() {
if int32((*XBtShared)(_p.X1).X8) == i32(0) && ((*XBtShared)(_p.X1).X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62891), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000))), unsafe.Pointer(str(9977)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtShared)(_p.X1).X8) < int32(_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62891), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeEndTransactionØ00__func__Ø000))), unsafe.Pointer(str(10038)))
crt.X__builtin_abort(tls)
}
}()
}
var _btreeEndTransactionØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_btreeEndTransactionØ00__func__Ø000[0], str(20659), 20)
}
// This function changes all write-locks held by Btree p into read-locks.
func _downgradeAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
var _pBt *XBtShared
var _1_pLock *XBtLock
_pBt = (*XBtShared)(_p.X1)
if (*XBtree)(_pBt.X26) != _p {
goto _0
}
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = nil
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-97))
sink14 = *p
}
_1_pLock = (*XBtLock)(_pBt.X25)
_1:
if _1_pLock == nil {
goto _4
}
func() {
if int32(_1_pLock.X2) != i32(1) && (*XBtree)(_1_pLock.X0) != _p {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59468), unsafe.Pointer((*int8)(unsafe.Pointer(&_downgradeAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20679)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_1_pLock.X2))) = uint8(i32(1))
_1_pLock = (*XBtLock)(_1_pLock.X3)
goto _1
_4:
_0:
}
var _downgradeAllSharedCacheTableLocksØ00__func__Ø000 [34]int8
func init() {
crt.Xstrncpy(nil, &_downgradeAllSharedCacheTableLocksØ00__func__Ø000[0], str(20723), 34)
}
// Release all the table locks (locks obtained via calls to
// the setSharedCacheTableLock() procedure) held by Btree object p.
//
// This function assumes that Btree p has an open read or write
// transaction. If it does not, then the BTS_PENDING flag
// may be incorrectly cleared.
func _clearAllSharedCacheTableLocks(tls *crt.TLS, _p *XBtree) {
var _pBt *XBtShared
var _1_pLock *XBtLock
var _ppIter **XBtLock
_pBt = (*XBtShared)(_p.X1)
_ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25)))))
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59421), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X3) == 0 && nil != (*_ppIter) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59422), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20757)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59423), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20783)))
crt.X__builtin_abort(tls)
}
}()
_7:
if (*_ppIter) == nil {
goto _8
}
_1_pLock = *_ppIter
func() {
if (int32(_pBt.X10)&i32(32)) != i32(0) && (*XBtree)(_pBt.X26) != (*XBtree)(_1_pLock.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59427), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20796)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtree)(_1_pLock.X0).X2) < int32(_1_pLock.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59428), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20862)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtree)(_1_pLock.X0) != _p {
goto _14
}
*_ppIter = (*XBtLock)(_1_pLock.X3)
func() {
if (_1_pLock.X1) == uint32(i32(1)) && _1_pLock != (*XBtLock)(unsafe.Pointer(&(_p.X11))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59431), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20899)))
crt.X__builtin_abort(tls)
}
}()
if (_1_pLock.X1) != uint32(i32(1)) {
Xsqlite3_free(tls, (unsafe.Pointer)(_1_pLock))
}
goto _19
_14:
_ppIter = (**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pLock.X3)))))
_19:
goto _7
_8:
func() {
if (int32(_pBt.X10)&i32(64)) != i32(0) && (*XBtree)(_pBt.X26) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59440), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearAllSharedCacheTableLocksØ00__func__Ø000))), unsafe.Pointer(str(20935)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtree)(_pBt.X26) == _p {
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = nil
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-97))
sink14 = *p
}
goto _25
}
if (_pBt.X17) == i32(2) {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-65))
sink14 = *p
}
}
_25:
}
var _clearAllSharedCacheTableLocksØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_clearAllSharedCacheTableLocksØ00__func__Ø000[0], str(20984), 30)
}
// If there are no outstanding cursors and we are not in the middle
// of a transaction but there is a read lock on the database, then
// this routine unrefs the first page of the database file which
// has the effect of releasing the read lock.
//
// If there is a transaction in progress, this routine is a no-op.
func _unlockBtreeIfUnused(tls *crt.TLS, _pBt *XBtShared) {
var _1_pPage1 *XMemPage
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62138), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _countValidCursors(tls, _pBt, i32(0)) != i32(0) && int32(_pBt.X8) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62139), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000))), unsafe.Pointer(str(21014)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pBt.X8) == i32(0)) && ((*XMemPage)(_pBt.X3) != nil) {
_1_pPage1 = (*XMemPage)(_pBt.X3)
func() {
if (_1_pPage1.X19) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62142), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000))), unsafe.Pointer(str(21075)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerRefcount(tls, (*XPager)(_pBt.X0)) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62143), unsafe.Pointer((*int8)(unsafe.Pointer(&_unlockBtreeIfUnusedØ00__func__Ø000))), unsafe.Pointer(str(21089)))
crt.X__builtin_abort(tls)
}
}()
*(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil
_releasePageNotNull(tls, _1_pPage1)
}
}
var _unlockBtreeIfUnusedØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_unlockBtreeIfUnusedØ00__func__Ø000[0], str(21126), 20)
}
// Return the sum of the reference counts for all pages held by pPager.
func _sqlite3PagerRefcount(tls *crt.TLS, _pPager *XPager) (r0 int32) {
return _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59))
}
// Erase all schema information from all attached databases (including
// "main" and "temp") for a single database connection.
func _sqlite3ResetAllSchemasOfConnection(tls *crt.TLS, _db *Xsqlite3) {
var _i int32
var _1_pDb *XDb
_sqlite3BtreeEnterAll(tls, _db)
_i = i32(0)
_0:
if _i >= (_db.X5) {
goto _3
}
_1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
if (*XSchema)(_1_pDb.X4) != nil {
_sqlite3SchemaClear(tls, _1_pDb.X4)
}
_i += 1
goto _0
_3:
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-3)
sink1 = *p
}
_sqlite3VtabUnlockList(tls, _db)
_sqlite3BtreeLeaveAll(tls, _db)
_sqlite3CollapseDatabaseArray(tls, _db)
}
// Free all resources held by the schema structure. The void* argument points
// at a Schema struct. This function does not call sqlite3DbFree(db, ) on the
// pointer itself, it just cleans up subsidiary resources (i.e. the contents
// of the schema hash tables).
//
// The Schema.cache_size variable is not cleared.
func _sqlite3SchemaClear(tls *crt.TLS, _p unsafe.Pointer) {
var _temp1, _temp2 XHash
var _pSchema *XSchema
var _pElem *XHashElem
var _2_pTab *XTable
_pSchema = (*XSchema)(_p)
_temp1 = _pSchema.X2
_temp2 = _pSchema.X4
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X4))))
_sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X3))))
_pElem = (*XHashElem)(_temp2.X2)
_0:
if _pElem == nil {
goto _3
}
_sqlite3DeleteTrigger(tls, nil, (*XTrigger)(_pElem.X2))
_pElem = (*XHashElem)(_pElem.X0)
goto _0
_3:
_sqlite3HashClear(tls, &_temp2)
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X2))))
_pElem = (*XHashElem)(_temp1.X2)
_4:
if _pElem == nil {
goto _7
}
_2_pTab = (*XTable)(_pElem.X2)
_sqlite3DeleteTable(tls, nil, _2_pTab)
_pElem = (*XHashElem)(_pElem.X0)
goto _4
_7:
_sqlite3HashClear(tls, &_temp1)
_sqlite3HashClear(tls, (*XHash)(unsafe.Pointer(&(_pSchema.X5))))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSchema.X6))))) = nil
if (int32(_pSchema.X9) & i32(1)) != 0 {
*(*int32)(unsafe.Pointer(&(_pSchema.X1))) += 1
{
p := (*uint16)(unsafe.Pointer(&(_pSchema.X9)))
*p = uint16(int32(*p) & i32(-2))
sink14 = *p
}
}
_ = _temp1
_ = _temp2
}
// 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 _sqlite3HashInit(tls *crt.TLS, _pNew *XHash) {
func() {
if _pNew == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29250), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashInitØ00__func__Ø000))), unsafe.Pointer(str(21146)))
crt.X__builtin_abort(tls)
}
}()
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2))))) = nil
*(*uint32)(unsafe.Pointer(&(_pNew.X1))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_pNew.X0))) = uint32(i32(0))
*(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X3))))) = nil
}
var _sqlite3HashInitØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HashInitØ00__func__Ø000[0], str(21154), 16)
}
// 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 _sqlite3HashClear(tls *crt.TLS, _pH *XHash) {
var _elem, _1_next_elem *XHashElem
func() {
if _pH == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29264), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashClearØ00__func__Ø000))), unsafe.Pointer(str(21170)))
crt.X__builtin_abort(tls)
}
}()
_elem = (*XHashElem)(_pH.X2)
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = nil
Xsqlite3_free(tls, _pH.X3)
*(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X3))))) = nil
*(*uint32)(unsafe.Pointer(&(_pH.X0))) = uint32(i32(0))
_2:
if _elem != nil {
_1_next_elem = (*XHashElem)(_elem.X0)
Xsqlite3_free(tls, (unsafe.Pointer)(_elem))
_elem = _1_next_elem
goto _2
}
*(*uint32)(unsafe.Pointer(&(_pH.X1))) = uint32(i32(0))
}
var _sqlite3HashClearØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HashClearØ00__func__Ø000[0], str(21176), 17)
}
// Recursively delete a Trigger structure
func _sqlite3DeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _pTrigger *XTrigger) {
if _pTrigger == nil {
return
}
_sqlite3DeleteTriggerStep(tls, _db, (*XTriggerStep)(_pTrigger.X8))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger.X0))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger.X1))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pTrigger.X4))
_sqlite3IdListDelete(tls, _db, (*XIdList)(_pTrigger.X5))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTrigger))
}
// Delete a linked list of TriggerStep structures.
func _sqlite3DeleteTriggerStep(tls *crt.TLS, _db *Xsqlite3, _pTriggerStep *XTriggerStep) {
var _1_pTmp *XTriggerStep
_0:
if _pTriggerStep != nil {
_1_pTmp = _pTriggerStep
_pTriggerStep = (*XTriggerStep)(_pTriggerStep.X8)
_sqlite3ExprDelete(tls, _db, (*XExpr)(_1_pTmp.X5))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_1_pTmp.X6))
_sqlite3SelectDelete(tls, _db, (*XSelect)(_1_pTmp.X3))
_sqlite3IdListDelete(tls, _db, (*XIdList)(_1_pTmp.X7))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pTmp))
goto _0
}
}
func _sqlite3ExprDelete(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
if _p != nil {
_sqlite3ExprDeleteNN(tls, _db, _p)
}
}
// Recursively delete an expression tree.
func _sqlite3ExprDeleteNN(tls *crt.TLS, _db *Xsqlite3, _p *XExpr) {
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91912), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X2)&uint32(i32(1024))) != uint32(i32(0)) && (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21193)))
crt.X__builtin_abort(tls)
}
}()
if (((_p.X2) & uint32(i32(8388608))) != uint32(i32(0))) && (((_p.X2) & uint32(i32(16384))) == uint32(i32(0))) {
func() {
if (*XExpr)(_p.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91917), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21244)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91918), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21256)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21269)))
crt.X__builtin_abort(tls)
}
}()
}
if ((_p.X2) & uint32(i32(8404992))) != uint32(i32(0)) {
goto _13
}
func() {
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil && (*XExpr)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21285)))
crt.X__builtin_abort(tls)
}
}()
if ((*XExpr)(_p.X4) != nil) && (int32(_p.X0) != i32(159)) {
_sqlite3ExprDeleteNN(tls, _db, (*XExpr)(_p.X4))
}
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X5))
if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) {
_sqlite3SelectDelete(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))))
goto _20
}
_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))))
_20:
_13:
if ((_p.X2) & uint32(i32(65536))) != uint32(i32(0)) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))))
}
if ((_p.X2) & uint32(i32(32768))) == uint32(i32(0)) {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
}
var _sqlite3ExprDeleteNNØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprDeleteNNØ00__func__Ø000[0], str(21315), 20)
}
// Delete the given Select structure and all of its substructures.
func _sqlite3SelectDelete(tls *crt.TLS, _db *Xsqlite3, _p *XSelect) {
if _p != nil {
_clearSelect(tls, _db, _p, i32(1))
}
}
// Delete all the content of a Select structure. Deallocate the structure
// itself only if bFree is true.
func _clearSelect(tls *crt.TLS, _db *Xsqlite3, _p *XSelect, _bFree int32) {
var _1_pPrior *XSelect
_0:
if _p == nil {
goto _1
}
_1_pPrior = (*XSelect)(_p.X13)
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X0))
_sqlite3SrcListDelete(tls, _db, (*XSrcList)(_p.X8))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X9))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X10))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X11))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X16))
if (*XWith)(_p.X17) != nil {
_sqlite3WithDelete(tls, _db, (*XWith)(_p.X17))
}
if _bFree != 0 {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
_p = _1_pPrior
_bFree = i32(1)
goto _0
_1:
}
func _sqlite3ExprListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
if _pList != nil {
_exprListDeleteNN(tls, _db, _pList)
}
}
// Delete an entire expression list.
func _exprListDeleteNN(tls *crt.TLS, _db *Xsqlite3, _pList *XExprList) {
var _i int32
var _pItem *TExprList_item
_i = _pList.X0
_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))
func() {
if (_pList.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92555), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprListDeleteNNØ00__func__Ø000))), unsafe.Pointer(str(21335)))
crt.X__builtin_abort(tls)
}
}()
_2:
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.X0))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X2))
*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(20)
if preInc1(&_i, -1) > i32(0) {
goto _2
}
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList))
_ = _i
}
var _exprListDeleteNNØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_exprListDeleteNNØ00__func__Ø000[0], str(21350), 17)
}
// Delete an entire SrcList including all its substructure.
func _sqlite3SrcListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList) {
var _i int32
var _pItem *TSrcList_item
if _pList == nil {
return
}
*func() *int32 {
_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2)))))
return &_i
}() = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X2))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pItem.X3))
if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15)))))))
}
if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3ExprListDelete(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15)))))))
}
_sqlite3DeleteTable(tls, _db, (*XTable)(_pItem.X4))
_sqlite3SelectDelete(tls, _db, (*XSelect)(_pItem.X5))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pItem.X12))
_sqlite3IdListDelete(tls, _db, (*XIdList)(_pItem.X13))
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
goto _1
_4:
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList))
}
func _sqlite3DeleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
if _pTable == nil {
return
}
if ((_db == nil) || ((_db.X79) == nil)) && (preInc5((*uint32)(unsafe.Pointer(&(_pTable.X8))), uint32(4294967295)) > uint32(i32(0))) {
return
}
_deleteTable(tls, _db, _pTable)
}
// Remove the memory data structures associated with the given
// Table. No changes are made to disk by this routine.
//
// This routine just deletes the data structure. It does not unlink
// the table data structure from the hash table. But it does destroy
// memory structures of the indices and foreign keys associated with
// the table.
//
// The db parameter is optional. It is needed if the Table object
// contains lookaside memory. (Table objects in the schema do not use
// lookaside memory, but some ephemeral Table objects do.) Or the
// db parameter can be used with db->pnBytesFreed to measure the memory
// used by the Table object.
func _deleteTable(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
var _nLookaside int32
var _2_zName *int8
var _pIndex, _pNext, _2_pOld *XIndex
_nLookaside = func() int32 {
if (_db != nil) && (((_pTable.X9) & uint32(i32(2))) == uint32(i32(0))) {
return ((*t7)(unsafe.Pointer(&(_db.X58))).X3)
}
return i32(0)
}()
_pIndex = (*XIndex)(_pTable.X2)
_3:
if _pIndex == nil {
goto _6
}
_pNext = (*XIndex)(_pIndex.X5)
func() {
if (*XSchema)(_pIndex.X6) != (*XSchema)(_pTable.X20) && ((_pTable.X16) == 0 || int32((uint32(_pIndex.X16)<>uint(i32(30))) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100309), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21367)))
crt.X__builtin_abort(tls)
}
}()
if ((_db == nil) || ((_db.X79) == nil)) && ((_pTable.X16) == 0) {
_2_zName = _pIndex.X0
_2_pOld = (*XIndex)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pIndex.X6).X3))), _2_zName, nil))
func() {
if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pIndex.X6)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100316), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21465)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _2_pOld != _pIndex && _2_pOld != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100317), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21521)))
crt.X__builtin_abort(tls)
}
}()
}
_freeIndex(tls, _db, _pIndex)
_pIndex = _pNext
goto _3
_6:
_sqlite3FkDelete(tls, _db, _pTable)
_sqlite3DeleteColumnNames(tls, _db, _pTable)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable.X0))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable.X5))
_sqlite3SelectDelete(tls, _db, (*XSelect)(_pTable.X3))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_pTable.X6))
_sqlite3VtabClear(tls, _db, _pTable)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTable))
func() {
if _nLookaside != i32(0) && _nLookaside != ((*t7)(unsafe.Pointer(&(_db.X58))).X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100338), unsafe.Pointer((*int8)(unsafe.Pointer(&_deleteTableØ00__func__Ø000))), unsafe.Pointer(str(21545)))
crt.X__builtin_abort(tls)
}
}()
}
var _deleteTableØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_deleteTableØ00__func__Ø000[0], str(21593), 12)
}
// 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 _sqlite3HashInsert(tls *crt.TLS, _pH *XHash, _pKey *int8, _data unsafe.Pointer) (r0 unsafe.Pointer) {
var _h uint32
var _1_old_data unsafe.Pointer
var _elem, _new_elem *XHashElem
func() {
if _pH == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29470), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000))), unsafe.Pointer(str(21170)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pKey == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29471), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000))), unsafe.Pointer(str(21605)))
crt.X__builtin_abort(tls)
}
}()
_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
if _elem == nil {
goto _4
}
_1_old_data = _elem.X2
if _data == nil {
_removeElementGivenHash(tls, _pH, _elem, _h)
goto _6
}
*(*unsafe.Pointer)(unsafe.Pointer(&(_elem.X2))) = _data
*(**int8)(unsafe.Pointer(&(_elem.X3))) = _pKey
_6:
return _1_old_data
_4:
if _data == nil {
return nil
}
_new_elem = (*XHashElem)(_sqlite3Malloc(tls, uint64(u32(16))))
if _new_elem == nil {
return _data
}
*(**int8)(unsafe.Pointer(&(_new_elem.X3))) = _pKey
*(*unsafe.Pointer)(unsafe.Pointer(&(_new_elem.X2))) = _data
*(*uint32)(unsafe.Pointer(&(_pH.X1))) += 1
if (_pH.X1) < uint32(i32(10)) || (_pH.X1) <= (uint32(i32(2))*(_pH.X0)) {
goto _10
}
if _rehash(tls, _pH, (_pH.X1)*uint32(i32(2))) != 0 {
func() {
if (_pH.X0) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29491), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashInsertØ00__func__Ø000))), unsafe.Pointer(str(21613)))
crt.X__builtin_abort(tls)
}
}()
_h = _strHash(tls, _pKey) % (_pH.X0)
}
_10:
_insertElement(tls, _pH, func() *T_ht {
if (*T_ht)(_pH.X3) != nil {
return (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 8*uintptr(_h)))
}
return nil
}(), _new_elem)
return nil
}
var _sqlite3HashInsertØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HashInsertØ00__func__Ø000[0], str(21626), 18)
}
// This function (for internal use only) locates an element in an
// hash table that matches the given key. The hash for this key is
// also computed and returned in the *pH parameter.
func _findElementWithHash(tls *crt.TLS, _pH *XHash, _pKey *int8, _pHash *uint32) (r0 *XHashElem) {
var _count int32
var _h uint32
var _elem *XHashElem
var _1_pEntry *T_ht
if (*T_ht)(_pH.X3) != nil {
_h = _strHash(tls, _pKey) % (_pH.X0)
_1_pEntry = (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 8*uintptr(_h)))
_elem = (*XHashElem)(_1_pEntry.X1)
_count = _1_pEntry.X0
goto _1
}
_h = uint32(i32(0))
_elem = (*XHashElem)(_pH.X2)
_count = int32(_pH.X1)
_1:
*_pHash = _h
_2:
if postInc1(&_count, int32(-1)) == 0 {
goto _3
}
func() {
if _elem == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29394), unsafe.Pointer((*int8)(unsafe.Pointer(&_findElementWithHashØ00__func__Ø000))), unsafe.Pointer(str(21644)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3StrICmp(tls, _elem.X3, _pKey) == i32(0) {
return _elem
}
_elem = (*XHashElem)(_elem.X0)
goto _2
_3:
return nil
_ = _count
panic(0)
}
// The hashing function.
func _strHash(tls *crt.TLS, _z *int8) (r0 uint32) {
var _h uint32
var _c uint8
_h = u32(0)
_0:
if int32(store2(&_c, uint8(*postInc0(&_z, 1)))) != i32(0) {
{
p := &_h
*p = (*p) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(_c))))
sink5 = *p
}
{
p := &_h
*p = (*p) * u32(2654435761)
sink5 = *p
}
goto _0
}
return _h
}
var _findElementWithHashØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_findElementWithHashØ00__func__Ø000[0], str(21652), 20)
}
// Remove a single entry from the hash table given a pointer to that
// element and a hash on the element's key.
func _removeElementGivenHash(tls *crt.TLS, _pH *XHash, _elem *XHashElem, _h uint32) {
var _pEntry *T_ht
if (*XHashElem)(_elem.X1) != nil {
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_elem.X1).X0))))) = (*XHashElem)(_elem.X0)
goto _1
}
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = (*XHashElem)(_elem.X0)
_1:
if (*XHashElem)(_elem.X0) != nil {
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_elem.X0).X1))))) = (*XHashElem)(_elem.X1)
}
if (*T_ht)(_pH.X3) == nil {
goto _3
}
_pEntry = (*T_ht)(unsafe.Pointer(uintptr(_pH.X3) + 8*uintptr(_h)))
if (*XHashElem)(_pEntry.X1) == _elem {
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = (*XHashElem)(_elem.X0)
}
*(*int32)(unsafe.Pointer(&(_pEntry.X0))) -= 1
func() {
if (_pEntry.X0) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29426), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21672)))
crt.X__builtin_abort(tls)
}
}()
_3:
Xsqlite3_free(tls, (unsafe.Pointer)(_elem))
*(*uint32)(unsafe.Pointer(&(_pH.X1))) -= 1
if (_pH.X1) == uint32(i32(0)) {
func() {
if (*XHashElem)(_pH.X2) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29431), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21689)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pH.X1) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29432), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeElementGivenHashØ00__func__Ø000))), unsafe.Pointer(str(21702)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3HashClear(tls, _pH)
}
}
var _removeElementGivenHashØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_removeElementGivenHashØ00__func__Ø000[0], str(21715), 23)
}
// Resize the hash table so that it cantains "new_size" buckets.
//
// The hash table might fail to resize if sqlite3_malloc() fails or
// if the new size is the same as the prior size.
// Return TRUE if the resize occurs and false if not.
func _rehash(tls *crt.TLS, _pH *XHash, _new_size uint32) (r0 int32) {
var _2_h uint32
var _elem, _next_elem *XHashElem
var _new_ht *T_ht
if (_new_size * u32(8)) > uint32(i32(1024)) {
_new_size = u32(128)
}
if _new_size == (_pH.X0) {
return i32(0)
}
_sqlite3BeginBenignMalloc(tls)
_new_ht = (*T_ht)(_sqlite3Malloc(tls, uint64(_new_size*u32(8))))
_sqlite3EndBenignMalloc(tls)
if _new_ht == nil {
return i32(0)
}
Xsqlite3_free(tls, _pH.X3)
*(**T_ht)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X3))))) = _new_ht
*(*uint32)(unsafe.Pointer(&(_pH.X0))) = store5(&_new_size, uint32(_sqlite3MallocSize(tls, (unsafe.Pointer)(_new_ht)))/u32(8))
crt.Xmemset(tls, (unsafe.Pointer)(_new_ht), i32(0), _new_size*u32(8))
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(func() *XHash { _elem = (*XHashElem)(_pH.X2); return _pH }().X2))))) = nil
_3:
if _elem == nil {
goto _6
}
_2_h = _strHash(tls, _elem.X3) % _new_size
_next_elem = (*XHashElem)(_elem.X0)
_insertElement(tls, _pH, (*T_ht)(unsafe.Pointer(uintptr((unsafe.Pointer)(_new_ht))+8*uintptr(_2_h))), _elem)
_elem = _next_elem
goto _3
_6:
return i32(1)
}
// Link pNew element into the hash table pH. If pEntry!=0 then also
// insert pNew into the pEntry hash bucket.
func _insertElement(tls *crt.TLS, _pH *XHash, _pEntry *T_ht, _pNew *XHashElem) {
var _pHead *XHashElem
if _pEntry != nil {
_pHead = func() *XHashElem {
if (_pEntry.X0) != 0 {
return (*XHashElem)(_pEntry.X1)
}
return nil
}()
*(*int32)(unsafe.Pointer(&(_pEntry.X0))) += 1
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = _pNew
goto _3
}
_pHead = nil
_3:
if _pHead == nil {
goto _4
}
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pHead
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = (*XHashElem)(_pHead.X1)
if (*XHashElem)(_pHead.X1) != nil {
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_pHead.X1).X0))))) = _pNew
goto _6
}
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = _pNew
_6:
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pHead.X1))))) = _pNew
goto _7
_4:
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = (*XHashElem)(_pH.X2)
if (*XHashElem)(_pH.X2) != nil {
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XHashElem)(_pH.X2).X1))))) = _pNew
}
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = nil
*(**XHashElem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pH.X2))))) = _pNew
_7:
}
// Return true if the correct mutexes are held for accessing the
// db->aDb[iDb].pSchema structure. The mutexes required for schema
// access are:
//
// (1) The mutex on db
// (2) if iDb!=1, then the mutex on db->aDb[iDb].pBt.
//
// If pSchema is not NULL, then iDb is computed from pSchema and
// db using sqlite3SchemaToIndex().
func _sqlite3SchemaMutexHeld(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pSchema *XSchema) (r0 int32) {
var _p *XBtree
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58977), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _pSchema != nil {
_iDb = _sqlite3SchemaToIndex(tls, _db, _pSchema)
}
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58979), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
return i32(0)
}
if _iDb == i32(1) {
return i32(1)
}
_p = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X1)
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(58983), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaMutexHeldØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((int32(_p.X3) == i32(0)) || (int32(_p.X4) == i32(1)))
}
var _sqlite3SchemaMutexHeldØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SchemaMutexHeldØ00__func__Ø000[0], str(21760), 23)
}
// Convert a schema pointer into the iDb index that indicates
// which database file in db->aDb[] the schema refers to.
//
// If the same database is attached more than once, the first
// attached database is returned.
func _sqlite3SchemaToIndex(tls *crt.TLS, _db *Xsqlite3, _pSchema *XSchema) (r0 int32) {
var _i int32
_i = i32(-1000000)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116147), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if _pSchema == nil {
goto _2
}
_i = i32(0)
_3:
if func() int32 {
if _i < (_db.X5) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116149), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _8
}
if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X4) == _pSchema {
goto _8
}
_i += 1
goto _3
_8:
func() {
if _i < i32(0) || _i >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116154), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SchemaToIndexØ00__func__Ø000))), unsafe.Pointer(str(21783)))
crt.X__builtin_abort(tls)
}
}()
_2:
return _i
}
var _sqlite3SchemaToIndexØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SchemaToIndexØ00__func__Ø000[0], str(21801), 21)
}
// Reclaim the memory used by an index
func _freeIndex(tls *crt.TLS, _db *Xsqlite3, _p *XIndex) {
_sqlite3DeleteIndexSamples(tls, _db, _p)
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X9))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X10))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X4))
if ((uint32((_p.X16)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X8))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p))
}
// If the Index.aSample variable is not NULL, delete the aSample[] array
// and its contents.
func _sqlite3DeleteIndexSamples(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) {
}
// Free all memory associated with foreign key definitions attached to
// table pTab. Remove the deleted foreign keys from the Schema.fkeyHash
// hash table.
func _sqlite3FkDelete(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) {
var _4_z *int8
var _4_p unsafe.Pointer
var _pFKey, _pNext *XFKey
func() {
if _db != nil && (_pTab.X16) == 0 && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pTab.X20)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000))), unsafe.Pointer(str(21822)))
crt.X__builtin_abort(tls)
}
}()
_pFKey = (*XFKey)(_pTab.X4)
_4:
if _pFKey == nil {
goto _7
}
if _db != nil && (_db.X79) != nil {
goto _9
}
if (*XFKey)(_pFKey.X4) != nil {
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFKey)(_pFKey.X4).X3))))) = (*XFKey)(_pFKey.X3)
goto _11
}
_4_p = _pFKey.X3
_4_z = func() *int8 {
if _4_p != nil {
return ((*XFKey)(_pFKey.X3).X2)
}
return (_pFKey.X2)
}()
_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTab.X20).X5))), _4_z, _4_p)
_11:
if (*XFKey)(_pFKey.X3) != nil {
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XFKey)(_pFKey.X3).X4))))) = (*XFKey)(_pFKey.X4)
}
_9:
func() {
if int32(_pFKey.X6) != i32(0) && int32(_pFKey.X6) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108820), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkDeleteØ00__func__Ø000))), unsafe.Pointer(str(21895)))
crt.X__builtin_abort(tls)
}
}()
_fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(i32(0)))))
_fkTriggerDelete(tls, _db, *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(i32(1)))))
_pNext = (*XFKey)(_pFKey.X1)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pFKey))
_pFKey = _pNext
goto _4
_7:
}
var _sqlite3FkDeleteØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FkDeleteØ00__func__Ø000[0], str(21940), 16)
}
// The second argument is a Trigger structure allocated by the
// fkActionTrigger() routine. This function deletes the Trigger structure
// and all of its sub-components.
//
// The Trigger structure or any of its sub-components may be allocated from
// the lookaside buffer belonging to database handle dbMem.
func _fkTriggerDelete(tls *crt.TLS, _dbMem *Xsqlite3, _p *XTrigger) {
var _1_pStep *XTriggerStep
if _p != nil {
_1_pStep = (*XTriggerStep)(_p.X8)
_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_1_pStep.X5))
_sqlite3ExprListDelete(tls, _dbMem, (*XExprList)(_1_pStep.X6))
_sqlite3SelectDelete(tls, _dbMem, (*XSelect)(_1_pStep.X3))
_sqlite3ExprDelete(tls, _dbMem, (*XExpr)(_p.X4))
_sqlite3DbFree(tls, _dbMem, (unsafe.Pointer)(_p))
}
}
// Delete memory allocated for the column names of a table or view (the
// Table.aCol[] array).
func _sqlite3DeleteColumnNames(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable) {
var _i int32
var _pCol *XColumn
func() {
if _pTable == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(21956)))
crt.X__builtin_abort(tls)
}
}()
if store30(&_pCol, (*XColumn)(_pTable.X1)) == nil {
goto _2
}
_i = i32(0)
_3:
if _i >= int32(_pTable.X11) {
goto _6
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pCol.X0))
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.X1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pCol.X2))
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
goto _3
_6:
_sqlite3DbFree(tls, _db, _pTable.X1)
_2:
}
var _sqlite3DeleteColumnNamesØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DeleteColumnNamesØ00__func__Ø000[0], str(21966), 25)
}
// Clear any and all virtual-table information from the Table record.
// This routine is called, for example, just before deleting the Table
// record.
//
// Since it is a virtual-table, the Table structure contains a pointer
// to the head of a linked list of VTable structures. Each VTable
// structure is associated with a single sqlite3* user of the schema.
// The reference count of the VTable structure associated with database
// connection db is decremented immediately (which may lead to the
// structure being xDisconnected and free). Any other VTable structures
// in the list are moved to the sqlite3.pDisconnect list of the associated
// database connection.
func _sqlite3VtabClear(tls *crt.TLS, _db *Xsqlite3, _p *XTable) {
var _1_i int32
if (_db == nil) || ((_db.X79) == nil) {
_vtabDisconnectAll(tls, nil, _p)
}
if (_p.X17) == nil {
goto _2
}
_1_i = i32(0)
_3:
if _1_i >= (_p.X16) {
goto _6
}
if _1_i != i32(1) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X17)) + 4*uintptr(_1_i)))))
}
_1_i += 1
goto _3
_6:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X17))
_2:
}
// Table p is a virtual table. This function moves all elements in the
// p->pVTable list to the sqlite3.pDisconnect lists of their associated
// database connections to be disconnected at the next opportunity.
// Except, if argument db is not NULL, then the entry associated with
// connection db is left in the p->pVTable list.
func _vtabDisconnectAll(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *XVTable) {
var _1_db2 *Xsqlite3
var _pRet, _pVTable, _1_pNext *XVTable
_pRet = nil
_pVTable = (*XVTable)(_p.X18)
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = nil
func() {
if _db != nil && _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_p.X20)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125175), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000))), unsafe.Pointer(str(21991)))
crt.X__builtin_abort(tls)
}
}()
_3:
if _pVTable == nil {
goto _4
}
_1_db2 = (*Xsqlite3)(_pVTable.X0)
_1_pNext = (*XVTable)(_pVTable.X6)
func() {
if _1_db2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125180), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000))), unsafe.Pointer(str(22042)))
crt.X__builtin_abort(tls)
}
}()
if _1_db2 == _db {
_pRet = _pVTable
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = _pRet
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X6))))) = nil
goto _8
}
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X6))))) = (*XVTable)(_1_db2.X68)
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_db2.X68))))) = _pVTable
_8:
_pVTable = _1_pNext
goto _3
_4:
func() {
if _db != nil && _pRet == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125192), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabDisconnectAllØ00__func__Ø000))), unsafe.Pointer(str(22046)))
crt.X__builtin_abort(tls)
}
}()
return _pRet
}
var _vtabDisconnectAllØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_vtabDisconnectAllØ00__func__Ø000[0], str(22058), 18)
}
// Delete an IdList.
func _sqlite3IdListDelete(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList) {
var _i int32
if _pList == nil {
return
}
_i = i32(0)
_1:
if _i >= (_pList.X1) {
goto _4
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)((*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0)+8*uintptr(_i))).X0))
_i += 1
goto _1
_4:
_sqlite3DbFree(tls, _db, _pList.X0)
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pList))
}
// Free the contents of the With object passed as the second argument.
func _sqlite3WithDelete(tls *crt.TLS, _db *Xsqlite3, _pWith *XWith) {
var _1_i int32
var _2_pCte *TCte
if _pWith == nil {
goto _0
}
_1_i = i32(0)
_1:
if _1_i >= (_pWith.X0) {
goto _4
}
_2_pCte = (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2))))) + 16*uintptr(_1_i)))
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_2_pCte.X1))
_sqlite3SelectDelete(tls, _db, (*XSelect)(_2_pCte.X2))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_pCte.X0))
_1_i += 1
goto _1
_4:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pWith))
_0:
}
// 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 _sqlite3CollapseDatabaseArray(tls *crt.TLS, _db *Xsqlite3) {
var _i, _j int32
var _1_pDb *XDb
_i = store1(&_j, i32(2))
_0:
if _i >= (_db.X5) {
goto _3
}
_1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
if (*XBtree)(_1_pDb.X1) == nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pDb.X0))
*(**int8)(unsafe.Pointer(&(_1_pDb.X0))) = nil
goto _1
}
if _j < _i {
*(*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_j))) = *(*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
}
_j += 1
_1:
_i += 1
goto _0
_3:
*(*int32)(unsafe.Pointer(&(_db.X5))) = _j
if ((_db.X5) <= i32(2)) && ((*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72)))))) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*[2]XDb)(unsafe.Pointer(&(_db.X72)))), _db.X4, u32(32))
_sqlite3DbFree(tls, _db, _db.X4)
*(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72)))))
}
}
// 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 _sqlite3CloseSavepoints(tls *crt.TLS, _db *Xsqlite3) {
var _1_pTmp *XSavepoint
_0:
if (*XSavepoint)(_db.X73) != nil {
_1_pTmp = (*XSavepoint)(_db.X73)
*(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_1_pTmp.X3)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pTmp))
goto _0
}
*(*int32)(unsafe.Pointer(&(_db.X75))) = i32(0)
*(*int32)(unsafe.Pointer(&(_db.X76))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(0))
}
// Close an open database and invalidate all cursors.
func _sqlite3BtreeClose(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _pBt *XBtShared
var _pCur, _1_pTmp *XBtCursor
_pBt = (*XBtShared)(_p.X1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61603), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_pCur = (*XBtCursor)(_pBt.X2)
_2:
if _pCur == nil {
goto _3
}
_1_pTmp = _pCur
_pCur = (*XBtCursor)(_pCur.X2)
if (*XBtree)(_1_pTmp.X0) == _p {
_sqlite3BtreeCloseCursor(tls, _1_pTmp)
}
goto _2
_3:
_sqlite3BtreeRollback(tls, _p, i32(0), i32(0))
_sqlite3BtreeLeave(tls, _p)
func() {
if (_p.X6) != i32(0) || int32(_p.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61625), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22076)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) != 0 && _removeFromSharingList(tls, _pBt) == 0 {
goto _9
}
func() {
if (*XBtCursor)(_pBt.X2) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61632), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22109)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3PagerClose(tls, (*XPager)(_pBt.X0), (*Xsqlite3)(_p.X0))
if ((_pBt.X20) != nil) && ((_pBt.X19) != nil) {
(_pBt.X20)(tls, _pBt.X19)
}
_sqlite3DbFree(tls, nil, _pBt.X19)
_freeTempSpace(tls, _pBt)
Xsqlite3_free(tls, (unsafe.Pointer)(_pBt))
_9:
func() {
if (_p.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(22123)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61644), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseØ00__func__Ø000))), unsafe.Pointer(str(9343)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtree)(_p.X10) != nil {
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X10).X9))))) = (*XBtree)(_p.X9)
}
if (*XBtree)(_p.X9) != nil {
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X9).X10))))) = (*XBtree)(_p.X10)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
return i32(0)
}
var _sqlite3BtreeCloseØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCloseØ00__func__Ø000[0], str(22140), 18)
}
// Close a cursor. The read lock on the database file is released
// when the last cursor is closed.
func _sqlite3BtreeCloseCursor(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _1_i int32
var _pBtree *XBtree
var _1_pBt *XBtShared
var _3_pPrev *XBtCursor
_pBtree = (*XBtree)(_pCur.X0)
if _pBtree == nil {
goto _0
}
_1_pBt = (*XBtShared)(_pCur.X1)
_sqlite3BtreeEnter(tls, _pBtree)
_sqlite3BtreeClearCursor(tls, _pCur)
func() {
if (*XBtCursor)(_1_pBt.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63317), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000))), unsafe.Pointer(str(22158)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtCursor)(_1_pBt.X2) == _pCur {
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pBt.X2))))) = (*XBtCursor)(_pCur.X2)
goto _4
}
_3_pPrev = (*XBtCursor)(_1_pBt.X2)
_5:
if (*XBtCursor)(_3_pPrev.X2) == _pCur {
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pPrev.X2))))) = (*XBtCursor)(_pCur.X2)
goto _7
}
_3_pPrev = (*XBtCursor)(_3_pPrev.X2)
if func() int32 {
if _3_pPrev != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63328), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCloseCursorØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
goto _5
}
_7:
_4:
_1_i = i32(0)
_10:
if _1_i > int32(_pCur.X14) {
goto _13
}
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_1_i))))
_1_i += 1
goto _10
_13:
_unlockBtreeIfUnused(tls, _1_pBt)
Xsqlite3_free(tls, (unsafe.Pointer)(_pCur.X3))
_sqlite3BtreeLeave(tls, _pBtree)
_0:
return i32(0)
}
var _sqlite3BtreeCloseCursorØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCloseCursorØ00__func__Ø000[0], str(22174), 24)
}
// Decrement the BtShared.nRef counter. When it reaches zero,
// remove the BtShared structure from the sharing list. Return
// true if the BtShared.nRef counter reaches zero and return
// false if it is still positive.
func _removeFromSharingList(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
var _removed int32
var _pMaster *Xsqlite3_mutex
var _pList *XBtShared
_removed = i32(0)
func() {
if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61525), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000))), unsafe.Pointer(str(22198)))
crt.X__builtin_abort(tls)
}
}()
_pMaster = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _pMaster)
*(*int32)(unsafe.Pointer(&(_pBt.X23))) -= 1
if (_pBt.X23) > i32(0) {
goto _2
}
if _sqlite3SharedCacheList == _pBt {
_sqlite3SharedCacheList = (*XBtShared)(_pBt.X24)
bug20530(_sqlite3SharedCacheList)
goto _4
}
_pList = _sqlite3SharedCacheList
_5:
if func() int32 {
if _pList != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61534), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && ((*XBtShared)(_pList.X24) != _pBt) {
_pList = (*XBtShared)(_pList.X24)
goto _5
}
if func() int32 {
if _pList != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61537), unsafe.Pointer((*int8)(unsafe.Pointer(&_removeFromSharingListØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X24))))) = (*XBtShared)(_pBt.X24)
}
_4:
Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_pBt.X21))
_removed = i32(1)
_2:
Xsqlite3_mutex_leave(tls, _pMaster)
return _removed
}
var _removeFromSharingListØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_removeFromSharingListØ00__func__Ø000[0], str(22232), 22)
}
var _sqlite3SharedCacheList *XBtShared
// Free a dynamic mutex.
func Xsqlite3_mutex_free(tls *crt.TLS, _p *Xsqlite3_mutex) {
if _p != nil {
func() {
if (*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X3)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_freeØ00__func__Ø000))), unsafe.Pointer(str(22254)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *Xsqlite3_mutex))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X3)})))(tls, _p)
}
}
var _sqlite3_mutex_freeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_freeØ00__func__Ø000[0], str(22291), 19)
}
// Shutdown the page cache. Free all memory and close all files.
//
// If a transaction was in progress when this routine is called, that
// transaction is rolled back. All outstanding pages are invalidated
// and their memory is freed. Any attempt to use a page associated
// with this page cache after this function returns will likely
// result in a coredump.
//
// This function always succeeds. If a transaction is active an attempt
// is made to roll it back. If an error occurs during the rollback
// a hot journal may be left in the filesystem but no error is returned
// to the caller.
func _sqlite3PagerClose(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
var _pTmp *uint8
_pTmp = (*uint8)(unsafe.Pointer(_pPager.X58))
func() {
if _db == nil && bool2int((*XWal)(_pPager.X60) != nil) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22310)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51013), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BeginBenignMalloc(tls)
_pagerFreeMapHdrs(tls, _pPager)
*(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(i32(0))
func() {
if _db == nil && (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51020), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22339)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3WalClose(tls, (*XWal)(_pPager.X60), _db, int32(_pPager.X7), _pPager.X48, func() *uint8 {
if (_db != nil) && ((uint32(_db.X6) & u32(2147483648)) != 0) {
return nil
}
return _pTmp
}())
*(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60))))) = nil
_pager_reset(tls, _pPager)
if (_pPager.X13) != 0 {
_pager_unlock(tls, _pPager)
goto _12
}
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil {
_pager_error(tls, _pPager, _pagerSyncHotJournal(tls, _pPager))
}
_pagerUnlockAndRollback(tls, _pPager)
_12:
_sqlite3EndBenignMalloc(tls)
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X31))
_sqlite3PageFree(tls, (unsafe.Pointer)(_pTmp))
_sqlite3PcacheClose(tls, (*XPCache)(_pPager.X59))
func() {
if (*XPagerSavepoint)(_pPager.X37) != nil || (*XBitvec)(_pPager.X30) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22361)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X33).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51060), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseØ00__func__Ø000))), unsafe.Pointer(str(22404)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_free(tls, (unsafe.Pointer)(_pPager))
return i32(0)
}
var _sqlite3PagerCloseØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerCloseØ00__func__Ø000[0], str(22450), 18)
}
// Free all PgHdr objects stored in the Pager.pMmapFreelist list.
func _pagerFreeMapHdrs(tls *crt.TLS, _pPager *XPager) {
var _p, _pNext *XPgHdr
_p = (*XPgHdr)(_pPager.X43)
_0:
if _p == nil {
goto _3
}
_pNext = (*XPgHdr)(_p.X3)
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
_p = _pNext
goto _0
_3:
}
// Close a connection to a log file.
func _sqlite3WalClose(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _sync_flags int32, _nBuf int32, _zBuf *uint8) (r0 int32) {
var _rc, _1_isDelete, _4_bPersist int32
_rc = i32(0)
if _pWal == nil {
goto _0
}
_1_isDelete = i32(0)
if _zBuf == nil || i32(0) != store1(&_rc, _sqlite3OsLock(tls, (*Xsqlite3_file)(_pWal.X1), i32(4))) {
goto _2
}
if int32(_pWal.X11) == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pWal.X11))) = uint8(i32(1))
}
_rc = _sqlite3WalCheckpoint(tls, _pWal, _db, i32(0), nil, nil, _sync_flags, _nBuf, _zBuf, nil, nil)
if _rc != i32(0) {
goto _4
}
_4_bPersist = i32(-1)
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(10), (unsafe.Pointer)(&_4_bPersist))
if _4_bPersist != i32(1) {
_1_isDelete = i32(1)
goto _7
}
if (_pWal.X4) >= int64(i32(0)) {
_walLimitSize(tls, _pWal, int64(i32(0)))
}
_7:
_4:
_2:
_walIndexClose(tls, _pWal, _1_isDelete)
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pWal.X2))
if _1_isDelete != 0 {
_sqlite3BeginBenignMalloc(tls)
_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pWal.X0), _pWal.X21, i32(0))
_sqlite3EndBenignMalloc(tls)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_pWal.X7))
Xsqlite3_free(tls, (unsafe.Pointer)(_pWal))
_0:
return _rc
}
func _sqlite3OsLock(tls *crt.TLS, _id *Xsqlite3_file, _lockType int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X7)})))(tls, _id, _lockType)
}
// This routine is called to implement sqlite3_wal_checkpoint() and
// related interfaces.
//
// Obtain a CHECKPOINT lock and then backfill as much information as
// we can from WAL into the database.
//
// If parameter xBusy is not NULL, it is a pointer to a busy-handler
// callback. In this case this function runs a blocking checkpoint.
func _sqlite3WalCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _nBuf int32, _zBuf *uint8, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
var _rc, _isChanged, _eMode2 int32
var _xBusy2 func(*crt.TLS, unsafe.Pointer) int32
_isChanged = i32(0)
_eMode2 = _eMode
_xBusy2 = _xBusy
func() {
if int32(_pWal.X13) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57774), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22468)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57775), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000))), unsafe.Pointer(str(19079)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eMode == i32(0) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_xBusy})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57779), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22486)))
crt.X__builtin_abort(tls)
}
}()
if (_pWal.X14) != 0 {
return i32(8)
}
_rc = _walLockExclusive(tls, _pWal, i32(1), i32(1))
if _rc != 0 {
return _rc
}
*(*uint8)(unsafe.Pointer(&(_pWal.X13))) = uint8(i32(1))
if _eMode == i32(0) {
goto _9
}
_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(0), i32(1))
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1))
goto _12
}
if _rc == i32(5) {
_eMode2 = i32(0)
_xBusy2 = nil
_rc = i32(0)
}
_12:
_9:
if _rc != i32(0) {
goto _13
}
_rc = _walIndexReadHdr(tls, _pWal, &_isChanged)
if _isChanged != 0 && (((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pWal.X1).X0).X0) >= i32(3)) {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pWal.X1), int64(i32(0)), nil)
}
_13:
if _rc != i32(0) {
goto _16
}
if (((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) != 0) && (_walPagesize(tls, _pWal) != _nBuf) {
_rc = _sqlite3CorruptError(tls, i32(57832))
goto _19
}
_rc = _walCheckpoint(tls, _pWal, _db, _eMode2, _xBusy2, _pBusyArg, _sync_flags, _zBuf)
_19:
if _rc != i32(0) && _rc != i32(5) {
goto _21
}
if _pnLog != nil {
*_pnLog = int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6)
}
if _pnCkpt != nil {
*_pnCkpt = int32(_walCkptInfo(tls, _pWal).X0)
}
_21:
_16:
if _isChanged != 0 {
crt.Xmemset(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), i32(0), u32(48))
}
_sqlite3WalEndWriteTransaction(tls, _pWal)
_walUnlockExclusive(tls, _pWal, i32(1), i32(1))
*(*uint8)(unsafe.Pointer(&(_pWal.X13))) = uint8(i32(0))
return func() int32 {
if (_rc == i32(0)) && (_eMode != _eMode2) {
return i32(5)
}
return _rc
}()
}
var _sqlite3WalCheckpointØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalCheckpointØ00__func__Ø000[0], str(22531), 21)
}
func _walLockExclusive(tls *crt.TLS, _pWal *XWal, _lockIdx int32, _n int32) (r0 int32) {
var _rc int32
if (_pWal.X11) != 0 {
return i32(0)
}
_rc = _sqlite3OsShmLock(tls, (*Xsqlite3_file)(_pWal.X1), _lockIdx, _n, i32(10))
*(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(bool2int((_rc != i32(0)) && (_rc != i32(5))))
return _rc
}
// Attempt to obtain the exclusive WAL lock defined by parameters lockIdx and
// n. If the attempt fails and parameter xBusy is not NULL, then it is a
// busy-handler function. Invoke it and retry the lock until either the
// lock is successfully obtained or the busy-handler returns 0.
func _walBusyLock(tls *crt.TLS, _pWal *XWal, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _lockIdx int32, _n int32) (r0 int32) {
var _rc int32
_0:
_rc = _walLockExclusive(tls, _pWal, _lockIdx, _n)
if ((_xBusy != nil) && (_rc == i32(5))) && _xBusy(tls, _pBusyArg) != 0 {
goto _0
}
return _rc
}
// Read the wal-index header from the wal-index and into pWal->hdr.
// If the wal-header appears to be corrupt, try to reconstruct the
// wal-index from the WAL before returning.
//
// Set *pChanged to 1 if the wal-index header value in pWal->hdr is
// changed by this operation. If pWal->hdr is unchanged, set *pChanged
// to 0.
//
// If the wal-index header is successfully read, return SQLITE_OK.
// Otherwise an SQLite error code.
func _walIndexReadHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
var _rc, _badHdr int32
var _page0 *uint32
func() {
if _pChanged == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56550), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000))), unsafe.Pointer(str(22552)))
crt.X__builtin_abort(tls)
}
}()
_rc = _walIndexPage(tls, _pWal, i32(0), &_page0)
if _rc != i32(0) {
return _rc
}
func() {
if _page0 == nil && int32(_pWal.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56555), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000))), unsafe.Pointer(str(22561)))
crt.X__builtin_abort(tls)
}
}()
_badHdr = func() int32 {
if _page0 != nil {
return _walIndexTryHdr(tls, _pWal, _pChanged)
}
return i32(1)
}()
func() {
if _badHdr != i32(0) && int32(_pWal.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56567), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexReadHdrØ00__func__Ø000))), unsafe.Pointer(str(22589)))
crt.X__builtin_abort(tls)
}
}()
if _badHdr == 0 {
goto _11
}
if (int32(_pWal.X14) & i32(2)) == 0 {
goto _12
}
if i32(0) == store1(&_rc, _walLockShared(tls, _pWal, i32(0))) {
_walUnlockShared(tls, _pWal, i32(0))
_rc = i32(264)
}
goto _15
_12:
if i32(0) != store1(&_rc, _walLockExclusive(tls, _pWal, i32(0), i32(1))) {
goto _15
}
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1))
if i32(0) != store1(&_rc, _walIndexPage(tls, _pWal, i32(0), &_page0)) {
goto _16
}
_badHdr = _walIndexTryHdr(tls, _pWal, _pChanged)
if _badHdr != 0 {
_rc = _walIndexRecover(tls, _pWal)
*_pChanged = i32(1)
}
_16:
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0))
_walUnlockExclusive(tls, _pWal, i32(0), i32(1))
_15:
_11:
if (_badHdr == i32(0)) && (((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X0) != uint32(i32(3007000))) {
_rc = _sqlite3CantopenError(tls, i32(56597))
}
return _rc
}
var _walIndexReadHdrØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_walIndexReadHdrØ00__func__Ø000[0], str(22621), 16)
}
// Try to read the wal-index header. Return 0 on success and 1 if
// there is a problem.
//
// The wal-index is in shared memory. Another thread or process might
// be writing the header at the same time this procedure is trying to
// read it, which might result in inconsistency. A dirty read is detected
// by verifying that both copies of the header are the same and also by
// a checksum on the header.
//
// If and only if the read is consistent and the header is different from
// pWal->hdr, then pWal->hdr is updated to the content of the new header
// and *pChanged is set to 1.
//
// If the checksum cannot be verified return non-zero. If the header
// is read successfully and the checksum verified, return zero.
func _walIndexTryHdr(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
var _aCksum [2]uint32
var _h1, _h2 XWalIndexHdr
var _aHdr *XWalIndexHdr
func() {
if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56490), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexTryHdrØ00__func__Ø000))), unsafe.Pointer(str(15271)))
crt.X__builtin_abort(tls)
}
}()
_aHdr = _walIndexHdr(tls, _pWal)
crt.Xmemcpy(tls, (unsafe.Pointer)(&_h1), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(0))))), u32(48))
_walShmBarrier(tls, _pWal)
crt.Xmemcpy(tls, (unsafe.Pointer)(&_h2), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(1))))), u32(48))
if crt.Xmemcmp(tls, (unsafe.Pointer)(&_h1), (unsafe.Pointer)(&_h2), u32(48)) != i32(0) {
return i32(1)
}
if int32(_h1.X3) == i32(0) {
return i32(1)
}
_walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer(&_h1)), int32(u32(40)), nil, (*uint32)(unsafe.Pointer(&_aCksum)))
if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCksum)) + 4*uintptr(i32(0))))) != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_h1.X10))))) + 4*uintptr(i32(0)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCksum)) + 4*uintptr(i32(1))))) != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_h1.X10))))) + 4*uintptr(i32(1)))))) {
return i32(1)
}
if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(&_h1), u32(48)) != 0 {
*_pChanged = i32(1)
crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(&_h1), u32(48))
*(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(1)) << uint(i32(16))))
}
return i32(0)
_ = _aCksum
_ = _h1
_ = _h2
panic(0)
}
var _walIndexTryHdrØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_walIndexTryHdrØ00__func__Ø000[0], str(22637), 15)
}
func _walShmBarrier(tls *crt.TLS, _pWal *XWal) {
if int32(_pWal.X11) != i32(2) {
_sqlite3OsShmBarrier(tls, (*Xsqlite3_file)(_pWal.X1))
}
}
func _sqlite3OsShmBarrier(tls *crt.TLS, _id *Xsqlite3_file) {
(*(*func(*crt.TLS, *Xsqlite3_file))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{((*Xsqlite3_io_methods)(_id.X0).X15)})))(tls, _id)
}
// Generate or extend an 8 byte checksum based on the data in
// array aByte[] and the initial values of aIn[0] and aIn[1] (or
// initial values of 0 and 0 if aIn==NULL).
//
// The checksum is written back into aOut[] before returning.
//
// nByte must be a positive multiple of 8.
func _walChecksumBytes(tls *crt.TLS, _nativeCksum int32, _a *uint8, _nByte int32, _aIn *uint32, _aOut *uint32) {
var _s1, _s2 uint32
var _aData, _aEnd *uint32
_aData = (*uint32)(unsafe.Pointer(_a))
_aEnd = (*uint32)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 1*uintptr(_nByte)))))
if _aIn != nil {
_s1 = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aIn)) + 4*uintptr(i32(0))))
_s2 = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aIn)) + 4*uintptr(i32(1))))
goto _1
}
_s1 = store5(&_s2, uint32(i32(0)))
_1:
func() {
if _nByte < i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55109), unsafe.Pointer((*int8)(unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000))), unsafe.Pointer(str(22652)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_nByte & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55110), unsafe.Pointer((*int8)(unsafe.Pointer(&_walChecksumBytesØ00__func__Ø000))), unsafe.Pointer(str(22661)))
crt.X__builtin_abort(tls)
}
}()
if _nativeCksum == 0 {
goto _6
}
_7:
{
p := &_s1
*p = (*p) + ((*postInc31(&_aData, 4)) + _s2)
sink5 = *p
}
{
p := &_s2
*p = (*p) + ((*postInc31(&_aData, 4)) + _s1)
sink5 = *p
}
if uintptr(unsafe.Pointer(_aData)) < uintptr(unsafe.Pointer(_aEnd)) {
goto _7
}
goto _8
_6:
_9:
{
p := &_s1
*p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(0))))) & u32(4278190080)) >> uint(i32(24)))) + _s2)
sink5 = *p
}
{
p := &_s2
*p = (*p) + (((((((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(255))) << uint(i32(24))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(65280))) << uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & uint32(i32(16711680))) >> uint(i32(8)))) + (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 4*uintptr(i32(1))))) & u32(4278190080)) >> uint(i32(24)))) + _s1)
sink5 = *p
}
{
p := &_aData
*p = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 4*uintptr(i32(2))))
sink31 = *p
}
if uintptr(unsafe.Pointer(_aData)) < uintptr(unsafe.Pointer(_aEnd)) {
goto _9
}
_8:
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOut)) + 4*uintptr(i32(0)))) = _s1
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOut)) + 4*uintptr(i32(1)))) = _s2
}
var _walChecksumBytesØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_walChecksumBytesØ00__func__Ø000[0], str(22683), 17)
}
// Recover the wal-index by reading the write-ahead log file.
//
// This routine first tries to establish an exclusive lock on the
// wal-index to prevent other threads/processes from doing anything
// with the WAL or wal-index while recovery is running. The
// WAL_RECOVER_LOCK is also held so that other threads will know
// that this thread is running recovery. If unable to establish
// the necessary locks, this routine returns SQLITE_BUSY.
func _walIndexRecover(tls *crt.TLS, _pWal *XWal) (r0 int32) {
var _rc, _iLock, _nLock, _3_szFrame, _3_iFrame, _3_szPage, _3_isValid, _11_i int32
var _nSize, _3_iOffset int64
var _3_magic, _3_version, _9_pgno, _9_nTruncate uint32
var _3_aFrame, _3_aData *uint8
var _3_aBuf [32]uint8
var _aFrameCksum [2]uint32
var _11_pInfo *XWalCkptInfo
_aFrameCksum = [2]uint32{}
func() {
if int32(_pWal.X13) != i32(1) && int32(_pWal.X13) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55574), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000))), unsafe.Pointer(str(22700)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55577), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexRecoverØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
_iLock = i32(1) + int32(_pWal.X13)
_nLock = i32(8) - _iLock
_rc = _walLockExclusive(tls, _pWal, _iLock, _nLock)
if _rc != 0 {
return _rc
}
crt.Xmemset(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), i32(0), u32(48))
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.X2), &_nSize)
if _rc != i32(0) {
goto _recovery_error
}
if _nSize <= int64(i32(32)) {
goto _finished
}
_3_aFrame = nil
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_3_aBuf), i32(32), int64(i32(0)))
if _rc != i32(0) {
goto _recovery_error
}
_3_magic = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(0)))))
_3_szPage = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(8))))))
if ((((_3_magic & u32(4294967294)) != uint32(i32(931071618))) || (_3_szPage&(_3_szPage-i32(1))) != 0) || (_3_szPage > i32(65536))) || (_3_szPage < i32(512)) {
goto _finished
}
*(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4))) = uint8(_3_magic & uint32(i32(1)))
*(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32(_3_szPage)
*(*uint32)(unsafe.Pointer(&(_pWal.X22))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(12)))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(16))))), uint32(i32(8)))
_walChecksumBytes(tls, bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0)), (*uint8)(unsafe.Pointer(&_3_aBuf)), i32(24), nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))))
if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(24)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(28)))))) {
goto _finished
}
_3_version = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aBuf))+1*uintptr(i32(4)))))
if _3_version != uint32(i32(3007000)) {
_rc = _sqlite3CantopenError(tls, i32(55644))
goto _finished
}
_3_szFrame = _3_szPage + i32(24)
_3_aFrame = (*uint8)(Xsqlite3_malloc64(tls, uint64(_3_szFrame)))
if _3_aFrame == nil {
_rc = _sqlite3NomemError(tls, i32(55652))
goto _recovery_error
}
_3_aData = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_aFrame)) + 1*uintptr(i32(24))))
_3_iFrame = i32(0)
_3_iOffset = int64(i32(32))
_17:
if (_3_iOffset + int64(_3_szFrame)) > _nSize {
goto _20
}
_3_iFrame += 1
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_3_aFrame), _3_szFrame, _3_iOffset)
if _rc != i32(0) {
goto _20
}
_3_isValid = _walDecodeFrame(tls, _pWal, &_9_pgno, &_9_nTruncate, _3_aData, _3_aFrame)
if _3_isValid == 0 {
goto _20
}
_rc = _walIndexAppend(tls, _pWal, uint32(_3_iFrame), _9_pgno)
if _rc != i32(0) {
goto _20
}
if _9_nTruncate != 0 {
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = uint32(_3_iFrame)
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7))) = _9_nTruncate
*(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5))) = uint16((_3_szPage & i32(65280)) | (_3_szPage >> uint(i32(16))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1))))
}
{
p := &_3_iOffset
*p = (*p) + int64(_3_szFrame)
sink6 = *p
}
goto _17
_20:
Xsqlite3_free(tls, (unsafe.Pointer)(_3_aFrame))
_finished:
if _rc != i32(0) {
goto _recovery_error
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(0))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFrameCksum)) + 4*uintptr(i32(1))))
_walIndexWriteHdr(tls, _pWal)
_11_pInfo = _walCkptInfo(tls, _pWal)
*(*uint32)(unsafe.Pointer(&(_11_pInfo.X0))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_11_pInfo.X3))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(i32(0)))) = uint32(i32(0))
_11_i = i32(1)
_26:
if _11_i >= i32(5) {
goto _29
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(_11_i))) = u32(4294967295)
_11_i += 1
goto _26
_29:
if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) != 0 {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_11_pInfo.X1))))) + 4*uintptr(i32(1)))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
}
if ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7) != 0 {
Xsqlite3_log(tls, i32(283), str(22739), (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6, unsafe.Pointer(_pWal.X21))
}
_recovery_error:
_walUnlockExclusive(tls, _pWal, _iLock, _nLock)
return _rc
_ = _aFrameCksum
_ = _3_aBuf
panic(0)
}
var _walIndexRecoverØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_walIndexRecoverØ00__func__Ø000[0], str(22776), 16)
}
func _sqlite3CantopenError(tls *crt.TLS, _lineno int32) (r0 int32) {
return _reportError(tls, i32(14), _lineno, str(22792))
}
// Check to see if the frame with header in aFrame[] and content
// in aData[] is valid. If it is a valid frame, fill *piPage and
// *pnTruncate and return true. Return if the frame is not valid.
func _walDecodeFrame(tls *crt.TLS, _pWal *XWal, _piPage *uint32, _pnTruncate *uint32, _aData *uint8, _aFrame *uint8) (r0 int32) {
var _nativeCksum int32
var _pgno uint32
var _aCksum *uint32
_aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8)))))
i32(0)
if crt.Xmemcmp(tls, (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), uint32(i32(8))) != i32(0) {
return i32(0)
}
_pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(0)))))
if _pgno == uint32(i32(0)) {
return i32(0)
}
_nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0))
_walChecksumBytes(tls, _nativeCksum, _aFrame, i32(8), _aCksum, _aCksum)
_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.X8), _aCksum, _aCksum)
if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(0))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(16)))))) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(1))))) != _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(20)))))) {
return i32(0)
}
*_piPage = _pgno
*_pnTruncate = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(4)))))
return i32(1)
}
// Set an entry in the wal-index that will map database page number
// pPage into WAL frame iFrame.
func _walIndexAppend(tls *crt.TLS, _pWal *XWal, _iFrame uint32, _iPage uint32) (r0 int32) {
var _rc, _1_iKey, _1_idx, _1_nCollide, _2_nByte int32
var _iZero uint32
var _aPgno *uint32
var _aHash *uint16
_iZero = u32(0)
_aPgno = nil
_aHash = nil
_rc = _walHashGet(tls, _pWal, _walFramePage(tls, _iFrame), &_aHash, &_aPgno, &_iZero)
if _rc != i32(0) {
goto _0
}
_1_idx = int32(_iFrame - _iZero)
func() {
if _1_idx > i32(4097) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55489), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexAppendØ00__func__Ø000))), unsafe.Pointer(str(22809)))
crt.X__builtin_abort(tls)
}
}()
if _1_idx == i32(1) {
_2_nByte = int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash))+2*uintptr(i32(8192)))))))) - uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(i32(1))))))))) / 1)
crt.Xmemset(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno))+4*uintptr(i32(1))))), i32(0), uint32(_2_nByte))
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx)))) != 0 {
_walCleanupHash(tls, _pWal)
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx)))) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55507), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexAppendØ00__func__Ø000))), unsafe.Pointer(str(22838)))
crt.X__builtin_abort(tls)
}
}()
}
_1_nCollide = _1_idx
_1_iKey = _walHash(tls, _iPage)
_7:
if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_1_iKey)))) == 0 {
goto _10
}
if postInc1(&_1_nCollide, int32(-1)) == i32(0) {
return _sqlite3CorruptError(tls, i32(55513))
}
_1_iKey = _walNextHash(tls, _1_iKey)
goto _7
_10:
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPgno)) + 4*uintptr(_1_idx))) = _iPage
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHash)) + 2*uintptr(_1_iKey))) = uint16(_1_idx)
_0:
return _rc
_ = _1_nCollide
panic(0)
}
var _walIndexAppendØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_walIndexAppendØ00__func__Ø000[0], str(22850), 15)
}
// Write the header information in pWal->hdr into the wal-index.
//
// The checksum on pWal->hdr is updated before it is written.
func _walIndexWriteHdr(tls *crt.TLS, _pWal *XWal) {
var _nCksum int32
var _aHdr *XWalIndexHdr
_aHdr = _walIndexHdr(tls, _pWal)
_nCksum = i32(40)
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55144), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIndexWriteHdrØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X3))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X0))) = uint32(i32(3007000))
_walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))))), _nCksum, nil, (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X10))))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(1))))), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u32(48))
_walShmBarrier(tls, _pWal)
crt.Xmemcpy(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHdr))+48*uintptr(i32(0))))), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u32(48))
}
var _walIndexWriteHdrØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_walIndexWriteHdrØ00__func__Ø000[0], str(22865), 17)
}
// Return a pointer to the WalCkptInfo structure in the wal-index.
func _walCkptInfo(tls *crt.TLS, _pWal *XWal) (r0 *XWalCkptInfo) {
func() {
if (_pWal.X5) <= i32(0) || (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55058), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCkptInfoØ00__func__Ø000))), unsafe.Pointer(str(15271)))
crt.X__builtin_abort(tls)
}
}()
return (*XWalCkptInfo)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0)))))) + 4*uintptr(u32(24))))))
}
var _walCkptInfoØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_walCkptInfoØ00__func__Ø000[0], str(22882), 12)
}
// The cache of the wal-index header must be valid to call this function.
// Return the page-size in bytes used by the database.
func _walPagesize(tls *crt.TLS, _pWal *XWal) (r0 int32) {
return (int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(65024)) + ((int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5) & i32(1)) << uint(i32(16)))
}
// Copy as much content as we can from the WAL back into the database file
// in response to an sqlite3_wal_checkpoint() request or the equivalent.
//
// The amount of information copies from WAL to database might be limited
// by active readers. This routine will never overwrite a database page
// that a concurrent reader might be using.
//
// All I/O barrier operations (a.k.a fsyncs) occur in this routine when
// SQLite is in WAL-mode in synchronous=NORMAL. That means that if
// checkpoints are always run by a background thread or background
// process, foreground threads will never block on a lengthy fsync call.
//
// Fsync is called on the WAL before writing content out of the WAL and
// into the database. This ensures that if the new content is persistent
// in the WAL and can be recovered following a power-loss or hard reset.
//
// Fsync is also called on the database file if (and only if) the entire
// WAL content is copied into the database file. This second fsync makes
// it safe to delete the WAL since the new content will persist in the
// database file.
//
// This routine uses and updates the nBackfill field of the wal-index header.
// This is the only routine that will increase the value of nBackfill.
// (A WAL reset or recovery will revert nBackfill to zero, but not increase
// its value.)
//
// The caller must be holding sufficient locks to ensure that no other
// checkpoint is running (in any other thread or process) at the same
// time.
func _walCheckpoint(tls *crt.TLS, _pWal *XWal, _db *Xsqlite3, _eMode int32, _xBusy func(*crt.TLS, unsafe.Pointer) int32, _pBusyArg unsafe.Pointer, _sync_flags int32, _zBuf *uint8) (r0 int32) {
var _rc, _szPage, _i int32
var _8_nSize, _10_nReq, _12_iOffset, _16_szDb int64
var _iDbpage, _iFrame, _mxSafeFrame, _mxPage, _3_y, _8_nBackfill, _22_salt1 uint32
var _pInfo *XWalCkptInfo
var _pIter *XWalIterator
_rc = i32(0)
_pIter = nil
_iDbpage = u32(0)
_iFrame = u32(0)
_szPage = _walPagesize(tls, _pWal)
_pInfo = _walCkptInfo(tls, _pWal)
if (_pInfo.X0) >= ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
goto _0
}
_rc = _walIteratorInit(tls, _pWal, &_pIter)
if _rc != i32(0) {
return _rc
}
func() {
if _pIter == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56230), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22894)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eMode == i32(0) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_xBusy})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56234), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22486)))
crt.X__builtin_abort(tls)
}
}()
_mxSafeFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
_mxPage = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7
_i = i32(1)
_7:
if _i >= i32(5) {
goto _10
}
_3_y = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i)))
if _mxSafeFrame <= _3_y {
goto _11
}
func() {
if _3_y > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56254), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22900)))
crt.X__builtin_abort(tls)
}
}()
_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(3)+_i, i32(1))
if _rc == i32(0) {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) = func() uint32 {
if _i == i32(1) {
return _mxSafeFrame
}
return u32(4294967295)
}()
_walUnlockExclusive(tls, _pWal, i32(3)+_i, i32(1))
goto _19
}
if _rc == i32(5) {
_mxSafeFrame = _3_y
_xBusy = nil
goto _19
}
goto _walcheckpoint_out
_19:
_11:
_i += 1
goto _7
_10:
if (_pInfo.X0) >= _mxSafeFrame || store1(&_rc, _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(3), i32(1))) != i32(0) {
goto _21
}
_8_nBackfill = _pInfo.X0
*(*uint32)(unsafe.Pointer(&(_pInfo.X3))) = _mxSafeFrame
if _sync_flags != 0 {
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X2), _sync_flags)
}
if _rc != i32(0) {
goto _23
}
_10_nReq = int64(_mxPage) * int64(_szPage)
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.X1), &_8_nSize)
if (_rc == i32(0)) && (_8_nSize < _10_nReq) {
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pWal.X1), i32(5), (unsafe.Pointer)(&_10_nReq))
}
_23:
if _rc != i32(0) || i32(0) != _walIteratorNext(tls, _pIter, &_iDbpage, &_iFrame) {
goto _27
}
func() {
if _walFramePgno(tls, _pWal, _iFrame) != _iDbpage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56296), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22921)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 {
_rc = func() int32 {
if (_db.X17) != 0 {
return _sqlite3NomemError(tls, i32(56298))
}
return i32(9)
}()
goto _27
}
if ((_iFrame <= _8_nBackfill) || (_iFrame > _mxSafeFrame)) || (_iDbpage > _mxPage) {
goto _23
}
_12_iOffset = (int64(i32(32)) + (int64(_iFrame-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(24))
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_zBuf), _szPage, _12_iOffset)
if _rc != i32(0) {
goto _27
}
_12_iOffset = int64(_iDbpage-uint32(i32(1))) * int64(_szPage)
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X1), (unsafe.Pointer)(_zBuf), _szPage, _12_iOffset)
if _rc != i32(0) {
goto _27
}
goto _23
_27:
if _rc != i32(0) {
goto _39
}
if _mxSafeFrame != (_walIndexHdr(tls, _pWal).X6) {
goto _40
}
_16_szDb = int64((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7) * int64(_szPage)
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.X1), _16_szDb)
if (_rc == i32(0)) && _sync_flags != 0 {
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X1), _sync_flags)
}
_40:
if _rc == i32(0) {
*(*uint32)(unsafe.Pointer(&(_pInfo.X0))) = _mxSafeFrame
}
_39:
_walUnlockExclusive(tls, _pWal, i32(3), i32(1))
_21:
if _rc == i32(5) {
_rc = i32(0)
}
_0:
if _rc != i32(0) || _eMode == i32(0) {
goto _walcheckpoint_out
}
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56346), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
if (_pInfo.X0) < ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
_rc = i32(5)
goto _51
}
if _eMode < i32(2) {
goto _51
}
Xsqlite3_randomness(tls, i32(4), (unsafe.Pointer)(&_22_salt1))
func() {
if (_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56352), unsafe.Pointer((*int8)(unsafe.Pointer(&_walCheckpointØ00__func__Ø000))), unsafe.Pointer(str(22957)))
crt.X__builtin_abort(tls)
}
}()
_rc = _walBusyLock(tls, _pWal, _xBusy, _pBusyArg, i32(4), i32(4))
if _rc != i32(0) {
goto _54
}
if _eMode == i32(3) {
_walRestartHdr(tls, _pWal, _22_salt1)
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.X2), int64(i32(0)))
}
_walUnlockExclusive(tls, _pWal, i32(4), i32(4))
_54:
_51:
_walcheckpoint_out:
_walIteratorFree(tls, _pIter)
return _rc
}
// Construct a WalInterator object that can be used to loop over all
// pages in the WAL in ascending order. The caller must hold the checkpoint
// lock.
//
// On success, make *pp point to the newly allocated WalInterator object
// return SQLITE_OK. Otherwise, return an error code. If this routine
// returns an error, the value of *pp is undefined.
//
// The calling routine should invoke walIteratorFree() to destroy the
// WalIterator object when it has finished with it.
func _walIteratorInit(tls *crt.TLS, _pWal *XWal, _pp **XWalIterator) (r0 int32) {
var _nSegment, _nByte, _i, _rc, _4_j, _4_nEntry int32
var _iLast, _3_iZero uint32
var _3_aPgno *uint32
var _aTmp, _3_aHash, _4_aIndex *uint16
var _p *XWalIterator
_rc = i32(0)
func() {
if (_pWal.X13) == 0 || ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56044), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIteratorInitØ00__func__Ø000))), unsafe.Pointer(str(22993)))
crt.X__builtin_abort(tls)
}
}()
_iLast = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
_nSegment = _walFramePage(tls, _iLast) + i32(1)
_nByte = int32((u32(28) + (uint32(_nSegment-i32(1)) * u32(20))) + (_iLast * u32(2)))
_p = (*XWalIterator)(Xsqlite3_malloc64(tls, uint64(_nByte)))
if _p == nil {
return _sqlite3NomemError(tls, i32(56054))
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), uint32(_nByte))
*(*int32)(unsafe.Pointer(&(_p.X1))) = _nSegment
_aTmp = (*uint16)(Xsqlite3_malloc64(tls, uint64(u32(2)*func() uint32 {
if _iLast > uint32(i32(4096)) {
return uint32(i32(4096))
}
return _iLast
}())))
if _aTmp == nil {
_rc = _sqlite3NomemError(tls, i32(56066))
}
_i = i32(0)
_7:
if _rc != i32(0) || _i >= _nSegment {
goto _11
}
_rc = _walHashGet(tls, _pWal, _i, &_3_aHash, &_3_aPgno, &_3_iZero)
if _rc != i32(0) {
goto _12
}
*(*uintptr)(unsafe.Pointer(&_3_aPgno)) += uintptr(4)
if (_i + i32(1)) == _nSegment {
_4_nEntry = int32(_iLast - _3_iZero)
goto _14
}
_4_nEntry = int32((uintptr(unsafe.Pointer((*uint32)(unsafe.Pointer(_3_aHash)))) - uintptr(unsafe.Pointer(_3_aPgno))) / 4)
_14:
_4_aIndex = (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2)))))+20*uintptr(_p.X1))))) + 2*uintptr(_3_iZero)))
_3_iZero += 1
_4_j = i32(0)
_15:
if _4_j >= _4_nEntry {
goto _18
}
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aIndex)) + 2*uintptr(_4_j))) = uint16(_4_j)
_4_j += 1
goto _15
_18:
_walMergesort(tls, _3_aPgno, _aTmp, _4_aIndex, &_4_nEntry)
*(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr(_i))).X4))) = int32(_3_iZero)
*(*int32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr(_i))).X3))) = _4_nEntry
*(**uint16)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr(_i))).X1))) = _4_aIndex
*(**uint32)(unsafe.Pointer(&((*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr(_i))).X2))) = _3_aPgno
_12:
_i += 1
goto _7
_11:
Xsqlite3_free(tls, (unsafe.Pointer)(_aTmp))
if _rc != i32(0) {
_walIteratorFree(tls, _p)
}
*_pp = _p
return _rc
}
var _walIteratorInitØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_walIteratorInitØ00__func__Ø000[0], str(23031), 16)
}
// Sort the elements in list aList using aContent[] as the sort key.
// Remove elements with duplicate keys, preferring to keep the
// larger aList[] values.
//
// The aList[] entries are indices into aContent[]. The values in
// aList[] are to be sorted so that for all J i32(4096) || _nList <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55972), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23047)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
_iList = i32(0)
_3:
if _iList >= _nList {
goto _6
}
_nMerge = i32(1)
_aMerge = (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_iList)))
_iSub = uint32(i32(0))
_7:
if (_iList & (i32(1) << uint(int32(_iSub)))) == 0 {
goto _10
}
func() {
if _iSub >= uint32(i32(13)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55980), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23081)))
crt.X__builtin_abort(tls)
}
}()
_2_p = (*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 8*uintptr(_iSub)))
func() {
if (_2_p.X1) == nil || (_2_p.X0) > (i32(1)<= uint32(i32(13)) {
goto _21
}
if (_nList & (i32(1) << uint(int32(_iSub)))) != 0 {
func() {
if _iSub >= uint32(i32(13)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55993), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23081)))
crt.X__builtin_abort(tls)
}
}()
_4_p = (*TSublist)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSub)) + 8*uintptr(_iSub)))
func() {
if (_4_p.X0) > (i32(1) << uint(int32(_iSub))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55995), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23173)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_4_p.X1) != (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList))+2*uintptr(_nList&(^((i32(2)<= (*_pnList) {
goto _34
}
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_5_i))))))) <= (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aList)) + 2*uintptr(_5_i-i32(1)))))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56007), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergesortØ00__func__Ø000))), unsafe.Pointer(str(23246)))
crt.X__builtin_abort(tls)
}
}()
_5_i += 1
goto _31
_34:
_ = _aSub
}
var _walMergesortØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_walMergesortØ00__func__Ø000[0], str(23288), 13)
}
// This function merges two sorted lists into a single sorted list.
//
// aLeft[] and aRight[] are arrays of indices. The sort key is
// aContent[aLeft[]] and aContent[aRight[]]. Upon entry, the following
// is guaranteed for all J= _nRight && _iLeft >= _nLeft {
goto _4
}
if (_iLeft < _nLeft) && ((_iRight >= _nRight) || ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(_iRight))))))))) {
_1_logpage = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(postInc1(&_iLeft, int32(1)))))
goto _9
}
_1_logpage = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(postInc1(&_iRight, int32(1)))))
_9:
_1_dbpage = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(_1_logpage)))
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTmp)) + 2*uintptr(postInc1(&_iOut, int32(1))))) = _1_logpage
if (_iLeft < _nLeft) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) == _1_dbpage) {
_iLeft += 1
}
func() {
if _iLeft < _nLeft && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLeft)) + 2*uintptr(_iLeft))))))) <= _1_dbpage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55927), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergeØ00__func__Ø000))), unsafe.Pointer(str(23321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iRight < _nRight && (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aContent)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRight)) + 2*uintptr(_iRight))))))) <= _1_dbpage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55928), unsafe.Pointer((*int8)(unsafe.Pointer(&_walMergeØ00__func__Ø000))), unsafe.Pointer(str(23367)))
crt.X__builtin_abort(tls)
}
}()
goto _3
_4:
*_paRight = _aLeft
*_pnRight = _iOut
crt.Xmemcpy(tls, (unsafe.Pointer)(_aLeft), (unsafe.Pointer)(_aTmp), u32(2)*uint32(_iOut))
}
var _walMergeØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_walMergeØ00__func__Ø000[0], str(23417), 9)
}
// Free an iterator allocated by walIteratorInit().
func _walIteratorFree(tls *crt.TLS, _p *XWalIterator) {
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
}
var _walCheckpointØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_walCheckpointØ00__func__Ø000[0], str(23426), 14)
}
// Find the smallest page number out of all pages held in the WAL that
// has not been returned by any prior invocation of this method on the
// same WalIterator object. Write into *piFrame the frame index where
// that page was last written into the WAL. Write into *piPage the page
// number.
//
// Return 0 on success. If there are no pages in the WAL with a page
// number larger than *piPage, then return 1.
func _walIteratorNext(tls *crt.TLS, _p *XWalIterator, _piPage *uint32, _piFrame *uint32) (r0 int32) {
var _i int32
var _iMin, _iRet, _2_iPg uint32
var _1_pSegment *TWalSegment
_iRet = u32(4294967295)
_iMin = uint32(_p.X0)
func() {
if _iMin >= u32(4294967295) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55853), unsafe.Pointer((*int8)(unsafe.Pointer(&_walIteratorNextØ00__func__Ø000))), unsafe.Pointer(str(23440)))
crt.X__builtin_abort(tls)
}
}()
_i = (_p.X1) - i32(1)
_2:
if _i < i32(0) {
goto _5
}
_1_pSegment = (*TWalSegment)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TWalSegment)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr(_i)))
_6:
if (_1_pSegment.X0) >= (_1_pSegment.X3) {
goto _7
}
_2_iPg = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X2)) + 4*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0))))))
if _2_iPg <= _iMin {
goto _8
}
if _2_iPg < _iRet {
_iRet = _2_iPg
*_piFrame = uint32((_1_pSegment.X4) + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pSegment.X1)) + 2*uintptr(_1_pSegment.X0)))))
}
goto _7
_8:
*(*int32)(unsafe.Pointer(&(_1_pSegment.X0))) += 1
goto _6
_7:
_i -= 1
goto _2
_5:
*_piPage = uint32(store1((*int32)(unsafe.Pointer(&(_p.X0))), int32(_iRet)))
return bool2int(_iRet == u32(4294967295))
}
var _walIteratorNextØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_walIteratorNextØ00__func__Ø000[0], str(23456), 16)
}
// The following is guaranteed when this function is called:
//
// a) the WRITER lock is held,
// b) the entire log file has been checkpointed, and
// c) any existing readers are reading exclusively from the database
// file - there are no readers that may attempt to read a frame from
// the log file.
//
// This function updates the shared-memory structures so that the next
// client to write to the database (which may be this one) does so by
// writing frames into the start of the log file.
//
// The value of parameter salt1 is used as the aSalt[1] value in the
// new wal-index header. It should be passed a pseudo-random value (i.e.
// one obtained from sqlite3_randomness()).
func _walRestartHdr(tls *crt.TLS, _pWal *XWal, _salt1 uint32) {
var _i int32
var _aSalt *uint32
var _pInfo *XWalCkptInfo
_pInfo = _walCkptInfo(tls, _pWal)
_aSalt = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))))
*(*uint32)(unsafe.Pointer(&(_pWal.X22))) += 1
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = uint32(i32(0))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSalt))+4*uintptr(i32(0)))))), uint32(i32(1))+_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSalt))+4*uintptr(i32(0))))))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))))+4*uintptr(i32(1))))), (unsafe.Pointer)(&_salt1), uint32(i32(4)))
_walIndexWriteHdr(tls, _pWal)
*(*uint32)(unsafe.Pointer(&(_pInfo.X0))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_pInfo.X3))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(i32(1)))) = uint32(i32(0))
_i = i32(2)
_0:
if _i >= i32(5) {
goto _3
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i))) = u32(4294967295)
_i += 1
goto _0
_3:
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(i32(0))))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56166), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRestartHdrØ00__func__Ø000))), unsafe.Pointer(str(23472)))
crt.X__builtin_abort(tls)
}
}()
}
var _walRestartHdrØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_walRestartHdrØ00__func__Ø000[0], str(23495), 14)
}
// If the WAL file is currently larger than nMax bytes in size, truncate
// it to exactly nMax bytes. If an error occurs while doing so, ignore it.
func _walLimitSize(tls *crt.TLS, _pWal *XWal, _nMax int64) {
var _rx int32
var _sz int64
_sqlite3BeginBenignMalloc(tls)
_rx = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pWal.X2), &_sz)
if (_rx == i32(0)) && (_sz > _nMax) {
_rx = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pWal.X2), _nMax)
}
_sqlite3EndBenignMalloc(tls)
if _rx != 0 {
Xsqlite3_log(tls, _rx, str(23509), unsafe.Pointer(_pWal.X21))
}
}
// Close an open wal-index.
func _walIndexClose(tls *crt.TLS, _pWal *XWal, _isDelete int32) {
var _1_i int32
if int32(_pWal.X11) != i32(2) {
goto _0
}
_1_i = i32(0)
_1:
if _1_i >= (_pWal.X5) {
goto _4
}
Xsqlite3_free(tls, (unsafe.Pointer)(*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_1_i)))))
*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(_1_i))) = nil
_1_i += 1
goto _1
_4:
goto _5
_0:
_sqlite3OsShmUnmap(tls, (*Xsqlite3_file)(_pWal.X1), _isDelete)
_5:
}
func _sqlite3OsShmUnmap(tls *crt.TLS, _id *Xsqlite3_file, _deleteFlag int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X16)})))(tls, _id, _deleteFlag)
}
// This function is called before attempting a hot-journal rollback. It
// syncs the journal file to disk, then sets pPager->journalHdr to the
// size of the journal file so that the pager_playback() routine knows
// that the entire journal file has been synced.
//
// Syncing a hot-journal to disk before attempting to roll it back ensures
// that if a power-failure occurs during the rollback, the process that
// attempts rollback following system recovery sees the same journal
// content as this process.
//
// If everything goes as planned, SQLITE_OK is returned. Otherwise,
// an SQLite error code.
func _pagerSyncHotJournal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
_rc = i32(0)
if (_pPager.X4) == 0 {
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), i32(2))
}
if _rc == i32(0) {
_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), (*int64)(unsafe.Pointer(&(_pPager.X35))))
}
return _rc
}
// Close a cache.
func _sqlite3PcacheClose(tls *crt.TLS, _pCache *XPCache) {
func() {
if (_pCache.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44805), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheCloseØ00__func__Ø000))), unsafe.Pointer(str(15958)))
crt.X__builtin_abort(tls)
}
}()
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X11)(tls, _pCache.X12)
}
var _sqlite3PcacheCloseØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheCloseØ00__func__Ø000[0], str(23535), 19)
}
// Free the pBt->pTmpSpace allocation
func _freeTempSpace(tls *crt.TLS, _pBt *XBtShared) {
if (_pBt.X27) != nil {
{
p := (**uint8)(unsafe.Pointer(&(_pBt.X27)))
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(4))))
sink13 = *p
}
_sqlite3PageFree(tls, (unsafe.Pointer)(_pBt.X27))
*(**uint8)(unsafe.Pointer(&(_pBt.X27))) = nil
}
}
var _sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3LeaveMutexAndCloseZombieØ00__func__Ø000[0], str(23554), 32)
}
// Invoke the destructor function associated with FuncDef p, if any. Except,
// if this is not the last copy of the function, do not invoke it. Multiple
// copies of a single function are created when create_function() is called
// with SQLITE_ANY as the encoding.
func _functionDestroy(tls *crt.TLS, _db *Xsqlite3, _p *XFuncDef) {
var _pDestructor *XFuncDestructor
_pDestructor = (*XFuncDestructor)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7))))))
if _pDestructor == nil {
goto _0
}
*(*int32)(unsafe.Pointer(&(_pDestructor.X0))) -= 1
if (_pDestructor.X0) == i32(0) {
(_pDestructor.X1)(tls, _pDestructor.X2)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pDestructor))
}
_0:
}
// Erase the eponymous virtual table instance associated with
// virtual table module pMod, if it exists.
func _sqlite3VtabEponymousTableClear(tls *crt.TLS, _db *Xsqlite3, _pMod *XModule) {
var _pTab *XTable
_pTab = (*XTable)(_pMod.X4)
if _pTab != nil {
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | uint32(i32(2))
sink5 = *p
}
_sqlite3DeleteTable(tls, _db, _pTab)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = nil
}
}
// Free an sqlite3_value object
func _sqlite3ValueFree(tls *crt.TLS, _v *XMem) {
if _v == nil {
return
}
_sqlite3VdbeMemRelease(tls, _v)
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_v.X9), (unsafe.Pointer)(_v))
}
// Call this routine when the database connection is closing in order
// to clean up loaded extensions
func _sqlite3CloseExtensions(tls *crt.TLS, _db *Xsqlite3) {
var _i int32
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(112416), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CloseExtensionsØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= (_db.X39) {
goto _5
}
_sqlite3OsDlClose(tls, (*Xsqlite3_vfs)(_db.X0), *(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X40)) + 4*uintptr(_i))))
_i += 1
goto _2
_5:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_db.X40))
}
var _sqlite3CloseExtensionsØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CloseExtensionsØ00__func__Ø000[0], str(23586), 23)
}
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
func Xsqlite3_collation_needed(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8)) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(143721))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_db.X53))))) = _xCollNeeded
*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&(_db.X54))))) = nil
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X55))) = _pCollNeededArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// Register a collation sequence factory callback with the database handle
// db. Replace any previously installed collation sequence factory.
func Xsqlite3_collation_needed16(tls *crt.TLS, _db *Xsqlite3, _pCollNeededArg unsafe.Pointer, _xCollNeeded16 func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer)) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(143742))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&(_db.X53))))) = nil
*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer))(unsafe.Pointer(&(_db.X54))))) = _xCollNeeded16
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X55))) = _pCollNeededArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// *************************** sqlite3_column_ *******************************
// The following routines are used to access elements of the current row
// in the result set.
func Xsqlite3_column_blob(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
var _val unsafe.Pointer
_val = Xsqlite3_value_blob(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
// *************************** sqlite3_value_ *******************************
// The following routines extract information from a Mem or sqlite3_value
// structure.
func Xsqlite3_value_blob(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
var _p *XMem
_p = _pVal
if (int32(_p.X1) & i32(18)) == 0 {
goto _0
}
if func() int32 {
if (int32(_p.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _p)
}
return i32(0)
}() != i32(0) {
func() {
if int32(_p.X1) != i32(1) || (_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_value_blobØ00__func__Ø000))), unsafe.Pointer(str(23609)))
crt.X__builtin_abort(tls)
}
}()
return nil
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X1)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
return (unsafe.Pointer)(func() *int8 {
if (_p.X4) != 0 {
return (_p.X5)
}
return nil
}())
_0:
return (unsafe.Pointer)(Xsqlite3_value_text(tls, _pVal))
}
var _sqlite3_value_blobØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_value_blobØ00__func__Ø000[0], str(23639), 19)
}
// Check to see if column iCol of the given statement is valid. If
// it is, return a pointer to the Mem for the value of that column.
// If iCol is not valid, return a pointer to a Mem which has a value
// of NULL.
func _columnMem(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
var _pVm *TVdbe
var _pOut *XMem
_pVm = (*TVdbe)(_pStmt)
if _pVm == nil {
return _columnNullValue(tls)
}
func() {
if (*Xsqlite3)(_pVm.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77067), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnMemØ00__func__Ø000))), unsafe.Pointer(str(23658)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pVm.X0).X3))
if (((*XMem)(_pVm.X21) != nil) && (_i < int32(_pVm.X29))) && (_i >= i32(0)) {
_pOut = (*XMem)(unsafe.Pointer(uintptr(_pVm.X21) + 48*uintptr(_i)))
goto _6
}
_sqlite3Error(tls, (*Xsqlite3)(_pVm.X0), i32(25))
_pOut = _columnNullValue(tls)
_6:
return _pOut
}
// Return a pointer to static memory containing an SQL NULL value.
func _columnNullValue(tls *crt.TLS) (r0 *XMem) {
return &_columnNullValueØ00nullMemØ001
}
var _columnNullValueØ00nullMemØ001 XMem
func init() {
_columnNullValueØ00nullMemØ001 = XMem{X0: t15{}, X1: u16(1), X2: u8(0), X3: u8(0), X4: i32(0), X5: nil, X6: nil, X7: i32(0), X8: u32(0), X9: nil, X10: nil, X11: nil, X12: nil}
}
var _columnMemØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_columnMemØ00__func__Ø000[0], str(23666), 10)
}
// This function is called after invoking an sqlite3_value_XXX function on a
// column value (i.e. a value returned by evaluating an SQL expression in the
// select list of a SELECT statement) that may cause a malloc() failure. If
// malloc() has failed, the threads mallocFailed flag is cleared and the result
// code of statement pStmt set to SQLITE_NOMEM.
//
// Specifically, this is called from within:
//
// sqlite3_column_int()
// sqlite3_column_int64()
// sqlite3_column_text()
// sqlite3_column_text16()
// sqlite3_column_real()
// sqlite3_column_bytes()
// sqlite3_column_bytes16()
// sqiite3_column_blob()
func _columnMallocFailure(tls *crt.TLS, _pStmt unsafe.Pointer) {
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
if _p != nil {
func() {
if (*Xsqlite3)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77105), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000))), unsafe.Pointer(str(23676)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77106), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnMallocFailureØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _p.X10)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
}
var _columnMallocFailureØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_columnMallocFailureØ00__func__Ø000[0], str(23685), 20)
}
func Xsqlite3_column_bytes(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
var _val int32
_val = Xsqlite3_value_bytes(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_column_bytes16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
var _val int32
_val = Xsqlite3_value_bytes16(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_value_bytes16(tls *crt.TLS, _pVal *XMem) (r0 int32) {
return _sqlite3ValueBytes(tls, _pVal, uint8(i32(2)))
}
// Return the number of columns in the result set for the statement pStmt.
func Xsqlite3_column_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _pVm *TVdbe
_pVm = (*TVdbe)(_pStmt)
return func() int32 {
if _pVm != nil {
return int32(_pVm.X29)
}
return i32(0)
}()
}
// Return the column declaration type (if applicable) of the 'i'th column
// of the result set of SQL statement pStmt.
func Xsqlite3_column_decltype(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
return (*int8)(_columnName(tls, _pStmt, _N, *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), i32(1)))
}
// Convert the N-th element of pStmt->pColName[] into a string using
// xFunc() then return that string. If N is out of range, return 0.
//
// There are up to 5 names for each column. useType determines which
// name is returned. Here are the names:
//
// 0 The column name as it should be displayed for output
// 1 The datatype name for the column
// 2 The name of the database that the column derives from
// 3 The name of the table that the column derives from
// 4 The name of the table column that the result column derives from
//
// If the result is not a simple column reference (if it is an expression
// or a constant) then useTypes 2, 3, and 4 return NULL.
func _columnName(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32, _xFunc func(*crt.TLS, *XMem) unsafe.Pointer, _useType int32) (r0 unsafe.Pointer) {
var _n int32
var _ret unsafe.Pointer
var _db *Xsqlite3
var _p *TVdbe
if _pStmt == nil {
_sqlite3MisuseError(tls, i32(77206))
return nil
}
_ret = nil
_p = (*TVdbe)(_pStmt)
_db = (*Xsqlite3)(_p.X0)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77213), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnNameØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
_n = Xsqlite3_column_count(tls, _pStmt)
if _N >= _n || _N < i32(0) {
goto _4
}
{
p := &_N
*p = (*p) + (_useType * _n)
sink1 = *p
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if int32(_db.X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77218), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnNameØ00__func__Ø000))), unsafe.Pointer(str(1244)))
crt.X__builtin_abort(tls)
}
}()
_ret = _xFunc(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X20)+48*uintptr(_N))))
if (_db.X17) != 0 {
_sqlite3OomClear(tls, _db)
_ret = nil
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
_4:
return _ret
}
var _columnNameØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_columnNameØ00__func__Ø000[0], str(23705), 11)
}
func Xsqlite3_column_decltype16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, i32(1))
}
func Xsqlite3_value_text16(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
return _sqlite3ValueText(tls, _pVal, uint8(i32(2)))
}
func Xsqlite3_column_double(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 float64) {
var _val float64
_val = Xsqlite3_value_double(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_column_int(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
var _val int32
_val = Xsqlite3_value_int(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_value_int(tls *crt.TLS, _pVal *XMem) (r0 int32) {
return int32(_sqlite3VdbeIntValue(tls, _pVal))
}
func _sqlite3VdbeIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
var _flags int32
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70169), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70170), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
_flags = int32(_pMem.X1)
if (_flags & i32(4)) != 0 {
return *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))
}
if (_flags & i32(8)) != 0 {
return _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
}
if (_flags & i32(18)) != 0 {
func() {
if (_pMem.X5) == nil && (_pMem.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70177), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntValueØ00__func__Ø000))), unsafe.Pointer(str(23716)))
crt.X__builtin_abort(tls)
}
}()
return _memIntValue(tls, _pMem)
}
return int64(i32(0))
}
var _sqlite3VdbeIntValueØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeIntValueØ00__func__Ø000[0], str(23738), 20)
}
// Convert a 64-bit IEEE double into a 64-bit signed integer.
// If the double is out of range of a 64-bit signed integer then
// return the closest available 64-bit signed integer.
func _doubleToInt64(tls *crt.TLS, _r float64) (r0 int64) {
if _r <= float64(_doubleToInt64Ø00minIntØ002) {
return _doubleToInt64Ø00minIntØ002
}
if _r >= float64(_doubleToInt64Ø00maxIntØ001) {
return _doubleToInt64Ø00maxIntØ001
}
return int64(_r)
}
var _doubleToInt64Ø00minIntØ002 int64
func init() {
_doubleToInt64Ø00minIntØ002 = i64(-9223372036854775808)
}
var _doubleToInt64Ø00maxIntØ001 int64
func init() {
_doubleToInt64Ø00maxIntØ001 = i64(9223372036854775807)
}
// Return some kind of integer value which is the best we can do
// at representing the value that *pMem describes as an integer.
// If pMem is an integer, then the value is exact. If pMem is
// a floating-point then the value returned is the integer part.
// If pMem is a string or blob, then we make an attempt to convert
// it into an integer and return that. If pMem represents an
// an SQL-NULL value, return 0.
//
// If pMem represents a string value, its encoding might be changed.
func _memIntValue(tls *crt.TLS, _pMem *XMem) (r0 int64) {
var _value int64
_value = i64(0)
_sqlite3Atoi64(tls, _pMem.X5, &_value, _pMem.X4, _pMem.X2)
return _value
}
// Convert zNum to a 64-bit signed integer. zNum must be decimal. This
// routine does *not* accept hexadecimal notation.
//
// If the zNum value is representable as a 64-bit twos-complement
// integer, then write that value into *pNum and return 0.
//
// If zNum is exactly 9223372036854775808, return 2. This special
// case is broken out because while 9223372036854775808 cannot be a
// signed 64-bit integer, its negative -9223372036854775808 can be.
//
// If zNum is too big for a 64-bit integer and is not
// 9223372036854775808 or if zNum contains any non-numeric text,
// then return 1.
//
// 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 _sqlite3Atoi64(tls *crt.TLS, _zNum *int8, _pNum *int64, _length int32, _enc uint8) (r0 int32) {
var _incr, _neg, _i, _c, _nonNum int32
var _u uint64
var _zStart, _zEnd *int8
_u = u64(0)
_neg = i32(0)
_c = i32(0)
_nonNum = i32(0)
_zEnd = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zNum)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_length)))))))
func() {
if int32(_enc) != i32(1) && int32(_enc) != i32(2) && int32(_enc) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28236), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000))), unsafe.Pointer(str(7088)))
crt.X__builtin_abort(tls)
}
}()
if int32(_enc) == i32(1) {
_incr = i32(1)
goto _5
}
_incr = i32(2)
i32(0)
_i = i32(3) - int32(_enc)
_6:
if _i >= _length || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i)))) != i32(0) {
goto _10
}
{
p := &_i
*p = (*p) + i32(2)
sink1 = *p
}
goto _6
_10:
_nonNum = bool2int(_i < _length)
_zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i^i32(1))))
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(int32(_enc)&i32(1))))
sink0 = *p
}
_5:
if (uintptr(unsafe.Pointer(_zNum)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zNum)))))&i32(1)) != 0 {
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _5
}
if uintptr(unsafe.Pointer(_zNum)) >= uintptr(unsafe.Pointer(_zEnd)) {
goto _14
}
if int32(*_zNum) == i32(45) {
_neg = i32(1)
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _17
}
if int32(*_zNum) == i32(43) {
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
}
_17:
_14:
_zStart = _zNum
_18:
if (uintptr(unsafe.Pointer(_zNum)) < uintptr(unsafe.Pointer(_zEnd))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48)) {
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_incr)))
sink0 = *p
}
goto _18
}
_i = i32(0)
_21:
if uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum))+1*uintptr(_i))))) >= uintptr(unsafe.Pointer(_zEnd)) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))) < i32(48) || _c > i32(57) {
goto _26
}
_u = ((_u * uint64(i32(10))) + uint64(_c)) - uint64(i32(48))
{
p := &_i
*p = (*p) + _incr
sink1 = *p
}
goto _21
_26:
if _u > uint64(i64(9223372036854775807)) {
*_pNum = func() int64 {
if _neg != 0 {
return i64(-9223372036854775808)
}
return i64(9223372036854775807)
}()
goto _32
}
if _neg != 0 {
*_pNum = -int64(_u)
goto _32
}
*_pNum = int64(_u)
_32:
if (((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum))+1*uintptr(_i))))) < uintptr(unsafe.Pointer(_zEnd))) || ((_i == i32(0)) && (_zStart == _zNum))) || (_i > (i32(19) * _incr))) || _nonNum != 0 {
return i32(1)
}
if _i < (i32(19) * _incr) {
func() {
if _u > uint64(i64(9223372036854775807)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28281), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000))), unsafe.Pointer(str(23758)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
_c = _compare2pow63(tls, _zNum, _incr)
if _c < i32(0) {
func() {
if _u > uint64(i64(9223372036854775807)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000))), unsafe.Pointer(str(23758)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
if _c > i32(0) {
return i32(1)
}
func() {
if (_u - uint64(i32(1))) != uint64(i64(9223372036854775807)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28296), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Atoi64Ø00__func__Ø000))), unsafe.Pointer(str(23775)))
crt.X__builtin_abort(tls)
}
}()
return func() int32 {
if _neg != 0 {
return i32(0)
}
return i32(2)
}()
}
var _sqlite3Atoi64Ø00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3Atoi64Ø00__func__Ø000[0], str(23794), 14)
}
// Compare the 19-character string zNum against the text representation
// value 2^63: 9223372036854775808. Return negative, zero, or positive
// if zNum is less than, equal to, or greater than the string.
// Note that zNum must contain exactly 19 characters.
//
// Unlike memcmp() this routine is guaranteed to return the difference
// in the values of the last digit if the only difference is in the
// last digit. So, for example,
//
// compare2pow63("9223372036854775800", 1)
//
// will return -8.
func _compare2pow63(tls *crt.TLS, _zNum *int8, _incr int32) (r0 int32) {
var _c, _i int32
var _pow63 *int8
_c = i32(0)
_pow63 = str(23808)
_i = i32(0)
_0:
if _c != i32(0) || _i >= i32(18) {
goto _4
}
_c = (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i*_incr)))) - int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pow63)) + 1*uintptr(_i))))) * i32(10)
_i += 1
goto _0
_4:
if _c == i32(0) {
_c = int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(18)*_incr)))) - i32(56)
}
return _c
}
func Xsqlite3_column_int64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int64) {
var _val int64
_val = Xsqlite3_value_int64(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_value_int64(tls *crt.TLS, _pVal *XMem) (r0 int64) {
return _sqlite3VdbeIntValue(tls, _pVal)
}
// Return the name of the Nth column of the result set returned by SQL
// statement pStmt.
func Xsqlite3_column_name(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 *int8) {
return (*int8)(_columnName(tls, _pStmt, _N, *(*func(*crt.TLS, *XMem) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS, *XMem) *uint8 }{Xsqlite3_value_text})), i32(0)))
}
func Xsqlite3_column_name16(tls *crt.TLS, _pStmt unsafe.Pointer, _N int32) (r0 unsafe.Pointer) {
return _columnName(tls, _pStmt, _N, Xsqlite3_value_text16, i32(0))
}
func Xsqlite3_column_text(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *uint8) {
var _val *uint8
_val = Xsqlite3_value_text(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
func Xsqlite3_column_text16(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 unsafe.Pointer) {
var _val unsafe.Pointer
_val = Xsqlite3_value_text16(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _val
}
// SQLITE_OMIT_UTF16
func Xsqlite3_column_type(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 int32) {
var _iType int32
_iType = Xsqlite3_value_type(tls, _columnMem(tls, _pStmt, _i))
_columnMallocFailure(tls, _pStmt)
return _iType
}
func Xsqlite3_column_value(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32) (r0 *XMem) {
var _pOut *XMem
_pOut = _columnMem(tls, _pStmt, _i)
if (int32(_pOut.X1) & i32(2048)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) & i32(-2049))
sink14 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) | i32(4096))
sink14 = *p
}
}
_columnMallocFailure(tls, _pStmt)
return _pOut
}
// Register a function to be invoked when a transaction commits.
// If the invoked function returns non-zero, then the commit becomes a
// rollback.
func Xsqlite3_commit_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pOld unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142385))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pOld = _db.X45
*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X46))) = _xCallback
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X45))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pOld
}
// Return TRUE if the given SQL string ends in a semicolon.
//
// Special handling is require for CREATE TRIGGER statements.
// Whenever the CREATE TRIGGER keywords are seen, the statement
// must end with ";END;".
//
// This implementation uses a state machine with 8 states:
//
// (0) INVALID We have not yet seen a non-whitespace character.
//
// (1) START At the beginning or end of an SQL statement. This routine
// returns 1 if it ends in the START state and 0 if it ends
// in any other state.
//
// (2) NORMAL We are in the middle of statement which ends with a single
// semicolon.
//
// (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of
// a statement.
//
// (4) CREATE The keyword CREATE has been seen at the beginning of a
// statement, possibly preceded by EXPLAIN and/or followed by
// TEMP or TEMPORARY
//
// (5) TRIGGER We are in the middle of a trigger definition that must be
// ended by a semicolon, the keyword END, and another semicolon.
//
// (6) SEMI We've seen the first semicolon in the ";END;" that occurs at
// the end of a trigger definition.
//
// (7) END We've seen the ";END" of the ";END;" that occurs at the end
// of a trigger definition.
//
// Transitions between states above are determined by tokens extracted
// from the input. The following tokens are significant:
//
// (0) tkSEMI A semicolon.
// (1) tkWS Whitespace.
// (2) tkOTHER Any other SQL token.
// (3) tkEXPLAIN The "explain" keyword.
// (4) tkCREATE The "create" keyword.
// (5) tkTEMP The "temp" or "temporary" keyword.
// (6) tkTRIGGER The "trigger" keyword.
// (7) tkEND The "end" keyword.
//
// Whitespace never causes a state transition and is always ignored.
// This means that a SQL string of all whitespace is invalid.
//
// If we compile with SQLITE_OMIT_TRIGGER, all of the computation needed
// to recognize the end of a trigger can be omitted. All we have to do
// is look for a semicolon that is not part of an string or comment.
func Xsqlite3_complete(tls *crt.TLS, _zSql *int8) (r0 int32) {
var _14_c, _17_nId int32
var _state, _token uint8
_state = u8(0)
if _zSql == nil {
_sqlite3MisuseError(tls, i32(140223))
return i32(0)
}
_0:
if (*_zSql) == 0 {
goto _2
}
switch int32(*_zSql) {
case i32(9):
goto _5
case i32(10):
goto _5
case i32(12):
goto _5
case i32(13):
goto _5
case i32(32):
goto _5
case i32(34):
goto _13
case i32(39):
goto _13
case i32(45):
goto _11
case i32(47):
goto _10
case i32(59):
goto _4
case i32(91):
goto _12
case i32(96):
goto _13
default:
goto _16
}
_4:
_token = uint8(i32(0))
goto _17
_5:
_token = uint8(i32(1))
goto _17
_10:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(42) {
_token = uint8(i32(2))
goto _17
}
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink0 = *p
}
_19:
if ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) != 0) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) != i32(42)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(47))) {
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _19
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == i32(0) {
return i32(0)
}
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
_token = uint8(i32(1))
goto _17
_11:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(1))))) != i32(45) {
_token = uint8(i32(2))
goto _17
}
_24:
if ((*_zSql) != 0) && (int32(*_zSql) != i32(10)) {
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _24
}
if int32(*_zSql) == i32(0) {
return bool2int(int32(_state) == i32(1))
}
_token = uint8(i32(1))
goto _17
_12:
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
_29:
if ((*_zSql) != 0) && (int32(*_zSql) != i32(93)) {
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _29
}
if int32(*_zSql) == i32(0) {
return i32(0)
}
_token = uint8(i32(2))
goto _17
_13:
_14_c = int32(*_zSql)
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
_33:
if ((*_zSql) != 0) && (int32(*_zSql) != _14_c) {
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _33
}
if int32(*_zSql) == i32(0) {
return i32(0)
}
_token = uint8(i32(2))
goto _17
_16:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_zSql))))) & i32(70)) == i32(0) {
goto _37
}
_17_nId = i32(1)
_38:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_17_nId)))))))) & i32(70)) == i32(0) {
goto _41
}
_17_nId += 1
goto _38
_41:
switch int32(*_zSql) {
case i32(67):
goto _43
case i32(69):
goto _47
case i32(84):
goto _45
case i32(99):
goto _43
case i32(101):
goto _47
case i32(116):
goto _45
default:
goto _49
}
_43:
if (_17_nId == i32(6)) && (Xsqlite3_strnicmp(tls, _zSql, str(23827), i32(6)) == i32(0)) {
_token = uint8(i32(4))
goto _52
}
_token = uint8(i32(2))
_52:
goto _53
_45:
if (_17_nId == i32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23834), i32(7)) == i32(0)) {
_token = uint8(i32(6))
goto _62
}
if (_17_nId == i32(4)) && (Xsqlite3_strnicmp(tls, _zSql, str(23842), i32(4)) == i32(0)) {
_token = uint8(i32(5))
goto _62
}
if (_17_nId == i32(9)) && (Xsqlite3_strnicmp(tls, _zSql, str(23847), i32(9)) == i32(0)) {
_token = uint8(i32(5))
goto _62
}
_token = uint8(i32(2))
_62:
goto _53
_47:
if (_17_nId == i32(3)) && (Xsqlite3_strnicmp(tls, _zSql, str(23857), i32(3)) == i32(0)) {
_token = uint8(i32(7))
goto _68
}
if (_17_nId == i32(7)) && (Xsqlite3_strnicmp(tls, _zSql, str(23861), i32(7)) == i32(0)) {
_token = uint8(i32(3))
goto _68
}
_token = uint8(i32(2))
_68:
goto _53
_49:
_token = uint8(i32(2))
goto _53
_53:
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_17_nId-i32(1))))
sink0 = *p
}
goto _69
_37:
_token = uint8(i32(2))
_69:
goto _17
_17:
_state = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_completeØ00transØ001))+8*uintptr(_state))))) + 1*uintptr(_token)))
*(*uintptr)(unsafe.Pointer(&_zSql)) += uintptr(1)
goto _0
_2:
return bool2int(int32(_state) == i32(1))
}
var _sqlite3_completeØ00transØ001 [8][8]uint8
func init() {
_sqlite3_completeØ00transØ001 = [8][8]uint8{[8]uint8{u8(1), u8(0), u8(2), u8(3), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(1), u8(2), u8(3), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(2), u8(2), u8(2), u8(2), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(3), u8(3), u8(2), u8(4), u8(2), u8(2), u8(2)}, [8]uint8{u8(1), u8(4), u8(2), u8(2), u8(2), u8(4), u8(5), u8(2)}, [8]uint8{u8(6), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5)}, [8]uint8{u8(6), u8(6), u8(5), u8(5), u8(5), u8(5), u8(5), u8(7)}, [8]uint8{u8(1), u8(7), u8(5), u8(5), u8(5), u8(5), u8(5), u8(5)}}
}
// This routine is the same as the sqlite3_complete() routine described
// above, except that the parameter is required to be UTF-16 encoded, not
// UTF-8.
func Xsqlite3_complete16(tls *crt.TLS, _zSql unsafe.Pointer) (r0 int32) {
var _rc int32
var _zSql8 *int8
var _pVal *XMem
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return _rc
}
_pVal = _sqlite3ValueNew(tls, nil)
_sqlite3ValueSetStr(tls, _pVal, i32(-1), _zSql, uint8(i32(2)), nil)
_zSql8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(i32(1))))
if _zSql8 != nil {
_rc = Xsqlite3_complete(tls, _zSql8)
goto _2
}
_rc = _sqlite3NomemError(tls, i32(140368))
_2:
_sqlite3ValueFree(tls, _pVal)
return _rc & i32(255)
}
// Register a new collation sequence with the database handle db.
func Xsqlite3_create_collation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) {
return Xsqlite3_create_collation_v2(tls, _db, _zName, _enc, _pCtx, _xCompare, nil)
}
// Register a new collation sequence with the database handle db.
func Xsqlite3_create_collation_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _rc int32
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
return _sqlite3MisuseError(tls, i32(143671))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_collation_v2Ø00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
_rc = _createCollation(tls, _db, _zName, uint8(_enc), _pCtx, _xCompare, _xDel)
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_create_collation_v2Ø00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_create_collation_v2Ø00__func__Ø000[0], str(23887), 28)
}
// Create a new collating function for database "db". The name is zName
// and the encoding is enc.
func _createCollation(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _enc uint8, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _enc2, _5_j int32
var _pColl, _5_aColl, _6_p *XCollSeq
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142821), unsafe.Pointer((*int8)(unsafe.Pointer(&_createCollationØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_enc2 = int32(_enc)
if (_enc2 == i32(4)) || (_enc2 == i32(8)) {
_enc2 = i32(2)
}
if (_enc2 < i32(1)) || (_enc2 > i32(3)) {
return _sqlite3MisuseError(tls, i32(142834))
}
_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, i32(0))
if _pColl == nil || (_pColl.X3) == nil {
goto _7
}
if (_db.X34) != 0 {
_sqlite3ErrorWithMsg(tls, _db, i32(5), str(23915))
return i32(5)
}
_sqlite3ExpirePreparedStatements(tls, _db)
if (int32(_pColl.X1) & i32(-9)) != _enc2 {
goto _9
}
_5_aColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), _zName))
_5_j = i32(0)
_10:
if _5_j >= i32(3) {
goto _13
}
_6_p = (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_aColl)) + 20*uintptr(_5_j)))
if int32(_6_p.X1) != int32(_pColl.X1) {
goto _14
}
if (_6_p.X4) != nil {
(_6_p.X4)(tls, _6_p.X2)
}
*(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&(_6_p.X3))) = nil
_14:
_5_j += 1
goto _10
_13:
_9:
_7:
_pColl = _sqlite3FindCollSeq(tls, _db, uint8(_enc2), _zName, i32(1))
if _pColl == nil {
return _sqlite3NomemError(tls, i32(142872))
}
*(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&(_pColl.X3))) = _xCompare
*(*unsafe.Pointer)(unsafe.Pointer(&(_pColl.X2))) = _pCtx
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pColl.X4))) = _xDel
*(*uint8)(unsafe.Pointer(&(_pColl.X1))) = uint8(_enc2 | (int32(_enc) & i32(8)))
_sqlite3Error(tls, _db, i32(0))
return i32(0)
}
var _createCollationØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_createCollationØ00__func__Ø000[0], str(23983), 16)
}
// 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 _sqlite3FindCollSeq(tls *crt.TLS, _db *Xsqlite3, _enc uint8, _zName *int8, _create int32) (r0 *XCollSeq) {
var _pColl *XCollSeq
if _zName != nil {
_pColl = _findCollSeqEntry(tls, _db, _zName, _create)
goto _1
}
_pColl = (*XCollSeq)(_db.X2)
_1:
i32(0)
func() {
if int32(_enc) < i32(1) || int32(_enc) > i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindCollSeqØ00__func__Ø000))), unsafe.Pointer(str(23999)))
crt.X__builtin_abort(tls)
}
}()
if _pColl != nil {
{
p := &_pColl
*p = (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 20*uintptr(int32(_enc)-i32(1))))
sink32 = *p
}
}
return _pColl
}
// Locate and return an entry from the db.aCollSeq hash table. If the entry
// specified by zName and nName is not found and parameter 'create' is
// true, then create a new entry. Otherwise return NULL.
//
// Each pointer stored in the sqlite3.aCollSeq hash table contains an
// array of three CollSeq structures. The first is the collation sequence
// preferred for UTF-8, the second UTF-16le, and the third UTF-16be.
//
// Stored immediately after the three collation sequences is a copy of
// the collation sequence name. A pointer to this string is stored in
// each collation sequence structure.
func _findCollSeqEntry(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _create int32) (r0 *XCollSeq) {
var _1_nName int32
var _pColl, _2_pDel *XCollSeq
_pColl = (*XCollSeq)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), _zName))
if nil != _pColl || _create == 0 {
goto _1
}
_1_nName = _sqlite3Strlen30(tls, _zName)
_pColl = (*XCollSeq)(_sqlite3DbMallocZero(tls, _db, uint64((u32(60)+uint32(_1_nName))+uint32(i32(1)))))
if _pColl == nil {
goto _2
}
_2_pDel = nil
*(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(0)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(3))))))
*(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(0)))).X1))) = uint8(i32(1))
*(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(1)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(3))))))
*(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(1)))).X1))) = uint8(i32(2))
*(**int8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(2)))).X0))) = (*int8)(unsafe.Pointer((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(3))))))
*(*uint8)(unsafe.Pointer(&((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl)) + 20*uintptr(i32(2)))).X1))) = uint8(i32(3))
crt.Xmemcpy(tls, (unsafe.Pointer)((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+20*uintptr(i32(0)))).X0), (unsafe.Pointer)(_zName), uint32(_1_nName))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+20*uintptr(i32(0)))).X0)) + 1*uintptr(_1_nName))) = int8(i32(0))
_2_pDel = (*XCollSeq)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X70))), (*XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pColl))+20*uintptr(i32(0)))).X0, (unsafe.Pointer)(_pColl)))
func() {
if _2_pDel != nil && _2_pDel != _pColl {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104323), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCollSeqEntryØ00__func__Ø000))), unsafe.Pointer(str(24039)))
crt.X__builtin_abort(tls)
}
}()
if _2_pDel != nil {
_sqlite3OomFault(tls, _db)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_pDel))
_pColl = nil
}
_2:
_1:
return _pColl
}
// 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 _sqlite3HashFind(tls *crt.TLS, _pH *XHash, _pKey *int8) (r0 unsafe.Pointer) {
var _h uint32
var _elem *XHashElem
func() {
if _pH == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29445), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000))), unsafe.Pointer(str(21170)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pKey == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29446), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HashFindØ00__func__Ø000))), unsafe.Pointer(str(21605)))
crt.X__builtin_abort(tls)
}
}()
_elem = _findElementWithHash(tls, _pH, _pKey, &_h)
return func() unsafe.Pointer {
if _elem != nil {
return _elem.X2
}
return nil
}()
_ = _h
panic(0)
}
var _sqlite3HashFindØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HashFindØ00__func__Ø000[0], str(24062), 16)
}
var _findCollSeqEntryØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_findCollSeqEntryØ00__func__Ø000[0], str(24078), 17)
}
var _sqlite3FindCollSeqØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FindCollSeqØ00__func__Ø000[0], str(24095), 19)
}
// Register a new collation sequence with the database handle db.
func Xsqlite3_create_collation16(tls *crt.TLS, _db *Xsqlite3, _zName unsafe.Pointer, _enc int32, _pCtx unsafe.Pointer, _xCompare func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) (r0 int32) {
var _rc int32
var _zName8 *int8
_rc = i32(0)
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
return _sqlite3MisuseError(tls, i32(143696))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143699), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_collation16Ø00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
_zName8 = _sqlite3Utf16to8(tls, _db, _zName, i32(-1), uint8(i32(2)))
if _zName8 != nil {
_rc = _createCollation(tls, _db, _zName8, uint8(_enc), _pCtx, _xCompare, nil)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName8))
}
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_create_collation16Ø00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_create_collation16Ø00__func__Ø000[0], str(24114), 27)
}
// Convert a UTF-16 string in the native encoding into a UTF-8 string.
// Memory to hold the UTF-8 string is obtained from sqlite3_malloc and must
// be freed by the calling function.
//
// NULL is returned if there is an allocation error.
func _sqlite3Utf16to8(tls *crt.TLS, _db *Xsqlite3, _z unsafe.Pointer, _nByte int32, _enc uint8) (r0 *int8) {
var _m XMem
crt.Xmemset(tls, (unsafe.Pointer)(&_m), i32(0), u32(48))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_m.X9))))) = _db
_sqlite3VdbeMemSetStr(tls, &_m, (*int8)(_z), _nByte, _enc, nil)
_sqlite3VdbeChangeEncoding(tls, &_m, i32(1))
if (_db.X17) != 0 {
_sqlite3VdbeMemRelease(tls, &_m)
*(**int8)(unsafe.Pointer(&(_m.X5))) = nil
}
func() {
if (int32(_m.X1)&i32(512)) == i32(0) && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27570), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24141)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_m.X1)&i32(2)) == i32(0) && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24185)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_m.X5) == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf16to8Ø00__func__Ø000))), unsafe.Pointer(str(24228)))
crt.X__builtin_abort(tls)
}
}()
return _m.X5
_ = _m
panic(0)
}
var _sqlite3Utf16to8Ø00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3Utf16to8Ø00__func__Ø000[0], str(24252), 16)
}
// Create new user functions.
func Xsqlite3_create_function(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nArg int32, _enc int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context)) (r0 int32) {
return Xsqlite3_create_function_v2(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, nil)
}
func Xsqlite3_create_function_v2(tls *crt.TLS, _db *Xsqlite3, _zFunc *int8, _nArg int32, _enc int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context), _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _rc int32
var _pArg *XFuncDestructor
_rc = i32(1)
_pArg = nil
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(142198))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _xDestroy == nil {
goto _1
}
_pArg = (*XFuncDestructor)(_sqlite3DbMallocZero(tls, _db, uint64(u32(12))))
if _pArg == nil {
_xDestroy(tls, _p)
goto _out
}
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pArg.X1))) = _xDestroy
*(*unsafe.Pointer)(unsafe.Pointer(&(_pArg.X2))) = _p
_1:
_rc = _sqlite3CreateFunc(tls, _db, _zFunc, _nArg, _enc, _p, _xSFunc, _xStep, _xFinal, _pArg)
if (_pArg != nil) && ((_pArg.X0) == i32(0)) {
func() {
if _rc == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142213), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_function_v2Ø00__func__Ø000))), unsafe.Pointer(str(18512)))
crt.X__builtin_abort(tls)
}
}()
_xDestroy(tls, _p)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pArg))
}
_out:
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// 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 _sqlite3CreateFunc(tls *crt.TLS, _db *Xsqlite3, _zFunctionName *int8, _nArg int32, _enc int32, _pUserData unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context), _pDestructor *XFuncDestructor) (r0 int32) {
var _nName, _extraFlags, _3_rc int32
var _p *XFuncDef
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142084), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if (((((_zFunctionName == nil) || ((_xSFunc != nil) && ((_xFinal != nil) || (_xStep != nil)))) || ((_xSFunc == nil) && ((_xFinal != nil) && (_xStep == nil)))) || ((_xSFunc == nil) && ((_xFinal == nil) && (_xStep != nil)))) || ((_nArg < i32(-1)) || (_nArg > i32(127)))) || (i32(255) < store1(&_nName, _sqlite3Strlen30(tls, _zFunctionName))) {
return _sqlite3MisuseError(tls, i32(142091))
}
i32(0)
_extraFlags = _enc & i32(2048)
{
p := &_enc
*p = (*p) & i32(7)
sink1 = *p
}
if _enc == i32(4) {
_enc = i32(2)
goto _17
}
if _enc != i32(5) {
goto _17
}
_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, i32(1)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
if _3_rc == i32(0) {
_3_rc = _sqlite3CreateFunc(tls, _db, _zFunctionName, _nArg, i32(2)|_extraFlags, _pUserData, _xSFunc, _xStep, _xFinal, _pDestructor)
}
if _3_rc != i32(0) {
return _3_rc
}
_enc = i32(3)
_17:
_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), uint8(i32(0)))
if _p == nil || (int32(_p.X1)&i32(3)) != _enc || int32(_p.X0) != _nArg {
goto _22
}
if (_db.X34) != 0 {
_sqlite3ErrorWithMsg(tls, _db, i32(5), str(24268))
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
return i32(5)
}
_sqlite3ExpirePreparedStatements(tls, _db)
_22:
_p = _sqlite3FindFunction(tls, _db, _zFunctionName, _nArg, uint8(_enc), uint8(i32(1)))
func() {
if _p == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142143), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateFuncØ00__func__Ø000))), unsafe.Pointer(str(24331)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return _sqlite3NomemError(tls, i32(142145))
}
_functionDestroy(tls, _db, _p)
if _pDestructor != nil {
*(*int32)(unsafe.Pointer(&(_pDestructor.X0))) += 1
}
*(**XFuncDestructor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X7))))))) = _pDestructor
*(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16((int32(_p.X1) & i32(3)) | _extraFlags)
*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&(_p.X4))))) = func() func(*crt.TLS, *Xsqlite3_context, int32, **XMem) {
if _xSFunc != nil {
return _xSFunc
}
return _xStep
}()
*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_p.X5))))) = _xFinal
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = _pUserData
*(*int8)(unsafe.Pointer(&(_p.X0))) = int8(uint16(_nArg))
return i32(0)
_ = _nName
panic(0)
}
var _sqlite3CreateFuncØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CreateFuncØ00__func__Ø000[0], str(24353), 18)
}
// 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 _sqlite3FindFunction(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32, _enc uint8, _createFlag uint8) (r0 *XFuncDef) {
var _bestScore, _h, _nName, _1_score, _4_score int32
var _p, _pBest, _6_pOther *XFuncDef
_pBest = nil
_bestScore = i32(0)
func() {
if _nArg < i32(-2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104504), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000))), unsafe.Pointer(str(24371)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nArg < i32(-1) && int32(_createFlag) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104505), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindFunctionØ00__func__Ø000))), unsafe.Pointer(str(24382)))
crt.X__builtin_abort(tls)
}
}()
_nName = _sqlite3Strlen30(tls, _zName)
_p = (*XFuncDef)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X69))), _zName))
_5:
if _p == nil {
goto _6
}
_1_score = _matchQuality(tls, _p, _nArg, _enc)
if _1_score > _bestScore {
_pBest = _p
_bestScore = _1_score
}
_p = (*XFuncDef)(_p.X3)
goto _5
_6:
if _createFlag != 0 || _pBest != nil && ((_db.X6)&i32(2097152)) == i32(0) {
goto _10
}
_bestScore = i32(0)
_h = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(i32(0))))))))) + _nName) % i32(23)
_p = _functionSearch(tls, _h, _zName)
_11:
if _p == nil {
goto _12
}
_4_score = _matchQuality(tls, _p, _nArg, _enc)
if _4_score > _bestScore {
_pBest = _p
_bestScore = _4_score
}
_p = (*XFuncDef)(_p.X3)
goto _11
_12:
_10:
if _createFlag == 0 || _bestScore >= i32(6) || store33(&_pBest, (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, uint64((u32(28)+uint32(_nName))+uint32(i32(1)))))) == nil {
goto _16
}
*(**int8)(unsafe.Pointer(&(_pBest.X6))) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pBest)) + 28*uintptr(i32(1))))))
*(*int8)(unsafe.Pointer(&(_pBest.X0))) = int8(uint16(_nArg))
*(*uint16)(unsafe.Pointer(&(_pBest.X1))) = uint16(_enc)
crt.Xmemcpy(tls, (unsafe.Pointer)((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pBest))+28*uintptr(i32(1))))), (unsafe.Pointer)(_zName), uint32(_nName+i32(1)))
_6_pOther = (*XFuncDef)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X69))), _pBest.X6, (unsafe.Pointer)(_pBest)))
if _6_pOther == _pBest {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pBest))
_sqlite3OomFault(tls, _db)
return nil
}
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBest.X3))))) = _6_pOther
_16:
if (_pBest != nil) && (((*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
}{(_pBest.X4)}))) != nil) || (_createFlag != 0)) {
return _pBest
}
return nil
}
var _sqlite3FindFunctionØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FindFunctionØ00__func__Ø000[0], str(24410), 20)
}
// The score for a perfect match
func _matchQuality(tls *crt.TLS, _p *XFuncDef, _nArg int32, _enc uint8) (r0 int32) {
var _match int32
if _nArg == i32(-2) {
return func() int32 {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{(*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
}{(_p.X4)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{nil})) {
return i32(0)
}
return i32(6)
}()
}
if (int32(_p.X0) != _nArg) && (int32(_p.X0) >= i32(0)) {
return i32(0)
}
if int32(_p.X0) == _nArg {
_match = i32(4)
goto _6
}
_match = i32(1)
_6:
if int32(_enc) == (int32(_p.X1) & i32(3)) {
{
p := &_match
*p = (*p) + i32(2)
sink1 = *p
}
goto _9
}
if ((int32(_enc) & int32(_p.X1)) & i32(2)) != i32(0) {
{
p := &_match
*p = (*p) + i32(1)
sink1 = *p
}
}
_9:
return _match
}
var _sqlite3_create_function_v2Ø00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_create_function_v2Ø00__func__Ø000[0], str(24430), 27)
}
func Xsqlite3_create_function16(tls *crt.TLS, _db *Xsqlite3, _zFunctionName unsafe.Pointer, _nArg int32, _eTextRep int32, _p unsafe.Pointer, _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xStep func(*crt.TLS, *Xsqlite3_context, int32, **XMem), _xFinal func(*crt.TLS, *Xsqlite3_context)) (r0 int32) {
var _rc int32
var _zFunc8 *int8
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zFunctionName == nil) {
return _sqlite3MisuseError(tls, i32(142239))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142242), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_create_function16Ø00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
_zFunc8 = _sqlite3Utf16to8(tls, _db, _zFunctionName, i32(-1), uint8(i32(2)))
_rc = _sqlite3CreateFunc(tls, _db, _zFunc8, _nArg, _eTextRep, _p, _xSFunc, _xStep, _xFinal, nil)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zFunc8))
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_create_function16Ø00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_create_function16Ø00__func__Ø000[0], str(24457), 26)
}
// External API function used to create a new virtual-table module.
func Xsqlite3_create_module(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer) (r0 int32) {
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
return _sqlite3MisuseError(tls, i32(125090))
}
return _createModule(tls, _db, _zName, _pModule, _pAux, nil)
}
// The actual function that does the work of creating a new module.
// This function implements the sqlite3_create_module() and
// sqlite3_create_module_v2() interfaces.
func _createModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _rc int32
_rc = i32(0)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zName) != nil {
_rc = _sqlite3MisuseError(tls, i32(125069))
goto _1
}
_sqlite3VtabCreateModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
_1:
_rc = _sqlite3ApiExit(tls, _db, _rc)
if (_rc != i32(0)) && (_xDestroy != nil) {
_xDestroy(tls, _pAux)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// Construct and install a Module object for a virtual table. When this
// routine is called, it is guaranteed that all appropriate locks are held
// and the module is not already part of the connection.
func _sqlite3VtabCreateModule(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 *XModule) {
var _nName int32
var _1_zCopy *int8
var _pMod, _1_pDel *XModule
_nName = _sqlite3Strlen30(tls, _zName)
_pMod = (*XModule)(_sqlite3DbMallocRawNN(tls, _db, uint64((u32(20)+uint32(_nName))+uint32(i32(1)))))
if _pMod == nil {
goto _0
}
_1_zCopy = (*int8)(unsafe.Pointer((*XModule)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMod)) + 20*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_1_zCopy), (unsafe.Pointer)(_zName), uint32(_nName+i32(1)))
*(**int8)(unsafe.Pointer(&(_pMod.X1))) = _1_zCopy
*(**Xsqlite3_module)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X0))))) = _pModule
*(*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X2))) = _pAux
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pMod.X3))) = _xDestroy
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = nil
_1_pDel = (*XModule)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _1_zCopy, (unsafe.Pointer)(_pMod)))
func() {
if _1_pDel != nil && _1_pDel != _pMod {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125043), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCreateModuleØ00__func__Ø000))), unsafe.Pointer(str(24483)))
crt.X__builtin_abort(tls)
}
}()
if _1_pDel != nil {
_sqlite3OomFault(tls, _db)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pDel))
_pMod = nil
}
_0:
return _pMod
}
var _sqlite3VtabCreateModuleØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabCreateModuleØ00__func__Ø000[0], str(24505), 24)
}
// Return the number of values available from the current row of the
// currently executing statement pStmt.
func Xsqlite3_data_count(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _pVm *TVdbe
_pVm = (*TVdbe)(_pStmt)
if (_pVm == nil) || ((*XMem)(_pVm.X21) == nil) {
return i32(0)
}
return int32(_pVm.X29)
}
// Return the sqlite3* database handle to which the prepared statement given
// in the argument belongs. This is the same database handle that was
// the first argument to the sqlite3_prepare() that was used to create
// the statement in the first place.
func Xsqlite3_db_handle(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *Xsqlite3) {
return func() *Xsqlite3 {
if _pStmt != nil {
return (*Xsqlite3)((*TVdbe)(_pStmt).X0)
}
return nil
}()
}
// This function is used to set the schema of a virtual table. It is only
// valid to call this function from within the xCreate() or xConnect() of a
// virtual table module.
func Xsqlite3_declare_vtab(tls *crt.TLS, _db *Xsqlite3, _zCreateTable *int8) (r0 int32) {
var _rc int32
var _zErr *int8
var _pTab, _6_pNew *XTable
var _pParse *XParse
var _6_pIdx *XIndex
var _pCtx *XVtabCtx
_rc = i32(0)
_zErr = nil
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zCreateTable == nil) {
return _sqlite3MisuseError(tls, i32(125730))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pCtx = (*XVtabCtx)(_db.X66)
if (_pCtx == nil) || (_pCtx.X3) != 0 {
_sqlite3Error(tls, _db, i32(21))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _sqlite3MisuseError(tls, i32(125738))
}
_pTab = (*XTable)(_pCtx.X1)
func() {
if (_pTab.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125741), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24529)))
crt.X__builtin_abort(tls)
}
}()
_pParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(u32(484))))
if _pParse == nil {
_rc = _sqlite3NomemError(tls, i32(125745))
goto _7
}
*(*uint8)(unsafe.Pointer(&(_pParse.X55))) = uint8(i32(1))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X0))))) = _db
*(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(i32(1))
if i32(0) != _sqlite3RunParser(tls, _pParse, _zCreateTable, &_zErr) || (*XTable)(_pParse.X63) == nil || (_db.X17) != 0 || (*XSelect)((*XTable)(_pParse.X63).X3) != nil || ((*XTable)(_pParse.X63).X16) != 0 {
goto _12
}
if (*XColumn)(_pTab.X1) != nil {
goto _13
}
_6_pNew = (*XTable)(_pParse.X63)
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1))))) = (*XColumn)(_6_pNew.X1)
*(*int16)(unsafe.Pointer(&(_pTab.X11))) = _6_pNew.X11
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | ((_6_pNew.X9) & uint32(i32(96)))
sink5 = *p
}
*(*int16)(unsafe.Pointer(&(_6_pNew.X11))) = int16(i32(0))
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X1))))) = nil
func() {
if (*XIndex)(_pTab.X2) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24545)))
crt.X__builtin_abort(tls)
}
}()
if (((_6_pNew.X9) & uint32(i32(32))) != uint32(i32(0))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32
}{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
}{((*Xsqlite3_module)((*XModule)((*XVTable)(_pCtx.X0).X1).X0).X13)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32
}{nil}))) {
_rc = i32(1)
}
_6_pIdx = (*XIndex)(_6_pNew.X2)
if _6_pIdx != nil {
func() {
if (*XIndex)(_6_pIdx.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24561)))
crt.X__builtin_abort(tls)
}
}()
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _6_pIdx
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pNew.X2))))) = nil
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pIdx.X3))))) = _pTab
}
_13:
*(*int32)(unsafe.Pointer(&(_pCtx.X3))) = i32(1)
goto _21
_12:
_sqlite3ErrorWithMsg(tls, _db, i32(1), func() *int8 {
if _zErr != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_zErr))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_rc = i32(1)
_21:
*(*uint8)(unsafe.Pointer(&(_pParse.X55))) = uint8(i32(0))
if (*TVdbe)(_pParse.X2) != nil {
_sqlite3VdbeFinalize(tls, (*TVdbe)(_pParse.X2))
}
_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.X63))
_sqlite3ParserReset(tls, _pParse)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse))
_7:
func() {
if (_rc & i32(255)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125793), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_declare_vtabØ00__func__Ø000))), unsafe.Pointer(str(24579)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_declare_vtabØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_declare_vtabØ00__func__Ø000[0], str(24593), 21)
}
// Run the parser on the given SQL string. The parser structure is
// passed in. An SQLITE_ status code is returned. If an error occurs
// then an and attempt is made to write an error message into
// memory obtained from sqlite3_malloc() and to make *pzErrMsg point to that
// error message.
func _sqlite3RunParser(tls *crt.TLS, _pParse *XParse, _zSql *int8, _pzErrMsg **int8) (r0 int32) {
var _nErr, _n, _tokenType, _lastTokenParsed, _mxSqlLen int32
var _pEngine unsafe.Pointer
var _db *Xsqlite3
var _20_p *XTable
var _19_p *TAggInfo_func
var _sEngine XyyParser
_nErr = i32(0)
_n = i32(0)
_lastTokenParsed = i32(-1)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _zSql == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139953), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24614)))
crt.X__builtin_abort(tls)
}
}()
_mxSqlLen = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(1))))
if (_db.X34) == i32(0) {
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0)
}
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(0)
*(**int8)(unsafe.Pointer(&(_pParse.X62))) = _zSql
func() {
if _pzErrMsg == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24622)))
crt.X__builtin_abort(tls)
}
}()
_pEngine = (unsafe.Pointer)(&_sEngine)
_sqlite3ParserInit(tls, _pEngine)
func() {
if (*XTable)(_pParse.X63) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139972), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24634)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTrigger)(_pParse.X64) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24655)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pParse.X52) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139974), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24678)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pParse.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24694)))
crt.X__builtin_abort(tls)
}
}()
_13:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == i32(0) {
goto _15
}
_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
{
p := &_mxSqlLen
*p = (*p) - _n
sink1 = *p
}
if _mxSqlLen < i32(0) {
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(18)
goto _14
}
goto _17
_15:
if _lastTokenParsed == i32(1) {
_tokenType = i32(0)
goto _21
}
if _lastTokenParsed == i32(0) {
goto _14
}
_tokenType = i32(1)
_21:
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_n)))
sink0 = *p
}
_17:
if _tokenType < i32(163) {
goto _22
}
func() {
if _tokenType != i32(163) && _tokenType != i32(164) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139997), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24712)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 {
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(9)
goto _14
}
if _tokenType == i32(164) {
_sqlite3ErrorMsg(tls, _pParse, str(24757), _n, unsafe.Pointer(_zSql))
goto _14
}
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink0 = *p
}
goto _28
_22:
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))) = _zSql
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1))) = uint32(_n)
_sqlite3Parser(tls, _pEngine, _tokenType, _pParse.X51, _pParse)
_lastTokenParsed = _tokenType
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink0 = *p
}
if ((_pParse.X3) != i32(0)) || ((_db.X17) != 0) {
goto _14
}
_28:
goto _13
_14:
func() {
if _nErr != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140016), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24784)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pParse.X62))) = _zSql
_sqlite3ParserFinalize(tls, _pEngine)
if (_db.X17) != 0 {
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = _sqlite3NomemError(tls, i32(140031))
}
if (((_pParse.X3) != i32(0)) && ((_pParse.X3) != i32(101))) && ((_pParse.X1) == nil) {
*(**int8)(unsafe.Pointer(&(_pParse.X1))) = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _pParse.X3)))
}
func() {
if _pzErrMsg == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140036), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24622)))
crt.X__builtin_abort(tls)
}
}()
if (_pParse.X1) != nil {
*_pzErrMsg = _pParse.X1
Xsqlite3_log(tls, _pParse.X3, str(24576), unsafe.Pointer(*_pzErrMsg))
*(**int8)(unsafe.Pointer(&(_pParse.X1))) = nil
_nErr += 1
}
if (((*TVdbe)(_pParse.X2) != nil) && ((_pParse.X16) > i32(0))) && (int32(_pParse.X6) == i32(0)) {
_sqlite3VdbeDelete(tls, (*TVdbe)(_pParse.X2))
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X2))))) = nil
}
if int32(_pParse.X6) == i32(0) {
_sqlite3DbFree(tls, _db, _pParse.X37)
*(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X37))))) = nil
*(*int32)(unsafe.Pointer(&(_pParse.X36))) = i32(0)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_pParse.X67))
if (_pParse.X55) == 0 {
_sqlite3DeleteTable(tls, _db, (*XTable)(_pParse.X63))
}
if (*XWith)(_pParse.X71) != nil {
_sqlite3WithDelete(tls, _db, (*XWith)(_pParse.X71))
}
_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_pParse.X64))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse.X60))
_46:
if (*TAggInfo_func)(_pParse.X38) != nil {
_19_p = (*TAggInfo_func)(_pParse.X38)
*(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X38))))) = (*TAggInfo_func)(_19_p.X0)
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_19_p))
goto _46
}
_47:
if (*XTable)(_pParse.X68) != nil {
_20_p = (*XTable)(_pParse.X68)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X68))))) = (*XTable)(_20_p.X21)
_sqlite3DeleteTable(tls, _db, _20_p)
goto _47
}
func() {
if _nErr != i32(0) && (_pParse.X3) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(140079), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunParserØ00__func__Ø000))), unsafe.Pointer(str(24792)))
crt.X__builtin_abort(tls)
}
}()
return _nErr
_ = _sEngine
panic(0)
}
var _sqlite3RunParserØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RunParserØ00__func__Ø000[0], str(24825), 17)
}
// Initialize a new parser that has already been allocated.
func _sqlite3ParserInit(tls *crt.TLS, _yypParser unsafe.Pointer) {
var _pParser *XyyParser
_pParser = (*XyyParser)(_yypParser)
*(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParser.X0))))) = (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2)))))
*(*uint16)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))) + 16*uintptr(i32(0)))).X0))) = uint16(i32(0))
*(*uint8)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))) + 16*uintptr(i32(0)))).X1))) = uint8(i32(0))
}
// 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 _sqlite3ErrorMsg(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
var _zMsg *int8
var _ap []interface{}
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
_ap = args
_zMsg = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
_ap = nil
if (_db.X21) != 0 {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zMsg))
goto _1
}
*(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse.X1))
*(**int8)(unsafe.Pointer(&(_pParse.X1))) = _zMsg
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1)
_1:
}
// The main parser program.
// The first argument is a pointer to a structure obtained from
// "sqlite3ParserAlloc" which describes the current state of the parser.
// The second argument is the major token number. The third is
// the minor token. The fourth optional argument is whatever the
// user wants (and specified in the grammar) and is available for
// use by the action routines.
//
// Inputs:
//
// - A pointer to the parser (an opaque structure.)
//
- The major token number.
//
- The minor token number.
//
- An option argument of a grammar-specified type.
//
//
// Outputs:
// None.
func _sqlite3Parser(tls *crt.TLS, _yyp unsafe.Pointer, _yymajor int32, _yyminor XToken, _pParse *XParse) {
var _7_cDiv int8
var _yyact uint32
var _yypParser *XyyParser
var _yyminorunion XYYMINORTYPE
var _7_i *XyyStackEntry
_yypParser = (*XyyParser)(_yyp)
func() {
if (*XyyStackEntry)(_yypParser.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139035), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000))), unsafe.Pointer(str(24842)))
crt.X__builtin_abort(tls)
}
}()
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(24862), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_yymajor)))))
}
_2:
_yyact = _yy_find_shift_action(tls, _yypParser, uint8(_yymajor))
if _yyact <= uint32(i32(999)) {
_yy_shift(tls, _yypParser, int32(_yyact), _yymajor, _yyminor)
_yymajor = i32(252)
goto _7
}
if _yyact <= uint32(i32(1331)) {
_yy_reduce(tls, _yypParser, _yyact-uint32(i32(1000)))
goto _7
}
func() {
if _yyact != uint32(i32(1332)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(139058), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParserØ00__func__Ø000))), unsafe.Pointer(str(24876)))
crt.X__builtin_abort(tls)
}
}()
*(*XToken)(unsafe.Pointer(&_yyminorunion)) = _yyminor
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(24901), unsafe.Pointer(_yyTracePrompt))
}
_yy_syntax_error(tls, _yypParser, _yymajor, _yyminor)
_yy_destructor(tls, _yypParser, uint8(_yymajor), &_yyminorunion)
_yymajor = i32(252)
_7:
if (_yymajor != i32(252)) && (uintptr(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))))) {
goto _2
}
if _yyTraceFILE == nil {
goto _12
}
_7_cDiv = i8(91)
crt.Xfprintf(tls, _yyTraceFILE, str(24918), unsafe.Pointer(_yyTracePrompt))
_7_i = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))) + 16*uintptr(i32(1))))
_13:
if uintptr(unsafe.Pointer(_7_i)) > uintptr(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) {
goto _16
}
crt.Xfprintf(tls, _yyTraceFILE, str(24935), int32(_7_cDiv), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_7_i.X1)))))
_7_cDiv = int8(i32(32))
*(*uintptr)(unsafe.Pointer(&_7_i)) += uintptr(16)
goto _13
_16:
crt.Xfprintf(tls, _yyTraceFILE, str(24940))
_12:
_ = _yyminorunion
}
var _sqlite3ParserØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ParserØ00__func__Ø000[0], str(24943), 14)
}
var _yyTraceFILE *crt.XFILE
var _yyTracePrompt *int8
var _yyTokenName [251]*int8
func init() {
_yyTokenName = [251]*int8{str(24957), str(24959), str(24964), str(24972), str(24978), str(24983), str(24989), str(25001), str(25010), str(25020), str(25030), str(25037), str(25041), str(25050), str(25060), str(25068), str(25071), str(25077), str(25084), str(25087), str(25091), str(25098), str(25103), str(25106), str(25109), str(25112), str(25120), str(25126), str(25129), str(25135), str(25142), str(25148), str(25156), str(25160), str(25167), str(25174), str(25177), str(25185), str(25190), str(25199), str(25208), str(25217), str(25222), str(25229), str(25234), str(25239), str(25243), str(25250), str(25260), str(25268), str(25276), str(25282), str(25285), str(25289), str(25292), str(25299), str(25306), str(25312), str(25322), str(25330), str(25339), str(25343), str(25351), str(25358), str(25363), str(25371), str(25376), str(25384), str(25391), str(25400), str(25404), str(25407), str(25411), str(25414), str(25422), str(25425), str(25432), str(25440), str(25443), str(25446), str(25449), str(25452), str(25455), str(25458), str(25465), str(25472), str(25478), str(25485), str(25492), str(25497), str(25503), str(25508), str(25514), str(25518), str(25525), str(25533), str(25540), str(25548), str(25555), str(25563), str(25574), str(155), str(25582), str(25590), str(25597), str(25603), str(25614), str(25623), str(25626), str(25633), str(25640), str(25647), str(25651), str(25662), str(25670), str(25675), str(25681), str(25685), str(25692), str(25702), str(25709), str(25716), str(25725), str(25729), str(25734), str(25739), str(25745), str(25751), str(25757), str(25764), str(25770), str(25776), str(25781), str(25787), str(25792), str(25800), str(25809), str(25814), str(25819), str(25824), str(25829), str(25835), str(25841), str(25845), str(25851), str(25857), str(25865), str(23861), str(25870), str(25875), str(25879), str(25889), str(25899), str(25902), str(25916), str(25929), str(25947), str(23842), str(25956), str(25968), str(25973), str(25984), str(25997), str(26011), str(26018), str(26029), str(26038), str(26048), str(26057), str(26064), str(26073), str(26083), str(26089), str(26094), str(26099), str(26106), str(26116), str(26124), str(26136), str(26144), str(26160), str(26167), str(26174), str(26197), str(26206), str(26217), str(26223), str(26232), str(26240), str(26260), str(26267), str(26279), str(26289), str(26298), str(26307), str(26320), str(26330), str(26335), str(26350), str(26359), str(26370), str(26375), str(26385), str(26397), str(26408), str(26420), str(26430), str(26437), str(26447), str(26456), str(26461), str(26464), str(26475), str(26486), str(26493), str(26505), str(26512), str(26522), str(26529), str(26537), str(26548), str(26559), str(26566), str(26577), str(26583), str(26598), str(26611), str(26625), str(26635), str(26646), str(26654), str(26660), str(26673), str(26690), str(26703), str(26717), str(26732), str(26744), str(26756), str(26761), str(26769), str(26785), str(26793), str(26813), str(26826), str(26838), str(26850), str(26858), str(26871), str(26874), str(26882)}
}
// Find the appropriate action for a parser given the terminal
// look-ahead token iLookAhead.
func _yy_find_shift_action(tls *crt.TLS, _pParser *XyyParser, _iLookAhead uint8) (r0 uint32) {
var _i, _stateno, _5_j int32
var _2_iFallback uint8
_stateno = int32((*XyyStackEntry)(_pParser.X0).X0)
if _stateno >= i32(1000) {
return uint32(_stateno)
}
func() {
if _stateno > i32(455) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137121), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000))), unsafe.Pointer(str(26889)))
crt.X__builtin_abort(tls)
}
}()
_3:
_i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_shift_ofst)) + 2*uintptr(_stateno))))
func() {
if int32(_iLookAhead) == i32(252) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137124), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000))), unsafe.Pointer(str(26915)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_i
*p = (*p) + int32(_iLookAhead)
sink1 = *p
}
if _i >= i32(0) && _i < i32(1566) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_i)))) == int32(_iLookAhead) {
goto _8
}
if uint32(_iLookAhead) >= u32(69) || int32(store2(&_2_iFallback, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyFallback)) + 1*uintptr(_iLookAhead))))) == i32(0) {
goto _10
}
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(26936), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_2_iFallback)))))
}
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyFallback)) + 1*uintptr(_2_iFallback)))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137137), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_shift_actionØ00__func__Ø000))), unsafe.Pointer(str(26957)))
crt.X__builtin_abort(tls)
}
}()
_iLookAhead = _2_iFallback
goto _3
_10:
_5_j = (_i - int32(_iLookAhead)) + i32(69)
if _5_j < i32(0) || _5_j >= i32(1566) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_5_j)))) != i32(69) || int32(_iLookAhead) <= i32(0) {
goto _17
}
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(26982), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_iLookAhead)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(i32(69))))))
}
return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_5_j))))
_17:
return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_default)) + 2*uintptr(_stateno))))
_8:
return uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_i))))
}
var _yy_find_shift_actionØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_yy_find_shift_actionØ00__func__Ø000[0], str(27003), 21)
}
var _yy_shift_ofst [456]int16
func init() {
_yy_shift_ofst = [456]int16{i16(5), i16(1117), i16(1312), i16(1128), i16(1274), i16(1274), i16(1274), i16(1274), i16(61), i16(-19), i16(57), i16(57), i16(183), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(66), i16(66), i16(201), i16(-29), i16(331), i16(318), i16(133), i16(259), i16(335), i16(411), i16(487), i16(563), i16(639), i16(689), i16(765), i16(841), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(891), i16(941), i16(891), i16(991), i16(1041), i16(1041), i16(1217), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1363), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(1274), i16(-70), i16(-47), i16(-47), i16(-47), i16(-47), i16(-47), i16(24), i16(11), i16(146), i16(296), i16(524), i16(444), i16(529), i16(529), i16(296), i16(3), i16(2), i16(-30), i16(1566), i16(1566), i16(1566), i16(-17), i16(-17), i16(-17), i16(145), i16(145), i16(497), i16(497), i16(265), i16(603), i16(653), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(701), i16(1078), i16(147), i16(147), i16(2), i16(164), i16(164), i16(164), i16(164), i16(164), i16(164), i16(1566), i16(1566), i16(1566), i16(223), i16(56), i16(56), i16(268), i16(269), i16(220), i16(347), i16(351), i16(415), i16(359), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(632), i16(632), i16(632), i16(296), i16(296), i16(498), i16(296), i16(296), i16(296), i16(570), i16(296), i16(296), i16(654), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(296), i16(636), i16(200), i16(596), i16(596), i16(596), i16(575), i16(-114), i16(971), i16(740), i16(454), i16(503), i16(503), i16(1134), i16(454), i16(1134), i16(353), i16(588), i16(628), i16(762), i16(503), i16(189), i16(762), i16(762), i16(916), i16(330), i16(668), i16(1245), i16(1167), i16(1167), i16(1255), i16(1255), i16(1167), i16(1277), i16(1230), i16(1172), i16(1291), i16(1291), i16(1291), i16(1291), i16(1167), i16(1310), i16(1172), i16(1277), i16(1230), i16(1230), i16(1172), i16(1167), i16(1310), i16(1204), i16(1299), i16(1167), i16(1167), i16(1310), i16(1335), i16(1167), i16(1310), i16(1167), i16(1310), i16(1335), i16(1258), i16(1258), i16(1258), i16(1329), i16(1335), i16(1258), i16(1273), i16(1258), i16(1329), i16(1258), i16(1258), i16(1256), i16(1288), i16(1256), i16(1288), i16(1256), i16(1288), i16(1256), i16(1288), i16(1167), i16(1375), i16(1167), i16(1267), i16(1335), i16(1320), i16(1320), i16(1335), i16(1287), i16(1295), i16(1294), i16(1301), i16(1172), i16(1407), i16(1408), i16(1422), i16(1422), i16(1433), i16(1433), i16(1433), i16(1433), i16(1566), i16(1566), i16(1566), i16(1566), i16(1566), i16(1566), i16(1566), i16(1566), i16(558), i16(537), i16(684), i16(719), i16(734), i16(799), i16(840), i16(1019), i16(14), i16(1020), i16(1021), i16(1025), i16(1026), i16(1027), i16(1070), i16(1072), i16(997), i16(1047), i16(999), i16(1079), i16(1126), i16(1074), i16(1141), i16(694), i16(819), i16(1174), i16(1136), i16(981), i16(1445), i16(1451), i16(1434), i16(1313), i16(1448), i16(1398), i16(1450), i16(1444), i16(1446), i16(1348), i16(1339), i16(1360), i16(1349), i16(1453), i16(1350), i16(1458), i16(1475), i16(1354), i16(1347), i16(1401), i16(1402), i16(1403), i16(1404), i16(1372), i16(1388), i16(1452), i16(1364), i16(1484), i16(1483), i16(1467), i16(1383), i16(1351), i16(1439), i16(1468), i16(1440), i16(1441), i16(1457), i16(1395), i16(1479), i16(1485), i16(1487), i16(1392), i16(1405), i16(1486), i16(1455), i16(1489), i16(1490), i16(1491), i16(1493), i16(1461), i16(1480), i16(1494), i16(1465), i16(1481), i16(1495), i16(1496), i16(1498), i16(1497), i16(1406), i16(1502), i16(1503), i16(1505), i16(1499), i16(1409), i16(1506), i16(1507), i16(1432), i16(1500), i16(1510), i16(1410), i16(1511), i16(1501), i16(1512), i16(1504), i16(1517), i16(1511), i16(1518), i16(1519), i16(1520), i16(1521), i16(1522), i16(1524), i16(1533), i16(1525), i16(1527), i16(1509), i16(1526), i16(1528), i16(1531), i16(1530), i16(1526), i16(1532), i16(1534), i16(1535), i16(1536), i16(1538), i16(1428), i16(1435), i16(1442), i16(1443), i16(1539), i16(1546), i16(1562)}
}
var _yy_lookahead [1566]uint8
func init() {
_yy_lookahead = [1566]uint8{19, 115, 19, 117, 118, 24, 1, 2, 27, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 144, 145, 146, 147, 58, 49, 50, 79, 80, 81, 82, 22, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 221, 222, 223, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 94, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 94, 97, 108, 109, 110, 99, 100, 101, 102, 103, 104, 105, 32, 119, 120, 78, 27, 152, 112, 93, 94, 41, 88, 89, 90, 91, 92, 93, 94, 49, 50, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 58, 157, 119, 120, 163, 68, 163, 65, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 97, 88, 89, 196, 101, 196, 26, 172, 173, 96, 97, 98, 210, 100, 22, 152, 108, 109, 110, 27, 107, 27, 109, 221, 222, 223, 219, 238, 219, 49, 50, 152, 169, 170, 54, 132, 133, 134, 228, 232, 171, 231, 207, 208, 237, 132, 237, 134, 179, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 27, 65, 30, 152, 49, 50, 34, 52, 90, 91, 92, 93, 94, 96, 97, 98, 97, 22, 230, 27, 48, 217, 27, 172, 173, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 172, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 148, 149, 152, 218, 24, 152, 154, 207, 156, 172, 152, 22, 68, 27, 152, 163, 27, 164, 96, 97, 98, 99, 172, 173, 102, 103, 104, 169, 170, 49, 50, 90, 88, 89, 152, 113, 186, 96, 97, 98, 96, 97, 160, 57, 27, 101, 164, 137, 196, 139, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 11, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 132, 133, 134, 23, 218, 152, 96, 97, 98, 96, 97, 98, 230, 99, 22, 152, 102, 103, 104, 27, 244, 152, 152, 27, 26, 152, 22, 113, 65, 49, 50, 27, 194, 195, 58, 172, 173, 96, 97, 98, 185, 65, 172, 173, 206, 172, 173, 190, 191, 186, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 175, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 175, 207, 208, 23, 207, 208, 119, 120, 108, 109, 110, 27, 96, 97, 98, 116, 96, 97, 98, 152, 121, 152, 179, 180, 96, 97, 98, 250, 106, 49, 50, 188, 19, 221, 222, 223, 168, 169, 170, 172, 173, 172, 173, 250, 124, 172, 221, 222, 223, 26, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 50, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 207, 208, 12, 23, 96, 97, 98, 221, 222, 223, 194, 195, 152, 199, 23, 19, 225, 26, 28, 152, 152, 152, 206, 209, 164, 190, 191, 241, 152, 49, 50, 152, 124, 152, 44, 219, 46, 152, 21, 172, 173, 172, 173, 183, 107, 185, 16, 163, 58, 112, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 207, 130, 152, 23, 196, 64, 152, 172, 173, 22, 152, 24, 152, 98, 27, 61, 96, 63, 26, 211, 212, 186, 172, 173, 49, 50, 172, 173, 23, 49, 50, 26, 172, 173, 88, 89, 186, 24, 238, 124, 27, 238, 22, 23, 103, 187, 26, 152, 73, 74, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 101, 152, 132, 23, 134, 140, 152, 12, 97, 36, 168, 169, 170, 69, 98, 152, 22, 23, 140, 50, 26, 172, 173, 28, 51, 152, 172, 173, 193, 49, 50, 22, 59, 24, 97, 172, 173, 152, 152, 44, 124, 46, 0, 1, 2, 172, 173, 22, 23, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 69, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 107, 152, 193, 49, 50, 181, 22, 23, 111, 108, 109, 110, 7, 8, 9, 16, 247, 248, 69, 172, 173, 172, 173, 152, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 152, 242, 152, 69, 152, 166, 167, 172, 173, 32, 61, 152, 63, 152, 193, 152, 152, 152, 41, 152, 172, 173, 172, 173, 172, 173, 152, 152, 152, 49, 50, 172, 173, 172, 173, 172, 173, 172, 173, 172, 173, 132, 138, 134, 152, 152, 172, 173, 172, 173, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 152, 22, 152, 195, 24, 152, 27, 172, 173, 193, 193, 152, 152, 152, 206, 152, 217, 152, 152, 152, 172, 173, 172, 173, 152, 172, 173, 152, 152, 49, 50, 172, 173, 172, 173, 172, 173, 172, 173, 172, 173, 152, 138, 152, 172, 173, 108, 109, 110, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 97, 152, 152, 49, 50, 26, 193, 172, 173, 152, 152, 152, 146, 147, 132, 152, 134, 217, 181, 172, 173, 172, 173, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 193, 152, 193, 49, 50, 181, 193, 172, 173, 166, 167, 245, 246, 211, 212, 152, 22, 217, 152, 172, 173, 172, 173, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 187, 152, 123, 49, 50, 23, 23, 23, 26, 26, 26, 23, 23, 23, 26, 26, 26, 7, 8, 172, 173, 172, 173, 19, 90, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 152, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 152, 116, 152, 217, 49, 50, 121, 23, 172, 173, 26, 100, 101, 27, 101, 27, 23, 122, 152, 26, 172, 173, 172, 173, 152, 112, 163, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 163, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 19, 20, 152, 22, 23, 152, 163, 65, 27, 196, 163, 19, 20, 23, 22, 213, 26, 19, 37, 27, 152, 196, 172, 173, 152, 172, 173, 27, 23, 37, 152, 26, 152, 97, 152, 97, 210, 56, 163, 196, 163, 163, 100, 196, 172, 173, 65, 152, 56, 68, 172, 173, 172, 173, 172, 173, 152, 65, 163, 163, 68, 23, 152, 234, 26, 152, 152, 172, 173, 88, 89, 196, 152, 196, 196, 152, 95, 96, 97, 98, 88, 89, 101, 152, 152, 207, 208, 95, 96, 97, 98, 196, 196, 101, 96, 233, 152, 97, 152, 152, 19, 20, 207, 22, 152, 152, 152, 191, 27, 152, 152, 152, 152, 132, 133, 134, 135, 136, 37, 152, 152, 152, 152, 152, 132, 133, 134, 135, 136, 210, 197, 210, 210, 198, 150, 184, 239, 56, 201, 214, 214, 201, 239, 180, 214, 227, 198, 38, 176, 68, 175, 175, 175, 122, 155, 200, 159, 19, 20, 40, 22, 159, 159, 22, 70, 27, 130, 243, 240, 88, 89, 90, 189, 18, 201, 37, 95, 96, 97, 98, 192, 5, 101, 192, 220, 240, 10, 11, 12, 13, 14, 159, 18, 17, 56, 158, 192, 201, 192, 220, 189, 189, 201, 159, 158, 137, 68, 31, 45, 33, 236, 159, 159, 132, 133, 134, 135, 136, 42, 158, 235, 22, 177, 159, 158, 158, 88, 89, 159, 107, 174, 55, 177, 95, 96, 97, 98, 174, 62, 101, 47, 65, 66, 106, 174, 125, 19, 20, 174, 22, 177, 176, 174, 182, 27, 216, 174, 174, 182, 107, 159, 22, 215, 215, 37, 216, 216, 216, 137, 215, 132, 133, 134, 135, 136, 215, 159, 177, 94, 177, 129, 224, 205, 56, 226, 126, 128, 203, 229, 204, 114, 229, 127, 202, 201, 68, 25, 162, 26, 13, 161, 153, 153, 6, 151, 151, 178, 151, 151, 165, 165, 178, 165, 4, 249, 88, 89, 141, 3, 142, 22, 249, 95, 96, 97, 98, 246, 15, 101, 67, 16, 23, 120, 23, 131, 111, 123, 20, 16, 125, 1, 123, 131, 78, 78, 78, 78, 111, 96, 1, 122, 35, 5, 22, 107, 140, 53, 53, 26, 132, 133, 134, 135, 136, 43, 60, 107, 24, 112, 20, 19, 52, 22, 29, 105, 22, 22, 52, 23, 22, 22, 52, 23, 23, 39, 23, 116, 26, 22, 26, 23, 22, 96, 23, 23, 122, 22, 24, 124, 35, 35, 26, 26, 35, 23, 23, 23, 23, 11, 23, 22, 26, 23, 22, 122, 23, 26, 22, 24, 23, 22, 122, 23, 23, 22, 15, 23, 1, 122, 122}
}
var _yyFallback [69]uint8
func init() {
_yyFallback = [69]uint8{0, 0, 27, 27, 27, 27, 0, 27, 27, 27, 0, 27, 27, 27, 27, 0, 0, 0, 27, 0, 0, 27, 0, 0, 0, 27, 0, 0, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27}
}
var _yy_action [1566]uint16
func init() {
_yy_action = [1566]uint16{u16(325), u16(411), u16(343), u16(752), u16(752), u16(203), u16(946), u16(354), u16(976), u16(98), u16(98), u16(98), u16(98), u16(91), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(1333), u16(155), u16(155), u16(2), u16(813), u16(978), u16(978), u16(98), u16(98), u16(98), u16(98), u16(20), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(92), u16(89), u16(178), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(351), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(340), u16(976), u16(262), u16(365), u16(251), u16(212), u16(169), u16(287), u16(405), u16(282), u16(404), u16(199), u16(791), u16(242), u16(412), u16(21), u16(957), u16(379), u16(280), u16(93), u16(351), u16(792), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(978), u16(978), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(813), u16(329), u16(242), u16(412), u16(913), u16(832), u16(913), u16(132), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(825), u16(349), u16(348), u16(120), u16(819), u16(120), u16(75), u16(52), u16(52), u16(957), u16(958), u16(959), u16(760), u16(984), u16(146), u16(361), u16(262), u16(370), u16(261), u16(957), u16(982), u16(961), u16(983), u16(92), u16(89), u16(178), u16(371), u16(230), u16(371), u16(978), u16(978), u16(817), u16(361), u16(360), u16(101), u16(824), u16(824), u16(826), u16(384), u16(24), u16(964), u16(381), u16(428), u16(413), u16(369), u16(985), u16(380), u16(985), u16(708), u16(325), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(373), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(957), u16(132), u16(897), u16(450), u16(978), u16(978), u16(896), u16(60), u16(94), u16(94), u16(94), u16(93), u16(351), u16(957), u16(958), u16(959), u16(961), u16(103), u16(361), u16(957), u16(385), u16(334), u16(702), u16(52), u16(52), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(698), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(455), u16(670), u16(450), u16(227), u16(61), u16(157), u16(243), u16(344), u16(114), u16(701), u16(888), u16(147), u16(832), u16(957), u16(373), u16(747), u16(957), u16(320), u16(957), u16(958), u16(959), u16(194), u16(10), u16(10), u16(402), u16(399), u16(398), u16(888), u16(890), u16(978), u16(978), u16(762), u16(171), u16(170), u16(157), u16(397), u16(337), u16(957), u16(958), u16(959), u16(702), u16(825), u16(310), u16(153), u16(957), u16(819), u16(321), u16(82), u16(23), u16(80), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(894), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(824), u16(824), u16(826), u16(277), u16(231), u16(300), u16(957), u16(958), u16(959), u16(957), u16(958), u16(959), u16(888), u16(194), u16(25), u16(450), u16(402), u16(399), u16(398), u16(957), u16(355), u16(300), u16(450), u16(957), u16(74), u16(450), u16(1), u16(397), u16(132), u16(978), u16(978), u16(957), u16(224), u16(224), u16(813), u16(10), u16(10), u16(957), u16(958), u16(959), u16(968), u16(132), u16(52), u16(52), u16(415), u16(52), u16(52), u16(739), u16(739), u16(339), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(790), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(789), u16(428), u16(418), u16(706), u16(428), u16(427), u16(1270), u16(1270), u16(262), u16(370), u16(261), u16(957), u16(957), u16(958), u16(959), u16(757), u16(957), u16(958), u16(959), u16(450), u16(756), u16(450), u16(734), u16(713), u16(957), u16(958), u16(959), u16(443), u16(711), u16(978), u16(978), u16(734), u16(394), u16(92), u16(89), u16(178), u16(447), u16(447), u16(447), u16(51), u16(51), u16(52), u16(52), u16(439), u16(778), u16(700), u16(92), u16(89), u16(178), u16(172), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(198), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(428), u16(408), u16(916), u16(699), u16(957), u16(958), u16(959), u16(92), u16(89), u16(178), u16(224), u16(224), u16(157), u16(241), u16(221), u16(419), u16(299), u16(776), u16(917), u16(416), u16(375), u16(450), u16(415), u16(58), u16(324), u16(737), u16(737), u16(920), u16(379), u16(978), u16(978), u16(379), u16(777), u16(449), u16(918), u16(363), u16(740), u16(296), u16(686), u16(9), u16(9), u16(52), u16(52), u16(234), u16(330), u16(234), u16(256), u16(417), u16(741), u16(280), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(423), u16(72), u16(450), u16(833), u16(120), u16(368), u16(450), u16(10), u16(10), u16(5), u16(301), u16(203), u16(450), u16(177), u16(976), u16(253), u16(420), u16(255), u16(776), u16(200), u16(175), u16(233), u16(10), u16(10), u16(842), u16(842), u16(36), u16(36), u16(1299), u16(978), u16(978), u16(729), u16(37), u16(37), u16(349), u16(348), u16(425), u16(203), u16(260), u16(776), u16(976), u16(232), u16(937), u16(1326), u16(876), u16(338), u16(1326), u16(422), u16(854), u16(857), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(268), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(846), u16(450), u16(985), u16(818), u16(985), u16(1209), u16(450), u16(916), u16(976), u16(720), u16(350), u16(350), u16(350), u16(935), u16(177), u16(450), u16(937), u16(1327), u16(254), u16(198), u16(1327), u16(12), u16(12), u16(917), u16(403), u16(450), u16(27), u16(27), u16(250), u16(978), u16(978), u16(118), u16(721), u16(162), u16(976), u16(38), u16(38), u16(268), u16(176), u16(918), u16(776), u16(433), u16(1275), u16(946), u16(354), u16(39), u16(39), u16(317), u16(998), u16(325), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(935), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(450), u16(330), u16(450), u16(358), u16(978), u16(978), u16(717), u16(317), u16(936), u16(341), u16(900), u16(900), u16(387), u16(673), u16(674), u16(675), u16(275), u16(996), u16(318), u16(999), u16(40), u16(40), u16(41), u16(41), u16(268), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(450), u16(356), u16(450), u16(999), u16(450), u16(692), u16(331), u16(42), u16(42), u16(791), u16(270), u16(450), u16(273), u16(450), u16(228), u16(450), u16(298), u16(450), u16(792), u16(450), u16(28), u16(28), u16(29), u16(29), u16(31), u16(31), u16(450), u16(817), u16(450), u16(978), u16(978), u16(43), u16(43), u16(44), u16(44), u16(45), u16(45), u16(11), u16(11), u16(46), u16(46), u16(893), u16(78), u16(893), u16(268), u16(268), u16(105), u16(105), u16(47), u16(47), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(325), u16(450), u16(117), u16(450), u16(749), u16(158), u16(450), u16(696), u16(48), u16(48), u16(229), u16(919), u16(450), u16(928), u16(450), u16(415), u16(450), u16(335), u16(450), u16(245), u16(450), u16(33), u16(33), u16(49), u16(49), u16(450), u16(50), u16(50), u16(246), u16(817), u16(978), u16(978), u16(34), u16(34), u16(122), u16(122), u16(123), u16(123), u16(124), u16(124), u16(56), u16(56), u16(268), u16(81), u16(249), u16(35), u16(35), u16(197), u16(196), u16(195), u16(325), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(450), u16(696), u16(450), u16(817), u16(978), u16(978), u16(975), u16(884), u16(106), u16(106), u16(268), u16(886), u16(268), u16(944), u16(2), u16(892), u16(268), u16(892), u16(336), u16(716), u16(53), u16(53), u16(107), u16(107), u16(325), u16(99), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(450), u16(746), u16(450), u16(742), u16(978), u16(978), u16(715), u16(267), u16(108), u16(108), u16(446), u16(331), u16(332), u16(133), u16(223), u16(175), u16(301), u16(225), u16(386), u16(933), u16(104), u16(104), u16(121), u16(121), u16(325), u16(99), u16(88), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(817), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(450), u16(347), u16(450), u16(167), u16(978), u16(978), u16(932), u16(815), u16(372), u16(319), u16(202), u16(202), u16(374), u16(263), u16(395), u16(202), u16(74), u16(208), u16(726), u16(727), u16(119), u16(119), u16(112), u16(112), u16(325), u16(407), u16(100), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(450), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(450), u16(757), u16(450), u16(345), u16(978), u16(978), u16(756), u16(278), u16(111), u16(111), u16(74), u16(719), u16(718), u16(709), u16(286), u16(883), u16(754), u16(1289), u16(257), u16(77), u16(109), u16(109), u16(110), u16(110), u16(908), u16(285), u16(810), u16(90), u16(853), u16(856), u16(845), u16(845), u16(97), u16(97), u16(98), u16(98), u16(98), u16(98), u16(911), u16(96), u16(96), u16(96), u16(96), u16(95), u16(95), u16(94), u16(94), u16(94), u16(93), u16(351), u16(86), u16(445), u16(450), u16(3), u16(1202), u16(450), u16(745), u16(132), u16(352), u16(120), u16(689), u16(86), u16(445), u16(785), u16(3), u16(767), u16(202), u16(377), u16(448), u16(352), u16(907), u16(120), u16(55), u16(55), u16(450), u16(57), u16(57), u16(828), u16(879), u16(448), u16(450), u16(208), u16(450), u16(709), u16(450), u16(883), u16(237), u16(434), u16(436), u16(120), u16(440), u16(429), u16(362), u16(120), u16(54), u16(54), u16(132), u16(450), u16(434), u16(832), u16(52), u16(52), u16(26), u16(26), u16(30), u16(30), u16(382), u16(132), u16(409), u16(444), u16(832), u16(694), u16(264), u16(390), u16(116), u16(269), u16(272), u16(32), u16(32), u16(83), u16(84), u16(120), u16(274), u16(120), u16(120), u16(276), u16(85), u16(352), u16(452), u16(451), u16(83), u16(84), u16(819), u16(730), u16(714), u16(428), u16(430), u16(85), u16(352), u16(452), u16(451), u16(120), u16(120), u16(819), u16(378), u16(218), u16(281), u16(828), u16(783), u16(816), u16(86), u16(445), u16(410), u16(3), u16(763), u16(774), u16(431), u16(432), u16(352), u16(302), u16(303), u16(823), u16(697), u16(824), u16(824), u16(826), u16(827), u16(19), u16(448), u16(691), u16(680), u16(679), u16(681), u16(951), u16(824), u16(824), u16(826), u16(827), u16(19), u16(289), u16(159), u16(291), u16(293), u16(7), u16(316), u16(173), u16(259), u16(434), u16(805), u16(364), u16(252), u16(910), u16(376), u16(713), u16(295), u16(435), u16(168), u16(993), u16(400), u16(832), u16(284), u16(881), u16(880), u16(205), u16(954), u16(308), u16(927), u16(86), u16(445), u16(990), u16(3), u16(925), u16(333), u16(144), u16(130), u16(352), u16(72), u16(135), u16(59), u16(83), u16(84), u16(761), u16(137), u16(366), u16(802), u16(448), u16(85), u16(352), u16(452), u16(451), u16(139), u16(226), u16(819), u16(140), u16(156), u16(62), u16(315), u16(314), u16(313), u16(215), u16(311), u16(367), u16(393), u16(683), u16(434), u16(185), u16(141), u16(912), u16(142), u16(160), u16(148), u16(812), u16(875), u16(383), u16(189), u16(67), u16(832), u16(180), u16(389), u16(248), u16(895), u16(775), u16(219), u16(824), u16(824), u16(826), u16(827), u16(19), u16(247), u16(190), u16(266), u16(154), u16(391), u16(271), u16(191), u16(192), u16(83), u16(84), u16(682), u16(406), u16(733), u16(182), u16(322), u16(85), u16(352), u16(452), u16(451), u16(732), u16(183), u16(819), u16(342), u16(132), u16(181), u16(711), u16(731), u16(421), u16(76), u16(445), u16(705), u16(3), u16(323), u16(704), u16(283), u16(724), u16(352), u16(771), u16(703), u16(966), u16(723), u16(71), u16(204), u16(6), u16(288), u16(290), u16(448), u16(772), u16(770), u16(769), u16(79), u16(292), u16(824), u16(824), u16(826), u16(827), u16(19), u16(294), u16(297), u16(438), u16(346), u16(442), u16(102), u16(861), u16(753), u16(434), u16(238), u16(426), u16(73), u16(305), u16(239), u16(304), u16(326), u16(240), u16(424), u16(306), u16(307), u16(832), u16(213), u16(688), u16(22), u16(952), u16(453), u16(214), u16(216), u16(217), u16(454), u16(677), u16(115), u16(676), u16(671), u16(125), u16(126), u16(235), u16(127), u16(669), u16(327), u16(83), u16(84), u16(359), u16(353), u16(244), u16(166), u16(328), u16(85), u16(352), u16(452), u16(451), u16(134), u16(179), u16(819), u16(357), u16(113), u16(891), u16(811), u16(889), u16(136), u16(128), u16(138), u16(743), u16(258), u16(184), u16(906), u16(143), u16(145), u16(63), u16(64), u16(65), u16(66), u16(129), u16(909), u16(905), u16(187), u16(186), u16(8), u16(13), u16(188), u16(265), u16(898), u16(149), u16(202), u16(824), u16(824), u16(826), u16(827), u16(19), u16(388), u16(987), u16(150), u16(161), u16(285), u16(685), u16(392), u16(396), u16(151), u16(722), u16(193), u16(68), u16(14), u16(401), u16(279), u16(15), u16(69), u16(236), u16(831), u16(830), u16(131), u16(859), u16(751), u16(70), u16(16), u16(414), u16(755), u16(4), u16(784), u16(220), u16(222), u16(174), u16(152), u16(437), u16(779), u16(201), u16(17), u16(77), u16(74), u16(18), u16(874), u16(860), u16(858), u16(915), u16(863), u16(914), u16(207), u16(206), u16(941), u16(163), u16(210), u16(942), u16(209), u16(164), u16(441), u16(862), u16(165), u16(211), u16(829), u16(695), u16(87), u16(312), u16(309), u16(947), u16(1291), u16(1290)}
}
var _yy_default [456]uint16
func init() {
_yy_default = [456]uint16{u16(1280), u16(1270), u16(1270), u16(1270), u16(1202), u16(1202), u16(1202), u16(1202), u16(1270), u16(1096), u16(1125), u16(1125), u16(1254), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1201), u16(1332), u16(1332), u16(1332), u16(1332), u16(1270), u16(1100), u16(1131), u16(1332), u16(1332), u16(1332), u16(1332), u16(1203), u16(1204), u16(1332), u16(1332), u16(1332), u16(1253), u16(1255), u16(1141), u16(1140), u16(1139), u16(1138), u16(1236), u16(1112), u16(1136), u16(1129), u16(1133), u16(1203), u16(1197), u16(1198), u16(1196), u16(1200), u16(1204), u16(1332), u16(1132), u16(1167), u16(1181), u16(1166), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1175), u16(1180), u16(1187), u16(1179), u16(1176), u16(1169), u16(1168), u16(1170), u16(1171), u16(1332), u16(1019), u16(1067), u16(1332), u16(1332), u16(1332), u16(1172), u16(1332), u16(1173), u16(1184), u16(1183), u16(1182), u16(1261), u16(1288), u16(1287), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1280), u16(1270), u16(1025), u16(1025), u16(1332), u16(1270), u16(1270), u16(1270), u16(1270), u16(1270), u16(1270), u16(1266), u16(1100), u16(1091), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1258), u16(1256), u16(1332), u16(1217), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1096), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1282), u16(1332), u16(1231), u16(1096), u16(1096), u16(1096), u16(1098), u16(1080), u16(1090), u16(1004), u16(1135), u16(1114), u16(1114), u16(1321), u16(1135), u16(1321), u16(1042), u16(1302), u16(1039), u16(1125), u16(1114), u16(1199), u16(1125), u16(1125), u16(1097), u16(1090), u16(1332), u16(1324), u16(1105), u16(1105), u16(1323), u16(1323), u16(1105), u16(1146), u16(1070), u16(1135), u16(1076), u16(1076), u16(1076), u16(1076), u16(1105), u16(1016), u16(1135), u16(1146), u16(1070), u16(1070), u16(1135), u16(1105), u16(1016), u16(1235), u16(1318), u16(1105), u16(1105), u16(1016), u16(1210), u16(1105), u16(1016), u16(1105), u16(1016), u16(1210), u16(1068), u16(1068), u16(1068), u16(1057), u16(1210), u16(1068), u16(1042), u16(1068), u16(1057), u16(1068), u16(1068), u16(1118), u16(1113), u16(1118), u16(1113), u16(1118), u16(1113), u16(1118), u16(1113), u16(1105), u16(1205), u16(1105), u16(1332), u16(1210), u16(1214), u16(1214), u16(1210), u16(1130), u16(1119), u16(1128), u16(1126), u16(1135), u16(1022), u16(1060), u16(1285), u16(1285), u16(1281), u16(1281), u16(1281), u16(1281), u16(1329), u16(1329), u16(1266), u16(1297), u16(1297), u16(1044), u16(1044), u16(1297), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1292), u16(1332), u16(1219), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1152), u16(1332), u16(1000), u16(1263), u16(1332), u16(1332), u16(1262), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1320), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1234), u16(1233), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1082), u16(1332), u16(1332), u16(1332), u16(1306), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1127), u16(1332), u16(1120), u16(1332), u16(1332), u16(1311), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1272), u16(1332), u16(1332), u16(1332), u16(1271), u16(1332), u16(1332), u16(1332), u16(1332), u16(1332), u16(1154), u16(1332), u16(1153), u16(1157), u16(1332), u16(1010), u16(1332)}
}
// Perform a shift action.
func _yy_shift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32, _yyMajor int32, _yyMinor XToken) {
var _yytos *XyyStackEntry
*(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))))) += uintptr(16)
if uintptr(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))+16*uintptr(i32(100)))))) {
*(*uintptr)(unsafe.Pointer((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))))) += uintptr(4294967280)
_yyStackOverflow(tls, _yypParser)
return
}
if _yyNewState > i32(455) {
{
p := &_yyNewState
*p = (*p) + i32(332)
sink1 = *p
}
}
_yytos = (*XyyStackEntry)(_yypParser.X0)
*(*uint16)(unsafe.Pointer(&(_yytos.X0))) = uint16(_yyNewState)
*(*uint8)(unsafe.Pointer(&(_yytos.X1))) = uint8(_yyMajor)
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&(_yytos.X2))))) = _yyMinor
_yyTraceShift(tls, _yypParser, _yyNewState)
}
// The following routine is called if the stack overflows.
func _yyStackOverflow(tls *crt.TLS, _yypParser *XyyParser) {
var _pParse *XParse
_pParse = (*XParse)(_yypParser.X1)
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(27024), unsafe.Pointer(_yyTracePrompt))
}
_0:
if uintptr(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) > uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))))) {
_yy_pop_parser_stack(tls, _yypParser)
goto _0
}
_sqlite3ErrorMsg(tls, _pParse, str(27043))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse
}
// Pop the parser's stack once.
//
// If there is a destructor routine associated with the token which
// is popped from the stack, then call it.
func _yy_pop_parser_stack(tls *crt.TLS, _pParser *XyyParser) {
var _yytos *XyyStackEntry
func() {
if (*XyyStackEntry)(_pParser.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137054), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_pop_parser_stackØ00__func__Ø000))), unsafe.Pointer(str(27065)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) <= uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137055), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_pop_parser_stackØ00__func__Ø000))), unsafe.Pointer(str(27083)))
crt.X__builtin_abort(tls)
}
}()
_yytos = postInc34((**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParser.X0))))), -16)
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(27117), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr(_yytos.X1)))))
}
_yy_destructor(tls, _pParser, _yytos.X1, (*XYYMINORTYPE)(unsafe.Pointer(&(_yytos.X2))))
}
var _yy_pop_parser_stackØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_yy_pop_parser_stackØ00__func__Ø000[0], str(27131), 20)
}
// The following function deletes the "minor type" or semantic value
// associated with a symbol. The symbol can be either a terminal
// or nonterminal. "yymajor" is the symbol code, and "yypminor" is
// a pointer to the value to be deleted. The code used to do the
// deletions is derived from the %destructor and/or %token_destructor
// directives of the input grammar.
func _yy_destructor(tls *crt.TLS, _yypParser *XyyParser, _yymajor uint8, _yypminor *XYYMINORTYPE) {
var _pParse *XParse
_pParse = (*XParse)(_yypParser.X1)
switch int32(_yymajor) {
case i32(163):
goto _1
case i32(172):
goto _5
case i32(173):
goto _5
case i32(177):
goto _7
case i32(186):
goto _7
case i32(187):
goto _7
case i32(193):
goto _19
case i32(194):
goto _1
case i32(195):
goto _1
case i32(196):
goto _23
case i32(199):
goto _7
case i32(200):
goto _19
case i32(201):
goto _25
case i32(202):
goto _7
case i32(203):
goto _25
case i32(204):
goto _7
case i32(206):
goto _1
case i32(207):
goto _7
case i32(208):
goto _7
case i32(209):
goto _7
case i32(211):
goto _19
case i32(212):
goto _19
case i32(215):
goto _25
case i32(216):
goto _32
case i32(217):
goto _32
case i32(218):
goto _7
case i32(220):
goto _32
case i32(224):
goto _7
case i32(225):
goto _25
case i32(226):
goto _7
case i32(227):
goto _25
case i32(232):
goto _35
case i32(234):
goto _37
case i32(236):
goto _25
case i32(237):
goto _35
case i32(241):
goto _25
case i32(250):
goto _23
default:
goto _38
}
_1:
_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_5:
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer(_yypminor)).X0))
goto _39
_7:
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_19:
_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_23:
_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.X0), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_25:
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_32:
_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_35:
_sqlite3DeleteTriggerStep(tls, (*Xsqlite3)(_pParse.X0), (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer(_yypminor))))
goto _39
_37:
_sqlite3IdListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XIdList)((*T_ht)(unsafe.Pointer(_yypminor)).X1))
goto _39
_38:
goto _39
_39:
}
func _yyTraceShift(tls *crt.TLS, _yypParser *XyyParser, _yyNewState int32) {
if _yyTraceFILE == nil {
goto _0
}
if _yyNewState < i32(456) {
crt.Xfprintf(tls, _yyTraceFILE, str(27151), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr((*XyyStackEntry)(_yypParser.X0).X1)))), _yyNewState)
goto _2
}
crt.Xfprintf(tls, _yyTraceFILE, str(27181), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyTokenName)) + 4*uintptr((*XyyStackEntry)(_yypParser.X0).X1)))))
_2:
_0:
}
// Perform a reduce action and the shift that must immediately
// follow the reduce.
func _yy_reduce(tls *crt.TLS, _yypParser *XyyParser, _yyruleno uint32) {
var _yygoto, _yyact, _yysize, _81_i, _163_bNot, _164_bNot int32
var _147_n uint32
var _81_z *int8
var _75_x, _80_s, _148_t, _209_all XToken
var _75_pFrom, _185_pSrc *XSrcList
var _105_pNew, _105_pOld *TSrcList_item
var _158_pList, _163_pList, _164_pList, _173_pList *XExprList
var _71_p, _74_pRhs, _74_pLhs, _85_pRight, _85_pLeft, _106_pSubquery, _185_pSelect *XSelect
var _92_p, _93_pRight, _93_pLeft, _93_pDot, _143_temp1, _143_temp2, _144_temp1, _144_temp2, _144_temp3, _144_temp4, _178_pRHS, _186_p *XExpr
var _pParse *XParse
var _34_v, _35_v XExprSpan
var _70_dest XSelectDest
var _4_yylhsminor XYYMINORTYPE
var _yymsp *XyyStackEntry
_pParse = (*XParse)(_yypParser.X1)
_yymsp = (*XyyStackEntry)(_yypParser.X0)
if (_yyTraceFILE != nil) && (_yyruleno < uint32(i32(332))) {
_yysize = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1)
crt.Xfprintf(tls, _yyTraceFILE, str(27195), unsafe.Pointer(_yyTracePrompt), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleName)) + 4*uintptr(_yyruleno)))), int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(-_yysize))).X0))
}
if int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo))+2*uintptr(_yyruleno))).X1) != i32(0) {
goto _2
}
if uintptr(unsafe.Pointer((*XyyStackEntry)(_yypParser.X0))) >= uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2)))))+16*uintptr(i32(99)))))) {
_yyStackOverflow(tls, _yypParser)
return
}
_2:
switch _yyruleno {
case u32(0):
goto _5
case u32(1):
goto _6
case u32(2):
goto _7
case u32(3):
goto _8
case u32(4):
goto _9
case u32(5):
goto _10
case u32(6):
goto _10
case u32(7):
goto _10
case u32(8):
goto _13
case u32(9):
goto _13
case u32(10):
goto _15
case u32(11):
goto _16
case u32(12):
goto _17
case u32(13):
goto _18
case u32(14):
goto _19
case u32(15):
goto _20
case u32(16):
goto _21
case u32(17):
goto _30
case u32(18):
goto _31
case u32(19):
goto _21
case u32(20):
goto _33
case u32(21):
goto _34
case u32(22):
goto _21
case u32(23):
goto _35
case u32(24):
goto _36
case u32(25):
goto _37
case u32(26):
goto _40
case u32(27):
goto _41
case u32(28):
goto _42
case u32(29):
goto _43
case u32(30):
goto _45
case u32(31):
goto _47
case u32(32):
goto _45
case u32(33):
goto _48
case u32(34):
goto _49
case u32(35):
goto _50
case u32(36):
goto _51
case u32(37):
goto _52
case u32(38):
goto _53
case u32(39):
goto _54
case u32(40):
goto _55
case u32(41):
goto _56
case u32(42):
goto _21
case u32(43):
goto _31
case u32(44):
goto _57
case u32(45):
goto _58
case u32(46):
goto _59
case u32(47):
goto _60
case u32(48):
goto _61
case u32(49):
goto _62
case u32(50):
goto _63
case u32(51):
goto _64
case u32(52):
goto _65
case u32(53):
goto _66
case u32(54):
goto _67
case u32(55):
goto _68
case u32(56):
goto _69
case u32(57):
goto _21
case u32(58):
goto _72
case u32(59):
goto _77
case u32(60):
goto _37
case u32(61):
goto _78
case u32(62):
goto _43
case u32(63):
goto _79
case u32(64):
goto _80
case u32(65):
goto _81
case u32(66):
goto _82
case u32(67):
goto _21
case u32(68):
goto _83
case u32(69):
goto _85
case u32(70):
goto _83
case u32(71):
goto _69
case u32(72):
goto _86
case u32(73):
goto _87
case u32(74):
goto _89
case u32(75):
goto _72
case u32(76):
goto _21
case u32(77):
goto _90
case u32(78):
goto _91
case u32(79):
goto _92
case u32(80):
goto _93
case u32(81):
goto _94
case u32(82):
goto _95
case u32(83):
goto _97
case u32(84):
goto _95
case u32(85):
goto _98
case u32(86):
goto _99
case u32(87):
goto _100
case u32(88):
goto _101
case u32(89):
goto _102
case u32(90):
goto _21
case u32(91):
goto _103
case u32(92):
goto _109
case u32(93):
goto _110
case u32(94):
goto _111
case u32(95):
goto _112
case u32(96):
goto _37
case u32(97):
goto _116
case u32(98):
goto _117
case u32(99):
goto _118
case u32(100):
goto _119
case u32(101):
goto _120
case u32(102):
goto _121
case u32(103):
goto _122
case u32(104):
goto _123
case u32(105):
goto _124
case u32(106):
goto _112
case u32(107):
goto _126
case u32(108):
goto _127
case u32(109):
goto _128
case u32(110):
goto _129
case u32(111):
goto _130
case u32(112):
goto _131
case u32(113):
goto _135
case u32(114):
goto _124
case u32(115):
goto _140
case u32(116):
goto _141
case u32(117):
goto _142
case u32(118):
goto _143
case u32(119):
goto _103
case u32(120):
goto _145
case u32(121):
goto _147
case u32(122):
goto _148
case u32(123):
goto _149
case u32(124):
goto _150
case u32(125):
goto _151
case u32(126):
goto _103
case u32(127):
goto _145
case u32(128):
goto _135
case u32(129):
goto _131
case u32(130):
goto _152
case u32(131):
goto _153
case u32(132):
goto _154
case u32(133):
goto _155
case u32(134):
goto _156
case u32(135):
goto _135
case u32(136):
goto _131
case u32(137):
goto _157
case u32(138):
goto _158
case u32(139):
goto _159
case u32(140):
goto _160
case u32(141):
goto _161
case u32(142):
goto _162
case u32(143):
goto _163
case u32(144):
goto _69
case u32(145):
goto _87
case u32(146):
goto _143
case u32(147):
goto _164
case u32(148):
goto _165
case u32(149):
goto _166
case u32(150):
goto _167
case u32(151):
goto _168
case u32(152):
goto _171
case u32(153):
goto _171
case u32(154):
goto _173
case u32(155):
goto _174
case u32(156):
goto _168
case u32(157):
goto _168
case u32(158):
goto _175
case u32(159):
goto _176
case u32(160):
goto _177
case u32(161):
goto _178
case u32(162):
goto _179
case u32(163):
goto _180
case u32(164):
goto _181
case u32(165):
goto _182
case u32(166):
goto _183
case u32(167):
goto _183
case u32(168):
goto _183
case u32(169):
goto _183
case u32(170):
goto _183
case u32(171):
goto _183
case u32(172):
goto _183
case u32(173):
goto _183
case u32(174):
goto _191
case u32(175):
goto _192
case u32(176):
goto _193
case u32(177):
goto _194
case u32(178):
goto _195
case u32(179):
goto _196
case u32(180):
goto _197
case u32(181):
goto _198
case u32(182):
goto _198
case u32(183):
goto _200
case u32(184):
goto _201
case u32(185):
goto _202
case u32(186):
goto _72
case u32(187):
goto _204
case u32(188):
goto _202
case u32(189):
goto _72
case u32(190):
goto _205
case u32(191):
goto _206
case u32(192):
goto _207
case u32(193):
goto _208
case u32(194):
goto _209
case u32(195):
goto _210
case u32(196):
goto _211
case u32(197):
goto _212
case u32(198):
goto _131
case u32(199):
goto _135
case u32(200):
goto _213
case u32(201):
goto _135
case u32(202):
goto _103
case u32(203):
goto _214
case u32(204):
goto _215
case u32(205):
goto _103
case u32(206):
goto _216
case u32(207):
goto _218
case u32(208):
goto _219
case u32(209):
goto _221
case u32(210):
goto _103
case u32(211):
goto _216
case u32(212):
goto _222
case u32(213):
goto _223
case u32(214):
goto _21
case u32(215):
goto _72
case u32(216):
goto _224
case u32(217):
goto _225
case u32(218):
goto _226
case u32(219):
goto _227
case u32(220):
goto _228
case u32(221):
goto _229
case u32(222):
goto _230
case u32(223):
goto _231
case u32(224):
goto _112
case u32(225):
goto _112
case u32(226):
goto _232
case u32(227):
goto _233
case u32(228):
goto _234
case u32(229):
goto _235
case u32(230):
goto _236
case u32(231):
goto _237
case u32(232):
goto _238
case u32(233):
goto _238
case u32(234):
goto _240
case u32(235):
goto _241
case u32(236):
goto _243
case u32(237):
goto _245
case u32(238):
goto _246
case u32(239):
goto _247
case u32(240):
goto _248
case u32(241):
goto _249
case u32(242):
goto _250
case u32(243):
goto _251
case u32(244):
goto _252
case u32(245):
goto _253
case u32(246):
goto _254
case u32(247):
goto _255
case u32(248):
goto _256
case u32(249):
goto _219
case u32(250):
goto _257
case u32(251):
goto _258
case u32(252):
goto _259
case u32(253):
goto _260
case u32(254):
goto _241
case u32(255):
goto _243
case u32(256):
goto _261
case u32(257):
goto _262
case u32(258):
goto _263
case u32(259):
goto _264
case u32(260):
goto _265
case u32(261):
goto _266
case u32(262):
goto _267
case u32(263):
goto _268
case u32(264):
goto _269
case u32(265):
goto _270
case u32(266):
goto _271
case u32(267):
goto _272
case u32(268):
goto _272
case u32(269):
goto _272
case u32(270):
goto _275
case u32(271):
goto _276
case u32(272):
goto _277
case u32(273):
goto _278
case u32(274):
goto _279
default:
goto _280
}
_5:
*(*uint8)(unsafe.Pointer(&(_pParse.X54))) = uint8(i32(1))
goto _281
_6:
*(*uint8)(unsafe.Pointer(&(_pParse.X54))) = uint8(i32(2))
goto _281
_7:
_sqlite3FinishCoding(tls, _pParse)
goto _281
_8:
_sqlite3BeginTransaction(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_9:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(7)
goto _281
_10:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X1)
goto _281
_13:
_sqlite3CommitTransaction(tls, _pParse)
goto _281
_15:
_sqlite3RollbackTransaction(tls, _pParse)
goto _281
_16:
_sqlite3Savepoint(tls, _pParse, i32(0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_17:
_sqlite3Savepoint(tls, _pParse, i32(1), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_18:
_sqlite3Savepoint(tls, _pParse, i32(2), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_19:
_sqlite3StartTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), i32(0), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
goto _281
_20:
_disableLookaside(tls, _pParse)
goto _281
_21:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(0)
goto _281
_30:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = i32(1)
goto _281
_31:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(1)
goto _281
_33:
_sqlite3EndTable(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), nil)
goto _281
_34:
_sqlite3EndTable(tls, _pParse, nil, nil, uint8(i32(0)), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_35:
if (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1) == uint32(i32(5))) && (Xsqlite3_strnicmp(tls, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X0, str(27227), i32(5)) == i32(0)) {
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(96)
goto _284
}
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(0)
_sqlite3ErrorMsg(tls, _pParse, str(27233), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1, unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
_284:
goto _281
_36:
_sqlite3AddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_37:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0))
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X0))) = nil
goto _281
_40:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X1))) = uint32(int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0))) / 1))
goto _281
_41:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X1))) = uint32(int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X0))+1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0))) / 1))
goto _281
_42:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1))) = ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1) + uint32(int32((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-1)))).X2))))).X0)))/1))
goto _281
_43:
*(*XToken)(unsafe.Pointer(&(_pParse.X28))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
goto _281
_45:
_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_47:
_sqlite3AddDefaultValue(tls, _pParse, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_48:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_34_v.X0))))) = _sqlite3PExpr(tls, _pParse, i32(155), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0), nil)
*(**int8)(unsafe.Pointer(&(_34_v.X1))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0
*(**int8)(unsafe.Pointer(&(_34_v.X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X2
_sqlite3AddDefaultValue(tls, _pParse, &_34_v)
goto _281
_49:
_spanExpr(tls, &_35_v, _pParse, i32(97), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_sqlite3AddDefaultValue(tls, _pParse, &_35_v)
goto _281
_50:
_sqlite3AddNotNull(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_51:
_sqlite3AddPrimaryKey(tls, _pParse, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
goto _281
_52:
_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, nil, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1)))
goto _281
_53:
_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))
goto _281
_54:
_sqlite3CreateForeignKey(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_55:
_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_56:
_sqlite3AddCollateType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_57:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(0)
goto _281
_58:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) & (^((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1))) | ((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_59:
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))) = i32(0)
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1))) = i32(0)
goto _281
_60:
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))) = i32(0)
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X1))) = i32(0)
goto _281
_61:
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X1))) = i32(255)
goto _281
_62:
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))) = (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))) << uint(i32(8))
*(*int32)(unsafe.Pointer(&((*crt.Xstruct_timeval)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X1))) = i32(65280)
goto _281
_63:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(7)
goto _281
_64:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(8)
goto _281
_65:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(9)
goto _281
_66:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(6)
goto _281
_67:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(0)
goto _281
_68:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = i32(0)
goto _281
_69:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
goto _281
_72:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(1)
goto _281
_77:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(0)
goto _281
_78:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1))) = uint32(i32(0))
goto _281
_79:
_sqlite3AddPrimaryKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(0))
goto _281
_80:
_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), nil, nil, i32(0), i32(0), uint8(i32(1)))
goto _281
_81:
_sqlite3AddCheckConstraint(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
goto _281
_82:
_sqlite3CreateForeignKey(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_sqlite3DeferForeignKey(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_83:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(10)
goto _281
_85:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
goto _281
_86:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(4)
goto _281
_87:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(5)
goto _281
_89:
_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_90:
_sqlite3CreateView(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))))
goto _281
_91:
_sqlite3DropTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), i32(1), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_92:
_70_dest = XSelectDest{X0: u8(9), X1: nil, X2: i32(0), X3: i32(0), X4: i32(0), X5: nil}
_sqlite3Select(tls, _pParse, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), &_70_dest)
_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_93:
_71_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
if _71_p != nil {
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_71_p.X17))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_parserDoubleLinkSelect(tls, _pParse, _71_p)
goto _286
}
_sqlite3WithDelete(tls, (*Xsqlite3)(_pParse.X0), (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
_286:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = _71_p
goto _281
_94:
_74_pRhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_74_pLhs = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
if (_74_pRhs != nil) && ((*XSelect)(_74_pRhs.X13) != nil) {
*(*uint32)(unsafe.Pointer(&(_75_x.X1))) = uint32(i32(0))
_parserDoubleLinkSelect(tls, _pParse, _74_pRhs)
_75_pFrom = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_75_x, _74_pRhs, nil, nil)
_74_pRhs = _sqlite3SelectNew(tls, _pParse, nil, _75_pFrom, nil, nil, nil, nil, uint32(i32(0)), nil, nil)
}
if _74_pRhs == nil {
goto _289
}
*(*uint8)(unsafe.Pointer(&(_74_pRhs.X1))) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_74_pRhs.X13))))) = _74_pLhs
if func() int32 {
if _74_pLhs != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137979), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_74_pLhs.X3)))
*p = (*p) & uint32(i32(-1025))
sink5 = *p
}
}
{
p := (*uint32)(unsafe.Pointer(&(_74_pRhs.X3)))
*p = (*p) & uint32(i32(-1025))
sink5 = *p
}
if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) != i32(116) {
*(*uint8)(unsafe.Pointer(&(_pParse.X10))) = uint8(i32(1))
}
goto _294
_289:
_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), _74_pLhs)
_294:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = _74_pRhs
goto _281
_95:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X1)
goto _281
_97:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(116)
goto _281
_98:
_80_s = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), uint32(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2)))))), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1))
if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))) == nil {
goto _295
}
_81_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_80_s.X0)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(6))))))))
Xsqlite3_snprintf(tls, int32(u32(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))).X6))))), str(27260), preInc1((*int32)(unsafe.Pointer(&(_pParse.X34))), 1))
_296:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) == i32(32) {
*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
goto _296
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(1))))) != i32(42) {
goto _299
}
{
p := &_81_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink0 = *p
}
_300:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(i32(0))))) == i32(32) {
*(*uintptr)(unsafe.Pointer(&_81_z)) += uintptr(1)
goto _300
}
_81_i = i32(0)
_302:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_z)) + 1*uintptr(_81_i)))))))) & i32(6)) == 0 {
goto _305
}
_81_i += 1
goto _302
_305:
Xsqlite3_snprintf(tls, int32(u32(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))).X6))))), str(27264), _81_i, unsafe.Pointer(_81_z))
_299:
_295:
goto _281
_99:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(512)), nil, nil)
goto _281
_100:
_85_pLeft = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
_85_pRight = _sqlite3SelectNew(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), nil, nil, nil, nil, nil, uint32(i32(1536)), nil, nil)
if func() int32 {
if _85_pLeft != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138036), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_85_pLeft.X3)))
*p = (*p) & uint32(i32(-1025))
sink5 = *p
}
}
if _85_pRight != nil {
*(*uint8)(unsafe.Pointer(&(_85_pRight.X1))) = uint8(i32(116))
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_85_pRight.X13))))) = _85_pLeft
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _85_pRight
goto _310
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _85_pLeft
_310:
goto _281
_101:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(1)
goto _281
_102:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(2)
goto _281
_103:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_109:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))
if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1) > uint32(i32(0)) {
_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
}
_sqlite3ExprListSetSpan(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_110:
_92_p = _sqlite3Expr(tls, (*Xsqlite3)(_pParse.X0), i32(161), nil)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), _92_p)
goto _281
_111:
_93_pRight = _sqlite3PExpr(tls, _pParse, i32(161), nil, nil)
_93_pLeft = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(1))
_93_pDot = _sqlite3PExpr(tls, _pParse, i32(122), _93_pLeft, _93_pRight)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), _93_pDot)
goto _281
_112:
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
goto _281
_116:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(76))))
goto _281
_117:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
goto _281
_118:
if func() int32 {
if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) != nil) && (((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X0) > i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138098), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
*(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X2))))) + 68*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X0)-i32(1)))).X9))).X0))) = uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
}
goto _281
_119:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_120:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
goto _281
_121:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
_sqlite3SrcListFuncArgs(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))))
goto _281
_122:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_123:
if ((((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))) == nil) && (((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X1) == uint32(i32(0)))) && ((*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) == nil)) && ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))) == nil) {
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
goto _323
}
if ((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))).X0) != i32(1) {
goto _321
}
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), nil, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
if (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))) != nil {
_105_pNew = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))).X2))))) + 68*uintptr(((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))).X0)-i32(1))))
_105_pOld = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))).X2)))))
*(**int8)(unsafe.Pointer(&(_105_pNew.X2))) = _105_pOld.X2
*(**int8)(unsafe.Pointer(&(_105_pNew.X1))) = _105_pOld.X1
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_105_pNew.X5))))) = (*XSelect)(_105_pOld.X5)
*(**int8)(unsafe.Pointer(&(_105_pOld.X2))) = store0((**int8)(unsafe.Pointer(&(_105_pOld.X1))), nil)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_105_pOld.X5))))) = nil
}
_sqlite3SrcListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))))
goto _323
_321:
_sqlite3SrcListShiftJoinType(tls, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))))
_106_pSubquery = _sqlite3SelectNew(tls, _pParse, nil, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), nil, nil, nil, nil, uint32(i32(2048)), nil, nil)
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3SrcListAppendFromTerm(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), nil, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), _106_pSubquery, (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
_323:
goto _281
_124:
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X0))) = nil
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X1))) = uint32(i32(0))
goto _281
_126:
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_127:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(1)
goto _281
_128:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), nil, nil)
goto _281
_129:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), nil)
goto _281
_130:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))) = _sqlite3JoinType(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_131:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_135:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_140:
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
goto _281
_141:
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))) = nil
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1))) = uint32(i32(1))
goto _281
_142:
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_143:
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_145:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_147:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))
_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_148:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))
_sqlite3ExprListSetSortOrder(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_149:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(0)
goto _281
_150:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(1)
goto _281
_151:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(-1)
goto _281
_152:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X0))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))).X1))))) = nil
goto _281
_153:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1))))) = nil
goto _281
_154:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_155:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X1))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_pcache_page)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_156:
_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2)))))), uint8(i32(1)))
_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_sqlite3DeleteFrom(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_157:
_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2)))))), uint8(i32(1)))
_sqlite3SrcListIndexedBy(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))
_sqlite3ExprListCheckLength(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), str(27269))
_sqlite3Update(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))))
goto _281
_158:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(1))
goto _281
_159:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_160:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(1))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer(&_4_yylhsminor)))
goto _281
_161:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppendVector(tls, _pParse, nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_162:
_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2)))))), uint8(i32(1)))
_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
goto _281
_163:
_sqlite3WithPush(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2)))))), uint8(i32(1)))
_sqlite3Insert(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), nil, (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))))
goto _281
_164:
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_165:
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_166:
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))) = _sqlite3IdListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_167:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0)
goto _281
_168:
_spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X1), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_171:
_spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), _pParse, i32(27), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_173:
_143_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(1))
_143_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _143_temp1, _143_temp2)
goto _281
_174:
_144_temp1 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), i32(1))
_144_temp2 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), i32(1))
_144_temp3 = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(27), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
_144_temp4 = _sqlite3PExpr(tls, _pParse, i32(122), _144_temp2, _144_temp3)
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(122), _144_temp1, _144_temp4)
goto _281
_175:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X1))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X2))) = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1)))))))
if (*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X2)))
*p = (*p) | uint32(i32(8388612))
sink5 = *p
}
}
*(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
goto _281
_176:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(0))))) != i32(35) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr(i32(1)))))))))&i32(4)) == 0 {
_147_n = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1
_spanExpr(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), _pParse, i32(135), *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_sqlite3ExprAssignVarNumber(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0), _147_n)
goto _327
}
_148_t = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
func() {
if (_148_t.X1) < uint32(i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138336), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27278)))
crt.X__builtin_abort(tls)
}
}()
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), &_148_t, &_148_t)
if int32(_pParse.X6) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(27285), unsafe.Pointer(&_148_t))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))))) = nil
goto _331
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(157), nil, nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0) != nil {
_sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_148_t.X0))+1*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0).X8))))
}
_331:
_327:
goto _281
_177:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprAddCollateToken(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X1)))
goto _281
_178:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(37), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), i32(1))
_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0), nil)
goto _281
_179:
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) != nil) && (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(6)))))) {
_sqlite3ErrorMsg(tls, _pParse, str(27309), unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))))
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
if ((*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))) == i32(1)) && ((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil) {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X2)))
*p = (*p) | uint32(i32(16))
sink5 = *p
}
}
*(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
goto _281
_180:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))
_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
goto _281
_181:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3ExprFunction(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
goto _281
_182:
_158_pList = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0))))) = _sqlite3PExpr(tls, _pParse, i32(158), nil, nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0) != nil {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)).X0).X6))))))) = _158_pList
_spanSet(tls, (*XExprSpan)(unsafe.Pointer(&_4_yylhsminor)), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _338
}
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _158_pList)
_338:
*(*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))) = *(*XExprSpan)(unsafe.Pointer(&_4_yylhsminor))
goto _281
_183:
_spanBinaryExpr(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_191:
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
{
p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1)))
*p = (*p) | u32(2147483648)
sink5 = *p
}
goto _281
_192:
_163_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1) & u32(2147483648))
{
p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1)))
*p = (*p) & uint32(i32(2147483647))
sink5 = *p
}
_163_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
_163_pList = _sqlite3ExprListAppend(tls, _pParse, _163_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _163_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_exprNot(tls, _pParse, _163_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X2
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0) != nil {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0).X2)))
*p = (*p) | uint32(i32(128))
sink5 = *p
}
}
goto _281
_193:
_164_bNot = int32(((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X1) & u32(2147483648))
{
p := (*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X1)))
*p = (*p) & uint32(i32(2147483647))
sink5 = *p
}
_164_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))
_164_pList = _sqlite3ExprListAppend(tls, _pParse, _164_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprFunction(tls, _pParse, _164_pList, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))
_exprNot(tls, _pParse, _164_bNot, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X2
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0) != nil {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0).X2)))
*p = (*p) | uint32(i32(128))
sink5 = *p
}
}
goto _281
_194:
_spanUnaryPostfix(tls, _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_195:
_spanUnaryPostfix(tls, _pParse, i32(76), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_196:
_spanBinaryExpr(tls, _pParse, i32(72), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0), i32(75))
goto _281
_197:
_spanBinaryExpr(tls, _pParse, i32(148), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_binaryToUnaryIfNull(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0), i32(76))
goto _281
_198:
_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), _pParse, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-1)))).X1), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_200:
_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), _pParse, i32(155), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_201:
_spanUnaryPrefix(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), _pParse, i32(156), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_202:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(0)
goto _281
_204:
_173_pList = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
_173_pList = _sqlite3ExprListAppend(tls, _pParse, _173_pList, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(73), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0) != nil {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0).X6))))))) = _173_pList
goto _342
}
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _173_pList)
_342:
_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X2))) = (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X2
goto _281
_205:
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) == nil {
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+8*uintptr(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))))), i32(1))
goto _351
}
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X0) != i32(1) {
goto _345
}
_178_pRHS = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X2))))) + 20*uintptr(i32(0)))).X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X2))))) + 20*uintptr(i32(0)))).X0))))) = nil
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
if func() int32 {
if _178_pRHS != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138522), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_178_pRHS.X2)))
*p = (*p) & uint32(i32(-257))
sink5 = *p
}
{
p := (*uint32)(unsafe.Pointer(&(_178_pRHS.X2)))
*p = (*p) | uint32(i32(512))
sink5 = *p
}
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, func() int32 {
if (*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))) != 0 {
return i32(77)
}
return i32(78)
}(), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), _178_pRHS)
goto _351
_345:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0) != nil {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0).X6))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))
goto _353
}
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
_353:
_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
_351:
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X1)))
goto _281
_206:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(119), nil, nil)
_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
goto _281
_207:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), nil)
_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X1)))
goto _281
_208:
_185_pSrc = _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
_185_pSelect = _sqlite3SelectNew(tls, _pParse, nil, _185_pSrc, nil, nil, nil, nil, uint32(i32(0)), nil, nil)
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))) != nil {
_sqlite3SrcListFuncArgs(tls, _pParse, func() *XSrcList {
if _185_pSelect != nil {
return _185_pSrc
}
return nil
}(), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(74), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), nil)
_sqlite3PExprAddSelect(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0), _185_pSelect)
_exprNot(tls, _pParse, *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
*(**int8)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X2))) = func() *int8 {
if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0) != nil {
return (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-1)))).X2))))).X1)))
}
return (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0)) + 1*uintptr((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-2)))).X2))))).X1)))
}()
goto _281
_209:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
_186_p = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0))))), _sqlite3PExpr(tls, _pParse, i32(20), nil, nil))
_sqlite3PExprAddSelect(tls, _pParse, _186_p, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
goto _281
_210:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(136), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0) != nil {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0).X6))))))) = func() *XExprList {
if (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) != nil {
return _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
}
return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))
}()
_sqlite3ExprSetHeightAndFlags(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0))
goto _362
}
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))))
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
_362:
goto _281
_211:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_212:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_213:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_214:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_215:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))) = _sqlite3ExprListAppend(tls, _pParse, nil, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_216:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_218:
_sqlite3CreateIndex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))), _sqlite3SrcListAppend(tls, (*Xsqlite3)(_pParse.X0), nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-4)))).X2))))), nil), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-10)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-11)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), i32(0), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2))))), uint8(i32(0)))
goto _281
_219:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(2)
goto _281
_221:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(0)
goto _281
_222:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_223:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = _parserAddExprIdListTerm(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_224:
_sqlite3DropIndex(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_225:
_sqlite3Vacuum(tls, _pParse, nil)
goto _281
_226:
_sqlite3Vacuum(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_227:
_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), nil, i32(0))
goto _281
_228:
_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(0))
goto _281
_229:
_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), i32(0))
goto _281
_230:
_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), i32(1))
goto _281
_231:
_sqlite3Pragma(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), i32(1))
goto _281
_232:
*(**int8)(unsafe.Pointer(&(_209_all.X0))) = (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0
*(*uint32)(unsafe.Pointer(&(_209_all.X1))) = uint32(int32((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(0)))).X2))))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-3)))).X2))))).X0)))/1)) + ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1)
_sqlite3FinishTrigger(tls, _pParse, (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), &_209_all)
goto _281
_233:
_sqlite3BeginTrigger(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X0, (*XIdList)((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))).X1), (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-10)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-8)))).X2))))))
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-10)))).X2))))) = func() XToken {
if ((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))).X1) == uint32(i32(0)) {
return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))))
}
return (*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))
}()
goto _281
_234:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(34)
goto _281
_235:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(30)
goto _281
_236:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))) = i32(48)
goto _281
_237:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))) = i32(34)
goto _281
_238:
*(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))) = int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X1)
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X1))))) = nil
goto _281
_240:
*(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X0))) = i32(110)
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))).X1))))) = (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_241:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_243:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0)
goto _281
_245:
func() {
if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138703), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27343)))
crt.X__builtin_abort(tls)
}
}()
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))).X9).X8))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_246:
func() {
if (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138710), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27368)))
crt.X__builtin_abort(tls)
}
}()
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))).X9))))) = (*XTriggerStep)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_247:
*(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))) = *(*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))
_sqlite3ErrorMsg(tls, _pParse, str(27393))
goto _281
_248:
_sqlite3ErrorMsg(tls, _pParse, str(27488))
goto _281
_249:
_sqlite3ErrorMsg(tls, _pParse, str(27572))
goto _281
_250:
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-6)))).X2))))))) = _sqlite3TriggerUpdateStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2)))))))
goto _281
_251:
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerInsertStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), uint8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))))
goto _281
_252:
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))) = _sqlite3TriggerDeleteStep(tls, (*Xsqlite3)(_pParse.X0), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_253:
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))) = _sqlite3TriggerSelectStep(tls, (*Xsqlite3)(_pParse.X0), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_254:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0))))) = _sqlite3PExpr(tls, _pParse, i32(56), nil, nil)
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0) != nil {
*(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0).X1))) = int8(i32(4))
}
goto _281
_255:
_spanSet(tls, (*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(56), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), i32(1))
if (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0) != nil {
*(*int8)(unsafe.Pointer(&((*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))).X0).X1))) = int8(*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))))
}
goto _281
_256:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(1)
goto _281
_257:
*(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))) = i32(3)
goto _281
_258:
_sqlite3DropTrigger(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_259:
_sqlite3Attach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))).X0), (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X0), (*XExpr)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_260:
_sqlite3Detach(tls, _pParse, (*XExpr)((*XExprSpan)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))).X0))
goto _281
_261:
_sqlite3Reindex(tls, _pParse, nil, nil)
goto _281
_262:
_sqlite3Reindex(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_263:
_sqlite3Analyze(tls, _pParse, nil, nil)
goto _281
_264:
_sqlite3Analyze(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_265:
_sqlite3AlterRenameTable(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_266:
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))).X1))) = uint32(int32((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(i32(-1)))).X2))))).X0)))/1)) + ((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1)
_sqlite3AlterFinishAddColumn(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))
goto _281
_267:
_disableLookaside(tls, _pParse)
_sqlite3AlterBeginAddColumn(tls, _pParse, (*XSrcList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2)))))))
goto _281
_268:
_sqlite3VtabFinishParse(tls, _pParse, nil)
goto _281
_269:
_sqlite3VtabFinishParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_270:
_sqlite3VtabBeginParse(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-3)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))), *(*int32)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2))))))
goto _281
_271:
_sqlite3VtabArgInit(tls, _pParse)
goto _281
_272:
_sqlite3VtabArgExtend(tls, _pParse, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_275:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(1)))).X2))))))) = nil
goto _281
_276:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_277:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-2)))).X2))))))) = (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(0)))).X2))))))
goto _281
_278:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, nil, (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
goto _281
_279:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2))))))) = _sqlite3WithAdd(tls, _pParse, (*XWith)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-7)))).X2)))))), (*XToken)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-5)))).X2))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-4)))).X2)))))), (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*XYYMINORTYPE)(unsafe.Pointer(&((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp)) + 16*uintptr(i32(-1)))).X2)))))))
goto _281
_280:
func() {
if _yyruleno == uint32(i32(277)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138857), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27657)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(294)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138874), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27671)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(295)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138875), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27685)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(301)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138881), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27699)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(303)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138883), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27713)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(304)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138884), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27727)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(305)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138885), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27741)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(309)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138889), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27755)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(312)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138892), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27769)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _yyruleno == uint32(i32(313)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138893), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27783)))
crt.X__builtin_abort(tls)
}
}()
goto _281
_281:
func() {
if _yyruleno >= u32(332) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138915), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27797)))
crt.X__builtin_abort(tls)
}
}()
_yygoto = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X0)
_yysize = int32((*t35)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yyRuleInfo)) + 2*uintptr(_yyruleno))).X1)
_yyact = _yy_find_reduce_action(tls, int32((*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yymsp))+16*uintptr(-_yysize))).X0), uint8(_yygoto))
if _yyact > i32(999) {
goto _393
}
if _yyact > i32(455) {
{
p := &_yyact
*p = (*p) + i32(332)
sink1 = *p
}
}
{
p := &_yymsp
*p = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 16*uintptr(_yysize-i32(1))))
sink34 = *p
}
*(**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0))))) = _yymsp
*(*uint16)(unsafe.Pointer(&(_yymsp.X0))) = uint16(_yyact)
*(*uint8)(unsafe.Pointer(&(_yymsp.X1))) = uint8(_yygoto)
_yyTraceShift(tls, _yypParser, _yyact)
goto _395
_393:
func() {
if _yyact != i32(1333) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138929), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_reduceØ00__func__Ø000))), unsafe.Pointer(str(27847)))
crt.X__builtin_abort(tls)
}
}()
{
p := (**XyyStackEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X0)))))
*p = (*XyyStackEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 16*uintptr(_yysize)))
sink34 = *p
}
_yy_accept(tls, _yypParser)
_395:
_ = _4_yylhsminor
_ = _34_v
_ = _35_v
_ = _70_dest
_ = _75_x
_ = _80_s
_ = _148_t
_ = _209_all
}
var _yyRuleInfo [332]struct {
X0 uint8
X1 uint8
}
func init() {
_yyRuleInfo = [332]struct {
X0 uint8
X1 uint8
}{t35{X0: u8(147), X1: u8(1)}, t35{X0: u8(147), X1: u8(3)}, t35{X0: u8(148), X1: u8(1)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(150), X1: u8(0)}, t35{X0: u8(150), X1: u8(1)}, t35{X0: u8(150), X1: u8(1)}, t35{X0: u8(150), X1: u8(1)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(149), X1: u8(5)}, t35{X0: u8(154), X1: u8(6)}, t35{X0: u8(156), X1: u8(1)}, t35{X0: u8(158), X1: u8(0)}, t35{X0: u8(158), X1: u8(3)}, t35{X0: u8(157), X1: u8(1)}, t35{X0: u8(157), X1: u8(0)}, t35{X0: u8(155), X1: u8(5)}, t35{X0: u8(155), X1: u8(2)}, t35{X0: u8(162), X1: u8(0)}, t35{X0: u8(162), X1: u8(2)}, t35{X0: u8(164), X1: u8(2)}, t35{X0: u8(166), X1: u8(0)}, t35{X0: u8(166), X1: u8(4)}, t35{X0: u8(166), X1: u8(6)}, t35{X0: u8(167), X1: u8(2)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(171), X1: u8(4)}, t35{X0: u8(171), X1: u8(3)}, t35{X0: u8(171), X1: u8(3)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(171), X1: u8(3)}, t35{X0: u8(171), X1: u8(5)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(171), X1: u8(4)}, t35{X0: u8(171), X1: u8(4)}, t35{X0: u8(171), X1: u8(1)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(176), X1: u8(0)}, t35{X0: u8(176), X1: u8(1)}, t35{X0: u8(178), X1: u8(0)}, t35{X0: u8(178), X1: u8(2)}, t35{X0: u8(180), X1: u8(2)}, t35{X0: u8(180), X1: u8(3)}, t35{X0: u8(180), X1: u8(3)}, t35{X0: u8(180), X1: u8(3)}, t35{X0: u8(181), X1: u8(2)}, t35{X0: u8(181), X1: u8(2)}, t35{X0: u8(181), X1: u8(1)}, t35{X0: u8(181), X1: u8(1)}, t35{X0: u8(181), X1: u8(2)}, t35{X0: u8(179), X1: u8(3)}, t35{X0: u8(179), X1: u8(2)}, t35{X0: u8(182), X1: u8(0)}, t35{X0: u8(182), X1: u8(2)}, t35{X0: u8(182), X1: u8(2)}, t35{X0: u8(161), X1: u8(0)}, t35{X0: u8(184), X1: u8(1)}, t35{X0: u8(185), X1: u8(2)}, t35{X0: u8(185), X1: u8(7)}, t35{X0: u8(185), X1: u8(5)}, t35{X0: u8(185), X1: u8(5)}, t35{X0: u8(185), X1: u8(10)}, t35{X0: u8(188), X1: u8(0)}, t35{X0: u8(174), X1: u8(0)}, t35{X0: u8(174), X1: u8(3)}, t35{X0: u8(189), X1: u8(0)}, t35{X0: u8(189), X1: u8(2)}, t35{X0: u8(190), X1: u8(1)}, t35{X0: u8(190), X1: u8(1)}, t35{X0: u8(149), X1: u8(4)}, t35{X0: u8(192), X1: u8(2)}, t35{X0: u8(192), X1: u8(0)}, t35{X0: u8(149), X1: u8(9)}, t35{X0: u8(149), X1: u8(4)}, t35{X0: u8(149), X1: u8(1)}, t35{X0: u8(163), X1: u8(2)}, t35{X0: u8(194), X1: u8(3)}, t35{X0: u8(197), X1: u8(1)}, t35{X0: u8(197), X1: u8(2)}, t35{X0: u8(197), X1: u8(1)}, t35{X0: u8(195), X1: u8(9)}, t35{X0: u8(206), X1: u8(4)}, t35{X0: u8(206), X1: u8(5)}, t35{X0: u8(198), X1: u8(1)}, t35{X0: u8(198), X1: u8(1)}, t35{X0: u8(198), X1: u8(0)}, t35{X0: u8(209), X1: u8(0)}, t35{X0: u8(199), X1: u8(3)}, t35{X0: u8(199), X1: u8(2)}, t35{X0: u8(199), X1: u8(4)}, t35{X0: u8(210), X1: u8(2)}, t35{X0: u8(210), X1: u8(0)}, t35{X0: u8(200), X1: u8(0)}, t35{X0: u8(200), X1: u8(2)}, t35{X0: u8(212), X1: u8(2)}, t35{X0: u8(212), X1: u8(0)}, t35{X0: u8(211), X1: u8(7)}, t35{X0: u8(211), X1: u8(9)}, t35{X0: u8(211), X1: u8(7)}, t35{X0: u8(211), X1: u8(7)}, t35{X0: u8(159), X1: u8(0)}, t35{X0: u8(159), X1: u8(2)}, t35{X0: u8(193), X1: u8(2)}, t35{X0: u8(213), X1: u8(1)}, t35{X0: u8(213), X1: u8(2)}, t35{X0: u8(213), X1: u8(3)}, t35{X0: u8(213), X1: u8(4)}, t35{X0: u8(215), X1: u8(2)}, t35{X0: u8(215), X1: u8(0)}, t35{X0: u8(214), X1: u8(0)}, t35{X0: u8(214), X1: u8(3)}, t35{X0: u8(214), X1: u8(2)}, t35{X0: u8(216), X1: u8(4)}, t35{X0: u8(216), X1: u8(0)}, t35{X0: u8(204), X1: u8(0)}, t35{X0: u8(204), X1: u8(3)}, t35{X0: u8(186), X1: u8(4)}, t35{X0: u8(186), X1: u8(2)}, t35{X0: u8(175), X1: u8(1)}, t35{X0: u8(175), X1: u8(1)}, t35{X0: u8(175), X1: u8(0)}, t35{X0: u8(202), X1: u8(0)}, t35{X0: u8(202), X1: u8(3)}, t35{X0: u8(203), X1: u8(0)}, t35{X0: u8(203), X1: u8(2)}, t35{X0: u8(205), X1: u8(0)}, t35{X0: u8(205), X1: u8(2)}, t35{X0: u8(205), X1: u8(4)}, t35{X0: u8(205), X1: u8(4)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(201), X1: u8(0)}, t35{X0: u8(201), X1: u8(2)}, t35{X0: u8(149), X1: u8(8)}, t35{X0: u8(218), X1: u8(5)}, t35{X0: u8(218), X1: u8(7)}, t35{X0: u8(218), X1: u8(3)}, t35{X0: u8(218), X1: u8(5)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(149), X1: u8(7)}, t35{X0: u8(219), X1: u8(2)}, t35{X0: u8(219), X1: u8(1)}, t35{X0: u8(220), X1: u8(0)}, t35{X0: u8(220), X1: u8(3)}, t35{X0: u8(217), X1: u8(3)}, t35{X0: u8(217), X1: u8(1)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(172), X1: u8(1)}, t35{X0: u8(173), X1: u8(1)}, t35{X0: u8(173), X1: u8(1)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(172), X1: u8(1)}, t35{X0: u8(172), X1: u8(1)}, t35{X0: u8(172), X1: u8(1)}, t35{X0: u8(173), X1: u8(1)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(6)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(4)}, t35{X0: u8(172), X1: u8(1)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(221), X1: u8(2)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(2)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(4)}, t35{X0: u8(173), X1: u8(2)}, t35{X0: u8(173), X1: u8(2)}, t35{X0: u8(173), X1: u8(2)}, t35{X0: u8(173), X1: u8(2)}, t35{X0: u8(222), X1: u8(1)}, t35{X0: u8(222), X1: u8(2)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(223), X1: u8(1)}, t35{X0: u8(223), X1: u8(2)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(3)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(173), X1: u8(4)}, t35{X0: u8(173), X1: u8(5)}, t35{X0: u8(226), X1: u8(5)}, t35{X0: u8(226), X1: u8(4)}, t35{X0: u8(227), X1: u8(2)}, t35{X0: u8(227), X1: u8(0)}, t35{X0: u8(225), X1: u8(1)}, t35{X0: u8(225), X1: u8(0)}, t35{X0: u8(208), X1: u8(0)}, t35{X0: u8(207), X1: u8(3)}, t35{X0: u8(207), X1: u8(1)}, t35{X0: u8(224), X1: u8(0)}, t35{X0: u8(224), X1: u8(3)}, t35{X0: u8(149), X1: u8(12)}, t35{X0: u8(228), X1: u8(1)}, t35{X0: u8(228), X1: u8(0)}, t35{X0: u8(177), X1: u8(0)}, t35{X0: u8(177), X1: u8(3)}, t35{X0: u8(187), X1: u8(5)}, t35{X0: u8(187), X1: u8(3)}, t35{X0: u8(229), X1: u8(0)}, t35{X0: u8(229), X1: u8(2)}, t35{X0: u8(149), X1: u8(4)}, t35{X0: u8(149), X1: u8(1)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(149), X1: u8(5)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(149), X1: u8(5)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(169), X1: u8(2)}, t35{X0: u8(170), X1: u8(2)}, t35{X0: u8(149), X1: u8(5)}, t35{X0: u8(231), X1: u8(11)}, t35{X0: u8(233), X1: u8(1)}, t35{X0: u8(233), X1: u8(1)}, t35{X0: u8(233), X1: u8(2)}, t35{X0: u8(233), X1: u8(0)}, t35{X0: u8(234), X1: u8(1)}, t35{X0: u8(234), X1: u8(1)}, t35{X0: u8(234), X1: u8(3)}, t35{X0: u8(236), X1: u8(0)}, t35{X0: u8(236), X1: u8(2)}, t35{X0: u8(232), X1: u8(3)}, t35{X0: u8(232), X1: u8(2)}, t35{X0: u8(238), X1: u8(3)}, t35{X0: u8(239), X1: u8(3)}, t35{X0: u8(239), X1: u8(2)}, t35{X0: u8(237), X1: u8(7)}, t35{X0: u8(237), X1: u8(5)}, t35{X0: u8(237), X1: u8(5)}, t35{X0: u8(237), X1: u8(1)}, t35{X0: u8(173), X1: u8(4)}, t35{X0: u8(173), X1: u8(6)}, t35{X0: u8(191), X1: u8(1)}, t35{X0: u8(191), X1: u8(1)}, t35{X0: u8(191), X1: u8(1)}, t35{X0: u8(149), X1: u8(4)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(241), X1: u8(0)}, t35{X0: u8(241), X1: u8(2)}, t35{X0: u8(149), X1: u8(1)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(149), X1: u8(1)}, t35{X0: u8(149), X1: u8(3)}, t35{X0: u8(149), X1: u8(6)}, t35{X0: u8(149), X1: u8(7)}, t35{X0: u8(242), X1: u8(1)}, t35{X0: u8(149), X1: u8(1)}, t35{X0: u8(149), X1: u8(4)}, t35{X0: u8(244), X1: u8(8)}, t35{X0: u8(246), X1: u8(0)}, t35{X0: u8(247), X1: u8(1)}, t35{X0: u8(247), X1: u8(3)}, t35{X0: u8(248), X1: u8(1)}, t35{X0: u8(196), X1: u8(0)}, t35{X0: u8(196), X1: u8(2)}, t35{X0: u8(196), X1: u8(3)}, t35{X0: u8(250), X1: u8(6)}, t35{X0: u8(250), X1: u8(8)}, t35{X0: u8(144), X1: u8(1)}, t35{X0: u8(145), X1: u8(2)}, t35{X0: u8(145), X1: u8(1)}, t35{X0: u8(146), X1: u8(1)}, t35{X0: u8(146), X1: u8(3)}, t35{X0: u8(147), X1: u8(0)}, t35{X0: u8(151), X1: u8(0)}, t35{X0: u8(151), X1: u8(1)}, t35{X0: u8(151), X1: u8(2)}, t35{X0: u8(153), X1: u8(1)}, t35{X0: u8(153), X1: u8(0)}, t35{X0: u8(149), X1: u8(2)}, t35{X0: u8(160), X1: u8(4)}, t35{X0: u8(160), X1: u8(2)}, t35{X0: u8(152), X1: u8(1)}, t35{X0: u8(152), X1: u8(1)}, t35{X0: u8(152), X1: u8(1)}, t35{X0: u8(166), X1: u8(1)}, t35{X0: u8(167), X1: u8(1)}, t35{X0: u8(168), X1: u8(1)}, t35{X0: u8(168), X1: u8(1)}, t35{X0: u8(165), X1: u8(2)}, t35{X0: u8(165), X1: u8(0)}, t35{X0: u8(171), X1: u8(2)}, t35{X0: u8(161), X1: u8(2)}, t35{X0: u8(183), X1: u8(3)}, t35{X0: u8(183), X1: u8(1)}, t35{X0: u8(184), X1: u8(0)}, t35{X0: u8(188), X1: u8(1)}, t35{X0: u8(190), X1: u8(1)}, t35{X0: u8(194), X1: u8(1)}, t35{X0: u8(195), X1: u8(1)}, t35{X0: u8(209), X1: u8(2)}, t35{X0: u8(210), X1: u8(1)}, t35{X0: u8(173), X1: u8(1)}, t35{X0: u8(221), X1: u8(1)}, t35{X0: u8(208), X1: u8(1)}, t35{X0: u8(230), X1: u8(1)}, t35{X0: u8(230), X1: u8(1)}, t35{X0: u8(230), X1: u8(1)}, t35{X0: u8(230), X1: u8(1)}, t35{X0: u8(230), X1: u8(1)}, t35{X0: u8(169), X1: u8(1)}, t35{X0: u8(235), X1: u8(0)}, t35{X0: u8(235), X1: u8(3)}, t35{X0: u8(238), X1: u8(1)}, t35{X0: u8(239), X1: u8(0)}, t35{X0: u8(240), X1: u8(1)}, t35{X0: u8(240), X1: u8(0)}, t35{X0: u8(243), X1: u8(0)}, t35{X0: u8(243), X1: u8(1)}, t35{X0: u8(245), X1: u8(1)}, t35{X0: u8(245), X1: u8(3)}, t35{X0: u8(246), X1: u8(2)}, t35{X0: u8(249), X1: u8(0)}, t35{X0: u8(249), X1: u8(4)}, t35{X0: u8(249), X1: u8(2)}}
}
var _yyRuleName [332]*int8
func init() {
_yyRuleName = [332]*int8{str(27873), str(27893), str(27924), str(27937), str(27971), str(27985), str(28008), str(28032), str(28056), str(28081), str(28103), str(28130), str(28151), str(28184), str(28231), str(28288), str(28308), str(28324), str(28354), str(28368), str(28377), str(28443), str(28475), str(28493), str(28522), str(28550), str(28564), str(28600), str(28649), str(28681), str(28705), str(28728), str(28757), str(28785), str(28814), str(28843), str(28869), str(28916), str(28940), str(28967), str(29011), str(29037), str(29065), str(29077), str(29098), str(29110), str(29137), str(29157), str(29185), str(29213), str(29241), str(29261), str(29284), str(29303), str(29323), str(29344), str(29402), str(29456), str(29483), str(29529), str(29576), str(29593), str(29614), str(29638), str(29690), str(29729), str(29763), str(29853), str(29877), str(29888), str(29923), str(29934), str(29960), str(29983), str(30007), str(30044), str(30067), str(30080), str(30149), str(30185), str(30200), str(30229), str(30284), str(30309), str(30338), str(30374), str(30475), str(30509), str(30548), str(30570), str(30587), str(30600), str(30609), str(30637), str(30662), str(30694), str(30707), str(30714), str(30723), str(30748), str(30781), str(30796), str(30862), str(30931), str(30990), str(31053), str(31062), str(31078), str(31099), str(31121), str(31145), str(31172), str(31202), str(31221), str(31232), str(31248), str(31278), str(31306), str(31339), str(31353), str(31369), str(31403), str(31446), str(31474), str(31492), str(31511), str(31525), str(31541), str(31576), str(31591), str(31618), str(31632), str(31657), str(31694), str(31730), str(31786), str(31800), str(31825), str(31895), str(31932), str(31979), str(32002), str(32035), str(32091), str(32155), str(32184), str(32207), str(32222), str(32250), str(32277), str(32291), str(32311), str(32325), str(32345), str(32362), str(32381), str(32407), str(32427), str(32443), str(32460), str(32478), str(32510), str(32548), str(32592), str(32623), str(32641), str(32677), str(32700), str(32722), str(32753), str(32778), str(32824), str(32854), str(32888), str(32914), str(32943), str(32969), str(33007), str(33036), str(33059), str(33081), str(33107), str(33125), str(33146), str(33166), str(33185), str(33208), str(33235), str(33274), str(33287), str(33304), str(33339), str(33361), str(33394), str(33437), str(33466), str(33521), str(33573), str(33611), str(33635), str(33649), str(33671), str(33688), str(33701), str(33736), str(33755), str(33774), str(33808), str(33893), str(33915), str(33930), str(33946), str(33976), str(34023), str(34056), str(34068), str(34098), str(34135), str(34150), str(34168), str(34191), str(34223), str(34258), str(34294), str(34333), str(34365), str(34399), str(34456), str(34572), str(34596), str(34619), str(34647), str(34664), str(34696), str(34721), str(34756), str(34772), str(34798), str(34853), str(34891), str(34910), str(34936), str(34960), str(35025), str(35080), str(35131), str(35154), str(35182), str(35222), str(35245), str(35265), str(35284), str(35323), str(35375), str(35411), str(35423), str(35444), str(35460), str(35484), str(35500), str(35524), str(35566), str(35643), str(35676), str(35696), str(35734), str(35802), str(35814), str(35835), str(35866), str(35876), str(35885), str(35906), str(35937), str(35979), str(36034), str(36052), str(36077), str(36094), str(36108), str(36135), str(36147), str(36161), str(36187), str(36216), str(36244), str(36262), str(36301), str(36353), str(36388), str(36406), str(36420), str(36435), str(36458), str(36481), str(36501), str(36522), str(36550), str(36563), str(36585), str(36617), str(36656), str(36675), str(36690), str(36730), str(36756), str(36783), str(36804), str(36830), str(36847), str(36861), str(36886), str(36909), str(36928), str(36941), str(36954), str(36971), str(36989), str(37016), str(37035), str(37067), str(37079), str(37091), str(37120), str(37140), str(37157), str(37183), str(37207), str(37249), str(37282), str(37294), str(37328)}
}
// 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 _sqlite3FinishCoding(tls *crt.TLS, _pParse *XParse) {
var _3_iDb, _3_i int32
var _5_vtab *int8
var _db *Xsqlite3
var _4_pSchema *XSchema
var _v *TVdbe
var _6_pEL *XExprList
func() {
if (*XParse)(_pParse.X39) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99832), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37352)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X6) != 0 {
return
}
if (_db.X17) == 0 && (_pParse.X16) == 0 {
goto _4
}
if (_pParse.X3) == i32(0) {
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1)
}
return
_4:
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if (_pParse.X8) != 0 && _sqlite3VdbeAssertMayAbort(tls, _v, int32(_pParse.X9)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99844), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37373)))
crt.X__builtin_abort(tls)
}
}()
if _v == nil {
goto _9
}
_sqlite3VdbeAddOp0(tls, _v, i32(55))
if int32(_db.X17) != i32(0) || (_pParse.X30) == uint32(i32(0)) && (*XExprList)(_pParse.X27) == nil {
goto _12
}
func() {
if int32(_sqlite3VdbeGetOp(tls, _v, i32(0)).X0) != i32(51) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99870), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37445)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeJumpHere(tls, _v, i32(0))
_3_iDb = i32(0)
_15:
if _3_iDb >= (_db.X5) {
goto _18
}
if bool2int(((_pParse.X30)&(u32(1)<= (_pParse.X56) {
goto _25
}
_5_vtab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, *(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParse.X67)) + 4*uintptr(_3_i))))))
_sqlite3VdbeAddOp4(tls, _v, i32(155), i32(0), i32(0), i32(0), _5_vtab, i32(-8))
_3_i += 1
goto _22
_25:
*(*int32)(unsafe.Pointer(&(_pParse.X56))) = i32(0)
_codeTableLocks(tls, _pParse)
_sqlite3AutoincrementBegin(tls, _pParse)
if (*XExprList)(_pParse.X27) == nil {
goto _26
}
_6_pEL = (*XExprList)(_pParse.X27)
*(*uint8)(unsafe.Pointer(&(_pParse.X11))) = uint8(i32(0))
_3_i = i32(0)
_27:
if _3_i >= (_6_pEL.X0) {
goto _30
}
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEL.X2)))))+20*uintptr(_3_i))).X0), *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEL.X2))))) + 20*uintptr(_3_i))).X5))))))
_3_i += 1
goto _27
_30:
_26:
_sqlite3VdbeGoto(tls, _v, i32(1))
_12:
_9:
if _v == nil || (_pParse.X16) != i32(0) || (_db.X17) != 0 {
goto _33
}
func() {
if (_pParse.X23) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishCodingØ00__func__Ø000))), unsafe.Pointer(str(37504)))
crt.X__builtin_abort(tls)
}
}()
if ((*TAggInfo_func)(_pParse.X38) != nil) && ((_pParse.X17) == i32(0)) {
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(1)
}
_sqlite3VdbeMakeReady(tls, _v, _pParse)
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(101)
goto _38
_33:
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1)
_38:
}
var _sqlite3FinishCodingØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FinishCodingØ00__func__Ø000[0], str(37527), 20)
}
func _sqlite3GetVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
return func() *TVdbe {
if _v != nil {
return _v
}
return _allocVdbe(tls, _pParse)
}()
}
// 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 _allocVdbe(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
var _v *TVdbe
_v = store38((**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X2))))), _sqlite3VdbeCreate(tls, _pParse))
if _v != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(51), i32(0), i32(1))
}
if ((*XParse)(_pParse.X39) == nil) && ((int32((*Xsqlite3)(_pParse.X0).X13) & i32(8)) == i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pParse.X11))) = uint8(i32(1))
}
return _v
}
// Create a new virtual database engine.
func _sqlite3VdbeCreate(tls *crt.TLS, _pParse *XParse) (r0 *TVdbe) {
var _db *Xsqlite3
var _p *TVdbe
_db = (*Xsqlite3)(_pParse.X0)
_p = (*TVdbe)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(204))))
if _p == nil {
return nil
}
crt.Xmemset(tls, (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17)))), i32(0), u32(120))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db
if (*TVdbe)(_db.X1) != nil {
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_db.X1).X1))))) = _p
}
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*TVdbe)(_db.X1)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = nil
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X1))))) = _p
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(381479589))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _pParse
func() {
if (_pParse.X26) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71456), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37547)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pParse.X25) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71457), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37565)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pParse.X19) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71458), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37583)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pParse.X20) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71459), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCreateØ00__func__Ø000))), unsafe.Pointer(str(37603)))
crt.X__builtin_abort(tls)
}
}()
return _p
}
var _sqlite3VdbeCreateØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeCreateØ00__func__Ø000[0], str(37624), 18)
}
func _sqlite3VdbeAddOp2(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32) (r0 int32) {
return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, i32(0))
}
func _sqlite3VdbeAddOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
var _i, _2_jj, _2_kk int32
var _2_pParse *XParse
var _pOp *XVdbeOp
var _3_x *TyColCache
_i = _p.X27
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71595), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op < i32(0) || _op >= i32(255) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71596), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOp3Ø00__func__Ø000))), unsafe.Pointer(str(37668)))
crt.X__builtin_abort(tls)
}
}()
if ((*XParse)(_p.X3).X19) <= _i {
return _growOp3(tls, _p, _op, _p1, _p2, _p3)
}
*(*int32)(unsafe.Pointer(&(_p.X27))) += 1
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_i)))
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(_op)
*(*uint16)(unsafe.Pointer(&(_pOp.X2))) = uint16(i32(0))
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = _p1
*(*int32)(unsafe.Pointer(&(_pOp.X4))) = _p2
*(*int32)(unsafe.Pointer(&(_pOp.X5))) = _p3
*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0))
*(**int8)(unsafe.Pointer(&(_pOp.X7))) = nil
if (((*Xsqlite3)(_p.X0).X6) & i32(4096)) == 0 {
goto _6
}
_2_pParse = (*XParse)(_p.X3)
_2_jj = store1(&_2_kk, i32(0))
_7:
if _2_jj >= int32(_2_pParse.X13) {
goto _10
}
_3_x = (*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_2_pParse.X48))))))) + uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(_2_jj)))))*uintptr(unsafe.Pointer((*TyColCache)(unsafe.Pointer(uintptr(20)))))))))))
crt.Xprintf(tls, str(37685), _3_x.X4, _3_x.X0, int32(_3_x.X1))
_2_kk += 1
_2_jj += 1
goto _7
_10:
if _2_kk != 0 {
crt.Xprintf(tls, str(37700))
}
_sqlite3VdbePrintOp(tls, nil, _i, (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_i))))
_test_addop_breakpoint(tls)
_6:
return _i
}
var _sqlite3VdbeAddOp3Ø00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeAddOp3Ø00__func__Ø000[0], str(37702), 18)
}
// Add a new instruction to the list of instructions current in the
// VDBE. Return the address of the new instruction.
//
// Parameters:
//
// p Pointer to the VDBE
//
// op The opcode for this instruction
//
// p1, p2, p3 Operands
//
// Use the sqlite3VdbeResolveLabel() function to fix an address and
// the sqlite3VdbeChangeP4() function to change the value of the P4
// operand.
func _growOp3(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32) (r0 int32) {
func() {
if ((*XParse)(_p.X3).X19) > (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71585), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOp3Ø00__func__Ø000))), unsafe.Pointer(str(37720)))
crt.X__builtin_abort(tls)
}
}()
if _growOpArray(tls, _p, i32(1)) != 0 {
return i32(1)
}
func() {
if ((*XParse)(_p.X3).X19) <= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71587), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOp3Ø00__func__Ø000))), unsafe.Pointer(str(37748)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
}
var _growOp3Ø00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_growOp3Ø00__func__Ø000[0], str(37775), 8)
}
// Resize the Vdbe.aOp array so that it is at least nOp elements larger
// than its current size. nOp is guaranteed to be less than or equal
// to 1024/sizeof(Op).
//
// If an out-of-memory error occurs while resizing the array, return
// SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
// unchanged (this is so that any opcodes already allocated can be
// correctly deallocated along with the rest of the Vdbe).
func _growOpArray(tls *crt.TLS, _v *TVdbe, _nOp int32) (r0 int32) {
var _nNew int32
var _p *XParse
var _pNew *XVdbeOp
_p = (*XParse)(_v.X3)
_nNew = func() int32 {
if (_p.X19) != 0 {
return ((_p.X19) * i32(2))
}
return i32(42)
}()
if _nNew > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(5))))) {
_sqlite3OomFault(tls, (*Xsqlite3)(_p.X0))
return i32(7)
}
func() {
if uint32(_nOp) > u32(42) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71546), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOpArrayØ00__func__Ø000))), unsafe.Pointer(str(37783)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nNew < ((_p.X19) + _nOp) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71547), unsafe.Pointer((*int8)(unsafe.Pointer(&_growOpArrayØ00__func__Ø000))), unsafe.Pointer(str(37806)))
crt.X__builtin_abort(tls)
}
}()
_pNew = (*XVdbeOp)(_sqlite3DbRealloc(tls, (*Xsqlite3)(_p.X0), _v.X17, uint64(uint32(_nNew)*u32(24))))
if _pNew != nil {
*(*int32)(unsafe.Pointer(&(_p.X20))) = _sqlite3DbMallocSize(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_pNew))
*(*int32)(unsafe.Pointer(&(_p.X19))) = int32(uint32(_p.X20) / u32(24))
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X17))))) = _pNew
}
return func() int32 {
if _pNew != nil {
return i32(0)
}
return _sqlite3NomemError(tls, i32(71554))
}()
}
var _growOpArrayØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_growOpArrayØ00__func__Ø000[0], str(37830), 12)
}
// Print a single opcode. This routine is used for debugging only.
func _sqlite3VdbePrintOp(tls *crt.TLS, _pOut *crt.XFILE, _pc int32, _pOp *XVdbeOp) {
var _zP4 *int8
var _zCom [100]int8
var _zPtr [50]int8
if _pOut == nil {
_pOut = (*crt.XFILE)(Xstdout)
}
_zP4 = _displayP4(tls, _pOp, (*int8)(unsafe.Pointer(&_zPtr)), int32(u32(50)))
_displayComment(tls, _pOp, _zP4, (*int8)(unsafe.Pointer(&_zCom)), int32(u32(100)))
crt.Xfprintf(tls, _pOut, _sqlite3VdbePrintOpØ00zFormat1Ø001, _pc, unsafe.Pointer(_sqlite3OpcodeName(tls, int32(_pOp.X0))), _pOp.X3, _pOp.X4, _pOp.X5, unsafe.Pointer(_zP4), int32(_pOp.X2), unsafe.Pointer((*int8)(unsafe.Pointer(&_zCom))))
crt.Xfflush(tls, _pOut)
_ = _zPtr
_ = _zCom
}
// Compute a string that describes the P4 parameter for an opcode.
// Use zTemp for any required temporary buffer space.
func _displayP4(tls *crt.TLS, _pOp *XVdbeOp, _zTemp *int8, _nTemp int32) (r0 *int8) {
var _2_j, _17_i, _17_n int32
var _17_ai *int32
var _zP4, _3_zColl *int8
var _10_pMem *XMem
var _5_pDef, _6_pDef *XFuncDef
var _x XStrAccum
var _2_pKeyInfo *XKeyInfo
var _3_pColl, _4_pColl *XCollSeq
var _16_pVtab *Xsqlite3_vtab
_zP4 = _zTemp
func() {
if _nTemp < i32(20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72711), unsafe.Pointer((*int8)(unsafe.Pointer(&_displayP4Ø00__func__Ø000))), unsafe.Pointer(str(37842)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StrAccumInit(tls, &_x, nil, _zTemp, _nTemp, i32(0))
switch int32(_pOp.X1) {
case i32(-16):
goto _6
case i32(-15):
goto _15
case i32(-14):
goto _14
case i32(-13):
goto _13
case i32(-12):
goto _12
case i32(-11):
goto _8
case i32(-10):
goto _7
case i32(-9):
goto _9
case i32(-8):
goto _11
case i32(-7):
goto _10
case i32(-5):
goto _3
case i32(-4):
goto _5
case i32(-3):
goto _4
default:
goto _16
}
_3:
_2_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
func() {
if (_2_pKeyInfo.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72717), unsafe.Pointer((*int8)(unsafe.Pointer(&_displayP4Ø00__func__Ø000))), unsafe.Pointer(str(37852)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3XPrintf(tls, &_x, str(37876), int32(_2_pKeyInfo.X2))
_2_j = i32(0)
_19:
if _2_j >= int32(_2_pKeyInfo.X2) {
goto _22
}
_3_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_2_pKeyInfo.X6))))) + 4*uintptr(_2_j)))
_3_zColl = func() *int8 {
if _3_pColl != nil {
return (_3_pColl.X0)
}
return str(0)
}()
if crt.Xstrcmp(tls, _3_zColl, str(37881)) == i32(0) {
_3_zColl = str(37888)
}
_sqlite3XPrintf(tls, &_x, str(37890), unsafe.Pointer(func() *int8 {
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pKeyInfo.X5)) + 1*uintptr(_2_j)))) != 0 {
return str(37896)
}
return str(0)
}()), unsafe.Pointer(_3_zColl))
_2_j += 1
goto _19
_22:
_sqlite3StrAccumAppend(tls, &_x, str(37898), i32(1))
goto _28
_4:
_4_pColl = (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_sqlite3XPrintf(tls, &_x, str(37900), unsafe.Pointer(_4_pColl.X0))
goto _28
_5:
_5_pDef = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_sqlite3XPrintf(tls, &_x, str(37908), unsafe.Pointer(_5_pDef.X6), int32(_5_pDef.X0))
goto _28
_6:
_6_pDef = (*XFuncDef)((*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X1)
_sqlite3XPrintf(tls, &_x, str(37908), unsafe.Pointer(_6_pDef.X6), int32(_6_pDef.X0))
goto _28
_7:
_sqlite3XPrintf(tls, &_x, str(6348), *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
goto _28
_8:
_sqlite3XPrintf(tls, &_x, str(37915), *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _28
_9:
_sqlite3XPrintf(tls, &_x, str(7552), *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
goto _28
_10:
_10_pMem = (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
if (int32(_10_pMem.X1) & i32(2)) != 0 {
_zP4 = _10_pMem.X5
goto _36
}
if (int32(_10_pMem.X1) & i32(4)) != 0 {
_sqlite3XPrintf(tls, &_x, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_10_pMem.X0))))))
goto _36
}
if (int32(_10_pMem.X1) & i32(8)) != 0 {
_sqlite3XPrintf(tls, &_x, str(7552), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_10_pMem.X0))))))
goto _36
}
if (int32(_10_pMem.X1) & i32(1)) != 0 {
_zP4 = str(155)
goto _36
}
func() {
if (int32(_10_pMem.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72774), unsafe.Pointer((*int8)(unsafe.Pointer(&_displayP4Ø00__func__Ø000))), unsafe.Pointer(str(37918)))
crt.X__builtin_abort(tls)
}
}()
_zP4 = str(37941)
_36:
goto _28
_11:
_16_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2)
_sqlite3XPrintf(tls, &_x, str(37948), unsafe.Pointer(_16_pVtab))
goto _28
_12:
_17_ai = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
_17_n = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_ai)) + 4*uintptr(i32(0))))
_17_i = i32(1)
_39:
if _17_i >= _17_n {
goto _42
}
_sqlite3XPrintf(tls, &_x, str(37956), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_ai)) + 4*uintptr(_17_i))))
_17_i += 1
goto _39
_42:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(91))
_sqlite3StrAccumAppend(tls, &_x, str(37960), i32(1))
goto _28
_13:
_sqlite3XPrintf(tls, &_x, str(37962))
goto _28
_14:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0))
goto _28
_15:
_sqlite3XPrintf(tls, &_x, str(24576), unsafe.Pointer((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X0))
goto _28
_16:
_zP4 = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
if _zP4 == nil {
_zP4 = _zTemp
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0))
}
_28:
_sqlite3StrAccumFinish(tls, &_x)
func() {
if _zP4 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72819), unsafe.Pointer((*int8)(unsafe.Pointer(&_displayP4Ø00__func__Ø000))), unsafe.Pointer(str(37970)))
crt.X__builtin_abort(tls)
}
}()
return _zP4
_ = _x
panic(0)
}
var _displayP4Ø00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_displayP4Ø00__func__Ø000[0], str(37977), 10)
}
// variable-argument wrapper around sqlite3VXPrintf(). The bFlags argument
// can contain the bit SQLITE_PRINTF_INTERNAL enable internal formats.
func _sqlite3XPrintf(tls *crt.TLS, _p *XStrAccum, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
_ap = args
_sqlite3VXPrintf(tls, _p, _zFormat, _ap)
_ap = nil
}
// Compute a string for the "comment" field of a VDBE opcode listing.
//
// The Synopsis: field in comments in the vdbe.c source file gets converted
// to an extra string that is appended to the sqlite3OpcodeName(). In the
// absence of other comments, this synopsis becomes the comment on the opcode.
// Some translation occurs:
//
// "PX" -> "r[X]"
// "PX@PY" -> "r[X..X+Y-1]" or "r[x]" if y is 0 or 1
// "PX@PY+1" -> "r[X..X+Y]" or "r[x]" if y is 0
// "PY..PY" -> "r[X..Y]" or "r[x]" if y<=x
func _displayComment(tls *crt.TLS, _pOp *XVdbeOp, _zP4 *int8, _zTemp *int8, _nTemp int32) (r0 int32) {
var _nOpName, _ii, _jj, _1_seenCom, _9_v1, _9_v2 int32
var _1_c int8
var _zOpName, _zSynopsis *int8
var _zAlt [50]int8
_zOpName = _sqlite3OpcodeName(tls, int32(_pOp.X0))
_nOpName = _sqlite3Strlen30(tls, _zOpName)
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOpName)) + 1*uintptr(_nOpName+i32(1))))) == 0 {
goto _0
}
_1_seenCom = i32(0)
_zSynopsis = store0(func() (**int8, *int8) {
p := &_zOpName
return p, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nOpName+i32(1))))
}())
if crt.Xstrncmp(tls, _zSynopsis, str(37987), uint32(i32(3))) != i32(0) {
goto _1
}
if (int32(_pOp.X2) & i32(32)) != 0 {
Xsqlite3_snprintf(tls, int32(u32(50)), (*int8)(unsafe.Pointer(&_zAlt)), str(37991), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(3))))))))))
goto _3
}
Xsqlite3_snprintf(tls, int32(u32(50)), (*int8)(unsafe.Pointer(&_zAlt)), str(38004), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(3))))))))))
_3:
_zSynopsis = (*int8)(unsafe.Pointer(&_zAlt))
_1:
_ii = store1(&_jj, i32(0))
_4:
if _jj >= (_nTemp-i32(1)) || int32(store3(&_1_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(_ii))))) == i32(0) {
goto _8
}
if int32(_1_c) != i32(80) {
goto _9
}
_1_c = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(preInc1(&_ii, 1))))
if int32(_1_c) == i32(52) {
Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))), str(24576), unsafe.Pointer(_zP4))
goto _13
}
if int32(_1_c) == i32(88) {
Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))), str(24576), unsafe.Pointer(_pOp.X7))
_1_seenCom = i32(1)
goto _13
}
_9_v1 = _translateP(tls, _1_c, _pOp)
Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))), str(37915), _9_v1)
if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_ii)))))))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(1)))))))), str(38018), uint32(i32(2))) != i32(0) {
goto _14
}
{
p := &_ii
*p = (*p) + i32(3)
sink1 = *p
}
{
p := &_jj
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))))
sink1 = *p
}
_9_v2 = _translateP(tls, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSynopsis)) + 1*uintptr(_ii))), _pOp)
if crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_ii)))))))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(1)))))))), str(38021), uint32(i32(2))) == i32(0) {
{
p := &_ii
*p = (*p) + i32(2)
sink1 = *p
}
_9_v2 += 1
}
if _9_v2 > i32(1) {
Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))), str(38024), (_9_v1+_9_v2)-i32(1))
}
goto _19
_14:
if (crt.Xstrncmp(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zSynopsis))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_ii)))))))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(1)))))))), str(38029), uint32(i32(4))) == i32(0)) && ((_pOp.X5) == i32(0)) {
{
p := &_ii
*p = (*p) + i32(4)
sink1 = *p
}
}
_19:
_13:
{
p := &_jj
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))))
sink1 = *p
}
goto _20
_9:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(postInc1(&_jj, int32(1))))) = _1_c
_20:
_ii += 1
goto _4
_8:
if ((_1_seenCom == 0) && (_jj < (_nTemp - i32(5)))) && ((_pOp.X7) != nil) {
Xsqlite3_snprintf(tls, _nTemp-_jj, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))), str(38034), unsafe.Pointer(_pOp.X7))
{
p := &_jj
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zTemp))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_jj))))))))
sink1 = *p
}
}
if _jj < _nTemp {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(_jj))) = int8(i32(0))
}
goto _27
_0:
if (_pOp.X7) != nil {
Xsqlite3_snprintf(tls, _nTemp, _zTemp, str(24576), unsafe.Pointer(_pOp.X7))
_jj = _sqlite3Strlen30(tls, _zTemp)
goto _27
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTemp)) + 1*uintptr(i32(0)))) = int8(i32(0))
_jj = i32(0)
_27:
return _jj
_ = _zAlt
panic(0)
}
func _sqlite3OpcodeName(tls *crt.TLS, _i int32) (r0 *int8) {
return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeNameØ00azNameØ001)) + 4*uintptr(_i)))
}
var _sqlite3OpcodeNameØ00azNameØ001 [166]*int8
func init() {
_sqlite3OpcodeNameØ00azNameØ001 = [166]*int8{str(38039), str(38050), str(38062), str(38075), str(38087), str(38099), str(38111), str(38117), str(38123), str(38135), str(38148), str(38156), str(38187), str(38209), str(38215), str(38222), str(38237), str(38244), str(38255), str(38261), str(38279), str(38285), str(38289), str(38296), str(38345), str(38365), str(38385), str(38405), str(38425), str(38449), str(38471), str(38490), str(38513), str(38536), str(38542), str(38553), str(38565), str(38571), str(38579), str(38598), str(38617), str(38636), str(38655), str(38683), str(38725), str(38734), str(38767), str(38808), str(38852), str(38889), str(38901), str(38908), str(38925), str(38933), str(38947), str(38977), str(38983), str(39000), str(39015), str(39042), str(39062), str(39082), str(39105), str(39137), str(39160), str(39187), str(39205), str(39225), str(39251), str(39260), str(39291), str(39317), str(39344), str(39374), str(39396), str(39410), str(39440), str(39471), str(39490), str(39509), str(39527), str(39546), str(39564), str(39583), str(39594), str(39619), str(39643), str(39672), str(39702), str(39724), str(39751), str(39778), str(39803), str(39831), str(39856), str(39877), str(39898), str(39911), str(39930), str(39960), str(39976), str(40004), str(40037), str(40057), str(40069), str(40080), str(40105), str(40129), str(40154), str(40163), str(40188), str(40213), str(40225), str(40269), str(40300), str(40307), str(40320), str(40352), str(40373), str(40404), str(40435), str(40443), str(40455), str(40504), str(40526), str(40545), str(40563), str(40572), str(40595), str(40615), str(40638), str(40663), str(40684), str(40698), str(40707), str(40714), str(40727), str(40757), str(40787), str(40796), str(40809), str(40823), str(40834), str(40845), str(40858), str(40871), str(40898), str(40905), str(40929), str(40959), str(41028), str(41064), str(41099), str(41125), str(41133), str(41167), str(41175), str(41184), str(41194), str(41201), str(41227), str(41236), str(41247), str(41257), str(41269), str(41275)}
}
// Return an integer value for one of the parameters to the opcode pOp
// determined by character c.
func _translateP(tls *crt.TLS, _c int8, _pOp *XVdbeOp) (r0 int32) {
if int32(_c) == i32(49) {
return _pOp.X3
}
if int32(_c) == i32(50) {
return _pOp.X4
}
if int32(_c) == i32(51) {
return _pOp.X5
}
if int32(_c) == i32(52) {
return *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
}
return int32(_pOp.X2)
}
var _sqlite3VdbePrintOpØ00zFormat1Ø001 *int8
func init() {
_sqlite3VdbePrintOpØ00zFormat1Ø001 = str(41284)
}
// This routine is just a convenient place to set a breakpoint that will
// fire after each opcode is inserted and displayed using
// "PRAGMA vdbe_addoptrace=on".
func _test_addop_breakpoint(tls *crt.TLS) {
_test_addop_breakpointØ00nØ001 += 1
}
var _test_addop_breakpointØ00nØ001 int32
// Check if the program stored in the VM associated with pParse may
// throw an ABORT exception (causing the statement, but not entire transaction
// to be rolled back). This condition is true if the main program or any
// sub-programs contains any of the following:
//
// * OP_Halt with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
// * OP_HaltIfNull with P1=SQLITE_CONSTRAINT and P2=OE_Abort.
// * OP_Destroy
// * OP_VUpdate
// * OP_VRename
// * OP_FkCounter with P2==0 (immediate foreign key constraint)
// * OP_CreateTable and OP_InitCoroutine (for CREATE TABLE AS SELECT ...)
//
// Then check that the value of Parse.mayAbort is true if an
// ABORT may be thrown, or false otherwise. Return true if it does
// match, or false otherwise. This function is intended to be used as
// part of an assert statement in the compiler. Similar to:
//
// assert( sqlite3VdbeAssertMayAbort(pParse->pVdbe, pParse->mayAbort) );
func _sqlite3VdbeAssertMayAbort(tls *crt.TLS, _v *TVdbe, _mayAbort int32) (r0 int32) {
var _hasAbort, _hasFkCounter, _hasCreateTable, _hasInitCoroutine, _1_opcode int32
var _pOp *XVdbeOp
var _sIter XVdbeOpIter
_hasAbort = i32(0)
_hasFkCounter = i32(0)
_hasCreateTable = i32(0)
_hasInitCoroutine = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_sIter), i32(0), u32(20))
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sIter.X0))))) = _v
_0:
if store40(&_pOp, _opIterNext(tls, &_sIter)) == nil {
goto _1
}
_1_opcode = int32(_pOp.X0)
if (((_1_opcode == i32(133)) || (_1_opcode == i32(12))) || (_1_opcode == i32(160))) || (((_1_opcode == i32(55)) || (_1_opcode == i32(54))) && ((((_pOp.X3) & i32(255)) == i32(19)) && ((_pOp.X4) == i32(2)))) {
_hasAbort = i32(1)
goto _1
}
if _1_opcode == i32(137) {
_hasCreateTable = i32(1)
}
if _1_opcode == i32(15) {
_hasInitCoroutine = i32(1)
}
if ((_1_opcode == i32(147)) && ((_pOp.X3) == i32(0))) && ((_pOp.X4) == i32(1)) {
_hasFkCounter = i32(1)
}
goto _0
_1:
_sqlite3DbFree(tls, (*Xsqlite3)(_v.X0), (unsafe.Pointer)(_sIter.X1))
return bool2int((((((*Xsqlite3)(_v.X0).X17) != 0) || (_hasAbort == _mayAbort)) || _hasFkCounter != 0) || (_hasCreateTable != 0 && _hasInitCoroutine != 0))
_ = _sIter
panic(0)
}
func _opIterNext(tls *crt.TLS, _p *XVdbeOpIter) (r0 *XVdbeOp) {
var _nOp, _5_nByte, _5_j int32
var _v *TVdbe
var _pRet, _aOp *XVdbeOp
_v = (*TVdbe)(_p.X0)
_pRet = nil
if (_p.X4) > (_p.X2) {
goto _0
}
if (_p.X4) == i32(0) {
_aOp = (*XVdbeOp)(_v.X17)
_nOp = _v.X27
goto _2
}
_aOp = (*XVdbeOp)((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 4*uintptr((_p.X4)-i32(1))))).X0)
_nOp = (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 4*uintptr((_p.X4)-i32(1))))).X1
_2:
func() {
if (_p.X3) >= _nOp {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71866), unsafe.Pointer((*int8)(unsafe.Pointer(&_opIterNextØ00__func__Ø000))), unsafe.Pointer(str(41321)))
crt.X__builtin_abort(tls)
}
}()
_pRet = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_p.X3)))
*(*int32)(unsafe.Pointer(&(_p.X3))) += 1
if (_p.X3) == _nOp {
*(*int32)(unsafe.Pointer(&(_p.X4))) += 1
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(0)
}
if int32(_pRet.X1) != i32(-13) {
goto _6
}
_5_nByte = int32(uint32((_p.X2)+i32(1)) * u32(4))
_5_j = i32(0)
_7:
if _5_j >= (_p.X2) {
goto _10
}
if (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 4*uintptr(_5_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pRet.X6)))))) {
goto _10
}
_5_j += 1
goto _7
_10:
if _5_j != (_p.X2) {
goto _12
}
*(***XSubProgram)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (**XSubProgram)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_v.X0), (unsafe.Pointer)(_p.X1), uint64(_5_nByte)))
if (**XSubProgram)(unsafe.Pointer(_p.X1)) == nil {
_pRet = nil
goto _14
}
*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X2))), int32(1))))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pRet.X6))))))
_14:
_12:
_6:
_0:
return _pRet
}
var _opIterNextØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_opIterNextØ00__func__Ø000[0], str(41334), 11)
}
func _sqlite3VdbeAddOp0(tls *crt.TLS, _p *TVdbe, _op int32) (r0 int32) {
return _sqlite3VdbeAddOp3(tls, _p, _op, i32(0), i32(0), i32(0))
}
// Return the opcode for a given address. If the address is -1, then
// return the most recently inserted opcode.
//
// If a memory allocation error has occurred prior to the calling of this
// routine, then a pointer to a dummy VdbeOp will be returned. That opcode
// is readable but not writable, though it is cast to a writable value.
// The return of a dummy opcode allows the call to continue functioning
// after an OOM fault without having to check to see if the return from
// this routine is a valid pointer. But because the dummy.opcode is 0,
// dummy will never be written to. This is verified by code inspection and
// by running with Valgrind.
func _sqlite3VdbeGetOp(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 *XVdbeOp) {
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72518), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
if _addr < i32(0) {
_addr = (_p.X27) - i32(1)
}
func() {
if (_addr < i32(0) || _addr >= (_p.X27)) && ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72522), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeGetOpØ00__func__Ø000))), unsafe.Pointer(str(41345)))
crt.X__builtin_abort(tls)
}
}()
if ((*Xsqlite3)(_p.X0).X17) != 0 {
return &_sqlite3VdbeGetOpØ00dummyØ001
}
return (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_addr)))
}
var _sqlite3VdbeGetOpØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeGetOpØ00__func__Ø000[0], str(41393), 17)
}
var _sqlite3VdbeGetOpØ00dummyØ001 XVdbeOp
// Change the P2 operand of instruction addr so that it points to
// the address of the next instruction to be coded.
func _sqlite3VdbeJumpHere(tls *crt.TLS, _p *TVdbe, _addr int32) {
_sqlite3VdbeChangeP2(tls, _p, uint32(_addr), _p.X27)
}
func _sqlite3VdbeChangeP2(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
*(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X4))) = _val
}
// Declare to the Vdbe that the BTree object at db->aDb[i] is used.
//
// The prepared statements need to know in advance the complete set of
// attached databases that will be use. A mask of these databases
// is maintained in p->btreeMask. The p->lockMask value is the subset of
// p->btreeMask of databases that will require a lock.
func _sqlite3VdbeUsesBtree(tls *crt.TLS, _p *TVdbe, _i int32) {
func() {
if _i < i32(0) || _i >= ((*Xsqlite3)(_p.X0).X5) || _i >= i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72833), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000))), unsafe.Pointer(str(41410)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _i >= i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72834), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeUsesBtreeØ00__func__Ø000))), unsafe.Pointer(str(41459)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X33)))
*p = (*p) | (u32(1) << uint(_i))
sink5 = *p
}
if (_i != i32(1)) && _sqlite3BtreeSharable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_p.X0).X4)+16*uintptr(_i))).X1)) != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_p.X34)))
*p = (*p) | (u32(1) << uint(_i))
sink5 = *p
}
}
}
var _sqlite3VdbeUsesBtreeØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeUsesBtreeØ00__func__Ø000[0], str(41489), 21)
}
// Return true if the Btree passed as the only argument is sharable.
func _sqlite3BtreeSharable(tls *crt.TLS, _p *XBtree) (r0 int32) {
return int32(_p.X3)
}
// Add an opcode that includes the p4 value as an integer.
func _sqlite3VdbeAddOp4Int(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _p4 int32) (r0 int32) {
var _addr int32
var _1_pOp *XVdbeOp
_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
if int32((*Xsqlite3)(_p.X0).X17) == i32(0) {
_1_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_addr)))
*(*int8)(unsafe.Pointer(&(_1_pOp.X1))) = int8(i32(-11))
*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6))))) = _p4
}
return _addr
}
func _sqlite3VdbeChangeP5(tls *crt.TLS, _p *TVdbe, _p5 uint16) {
func() {
if (_p.X27) <= i32(0) && ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72215), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP5Ø00__func__Ø000))), unsafe.Pointer(str(41510)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X27) > i32(0) {
*(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr((_p.X27)-i32(1)))).X2))) = _p5
}
}
var _sqlite3VdbeChangeP5Ø00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeChangeP5Ø00__func__Ø000[0], str(41542), 20)
}
func _sqlite3VdbeComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
if _p != nil {
_ap = args
_vdbeVComment(tls, _p, _zFormat, _ap)
_ap = nil
}
}
// Change the comment on the most recently coded instruction. Or
// insert a No-op and add the comment to that new instruction. This
// makes the code easier to read during debugging. None of this happens
// in a production build.
func _vdbeVComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, _ap []interface{}) {
func() {
if (_p.X27) <= i32(0) && (*XVdbeOp)(_p.X17) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72465), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41562)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XVdbeOp)(_p.X17) != nil && ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr((_p.X27)-i32(1)))).X7) != nil && ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72466), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41584)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X27) != 0 {
func() {
if (*XVdbeOp)(_p.X17) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72468), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeVCommentØ00__func__Ø000))), unsafe.Pointer(str(41649)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr((_p.X27)-i32(1)))).X7))
*(**int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr((_p.X27)-i32(1)))).X7))) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap)
}
}
var _vdbeVCommentØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_vdbeVCommentØ00__func__Ø000[0], str(41656), 13)
}
// 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 _sqlite3GetVTable(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable) (r0 *XVTable) {
var _pVtab *XVTable
func() {
if (_pTab.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125131), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetVTableØ00__func__Ø000))), unsafe.Pointer(str(24529)))
crt.X__builtin_abort(tls)
}
}()
_pVtab = (*XVTable)(_pTab.X18)
_2:
if _pVtab == nil || (*Xsqlite3)(_pVtab.X0) == _db {
goto _6
}
_pVtab = (*XVTable)(_pVtab.X6)
goto _2
_6:
return _pVtab
}
var _sqlite3GetVTableØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GetVTableØ00__func__Ø000[0], str(41669), 17)
}
// Add an opcode that includes the p4 value as a pointer.
func _sqlite3VdbeAddOp4(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *int8, _p4type int32) (r0 int32) {
var _addr int32
_addr = _sqlite3VdbeAddOp3(tls, _p, _op, _p1, _p2, _p3)
_sqlite3VdbeChangeP4(tls, _p, _addr, _zP4, _p4type)
return _addr
}
func _sqlite3VdbeChangeP4(tls *crt.TLS, _p *TVdbe, _addr int32, _zP4 *int8, _n int32) {
var _db *Xsqlite3
var _pOp *XVdbeOp
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72388), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_p.X0)
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72390), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XVdbeOp)(_p.X17) == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72391), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41686)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) == 0 {
goto _7
}
if _n != i32(-8) {
_freeP4(tls, _db, _n, (unsafe.Pointer)(_zP4))
}
return
_7:
func() {
if (_p.X27) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41716)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _addr >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72397), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41725)))
crt.X__builtin_abort(tls)
}
}()
if _addr < i32(0) {
_addr = (_p.X27) - i32(1)
}
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_addr)))
if (_n >= i32(0)) || ((_pOp.X1) != 0) {
_vdbeChangeP4Full(tls, _p, _pOp, _zP4, _n)
return
}
if _n == i32(-11) {
*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = int32(uintptr(unsafe.Pointer(_zP4)))
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-11))
goto _18
}
if _zP4 == nil {
goto _18
}
func() {
if _n >= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72412), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeP4Ø00__func__Ø000))), unsafe.Pointer(str(41737)))
crt.X__builtin_abort(tls)
}
}()
*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = (unsafe.Pointer)(_zP4)
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(_n)
if _n == i32(-8) {
_sqlite3VtabLock(tls, (*XVTable)(unsafe.Pointer(_zP4)))
}
_18:
}
var _sqlite3VdbeChangeP4Ø00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeChangeP4Ø00__func__Ø000[0], str(41741), 20)
}
func _freeP4(tls *crt.TLS, _db *Xsqlite3, _p4type int32, _p4 unsafe.Pointer) {
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72252), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeP4Ø00__func__Ø000))), unsafe.Pointer(str(9475)))
crt.X__builtin_abort(tls)
}
}()
switch _p4type {
case i32(-16):
goto _3
case i32(-12):
goto _4
case i32(-10):
goto _4
case i32(-9):
goto _4
case i32(-8):
goto _11
case i32(-7):
goto _10
case i32(-5):
goto _8
case i32(-4):
goto _9
case i32(-1):
goto _4
default:
goto _12
}
_3:
_freeP4FuncCtx(tls, _db, (*Xsqlite3_context)(_p4))
goto _12
_4:
_sqlite3DbFree(tls, _db, _p4)
goto _12
_8:
if (_db.X79) == nil {
_sqlite3KeyInfoUnref(tls, (*XKeyInfo)(_p4))
}
goto _12
_9:
_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p4))
goto _12
_10:
if (_db.X79) == nil {
_sqlite3ValueFree(tls, (*XMem)(_p4))
goto _15
}
_freeP4Mem(tls, _db, (*XMem)(_p4))
_15:
goto _12
_11:
if (_db.X79) == nil {
_sqlite3VtabUnlock(tls, (*XVTable)(_p4))
}
goto _12
_12:
}
var _freeP4Ø00__func__Ø000 [7]int8
func init() {
crt.Xstrncpy(nil, &_freeP4Ø00__func__Ø000[0], str(41761), 7)
}
func _freeP4FuncCtx(tls *crt.TLS, _db *Xsqlite3, _p *Xsqlite3_context) {
_freeEphemeralFunction(tls, _db, (*XFuncDef)(_p.X1))
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
// If the input FuncDef structure is ephemeral, then free it. If
// the FuncDef is not ephermal, then do nothing.
func _freeEphemeralFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef) {
if (int32(_pDef.X1) & i32(16)) != i32(0) {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pDef))
}
}
// Deallocate a KeyInfo object
func _sqlite3KeyInfoUnref(tls *crt.TLS, _p *XKeyInfo) {
if _p == nil {
goto _0
}
func() {
if (_p.X0) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3KeyInfoUnrefØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X0))) -= 1
if (_p.X0) == uint32(i32(0)) {
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_p.X4), (unsafe.Pointer)(_p))
}
_0:
}
var _sqlite3KeyInfoUnrefØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3KeyInfoUnrefØ00__func__Ø000[0], str(41768), 20)
}
// Delete a P4 value if necessary.
func _freeP4Mem(tls *crt.TLS, _db *Xsqlite3, _p *XMem) {
if (_p.X7) != 0 {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X6))
}
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
// Change the value of the P4 operand for a specific instruction.
// This routine is useful when a large program is loaded from a
// static array using sqlite3VdbeAddOpList but we want to make a
// few minor changes to the program.
//
// If n>=0 then the P4 operand is dynamic, meaning that a copy of
// the string is made into memory obtained from sqlite3_malloc().
// A value of n==0 means copy bytes of zP4 up to and including the
// first null byte. If n>0 then copy n+1 bytes of zP4.
//
// Other values of n (P4_STATIC, P4_COLLSEQ etc.) indicate that zP4 points
// to a string or structure that is guaranteed to exist for the lifetime of
// the Vdbe. In these cases we can just copy the pointer.
//
// If addr<0 then change P4 on the most recently inserted instruction.
func _vdbeChangeP4Full(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp, _zP4 *int8, _n int32) {
if (_pOp.X1) != 0 {
_freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0))
*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil
}
if _n < i32(0) {
_sqlite3VdbeChangeP4(tls, _p, int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer((*XVdbeOp)(_p.X17))))/24), _zP4, _n)
goto _2
}
if _n == i32(0) {
_n = _sqlite3Strlen30(tls, _zP4)
}
*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _zP4, uint64(_n))
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-1))
_2:
}
// Lock the virtual table so that it cannot be disconnected.
// Locks nest. Every lock should have a corresponding unlock.
// If an unlock is omitted, resources leaks will occur.
//
// If a disconnect is attempted while a virtual table is locked,
// the disconnect is deferred until all locks have been removed.
func _sqlite3VtabLock(tls *crt.TLS, _pVTab *XVTable) {
*(*int32)(unsafe.Pointer(&(_pVTab.X3))) += 1
}
// Code an OP_TableLock instruction for each table locked by the
// statement (configured by calls to sqlite3TableLock()).
func _codeTableLocks(tls *crt.TLS, _pParse *XParse) {
var _i, _1_p1 int32
var _pVdbe *TVdbe
var _1_p *XTableLock
_pVdbe = _sqlite3GetVdbe(tls, _pParse)
func() {
if _pVdbe == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99792), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTableLocksØ00__func__Ø000))), unsafe.Pointer(str(41788)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= (_pParse.X36) {
goto _5
}
_1_p = (*XTableLock)(unsafe.Pointer(uintptr(_pParse.X37) + 16*uintptr(_i)))
_1_p1 = _1_p.X0
_sqlite3VdbeAddOp4(tls, _pVdbe, i32(154), _1_p1, _1_p.X1, int32(_1_p.X2), _1_p.X3, i32(-2))
_i += 1
goto _2
_5:
}
var _codeTableLocksØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_codeTableLocksØ00__func__Ø000[0], str(41797), 15)
}
// This routine generates code that will initialize all of the
// register used by the autoincrement tracker.
func _sqlite3AutoincrementBegin(tls *crt.TLS, _pParse *XParse) {
var _memId int32
var _db *Xsqlite3
var _pDb *XDb
var _v *TVdbe
var _1_aOp *XVdbeOp
var _p *TAggInfo_func
_db = (*Xsqlite3)(_pParse.X0)
_v = (*TVdbe)(_pParse.X2)
func() {
if (*XTable)(_pParse.X40) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109100), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000))), unsafe.Pointer(str(41812)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XParse)(_pParse.X39) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109101), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000))), unsafe.Pointer(str(41835)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109103), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
_p = (*TAggInfo_func)(_pParse.X38)
_6:
if _p == nil {
goto _9
}
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_p.X2)))
_memId = _p.X3
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pDb.X4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109121), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00__func__Ø000))), unsafe.Pointer(str(41863)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OpenTable(tls, _pParse, i32(0), _p.X2, (*XTable)((*XSchema)(_pDb.X4).X6), i32(106))
_sqlite3VdbeLoadString(tls, _v, _memId-i32(1), (*XTable)(_p.X1).X0)
_1_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(10), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3AutoincrementBeginØ00autoIncØ002)), _sqlite3AutoincrementBeginØ00iLnØ001)
if _1_aOp == nil {
goto _9
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(0)))).X4))) = _memId
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(0)))).X5))) = _memId + i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(2)))).X5))) = _memId
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X3))) = _memId - i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X5))) = _memId
*(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X2))) = uint16(i32(16))
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(4)))).X4))) = _memId + i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(5)))).X5))) = _memId
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(8)))).X4))) = _memId
_p = (*TAggInfo_func)(_p.X0)
goto _6
_9:
}
var _sqlite3AutoincrementBeginØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AutoincrementBeginØ00__func__Ø000[0], str(41907), 26)
}
// 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 _sqlite3OpenTable(tls *crt.TLS, _pParse *XParse, _iCur int32, _iDb int32, _pTab *XTable, _opcode int32) {
var _v *TVdbe
var _2_pPk *XIndex
func() {
if (_pTab.X16) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108869), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(41933)))
crt.X__builtin_abort(tls)
}
}()
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _opcode != i32(107) && _opcode != i32(106) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108871), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(41950)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(func() int32 {
if _opcode == i32(107) {
return i32(1)
}
return i32(0)
}()), _pTab.X0)
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_sqlite3VdbeAddOp4Int(tls, _v, _opcode, _iCur, _pTab.X7, _iDb, int32(_pTab.X11))
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pTab.X0))
goto _8
}
_2_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
func() {
if _2_pPk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108879), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(41994)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_2_pPk.X11) != (_pTab.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108880), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableØ00__func__Ø000))), unsafe.Pointer(str(42001)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, _opcode, _iCur, _2_pPk.X11, _iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _2_pPk)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pTab.X0))
_8:
}
var _sqlite3OpenTableØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OpenTableØ00__func__Ø000[0], str(42023), 17)
}
// Record the fact that we want to lock a table at run-time.
//
// The table to be locked has root page iTab and is found in database iDb.
// A read or a write lock can be taken depending on isWritelock.
//
// This routine just records the fact that the lock is desired. The
// code to make the lock occur is generated by a later call to
// codeTableLocks() which occurs during sqlite3FinishCoding().
func _sqlite3TableLock(tls *crt.TLS, _pParse *XParse, _iDb int32, _iTab int32, _isWriteLock uint8, _zName *int8) {
var _i, _nBytes int32
var _pToplevel *XParse
var _p *XTableLock
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
func() {
if _iDb < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99756), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TableLockØ00__func__Ø000))), unsafe.Pointer(str(42040)))
crt.X__builtin_abort(tls)
}
}()
if _iDb == i32(1) {
return
}
if _sqlite3BtreeSharable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+16*uintptr(_iDb))).X1)) == 0 {
return
}
_i = i32(0)
_6:
if _i >= (_pToplevel.X36) {
goto _9
}
_p = (*XTableLock)(unsafe.Pointer(uintptr(_pToplevel.X37) + 16*uintptr(_i)))
if ((_p.X0) == _iDb) && ((_p.X1) == _iTab) {
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(bool2int(((_p.X2) != 0) || (_isWriteLock != 0)))
return
}
_i += 1
goto _6
_9:
_nBytes = int32(u32(16) * uint32((_pToplevel.X36)+i32(1)))
*(**XTableLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pToplevel.X37))))) = (*XTableLock)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pToplevel.X0), _pToplevel.X37, uint64(_nBytes)))
if (*XTableLock)(_pToplevel.X37) != nil {
_p = (*XTableLock)(unsafe.Pointer(uintptr(_pToplevel.X37) + 16*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pToplevel.X36))), int32(1)))))
*(*int32)(unsafe.Pointer(&(_p.X0))) = _iDb
*(*int32)(unsafe.Pointer(&(_p.X1))) = _iTab
*(*uint8)(unsafe.Pointer(&(_p.X2))) = _isWriteLock
*(**int8)(unsafe.Pointer(&(_p.X3))) = _zName
goto _14
}
*(*int32)(unsafe.Pointer(&(_pToplevel.X36))) = i32(0)
_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.X0))
_14:
}
var _sqlite3TableLockØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TableLockØ00__func__Ø000[0], str(42047), 17)
}
// Return the PRIMARY KEY index of a table
func _sqlite3PrimaryKeyIndex(tls *crt.TLS, _pTab *XTable) (r0 *XIndex) {
var _p *XIndex
_p = (*XIndex)(_pTab.X2)
_0:
if _p == nil || int32((uint32(_p.X16)<>uint(i32(30))) == i32(2) {
goto _4
}
_p = (*XIndex)(_p.X5)
goto _0
_4:
return _p
}
// Set the P4 on the most recently added opcode to the KeyInfo for the
// index given.
func _sqlite3VdbeSetP4KeyInfo(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) {
var _v *TVdbe
var _pKeyInfo *XKeyInfo
_v = (*TVdbe)(_pParse.X2)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72451), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72452), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000))), unsafe.Pointer(str(42069)))
crt.X__builtin_abort(tls)
}
}()
_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIdx)
if _pKeyInfo != nil {
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pKeyInfo), i32(-5))
}
}
var _sqlite3VdbeSetP4KeyInfoØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSetP4KeyInfoØ00__func__Ø000[0], str(42077), 24)
}
// 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 _sqlite3KeyInfoOfIndex(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex) (r0 *XKeyInfo) {
var _i, _nCol, _nKey int32
var _4_zColl *int8
var _pKey *XKeyInfo
_nCol = int32(_pIdx.X14)
_nKey = int32(_pIdx.X13)
if (_pParse.X16) != 0 {
return nil
}
if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.X0), _nKey, _nCol-_nKey)
goto _2
}
_pKey = _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.X0), _nCol, i32(0))
_2:
if _pKey == nil {
goto _3
}
func() {
if _sqlite3KeyInfoIsWriteable(tls, _pKey) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104060), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3KeyInfoOfIndexØ00__func__Ø000))), unsafe.Pointer(str(42101)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_6:
if _i >= _nCol {
goto _9
}
_4_zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_i)))
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKey.X6))))) + 4*uintptr(_i))) = func() *XCollSeq {
if _4_zColl == (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)) {
return nil
}
return _sqlite3LocateCollSeq(tls, _pParse, _4_zColl)
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKey.X5)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_i)))
_i += 1
goto _6
_9:
if (_pParse.X16) != 0 {
_sqlite3KeyInfoUnref(tls, _pKey)
_pKey = nil
}
_3:
return _pKey
}
// Allocate a KeyInfo object sufficient for an index of N key columns and
// X extra columns.
func _sqlite3KeyInfoAlloc(tls *crt.TLS, _db *Xsqlite3, _N int32, _X int32) (r0 *XKeyInfo) {
var _nExtra int32
var _p *XKeyInfo
_nExtra = int32(uint32(_N+_X) * u32(5))
_p = (*XKeyInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(24)+uint32(_nExtra))))
if _p != nil {
*(**uint8)(unsafe.Pointer(&(_p.X5))) = (*uint8)(unsafe.Pointer((**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) + 4*uintptr(_N+_X)))))
*(*uint16)(unsafe.Pointer(&(_p.X2))) = uint16(_N)
*(*uint16)(unsafe.Pointer(&(_p.X3))) = uint16(_X)
*(*uint8)(unsafe.Pointer(&(_p.X1))) = _db.X14
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _db
*(*uint32)(unsafe.Pointer(&(_p.X0))) = uint32(i32(1))
crt.Xmemset(tls, (unsafe.Pointer)((*XKeyInfo)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+24*uintptr(i32(1))))), i32(0), uint32(_nExtra))
goto _1
}
_sqlite3OomFault(tls, _db)
_1:
return _p
}
// Return TRUE if a KeyInfo object can be change. The KeyInfo object
// can only be changed if this is just a single reference to the object.
//
// This routine is used only inside of assert() statements.
func _sqlite3KeyInfoIsWriteable(tls *crt.TLS, _p *XKeyInfo) (r0 int32) {
return bool2int((_p.X0) == uint32(i32(1)))
}
var _sqlite3KeyInfoOfIndexØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3KeyInfoOfIndexØ00__func__Ø000[0], str(42133), 22)
}
var _sqlite3StrBINARY [7]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StrBINARY[0], str(37881), 7)
}
// This function returns the collation sequence for database native text
// encoding identified by the string zName, length nName.
//
// 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 _sqlite3LocateCollSeq(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 *XCollSeq) {
var _enc, _initbusy uint8
var _db *Xsqlite3
var _pColl *XCollSeq
_db = (*Xsqlite3)(_pParse.X0)
_enc = _db.X14
_initbusy = (*t21)(unsafe.Pointer(&(_db.X33))).X2
_pColl = _sqlite3FindCollSeq(tls, _db, _enc, _zName, int32(_initbusy))
if (_initbusy == 0) && ((_pColl == nil) || ((_pColl.X3) == nil)) {
_pColl = _sqlite3GetCollSeq(tls, _pParse, _enc, _pColl, _zName)
}
return _pColl
}
// 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 _sqlite3GetCollSeq(tls *crt.TLS, _pParse *XParse, _enc uint8, _pColl *XCollSeq, _zName *int8) (r0 *XCollSeq) {
var _db *Xsqlite3
var _p *XCollSeq
_db = (*Xsqlite3)(_pParse.X0)
_p = _pColl
if _p == nil {
_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, i32(0))
}
if (_p == nil) || ((_p.X3) == nil) {
_callCollNeeded(tls, _db, int32(_enc), _zName)
_p = _sqlite3FindCollSeq(tls, _db, _enc, _zName, i32(0))
}
if ((_p != nil) && ((_p.X3) == nil)) && _synthCollSeq(tls, _db, _p) != 0 {
_p = nil
}
func() {
if _p != nil && (_p.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104250), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetCollSeqØ00__func__Ø000))), unsafe.Pointer(str(42155)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
_sqlite3ErrorMsg(tls, _pParse, str(42169), unsafe.Pointer(_zName))
}
return _p
}
// Invoke the 'collation needed' callback to request a collation sequence
// in the encoding enc of name zName, length nName.
func _callCollNeeded(tls *crt.TLS, _db *Xsqlite3, _enc int32, _zName *int8) {
var _1_zExternal, _2_zExternal *int8
var _2_pTmp *XMem
func() {
if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
}{(_db.X53)}))) != nil && (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
}{(_db.X54)}))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104169), unsafe.Pointer((*int8)(unsafe.Pointer(&_callCollNeededØ00__func__Ø000))), unsafe.Pointer(str(42200)))
crt.X__builtin_abort(tls)
}
}()
if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
}{(_db.X53)}))) == nil {
goto _3
}
_1_zExternal = _sqlite3DbStrDup(tls, _db, _zName)
if _1_zExternal == nil {
return
}
(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
}{(_db.X53)})))(tls, _db.X55, _db, _enc, _1_zExternal)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_zExternal))
_3:
if (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
}{(_db.X54)}))) == nil {
goto _5
}
_2_pTmp = _sqlite3ValueNew(tls, _db)
_sqlite3ValueSetStr(tls, _2_pTmp, i32(-1), (unsafe.Pointer)(_zName), uint8(i32(1)), nil)
_2_zExternal = (*int8)(_sqlite3ValueText(tls, _2_pTmp, uint8(i32(2))))
if _2_zExternal != nil {
(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, int32, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
}{(_db.X54)})))(tls, _db.X55, _db, int32(_db.X14), (unsafe.Pointer)(_2_zExternal))
}
_sqlite3ValueFree(tls, _2_pTmp)
_5:
}
var _callCollNeededØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_callCollNeededØ00__func__Ø000[0], str(42239), 15)
}
// 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 _sqlite3DbStrDup(tls *crt.TLS, _db *Xsqlite3, _z *int8) (r0 *int8) {
var _n uint32
var _zNew *int8
if _z == nil {
return nil
}
_n = crt.Xstrlen(tls, _z) + uint32(i32(1))
_zNew = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64(_n)))
if _zNew != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(_zNew), (unsafe.Pointer)(_z), _n)
}
return _zNew
}
// This routine is called if the collation factory fails to deliver a
// collation function in the best encoding but there may be other versions
// of this collation function (for other text encodings) available. Use one
// of these instead if they exist. Avoid a UTF-8 <-> UTF-16 conversion if
// possible.
func _synthCollSeq(tls *crt.TLS, _db *Xsqlite3, _pColl *XCollSeq) (r0 int32) {
var _i int32
var _z *int8
var _pColl2 *XCollSeq
_z = _pColl.X0
_i = i32(0)
_0:
if _i >= i32(3) {
goto _3
}
_pColl2 = _sqlite3FindCollSeq(tls, _db, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_synthCollSeqØ00aEncØ001)) + 1*uintptr(_i))), _z, i32(0))
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32
}{(_pColl2.X3)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32
}{nil})) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_pColl), (unsafe.Pointer)(_pColl2), u32(20))
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pColl.X4))) = nil
return i32(0)
}
_i += 1
goto _0
_3:
return i32(1)
}
var _synthCollSeqØ00aEncØ001 [3]uint8
func init() {
_synthCollSeqØ00aEncØ001 = [3]uint8{3, 2, 1}
}
var _sqlite3GetCollSeqØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GetCollSeqØ00__func__Ø000[0], str(42254), 18)
}
// Change the P4 operand of the most recently coded instruction
// to the value defined by the arguments. This is a high-speed
// version of sqlite3VdbeChangeP4().
//
// The P4 operand must not have been previously defined. And the new
// P4 must not be P4_INT32. Use sqlite3VdbeChangeP4() in either of
// those cases.
func _sqlite3VdbeAppendP4(tls *crt.TLS, _p *TVdbe, _pP4 unsafe.Pointer, _n int32) {
var _pOp *XVdbeOp
func() {
if _n == i32(-11) || _n == i32(-8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72430), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(42272)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n > i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(42298)))
crt.X__builtin_abort(tls)
}
}()
if ((*Xsqlite3)(_p.X0).X17) != 0 {
_freeP4(tls, (*Xsqlite3)(_p.X0), _n, _pP4)
goto _6
}
func() {
if _pP4 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72435), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(42303)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X27) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(41716)))
crt.X__builtin_abort(tls)
}
}()
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr((_p.X27)-i32(1))))
func() {
if int32(_pOp.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAppendP4Ø00__func__Ø000))), unsafe.Pointer(str(42310)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(_n)
*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _pP4
_6:
}
var _sqlite3VdbeAppendP4Ø00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeAppendP4Ø00__func__Ø000[0], str(42334), 20)
}
// Generate code to cause the string zStr to be loaded into
// register iDest
func _sqlite3VdbeLoadString(tls *crt.TLS, _p *TVdbe, _iDest int32, _zStr *int8) (r0 int32) {
return _sqlite3VdbeAddOp4(tls, _p, i32(97), i32(0), _iDest, i32(0), _zStr, i32(0))
}
// Add a whole list of operations to the operation stack. Return a
// pointer to the first operation inserted.
//
// Non-zero P2 arguments to jump instructions are automatically adjusted
// so that the jump target is relative to the first operation inserted.
func _sqlite3VdbeAddOpList(tls *crt.TLS, _p *TVdbe, _nOp int32, _aOp *XVdbeOpList, _iLineno int32) (r0 *XVdbeOp) {
var _i int32
var _pOut, _pFirst *XVdbeOp
func() {
if _nOp <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000))), unsafe.Pointer(str(42354)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
if (((_p.X27) + _nOp) > ((*XParse)(_p.X3).X19)) && _growOpArray(tls, _p, _nOp) != 0 {
return nil
}
_pFirst = store40(&_pOut, (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_p.X27))))
_i = i32(0)
_6:
if _i >= _nOp {
goto _9
}
*(*uint8)(unsafe.Pointer(&(_pOut.X0))) = _aOp.X0
*(*int32)(unsafe.Pointer(&(_pOut.X3))) = int32(_aOp.X1)
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_aOp.X2)
func() {
if int32(_aOp.X2) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAddOpListØ00__func__Ø000))), unsafe.Pointer(str(42360)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_aOp.X0)))) & i32(1)) != i32(0)) && (int32(_aOp.X2) > i32(0)) {
{
p := (*int32)(unsafe.Pointer(&(_pOut.X4)))
*p = (*p) + (_p.X27)
sink1 = *p
}
}
*(*int32)(unsafe.Pointer(&(_pOut.X5))) = int32(_aOp.X3)
*(*int8)(unsafe.Pointer(&(_pOut.X1))) = int8(i32(0))
*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOut.X6))))) = nil
*(*uint16)(unsafe.Pointer(&(_pOut.X2))) = uint16(i32(0))
*(**int8)(unsafe.Pointer(&(_pOut.X7))) = nil
if (((*Xsqlite3)(_p.X0).X6) & i32(4096)) != 0 {
_sqlite3VdbePrintOp(tls, nil, _i+(_p.X27), (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_i+(_p.X27)))))
}
*(*uintptr)(unsafe.Pointer(func() **XVdbeOp {
*(*uintptr)(unsafe.Pointer(func() **XVdbeOpList { _i += 1; return &_aOp }())) += uintptr(4)
return &_pOut
}())) += uintptr(24)
goto _6
_9:
{
p := (*int32)(unsafe.Pointer(&(_p.X27)))
*p = (*p) + _nOp
sink1 = *p
}
return _pFirst
}
var _sqlite3VdbeAddOpListØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeAddOpListØ00__func__Ø000[0], str(42371), 21)
}
var _sqlite3OpcodeProperty [166]uint8
func init() {
_sqlite3OpcodeProperty = [166]uint8{0, 0, 0, 1, 1, 1, 1, 1, 0, 16, 0, 1, 0, 1, 1, 1, 3, 3, 1, 18, 1, 3, 3, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 35, 11, 1, 1, 3, 3, 3, 1, 1, 1, 2, 2, 8, 0, 16, 16, 16, 16, 0, 16, 16, 0, 0, 16, 16, 0, 0, 0, 38, 38, 0, 2, 2, 3, 3, 11, 11, 11, 11, 11, 11, 1, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 2, 18, 0, 16, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 16, 0, 4, 4, 0, 0, 16, 16, 16, 0, 0, 16, 16, 0, 0, 0, 0, 0, 0, 0, 6, 16, 0, 4, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 16, 0, 0, 0}
}
var _sqlite3AutoincrementBeginØ00autoIncØ002 [10]XVdbeOpList
func init() {
_sqlite3AutoincrementBeginØ00autoIncØ002 = [10]XVdbeOpList{XVdbeOpList{X0: u8(59), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(37), X1: i8(0), X2: i8(9), X3: i8(0)}, XVdbeOpList{X0: u8(99), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(77), X1: i8(0), X2: i8(7), X3: i8(0)}, XVdbeOpList{X0: u8(125), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(99), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(13), X1: i8(0), X2: i8(9), X3: i8(0)}, XVdbeOpList{X0: u8(7), X1: i8(0), X2: i8(2), X3: i8(0)}, XVdbeOpList{X0: u8(56), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(114), X1: i8(0), X2: i8(0), X3: i8(0)}}
}
var _sqlite3AutoincrementBeginØ00iLnØ001 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 _sqlite3ExprCode(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
var _inReg int32
func() {
if _target <= i32(0) || _target > (_pParse.X18) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95060), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000))), unsafe.Pointer(str(42392)))
crt.X__builtin_abort(tls)
}
}()
if (_pExpr != nil) && (int32(_pExpr.X0) == i32(157)) {
_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(64), _pExpr.X8, _target)
goto _5
}
_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _target)
func() {
if (*TVdbe)(_pParse.X2) == nil && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95065), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeØ00__func__Ø000))), unsafe.Pointer(str(42425)))
crt.X__builtin_abort(tls)
}
}()
if (_inReg != _target) && ((*TVdbe)(_pParse.X2) != nil) {
_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(65), _inReg, _target)
}
_5:
}
var _sqlite3ExprCodeØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeØ00__func__Ø000[0], str(42470), 16)
}
// 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 _sqlite3ExprCodeTarget(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) (r0 int32) {
var _op, _inReg, _regFree1, _regFree2, _r1, _r2, _p5, _8_iTab, _16_n, _31_addr, _35_nFarg, _35_i, _40_endCoalesce, _57_nCol, _60_n, _63_destIfFalse, _63_destIfNull, _66_p1, _69_addrINR, _70_endLabel, _70_nextCase, _70_nExpr, _70_i, _70_iCacheLevel int32
var _43_aff int8
var _35_constMask uint32
var _16_z, _16_zBlob, _18_z, _35_zId *int8
var _35_enc, _50_exprOp uint8
var _35_db *Xsqlite3
var _66_pTab *XTable
var _v *TVdbe
var _35_pDef *XFuncDef
var _35_pFarg, _70_pEList *XExprList
var _70_aListelem *TExprList_item
var _22_pLeft, _26_pLeft, _70_pX, _70_pTest *XExpr
var _tempX, _70_opCompare XExpr
var _35_pColl *XCollSeq
var _5_pAggInfo, _32_pInfo *XAggInfo
var _5_pCol *TAggInfo_col
var _43_azAff [5]*int8
_v = (*TVdbe)(_pParse.X2)
_inReg = _target
_regFree1 = i32(0)
_regFree2 = i32(0)
_p5 = i32(0)
func() {
if _target <= i32(0) || _target > (_pParse.X18) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94349), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42392)))
crt.X__builtin_abort(tls)
}
}()
if _v == nil {
func() {
if ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94351), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42486)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
if _pExpr == nil {
_op = i32(101)
goto _7
}
_op = int32(_pExpr.X0)
_7:
switch _op {
case i32(19):
goto _40
case i32(20):
goto _46
case i32(37):
goto _18
case i32(56):
goto _58
case i32(61):
goto _54
case i32(70):
goto _27
case i32(71):
goto _27
case i32(72):
goto _19
case i32(73):
goto _50
case i32(74):
goto _49
case i32(75):
goto _42
case i32(76):
goto _42
case i32(77):
goto _21
case i32(78):
goto _21
case i32(79):
goto _21
case i32(80):
goto _21
case i32(81):
goto _21
case i32(82):
goto _21
case i32(84):
goto _27
case i32(85):
goto _27
case i32(86):
goto _27
case i32(87):
goto _27
case i32(88):
goto _27
case i32(89):
goto _27
case i32(90):
goto _27
case i32(91):
goto _27
case i32(92):
goto _27
case i32(93):
goto _27
case i32(94):
goto _51
case i32(95):
goto _40
case i32(97):
goto _13
case i32(101):
goto _14
case i32(119):
goto _46
case i32(132):
goto _12
case i32(133):
goto _15
case i32(134):
goto _11
case i32(135):
goto _16
case i32(148):
goto _19
case i32(151):
goto _45
case i32(152):
goto _10
case i32(153):
goto _44
case i32(154):
goto _9
case i32(155):
goto _39
case i32(156):
goto _51
case i32(157):
goto _17
case i32(158):
goto _55
case i32(159):
goto _48
case i32(160):
goto _56
case i32(162):
goto _51
default:
goto _57
}
_9:
_5_pAggInfo = (*XAggInfo)(_pExpr.X13)
_5_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_5_pAggInfo.X8) + 24*uintptr(_pExpr.X10)))
if (_5_pAggInfo.X0) == 0 {
func() {
if (_5_pCol.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94365), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42511)))
crt.X__builtin_abort(tls)
}
}()
return _5_pCol.X4
}
if (_5_pAggInfo.X1) != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _5_pAggInfo.X3, _5_pCol.X3, _target)
return _target
}
_10:
_8_iTab = _pExpr.X8
if _8_iTab >= i32(0) {
goto _64
}
if (_pParse.X21) > i32(0) {
return int32(_pExpr.X9) + (_pParse.X21)
}
_8_iTab = _pParse.X22
_64:
return _sqlite3ExprCodeGetColumn(tls, _pParse, (*XTable)(_pExpr.X14), int32(_pExpr.X9), _8_iTab, _target, _pExpr.X12)
_11:
_codeInteger(tls, _pParse, _pExpr, i32(0), _target)
return _target
_12:
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
_codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(0), _target)
return _target
_13:
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94402), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeLoadString(tls, _v, _target, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))
return _target
_14:
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _target)
return _target
_15:
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94415), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(88) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94416), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42561)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42612)))
crt.X__builtin_abort(tls)
}
}()
_16_z = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(2))))
_16_n = _sqlite3Strlen30(tls, _16_z) - i32(1)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_16_z)) + 1*uintptr(_16_n)))) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94420), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42637)))
crt.X__builtin_abort(tls)
}
}()
_16_zBlob = (*int8)(_sqlite3HexToBlob(tls, _sqlite3VdbeDb(tls, _v), _16_z, _16_n))
_sqlite3VdbeAddOp4(tls, _v, i32(61), _16_n/i32(2), _target, i32(0), _16_zBlob, i32(-1))
return _target
_16:
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94428), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42648)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94429), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42667)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(62), int32(_pExpr.X9), _target)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(0) {
_18_z = _sqlite3VListNumToName(tls, _pParse.X60, int32(_pExpr.X9))
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(63) && crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), _18_z) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94433), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42689)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParse.X60)) + 4*uintptr(i32(0)))) = i32(0)
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_18_z), i32(-2))
}
return _target
_17:
return _pExpr.X8
_18:
_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.X4), _target)
if _inReg != _target {
_sqlite3VdbeAddOp2(tls, _v, i32(65), _inReg, _target)
_inReg = _target
}
_sqlite3VdbeAddOp2(tls, _v, i32(94), _target, int32(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil)))
_sqlite3ExprCacheAffinityChange(tls, _pParse, _inReg, i32(1))
return _inReg
_19:
_op = func() int32 {
if _op == i32(72) {
return i32(78)
}
return i32(77)
}()
_p5 = i32(128)
_21:
_22_pLeft = (*XExpr)(_pExpr.X4)
if _sqlite3ExprIsVector(tls, _22_pLeft) != 0 {
_codeVectorCompare(tls, _pParse, _pExpr, _target, uint8(_op), uint8(_p5))
goto _94
}
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _22_pLeft, &_regFree1)
_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X5), &_regFree2)
_codeCompare(tls, _pParse, _22_pLeft, (*XExpr)(_pExpr.X5), _op, _r1, _r2, _inReg, i32(32)|_p5)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
_94:
goto _95
_27:
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X5), &_regFree2)
_sqlite3VdbeAddOp3(tls, _v, _op, _r2, _r1, _target)
goto _95
_39:
_26_pLeft = (*XExpr)(_pExpr.X4)
func() {
if _26_pLeft == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94519), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42746)))
crt.X__builtin_abort(tls)
}
}()
if int32(_26_pLeft.X0) == i32(134) {
_codeInteger(tls, _pParse, _26_pLeft, i32(1), _target)
return _target
}
if int32(_26_pLeft.X0) == i32(132) {
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94525), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
_codeReal(tls, _v, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_26_pLeft.X3))))), i32(1), _target)
return _target
}
*(*uint8)(unsafe.Pointer(&(_tempX.X0))) = uint8(i32(134))
*(*uint32)(unsafe.Pointer(&(_tempX.X2))) = uint32(i32(17408))
*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_tempX.X3))))) = i32(0)
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, &_tempX, &_regFree1)
_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree2)
_sqlite3VdbeAddOp3(tls, _v, i32(89), _r2, _r1, _target)
goto _95
_40:
i32(0)
i32(0)
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _inReg)
goto _95
_42:
i32(0)
i32(0)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _target)
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_31_addr = _sqlite3VdbeAddOp1(tls, _v, _op, _r1)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _target)
_sqlite3VdbeJumpHere(tls, _v, _31_addr)
goto _95
_44:
_32_pInfo = (*XAggInfo)(_pExpr.X13)
if _32_pInfo == nil {
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94567), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ErrorMsg(tls, _pParse, str(42752), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _107
}
return (*TAggInfo_func)(unsafe.Pointer(uintptr(_32_pInfo.X11) + 16*uintptr(_pExpr.X10))).X2
_107:
goto _95
_45:
_35_constMask = u32(0)
_35_db = (*Xsqlite3)(_pParse.X0)
_35_enc = _35_db.X14
_35_pColl = nil
if ((_pParse.X11) != 0) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
return _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, i32(-1))
}
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94590), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
if ((_pExpr.X2) & uint32(i32(16384))) != uint32(i32(0)) {
_35_pFarg = nil
goto _113
}
_35_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_113:
_35_nFarg = func() int32 {
if _35_pFarg != nil {
return (_35_pFarg.X0)
}
return i32(0)
}()
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
_35_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
_35_pDef = _sqlite3FindFunction(tls, _35_db, _35_zId, _35_nFarg, _35_enc, uint8(i32(0)))
if (_35_pDef == nil) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{(*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_35_pDef.X5)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{nil}))) {
_sqlite3ErrorMsg(tls, _pParse, str(42816), unsafe.Pointer(_35_zId))
goto _95
}
if (int32(_35_pDef.X1) & i32(512)) == 0 {
goto _120
}
_40_endCoalesce = _sqlite3VdbeMakeLabel(tls, _v)
func() {
if _35_nFarg < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42839)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(0)))).X0), _target)
_35_i = i32(1)
_123:
if _35_i >= _35_nFarg {
goto _126
}
_sqlite3VdbeAddOp2(tls, _v, i32(76), _target, _40_endCoalesce)
_sqlite3ExprCacheRemove(tls, _pParse, _target, i32(1))
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(_35_i))).X0), _target)
_sqlite3ExprCachePop(tls, _pParse)
_35_i += 1
goto _123
_126:
_sqlite3VdbeResolveLabel(tls, _v, _40_endCoalesce)
goto _95
_120:
if (int32(_35_pDef.X1) & i32(1024)) != 0 {
func() {
if _35_nFarg < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42848)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(0)))).X0), _target)
}
if (int32(_35_pDef.X1) & i32(16384)) != 0 {
_43_azAff = [5]*int8{}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(i32(0)))) = str(42857)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(i32(1)))) = str(42862)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(i32(2)))) = str(42867)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(i32(3)))) = str(42875)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(i32(4)))) = str(42883)
func() {
if _35_nFarg != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94646), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42888)))
crt.X__builtin_abort(tls)
}
}()
_43_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(0)))).X0))
_sqlite3VdbeLoadString(tls, _v, _target, func() *int8 {
if _43_aff != 0 {
return (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_43_azAff)) + 4*uintptr(int32(_43_aff)-i32(65)))))
}
return str(42897)
}())
return _target
}
_35_i = i32(0)
_135:
if _35_i >= _35_nFarg {
goto _138
}
if (_35_i < i32(32)) && _sqlite3ExprIsConstant(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(_35_i))).X0)) != 0 {
{
p := &_35_constMask
*p = (*p) | (u32(1) << uint(_35_i))
sink5 = *p
}
}
if ((int32(_35_pDef.X1) & i32(32)) != i32(0)) && (_35_pColl == nil) {
_35_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(_35_i))).X0))
}
_35_i += 1
goto _135
_138:
if _35_pFarg == nil {
goto _143
}
if _35_constMask != 0 {
_r1 = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _35_nFarg
sink1 = *p
}
goto _145
}
_r1 = _sqlite3GetTempRange(tls, _pParse, _35_nFarg)
_145:
if (int32(_35_pDef.X1) & i32(192)) == i32(0) {
goto _146
}
func() {
if _35_nFarg != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94678), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42888)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(0)))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42902)))
crt.X__builtin_abort(tls)
}
}()
_50_exprOp = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2))))) + 20*uintptr(i32(0)))).X0).X0
if (int32(_50_exprOp) == i32(152)) || (int32(_50_exprOp) == i32(154)) {
i32(0)
i32(0)
*(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2))))) + 20*uintptr(i32(0)))).X0).X12))) = uint8(int32(_35_pDef.X1) & i32(192))
}
_146:
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprCodeExprList(tls, _pParse, _35_pFarg, _r1, i32(0), uint8(i32(3)))
_sqlite3ExprCachePop(tls, _pParse)
goto _153
_143:
_r1 = i32(0)
_153:
if (_35_nFarg >= i32(2)) && (((_pExpr.X2) & uint32(i32(128))) != 0) {
_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(1)))).X0))
goto _157
}
if _35_nFarg > i32(0) {
_35_pDef = _sqlite3VtabOverloadFunction(tls, _35_db, _35_pDef, _35_nFarg, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_35_pFarg.X2)))))+20*uintptr(i32(0)))).X0))
}
_157:
if (int32(_35_pDef.X1) & i32(32)) == 0 {
goto _158
}
if _35_pColl == nil {
_35_pColl = (*XCollSeq)(_35_db.X2)
}
_sqlite3VdbeAddOp4(tls, _v, i32(68), i32(0), i32(0), i32(0), (*int8)(unsafe.Pointer(_35_pColl)), i32(-3))
_158:
_sqlite3VdbeAddOp4(tls, _v, i32(69), int32(_35_constMask), _r1, _target, (*int8)(unsafe.Pointer(_35_pDef)), i32(-4))
_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_35_nFarg)))
if _35_nFarg != 0 && (_35_constMask == uint32(i32(0))) {
_sqlite3ReleaseTempRange(tls, _pParse, _r1, _35_nFarg)
}
return _target
_46:
if (_op == i32(119)) && (store1(&_57_nCol, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0) != i32(1)) {
_sqlite3SubselectError(tls, _pParse, _57_nCol, i32(1))
goto _164
}
return _sqlite3CodeSubselect(tls, _pParse, _pExpr, i32(0), i32(0))
_164:
goto _95
_48:
if ((*XExpr)(_pExpr.X4).X8) == i32(0) {
*(*int32)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X8))) = _sqlite3CodeSubselect(tls, _pParse, (*XExpr)(_pExpr.X4), i32(0), i32(0))
}
func() {
if (_pExpr.X8) != i32(0) && int32((*XExpr)(_pExpr.X4).X0) != i32(119) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42923)))
crt.X__builtin_abort(tls)
}
}()
if (_pExpr.X8) != 0 && ((_pExpr.X8) != store1(&_60_n, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4)))) {
_sqlite3ErrorMsg(tls, _pParse, str(42971), _pExpr.X8, _60_n)
}
return ((*XExpr)(_pExpr.X4).X8) + int32(_pExpr.X9)
_49:
_63_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
_63_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _target)
_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _63_destIfFalse, _63_destIfNull)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _target)
_sqlite3VdbeResolveLabel(tls, _v, _63_destIfFalse)
_sqlite3VdbeAddOp2(tls, _v, i32(73), _target, i32(0))
_sqlite3VdbeResolveLabel(tls, _v, _63_destIfNull)
return _target
_50:
_exprCodeBetween(tls, _pParse, _pExpr, _target, nil, i32(0))
return _target
_51:
return _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.X4), _target)
_54:
_66_pTab = (*XTable)(_pExpr.X14)
_66_p1 = (((_pExpr.X8) * (int32(_66_pTab.X11) + i32(1))) + i32(1)) + int32(_pExpr.X9)
func() {
if (_pExpr.X8) != i32(0) && (_pExpr.X8) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94819), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43001)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X9) < i32(-1) || int32(_pExpr.X9) >= int32(_66_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94820), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43038)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_66_pTab.X10) >= i32(0) && int32(_pExpr.X9) == int32(_66_pTab.X10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94821), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43086)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _66_p1 < i32(0) || _66_p1 >= ((int32(_66_pTab.X11)*i32(2))+i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43131)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(146), _66_p1, _target)
_sqlite3VdbeComment(tls, _v, str(43160), unsafe.Pointer(func() *int8 {
if (_pExpr.X8) != 0 {
return str(43173)
}
return str(43177)
}()), unsafe.Pointer(func() *int8 {
if int32(_pExpr.X9) < i32(0) {
return str(27227)
}
return ((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pExpr.X14).X1) + 16*uintptr(_pExpr.X9))).X0)
}()), _target)
if (int32(_pExpr.X9) >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr(_66_pTab.X1)+16*uintptr(_pExpr.X9))).X4) == i32(69)) {
_sqlite3VdbeAddOp1(tls, _v, i32(74), _target)
}
goto _95
_55:
_sqlite3ErrorMsg(tls, _pParse, str(43181))
goto _95
_56:
_69_addrINR = _sqlite3VdbeAddOp1(tls, _v, i32(23), _pExpr.X8)
_sqlite3ExprCachePush(tls, _pParse)
_inReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pExpr.X4), _target)
_sqlite3ExprCachePop(tls, _pParse)
_sqlite3VdbeJumpHere(tls, _v, _69_addrINR)
_sqlite3VdbeChangeP3(tls, _v, uint32(_69_addrINR), _inReg)
goto _95
_57:
func() {
if _op != i32(136) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94883), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43199)))
crt.X__builtin_abort(tls)
}
}()
_70_pTest = nil
_70_iCacheLevel = _pParse.X23
func() {
if ((_pExpr.X2)&uint32(i32(2048))) != uint32(i32(0)) || (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94895), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43211)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43267)))
crt.X__builtin_abort(tls)
}
}()
_70_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_70_aListelem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_70_pEList.X2)))))
_70_nExpr = _70_pEList.X0
_70_endLabel = _sqlite3VdbeMakeLabel(tls, _v)
if store36(&_70_pX, (*XExpr)(_pExpr.X4)) != nil {
_tempX = *_70_pX
_exprToRegister(tls, &_tempX, _exprCodeVector(tls, _pParse, &_tempX, &_regFree1))
crt.Xmemset(tls, (unsafe.Pointer)(&_70_opCompare), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_70_opCompare.X0))) = uint8(i32(78))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_70_opCompare.X4))))) = &_tempX
_70_pTest = &_70_opCompare
_regFree1 = i32(0)
}
_70_i = i32(0)
_197:
if _70_i >= (_70_nExpr - i32(1)) {
goto _200
}
_sqlite3ExprCachePush(tls, _pParse)
if _70_pX != nil {
func() {
if _70_pTest == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43293)))
crt.X__builtin_abort(tls)
}
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_70_opCompare.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem)) + 20*uintptr(_70_i))).X0)
goto _204
}
_70_pTest = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem)) + 20*uintptr(_70_i))).X0)
_204:
_70_nextCase = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfFalse(tls, _pParse, _70_pTest, _70_nextCase, i32(16))
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_70_aListelem))+20*uintptr(_70_i+i32(1)))).X0), _target)
_sqlite3VdbeGoto(tls, _v, _70_endLabel)
_sqlite3ExprCachePop(tls, _pParse)
_sqlite3VdbeResolveLabel(tls, _v, _70_nextCase)
_70_i = _70_i + i32(2)
goto _197
_200:
if (_70_nExpr & i32(1)) != i32(0) {
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_70_pEList.X2)))))+20*uintptr(_70_nExpr-i32(1)))).X0), _target)
_sqlite3ExprCachePop(tls, _pParse)
goto _206
}
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _target)
_206:
func() {
if ((*Xsqlite3)(_pParse.X0).X17) == 0 && (_pParse.X16) <= i32(0) && (_pParse.X23) != _70_iCacheLevel {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94940), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43302)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeResolveLabel(tls, _v, _70_endLabel)
goto _95
_58:
func() {
if int32(_pExpr.X1) != i32(1) && int32(_pExpr.X1) != i32(2) && int32(_pExpr.X1) != i32(3) && int32(_pExpr.X1) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94947), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(43381)))
crt.X__builtin_abort(tls)
}
}()
if (*XTable)(_pParse.X40) == nil {
_sqlite3ErrorMsg(tls, _pParse, str(43497))
return i32(0)
}
if int32(_pExpr.X1) == i32(2) {
_sqlite3MayAbort(tls, _pParse)
}
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeTargetØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pExpr.X1) == i32(4) {
_sqlite3VdbeAddOp4(tls, _v, i32(55), i32(0), i32(4), i32(0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(0))
goto _221
}
_sqlite3HaltConstraint(tls, _pParse, i32(1811), int32(_pExpr.X1), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), int8(i32(0)), uint8(i32(0)))
_221:
goto _95
_95:
_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
return _inReg
_ = _tempX
_ = _43_azAff
_ = _70_opCompare
panic(0)
}
var _sqlite3ExprCodeTargetØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeTargetØ00__func__Ø000[0], str(43547), 22)
}
// Generate code that will extract the iColumn-th column from
// table pTab and store the column value in a register.
//
// An effort is made to store the column value in register iReg. This
// is not garanteeed for GetColumn() - the result can be stored in
// any register. But the result is guaranteed to land in register iReg
// for GetColumnToReg().
//
// 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 _sqlite3ExprCodeGetColumn(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32, _p5 uint8) (r0 int32) {
var _i int32
var _v *TVdbe
var _p *TyColCache
_v = (*TVdbe)(_pParse.X2)
*func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_0:
if _i >= int32(_pParse.X13) {
goto _3
}
if ((_p.X0) == _iTable) && (int32(_p.X1) == _iColumn) {
*(*int32)(unsafe.Pointer(&(_p.X5))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X24))), int32(1))
_sqlite3ExprCachePinRegister(tls, _pParse, _p.X4)
return _p.X4
}
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
goto _0
_3:
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94200), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeGetColumnØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTable, _iColumn, _iReg)
if _p5 != 0 {
_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
goto _9
}
_sqlite3ExprCacheStore(tls, _pParse, _iTable, _iColumn, _iReg)
_9:
return _iReg
}
// When a cached column is reused, make sure that its register is
// no longer available as a temp register. ticket #3879: that same
// register might be in the cache in multiple places, so be sure to
// get them all.
func _sqlite3ExprCachePinRegister(tls *crt.TLS, _pParse *XParse, _iReg int32) {
var _i int32
var _p *TyColCache
*func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_0:
if _i >= int32(_pParse.X13) {
goto _3
}
if (_p.X4) == _iReg {
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0))
}
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
goto _0
_3:
}
var _sqlite3ExprCodeGetColumnØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeGetColumnØ00__func__Ø000[0], str(43569), 25)
}
// Generate code to extract the value of the iCol-th column of a table.
func _sqlite3ExprCodeGetColumnOfTable(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iTabCur int32, _iCol int32, _regOut int32) {
var _3_op, _3_x int32
if _pTab == nil {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _iTabCur, _iCol, _regOut)
return
}
if (_iCol < i32(0)) || (_iCol == int32(_pTab.X10)) {
_sqlite3VdbeAddOp2(tls, _v, i32(125), _iTabCur, _regOut)
goto _3
}
_3_op = func() int32 {
if (_pTab.X16) != 0 {
return i32(159)
}
return i32(99)
}()
_3_x = _iCol
if (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && ((_pTab.X16) == 0) {
_3_x = int32(_sqlite3ColumnOfIndex(tls, _sqlite3PrimaryKeyIndex(tls, _pTab), int16(_iCol)))
}
_sqlite3VdbeAddOp3(tls, _v, _3_op, _iTabCur, _3_x, _regOut)
_3:
if _iCol >= i32(0) {
_sqlite3ColumnDefault(tls, _v, _pTab, _iCol, _regOut)
}
}
// Return the column of index pIdx that corresponds to table
// column iCol. Return -1 if not found.
func _sqlite3ColumnOfIndex(tls *crt.TLS, _pIdx *XIndex, _iCol int16) (r0 int16) {
var _i int32
_i = i32(0)
_0:
if _i >= int32(_pIdx.X14) {
goto _3
}
if int32(_iCol) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) {
return int16(_i)
}
_i += 1
goto _0
_3:
return int16(i32(-1))
}
// 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_master 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 parameter iReg is not negative, code an OP_RealAffinity instruction
// on register iReg. This is used when an equivalent integer value is
// stored in place of an 8-byte floating point value in order to save
// space.
func _sqlite3ColumnDefault(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _i int32, _iReg int32) {
var _1_enc uint8
var _1_pValue *XMem
var _1_pCol *XColumn
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
if (*XSelect)(_pTab.X3) != nil {
goto _2
}
_1_pValue = nil
_1_enc = _sqlite3VdbeDb(tls, _v).X14
_1_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_i)))
_sqlite3VdbeComment(tls, _v, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_1_pCol.X0))
func() {
if _i >= int32(_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnDefaultØ00__func__Ø000))), unsafe.Pointer(str(43602)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ValueFromExpr(tls, _sqlite3VdbeDb(tls, _v), (*XExpr)(_1_pCol.X1), _1_enc, uint8(_1_pCol.X4), &_1_pValue)
if _1_pValue != nil {
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_1_pValue), i32(-7))
}
_2:
if int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X4) == i32(69) {
_sqlite3VdbeAddOp1(tls, _v, i32(74), _iReg)
}
}
var _sqlite3ColumnDefaultØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ColumnDefaultØ00__func__Ø000[0], str(43615), 21)
}
// Return the database associated with the Vdbe.
func _sqlite3VdbeDb(tls *crt.TLS, _v *TVdbe) (r0 *Xsqlite3) {
return (*Xsqlite3)(_v.X0)
}
// Create a new sqlite3_value object, containing the value of pExpr.
//
// This only works for very simple expressions that consist of one constant
// token (i.e. "5", "5.1", "'a string'"). If the expression can
// be converted directly into a value, then the value is allocated and
// a pointer written to *ppVal. The caller is responsible for deallocating
// the value by passing it to sqlite3ValueFree() later on. If the expression
// cannot be converted to a value, then *ppVal is set to NULL.
func _sqlite3ValueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem) (r0 int32) {
return func() int32 {
if _pExpr != nil {
return _valueFromExpr(tls, _db, _pExpr, _enc, _affinity, _ppVal, nil)
}
return i32(0)
}()
}
// Extract a value from the supplied expression in the manner described
// above sqlite3ValueFromExpr(). Allocate the sqlite3_value object
// using valueNew().
//
// If pCtx is NULL and an error occurs after the sqlite3_value object
// has been allocated, it is freed before returning. Or, if pCtx is not
// NULL, it is assumed that the caller will free any allocated object
// in all cases.
func _valueFromExpr(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _enc uint8, _affinity uint8, _ppVal **XMem, _pCtx *t41) (r0 int32) {
var _op, _negInt, _rc, _16_nVal int32
var _zVal, _zNeg *int8
var _1_aff uint8
var _pVal *XMem
_zVal = nil
_pVal = nil
_negInt = i32(1)
_zNeg = str(0)
_rc = i32(0)
func() {
if _pExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70976), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43636)))
crt.X__builtin_abort(tls)
}
}()
_2:
if (store1(&_op, int32(_pExpr.X0)) == i32(156)) || (_op == i32(162)) {
_pExpr = (*XExpr)(_pExpr.X4)
goto _2
}
if func() int32 {
if _op == i32(157) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70978), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_op = int32(_pExpr.X12)
}
func() {
if ((_pExpr.X2)&uint32(i32(16384))) != uint32(i32(0)) && _pCtx != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70984), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43645)))
crt.X__builtin_abort(tls)
}
}()
if _op != i32(37) {
goto _11
}
_1_aff = uint8(_sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil))
_rc = _valueFromExpr(tls, _db, (*XExpr)(_pExpr.X4), _enc, _1_aff, _ppVal, _pCtx)
if (*_ppVal) != nil {
_sqlite3VdbeMemCast(tls, *_ppVal, _1_aff, uint8(i32(1)))
_sqlite3ValueApplyAffinity(tls, *_ppVal, _affinity, uint8(i32(1)))
}
return _rc
_11:
if (_op == i32(155)) && ((int32((*XExpr)(_pExpr.X4).X0) == i32(134)) || (int32((*XExpr)(_pExpr.X4).X0) == i32(132))) {
_pExpr = (*XExpr)(_pExpr.X4)
_op = int32(_pExpr.X0)
_negInt = i32(-1)
_zNeg = str(37896)
}
if _op != i32(97) && _op != i32(132) && _op != i32(134) {
goto _18
}
_pVal = _valueNew(tls, _db, _pCtx)
if _pVal == nil {
goto _no_mem
}
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
_sqlite3VdbeMemSetInt64(tls, _pVal, int64(*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))*int64(_negInt))
goto _21
}
_zVal = _sqlite3MPrintf(tls, _db, str(6890), unsafe.Pointer(_zNeg), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
if _zVal == nil {
goto _no_mem
}
_sqlite3ValueSetStr(tls, _pVal, i32(-1), (unsafe.Pointer)(_zVal), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_21:
if ((_op == i32(134)) || (_op == i32(132))) && (int32(_affinity) == i32(65)) {
_sqlite3ValueApplyAffinity(tls, _pVal, uint8(i32(67)), uint8(i32(1)))
goto _26
}
_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, uint8(i32(1)))
_26:
if (int32(_pVal.X1) & i32(12)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pVal.X1)))
*p = uint16(int32(*p) & i32(-3))
sink14 = *p
}
}
if int32(_enc) != i32(1) {
_rc = _sqlite3VdbeChangeEncoding(tls, _pVal, int32(_enc))
}
goto _41
_18:
if _op != i32(155) {
goto _30
}
if i32(0) != _sqlite3ValueFromExpr(tls, _db, (*XExpr)(_pExpr.X4), _enc, _affinity, &_pVal) || _pVal == nil {
goto _32
}
_sqlite3VdbeMemNumerify(tls, _pVal)
if (int32(_pVal.X1) & i32(8)) != 0 {
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = -(*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))))
goto _36
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0)))))) == i64(-9223372036854775808) {
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = 9.223372036854776e+18
*(*uint16)(unsafe.Pointer(&(_pVal.X1))) = uint16((int32(_pVal.X1) & i32(-49664)) | i32(8))
goto _36
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))) = -(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVal.X0))))))
_36:
_sqlite3ValueApplyAffinity(tls, _pVal, _affinity, _enc)
_32:
goto _41
_30:
if _op != i32(101) {
goto _38
}
_pVal = _valueNew(tls, _db, _pCtx)
if _pVal == nil {
goto _no_mem
}
_sqlite3VdbeMemNumerify(tls, _pVal)
goto _41
_38:
if _op != i32(133) {
goto _41
}
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(0))))) != i32(88) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71051), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(42561)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(1))))) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71052), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(42612)))
crt.X__builtin_abort(tls)
}
}()
_pVal = _valueNew(tls, _db, _pCtx)
if _pVal == nil {
goto _no_mem
}
_zVal = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))) + 1*uintptr(i32(2))))
_16_nVal = _sqlite3Strlen30(tls, _zVal) - i32(1)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zVal)) + 1*uintptr(_16_nVal)))) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71057), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43689)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetStr(tls, _pVal, (*int8)(_sqlite3HexToBlob(tls, _db, _zVal, _16_nVal)), _16_nVal/i32(2), uint8(i32(0)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_41:
*_ppVal = _pVal
return _rc
_no_mem:
_sqlite3OomFault(tls, _db)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zVal))
func() {
if (*_ppVal) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71075), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43706)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pCtx != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71079), unsafe.Pointer((*int8)(unsafe.Pointer(&_valueFromExprØ00__func__Ø000))), unsafe.Pointer(str(43716)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ValueFree(tls, _pVal)
return _sqlite3NomemError(tls, i32(71081))
}
var _valueFromExprØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_valueFromExprØ00__func__Ø000[0], str(43724), 14)
}
// 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 _sqlite3AffinityType(tls *crt.TLS, _zIn *int8, _pszEst *uint8) (r0 int8) {
var _14_v int32
var _aff int8
var _h uint32
var _zChar *int8
_h = u32(0)
_aff = i8(67)
_zChar = nil
func() {
if _zIn == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100847), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AffinityTypeØ00__func__Ø000))), unsafe.Pointer(str(43738)))
crt.X__builtin_abort(tls)
}
}()
_2:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) == 0 {
goto _3
}
_h = (_h << uint(i32(8))) + uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(int32(*_zIn)&i32(255)))))
*(*uintptr)(unsafe.Pointer(&_zIn)) += uintptr(1)
if _h == uint32(i32(1667785074)) {
_aff = int8(i32(66))
_zChar = _zIn
goto _24
}
if _h == uint32(i32(1668050786)) {
_aff = int8(i32(66))
goto _24
}
if _h == uint32(i32(1952807028)) {
_aff = int8(i32(66))
goto _24
}
if _h != uint32(i32(1651273570)) || int32(_aff) != i32(67) && int32(_aff) != i32(69) {
goto _12
}
_aff = int8(i32(65))
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) == i32(40) {
_zChar = _zIn
}
goto _24
_12:
if (_h == uint32(i32(1919246700))) && (int32(_aff) == i32(67)) {
_aff = int8(i32(69))
goto _24
}
if (_h == uint32(i32(1718382433))) && (int32(_aff) == i32(67)) {
_aff = int8(i32(69))
goto _24
}
if (_h == uint32(i32(1685026146))) && (int32(_aff) == i32(67)) {
_aff = int8(i32(69))
goto _24
}
if (_h & uint32(i32(16777215))) == uint32(i32(6909556)) {
_aff = int8(i32(68))
goto _3
}
_24:
goto _2
_3:
if _pszEst == nil {
goto _25
}
*_pszEst = uint8(i32(1))
if int32(_aff) >= i32(67) {
goto _26
}
if _zChar == nil {
goto _27
}
_28:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zChar)) + 1*uintptr(i32(0))))) == 0 {
goto _29
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zChar)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 {
goto _30
}
_14_v = i32(0)
_sqlite3GetInt32(tls, _zChar, &_14_v)
_14_v = (_14_v / i32(4)) + i32(1)
if _14_v > i32(255) {
_14_v = i32(255)
}
*_pszEst = uint8(_14_v)
goto _29
_30:
*(*uintptr)(unsafe.Pointer(&_zChar)) += uintptr(1)
goto _28
_29:
goto _32
_27:
*_pszEst = uint8(i32(5))
_32:
_26:
_25:
return _aff
}
var _sqlite3AffinityTypeØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AffinityTypeØ00__func__Ø000[0], str(43745), 20)
}
// 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 _sqlite3GetInt32(tls *crt.TLS, _zNum *int8, _pValue *int32) (r0 int32) {
var _i, _c, _neg int32
var _v int64
var _3_u uint32
_v = i64(0)
_neg = i32(0)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(45) {
_neg = i32(1)
*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
goto _7
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(43) {
*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
goto _7
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(1))))) != i32(88) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(2)))))))))&i32(8)) == 0 {
goto _7
}
_3_u = u32(0)
{
p := &_zNum
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink0 = *p
}
_8:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48) {
*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
goto _8
}
_i = i32(0)
_10:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))))))&i32(8)) == 0 || _i >= i32(8) {
goto _14
}
_3_u = (_3_u * uint32(i32(16))) + uint32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))))
_i += 1
goto _10
_14:
if ((_3_u & u32(2147483648)) == uint32(i32(0))) && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i)))))))) & i32(8)) == i32(0)) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_pValue), (unsafe.Pointer)(&_3_u), uint32(i32(4)))
return i32(1)
}
return i32(0)
_7:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))))))) & i32(4)) == 0 {
return i32(0)
}
_18:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(i32(0))))) == i32(48) {
*(*uintptr)(unsafe.Pointer(&_zNum)) += uintptr(1)
goto _18
}
_i = i32(0)
_21:
if _i >= i32(11) || store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zNum)) + 1*uintptr(_i))))-i32(48)) < i32(0) || _c > i32(9) {
goto _26
}
_v = (_v * int64(i32(10))) + int64(_c)
_i += 1
goto _21
_26:
if _i > i32(10) {
return i32(0)
}
if (_v - int64(_neg)) > int64(i32(2147483647)) {
return i32(0)
}
if _neg != 0 {
_v = -_v
}
*_pValue = int32(_v)
return i32(1)
}
// Translate a single byte of Hex into an integer.
// This routine only works if h really is a valid hexadecimal
// character: 0..9a..fA..F
func _sqlite3HexToInt(tls *crt.TLS, _h int32) (r0 uint8) {
func() {
if (_h < i32(48) || _h > i32(57)) && (_h < i32(97) || _h > i32(102)) && (_h < i32(65) || _h > i32(70)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28838), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HexToIntØ00__func__Ø000))), unsafe.Pointer(str(43765)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_h
*p = (*p) + (i32(9) * (i32(1) & (_h >> uint(i32(6)))))
sink1 = *p
}
return uint8(_h & i32(15))
}
var _sqlite3HexToIntØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HexToIntØ00__func__Ø000[0], str(43828), 16)
}
// Cast the datatype of the value in pMem according to the affinity
// "aff". Casting is different from applying affinity in that a cast
// is forced. In other words, the value is converted into the desired
// affinity even if that results in loss of data. This routine is
// used (for example) to implement the SQL "cast()" operator.
func _sqlite3VdbeMemCast(tls *crt.TLS, _pMem *XMem, _aff uint8, _encoding uint8) {
if (int32(_pMem.X1) & i32(1)) != 0 {
return
}
switch int32(_aff) {
case i32(65):
goto _2
case i32(67):
goto _3
case i32(68):
goto _4
case i32(69):
goto _5
default:
goto _6
}
_2:
if (int32(_pMem.X1) & i32(16)) != i32(0) {
goto _7
}
_sqlite3ValueApplyAffinity(tls, _pMem, uint8(i32(66)), _encoding)
func() {
if (int32(_pMem.X1)&i32(2)) == 0 && ((*Xsqlite3)(_pMem.X9).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70304), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000))), unsafe.Pointer(str(43844)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pMem.X1) & i32(2)) != 0 {
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(16))
}
goto _12
_7:
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-33264))
sink14 = *p
}
_12:
goto _13
_3:
_sqlite3VdbeMemNumerify(tls, _pMem)
goto _13
_4:
_sqlite3VdbeMemIntegerify(tls, _pMem)
goto _13
_5:
_sqlite3VdbeMemRealify(tls, _pMem)
goto _13
_6:
func() {
if int32(_aff) != i32(66) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70324), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000))), unsafe.Pointer(str(43892)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) | ((int32(_pMem.X1) & i32(16)) >> uint(i32(3))))
sink14 = *p
}
_sqlite3ValueApplyAffinity(tls, _pMem, uint8(i32(66)), _encoding)
func() {
if (int32(_pMem.X1)&i32(2)) == 0 && ((*Xsqlite3)(_pMem.X9).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70328), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemCastØ00__func__Ø000))), unsafe.Pointer(str(43844)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-16413))
sink14 = *p
}
goto _13
_13:
}
// Exported version of applyAffinity(). This one works on sqlite3_value*,
// not the internal Mem* type.
func _sqlite3ValueApplyAffinity(tls *crt.TLS, _pVal *XMem, _affinity uint8, _enc uint8) {
_applyAffinity(tls, _pVal, int8(_affinity), _enc)
}
// Processing is determine by the affinity parameter:
//
// SQLITE_AFF_INTEGER:
// SQLITE_AFF_REAL:
// SQLITE_AFF_NUMERIC:
// Try to convert pRec to an integer representation or a
// floating-point representation if an integer representation
// is not possible. Note that the integer representation is
// always preferred, even if the affinity is REAL, because
// an integer representation is more space efficient on disk.
//
// SQLITE_AFF_TEXT:
// Convert pRec to a text representation.
//
// SQLITE_AFF_BLOB:
// No-op. pRec is unchanged.
func _applyAffinity(tls *crt.TLS, _pRec *XMem, _affinity int8, _enc uint8) {
if int32(_affinity) < i32(67) {
goto _0
}
func() {
if int32(_affinity) != i32(68) && int32(_affinity) != i32(69) && int32(_affinity) != i32(67) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78494), unsafe.Pointer((*int8)(unsafe.Pointer(&_applyAffinityØ00__func__Ø000))), unsafe.Pointer(str(43913)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pRec.X1) & i32(4)) != i32(0) {
goto _5
}
if (int32(_pRec.X1) & i32(8)) != i32(0) {
goto _6
}
if (int32(_pRec.X1) & i32(2)) != 0 {
_applyNumericAffinity(tls, _pRec, i32(1))
}
goto _8
_6:
_sqlite3VdbeIntegerAffinity(tls, _pRec)
_8:
_5:
goto _10
_0:
if int32(_affinity) != i32(66) {
goto _10
}
if i32(0) != (int32(_pRec.X1) & i32(2)) {
goto _11
}
if (int32(_pRec.X1) & i32(12)) != 0 {
_sqlite3VdbeMemStringify(tls, _pRec, _enc, uint8(i32(1)))
}
_11:
{
p := (*uint16)(unsafe.Pointer(&(_pRec.X1)))
*p = uint16(int32(*p) & i32(-13))
sink14 = *p
}
_10:
}
var _applyAffinityØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_applyAffinityØ00__func__Ø000[0], str(44003), 14)
}
// Try to convert a value into a numeric representation if we can
// do so without loss of information. In other words, if the string
// looks like a number, convert it into a number. If it does not
// look like a number, leave it alone.
//
// If the bTryForInt flag is true, then extra effort is made to give
// an integer representation. Strings that look like floating point
// values but which have no fractional component (example: '48.00')
// will have a MEM_Int representation when bTryForInt is true.
//
// If bTryForInt is false, then if the input string contains a decimal
// point or exponential notation, the result is only MEM_Real, even
// if there is an exact integer representation of the quantity.
func _applyNumericAffinity(tls *crt.TLS, _pRec *XMem, _bTryForInt int32) {
var _iValue int64
var _rValue float64
var _enc uint8
_enc = _pRec.X2
func() {
if (int32(_pRec.X1) & i32(14)) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78458), unsafe.Pointer((*int8)(unsafe.Pointer(&_applyNumericAffinityØ00__func__Ø000))), unsafe.Pointer(str(44017)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AtoF(tls, _pRec.X5, &_rValue, _pRec.X4, _enc) == i32(0) {
return
}
if i32(0) == _sqlite3Atoi64(tls, _pRec.X5, &_iValue, _pRec.X4, _enc) {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRec.X0))))) = _iValue
{
p := (*uint16)(unsafe.Pointer(&(_pRec.X1)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
goto _4
}
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRec.X0))))) = _rValue
{
p := (*uint16)(unsafe.Pointer(&(_pRec.X1)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
if _bTryForInt != 0 {
_sqlite3VdbeIntegerAffinity(tls, _pRec)
}
_4:
}
var _applyNumericAffinityØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_applyNumericAffinityØ00__func__Ø000[0], str(44069), 21)
}
// The MEM structure is already a MEM_Real. Try to also make it a
// MEM_Int if we can.
func _sqlite3VdbeIntegerAffinity(tls *crt.TLS, _pMem *XMem) {
var _ix int64
func() {
if (int32(_pMem.X1) & i32(8)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70217), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000))), unsafe.Pointer(str(44090)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70218), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000))), unsafe.Pointer(str(6728)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70219), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70220), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIntegerAffinityØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
_ix = _doubleToInt64(tls, *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
if (((*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) == float64(_ix)) && (_ix > i64(-9223372036854775808))) && (_ix < i64(9223372036854775807)) {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _ix
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4))
}
}
var _sqlite3VdbeIntegerAffinityØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeIntegerAffinityØ00__func__Ø000[0], str(44113), 27)
}
var _sqlite3VdbeMemCastØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemCastØ00__func__Ø000[0], str(44140), 19)
}
// Convert pMem so that it has types MEM_Real or MEM_Int or both.
// Invalidate any prior representations.
//
// Every effort is made to force the conversion, even if the input
// is a string that does not look completely like a number. Convert
// as much of the string as we can and ignore the rest.
func _sqlite3VdbeMemNumerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
if (int32(_pMem.X1) & i32(13)) != i32(0) {
goto _0
}
func() {
if (int32(_pMem.X1) & i32(18)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000))), unsafe.Pointer(str(44159)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70277), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) {
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4))
goto _7
}
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeRealValue(tls, _pMem)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8))
_sqlite3VdbeIntegerAffinity(tls, _pMem)
_7:
_0:
func() {
if (int32(_pMem.X1) & i32(13)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70286), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemNumerifyØ00__func__Ø000))), unsafe.Pointer(str(44197)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pMem.X1)))
*p = uint16(int32(*p) & i32(-16403))
sink14 = *p
}
return i32(0)
}
var _sqlite3VdbeMemNumerifyØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemNumerifyØ00__func__Ø000[0], str(44244), 23)
}
// Convert pMem to type integer. Invalidate any prior representations.
func _sqlite3VdbeMemIntegerify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70244), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70245), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000))), unsafe.Pointer(str(6728)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70246), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemIntegerifyØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeIntValue(tls, _pMem)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(4))
return i32(0)
}
var _sqlite3VdbeMemIntegerifyØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemIntegerifyØ00__func__Ø000[0], str(44267), 25)
}
// Convert pMem so that it is of type MEM_Real.
// Invalidate any prior representations.
func _sqlite3VdbeMemRealify(tls *crt.TLS, _pMem *XMem) (r0 int32) {
func() {
if (*Xsqlite3)(_pMem.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pMem.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70258), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000))), unsafe.Pointer(str(4667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70259), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemRealifyØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = _sqlite3VdbeRealValue(tls, _pMem)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16((int32(_pMem.X1) & i32(-49664)) | i32(8))
return i32(0)
}
var _sqlite3VdbeMemRealifyØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemRealifyØ00__func__Ø000[0], str(44292), 22)
}
// Allocate and return a pointer to a new sqlite3_value object. If
// the second argument to this function is NULL, the object is allocated
// by calling sqlite3ValueNew().
//
// Otherwise, if the second argument is non-zero, then this function is
// being called indirectly by sqlite3Stat4ProbeSetValue(). If it has not
// already been allocated, allocate the UnpackedRecord structure that
// that function will return to its caller here. Then return a pointer to
// an sqlite3_value within the UnpackedRecord.a[] array.
func _valueNew(tls *crt.TLS, _db *Xsqlite3, _p *t41) (r0 *XMem) {
return _sqlite3ValueNew(tls, _db)
}
// 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 _sqlite3HexToBlob(tls *crt.TLS, _db *Xsqlite3, _z *int8, _n int32) (r0 unsafe.Pointer) {
var _i int32
var _zBlob *int8
_zBlob = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64((_n/i32(2))+i32(1))))
_n -= 1
if _zBlob == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= _n {
goto _4
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8((int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))))) << uint(i32(4))) | int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i+i32(1))))))))
{
p := &_i
*p = (*p) + i32(2)
sink1 = *p
}
goto _1
_4:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBlob)) + 1*uintptr(_i/i32(2)))) = int8(i32(0))
_0:
return (unsafe.Pointer)(_zBlob)
}
func _sqlite3VdbeAddOp1(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32) (r0 int32) {
return _sqlite3VdbeAddOp3(tls, _p, _op, _p1, i32(0), i32(0))
}
// Record in the column cache that a particular column from a
// particular table is stored in a particular register.
func _sqlite3ExprCacheStore(tls *crt.TLS, _pParse *XParse, _iTab int32, _iCol int32, _iReg int32) {
var _i, _minLru, _idxLru int32
var _p *TyColCache
func() {
if _iReg <= i32(0) && (_pParse.X16) == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94005), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000))), unsafe.Pointer(str(44314)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iCol < i32(-1) || _iCol >= i32(32768) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94006), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000))), unsafe.Pointer(str(44365)))
crt.X__builtin_abort(tls)
}
}()
if (int32((*Xsqlite3)(_pParse.X0).X13) & i32(2)) != i32(0) {
return
}
*func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_8:
if _i >= int32(_pParse.X13) {
goto _11
}
func() {
if (_p.X0) == _iTab && int32(_p.X1) == _iCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94021), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCacheStoreØ00__func__Ø000))), unsafe.Pointer(str(44388)))
crt.X__builtin_abort(tls)
}
}()
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
goto _8
_11:
if int32(_pParse.X13) < i32(10) {
goto _15
}
_minLru = i32(2147483647)
_idxLru = i32(-1)
*func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_16:
if _i >= i32(10) {
goto _19
}
if (_p.X5) < _minLru {
_idxLru = _i
_minLru = _p.X5
}
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
goto _16
_19:
_p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_idxLru)))
goto _21
_15:
_p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X13))), uint8(1)))))
_21:
*(*int32)(unsafe.Pointer(&(_p.X3))) = _pParse.X23
*(*int32)(unsafe.Pointer(&(_p.X0))) = _iTab
*(*int16)(unsafe.Pointer(&(_p.X1))) = int16(_iCol)
*(*int32)(unsafe.Pointer(&(_p.X4))) = _iReg
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_p.X5))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X24))), int32(1))
}
var _sqlite3ExprCacheStoreØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCacheStoreØ00__func__Ø000[0], str(44424), 22)
}
// Generate an instruction that will put the integer describe by
// text z[0..n-1] into register iMem.
//
// Expr.u.zToken is always UTF8 and zero-terminated.
func _codeInteger(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _negFlag int32, _iMem int32) {
var _1_i, _2_c int32
var _2_value int64
var _2_z *int8
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
if ((_pExpr.X2) & uint32(i32(1024))) == 0 {
goto _0
}
_1_i = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
func() {
if _1_i < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93949), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeIntegerØ00__func__Ø000))), unsafe.Pointer(str(44446)))
crt.X__builtin_abort(tls)
}
}()
if _negFlag != 0 {
_1_i = -_1_i
}
_sqlite3VdbeAddOp2(tls, _v, i32(56), _1_i, _iMem)
goto _4
_0:
_2_z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
func() {
if _2_z == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93956), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeIntegerØ00__func__Ø000))), unsafe.Pointer(str(44451)))
crt.X__builtin_abort(tls)
}
}()
_2_c = _sqlite3DecOrHexToI64(tls, _2_z, &_2_value)
if _2_c != i32(1) && (_2_c != i32(2) || _negFlag != 0) && (_negFlag == 0 || _2_value != i64(-9223372036854775808)) {
goto _11
}
if Xsqlite3_strnicmp(tls, _2_z, str(44456), i32(2)) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(44459), unsafe.Pointer(func() *int8 {
if _negFlag != 0 {
return str(37896)
}
return str(0)
}()), unsafe.Pointer(_2_z))
goto _15
}
_codeReal(tls, _v, _2_z, _negFlag, _iMem)
_15:
goto _16
_11:
if _negFlag != 0 {
_2_value = func() int64 {
if _2_c == i32(2) {
return i64(-9223372036854775808)
}
return (-_2_value)
}()
}
_sqlite3VdbeAddOp4Dup8(tls, _v, i32(57), i32(0), _iMem, i32(0), (*uint8)(unsafe.Pointer(&_2_value)), i32(-10))
_16:
_4:
}
var _codeIntegerØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_codeIntegerØ00__func__Ø000[0], str(44485), 12)
}
// 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 Integer too large for a 64-bit signed integer or is malformed
// 2 Special case of 9223372036854775808
func _sqlite3DecOrHexToI64(tls *crt.TLS, _z *int8, _pOut *int64) (r0 int32) {
var _1_i, _1_k int32
var _1_u uint64
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(48) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(120) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) != i32(88) {
goto _2
}
_1_u = u64(0)
_1_i = i32(2)
_3:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_i)))) != i32(48) {
goto _6
}
_1_i += 1
goto _3
_6:
_1_k = _1_i
_7:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k)))))))) & i32(8)) == 0 {
goto _10
}
_1_u = (_1_u * uint64(i32(16))) + uint64(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k))))))
_1_k += 1
goto _7
_10:
crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut), (unsafe.Pointer)(&_1_u), uint32(i32(8)))
return func() int32 {
if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_1_k)))) == i32(0)) && ((_1_k - _1_i) <= i32(16)) {
return i32(0)
}
return i32(1)
}()
_2:
return _sqlite3Atoi64(tls, _z, _pOut, _sqlite3Strlen30(tls, _z), uint8(i32(1)))
}
// Generate an instruction that will put the floating point
// value described by z[0..n-1] into register iMem.
//
// The z[] string will probably not be zero-terminated. But the
// z[n] character is guaranteed to be something that does not look
// like the continuation of the number.
func _codeReal(tls *crt.TLS, _v *TVdbe, _z *int8, _negateFlag int32, _iMem int32) {
var _1_value float64
if func() int32 {
if _z != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93928), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRealØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _2
}
_sqlite3AtoF(tls, _z, &_1_value, _sqlite3Strlen30(tls, _z), uint8(i32(1)))
func() {
if _sqlite3IsNaN(tls, _1_value) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93931), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRealØ00__func__Ø000))), unsafe.Pointer(str(44497)))
crt.X__builtin_abort(tls)
}
}()
if _negateFlag != 0 {
_1_value = -_1_value
}
_sqlite3VdbeAddOp4Dup8(tls, _v, i32(132), i32(0), _iMem, i32(0), (*uint8)(unsafe.Pointer(&_1_value)), i32(-9))
_2:
}
var _codeRealØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_codeRealØ00__func__Ø000[0], str(44518), 9)
}
// Add an opcode that includes the p4 value with a P4_INT64 or
// P4_REAL type.
func _sqlite3VdbeAddOp4Dup8(tls *crt.TLS, _p *TVdbe, _op int32, _p1 int32, _p2 int32, _p3 int32, _zP4 *uint8, _p4type int32) (r0 int32) {
var _p4copy *int8
_p4copy = (*int8)(_sqlite3DbMallocRawNN(tls, _sqlite3VdbeDb(tls, _p), uint64(i32(8))))
if _p4copy != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(_p4copy), (unsafe.Pointer)(_zP4), uint32(i32(8)))
}
return _sqlite3VdbeAddOp4(tls, _p, _op, _p1, _p2, _p3, _p4copy, _p4type)
}
// Record the fact that an affinity change has occurred on iCount
// registers starting with iStart.
func _sqlite3ExprCacheAffinityChange(tls *crt.TLS, _pParse *XParse, _iStart int32, _iCount int32) {
_sqlite3ExprCacheRemove(tls, _pParse, _iStart, _iCount)
}
// Indicate that registers between iReg..iReg+nReg-1 are being overwritten.
// Purge the range of registers from the column cache.
func _sqlite3ExprCacheRemove(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
var _i int32
var _1_p *TyColCache
_i = i32(0)
_0:
if _i >= int32(_pParse.X13) {
goto _1
}
_1_p = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i)))
if ((_1_p.X4) >= _iReg) && ((_1_p.X4) < (_iReg + _nReg)) {
_cacheEntryClear(tls, _pParse, _i)
goto _4
}
_i += 1
_4:
goto _0
_1:
}
// Erase column-cache entry number i
func _cacheEntryClear(tls *crt.TLS, _pParse *XParse, _i int32) {
if ((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X2) == 0 {
goto _0
}
if int32(_pParse.X7) < i32(8) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X4
}
_0:
*(*uint8)(unsafe.Pointer(&(_pParse.X13))) -= 1
if _i < int32(_pParse.X13) {
*(*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))) = *(*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_pParse.X13)))
}
}
// 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 _sqlite3ExprIsVector(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
return bool2int(_sqlite3ExprVectorSize(tls, _pExpr) > i32(1))
}
// 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 _sqlite3ExprVectorSize(tls *crt.TLS, _pExpr *XExpr) (r0 int32) {
var _op uint8
_op = _pExpr.X0
if int32(_op) == i32(157) {
_op = _pExpr.X12
}
if int32(_op) == i32(158) {
return (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0
}
if int32(_op) == i32(119) {
return (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0
}
return i32(1)
}
// Expression pExpr is a comparison between two vector values. Compute
// the result of the comparison (1, 0, or NULL) and write that
// result into register dest.
//
// The caller must satisfy the following preconditions:
//
// if pExpr->op==TK_IS: op==TK_EQ and p5==SQLITE_NULLEQ
// if pExpr->op==TK_ISNOT: op==TK_NE and p5==SQLITE_NULLEQ
// otherwise: op==pExpr->op and p5==0
func _codeVectorCompare(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _op uint8, _p5 uint8) {
var _nLeft, _i, _regLeft, _regRight, _addrDone, _2_regFree1, _2_regFree2, _2_r1, _2_r2 int32
var _opx uint8
var _v *TVdbe
var _pLeft, _pRight, _2_pL, _2_pR *XExpr
_v = (*TVdbe)(_pParse.X2)
_pLeft = (*XExpr)(_pExpr.X4)
_pRight = (*XExpr)(_pExpr.X5)
_nLeft = _sqlite3ExprVectorSize(tls, _pLeft)
_regLeft = i32(0)
_regRight = i32(0)
_opx = _op
_addrDone = _sqlite3VdbeMakeLabel(tls, _v)
if _nLeft != _sqlite3ExprVectorSize(tls, _pRight) {
_sqlite3ErrorMsg(tls, _pParse, str(43181))
return
}
func() {
if int32(_pExpr.X0) != i32(78) && int32(_pExpr.X0) != i32(77) && int32(_pExpr.X0) != i32(72) && int32(_pExpr.X0) != i32(148) && int32(_pExpr.X0) != i32(81) && int32(_pExpr.X0) != i32(79) && int32(_pExpr.X0) != i32(80) && int32(_pExpr.X0) != i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91429), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44527)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) != int32(_op) && (int32(_pExpr.X0) != i32(72) || int32(_op) != i32(78)) && (int32(_pExpr.X0) != i32(148) || int32(_op) != i32(77)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91434), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44687)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p5) != i32(0) && int32(_pExpr.X0) == int32(_op) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91436), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44774)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p5) != i32(128) && int32(_pExpr.X0) != int32(_op) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91437), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44797)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_p5
*p = uint8(int32(*p) | i32(32))
sink2 = *p
}
if int32(_opx) == i32(80) {
_opx = uint8(i32(81))
}
if int32(_opx) == i32(82) {
_opx = uint8(i32(79))
}
_regLeft = _exprCodeSubselect(tls, _pParse, _pLeft)
_regRight = _exprCodeSubselect(tls, _pParse, _pRight)
_i = i32(0)
_24:
_2_regFree1 = i32(0)
_2_regFree2 = i32(0)
func() {
if _i < i32(0) || _i >= _nLeft {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91450), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44832)))
crt.X__builtin_abort(tls)
}
}()
if _i > i32(0) {
_sqlite3ExprCachePush(tls, _pParse)
}
_2_r1 = _exprVectorRegister(tls, _pParse, _pLeft, _i, _regLeft, &_2_pL, &_2_regFree1)
_2_r2 = _exprVectorRegister(tls, _pParse, _pRight, _i, _regRight, &_2_pR, &_2_regFree2)
_codeCompare(tls, _pParse, _2_pL, _2_pR, int32(_opx), _2_r1, _2_r2, _dest, int32(_p5))
_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree1)
_sqlite3ReleaseTempReg(tls, _pParse, _2_regFree2)
if _i > i32(0) {
_sqlite3ExprCachePop(tls, _pParse)
}
if _i == (_nLeft - i32(1)) {
goto _27
}
if int32(_opx) == i32(78) {
_sqlite3VdbeAddOp2(tls, _v, i32(22), _dest, _addrDone)
{
p := &_p5
*p = uint8(int32(*p) | i32(8))
sink2 = *p
}
goto _37
}
if int32(_opx) == i32(77) {
_sqlite3VdbeAddOp2(tls, _v, i32(21), _dest, _addrDone)
{
p := &_p5
*p = uint8(int32(*p) | i32(8))
sink2 = *p
}
goto _37
}
func() {
if int32(_op) != i32(81) && int32(_op) != i32(79) && int32(_op) != i32(80) && int32(_op) != i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91474), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeVectorCompareØ00__func__Ø000))), unsafe.Pointer(str(44848)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(83), i32(0), _addrDone)
if _i == (_nLeft - i32(2)) {
_opx = _op
}
_37:
_i += 1
goto _24
_27:
_sqlite3VdbeResolveLabel(tls, _v, _addrDone)
}
// Create a new symbolic label for an instruction that has yet to be
// coded. The symbolic label is really just a negative number. The
// label can be used as the P2 value of an operation. Later, when
// the label is resolved to a specific address, the VDBE will scan
// through its operation list and change all values of P2 which match
// the label into the resolved address.
//
// The VDBE knows that a P2 value is a label because labels are
// always negative and P2 values are suppose to be non-negative.
// Hence, a negative P2 value is a label that has yet to be resolved.
//
// Zero is returned if a malloc() fails.
func _sqlite3VdbeMakeLabel(tls *crt.TLS, _v *TVdbe) (r0 int32) {
var _i int32
var _p *XParse
_p = (*XParse)(_v.X3)
_i = postInc1((*int32)(unsafe.Pointer(&(_p.X25))), int32(1))
func() {
if (_v.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeLabelØ00__func__Ø000))), unsafe.Pointer(str(44897)))
crt.X__builtin_abort(tls)
}
}()
if (_i & (_i - i32(1))) == i32(0) {
*(**int32)(unsafe.Pointer(&(_p.X26))) = (*int32)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X26), uint64(uint32((_i*i32(2))+i32(1))*u32(4))))
}
if (_p.X26) != nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X26)) + 4*uintptr(_i))) = i32(-1)
}
return i32(-1) - _i
}
var _sqlite3VdbeMakeLabelØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMakeLabelØ00__func__Ø000[0], str(44923), 21)
}
var _codeVectorCompareØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_codeVectorCompareØ00__func__Ø000[0], str(44944), 18)
}
// If expression pExpr is of type TK_SELECT, generate code to evaluate
// it. Return the register in which the result is stored (or, if the
// sub-select returns more than one column, the first in an array
// of registers in which the result is stored).
//
// If pExpr is not a TK_SELECT expression, return 0.
func _exprCodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
var _reg int32
_reg = i32(0)
if int32(_pExpr.X0) == i32(119) {
_reg = _sqlite3CodeSubselect(tls, _pParse, _pExpr, i32(0), i32(0))
}
return _reg
}
func _sqlite3CodeSubselect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _rHasNullFlag int32, _isRowid int32) (r0 int32) {
var _jmpIfDynamic, _rReg, _4_addr, _4_nVal, _6_i, _9_i, _9_r1, _9_r2, _9_r3, _12_iValToIns, _19_nReg int32
var _9_affinity int8
var _2_zMsg *int8
var _v *TVdbe
var _5_pEList, _9_pList *XExprList
var _9_pItem *TExprList_item
var _5_pSelect, _19_pSel *XSelect
var _4_pLeft, _8_p, _12_pE2 *XExpr
var _4_pKeyInfo *XKeyInfo
var _6_dest, _19_dest XSelectDest
_jmpIfDynamic = i32(-1)
_rReg = i32(0)
_v = _sqlite3GetVdbe(tls, _pParse)
if func() int32 {
if _v == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93411), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return i32(0)
}
_sqlite3ExprCachePush(tls, _pParse)
if ((_pExpr.X2) & uint32(i32(32))) == uint32(i32(0)) {
_jmpIfDynamic = _sqlite3VdbeAddOp0(tls, _v, i32(20))
}
if int32(_pParse.X54) == i32(2) {
_2_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(44962), unsafe.Pointer(func() *int8 {
if _jmpIfDynamic >= i32(0) {
return str(0)
}
return str(44987)
}()), unsafe.Pointer(func() *int8 {
if int32(_pExpr.X0) == i32(74) {
return str(44999)
}
return str(45004)
}()), _pParse.X59)
_sqlite3VdbeAddOp4(tls, _v, i32(165), _pParse.X58, i32(0), i32(0), _2_zMsg, i32(-1))
}
switch int32(_pExpr.X0) {
case i32(20):
goto _11
case i32(74):
goto _10
case i32(119):
goto _11
default:
goto _11
}
_10:
_4_pLeft = (*XExpr)(_pExpr.X4)
_4_pKeyInfo = nil
_4_nVal = _sqlite3ExprVectorSize(tls, _4_pLeft)
func() {
if _isRowid != 0 && _4_nVal != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45011)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_4_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _pExpr.X8, func() int32 {
if _isRowid != 0 {
return i32(0)
}
return _4_nVal
}())
_4_pKeyInfo = func() *XKeyInfo {
if _isRowid != 0 {
return nil
}
return _sqlite3KeyInfoAlloc(tls, (*Xsqlite3)(_pParse.X0), _4_nVal, i32(1))
}()
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
goto _21
}
_5_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_5_pEList = (*XExprList)(_5_pSelect.X0)
func() {
if _isRowid != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93476), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45031)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (_5_pEList.X0) == _4_nVal {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93479), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _26
}
_sqlite3SelectDestInit(tls, &_6_dest, i32(11), _pExpr.X8)
*(**int8)(unsafe.Pointer(&(_6_dest.X1))) = _exprINAffinity(tls, _pParse, _pExpr)
*(*int32)(unsafe.Pointer(&(_5_pSelect.X4))) = i32(0)
if _sqlite3Select(tls, _pParse, _5_pSelect, &_6_dest) != 0 {
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_6_dest.X1))
_sqlite3KeyInfoUnref(tls, _4_pKeyInfo)
return i32(0)
}
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_6_dest.X1))
func() {
if _4_pKeyInfo == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45040)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _5_pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93494), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_5_pEList.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45062)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45078)))
crt.X__builtin_abort(tls)
}
}()
_6_i = i32(0)
_36:
if _6_i >= _4_nVal {
goto _39
}
_8_p = _sqlite3VectorFieldSubexpr(tls, _4_pLeft, _6_i)
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_4_pKeyInfo.X6))))) + 4*uintptr(_6_i))) = _sqlite3BinaryCompareCollSeq(tls, _pParse, _8_p, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_5_pEList.X2)))))+20*uintptr(_6_i))).X0))
_6_i += 1
goto _36
_39:
_26:
goto _43
_21:
if func() int32 {
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93504), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _43
}
_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_9_affinity = _sqlite3ExprAffinity(tls, _4_pLeft)
if _9_affinity == 0 {
_9_affinity = int8(i32(65))
}
if _4_pKeyInfo != nil {
func() {
if _sqlite3KeyInfoIsWriteable(tls, _4_pKeyInfo) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93523), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45078)))
crt.X__builtin_abort(tls)
}
}()
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_4_pKeyInfo.X6))))) + 4*uintptr(i32(0)))) = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4))
}
_9_r1 = _sqlite3GetTempReg(tls, _pParse)
_9_r2 = _sqlite3GetTempReg(tls, _pParse)
if _isRowid != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _9_r2)
}
*func() **TExprList_item { _9_i = _9_pList.X0; return &_9_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_9_pList.X2)))))
_49:
if _9_i <= i32(0) {
goto _52
}
_12_pE2 = (*XExpr)(_9_pItem.X0)
if (_jmpIfDynamic >= i32(0)) && (_sqlite3ExprIsConstant(tls, _12_pE2) == 0) {
_sqlite3VdbeChangeToNoop(tls, _v, _jmpIfDynamic)
_jmpIfDynamic = i32(-1)
}
if _isRowid != 0 && _sqlite3ExprIsInteger(tls, _12_pE2, &_12_iValToIns) != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(119), _pExpr.X8, _9_r2, _12_iValToIns)
goto _57
}
_9_r3 = _sqlite3ExprCodeTarget(tls, _pParse, _12_pE2, _9_r1)
if _isRowid != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(17), _9_r3, _sqlite3VdbeCurrentAddr(tls, _v)+i32(2))
_sqlite3VdbeAddOp3(tls, _v, i32(118), _pExpr.X8, _9_r2, _9_r3)
goto _59
}
_sqlite3VdbeAddOp4(tls, _v, i32(101), _9_r3, i32(1), _9_r2, &_9_affinity, i32(1))
_sqlite3ExprCacheAffinityChange(tls, _pParse, _9_r3, i32(1))
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _pExpr.X8, _9_r2, _9_r3, i32(1))
_59:
_57:
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_i -= 1; return &_9_pItem }())) += uintptr(20)
goto _49
_52:
_sqlite3ReleaseTempReg(tls, _pParse, _9_r1)
_sqlite3ReleaseTempReg(tls, _pParse, _9_r2)
_43:
if _4_pKeyInfo != nil {
_sqlite3VdbeChangeP4(tls, _v, _4_addr, (*int8)((unsafe.Pointer)(_4_pKeyInfo)), i32(-5))
}
goto _61
_11:
func() {
if int32(_pExpr.X0) != i32(20) && int32(_pExpr.X0) != i32(119) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93593), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45114)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93594), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeSubselectØ00__func__Ø000))), unsafe.Pointer(str(45159)))
crt.X__builtin_abort(tls)
}
}()
_19_pSel = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_19_nReg = func() int32 {
if int32(_pExpr.X0) == i32(119) {
return ((*XExprList)(_19_pSel.X0).X0)
}
return i32(1)
}()
_sqlite3SelectDestInit(tls, &_19_dest, i32(0), (_pParse.X18)+i32(1))
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _19_nReg
sink1 = *p
}
if int32(_pExpr.X0) == i32(119) {
*(*uint8)(unsafe.Pointer(&(_19_dest.X0))) = uint8(i32(10))
*(*int32)(unsafe.Pointer(&(_19_dest.X3))) = _19_dest.X2
*(*int32)(unsafe.Pointer(&(_19_dest.X4))) = _19_nReg
_sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _19_dest.X2, ((_19_dest.X2)+_19_nReg)-i32(1))
_sqlite3VdbeComment(tls, _v, str(45196))
goto _70
}
*(*uint8)(unsafe.Pointer(&(_19_dest.X0))) = uint8(i32(3))
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _19_dest.X2)
_sqlite3VdbeComment(tls, _v, str(45217))
_70:
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_19_pSel.X15))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pSel.X15))))) = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+8*uintptr(i32(1)))), i32(0))
*(*int32)(unsafe.Pointer(&(_19_pSel.X4))) = i32(0)
{
p := (*uint32)(unsafe.Pointer(&(_19_pSel.X3)))
*p = (*p) & uint32(i32(-1025))
sink5 = *p
}
if _sqlite3Select(tls, _pParse, _19_pSel, &_19_dest) != 0 {
return i32(0)
}
_rReg = _19_dest.X2
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
goto _61
_61:
if _rHasNullFlag != 0 {
_sqlite3SetHasNullFlag(tls, _v, _pExpr.X8, _rHasNullFlag)
}
if _jmpIfDynamic >= i32(0) {
_sqlite3VdbeJumpHere(tls, _v, _jmpIfDynamic)
}
_sqlite3ExprCachePop(tls, _pParse)
return _rReg
_ = _6_dest
_ = _19_dest
panic(0)
}
var _sqlite3CodeSubselectØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CodeSubselectØ00__func__Ø000[0], str(45236), 21)
}
// Remember the current column cache context. Any new entries added
// added to the column cache after this call are removed when the
// corresponding pop occurs.
func _sqlite3ExprCachePush(tls *crt.TLS, _pParse *XParse) {
*(*int32)(unsafe.Pointer(&(_pParse.X23))) += 1
if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 {
crt.Xprintf(tls, str(45257), _pParse.X23)
}
}
// Initialize a SelectDest structure.
func _sqlite3SelectDestInit(tls *crt.TLS, _pDest *XSelectDest, _eDest int32, _iParm int32) {
*(*uint8)(unsafe.Pointer(&(_pDest.X0))) = uint8(_eDest)
*(*int32)(unsafe.Pointer(&(_pDest.X2))) = _iParm
*(**int8)(unsafe.Pointer(&(_pDest.X1))) = nil
*(*int32)(unsafe.Pointer(&(_pDest.X3))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pDest.X4))) = i32(0)
}
// Argument pExpr is an (?, ?...) IN(...) expression. This
// function allocates and returns a nul-terminated string containing
// the affinities to be used for each column of the comparison.
//
// It is the responsibility of the caller to ensure that the returned
// string is eventually freed using sqlite3DbFree().
func _exprINAffinity(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *int8) {
var _nVal, _1_i int32
var _2_a int8
var _zRet *int8
var _pSelect *XSelect
var _pLeft, _2_pA *XExpr
_pLeft = (*XExpr)(_pExpr.X4)
_nVal = _sqlite3ExprVectorSize(tls, _pLeft)
_pSelect = func() *XSelect {
if ((_pExpr.X2) & uint32(i32(2048))) != 0 {
return (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
}
return nil
}()
func() {
if int32(_pExpr.X0) != i32(74) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93318), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprINAffinityØ00__func__Ø000))), unsafe.Pointer(str(45269)))
crt.X__builtin_abort(tls)
}
}()
_zRet = (*int8)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pParse.X0), uint64(_nVal+i32(1))))
if _zRet == nil {
goto _4
}
_1_i = i32(0)
_5:
if _1_i >= _nVal {
goto _8
}
_2_pA = _sqlite3VectorFieldSubexpr(tls, _pLeft, _1_i)
_2_a = _sqlite3ExprAffinity(tls, _2_pA)
if _pSelect != nil {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_1_i))) = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+20*uintptr(_1_i))).X0), _2_a)
goto _10
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_1_i))) = _2_a
_10:
_1_i += 1
goto _5
_8:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRet)) + 1*uintptr(_nVal))) = int8(i32(0))
_4:
return _zRet
}
var _exprINAffinityØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_exprINAffinityØ00__func__Ø000[0], str(45286), 15)
}
// Return a pointer to a subexpression of pVector that is the i-th
// column of the vector (numbered starting with 0). The caller must
// ensure that i is within range.
//
// If pVector is really a scalar (and "scalar" here includes subqueries
// that return a single column!) then return pVector unmodified.
//
// pVector retains ownership of the returned subexpression.
//
// If the vector is a (SELECT ...) then the expression returned is
// just the expression for the i-th term of the result set, and may
// not be ready for evaluation because the table cursor has not yet
// been positioned.
func _sqlite3VectorFieldSubexpr(tls *crt.TLS, _pVector *XExpr, _i int32) (r0 *XExpr) {
func() {
if _i >= _sqlite3ExprVectorSize(tls, _pVector) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91269), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000))), unsafe.Pointer(str(45301)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprIsVector(tls, _pVector) == 0 {
goto _2
}
func() {
if int32(_pVector.X12) != i32(0) && int32(_pVector.X0) != i32(157) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91271), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VectorFieldSubexprØ00__func__Ø000))), unsafe.Pointer(str(45334)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pVector.X0) == i32(119)) || (int32(_pVector.X12) == i32(119)) {
return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X0).X2))))) + 20*uintptr(_i))).X0)
}
return (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 20*uintptr(_i))).X0)
_2:
return _pVector
}
var _sqlite3VectorFieldSubexprØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VectorFieldSubexprØ00__func__Ø000[0], str(45378), 26)
}
// 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 _sqlite3ExprAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
var _op int32
_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
if ((_pExpr.X2) & uint32(i32(512))) != 0 {
return int8(i32(0))
}
_op = int32(_pExpr.X0)
if _op == i32(119) {
func() {
if ((_pExpr.X2) & uint32(i32(2048))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90949), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000))), unsafe.Pointer(str(45404)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X2)))))+20*uintptr(i32(0)))).X0))
}
if _op == i32(157) {
_op = int32(_pExpr.X12)
}
if _op == i32(37) {
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90955), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3AffinityType(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), nil)
}
if ((_op == i32(154)) || (_op == i32(152))) && ((*XTable)(_pExpr.X14) != nil) {
return _sqlite3TableColumnAffinity(tls, (*XTable)(_pExpr.X14), int32(_pExpr.X9))
}
if _op == i32(159) {
func() {
if (((*XExpr)(_pExpr.X4).X2) & uint32(i32(2048))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90963), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAffinityØ00__func__Ø000))), unsafe.Pointer(str(45430)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X6)))))).X0).X2)))))+20*uintptr(_pExpr.X9))).X0))
}
return _pExpr.X1
}
// Skip over any TK_COLLATE operators and any unlikely()
// or likelihood() function at the root of an expression.
func _sqlite3ExprSkipCollate(tls *crt.TLS, _pExpr *XExpr) (r0 *XExpr) {
_0:
if _pExpr == nil || ((_pExpr.X2)&uint32(i32(4096))) == uint32(i32(0)) {
goto _1
}
if ((_pExpr.X2) & uint32(i32(262144))) != uint32(i32(0)) {
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91010), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(45463)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) != i32(151) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(45487)))
crt.X__builtin_abort(tls)
}
}()
_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(0)))).X0)
goto _10
}
func() {
if int32(_pExpr.X0) != i32(94) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91014), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprSkipCollateØ00__func__Ø000))), unsafe.Pointer(str(45510)))
crt.X__builtin_abort(tls)
}
}()
_pExpr = (*XExpr)(_pExpr.X4)
_10:
goto _0
_1:
return _pExpr
}
var _sqlite3ExprSkipCollateØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprSkipCollateØ00__func__Ø000[0], str(45532), 23)
}
var _sqlite3ExprAffinityØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAffinityØ00__func__Ø000[0], str(45555), 20)
}
// Return the affinity character for a single column of a table.
func _sqlite3TableColumnAffinity(tls *crt.TLS, _pTab *XTable, _iCol int32) (r0 int8) {
func() {
if _iCol >= int32(_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90923), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TableColumnAffinityØ00__func__Ø000))), unsafe.Pointer(str(45575)))
crt.X__builtin_abort(tls)
}
}()
return int8(func() int32 {
if _iCol >= i32(0) {
return int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol))).X4)
}
return i32(68)
}())
}
var _sqlite3TableColumnAffinityØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TableColumnAffinityØ00__func__Ø000[0], str(45591), 27)
}
// 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 _sqlite3CompareAffinity(tls *crt.TLS, _pExpr *XExpr, _aff2 int8) (r0 int8) {
var _aff1 int8
_aff1 = _sqlite3ExprAffinity(tls, _pExpr)
if _aff1 == 0 || _aff2 == 0 {
goto _1
}
if (int32(_aff1) >= i32(67)) || (int32(_aff2) >= i32(67)) {
return int8(i32(67))
}
return int8(i32(65))
_1:
if (_aff1 == 0) && (_aff2 == 0) {
return int8(i32(65))
}
func() {
if int32(_aff1) != i32(0) && int32(_aff2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompareAffinityØ00__func__Ø000))), unsafe.Pointer(str(45618)))
crt.X__builtin_abort(tls)
}
}()
return int8(int32(_aff1) + int32(_aff2))
}
var _sqlite3CompareAffinityØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CompareAffinityØ00__func__Ø000[0], str(45637), 23)
}
// Generate code for the SELECT statement given in the p argument.
//
// The results are returned according to the SelectDest structure.
// See comments in sqliteInt.h for further information.
//
// This routine returns the number of errors. If any errors are
// encountered, then an appropriate error message is left in
// pParse->zErrMsg.
//
// This routine does NOT free the Select structure passed in. The
// calling function needs to do that.
func _sqlite3Select(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
var _i, _j, _isAgg, _rc, _iEnd, _iRestoreSelectId, _6_isAggSub, _18_addrTop, _19_topAddr, _19_onceAddr, _19_retAddr, _40_iAMem, _40_iBMem, _40_iUseFlag, _40_iAbortFlag, _40_groupBySort, _40_addrEnd, _40_sortPTab, _40_sortOut, _40_orderByGrp, _41_k, _49_addr1, _49_addrOutputRow, _49_regOutputRow, _49_addrSetAbort, _49_addrTopOfLoop, _49_addrSortingIdx, _49_addrReset, _49_regReset, _51_regBase, _51_regRecord, _51_nCol, _51_nGroupBy, _55_r1, _64_iDb, _64_iCsr, _64_iRoot int32
var _34_wctrlFlags uint16
var _69_flag uint8
var _db *Xsqlite3
var _6_pTab, _63_pTab *XTable
var _v *TVdbe
var _pTabList *XSrcList
var _6_pItem, _12_pItem, _19_pPrior *TSrcList_item
var _pEList, _pGroupBy, _63_pDel, _69_pMinMax *XExprList
var _41_pItem *TExprList_item
var _6_pSub, _12_pSub *XSelect
var _pWhere, _pHaving *XExpr
var _64_pIdx, _64_pBest *XIndex
var _27_pKeyInfo, _49_pKeyInfo, _64_pKeyInfo *XKeyInfo
var _40_sNC XNameContext
var _12_dest XSelectDest
var _sAggInfo XAggInfo
var _54_pCol *TAggInfo_col
var _pWInfo *XWhereInfo
var _sSort XSortCtx
var _sDistinct XDistinctCtx
_pEList = nil
_rc = i32(1)
_iRestoreSelectId = _pParse.X58
*(*int32)(unsafe.Pointer(&(_pParse.X58))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X59))), int32(1))
_db = (*Xsqlite3)(_pParse.X0)
if ((_p == nil) || ((_db.X17) != 0)) || (_pParse.X16) != 0 {
return i32(1)
}
if _sqlite3AuthCheck(tls, _pParse, i32(21), nil, nil, nil) != 0 {
return i32(1)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sAggInfo), i32(0), u32(48))
*(*int32)(unsafe.Pointer(&(_pParse.X35))) += 1
if (Xsqlite3SelectTrace & i32(1)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(45671)
}())
}
if (Xsqlite3SelectTrace & i32(256)) != 0 {
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
}
func() {
if (*XExprList)(_p.X12) != nil && int32(_pDest.X0) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121570), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(45690)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(_p.X12) != nil && int32(_pDest.X0) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(45735)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(_p.X12) != nil && int32(_pDest.X0) == i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(45776)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(_p.X12) != nil && int32(_pDest.X0) == i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121573), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(45822)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pDest.X0) <= i32(8) {
func() {
if int32(_pDest.X0) != i32(3) && int32(_pDest.X0) != i32(1) && int32(_pDest.X0) != i32(2) && int32(_pDest.X0) != i32(4) && int32(_pDest.X0) != i32(7) && int32(_pDest.X0) != i32(6) && int32(_pDest.X0) != i32(8) && int32(_pDest.X0) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121575), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(45864)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) & uint32(i32(-2))
sink5 = *p
}
}
_sqlite3SelectPrep(tls, _pParse, _p, nil)
crt.Xmemset(tls, (unsafe.Pointer)(&_sSort), i32(0), u32(32))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = (*XExprList)(_p.X12)
_pTabList = (*XSrcList)(_p.X8)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
goto _select_end
}
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121592), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46087)))
crt.X__builtin_abort(tls)
}
}()
_isAgg = bool2int(((_p.X3) & uint32(i32(8))) != uint32(i32(0)))
if (Xsqlite3SelectTrace & i32(256)) == 0 {
goto _32
}
if (Xsqlite3SelectTrace & i32(256)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46100)
}())
}
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
_32:
_i = i32(0)
_34:
if (*XSelect)(_p.X13) != nil || _i >= (_pTabList.X0) {
goto _38
}
_6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_i)))
_6_pSub = (*XSelect)(_6_pItem.X5)
_6_pTab = (*XTable)(_6_pItem.X4)
if _6_pSub == nil {
goto _35
}
if int32(_6_pTab.X11) != ((*XExprList)(_6_pSub.X0).X0) {
_sqlite3ErrorMsg(tls, _pParse, str(46124), int32(_6_pTab.X11), unsafe.Pointer(_6_pTab.X0), (*XExprList)(_6_pSub.X0).X0)
goto _select_end
}
_6_isAggSub = bool2int(((_6_pSub.X3) & uint32(i32(8))) != uint32(i32(0)))
if _flattenSubquery(tls, _pParse, _p, _i, _isAgg, _6_isAggSub) == 0 {
goto _41
}
if _6_isAggSub != 0 {
_isAgg = i32(1)
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(8))
sink5 = *p
}
}
_i = i32(-1)
_41:
_pTabList = (*XSrcList)(_p.X8)
if (_db.X17) != 0 {
goto _select_end
}
if int32(_pDest.X0) > i32(8) {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = (*XExprList)(_p.X12)
}
_35:
_i += 1
goto _34
_38:
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _select_end
}
if (*XSelect)(_p.X13) == nil {
goto _46
}
_rc = _multiSelect(tls, _pParse, _p, _pDest)
*(*int32)(unsafe.Pointer(&(_pParse.X58))) = _iRestoreSelectId
if (Xsqlite3SelectTrace & i32(1)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46164)
}())
}
*(*int32)(unsafe.Pointer(&(_pParse.X35))) -= 1
return _rc
_46:
_i = i32(0)
_48:
if _i >= (_pTabList.X0) {
goto _51
}
_12_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_i)))
if (_12_pItem.X14) == uint64(i32(0)) {
_sqlite3AuthCheck(tls, _pParse, i32(20), _12_pItem.X2, str(0), _12_pItem.X1)
}
_12_pSub = (*XSelect)(_12_pItem.X5)
if _12_pSub == nil {
goto _49
}
if (_12_pItem.X6) == 0 {
goto _54
}
if int32((uint32(((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1)>>uint(i32(4)))<>uint(i32(31))) == i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(14), _12_pItem.X7, _12_pItem.X6)
}
goto _49
_54:
{
p := (*int32)(unsafe.Pointer(&(_pParse.X57)))
*p = (*p) + _sqlite3SelectExprHeight(tls, _p)
sink1 = *p
}
if (int32((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X0)&i32(32)) != i32(0) || _pushDownWhereTerms(tls, _pParse, _12_pSub, (*XExpr)(_p.X9), _12_pItem.X11) == 0 {
goto _57
}
if (Xsqlite3SelectTrace & i32(256)) == 0 {
goto _58
}
if (Xsqlite3SelectTrace & i32(256)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46196)
}())
}
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
_58:
_57:
if (((_i == i32(0)) && (((_pTabList.X0) == i32(1)) || ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(1)))).X9))).X0) & i32(10)) != i32(0)))) && (((_p.X3) & uint32(i32(2))) == uint32(i32(0)))) && ((int32(_db.X13) & i32(256)) == i32(0)) {
_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1)
*(*int32)(unsafe.Pointer(&(_12_pItem.X7))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp3(tls, _v, i32(15), _12_pItem.X7, i32(0), _18_addrTop)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer((*XTable)(_12_pItem.X4).X0))
*(*int32)(unsafe.Pointer(&(_12_pItem.X6))) = _18_addrTop
_sqlite3SelectDestInit(tls, &_12_dest, i32(13), _12_pItem.X7)
*(*uint8)(unsafe.Pointer(&(_12_pItem.X10))) = uint8(_pParse.X59)
_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
*(*int16)(unsafe.Pointer(&((*XTable)(_12_pItem.X4).X12))) = _12_pSub.X2
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1))), int8(i32(1)), 16, 4)
*(*int32)(unsafe.Pointer(&(_12_pItem.X8))) = _12_dest.X3
_sqlite3VdbeEndCoroutine(tls, _v, _12_pItem.X7)
_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-i32(1))
_sqlite3ClearTempRegCache(tls, _pParse)
goto _65
}
_19_onceAddr = i32(0)
func() {
if (_12_pItem.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46227)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_12_pItem.X7))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_19_topAddr = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _12_pItem.X7)
*(*int32)(unsafe.Pointer(&(_12_pItem.X6))) = _19_topAddr + i32(1)
if int32((uint32(((*t28)(unsafe.Pointer(&(_12_pItem.X9))).X1)>>uint(i32(3)))<>uint(i32(31))) == i32(0) {
_19_onceAddr = _sqlite3VdbeAddOp0(tls, _v, i32(20))
_sqlite3VdbeComment(tls, _v, str(46249), unsafe.Pointer((*XTable)(_12_pItem.X4).X0))
goto _69
}
_sqlite3VdbeNoopComment(tls, _v, str(46249), unsafe.Pointer((*XTable)(_12_pItem.X4).X0))
_69:
_19_pPrior = _isSelfJoinView(tls, _pTabList, _12_pItem)
if _19_pPrior != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(108), _12_pItem.X11, _19_pPrior.X11)
goto _71
}
_sqlite3SelectDestInit(tls, &_12_dest, i32(12), _12_pItem.X11)
*(*uint8)(unsafe.Pointer(&(_12_pItem.X10))) = uint8(_pParse.X59)
_sqlite3Select(tls, _pParse, _12_pSub, &_12_dest)
_71:
*(*int16)(unsafe.Pointer(&((*XTable)(_12_pItem.X4).X12))) = _12_pSub.X2
if _19_onceAddr != 0 {
_sqlite3VdbeJumpHere(tls, _v, _19_onceAddr)
}
_19_retAddr = _sqlite3VdbeAddOp1(tls, _v, i32(52), _12_pItem.X7)
_sqlite3VdbeComment(tls, _v, str(46266), unsafe.Pointer((*XTable)(_12_pItem.X4).X0))
_sqlite3VdbeChangeP1(tls, _v, uint32(_19_topAddr), _19_retAddr)
_sqlite3ClearTempRegCache(tls, _pParse)
_65:
if (_db.X17) != 0 {
goto _select_end
}
{
p := (*int32)(unsafe.Pointer(&(_pParse.X57)))
*p = (*p) - _sqlite3SelectExprHeight(tls, _p)
sink1 = *p
}
_49:
_i += 1
goto _48
_51:
_pEList = (*XExprList)(_p.X0)
_pWhere = (*XExpr)(_p.X9)
_pGroupBy = (*XExprList)(_p.X10)
_pHaving = (*XExpr)(_p.X11)
*(*uint8)(unsafe.Pointer(&(_sDistinct.X0))) = uint8(bool2int(((_p.X3) & uint32(i32(1))) != uint32(i32(0))))
if (Xsqlite3SelectTrace & i32(1024)) == 0 {
goto _74
}
if (Xsqlite3SelectTrace & i32(1024)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46273)
}())
}
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
_74:
if ((_p.X3)&uint32(i32(9))) != uint32(i32(1)) || _sqlite3ExprListCompare(tls, (*XExprList)(_sSort.X0), _pEList, i32(-1)) != i32(0) {
goto _77
}
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) & uint32(i32(-2))
sink5 = *p
}
_pGroupBy = store42((**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))), _sqlite3ExprListDup(tls, _db, _pEList, i32(0)))
func() {
if (_sDistinct.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121849), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46306)))
crt.X__builtin_abort(tls)
}
}()
if (Xsqlite3SelectTrace & i32(1024)) == 0 {
goto _80
}
if (Xsqlite3SelectTrace & i32(1024)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46323)
}())
}
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
_80:
_77:
if (*XExprList)(_sSort.X0) != nil {
_27_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_sSort.X0), i32(0), _pEList.X0)
*(*int32)(unsafe.Pointer(&(_sSort.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
*(*int32)(unsafe.Pointer(&(_sSort.X5))) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sSort.X2, (((*XExprList)(_sSort.X0).X0)+i32(1))+(_pEList.X0), i32(0), (*int8)(unsafe.Pointer(_27_pKeyInfo)), i32(-5))
goto _83
}
*(*int32)(unsafe.Pointer(&(_sSort.X5))) = i32(-1)
_83:
if int32(_pDest.X0) == i32(12) {
_sqlite3VdbeAddOp2(tls, _v, i32(110), _pDest.X2, _pEList.X0)
}
_iEnd = _sqlite3VdbeMakeLabel(tls, _v)
if ((_p.X3) & uint32(i32(16384))) == uint32(i32(0)) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(320))
}
_computeLimitRegisters(tls, _pParse, _p, _iEnd)
if ((_p.X4) == i32(0)) && ((_sSort.X5) >= i32(0)) {
_sqlite3VdbeChangeOpcode(tls, _v, uint32(_sSort.X5), uint8(i32(111)))
{
p := (*uint8)(unsafe.Pointer(&(_sSort.X7)))
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
}
if ((_p.X3) & uint32(i32(1))) != 0 {
*(*int32)(unsafe.Pointer(&(_sDistinct.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
*(*int32)(unsafe.Pointer(&(_sDistinct.X3))) = _sqlite3VdbeAddOp4(tls, _v, i32(110), _sDistinct.X2, i32(0), i32(0), (*int8)(unsafe.Pointer(_keyInfoFromExprList(tls, _pParse, (*XExprList)(_p.X0), i32(0), i32(0)))), i32(-5))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
*(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(i32(3))
goto _89
}
*(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(i32(0))
_89:
if _isAgg != 0 || _pGroupBy != nil {
goto _91
}
_34_wctrlFlags = uint16(func() int32 {
if (_sDistinct.X0) != 0 {
return i32(256)
}
return i32(0)
}())
i32(0)
{
p := &_34_wctrlFlags
*p = uint16(uint32(*p) | ((_p.X3) & uint32(i32(16384))))
sink14 = *p
}
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, (*XExprList)(_sSort.X0), (*XExprList)(_p.X0), _34_wctrlFlags, int32(_p.X2))
if _pWInfo == nil {
goto _select_end
}
if int32(_sqlite3WhereOutputRowCount(tls, _pWInfo)) < int32(_p.X2) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3WhereOutputRowCount(tls, _pWInfo)
}
if ((_sDistinct.X0) != 0) && _sqlite3WhereIsDistinct(tls, _pWInfo) != 0 {
*(*uint8)(unsafe.Pointer(&(_sDistinct.X1))) = uint8(_sqlite3WhereIsDistinct(tls, _pWInfo))
}
if (*XExprList)(_sSort.X0) == nil {
goto _98
}
*(*int32)(unsafe.Pointer(&(_sSort.X1))) = _sqlite3WhereIsOrdered(tls, _pWInfo)
*(*uint8)(unsafe.Pointer(&(_sSort.X8))) = uint8(_sqlite3WhereOrderedInnerLoop(tls, _pWInfo))
if (_sSort.X1) == ((*XExprList)(_sSort.X0).X0) {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil
}
_98:
if ((_sSort.X5) >= i32(0)) && ((*XExprList)(_sSort.X0) == nil) {
_sqlite3VdbeChangeToNoop(tls, _v, _sSort.X5)
}
_selectInnerLoop(tls, _pParse, _p, _pEList, i32(-1), &_sSort, &_sDistinct, _pDest, _sqlite3WhereContinueLabel(tls, _pWInfo), _sqlite3WhereBreakLabel(tls, _pWInfo))
_sqlite3WhereEnd(tls, _pWInfo)
goto _102
_91:
_40_sortPTab = i32(0)
_40_sortOut = i32(0)
_40_orderByGrp = i32(0)
if _pGroupBy == nil {
goto _103
}
*func() **TExprList_item { _41_k = (*XExprList)(_p.X0).X0; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))
_104:
if _41_k <= i32(0) {
goto _107
}
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_41_pItem.X5))))).X1))) = uint16(i32(0))
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(20)
goto _104
_107:
*func() **TExprList_item { _41_k = _pGroupBy.X0; return &_41_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2)))))
_108:
if _41_k <= i32(0) {
goto _111
}
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_41_pItem.X5))))).X1))) = uint16(i32(0))
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _41_k -= 1; return &_41_pItem }())) += uintptr(20)
goto _108
_111:
func() {
if i32(66) != int32(_sqlite3LogEst(tls, uint64(i32(100)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46358)))
crt.X__builtin_abort(tls)
}
}()
if int32(_p.X2) > i32(66) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(66))
}
goto _115
_103:
func() {
if i32(0) != int32(_sqlite3LogEst(tls, uint64(i32(1)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121984), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46381)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(0))
_115:
if _sqlite3ExprListCompare(tls, _pGroupBy, (*XExprList)(_sSort.X0), i32(-1)) == i32(0) {
_40_orderByGrp = i32(1)
}
_40_addrEnd = _sqlite3VdbeMakeLabel(tls, _v)
crt.Xmemset(tls, (unsafe.Pointer)(&_40_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X1))))) = _pTabList
*(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_40_sNC.X3))))) = &_sAggInfo
*(*int32)(unsafe.Pointer(&(_sAggInfo.X5))) = (_pParse.X18) + i32(1)
*(*int32)(unsafe.Pointer(&(_sAggInfo.X4))) = func() int32 {
if _pGroupBy != nil {
return (_pGroupBy.X0)
}
return i32(0)
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sAggInfo.X7))))) = _pGroupBy
_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, _pEList)
_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(_sSort.X0))
if _pHaving == nil {
goto _121
}
if _pGroupBy != nil {
func() {
if _pWhere != (*XExpr)(_p.X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122018), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46401)))
crt.X__builtin_abort(tls)
}
}()
_havingToWhere(tls, _pParse, _pGroupBy, _pHaving, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))))
_pWhere = (*XExpr)(_p.X9)
}
_sqlite3ExprAnalyzeAggregates(tls, &_40_sNC, _pHaving)
_121:
*(*int32)(unsafe.Pointer(&(_sAggInfo.X10))) = _sAggInfo.X9
_i = i32(0)
_125:
if _i >= (_sAggInfo.X12) {
goto _128
}
func() {
if (((*XExpr)((*TAggInfo_func)(unsafe.Pointer(uintptr(_sAggInfo.X11) + 16*uintptr(_i))).X0).X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122026), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46419)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_40_sNC.X7)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
_sqlite3ExprAnalyzeAggList(tls, &_40_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*TAggInfo_func)(unsafe.Pointer(uintptr(_sAggInfo.X11) + 16*uintptr(_i))).X0).X6)))))))
{
p := (*uint16)(unsafe.Pointer(&(_40_sNC.X7)))
*p = uint16(int32(*p) & i32(-9))
sink14 = *p
}
_i += 1
goto _125
_128:
*(*int32)(unsafe.Pointer(&(_sAggInfo.X6))) = _pParse.X18
if (_db.X17) != 0 {
goto _select_end
}
if _pGroupBy == nil {
goto _132
}
*(*int32)(unsafe.Pointer(&(_sAggInfo.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_49_pKeyInfo = _keyInfoFromExprList(tls, _pParse, _pGroupBy, i32(0), _sAggInfo.X9)
_49_addrSortingIdx = _sqlite3VdbeAddOp4(tls, _v, i32(111), _sAggInfo.X2, _sAggInfo.X4, i32(0), (*int8)(unsafe.Pointer(_49_pKeyInfo)), i32(-5))
_40_iUseFlag = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_40_iAbortFlag = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_49_regOutputRow = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_49_addrOutputRow = _sqlite3VdbeMakeLabel(tls, _v)
_49_regReset = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_49_addrReset = _sqlite3VdbeMakeLabel(tls, _v)
_40_iAMem = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (_pGroupBy.X0)
sink1 = *p
}
_40_iBMem = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (_pGroupBy.X0)
sink1 = *p
}
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _40_iAbortFlag)
_sqlite3VdbeComment(tls, _v, str(46475))
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _40_iUseFlag)
_sqlite3VdbeComment(tls, _v, str(46492))
_sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _40_iAMem, (_40_iAMem+(_pGroupBy.X0))-i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(14), _49_regReset, _49_addrReset)
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _pGroupBy, nil, uint16(i32(64)|func() int32 {
if _40_orderByGrp != 0 {
return i32(512)
}
return i32(0)
}()), i32(0))
if _pWInfo == nil {
goto _select_end
}
if _sqlite3WhereIsOrdered(tls, _pWInfo) == (_pGroupBy.X0) {
_40_groupBySort = i32(0)
goto _137
}
_explainTempTable(tls, _pParse, func() *int8 {
if ((_sDistinct.X0) != 0) && (((_p.X3) & uint32(i32(1))) == uint32(i32(0))) {
return str(25716)
}
return str(46519)
}())
_40_groupBySort = i32(1)
_51_nGroupBy = _pGroupBy.X0
_51_nCol = _51_nGroupBy
_j = _51_nGroupBy
_i = i32(0)
_141:
if _i >= (_sAggInfo.X9) {
goto _144
}
if ((*TAggInfo_col)(unsafe.Pointer(uintptr(_sAggInfo.X8) + 24*uintptr(_i))).X3) >= _j {
_51_nCol += 1
_j += 1
}
_i += 1
goto _141
_144:
_51_regBase = _sqlite3GetTempRange(tls, _pParse, _51_nCol)
_sqlite3ExprCacheClear(tls, _pParse)
_sqlite3ExprCodeExprList(tls, _pParse, _pGroupBy, _51_regBase, i32(0), uint8(i32(0)))
_j = _51_nGroupBy
_i = i32(0)
_146:
if _i >= (_sAggInfo.X9) {
goto _149
}
_54_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_sAggInfo.X8) + 24*uintptr(_i)))
if (_54_pCol.X3) >= _j {
_55_r1 = _j + _51_regBase
_sqlite3ExprCodeGetColumnToReg(tls, _pParse, (*XTable)(_54_pCol.X0), _54_pCol.X2, _54_pCol.X1, _55_r1)
_j += 1
}
_i += 1
goto _146
_149:
_51_regRecord = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _51_regBase, _51_nCol, _51_regRecord)
_sqlite3VdbeAddOp2(tls, _v, i32(127), _sAggInfo.X2, _51_regRecord)
_sqlite3ReleaseTempReg(tls, _pParse, _51_regRecord)
_sqlite3ReleaseTempRange(tls, _pParse, _51_regBase, _51_nCol)
_sqlite3WhereEnd(tls, _pWInfo)
*(*int32)(unsafe.Pointer(&(_sAggInfo.X3))) = store1(&_40_sortPTab, postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)))
_40_sortOut = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(113), _40_sortPTab, _40_sortOut, _51_nCol)
_sqlite3VdbeAddOp2(tls, _v, i32(35), _sAggInfo.X2, _40_addrEnd)
_sqlite3VdbeComment(tls, _v, str(46528))
*(*uint8)(unsafe.Pointer(&(_sAggInfo.X1))) = uint8(i32(1))
_sqlite3ExprCacheClear(tls, _pParse)
_137:
if (_40_orderByGrp != 0 && ((int32(_db.X13) & i32(4)) == i32(0))) && (_40_groupBySort != 0 || _sqlite3WhereIsSorted(tls, _pWInfo) != 0) {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil
_sqlite3VdbeChangeToNoop(tls, _v, _sSort.X5)
}
_49_addrTopOfLoop = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3ExprCacheClear(tls, _pParse)
if _40_groupBySort != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(123), _sAggInfo.X2, _40_sortOut, _40_sortPTab)
}
_j = i32(0)
_156:
if _j >= (_pGroupBy.X0) {
goto _159
}
if _40_groupBySort != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _40_sortPTab, _j, _40_iBMem+_j)
goto _161
}
*(*uint8)(unsafe.Pointer(&(_sAggInfo.X0))) = uint8(i32(1))
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2)))))+20*uintptr(_j))).X0), _40_iBMem+_j)
_161:
_j += 1
goto _156
_159:
_sqlite3VdbeAddOp4(tls, _v, i32(98), _40_iAMem, _40_iBMem, _pGroupBy.X0, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _49_pKeyInfo))), i32(-5))
_49_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp3(tls, _v, i32(18), _49_addr1+i32(1), i32(0), _49_addr1+i32(1))
_sqlite3ExprCodeMove(tls, _pParse, _40_iBMem, _40_iAMem, _pGroupBy.X0)
_sqlite3VdbeAddOp2(tls, _v, i32(14), _49_regOutputRow, _49_addrOutputRow)
_sqlite3VdbeComment(tls, _v, str(46542))
_sqlite3VdbeAddOp2(tls, _v, i32(46), _40_iAbortFlag, _40_addrEnd)
_sqlite3VdbeComment(tls, _v, str(46557))
_sqlite3VdbeAddOp2(tls, _v, i32(14), _49_regReset, _49_addrReset)
_sqlite3VdbeComment(tls, _v, str(46574))
_sqlite3VdbeJumpHere(tls, _v, _49_addr1)
_updateAccumulator(tls, _pParse, &_sAggInfo)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _40_iUseFlag)
_sqlite3VdbeComment(tls, _v, str(46592))
if _40_groupBySort != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(3), _sAggInfo.X2, _49_addrTopOfLoop)
goto _163
}
_sqlite3WhereEnd(tls, _pWInfo)
_sqlite3VdbeChangeToNoop(tls, _v, _49_addrSortingIdx)
_163:
_sqlite3VdbeAddOp2(tls, _v, i32(14), _49_regOutputRow, _49_addrOutputRow)
_sqlite3VdbeComment(tls, _v, str(46621))
_sqlite3VdbeGoto(tls, _v, _40_addrEnd)
_49_addrSetAbort = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _40_iAbortFlag)
_sqlite3VdbeComment(tls, _v, str(46638))
_sqlite3VdbeAddOp1(tls, _v, i32(52), _49_regOutputRow)
_sqlite3VdbeResolveLabel(tls, _v, _49_addrOutputRow)
_49_addrOutputRow = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(46), _40_iUseFlag, _49_addrOutputRow+i32(2))
_sqlite3VdbeComment(tls, _v, str(46653))
_sqlite3VdbeAddOp1(tls, _v, i32(52), _49_regOutputRow)
_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _49_addrOutputRow+i32(1), i32(16))
_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), i32(-1), &_sSort, &_sDistinct, _pDest, _49_addrOutputRow+i32(1), _49_addrSetAbort)
_sqlite3VdbeAddOp1(tls, _v, i32(52), _49_regOutputRow)
_sqlite3VdbeComment(tls, _v, str(46690))
_sqlite3VdbeResolveLabel(tls, _v, _49_addrReset)
_resetAccumulator(tls, _pParse, &_sAggInfo)
_sqlite3VdbeAddOp1(tls, _v, i32(52), _49_regReset)
goto _164
_132:
_63_pDel = nil
if store44(&_63_pTab, _isSimpleCount(tls, _p, &_sAggInfo)) == nil {
goto _165
}
_64_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_63_pTab.X20))
_64_iCsr = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_64_pKeyInfo = nil
_64_pBest = nil
_64_iRoot = _63_pTab.X7
_sqlite3CodeVerifySchema(tls, _pParse, _64_iDb)
_sqlite3TableLock(tls, _pParse, _64_iDb, _63_pTab.X7, uint8(i32(0)), _63_pTab.X0)
if ((_63_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
_64_pBest = _sqlite3PrimaryKeyIndex(tls, _63_pTab)
}
_64_pIdx = (*XIndex)(_63_pTab.X2)
_167:
if _64_pIdx == nil {
goto _170
}
if (((int32((uint32((_64_pIdx.X16)>>uint(i32(2)))<>uint(i32(31))) == i32(0)) && (int32(_64_pIdx.X12) < int32(_63_pTab.X13))) && ((*XExpr)(_64_pIdx.X9) == nil)) && ((_64_pBest == nil) || (int32(_64_pIdx.X12) < int32(_64_pBest.X12))) {
_64_pBest = _64_pIdx
}
_64_pIdx = (*XIndex)(_64_pIdx.X5)
goto _167
_170:
if _64_pBest != nil {
_64_iRoot = _64_pBest.X11
_64_pKeyInfo = _sqlite3KeyInfoOfIndex(tls, _pParse, _64_pBest)
}
_sqlite3VdbeAddOp4Int(tls, _v, i32(106), _64_iCsr, _64_iRoot, _64_iDb, i32(1))
if _64_pKeyInfo != nil {
_sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(_64_pKeyInfo)), i32(-5))
}
_sqlite3VdbeAddOp2(tls, _v, i32(102), _64_iCsr, (*TAggInfo_func)(unsafe.Pointer(uintptr(_sAggInfo.X11)+16*uintptr(i32(0)))).X2)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _64_iCsr)
_explainSimpleCount(tls, _pParse, _63_pTab, _64_pBest)
goto _178
_165:
_69_pMinMax = nil
_69_flag = u8(0)
func() {
if (*XExprList)(_p.X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122352), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46719)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_69_flag) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122353), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46734)))
crt.X__builtin_abort(tls)
}
}()
if (*XExpr)(_p.X11) == nil {
_69_flag = _minMaxQuery(tls, &_sAggInfo, &_69_pMinMax)
}
func() {
if int32(_69_flag) != i32(0) && (_69_pMinMax == nil || (_69_pMinMax.X0) != i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122357), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46742)))
crt.X__builtin_abort(tls)
}
}()
if _69_flag == 0 {
goto _188
}
_69_pMinMax = _sqlite3ExprListDup(tls, _db, _69_pMinMax, i32(0))
_63_pDel = _69_pMinMax
func() {
if (_db.X17) == 0 && _69_pMinMax == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46787)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) == 0 {
*(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_69_pMinMax.X2))))) + 20*uintptr(i32(0)))).X3))) = uint8(func() int32 {
if int32(_69_flag) != i32(1) {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_69_pMinMax.X2))))) + 20*uintptr(i32(0)))).X0).X0))) = uint8(i32(152))
}
_188:
_resetAccumulator(tls, _pParse, &_sAggInfo)
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, _69_pMinMax, nil, uint16(_69_flag), i32(0))
if _pWInfo == nil {
_sqlite3ExprListDelete(tls, _db, _63_pDel)
goto _select_end
}
_updateAccumulator(tls, _pParse, &_sAggInfo)
func() {
if _69_pMinMax != nil && (_69_pMinMax.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122380), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectØ00__func__Ø000))), unsafe.Pointer(str(46818)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3WhereIsOrdered(tls, _pWInfo) > i32(0) {
_sqlite3VdbeGoto(tls, _v, _sqlite3WhereBreakLabel(tls, _pWInfo))
_sqlite3VdbeComment(tls, _v, str(46850), unsafe.Pointer(func() *int8 {
if int32(_69_flag) == i32(1) {
return str(7709)
}
return str(7713)
}()))
}
_sqlite3WhereEnd(tls, _pWInfo)
_finalizeAggFunctions(tls, _pParse, &_sAggInfo)
_178:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSort.X0))))) = nil
_sqlite3ExprIfFalse(tls, _pParse, _pHaving, _40_addrEnd, i32(16))
_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), i32(-1), nil, nil, _pDest, _40_addrEnd, _40_addrEnd)
_sqlite3ExprListDelete(tls, _db, _63_pDel)
_164:
_sqlite3VdbeResolveLabel(tls, _v, _40_addrEnd)
_102:
if int32(_sDistinct.X1) == i32(3) {
_explainTempTable(tls, _pParse, str(25716))
}
if (*XExprList)(_sSort.X0) != nil {
_explainTempTable(tls, _pParse, func() *int8 {
if (_sSort.X1) > i32(0) {
return str(46864)
}
return str(46887)
}())
_generateSortTail(tls, _pParse, _p, &_sSort, _pEList.X0, _pDest)
}
_sqlite3VdbeResolveLabel(tls, _v, _iEnd)
_rc = bool2int((_pParse.X16) > i32(0))
_select_end:
*(*int32)(unsafe.Pointer(&(_pParse.X58))) = _iRestoreSelectId
if (_rc == i32(0)) && (int32(_pDest.X0) == i32(9)) {
_generateColumnNames(tls, _pParse, _pTabList, _pEList)
}
_sqlite3DbFree(tls, _db, _sAggInfo.X8)
_sqlite3DbFree(tls, _db, _sAggInfo.X11)
if (Xsqlite3SelectTrace & i32(1)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(46896)
}())
}
*(*int32)(unsafe.Pointer(&(_pParse.X35))) -= 1
return _rc
_ = _sDistinct
_ = _sSort
_ = _sAggInfo
_ = _12_dest
_ = _40_sNC
panic(0)
}
// 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 _sqlite3AuthCheck(tls *crt.TLS, _pParse *XParse, _code int32, _zArg1 *int8, _zArg2 *int8, _zArg3 *int8) (r0 int32) {
var _rc int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) || ((_pParse.X55) != 0) {
return i32(0)
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
}{(_db.X59)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
}{nil})) {
return i32(0)
}
_rc = (_db.X59)(tls, _db.X60, _code, _zArg1, _zArg2, _zArg3, _pParse.X65)
if _rc == i32(1) {
_sqlite3ErrorMsg(tls, _pParse, str(7980))
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(23)
goto _6
}
if (_rc != i32(0)) && (_rc != i32(2)) {
_rc = i32(1)
_sqliteAuthBadReturnCode(tls, _pParse)
}
_6:
return _rc
}
// Write an error message into pParse->zErrMsg that explains that the
// user-supplied authorization function returned an illegal value.
func _sqliteAuthBadReturnCode(tls *crt.TLS, _pParse *XParse) {
_sqlite3ErrorMsg(tls, _pParse, str(46912))
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(1)
}
var Xsqlite3SelectTrace int32
// 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 _sqlite3DebugPrintf(tls *crt.TLS, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
var _acc XStrAccum
var _zBuf [500]int8
_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(u32(500)), i32(0))
_ap = args
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
_ap = nil
_sqlite3StrAccumFinish(tls, &_acc)
crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24576), unsafe.Pointer((*int8)(unsafe.Pointer(&_zBuf))))
crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
_ = _acc
_ = _zBuf
}
// Generate a human-readable description of a Select object.
func _sqlite3TreeViewSelect(tls *crt.TLS, _pView *t45, _p *XSelect, _moreToFollow uint8) {
var _n, _cnt, _6_i int32
var _21_zOp *int8
var _7_zLine [100]int8
var _7_x XStrAccum
var _7_pItem *TSrcList_item
_n = i32(0)
_cnt = i32(0)
if _p == nil {
_sqlite3TreeViewLine(tls, _pView, str(46935))
return
}
_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
if (*XWith)(_p.X17) != nil {
_sqlite3TreeViewWith(tls, _pView, (*XWith)(_p.X17), uint8(i32(1)))
_cnt = i32(1)
_sqlite3TreeViewPush(tls, _pView, uint8(i32(1)))
}
_1:
_sqlite3TreeViewLine(tls, _pView, str(46946), unsafe.Pointer(func() *int8 {
if ((_p.X3) & uint32(i32(1))) != 0 {
return str(46992)
}
return str(0)
}()), unsafe.Pointer(func() *int8 {
if ((_p.X3) & uint32(i32(8))) != 0 {
return str(47002)
}
return str(0)
}()), unsafe.Pointer(_p), _p.X3, int32(_p.X2))
if postInc1(&_cnt, int32(1)) != 0 {
_sqlite3TreeViewPop(tls, _pView)
}
if (*XSelect)(_p.X13) != nil {
_n = i32(1000)
goto _9
}
_n = i32(0)
if ((*XSrcList)(_p.X8) != nil) && ((*XSrcList)(_p.X8).X0) != 0 {
_n += 1
}
if (*XExpr)(_p.X9) != nil {
_n += 1
}
if (*XExprList)(_p.X10) != nil {
_n += 1
}
if (*XExpr)(_p.X11) != nil {
_n += 1
}
if (*XExprList)(_p.X12) != nil {
_n += 1
}
if (*XExpr)(_p.X15) != nil {
_n += 1
}
if (*XExpr)(_p.X16) != nil {
_n += 1
}
_9:
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X0), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47012))
if (*XSrcList)(_p.X8) == nil || ((*XSrcList)(_p.X8).X0) == 0 {
goto _19
}
_pView = _sqlite3TreeViewPush(tls, _pView, uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))))
_sqlite3TreeViewLine(tls, _pView, str(25729))
_6_i = i32(0)
_20:
if _6_i >= ((*XSrcList)(_p.X8).X0) {
goto _23
}
_7_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(_6_i)))
_sqlite3StrAccumInit(tls, &_7_x, nil, (*int8)(unsafe.Pointer(&_7_zLine)), int32(u32(100)), i32(0))
_sqlite3XPrintf(tls, &_7_x, str(47023), _7_pItem.X11)
if (_7_pItem.X1) != nil {
_sqlite3XPrintf(tls, &_7_x, str(47030), unsafe.Pointer(_7_pItem.X1), unsafe.Pointer(_7_pItem.X2))
goto _26
}
if (_7_pItem.X2) != nil {
_sqlite3XPrintf(tls, &_7_x, str(47037), unsafe.Pointer(_7_pItem.X2))
}
_26:
if (*XTable)(_7_pItem.X4) != nil {
_sqlite3XPrintf(tls, &_7_x, str(47041), unsafe.Pointer((*XTable)(_7_pItem.X4).X0))
}
if (_7_pItem.X3) != nil {
_sqlite3XPrintf(tls, &_7_x, str(47053), unsafe.Pointer(_7_pItem.X3))
}
if (int32((*t28)(unsafe.Pointer(&(_7_pItem.X9))).X0) & i32(8)) != 0 {
_sqlite3XPrintf(tls, &_7_x, str(47062))
}
_sqlite3StrAccumFinish(tls, &_7_x)
_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_7_zLine)), uint8(bool2int(_6_i < (((*XSrcList)(_p.X8).X0)-i32(1)))))
if (*XSelect)(_7_pItem.X5) != nil {
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_7_pItem.X5), uint8(i32(0)))
}
if ((uint32(((*t28)(unsafe.Pointer(&(_7_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_7_pItem.X15)))))), uint8(i32(0)), str(47073))
}
_sqlite3TreeViewPop(tls, _pView)
_6_i += 1
goto _20
_23:
_sqlite3TreeViewPop(tls, _pView)
_19:
if (*XExpr)(_p.X9) != nil {
_sqlite3TreeViewItem(tls, _pView, str(25770), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X9), uint8(i32(0)))
_sqlite3TreeViewPop(tls, _pView)
}
if (*XExprList)(_p.X10) != nil {
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X10), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47084))
}
if (*XExpr)(_p.X11) != nil {
_sqlite3TreeViewItem(tls, _pView, str(25757), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X11), uint8(i32(0)))
_sqlite3TreeViewPop(tls, _pView)
}
if (*XExprList)(_p.X12) != nil {
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(_p.X12), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))), str(47092))
}
if (*XExpr)(_p.X15) != nil {
_sqlite3TreeViewItem(tls, _pView, str(25764), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X15), uint8(i32(0)))
_sqlite3TreeViewPop(tls, _pView)
}
if (*XExpr)(_p.X16) != nil {
_sqlite3TreeViewItem(tls, _pView, str(25292), uint8(bool2int(postInc1(&_n, int32(-1)) > i32(0))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_p.X16), uint8(i32(0)))
_sqlite3TreeViewPop(tls, _pView)
}
if (*XSelect)(_p.X13) == nil {
goto _38
}
_21_zOp = str(25675)
switch int32(_p.X1) {
case i32(116):
goto _40
case i32(117):
goto _42
case i32(118):
goto _41
default:
goto _43
}
_40:
_21_zOp = str(47100)
goto _43
_41:
_21_zOp = str(25692)
goto _43
_42:
_21_zOp = str(25685)
goto _43
_43:
_sqlite3TreeViewItem(tls, _pView, _21_zOp, uint8(i32(1)))
_38:
_p = (*XSelect)(_p.X13)
if _p != nil {
goto _1
}
_sqlite3TreeViewPop(tls, _pView)
_ = _n
_ = _cnt
_ = _7_x
_ = _7_zLine
}
// Generate a single line of output for the tree, with a prefix that contains
// all the appropriate tree lines
func _sqlite3TreeViewLine(tls *crt.TLS, _p *t45, _zFormat *int8, args ...interface{}) {
var _i int32
var _ap []interface{}
var _acc XStrAccum
var _zBuf [500]int8
_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(u32(500)), i32(0))
if _p == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= (_p.X0) || uint32(_i) >= u32(99) {
goto _5
}
_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_i)))) != 0 {
return str(47110)
}
return str(47115)
}(), i32(4))
_i += 1
goto _1
_5:
_sqlite3StrAccumAppend(tls, &_acc, func() *int8 {
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_i)))) != 0 {
return str(47120)
}
return str(47125)
}(), i32(4))
_0:
_ap = args
_sqlite3VXPrintf(tls, &_acc, _zFormat, _ap)
_ap = nil
func() {
if (_acc.X3) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26243), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TreeViewLineØ00__func__Ø000))), unsafe.Pointer(str(47130)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zBuf)) + 1*uintptr((_acc.X3)-uint32(i32(1)))))) != i32(10) {
_sqlite3StrAccumAppend(tls, &_acc, str(37700), i32(1))
}
_sqlite3StrAccumFinish(tls, &_acc)
crt.Xfprintf(tls, (*crt.XFILE)(Xstdout), str(24576), unsafe.Pointer((*int8)(unsafe.Pointer(&_zBuf))))
crt.Xfflush(tls, (*crt.XFILE)(Xstdout))
_ = _acc
_ = _zBuf
}
var _sqlite3TreeViewLineØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TreeViewLineØ00__func__Ø000[0], str(47142), 20)
}
// Add a new subitem to the tree. The moreToFollow flag indicates that this
// is not the last item in the tree.
func _sqlite3TreeViewPush(tls *crt.TLS, _p *t45, _moreToFollow uint8) (r0 *t45) {
if _p != nil {
goto _0
}
_p = (*t45)(Xsqlite3_malloc64(tls, uint64(u32(104))))
if _p == nil {
return nil
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(104))
goto _2
_0:
*(*int32)(unsafe.Pointer(&(_p.X0))) += 1
_2:
func() {
if int32(_moreToFollow) != i32(0) && int32(_moreToFollow) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26210), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TreeViewPushØ00__func__Ø000))), unsafe.Pointer(str(47162)))
crt.X__builtin_abort(tls)
}
}()
if uint32(_p.X0) < u32(100) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[100]uint8)(unsafe.Pointer(&(_p.X1))))) + 1*uintptr(_p.X0))) = _moreToFollow
}
return _p
}
var _sqlite3TreeViewPushØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TreeViewPushØ00__func__Ø000[0], str(47197), 20)
}
// Generate a human-readable description of a WITH clause.
func _sqlite3TreeViewWith(tls *crt.TLS, _pView *t45, _pWith *XWith, _moreToFollow uint8) {
var _i, _5_j int32
var _5_cSep int8
var _4_x XStrAccum
var _4_zLine [1000]int8
var _4_pCte *TCte
if _pWith == nil {
return
}
if (_pWith.X0) == i32(0) {
return
}
if (*XWith)(_pWith.X1) != nil {
_sqlite3TreeViewLine(tls, _pView, str(47217), unsafe.Pointer(_pWith), unsafe.Pointer((*XWith)(_pWith.X1)))
goto _3
}
_sqlite3TreeViewLine(tls, _pView, str(47242), unsafe.Pointer(_pWith))
_3:
if (_pWith.X0) <= i32(0) {
goto _4
}
_pView = _sqlite3TreeViewPush(tls, _pView, uint8(i32(1)))
_i = i32(0)
_5:
if _i >= (_pWith.X0) {
goto _8
}
_4_pCte = (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2))))) + 16*uintptr(_i)))
_sqlite3StrAccumInit(tls, &_4_x, nil, (*int8)(unsafe.Pointer(&_4_zLine)), int32(u32(1000)), i32(0))
_sqlite3XPrintf(tls, &_4_x, str(24576), unsafe.Pointer(_4_pCte.X0))
if (*XExprList)(_4_pCte.X1) == nil || ((*XExprList)(_4_pCte.X1).X0) <= i32(0) {
goto _10
}
_5_cSep = int8(i32(40))
_5_j = i32(0)
_11:
if _5_j >= ((*XExprList)(_4_pCte.X1).X0) {
goto _14
}
_sqlite3XPrintf(tls, &_4_x, str(24935), int32(_5_cSep), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_4_pCte.X1).X2)))))+20*uintptr(_5_j))).X1))
_5_cSep = int8(i32(44))
_5_j += 1
goto _11
_14:
_sqlite3XPrintf(tls, &_4_x, str(37898))
_10:
_sqlite3XPrintf(tls, &_4_x, str(47254))
_sqlite3StrAccumFinish(tls, &_4_x)
_sqlite3TreeViewItem(tls, _pView, (*int8)(unsafe.Pointer(&_4_zLine)), uint8(bool2int(_i < ((_pWith.X0)-i32(1)))))
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(_4_pCte.X2), uint8(i32(0)))
_sqlite3TreeViewPop(tls, _pView)
_i += 1
goto _5
_8:
_sqlite3TreeViewPop(tls, _pView)
_4:
_ = _4_x
_ = _4_zLine
}
// Shorthand for starting a new tree item that consists of a single label
func _sqlite3TreeViewItem(tls *crt.TLS, _p *t45, _zLabel *int8, _moreFollows uint8) {
_p = _sqlite3TreeViewPush(tls, _p, _moreFollows)
_sqlite3TreeViewLine(tls, _p, str(24576), unsafe.Pointer(_zLabel))
}
// Finished with one layer of the tree
func _sqlite3TreeViewPop(tls *crt.TLS, _p *t45) {
if _p == nil {
return
}
*(*int32)(unsafe.Pointer(&(_p.X0))) -= 1
if (_p.X0) < i32(0) {
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
}
}
func _sqlite3TreeViewExprList(tls *crt.TLS, _pView *t45, _pList *XExprList, _moreToFollow uint8, _zLabel *int8) {
_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
_sqlite3TreeViewBareExprList(tls, _pView, _pList, _zLabel)
_sqlite3TreeViewPop(tls, _pView)
}
// Generate a human-readable explanation of an expression list.
func _sqlite3TreeViewBareExprList(tls *crt.TLS, _pView *t45, _pList *XExprList, _zLabel *int8) {
var _2_i, _3_j int32
if (_zLabel == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLabel)) + 1*uintptr(i32(0))))) == i32(0)) {
_zLabel = str(44999)
}
if _pList == nil {
_sqlite3TreeViewLine(tls, _pView, str(47258), unsafe.Pointer(_zLabel))
goto _3
}
_sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(_zLabel))
_2_i = i32(0)
_4:
if _2_i >= (_pList.X0) {
goto _7
}
_3_j = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_2_i))).X5))))).X0)
if _3_j != 0 {
_sqlite3TreeViewPush(tls, _pView, uint8(i32(0)))
_sqlite3TreeViewLine(tls, _pView, str(47269), _3_j)
}
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_2_i))).X0), uint8(bool2int(_2_i < ((_pList.X0)-i32(1)))))
if _3_j != 0 {
_sqlite3TreeViewPop(tls, _pView)
}
_2_i += 1
goto _4
_7:
_3:
}
// Generate a human-readable explanation of an expression tree.
func _sqlite3TreeViewExpr(tls *crt.TLS, _pView *t45, _pExpr *XExpr, _moreToFollow uint8) {
var _zBinOp, _zUniOp, _38_zType *int8
var _24_pFarg *XExprList
var _35_pX, _35_pY, _35_pZ *XExpr
var _zFlgs [60]int8
_zBinOp = nil
_zUniOp = nil
_pView = _sqlite3TreeViewPush(tls, _pView, _moreToFollow)
if _pExpr == nil {
_sqlite3TreeViewLine(tls, _pView, str(47284))
_sqlite3TreeViewPop(tls, _pView)
return
}
if (_pExpr.X2) == 0 {
goto _1
}
if ((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) {
Xsqlite3_snprintf(tls, int32(u32(60)), (*int8)(unsafe.Pointer(&_zFlgs)), str(47288), _pExpr.X2, int32(_pExpr.X11))
goto _3
}
Xsqlite3_snprintf(tls, int32(u32(60)), (*int8)(unsafe.Pointer(&_zFlgs)), str(47309), _pExpr.X2)
_3:
goto _4
_1:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zFlgs)) + 1*uintptr(i32(0)))) = int8(i32(0))
_4:
switch int32(_pExpr.X0) {
case i32(19):
goto _41
case i32(20):
goto _48
case i32(27):
goto _15
case i32(37):
goto _16
case i32(50):
goto _55
case i32(56):
goto _54
case i32(61):
goto _52
case i32(70):
goto _26
case i32(71):
goto _25
case i32(72):
goto _23
case i32(73):
goto _51
case i32(74):
goto _50
case i32(75):
goto _42
case i32(76):
goto _43
case i32(77):
goto _21
case i32(78):
goto _22
case i32(79):
goto _19
case i32(80):
goto _18
case i32(81):
goto _17
case i32(82):
goto _20
case i32(84):
goto _31
case i32(85):
goto _32
case i32(86):
goto _34
case i32(87):
goto _35
case i32(88):
goto _27
case i32(89):
goto _29
case i32(90):
goto _28
case i32(91):
goto _33
case i32(92):
goto _30
case i32(93):
goto _36
case i32(94):
goto _45
case i32(95):
goto _40
case i32(97):
goto _10
case i32(101):
goto _11
case i32(119):
goto _49
case i32(122):
goto _37
case i32(132):
goto _9
case i32(133):
goto _12
case i32(134):
goto _8
case i32(135):
goto _13
case i32(136):
goto _53
case i32(148):
goto _24
case i32(151):
goto _46
case i32(152):
goto _7
case i32(153):
goto _46
case i32(154):
goto _6
case i32(155):
goto _38
case i32(156):
goto _39
case i32(157):
goto _14
case i32(158):
goto _56
case i32(159):
goto _57
case i32(160):
goto _58
case i32(162):
goto _44
default:
goto _59
}
_6:
_sqlite3TreeViewLine(tls, _pView, str(47322), _pExpr.X8, int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
goto _60
_7:
if (_pExpr.X8) < i32(0) {
_sqlite3TreeViewLine(tls, _pView, str(47335), int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
goto _62
}
_sqlite3TreeViewLine(tls, _pView, str(47348), _pExpr.X8, int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
_62:
goto _60
_8:
if ((_pExpr.X2) & uint32(i32(1024))) != 0 {
_sqlite3TreeViewLine(tls, _pView, str(37915), *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))
goto _64
}
_sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
_64:
goto _60
_9:
_sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _60
_10:
_sqlite3TreeViewLine(tls, _pView, str(47358), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _60
_11:
_sqlite3TreeViewLine(tls, _pView, str(155))
goto _60
_12:
_sqlite3TreeViewLine(tls, _pView, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _60
_13:
_sqlite3TreeViewLine(tls, _pView, str(47361), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))), int32(_pExpr.X9))
goto _60
_14:
_sqlite3TreeViewLine(tls, _pView, str(47377), _pExpr.X8)
goto _60
_15:
_sqlite3TreeViewLine(tls, _pView, str(47390), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _60
_16:
_sqlite3TreeViewLine(tls, _pView, str(47398), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0)))
goto _60
_17:
_zBinOp = str(25452)
goto _60
_18:
_zBinOp = str(25449)
goto _60
_19:
_zBinOp = str(25446)
goto _60
_20:
_zBinOp = str(25455)
goto _60
_21:
_zBinOp = str(25440)
goto _60
_22:
_zBinOp = str(25443)
goto _60
_23:
_zBinOp = str(25411)
goto _60
_24:
_zBinOp = str(47406)
goto _60
_25:
_zBinOp = str(25407)
goto _60
_26:
_zBinOp = str(25404)
goto _60
_27:
_zBinOp = str(25841)
goto _60
_28:
_zBinOp = str(47412)
goto _60
_29:
_zBinOp = str(47416)
goto _60
_30:
_zBinOp = str(25514)
goto _60
_31:
_zBinOp = str(25465)
goto _60
_32:
_zBinOp = str(25472)
goto _60
_33:
_zBinOp = str(47420)
goto _60
_34:
_zBinOp = str(25478)
goto _60
_35:
_zBinOp = str(25485)
goto _60
_36:
_zBinOp = str(25518)
goto _60
_37:
_zBinOp = str(25725)
goto _60
_38:
_zUniOp = str(47424)
goto _60
_39:
_zUniOp = str(47431)
goto _60
_40:
_zUniOp = str(25533)
goto _60
_41:
_zUniOp = str(25087)
goto _60
_42:
_zUniOp = str(25425)
goto _60
_43:
_zUniOp = str(25432)
goto _60
_44:
_sqlite3TreeViewLine(tls, _pView, str(47437), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0)))
goto _60
_45:
_sqlite3TreeViewLine(tls, _pView, str(47445), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0)))
goto _60
_46:
if ((_pExpr.X2) & uint32(i32(16384))) != uint32(i32(0)) {
_24_pFarg = nil
goto _66
}
_24_pFarg = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_66:
if int32(_pExpr.X0) == i32(153) {
_sqlite3TreeViewLine(tls, _pView, str(47456), int32(_pExpr.X12), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _68
}
_sqlite3TreeViewLine(tls, _pView, str(47474), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
_68:
if _24_pFarg != nil {
_sqlite3TreeViewExprList(tls, _pView, _24_pFarg, uint8(i32(0)), nil)
}
goto _60
_48:
_sqlite3TreeViewLine(tls, _pView, str(47486))
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)))
goto _60
_49:
_sqlite3TreeViewLine(tls, _pView, str(47498))
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)))
goto _60
_50:
_sqlite3TreeViewLine(tls, _pView, str(25422))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(1)))
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)))
goto _71
}
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)), nil)
_71:
goto _60
_51:
_35_pX = (*XExpr)(_pExpr.X4)
_35_pY = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(0)))).X0)
_35_pZ = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(1)))).X0)
_sqlite3TreeViewLine(tls, _pView, str(25414))
_sqlite3TreeViewExpr(tls, _pView, _35_pX, uint8(i32(1)))
_sqlite3TreeViewExpr(tls, _pView, _35_pY, uint8(i32(1)))
_sqlite3TreeViewExpr(tls, _pView, _35_pZ, uint8(i32(0)))
goto _60
_52:
_sqlite3TreeViewLine(tls, _pView, str(37908), unsafe.Pointer(func() *int8 {
if (_pExpr.X8) != 0 {
return str(47510)
}
return str(47514)
}()), int32(_pExpr.X9))
goto _60
_53:
_sqlite3TreeViewLine(tls, _pView, str(25809))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(1)))
_sqlite3TreeViewExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), uint8(i32(0)), nil)
goto _60
_54:
_38_zType = str(47518)
switch int32(_pExpr.X1) {
case i32(1):
goto _75
case i32(2):
goto _76
case i32(3):
goto _77
case i32(4):
goto _78
default:
goto _79
}
_75:
_38_zType = str(47522)
goto _79
_76:
_38_zType = str(47531)
goto _79
_77:
_38_zType = str(47537)
goto _79
_78:
_38_zType = str(47542)
goto _79
_79:
_sqlite3TreeViewLine(tls, _pView, str(47549), unsafe.Pointer(_38_zType), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))))
goto _60
_55:
_sqlite3TreeViewLine(tls, _pView, str(47562), _pExpr.X8, int32(_pExpr.X9), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X5), uint8(i32(0)))
goto _60
_56:
_sqlite3TreeViewBareExprList(tls, _pView, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), str(47578))
goto _60
_57:
_sqlite3TreeViewLine(tls, _pView, str(47585), int32(_pExpr.X9))
_sqlite3TreeViewSelect(tls, _pView, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X6)))))), uint8(i32(0)))
goto _60
_58:
_sqlite3TreeViewLine(tls, _pView, str(47602), _pExpr.X8)
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0)))
goto _60
_59:
_sqlite3TreeViewLine(tls, _pView, str(47617), int32(_pExpr.X0))
goto _60
_60:
if _zBinOp != nil {
_sqlite3TreeViewLine(tls, _pView, str(6890), unsafe.Pointer(_zBinOp), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(1)))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X5), uint8(i32(0)))
goto _82
}
if _zUniOp != nil {
_sqlite3TreeViewLine(tls, _pView, str(6890), unsafe.Pointer(_zUniOp), unsafe.Pointer((*int8)(unsafe.Pointer(&_zFlgs))))
_sqlite3TreeViewExpr(tls, _pView, (*XExpr)(_pExpr.X4), uint8(i32(0)))
}
_82:
_sqlite3TreeViewPop(tls, _pView)
_ = _zFlgs
}
var _sqlite3SelectØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SelectØ00__func__Ø000[0], str(47623), 14)
}
// This routine sets up a SELECT statement for processing. The
// following is accomplished:
//
// * VDBE Cursor numbers are assigned to all FROM-clause terms.
// * Ephemeral Table objects are created for all FROM-clause subqueries.
// * ON and USING clauses are shifted into WHERE statements
// * Wildcards "*" and "TABLE.*" in result sets are expanded.
// * Identifiers in expression are matched to tables.
//
// This routine acts recursively on all subqueries within the SELECT.
func _sqlite3SelectPrep(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
var _db *Xsqlite3
if func() int32 {
if _p == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121240), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectPrepØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
_db = (*Xsqlite3)(_pParse.X0)
if (_db.X17) != 0 {
return
}
if ((_p.X3) & uint32(i32(128))) != 0 {
return
}
_sqlite3SelectExpand(tls, _pParse, _p)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
return
}
_sqlite3ResolveSelectNames(tls, _pParse, _p, _pOuterNC)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
return
}
_sqlite3SelectAddTypeInfo(tls, _pParse, _p)
}
var _sqlite3SelectPrepØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SelectPrepØ00__func__Ø000[0], str(47637), 18)
}
// This routine "expands" a SELECT statement and all of its subqueries.
// For additional information on what it means to "expand" a SELECT
// statement, see the comment on the selectExpand worker callback above.
//
// Expanding a SELECT statement is the first step in processing a
// SELECT statement. The SELECT statement must be expanded before
// name resolution is performed.
//
// If anything goes wrong, an error message is written into pParse.
// The calling function can detect the problem by looking at pParse->nErr
// and/or pParse->db->mallocFailed.
func _sqlite3SelectExpand(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _sqlite3ExprWalkNoop
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse
if (_pParse.X10) != 0 {
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _convertCompoundSelectToSubquery
_sqlite3WalkSelect(tls, &_w, _pSelect)
}
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _selectExpander
*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = _selectPopWith
_sqlite3WalkSelect(tls, &_w, _pSelect)
_ = _w
}
// 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 _sqlite3ExprWalkNoop(tls *crt.TLS, _NotUsed *XWalker, _NotUsed2 *XExpr) (r0 int32) {
_ = _NotUsed2
return i32(0)
}
// Detect compound SELECT statements that use an ORDER BY clause with
// an alternative collating sequence.
//
// SELECT ... FROM t1 EXCEPT SELECT ... FROM t2 ORDER BY .. COLLATE ...
//
// These are rewritten as a subquery:
//
// SELECT * FROM (SELECT ... FROM t1 EXCEPT SELECT ... FROM t2)
// ORDER BY ... COLLATE ...
//
// This transformation is necessary because the multiSelectOrderBy() routine
// above that generates the code for a compound SELECT with an ORDER BY clause
// uses a merge algorithm that requires the same collating sequence on the
// result columns as on the ORDER BY clause. See ticket
// http://www.sqlite.org/src/info/6709574d2a
//
// This transformation is only needed for EXCEPT, INTERSECT, and UNION.
// The UNION ALL operator works fine with multiSelectOrderBy() even when
// there are COLLATE terms in the ORDER BY.
func _convertCompoundSelectToSubquery(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
var _i int32
var _dummy XToken
var _db *Xsqlite3
var _pNewSrc *XSrcList
var _a *TExprList_item
var _pNew, _pX *XSelect
var _pParse *XParse
if (*XSelect)(_p.X13) == nil {
return i32(0)
}
if (*XExprList)(_p.X12) == nil {
return i32(0)
}
_pX = _p
_2:
if _pX == nil || int32(_pX.X1) != i32(116) && int32(_pX.X1) != i32(119) {
goto _7
}
_pX = (*XSelect)(_pX.X13)
goto _2
_7:
if _pX == nil {
return i32(0)
}
_a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X12).X2)))))
_i = ((*XExprList)(_p.X12).X0) - i32(1)
_9:
if _i < i32(0) {
goto _12
}
if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 20*uintptr(_i))).X0).X2) & uint32(i32(256))) != 0 {
goto _12
}
_i -= 1
goto _9
_12:
if _i < i32(0) {
return i32(0)
}
_pParse = (*XParse)(_pWalker.X0)
_db = (*Xsqlite3)(_pParse.X0)
_pNew = (*XSelect)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80))))
if _pNew == nil {
return i32(2)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_dummy), i32(0), u32(8))
_pNewSrc = _sqlite3SrcListAppendFromTerm(tls, _pParse, nil, nil, nil, &_dummy, _pNew, nil, nil)
if _pNewSrc == nil {
return i32(2)
}
*_pNew = *_p
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pNewSrc
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, _db, i32(161), nil))
*(*uint8)(unsafe.Pointer(&(_p.X1))) = uint8(i32(119))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = nil
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X10))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X11))))) = nil
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X12))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = nil
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = nil
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) & uint32(i32(-257))
sink5 = *p
}
func() {
if ((_p.X3) & uint32(i32(65536))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120599), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000))), unsafe.Pointer(str(47655)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(65536))
sink5 = *p
}
func() {
if (*XSelect)(_pNew.X13) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120601), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertCompoundSelectToSubqueryØ00__func__Ø000))), unsafe.Pointer(str(47687)))
crt.X__builtin_abort(tls)
}
}()
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSelect)(_pNew.X13).X14))))) = _pNew
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X15))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X16))))) = nil
return i32(0)
_ = _dummy
panic(0)
}
// This routine is called by the parser to add a new term to the
// end of a growing FROM clause. The "p" parameter is the part of
// the FROM clause that has already been constructed. "p" is NULL
// if this is the first term of the FROM clause. pTable and pDatabase
// are the name of the table and database named in the FROM clause term.
// pDatabase is NULL if the database name qualifier is missing - the
// usual case. If the term has an alias, then pAlias points to the
// alias token. If the term is a subquery, then pSubquery is the
// SELECT statement that the subquery encodes. The pTable and
// pDatabase parameters are NULL for subqueries. The pOn and pUsing
// parameters are the content of the ON and USING clauses.
//
// Return a new SrcList which encodes is the FROM with the new
// term added.
func _sqlite3SrcListAppendFromTerm(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pTable *XToken, _pDatabase *XToken, _pAlias *XToken, _pSubquery *XSelect, _pOn *XExpr, _pUsing *XIdList) (r0 *XSrcList) {
var _db *Xsqlite3
var _pItem *TSrcList_item
_db = (*Xsqlite3)(_pParse.X0)
if (_p == nil) && ((_pOn != nil) || (_pUsing != nil)) {
_sqlite3ErrorMsg(tls, _pParse, str(47703), unsafe.Pointer(func() *int8 {
if _pOn != nil {
return str(25623)
}
return str(25739)
}()))
goto _append_from_error
}
_p = _sqlite3SrcListAppend(tls, _db, _p, _pTable, _pDatabase)
if (_p == nil) || func() int32 {
if (_p.X0) == i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103550), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _append_from_error
}
_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr((_p.X0)-i32(1))))
func() {
if _pAlias == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103554), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000))), unsafe.Pointer(str(47739)))
crt.X__builtin_abort(tls)
}
}()
if (_pAlias.X1) != 0 {
*(**int8)(unsafe.Pointer(&(_pItem.X3))) = _sqlite3NameFromToken(tls, _db, _pAlias)
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X5))))) = _pSubquery
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X12))))) = _pOn
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X13))))) = _pUsing
return _p
_append_from_error:
func() {
if _p != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103564), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendFromTermØ00__func__Ø000))), unsafe.Pointer(str(47749)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprDelete(tls, _db, _pOn)
_sqlite3IdListDelete(tls, _db, _pUsing)
_sqlite3SelectDelete(tls, _db, _pSubquery)
return nil
}
// Append a new table name to the given SrcList. Create a new SrcList if
// need be. A new entry is created in the SrcList even if pTable is NULL.
//
// A SrcList is returned, or NULL if there is an OOM error. The returned
// SrcList might be the same as the SrcList that was input or it might be
// a new one. If an OOM error does occurs, then the prior value of pList
// that is input to this routine is automatically freed.
//
// If pDatabase is not null, it means that the table has an optional
// database name prefix. Like this: "database.table". The pDatabase
// points to the table name and the pTable points to the database name.
// The SrcList.a[].zName field is filled with the table name which might
// come from pTable (if pDatabase is NULL) or from pDatabase.
// SrcList.a[].zDatabase is filled with the database name from pTable,
// or with NULL if no database is specified.
//
// In other words, if call like this:
//
// sqlite3SrcListAppend(D,A,B,0);
//
// Then B is a table name and the database name is unspecified. If called
// like this:
//
// sqlite3SrcListAppend(D,A,B,C);
//
// Then C is the table name and B is the database name. If C is defined
// then so is B. In other words, we never have a case where:
//
// sqlite3SrcListAppend(D,A,0,C);
//
// Both pTable and pDatabase are assumed to be quoted. They are dequoted
// before being added to the SrcList.
func _sqlite3SrcListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XSrcList, _pTable *XToken, _pDatabase *XToken) (r0 *XSrcList) {
var _5_pTemp *XToken
var _pItem *TSrcList_item
func() {
if _pDatabase != nil && _pTable == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103446), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000))), unsafe.Pointer(str(47754)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAppendØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _pList != nil {
goto _5
}
_pList = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(76))))
if _pList == nil {
return nil
}
*(*uint32)(unsafe.Pointer(&(_pList.X1))) = uint32(i32(1))
*(*int32)(unsafe.Pointer(&(_pList.X0))) = i32(1)
crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2)))))+68*uintptr(i32(0))))), i32(0), u32(68))
*(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 68*uintptr(i32(0)))).X11))) = i32(-1)
goto _7
_5:
_pList = _sqlite3SrcListEnlarge(tls, _db, _pList, i32(1), _pList.X0)
_7:
if (_db.X17) != 0 {
_sqlite3SrcListDelete(tls, _db, _pList)
return nil
}
_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 68*uintptr((_pList.X0)-i32(1))))
if (_pDatabase != nil) && ((_pDatabase.X0) == nil) {
_pDatabase = nil
}
if _pDatabase != nil {
_5_pTemp = _pDatabase
_pDatabase = _pTable
_pTable = _5_pTemp
}
*(**int8)(unsafe.Pointer(&(_pItem.X2))) = _sqlite3NameFromToken(tls, _db, _pTable)
*(**int8)(unsafe.Pointer(&(_pItem.X1))) = _sqlite3NameFromToken(tls, _db, _pDatabase)
return _pList
}
var _sqlite3SrcListAppendØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListAppendØ00__func__Ø000[0], str(47780), 21)
}
// Expand the space allocated for the given SrcList object by
// creating nExtra new slots beginning at iStart. iStart is zero based.
// New slots are zeroed.
//
// For example, suppose a SrcList initially contains two entries: A,B.
// To append 3 new entries onto the end, do this:
//
// sqlite3SrcListEnlarge(db, pSrclist, 3, 2);
//
// After the call above it would contain: A, B, nil, nil, nil.
// If the iStart argument had been 1 instead of 2, then the result
// would have been: A, nil, nil, nil, B. To prepend the new slots,
// the iStart value would be 0. The result then would
// be: nil, nil, nil, A, B.
//
// If a memory allocation fails the SrcList is unchanged. The
// db->mallocFailed flag will be set to true.
func _sqlite3SrcListEnlarge(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _nExtra int32, _iStart int32) (r0 *XSrcList) {
var _i, _1_nAlloc, _1_nGot int32
var _1_pNew *XSrcList
func() {
if _iStart < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103366), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47801)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nExtra < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103367), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47811)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103368), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47821)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iStart > (_pSrc.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103369), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47829)))
crt.X__builtin_abort(tls)
}
}()
if (uint32(_pSrc.X0) + uint32(_nExtra)) <= (_pSrc.X1) {
goto _8
}
_1_nAlloc = ((_pSrc.X0) * i32(2)) + _nExtra
_1_pNew = (*XSrcList)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pSrc), uint64(u32(76)+(uint32(_1_nAlloc-i32(1))*u32(68)))))
if _1_pNew == nil {
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103379), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListEnlargeØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
return _pSrc
}
_pSrc = _1_pNew
_1_nGot = int32(((uint32(_sqlite3DbMallocSize(tls, _db, (unsafe.Pointer)(_1_pNew))) - u32(76)) / u32(68)) + uint32(i32(1)))
*(*uint32)(unsafe.Pointer(&(_pSrc.X1))) = uint32(_1_nGot)
_8:
_i = (_pSrc.X0) - i32(1)
_12:
if _i < _iStart {
goto _15
}
*(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i+_nExtra))) = *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i)))
_i -= 1
goto _12
_15:
{
p := (*int32)(unsafe.Pointer(&(_pSrc.X0)))
*p = (*p) + _nExtra
sink1 = *p
}
crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_iStart)))), i32(0), u32(68)*uint32(_nExtra))
_i = _iStart
_16:
if _i >= (_iStart + _nExtra) {
goto _19
}
*(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i))).X11))) = i32(-1)
_i += 1
goto _16
_19:
return _pSrc
}
var _sqlite3SrcListEnlargeØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListEnlargeØ00__func__Ø000[0], str(47865), 22)
}
// 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 _sqlite3NameFromToken(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 *int8) {
var _zName *int8
if _pName != nil {
_zName = _sqlite3DbStrNDup(tls, _db, _pName.X0, uint64(_pName.X1))
_sqlite3Dequote(tls, _zName)
goto _1
}
_zName = nil
_1:
return _zName
}
var _sqlite3SrcListAppendFromTermØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListAppendFromTermØ00__func__Ø000[0], str(47887), 29)
}
// Add a new element to the end of an expression list. If pList is
// initially NULL, then create a new expression list.
//
// 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 _sqlite3ExprListAppend(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pExpr *XExpr) (r0 *XExprList) {
var _db *Xsqlite3
var _3_pNew *XExprList
var _pItem *TExprList_item
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92370), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _pList != nil {
goto _2
}
_pList = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(28))))
if _pList == nil {
goto _no_mem
}
*(*int32)(unsafe.Pointer(&(_pList.X0))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pList.X1))) = i32(1)
goto _5
_2:
if (_pList.X0) != (_pList.X1) {
goto _5
}
_3_pNew = (*XExprList)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pList), uint64(u32(28)+(uint32((i32(2)*(_pList.X1))-i32(1))*u32(20)))))
if _3_pNew == nil {
goto _no_mem
}
_pList = _3_pNew
{
p := (*int32)(unsafe.Pointer(&(_pList.X1)))
*p = (*p) * i32(2)
sink1 = *p
}
_5:
_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pList.X0))), int32(1)))))
crt.Xmemset(tls, (unsafe.Pointer)(_pItem), i32(0), u32(20))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = _pExpr
return _pList
_no_mem:
_sqlite3ExprDelete(tls, _db, _pExpr)
_sqlite3ExprListDelete(tls, _db, _pList)
return nil
}
var _sqlite3ExprListAppendØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListAppendØ00__func__Ø000[0], str(47916), 22)
}
// Allocate a new expression node from a zero-terminated token that has
// already been dequoted.
func _sqlite3Expr(tls *crt.TLS, _db *Xsqlite3, _op int32, _zToken *int8) (r0 *XExpr) {
var _x XToken
*(**int8)(unsafe.Pointer(&(_x.X0))) = _zToken
*(*uint32)(unsafe.Pointer(&(_x.X1))) = uint32(func() int32 {
if _zToken != nil {
return _sqlite3Strlen30(tls, _zToken)
}
return i32(0)
}())
return _sqlite3ExprAlloc(tls, _db, _op, &_x, i32(0))
_ = _x
panic(0)
}
// 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 _sqlite3ExprAlloc(tls *crt.TLS, _db *Xsqlite3, _op int32, _pToken *XToken, _dequote int32) (r0 *XExpr) {
var _nExtra, _iValue int32
var _pNew *XExpr
_nExtra = i32(0)
_iValue = i32(0)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91630), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _pToken == nil {
goto _2
}
if ((_op != i32(134)) || ((_pToken.X0) == nil)) || (_sqlite3GetInt32(tls, _pToken.X0, &_iValue) == i32(0)) {
_nExtra = int32((_pToken.X1) + uint32(i32(1)))
func() {
if _iValue < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91635), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000))), unsafe.Pointer(str(47938)))
crt.X__builtin_abort(tls)
}
}()
}
_2:
_pNew = (*XExpr)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(48)+uint32(_nExtra))))
if _pNew == nil {
goto _8
}
crt.Xmemset(tls, (unsafe.Pointer)(_pNew), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_pNew.X0))) = uint8(_op)
*(*int16)(unsafe.Pointer(&(_pNew.X10))) = int16(i32(-1))
if _pToken == nil {
goto _9
}
if _nExtra == i32(0) {
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X2)))
*p = (*p) | uint32(i32(1024))
sink5 = *p
}
*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))) = _iValue
goto _11
}
*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 48*uintptr(i32(1))))))
func() {
if (_pToken.X0) == nil && (_pToken.X1) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAllocØ00__func__Ø000))), unsafe.Pointer(str(47948)))
crt.X__builtin_abort(tls)
}
}()
if (_pToken.X1) != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3)))))), (unsafe.Pointer)(_pToken.X0), _pToken.X1)
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(_pToken.X1))) = int8(i32(0))
if _dequote == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(i32(0)))))))))&i32(128)) == 0 {
goto _17
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))) + 1*uintptr(i32(0))))) == i32(34) {
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X2)))
*p = (*p) | uint32(i32(64))
sink5 = *p
}
}
_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))))
_17:
_11:
_9:
*(*int32)(unsafe.Pointer(&(_pNew.X7))) = i32(1)
_8:
return _pNew
}
var _sqlite3ExprAllocØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAllocØ00__func__Ø000[0], str(47977), 17)
}
var _convertCompoundSelectToSubqueryØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_convertCompoundSelectToSubqueryØ00__func__Ø000[0], str(47994), 32)
}
// Call sqlite3WalkExpr() for every expression in Select statement p.
// Invoke sqlite3WalkSelect() for subqueries in the FROM clause and
// on the compound select chain, p->pPrior.
//
// If it is not NULL, the xSelectCallback() callback is invoked before
// the walk of the expressions and FROM clause. The xSelectCallback2()
// method, if it is not NULL, is invoked following the walk of the
// expressions and FROM clause.
//
// Return WRC_Continue under normal conditions. Return WRC_Abort if
// there is an abort request.
//
// If the Walker does not have an xSelectCallback() then this routine
// is a no-op returning WRC_Continue.
func _sqlite3WalkSelect(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
var _rc int32
if (_p == nil) || ((*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XWalker, *XSelect) int32
}{(*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{(_pWalker.X2)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XWalker, *XSelect) int32
}{nil}))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XWalker, *XSelect)
}{(*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
}{(_pWalker.X3)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XWalker, *XSelect)
}{nil})))) {
return i32(0)
}
_rc = i32(0)
*(*int32)(unsafe.Pointer(&(_pWalker.X4))) += 1
_3:
if _p == nil {
goto _4
}
if (*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{(_pWalker.X2)}))) == nil {
goto _5
}
_rc = (*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{(_pWalker.X2)})))(tls, _pWalker, _p)
if _rc != 0 {
goto _4
}
_5:
if _sqlite3WalkSelectExpr(tls, _pWalker, _p) != 0 || _sqlite3WalkSelectFrom(tls, _pWalker, _p) != 0 {
*(*int32)(unsafe.Pointer(&(_pWalker.X4))) -= 1
return i32(2)
}
if (*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
}{(_pWalker.X3)}))) != nil {
(*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
}{(_pWalker.X3)})))(tls, _pWalker, _p)
}
_p = (*XSelect)(_p.X13)
goto _3
_4:
*(*int32)(unsafe.Pointer(&(_pWalker.X4))) -= 1
return _rc & i32(2)
}
// Walk all expressions associated with SELECT statement p. Do
// not invoke the SELECT callback on p, but do (of course) invoke
// any expr callbacks and SELECT callbacks that come from subqueries.
// Return WRC_Abort or WRC_Continue.
func _sqlite3WalkSelectExpr(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.X0)) != 0 {
return i32(2)
}
if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.X9)) != 0 {
return i32(2)
}
if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.X10)) != 0 {
return i32(2)
}
if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.X11)) != 0 {
return i32(2)
}
if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(_p.X12)) != 0 {
return i32(2)
}
if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.X15)) != 0 {
return i32(2)
}
if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_p.X16)) != 0 {
return i32(2)
}
return i32(0)
}
// Call sqlite3WalkExpr() for every expression in list p or until
// an abort request is seen.
func _sqlite3WalkExprList(tls *crt.TLS, _pWalker *XWalker, _p *XExprList) (r0 int32) {
var _i int32
var _pItem *TExprList_item
if _p == nil {
goto _0
}
*func() **TExprList_item { _i = _p.X0; return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))
_1:
if _i <= i32(0) {
goto _4
}
if _sqlite3WalkExpr(tls, _pWalker, (*XExpr)(_pItem.X0)) != 0 {
return i32(2)
}
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i -= 1; return &_pItem }())) += uintptr(20)
goto _1
_4:
_0:
return i32(0)
}
func _sqlite3WalkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
return func() int32 {
if _pExpr != nil {
return _walkExpr(tls, _pWalker, _pExpr)
}
return i32(0)
}()
}
// Walk an expression tree. Invoke the callback once for each node
// of the expression, while descending. (In other words, the callback
// is invoked before visiting children.)
//
// The return value from the callback should be one of the WRC_*
// constants to specify how to proceed with the walk.
//
// WRC_Continue Continue descending down the tree.
//
// WRC_Prune Do not descend into child nodes, but allow
// the walk to continue with sibling nodes.
//
// WRC_Abort Do no more callbacks. Unwind the stack and
// return from the top-level walk call.
//
// The return value from this routine is WRC_Abort to abandon the tree walk
// and WRC_Continue to continue.
func _walkExpr(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _rc int32
_rc = (*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{(_pWalker.X1)})))(tls, _pWalker, _pExpr)
if _rc != 0 || (((_pExpr.X2) & uint32(i32(8404992))) != uint32(i32(0))) {
return _rc & i32(2)
}
if ((*XExpr)(_pExpr.X4) != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X4)) != 0 {
return i32(2)
}
if ((*XExpr)(_pExpr.X5) != nil) && _walkExpr(tls, _pWalker, (*XExpr)(_pExpr.X5)) != 0 {
return i32(2)
}
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
goto _6
}
if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 {
return i32(2)
}
goto _9
_6:
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil {
goto _9
}
if _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 {
return i32(2)
}
_9:
return i32(0)
}
// Walk the parse trees associated with all subqueries in the
// FROM clause of SELECT statement p. Do not invoke the select
// callback on p, but do invoke it on each FROM clause subquery
// and on any subqueries further down in the tree. Return
// WRC_Abort or WRC_Continue;
func _sqlite3WalkSelectFrom(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
var _i int32
var _pSrc *XSrcList
var _pItem *TSrcList_item
_pSrc = (*XSrcList)(_p.X8)
if func() int32 {
if _pSrc != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89291), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalkSelectFromØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _2
}
*func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))
_3:
if _i <= i32(0) {
goto _6
}
if _sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pItem.X5)) != 0 {
return i32(2)
}
if (((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3WalkExprList(tls, _pWalker, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))) != 0 {
return i32(2)
}
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(68)
goto _3
_6:
_2:
return i32(0)
}
var _sqlite3WalkSelectFromØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalkSelectFromØ00__func__Ø000[0], str(48026), 22)
}
// This routine is a Walker callback for "expanding" a SELECT statement.
// "Expanding" means to do the following:
//
// (1) Make sure VDBE cursor numbers have been assigned to every
// element of the FROM clause.
//
// (2) Fill in the pTabList->a[].pTab fields in the SrcList that
// defines FROM clause. When views appear in the FROM clause,
// fill pTabList->a[].pSelect with a copy of the SELECT statement
// that implements the view. A copy is made of the view's SELECT
// statement so that we can freely modify or delete that statement
// without worrying about messing up the persistent representation
// of the view.
//
// (3) Add terms to the WHERE clause to accommodate the NATURAL keyword
// on joins and the ON and USING clause of joins.
//
// (4) Scan the list of columns in the result set (pEList) looking
// for instances of the "*" operator or the TABLE.* operator.
// If found, expand each "*" to be every column in every table
// and TABLE.* to be every column in TABLE.
//
func _selectExpander(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
var _11_nCol int16
var _i, _j, _k, _15_flags, _15_longNames, _19_tableSeen, _21_iDb int32
var _19_zTName, _21_zTabName, _21_zSchemaName, _25_zName, _25_zColname, _25_zToFree *int8
var _selFlags uint16
var _25_sColname XToken
var _db *Xsqlite3
var _4_pTab, _21_pTab *XTable
var _pTabList *XSrcList
var _pFrom *TSrcList_item
var _pEList, _15_pNew *XExprList
var _15_a, _35_pX *TExprList_item
var _6_pSel, _21_pSub *XSelect
var _pE, _pRight, _pExpr, _31_pLeft *XExpr
var _pParse *XParse
_pParse = (*XParse)(_pWalker.X0)
_db = (*Xsqlite3)(_pParse.X0)
_selFlags = uint16(_p.X3)
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(64))
sink5 = *p
}
if (_db.X17) != 0 {
return i32(2)
}
if func() int32 {
if (*XSrcList)(_p.X8) == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120864), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 || ((int32(_selFlags) & i32(64)) != i32(0)) {
return i32(1)
}
_pTabList = (*XSrcList)(_p.X8)
_pEList = (*XExprList)(_p.X0)
if (*XWith)(_p.X17) != nil {
_sqlite3WithPush(tls, _pParse, (*XWith)(_p.X17), uint8(i32(0)))
}
_sqlite3SrcListAssignCursors(tls, _pParse, _pTabList)
*func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))
_6:
if _i >= (_pTabList.X0) {
goto _9
}
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(5)))<>uint(i32(31))) != i32(0) && (*XTable)(_pFrom.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120884), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48048)))
crt.X__builtin_abort(tls)
}
}()
if ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 {
goto _7
}
func() {
if (*XTable)(_pFrom.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120886), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48091)))
crt.X__builtin_abort(tls)
}
}()
if _withExpand(tls, _pWalker, _pFrom) != 0 {
return i32(2)
}
if (*XTable)(_pFrom.X4) != nil {
goto _30
}
if (_pFrom.X2) != nil {
goto _19
}
_6_pSel = (*XSelect)(_pFrom.X5)
func() {
if _6_pSel == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120895), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48106)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)(_pFrom.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120896), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48091)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3WalkSelect(tls, _pWalker, _6_pSel) != 0 {
return i32(2)
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_4_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80)))))
if _4_pTab == nil {
return i32(2)
}
*(*uint32)(unsafe.Pointer(&(_4_pTab.X8))) = uint32(i32(1))
*(**int8)(unsafe.Pointer(&(_4_pTab.X0))) = _sqlite3MPrintf(tls, _db, str(48114), (unsafe.Pointer)(_4_pTab))
_26:
if (*XSelect)(_6_pSel.X13) != nil {
_6_pSel = (*XSelect)(_6_pSel.X13)
goto _26
}
_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_6_pSel.X0), (*int16)(unsafe.Pointer(&(_4_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pTab.X1))))))
*(*int16)(unsafe.Pointer(&(_4_pTab.X10))) = int16(i32(-1))
*(*int16)(unsafe.Pointer(&(_4_pTab.X12))) = int16(i32(200))
func() {
if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120905), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48127)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_4_pTab.X9)))
*p = (*p) | uint32(i32(2))
sink5 = *p
}
goto _30
_19:
func() {
if (*XTable)(_pFrom.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120910), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48091)))
crt.X__builtin_abort(tls)
}
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_4_pTab, _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pFrom))
if _4_pTab == nil {
return i32(2)
}
if (_4_pTab.X8) >= uint32(i32(65535)) {
_sqlite3ErrorMsg(tls, _pParse, str(48155), unsafe.Pointer(_4_pTab.X0))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = nil
return i32(2)
}
*(*uint32)(unsafe.Pointer(&(_4_pTab.X8))) += 1
if ((_4_pTab.X16) == 0) && _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
return i32(2)
}
if (_4_pTab.X16) == 0 && (*XSelect)(_4_pTab.X3) == nil {
goto _38
}
if _sqlite3ViewGetColumnNames(tls, _pParse, _4_pTab) != 0 {
return i32(2)
}
func() {
if (*XSelect)(_pFrom.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120927), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48194)))
crt.X__builtin_abort(tls)
}
}()
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_4_pTab.X3), i32(0))
_sqlite3SelectSetName(tls, (*XSelect)(_pFrom.X5), _4_pTab.X0)
_11_nCol = _4_pTab.X11
*(*int16)(unsafe.Pointer(&(_4_pTab.X11))) = int16(i32(-1))
_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(_pFrom.X5))
*(*int16)(unsafe.Pointer(&(_4_pTab.X11))) = _11_nCol
_38:
_30:
if _sqlite3IndexedByLookup(tls, _pParse, _pFrom) != 0 {
return i32(2)
}
_7:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
goto _6
_9:
if ((_db.X17) != 0) || _sqliteProcessJoin(tls, _pParse, _p) != 0 {
return i32(2)
}
_k = i32(0)
_45:
if _k >= (_pEList.X0) {
goto _48
}
_pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_k))).X0)
if int32(_pE.X0) == i32(161) {
goto _48
}
func() {
if int32(_pE.X0) == i32(122) && (*XExpr)(_pE.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120964), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48212)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pE.X0) == i32(122) && ((*XExpr)(_pE.X4) == nil || int32((*XExpr)(_pE.X4).X0) != i32(27)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120965), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48244)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pE.X0) == i32(122)) && (int32((*XExpr)(_pE.X5).X0) == i32(161)) {
goto _48
}
_k += 1
goto _45
_48:
if _k >= (_pEList.X0) {
goto _59
}
_15_a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))
_15_pNew = nil
_15_flags = (*Xsqlite3)(_pParse.X0).X6
_15_longNames = bool2int(((_15_flags & i32(4)) != i32(0)) && ((_15_flags & i32(64)) == i32(0)))
_k = i32(0)
_61:
if _k >= (_pEList.X0) {
goto _64
}
_pE = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X0)
_pRight = (*XExpr)(_pE.X5)
func() {
if int32(_pE.X0) == i32(122) && _pRight == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120983), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48301)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pE.X0) == i32(161) || int32(_pE.X0) == i32(122) && int32(_pRight.X0) == i32(161) {
goto _70
}
_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a))+20*uintptr(_k))).X0))
if _15_pNew != nil {
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 20*uintptr((_15_pNew.X0)-i32(1)))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X1
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 20*uintptr((_15_pNew.X0)-i32(1)))).X2))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X2
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X1))) = nil
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X2))) = nil
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_a)) + 20*uintptr(_k))).X0))))) = nil
goto _72
_70:
_19_tableSeen = i32(0)
_19_zTName = nil
if int32(_pE.X0) == i32(122) {
func() {
if (*XExpr)(_pE.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121003), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48329)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (((*XExpr)(_pE.X4).X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121004), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48342)))
crt.X__builtin_abort(tls)
}
}()
_19_zTName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pE.X4).X3)))))
}
*func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))
_78:
if _i >= (_pTabList.X0) {
goto _81
}
_21_pTab = (*XTable)(_pFrom.X4)
_21_pSub = (*XSelect)(_pFrom.X5)
_21_zTabName = _pFrom.X3
_21_zSchemaName = nil
if _21_zTabName == nil {
_21_zTabName = _21_pTab.X0
}
if (_db.X17) != 0 {
goto _81
}
if _21_pSub != nil && ((_21_pSub.X3)&uint32(i32(2048))) != uint32(i32(0)) {
goto _85
}
_21_pSub = nil
if (_19_zTName != nil) && (_sqlite3StrICmp(tls, _19_zTName, _21_zTabName) != i32(0)) {
goto _79
}
_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_21_pTab.X20))
_21_zSchemaName = func() *int8 {
if _21_iDb >= i32(0) {
return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_21_iDb))).X0)
}
return str(48383)
}()
_85:
_j = i32(0)
_90:
if _j >= int32(_21_pTab.X11) {
goto _93
}
_25_zName = (*XColumn)(unsafe.Pointer(uintptr(_21_pTab.X1) + 16*uintptr(_j))).X0
func() {
if _25_zName == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121031), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectExpanderØ00__func__Ø000))), unsafe.Pointer(str(48385)))
crt.X__builtin_abort(tls)
}
}()
if ((_19_zTName != nil) && (_21_pSub != nil)) && (_sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+20*uintptr(_j))).X2, nil, _19_zTName, nil) == i32(0)) {
goto _91
}
if (((_p.X3) & uint32(i32(131072))) == uint32(i32(0))) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_21_pTab.X1)+16*uintptr(_j))).X6) & i32(2)) != i32(0)) {
goto _91
}
_19_tableSeen = i32(1)
if _i <= i32(0) || _19_zTName != nil {
goto _102
}
if ((int32((*t28)(unsafe.Pointer(&(_pFrom.X9))).X0) & i32(4)) != i32(0)) && _tableAndColumnIndex(tls, _pTabList, _i, _25_zName, nil, nil) != 0 {
goto _91
}
if _sqlite3IdListIndex(tls, (*XIdList)(_pFrom.X13), _25_zName) >= i32(0) {
goto _91
}
_102:
_pRight = _sqlite3Expr(tls, _db, i32(27), _25_zName)
_25_zColname = _25_zName
_25_zToFree = nil
if _15_longNames == 0 && (_pTabList.X0) <= i32(1) {
goto _107
}
_31_pLeft = _sqlite3Expr(tls, _db, i32(27), _21_zTabName)
_pExpr = _sqlite3PExpr(tls, _pParse, i32(122), _31_pLeft, _pRight)
if _21_zSchemaName != nil {
_31_pLeft = _sqlite3Expr(tls, _db, i32(27), _21_zSchemaName)
_pExpr = _sqlite3PExpr(tls, _pParse, i32(122), _31_pLeft, _pExpr)
}
if _15_longNames != 0 {
_25_zColname = _sqlite3MPrintf(tls, _db, str(8018), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zName))
_25_zToFree = _25_zColname
}
goto _110
_107:
_pExpr = _pRight
_110:
_15_pNew = _sqlite3ExprListAppend(tls, _pParse, _15_pNew, _pExpr)
_sqlite3TokenInit(tls, &_25_sColname, _25_zColname)
_sqlite3ExprListSetName(tls, _pParse, _15_pNew, &_25_sColname, i32(0))
if _15_pNew == nil || ((_p.X3)&uint32(i32(2048))) == uint32(i32(0)) {
goto _112
}
_35_pX = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_15_pNew.X2))))) + 20*uintptr((_15_pNew.X0)-i32(1))))
if _21_pSub != nil {
*(**int8)(unsafe.Pointer(&(_35_pX.X2))) = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_21_pSub.X0).X2)))))+20*uintptr(_j))).X2)
goto _114
}
*(**int8)(unsafe.Pointer(&(_35_pX.X2))) = _sqlite3MPrintf(tls, _db, str(48391), unsafe.Pointer(_21_zSchemaName), unsafe.Pointer(_21_zTabName), unsafe.Pointer(_25_zColname))
_114:
storebits3((*int8)(unsafe.Pointer(&(_35_pX.X4))), int8(i32(1)), 2, 1)
_112:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_25_zToFree))
_91:
_j += 1
goto _90
_93:
_79:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
goto _78
_81:
if _19_tableSeen != 0 {
goto _115
}
if _19_zTName != nil {
_sqlite3ErrorMsg(tls, _pParse, str(48400), unsafe.Pointer(_19_zTName))
goto _117
}
_sqlite3ErrorMsg(tls, _pParse, str(48418))
_117:
_115:
_72:
_k += 1
goto _61
_64:
_sqlite3ExprListDelete(tls, _db, _pEList)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _15_pNew
_59:
if ((*XExprList)(_p.X0) != nil) && (((*XExprList)(_p.X0).X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2)))))) {
_sqlite3ErrorMsg(tls, _pParse, str(48438))
return i32(2)
}
return i32(0)
_ = _25_sColname
panic(0)
}
var _selectExpanderØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_selectExpanderØ00__func__Ø000[0], str(48469), 15)
}
// The code generator maintains a stack of active WITH clauses
// with the inner-most WITH clause being at the top of the stack.
//
// This routine pushes the WITH clause passed as the second argument
// onto the top of the stack. If argument bFree is true, then this
// WITH clause will never be popped from the stack. In this case it
// should be freed along with the Parse object. In other cases, when
// bFree==0, the With object will be freed along with the SELECT
// statement with which it is associated.
func _sqlite3WithPush(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _bFree uint8) {
func() {
if int32(_bFree) != i32(0) && ((*XWith)(_pParse.X70) != nil || (*XWith)(_pParse.X71) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120664), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000))), unsafe.Pointer(str(48484)))
crt.X__builtin_abort(tls)
}
}()
if _pWith == nil {
goto _4
}
func() {
if (*XWith)(_pParse.X70) == _pWith {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WithPushØ00__func__Ø000))), unsafe.Pointer(str(48541)))
crt.X__builtin_abort(tls)
}
}()
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWith.X1))))) = (*XWith)(_pParse.X70)
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith
if _bFree != 0 {
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X71))))) = _pWith
}
_4:
}
var _sqlite3WithPushØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WithPushØ00__func__Ø000[0], str(48562), 16)
}
// Assign VdbeCursor index numbers to all tables in a SrcList
func _sqlite3SrcListAssignCursors(tls *crt.TLS, _pParse *XParse, _pList *XSrcList) {
var _i int32
var _pItem *TSrcList_item
func() {
if _pList == nil && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103482), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListAssignCursorsØ00__func__Ø000))), unsafe.Pointer(str(48578)))
crt.X__builtin_abort(tls)
}
}()
if _pList == nil {
goto _3
}
*func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2)))))
_4:
if _i >= (_pList.X0) {
goto _7
}
if (_pItem.X11) >= i32(0) {
goto _7
}
*(*int32)(unsafe.Pointer(&(_pItem.X11))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
if (*XSelect)(_pItem.X5) != nil {
_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)((*XSelect)(_pItem.X5).X8))
}
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
goto _4
_7:
_3:
}
var _sqlite3SrcListAssignCursorsØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListAssignCursorsØ00__func__Ø000[0], str(48612), 28)
}
// This function checks if argument pFrom refers to a CTE declared by
// a WITH clause on the stack currently maintained by the parser. And,
// if currently processing a CTE expression, if it is a recursive
// reference to the current CTE.
//
// If pFrom falls into either of the two categories above, pFrom->pTab
// and other fields are populated accordingly. The caller should check
// (pFrom->pTab!=0) to determine whether or not a successful match
// was found.
//
// Whether or not a match is found, SQLITE_OK is returned if no error
// occurs. If an error does occur, an error message is stored in the
// parser and some error code other than SQLITE_OK returned.
func _withExpand(tls *crt.TLS, _pWalker *XWalker, _pFrom *TSrcList_item) (r0 int32) {
var _1_bMayRecursive, _3_i int32
var _db *Xsqlite3
var _1_pTab *XTable
var _3_pSrc *XSrcList
var _4_pItem *TSrcList_item
var _pWith, _1_pSavedWith *XWith
var _pCte *TCte
var _1_pEList *XExprList
var _1_pSel, _1_pLeft, _7_pPrior *XSelect
var _pParse *XParse
_pParse = (*XParse)(_pWalker.X0)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (*XTable)(_pFrom.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120697), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48091)))
crt.X__builtin_abort(tls)
}
}()
_pCte = _searchWith(tls, (*XWith)(_pParse.X70), _pFrom, &_pWith)
if _pCte == nil {
goto _2
}
if (_pCte.X3) != nil {
_sqlite3ErrorMsg(tls, _pParse, _pCte.X3, unsafe.Pointer(_pCte.X0))
return i32(1)
}
if _cannotBeFunction(tls, _pParse, _pFrom) != 0 {
return i32(1)
}
func() {
if (*XTable)(_pFrom.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120718), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48091)))
crt.X__builtin_abort(tls)
}
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X4))))) = store44(&_1_pTab, (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80)))))
if _1_pTab == nil {
return i32(2)
}
*(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) = uint32(i32(1))
*(**int8)(unsafe.Pointer(&(_1_pTab.X0))) = _sqlite3DbStrDup(tls, _db, _pCte.X0)
*(*int16)(unsafe.Pointer(&(_1_pTab.X10))) = int16(i32(-1))
*(*int16)(unsafe.Pointer(&(_1_pTab.X12))) = int16(i32(200))
func() {
if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120724), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48127)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_1_pTab.X9)))
*p = (*p) | uint32(i32(66))
sink5 = *p
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_pCte.X2), i32(0))
if (_db.X17) != 0 {
return _sqlite3NomemError(tls, i32(120727))
}
func() {
if (*XSelect)(_pFrom.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120728), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48640)))
crt.X__builtin_abort(tls)
}
}()
_1_pSel = (*XSelect)(_pFrom.X5)
_1_bMayRecursive = bool2int((int32(_1_pSel.X1) == i32(116)) || (int32(_1_pSel.X1) == i32(115)))
if _1_bMayRecursive == 0 {
goto _14
}
_3_pSrc = (*XSrcList)((*XSelect)(_pFrom.X5).X8)
_3_i = i32(0)
_15:
if _3_i >= (_3_pSrc.X0) {
goto _18
}
_4_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pSrc.X2))))) + 68*uintptr(_3_i)))
if (((_4_pItem.X1) == nil) && ((_4_pItem.X2) != nil)) && (i32(0) == _sqlite3StrICmp(tls, _4_pItem.X2, _pCte.X0)) {
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pItem.X4))))) = _1_pTab
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_4_pItem.X9))).X1))), int8(i32(1)), 32, 5)
*(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) += 1
{
p := (*uint32)(unsafe.Pointer(&(_1_pSel.X3)))
*p = (*p) | uint32(i32(8192))
sink5 = *p
}
}
_3_i += 1
goto _15
_18:
_14:
if (_1_pTab.X8) > uint32(i32(2)) {
_sqlite3ErrorMsg(tls, _pParse, str(48655), unsafe.Pointer(_pCte.X0))
return i32(1)
}
func() {
if (_1_pTab.X8) != uint32(i32(1)) && (((_1_pSel.X3)&uint32(i32(8192))) == 0 || (_1_pTab.X8) != uint32(i32(2))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120757), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48698)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48771)
_1_pSavedWith = (*XWith)(_pParse.X70)
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith
if _1_bMayRecursive != 0 {
_7_pPrior = (*XSelect)(_1_pSel.X13)
func() {
if (*XWith)(_7_pPrior.X17) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120764), unsafe.Pointer((*int8)(unsafe.Pointer(&_withExpandØ00__func__Ø000))), unsafe.Pointer(str(48794)))
crt.X__builtin_abort(tls)
}
}()
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_pPrior.X17))))) = (*XWith)(_1_pSel.X17)
_sqlite3WalkSelect(tls, _pWalker, _7_pPrior)
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_pPrior.X17))))) = nil
goto _30
}
_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
_30:
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _pWith
_1_pLeft = _1_pSel
_31:
if (*XSelect)(_1_pLeft.X13) == nil {
goto _34
}
_1_pLeft = (*XSelect)(_1_pLeft.X13)
goto _31
_34:
_1_pEList = (*XExprList)(_1_pLeft.X0)
if (*XExprList)(_pCte.X1) == nil {
goto _35
}
if (_1_pEList != nil) && ((_1_pEList.X0) != ((*XExprList)(_pCte.X1).X0)) {
_sqlite3ErrorMsg(tls, _pParse, str(48811), unsafe.Pointer(_pCte.X0), _1_pEList.X0, (*XExprList)(_pCte.X1).X0)
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _1_pSavedWith
return i32(1)
}
_1_pEList = (*XExprList)(_pCte.X1)
_35:
_sqlite3ColumnsFromExprList(tls, _pParse, _1_pEList, (*int16)(unsafe.Pointer(&(_1_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pTab.X1))))))
if _1_bMayRecursive == 0 {
goto _38
}
if ((_1_pSel.X3) & uint32(i32(8192))) != 0 {
*(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48849)
goto _40
}
*(**int8)(unsafe.Pointer(&(_pCte.X3))) = str(48883)
_40:
_sqlite3WalkSelect(tls, _pWalker, _1_pSel)
_38:
*(**int8)(unsafe.Pointer(&(_pCte.X3))) = nil
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = _1_pSavedWith
_2:
return i32(0)
}
var _withExpandØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_withExpandØ00__func__Ø000[0], str(48921), 11)
}
// Argument pWith (which may be NULL) points to a linked list of nested
// WITH contexts, from inner to outermost. If the table identified by
// FROM clause element pItem is really a common-table-expression (CTE)
// then return a pointer to the CTE definition for that table. Otherwise
// return NULL.
//
// If a non-NULL value is returned, set *ppContext to point to the With
// object that the returned CTE belongs to.
func _searchWith(tls *crt.TLS, _pWith *XWith, _pItem *TSrcList_item, _ppContext **XWith) (r0 *TCte) {
var _2_i int32
var _zName *int8
var _1_p *XWith
if (_pItem.X1) != nil || store0(&_zName, _pItem.X2) == nil {
goto _1
}
_1_p = _pWith
_2:
if _1_p == nil {
goto _5
}
_2_i = i32(0)
_6:
if _2_i >= (_1_p.X0) {
goto _9
}
if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_1_p.X2)))))+16*uintptr(_2_i))).X0) == i32(0) {
*_ppContext = _1_p
return (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_1_p.X2))))) + 16*uintptr(_2_i)))
}
_2_i += 1
goto _6
_9:
_1_p = (*XWith)(_1_p.X1)
goto _2
_5:
_1:
return nil
}
// Check to see if the FROM clause term pFrom has table-valued function
// arguments. If it does, leave an error message in pParse and return
// non-zero, since pFrom is not allowed to be a table-valued function.
func _cannotBeFunction(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
if ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(48932), unsafe.Pointer(_pFrom.X2))
return i32(1)
}
return i32(0)
}
// Convert an integer into a LogEst. In other words, compute an
// approximation for 10*log2(x).
func _sqlite3LogEst(tls *crt.TLS, _x uint64) (r0 int16) {
var _y int16
_y = i16(40)
if _x >= uint64(i32(8)) {
goto _0
}
if _x < uint64(i32(2)) {
return int16(i32(0))
}
_1:
if _x < uint64(i32(8)) {
{
p := &_y
*p = int16(int32(*p) - i32(10))
sink18 = *p
}
{
p := &_x
*p = (*p) << uint(i32(1))
sink17 = *p
}
goto _1
}
goto _4
_0:
_5:
if _x > uint64(i32(255)) {
{
p := &_y
*p = int16(int32(*p) + i32(40))
sink18 = *p
}
{
p := &_x
*p = (*p) >> uint(i32(4))
sink17 = *p
}
goto _5
}
_6:
if _x > uint64(i32(15)) {
{
p := &_y
*p = int16(int32(*p) + i32(10))
sink18 = *p
}
{
p := &_x
*p = (*p) >> uint(i32(1))
sink17 = *p
}
goto _6
}
_4:
return int16((int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstØ00aØ001)) + 2*uintptr(_x&uint64(i32(7)))))) + int32(_y)) - i32(10))
}
var _sqlite3LogEstØ00aØ001 [8]int16
func init() {
_sqlite3LogEstØ00aØ001 = [8]int16{i16(0), i16(2), i16(3), i16(5), i16(6), i16(7), i16(8), i16(9)}
}
func _sqlite3SelectDup(tls *crt.TLS, _db *Xsqlite3, _pDup *XSelect, _flags int32) (r0 *XSelect) {
var _pRet, _pNext, _p, _1_pNew *XSelect
var _pp **XSelect
_pRet = nil
_pNext = nil
_pp = &_pRet
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92317), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
_p = _pDup
_2:
if _p == nil {
goto _5
}
_1_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(80))))
if _1_pNew == nil {
goto _5
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X0))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X0), _flags)
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X8))))) = _sqlite3SrcListDup(tls, _db, (*XSrcList)(_p.X8), _flags)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X9))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X9), _flags)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X10))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X10), _flags)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X11))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X11), _flags)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X12))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_p.X12), _flags)
*(*uint8)(unsafe.Pointer(&(_1_pNew.X1))) = _p.X1
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X14))))) = _pNext
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X13))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X15))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X15), _flags)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X16))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X16), _flags)
*(*int32)(unsafe.Pointer(&(_1_pNew.X4))) = i32(0)
*(*int32)(unsafe.Pointer(&(_1_pNew.X5))) = i32(0)
*(*uint32)(unsafe.Pointer(&(_1_pNew.X3))) = (_p.X3) & uint32(i32(-33))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_1_pNew.X7))))) + 4*uintptr(i32(0)))) = i32(-1)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_1_pNew.X7))))) + 4*uintptr(i32(1)))) = i32(-1)
*(*int16)(unsafe.Pointer(&(_1_pNew.X2))) = _p.X2
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X17))))) = _withDup(tls, _db, (*XWith)(_p.X17))
_sqlite3SelectSetName(tls, _1_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6))))))
*_pp = _1_pNew
_pp = (**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X13)))))
_pNext = _1_pNew
_p = (*XSelect)(_p.X13)
goto _2
_5:
return _pRet
}
var _sqlite3SelectDupØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SelectDupØ00__func__Ø000[0], str(48955), 17)
}
func _sqlite3ExprListDup(tls *crt.TLS, _db *Xsqlite3, _p *XExprList, _flags int32) (r0 *XExprList) {
var _i int32
var _pNew *XExprList
var _pItem, _pOldItem *TExprList_item
var _pPriorSelectCol, _1_pOldExpr, _1_pNewExpr *XExpr
_pPriorSelectCol = nil
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92200), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return nil
}
_pNew = (*XExprList)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(28)+(u32(20)*uint32((_p.X0)-i32(1))))))
if _pNew == nil {
return nil
}
*(*int32)(unsafe.Pointer(&(_pNew.X1))) = store1((*int32)(unsafe.Pointer(&(_pNew.X0))), _p.X0)
_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pNew.X2)))))
_pOldItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))
_i = i32(0)
_4:
if _i >= (_p.X0) {
goto _7
}
_1_pOldExpr = (*XExpr)(_pOldItem.X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = _sqlite3ExprDup(tls, _db, _1_pOldExpr, _flags)
if _1_pOldExpr == nil || int32(_1_pOldExpr.X0) != i32(159) || store36(&_1_pNewExpr, (*XExpr)(_pItem.X0)) == nil {
goto _10
}
func() {
if int32(_1_pNewExpr.X9) != i32(0) && _i <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92216), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(48972)))
crt.X__builtin_abort(tls)
}
}()
if int32(_1_pNewExpr.X9) == i32(0) {
func() {
if (*XExpr)(_1_pOldExpr.X4) != (*XExpr)(_1_pOldExpr.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92218), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49000)))
crt.X__builtin_abort(tls)
}
}()
_pPriorSelectCol = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewExpr.X4))))), (*XExpr)(_1_pNewExpr.X5))
goto _17
}
func() {
if _i <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(12970)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+20*uintptr(i32(-1)))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49034)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_1_pNewExpr.X9) != (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+20*uintptr(i32(-1)))).X0).X9) + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49053)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pPriorSelectCol != (*XExpr)((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem))+20*uintptr(i32(-1)))).X0).X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListDupØ00__func__Ø000))), unsafe.Pointer(str(49099)))
crt.X__builtin_abort(tls)
}
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewExpr.X4))))) = _pPriorSelectCol
_17:
_10:
*(**int8)(unsafe.Pointer(&(_pItem.X1))) = _sqlite3DbStrDup(tls, _db, _pOldItem.X1)
*(**int8)(unsafe.Pointer(&(_pItem.X2))) = _sqlite3DbStrDup(tls, _db, _pOldItem.X2)
*(*uint8)(unsafe.Pointer(&(_pItem.X3))) = _pOldItem.X3
storebits3((*int8)(unsafe.Pointer(&(_pItem.X4))), int8(i32(0)), 1, 0)
storebits3((*int8)(unsafe.Pointer(&(_pItem.X4))), int8((uint32((_pOldItem.X4)>>uint(i32(1)))<>uint(i32(31))), 2, 1)
*(*t37)(unsafe.Pointer(&(_pItem.X5))) = _pOldItem.X5
*(*uintptr)(unsafe.Pointer(func() **TExprList_item {
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
return &_pOldItem
}())) += uintptr(20)
goto _4
_7:
return _pNew
}
var _sqlite3ExprListDupØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListDupØ00__func__Ø000[0], str(49139), 19)
}
// 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 _sqlite3ExprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _flags int32) (r0 *XExpr) {
func() {
if _flags != i32(0) && _flags != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92192), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprDupØ00__func__Ø000))), unsafe.Pointer(str(49158)))
crt.X__builtin_abort(tls)
}
}()
return func() *XExpr {
if _p != nil {
return _exprDup(tls, _db, _p, _flags, nil)
}
return nil
}()
}
var _sqlite3ExprDupØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprDupØ00__func__Ø000[0], str(49192), 15)
}
// This function is similar to sqlite3ExprDup(), except that if pzBuffer
// is not NULL then *pzBuffer is assumed to point to a buffer large enough
// to store the copy of expression p, the copies of p->u.zToken
// (if applicable), and the copies of the p->pLeft and p->pRight expressions,
// if any. Before returning, *pzBuffer is set to the first byte past the
// portion of the buffer copied into by this function.
func _exprDup(tls *crt.TLS, _db *Xsqlite3, _p *XExpr, _dupFlags int32, _pzBuffer **uint8) (r0 *XExpr) {
var _3_nNewSize, _3_nToken int32
var _staticFlag, _3_nStructSize, _7_nSize uint32
var _9_zToken *int8
var _zAlloc *uint8
var _pNew *XExpr
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92059), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92060), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(9660)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _dupFlags != i32(0) && _dupFlags != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92061), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49207)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pzBuffer != nil && _dupFlags != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92062), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49247)))
crt.X__builtin_abort(tls)
}
}()
if _pzBuffer != nil {
_zAlloc = *_pzBuffer
_staticFlag = uint32(i32(32768))
goto _11
}
_zAlloc = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_dupedExprSize(tls, _p, _dupFlags))))
_staticFlag = uint32(i32(0))
_11:
_pNew = (*XExpr)(unsafe.Pointer(_zAlloc))
if _pNew == nil {
goto _12
}
_3_nStructSize = uint32(_dupedExprStructSize(tls, _p, _dupFlags))
_3_nNewSize = int32(_3_nStructSize & uint32(i32(4095)))
if (((_p.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) != nil) {
_3_nToken = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + i32(1)
goto _15
}
_3_nToken = i32(0)
_15:
if _dupFlags != 0 {
func() {
if bool2int(((_p.X2)&uint32(i32(8192))) != uint32(i32(0))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92089), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49287)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_zAlloc), (unsafe.Pointer)(_p), uint32(_3_nNewSize))
goto _19
}
_7_nSize = uint32(_exprStructSize(tls, _p))
crt.Xmemcpy(tls, (unsafe.Pointer)(_zAlloc), (unsafe.Pointer)(_p), _7_nSize)
if _7_nSize < u32(48) {
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAlloc))+1*uintptr(_7_nSize)))), i32(0), u32(48)-_7_nSize)
}
_19:
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X2)))
*p = (*p) & uint32(i32(-122881))
sink5 = *p
}
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X2)))
*p = (*p) | (_3_nStructSize & uint32(i32(24576)))
sink5 = *p
}
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X2)))
*p = (*p) | _staticFlag
sink5 = *p
}
if _3_nToken != 0 {
_9_zToken = store0((**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pNew.X3))))), (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAlloc))+1*uintptr(_3_nNewSize))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_9_zToken), (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), uint32(_3_nToken))
}
if uint32(i32(0)) != (((_p.X2) | (_pNew.X2)) & uint32(i32(8404992))) {
goto _22
}
if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), _dupFlags)
goto _24
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), _dupFlags)
_24:
_22:
if ((_pNew.X2) & uint32(i32(24576))) == uint32(i32(0)) {
goto _25
}
{
p := &_zAlloc
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_dupedExprNodeSize(tls, _p, _dupFlags))))
sink13 = *p
}
if ((_pNew.X2) & uint32(i32(8404992))) == uint32(i32(0)) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = func() *XExpr {
if (*XExpr)(_p.X4) != nil {
return _exprDup(tls, _db, (*XExpr)(_p.X4), i32(1), &_zAlloc)
}
return nil
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X5))))) = func() *XExpr {
if (*XExpr)(_p.X5) != nil {
return _exprDup(tls, _db, (*XExpr)(_p.X5), i32(1), &_zAlloc)
}
return nil
}()
}
if _pzBuffer != nil {
*_pzBuffer = _zAlloc
}
goto _32
_25:
if ((_p.X2) & uint32(i32(8404992))) != uint32(i32(0)) {
goto _33
}
if int32(_pNew.X0) == i32(159) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = (*XExpr)(_p.X4)
func() {
if int32(_p.X9) != i32(0) && (*XExpr)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92135), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_p.X5) != nil && (*XExpr)(_p.X5) != (*XExpr)(_p.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92136), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprDupØ00__func__Ø000))), unsafe.Pointer(str(49351)))
crt.X__builtin_abort(tls)
}
}()
goto _41
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X4))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X4), i32(0))
_41:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X5))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_p.X5), i32(0))
_33:
_32:
_12:
return _pNew
}
var _exprDupØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_exprDupØ00__func__Ø000[0], str(49387), 8)
}
// Return the number of bytes required to create a duplicate of the
// expression passed as the first argument. The second argument is a
// mask containing EXPRDUP_XXX flags.
//
// The value returned includes space to create a copy of the Expr struct
// itself and the buffer referred to by Expr.u.zToken, if any.
//
// If the EXPRDUP_REDUCE flag is set, then the return value includes
// space to duplicate all Expr nodes in the tree formed by Expr.pLeft
// and Expr.pRight variables (but not for any structures pointed to or
// descended from the Expr.x.pList or Expr.x.pSelect variables).
func _dupedExprSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
var _nByte int32
_nByte = i32(0)
if _p == nil {
goto _0
}
_nByte = _dupedExprNodeSize(tls, _p, _flags)
if (_flags & i32(1)) != 0 {
{
p := &_nByte
*p = (*p) + (_dupedExprSize(tls, (*XExpr)(_p.X4), _flags) + _dupedExprSize(tls, (*XExpr)(_p.X5), _flags))
sink1 = *p
}
}
_0:
return _nByte
}
// This function returns the space in bytes required to store the copy
// of the Expr structure and a copy of the Expr.u.zToken string (if that
// string is defined.)
func _dupedExprNodeSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
var _nByte int32
_nByte = _dupedExprStructSize(tls, _p, _flags) & i32(4095)
if (((_p.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) != nil) {
{
p := &_nByte
*p = (*p) + (_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))) + i32(1))
sink1 = *p
}
}
return (_nByte + i32(7)) & i32(-8)
}
// The dupedExpr*Size() routines each return the number of bytes required
// to store a copy of an expression or expression tree. They differ in
// how much of the tree is measured.
//
// dupedExprStructSize() Size of only the Expr structure
// dupedExprNodeSize() Size of Expr + space for token
// dupedExprSize() Expr + token + subtree components
//
// ***************************************************************************
//
// The dupedExprStructSize() function returns two values OR-ed together:
// (1) the space required for a copy of the Expr structure only and
// (2) the EP_xxx flags that indicate what the structure size should be.
// The return values is always one of:
//
// EXPR_FULLSIZE
// EXPR_REDUCEDSIZE | EP_Reduced
// EXPR_TOKENONLYSIZE | EP_TokenOnly
//
// The size of the structure can be found by masking the return value
// of this routine with 0xfff. The flags can be found by masking the
// return value with EP_Reduced|EP_TokenOnly.
//
// Note that with flags==EXPRDUP_REDUCE, this routines works on full-size
// (unreduced) Expr objects as they or originally constructed by the parser.
// During expression analysis, extra information is computed and moved into
// later parts of teh Expr object and that extra information might get chopped
// off if the expression is reduced. Note also that it does not work to
// make an EXPRDUP_REDUCE copy of a reduced expression. It is only legal
// to reduce a pristine expression tree from the parser. The implementation
// of dupedExprStructSize() contain multiple assert() statements that attempt
// to enforce this constraint.
func _dupedExprStructSize(tls *crt.TLS, _p *XExpr, _flags int32) (r0 int32) {
var _nSize int32
func() {
if _flags != i32(1) && _flags != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91989), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49395)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
if (i32(0) == _flags) || (int32(_p.X0) == i32(159)) {
_nSize = int32(u32(48))
goto _5
}
func() {
if ((_p.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91995), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49429)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X2) & uint32(i32(1))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91996), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49474)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X2) & uint32(i32(65536))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91997), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49507)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X2) & uint32(i32(131072))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91998), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(49540)))
crt.X__builtin_abort(tls)
}
}()
if ((*XExpr)(_p.X4) != nil) || ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil) {
_nSize = int32(u32(8220))
goto _16
}
func() {
if (*XExpr)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92002), unsafe.Pointer((*int8)(unsafe.Pointer(&_dupedExprStructSizeØ00__func__Ø000))), unsafe.Pointer(str(21256)))
crt.X__builtin_abort(tls)
}
}()
_nSize = int32(u32(16396))
_16:
_5:
return _nSize
}
var _dupedExprStructSizeØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_dupedExprStructSizeØ00__func__Ø000[0], str(49573), 20)
}
// Return the number of bytes allocated for the expression structure
// passed as the first argument. This is always one of EXPR_FULLSIZE,
// EXPR_REDUCEDSIZE or EXPR_TOKENONLYSIZE.
func _exprStructSize(tls *crt.TLS, _p *XExpr) (r0 int32) {
if ((_p.X2) & uint32(i32(16384))) != uint32(i32(0)) {
return int32(u32(12))
}
if ((_p.X2) & uint32(i32(8192))) != uint32(i32(0)) {
return int32(u32(28))
}
return int32(u32(48))
}
func _sqlite3SrcListDup(tls *crt.TLS, _db *Xsqlite3, _p *XSrcList, _flags int32) (r0 *XSrcList) {
var _i, _nByte int32
var _1_pTab *XTable
var _pNew *XSrcList
var _1_pNewItem, _1_pOldItem *TSrcList_item
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92250), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return nil
}
_nByte = int32(u32(76) + func() uint32 {
if (_p.X0) > i32(0) {
return (u32(68) * uint32((_p.X0)-i32(1)))
}
return uint32(i32(0))
}())
_pNew = (*XSrcList)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nByte)))
if _pNew == nil {
return nil
}
*(*int32)(unsafe.Pointer(&(_pNew.X0))) = int32(store5((*uint32)(unsafe.Pointer(&(_pNew.X1))), uint32(_p.X0)))
_i = i32(0)
_6:
if _i >= (_p.X0) {
goto _9
}
_1_pNewItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pNew.X2))))) + 68*uintptr(_i)))
_1_pOldItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr(_i)))
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X0))))) = (*XSchema)(_1_pOldItem.X0)
*(**int8)(unsafe.Pointer(&(_1_pNewItem.X1))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X1)
*(**int8)(unsafe.Pointer(&(_1_pNewItem.X2))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X2)
*(**int8)(unsafe.Pointer(&(_1_pNewItem.X3))) = _sqlite3DbStrDup(tls, _db, _1_pOldItem.X3)
*(*t28)(unsafe.Pointer(&(_1_pNewItem.X9))) = _1_pOldItem.X9
*(*int32)(unsafe.Pointer(&(_1_pNewItem.X11))) = _1_pOldItem.X11
*(*int32)(unsafe.Pointer(&(_1_pNewItem.X6))) = _1_pOldItem.X6
*(*int32)(unsafe.Pointer(&(_1_pNewItem.X7))) = _1_pOldItem.X7
if ((uint32(((*t28)(unsafe.Pointer(&(_1_pNewItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pNewItem.X15))))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pOldItem.X15))))))
}
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X16))))) = (*XIndex)(_1_pOldItem.X16)
if ((uint32(((*t28)(unsafe.Pointer(&(_1_pNewItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pNewItem.X15))))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pOldItem.X15)))))), _flags)
}
_1_pTab = store44((**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X4))))), (*XTable)(_1_pOldItem.X4))
if _1_pTab != nil {
*(*uint32)(unsafe.Pointer(&(_1_pTab.X8))) += 1
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X5))))) = _sqlite3SelectDup(tls, _db, (*XSelect)(_1_pOldItem.X5), _flags)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X12))))) = _sqlite3ExprDup(tls, _db, (*XExpr)(_1_pOldItem.X12), _flags)
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNewItem.X13))))) = _sqlite3IdListDup(tls, _db, (*XIdList)(_1_pOldItem.X13))
*(*uint64)(unsafe.Pointer(&(_1_pNewItem.X14))) = _1_pOldItem.X14
_i += 1
goto _6
_9:
return _pNew
}
var _sqlite3SrcListDupØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListDupØ00__func__Ø000[0], str(49593), 18)
}
func _sqlite3IdListDup(tls *crt.TLS, _db *Xsqlite3, _p *XIdList) (r0 *XIdList) {
var _i int32
var _pNew *XIdList
var _2_pNewItem, _2_pOldItem *TIdList_item
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92290), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IdListDupØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return nil
}
_pNew = (*XIdList)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(8))))
if _pNew == nil {
return nil
}
*(*int32)(unsafe.Pointer(&(_pNew.X1))) = _p.X1
*(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = (*TIdList_item)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(_p.X1)*u32(8))))
if (*TIdList_item)(_pNew.X0) == nil {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pNew))
return nil
}
_i = i32(0)
_5:
if _i >= (_p.X1) {
goto _8
}
_2_pNewItem = (*TIdList_item)(unsafe.Pointer(uintptr(_pNew.X0) + 8*uintptr(_i)))
_2_pOldItem = (*TIdList_item)(unsafe.Pointer(uintptr(_p.X0) + 8*uintptr(_i)))
*(**int8)(unsafe.Pointer(&(_2_pNewItem.X0))) = _sqlite3DbStrDup(tls, _db, _2_pOldItem.X0)
*(*int32)(unsafe.Pointer(&(_2_pNewItem.X1))) = _2_pOldItem.X1
_i += 1
goto _5
_8:
return _pNew
}
var _sqlite3IdListDupØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3IdListDupØ00__func__Ø000[0], str(49611), 17)
}
func _withDup(tls *crt.TLS, _db *Xsqlite3, _p *XWith) (r0 *XWith) {
var _1_nByte, _2_i int32
var _pRet *XWith
_pRet = nil
if _p == nil {
goto _0
}
_1_nByte = int32(u32(24) + (u32(16) * uint32((_p.X0)-i32(1))))
_pRet = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(_1_nByte)))
if _pRet == nil {
goto _1
}
*(*int32)(unsafe.Pointer(&(_pRet.X0))) = _p.X0
_2_i = i32(0)
_2:
if _2_i >= (_p.X0) {
goto _5
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 16*uintptr(_2_i))).X2))))) = _sqlite3SelectDup(tls, _db, (*XSelect)((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+16*uintptr(_2_i))).X2), i32(0))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 16*uintptr(_2_i))).X1))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+16*uintptr(_2_i))).X1), i32(0))
*(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pRet.X2))))) + 16*uintptr(_2_i))).X0))) = _sqlite3DbStrDup(tls, _db, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_p.X2)))))+16*uintptr(_2_i))).X0)
_2_i += 1
goto _2
_5:
_1:
_0:
return _pRet
}
// Set the name of a Select object
func _sqlite3SelectSetName(tls *crt.TLS, _p *XSelect, _zName *int8) {
if (_p != nil) && (_zName != nil) {
Xsqlite3_snprintf(tls, int32(u32(12)), (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6))))), str(24576), unsafe.Pointer(_zName))
}
}
// 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.
func _sqlite3ColumnsFromExprList(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pnCol *int16, _paCol **XColumn) (r0 int32) {
var _i, _j, _nCol, _nName, _7_iCol int32
var _cnt uint32
var _zName *int8
var _ht XHash
var _db *Xsqlite3
var _5_pTab *XTable
var _p, _5_pColExpr *XExpr
var _aCol, _pCol *XColumn
_db = (*Xsqlite3)(_pParse.X0)
_sqlite3HashInit(tls, &_ht)
if _pEList != nil {
_nCol = _pEList.X0
_aCol = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(u32(16)*uint32(_nCol))))
goto _1
}
_nCol = i32(0)
_aCol = nil
_1:
func() {
if _nCol != int32(int16(_nCol)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000))), unsafe.Pointer(str(49628)))
crt.X__builtin_abort(tls)
}
}()
*_pnCol = int16(_nCol)
*_paCol = _aCol
*func() **XColumn { _i = i32(0); return &_pCol }() = _aCol
_4:
if _i >= _nCol || (_db.X17) != 0 {
goto _8
}
_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X0))
if store0(&_zName, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X1) != nil {
goto _10
}
_5_pColExpr = _p
_11:
if int32(_5_pColExpr.X0) == i32(122) {
_5_pColExpr = (*XExpr)(_5_pColExpr.X5)
func() {
if _5_pColExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118212), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000))), unsafe.Pointer(str(49644)))
crt.X__builtin_abort(tls)
}
}()
goto _11
}
if int32(_5_pColExpr.X0) != i32(152) || (*XTable)(_5_pColExpr.X14) == nil {
goto _16
}
_7_iCol = int32(_5_pColExpr.X9)
_5_pTab = (*XTable)(_5_pColExpr.X14)
if _7_iCol < i32(0) {
_7_iCol = int32(_5_pTab.X10)
}
_zName = func() *int8 {
if _7_iCol >= i32(0) {
return ((*XColumn)(unsafe.Pointer(uintptr(_5_pTab.X1) + 16*uintptr(_7_iCol))).X0)
}
return str(27227)
}()
goto _24
_16:
if int32(_5_pColExpr.X0) == i32(27) {
func() {
if ((_5_pColExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ColumnsFromExprListØ00__func__Ø000))), unsafe.Pointer(str(49656)))
crt.X__builtin_abort(tls)
}
}()
_zName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_5_pColExpr.X3)))))
goto _24
}
_zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X2
_24:
_10:
_zName = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_zName))
_cnt = uint32(i32(0))
_25:
if _zName == nil || _sqlite3HashFind(tls, &_ht, _zName) == nil {
goto _26
}
_nName = _sqlite3Strlen30(tls, _zName)
if _nName <= i32(0) {
goto _28
}
_j = _nName - i32(1)
_29:
if _j <= i32(0) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(_j))))))))&i32(4)) == 0 {
goto _33
}
_j -= 1
goto _29
_33:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(_j)))) == i32(58) {
_nName = _j
}
_28:
_zName = _sqlite3MPrintf(tls, _db, str(49696), _nName, unsafe.Pointer(_zName), preInc5(&_cnt, uint32(1)))
if _cnt > uint32(i32(3)) {
Xsqlite3_randomness(tls, int32(u32(4)), (unsafe.Pointer)(&_cnt))
}
goto _25
_26:
*(**int8)(unsafe.Pointer(&(_pCol.X0))) = _zName
if (_zName != nil) && (_sqlite3HashInsert(tls, &_ht, _zName, (unsafe.Pointer)(_pCol)) == (unsafe.Pointer)(_pCol)) {
_sqlite3OomFault(tls, _db)
}
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
goto _4
_8:
_sqlite3HashClear(tls, &_ht)
if (_db.X17) == 0 {
goto _38
}
_j = i32(0)
_39:
if _j >= _i {
goto _42
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XColumn)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCol))+16*uintptr(_j))).X0))
_j += 1
goto _39
_42:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aCol))
*_paCol = nil
*_pnCol = int16(i32(0))
return _sqlite3NomemError(tls, i32(118257))
_38:
return i32(0)
_ = _ht
panic(0)
}
var _sqlite3ColumnsFromExprListØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ColumnsFromExprListØ00__func__Ø000[0], str(49704), 27)
}
// 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 _sqlite3LocateTableItem(tls *crt.TLS, _pParse *XParse, _flags uint32, _p *TSrcList_item) (r0 *XTable) {
var _1_iDb int32
var _zDb *int8
func() {
if (*XSchema)(_p.X0) != nil && (_p.X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100094), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LocateTableItemØ00__func__Ø000))), unsafe.Pointer(str(49731)))
crt.X__builtin_abort(tls)
}
}()
if (*XSchema)(_p.X0) != nil {
_1_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_p.X0))
_zDb = (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 16*uintptr(_1_iDb))).X0
goto _4
}
_zDb = _p.X1
_4:
return _sqlite3LocateTable(tls, _pParse, _flags, _p.X2, _zDb)
}
var _sqlite3LocateTableItemØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3LocateTableItemØ00__func__Ø000[0], str(49764), 23)
}
// 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 _sqlite3LocateTable(tls *crt.TLS, _pParse *XParse, _flags uint32, _zName *int8, _zDbase *int8) (r0 *XTable) {
var _2_zMsg *int8
var _p *XTable
var _3_pMod *XModule
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
return nil
}
_p = _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.X0), _zName, _zDbase)
if _p != nil {
goto _1
}
_2_zMsg = func() *int8 {
if (_flags & uint32(i32(1))) != 0 {
return str(49787)
}
return str(49800)
}()
if _sqlite3FindDbName(tls, (*Xsqlite3)(_pParse.X0), _zDbase) >= i32(1) {
goto _4
}
_3_pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X65))), _zName))
if (_3_pMod == nil) && (Xsqlite3_strnicmp(tls, _zName, str(49814), i32(7)) == i32(0)) {
_3_pMod = _sqlite3PragmaVtabRegister(tls, (*Xsqlite3)(_pParse.X0), _zName)
}
if (_3_pMod != nil) && _sqlite3VtabEponymousTableInit(tls, _pParse, _3_pMod) != 0 {
return (*XTable)(_3_pMod.X4)
}
_4:
if (_flags & uint32(i32(2))) != uint32(i32(0)) {
goto _9
}
if _zDbase != nil {
_sqlite3ErrorMsg(tls, _pParse, str(49822), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zDbase), unsafe.Pointer(_zName))
goto _11
}
_sqlite3ErrorMsg(tls, _pParse, str(49832), unsafe.Pointer(_2_zMsg), unsafe.Pointer(_zName))
_11:
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
_9:
_1:
return _p
}
// This routine is a no-op if the database schema is already initialized.
// Otherwise, the schema is loaded. An error code is returned.
func _sqlite3ReadSchema(tls *crt.TLS, _pParse *XParse) (r0 int32) {
var _rc int32
var _db *Xsqlite3
_rc = i32(0)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116068), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReadSchemaØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
_rc = _sqlite3Init(tls, _db, (**int8)(unsafe.Pointer(&(_pParse.X1))))
}
if _rc != i32(0) {
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc
*(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1
}
return _rc
}
var _sqlite3ReadSchemaØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ReadSchemaØ00__func__Ø000[0], str(49839), 18)
}
// 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. If the database
// file was of zero-length, then the DB_Empty flag is also set.
func _sqlite3Init(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8) (r0 int32) {
var _i, _rc, _commit_internal int32
_commit_internal = bool2int(((_db.X6) & i32(2)) == 0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116025), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsMutex(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116026), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(49857)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(49896)))
crt.X__builtin_abort(tls)
}
}()
_rc = i32(0)
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_db.X14))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4).X8
_i = i32(0)
_6:
if _rc != i32(0) || _i >= (_db.X5) {
goto _10
}
if ((int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X4).X9) & i32(1)) == i32(1)) || (_i == i32(1)) {
goto _7
}
_rc = _sqlite3InitOne(tls, _db, _i, _pzErrMsg)
if _rc != 0 {
_sqlite3ResetOneSchema(tls, _db, _i)
}
_7:
_i += 1
goto _6
_10:
func() {
if (_db.X5) <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116044), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitØ00__func__Ø000))), unsafe.Pointer(str(49913)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) || (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4).X9)&i32(1)) == i32(1) {
goto _17
}
_rc = _sqlite3InitOne(tls, _db, i32(1), _pzErrMsg)
if _rc != 0 {
_sqlite3ResetOneSchema(tls, _db, i32(1))
}
_17:
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(0))
if (_rc == i32(0)) && _commit_internal != 0 {
_sqlite3CommitInternalChanges(tls, _db)
}
return _rc
}
var _sqlite3InitØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InitØ00__func__Ø000[0], str(49923), 12)
}
// 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 _sqlite3InitOne(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _pzErrMsg **int8) (r0 int32) {
var _rc, _i, _size, _openedTransaction int32
var _zMasterName, _17_zSql *int8
var _8_encoding uint8
var _18_xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
var _pDb *XDb
var _meta [5]int32
var _azArg [4]*int8
var _initData XInitData
_openedTransaction = i32(0)
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(49935)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115816), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iDb != i32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115817), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(49956)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 4*uintptr(i32(0)))) = store0(&_zMasterName, func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}())
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 4*uintptr(i32(1)))) = str(50040)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 4*uintptr(i32(2)))) = str(50042)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azArg)) + 4*uintptr(i32(3)))) = nil
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_initData.X0))))) = _db
*(*int32)(unsafe.Pointer(&(_initData.X2))) = _iDb
*(*int32)(unsafe.Pointer(&(_initData.X3))) = i32(0)
*(***int8)(unsafe.Pointer(&(_initData.X1))) = _pzErrMsg
_sqlite3InitCallback(tls, (unsafe.Pointer)(&_initData), i32(3), (**int8)(unsafe.Pointer(&_azArg)), nil)
if (_initData.X3) != 0 {
_rc = _initData.X3
goto _error_out
}
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
if (*XBtree)(_pDb.X1) != nil {
goto _14
}
if i32(1) != 0 && func() int32 {
if _iDb == i32(1) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115843), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X4).X9)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
}
return i32(0)
_14:
_sqlite3BtreeEnter(tls, (*XBtree)(_pDb.X1))
if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.X1)) != 0 {
goto _19
}
_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_pDb.X1), i32(0))
if _rc != i32(0) {
_sqlite3SetString(tls, _pzErrMsg, _db, _sqlite3ErrStr(tls, _rc))
goto _initone_error_out
}
_openedTransaction = i32(1)
_19:
_i = i32(0)
_21:
if _i >= i32(5) {
goto _24
}
_sqlite3BtreeGetMeta(tls, (*XBtree)(_pDb.X1), _i+i32(1), (*uint32)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta))+4*uintptr(_i))))))
_i += 1
goto _21
_24:
*(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X0))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(0))))
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4))))) == 0 {
goto _25
}
if _iDb != i32(0) {
goto _26
}
_8_encoding = uint8(int32(uint8(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4)))))) & i32(3))
if int32(_8_encoding) == i32(0) {
_8_encoding = uint8(i32(1))
}
*(*uint8)(unsafe.Pointer(&(_db.X14))) = _8_encoding
goto _28
_26:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(4))))) != int32(_db.X14) {
_sqlite3SetString(tls, _pzErrMsg, _db, str(50118))
_rc = i32(1)
goto _initone_error_out
}
_28:
goto _30
_25:
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X9)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
_30:
*(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X8))) = _db.X14
if ((*XSchema)(_pDb.X4).X10) != i32(0) {
goto _31
}
_size = _sqlite3AbsInt32(tls, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(2)))))
if _size == i32(0) {
_size = i32(-2000)
}
*(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X10))) = _size
_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.X1), (*XSchema)(_pDb.X4).X10)
_31:
*(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X7))) = uint8(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(1)))))
if int32((*XSchema)(_pDb.X4).X7) == i32(0) {
*(*uint8)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X7))) = uint8(i32(1))
}
if int32((*XSchema)(_pDb.X4).X7) > i32(4) {
_sqlite3SetString(tls, _pzErrMsg, _db, str(50186))
_rc = i32(1)
goto _initone_error_out
}
if (_iDb == i32(0)) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_meta)) + 4*uintptr(i32(1))))) >= i32(4)) {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-32769)
sink1 = *p
}
}
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitOneØ00__func__Ø000))), unsafe.Pointer(str(50210)))
crt.X__builtin_abort(tls)
}
}()
_17_zSql = _sqlite3MPrintf(tls, _db, str(50224), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(_zMasterName))
_18_xAuth = _db.X59
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = nil
_rc = Xsqlite3_exec(tls, _db, _17_zSql, _sqlite3InitCallback, (unsafe.Pointer)(&_initData), nil)
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _18_xAuth
if _rc == i32(0) {
_rc = _initData.X3
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_17_zSql))
if _rc == i32(0) {
_sqlite3AnalysisLoad(tls, _db, _iDb)
}
if (_db.X17) != 0 {
_rc = _sqlite3NomemError(tls, i32(115978))
_sqlite3ResetAllSchemasOfConnection(tls, _db)
}
if (_rc == i32(0)) || ((_db.X6)&i32(65536)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X9)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
_rc = i32(0)
}
_initone_error_out:
if _openedTransaction != 0 {
_sqlite3BtreeCommit(tls, (*XBtree)(_pDb.X1))
}
_sqlite3BtreeLeave(tls, (*XBtree)(_pDb.X1))
_error_out:
if (_rc == i32(7)) || (_rc == i32(3082)) {
_sqlite3OomFault(tls, _db)
}
return _rc
_ = _azArg
_ = _meta
_ = _initData
panic(0)
}
var _sqlite3InitOneØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InitOneØ00__func__Ø000[0], str(50279), 15)
}
// 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] = name of thing being created
// argv[1] = root page number for table or index. 0 for trigger or view.
// argv[2] = SQL text for the CREATE statement.
//
func _sqlite3InitCallback(tls *crt.TLS, _pInit unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
var _iDb, _3_rc, _3_rcp int32
var _3_pStmt unsafe.Pointer
var _3_saved_iDb uint8
var _db *Xsqlite3
var _10_pIndex *XIndex
var _pData *XInitData
_pData = (*XInitData)(_pInit)
_db = (*Xsqlite3)(_pData.X0)
_iDb = _pData.X2
func() {
if _argc != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115722), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50294)))
crt.X__builtin_abort(tls)
}
}()
_ = _argc
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115724), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X9)))
*p = uint16(int32(*p) & i32(-5))
sink14 = *p
}
if (_db.X17) != 0 {
_corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), nil)
return i32(1)
}
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115731), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
if _argv == nil {
return i32(0)
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) == nil {
_corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), nil)
goto _32
}
if Xsqlite3_strnicmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))), str(50302), i32(7)) != i32(0) {
goto _11
}
_3_saved_iDb = (*t21)(unsafe.Pointer(&(_db.X33))).X1
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50210)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(_iDb)
*(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X0))) = _sqlite3Atoi(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X3))) = uint8(i32(0))
_3_rcp = Xsqlite3_prepare(tls, _db, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))), i32(-1), &_3_pStmt, nil)
_3_rc = _db.X10
func() {
if (_3_rc & i32(255)) != (_3_rcp & i32(255)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115752), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50310)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = _3_saved_iDb
func() {
if int32(_3_saved_iDb) != i32(0) && ((_db.X6)&i32(268435456)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50332)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == _3_rc {
goto _19
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X3) != 0 {
func() {
if _iDb != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115757), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InitCallbackØ00__func__Ø000))), unsafe.Pointer(str(50379)))
crt.X__builtin_abort(tls)
}
}()
goto _23
}
*(*int32)(unsafe.Pointer(&(_pData.X3))) = _3_rc
if _3_rc == i32(7) {
_sqlite3OomFault(tls, _db)
goto _27
}
if (_3_rc != i32(9)) && ((_3_rc & i32(255)) != i32(6)) {
_corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), Xsqlite3_errmsg(tls, _db))
}
_27:
_23:
_19:
Xsqlite3_finalize(tls, _3_pStmt)
goto _32
_11:
if ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == nil) || (((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))) != nil) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))))) + 1*uintptr(i32(0))))) != i32(0))) {
_corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), nil)
goto _32
}
_10_pIndex = _sqlite3FindIndex(tls, _db, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
if _10_pIndex == nil {
goto _35
}
if _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))), (*int32)(unsafe.Pointer(&(_10_pIndex.X11)))) == i32(0) {
_corruptSchema(tls, _pData, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), str(50386))
}
_35:
_32:
return i32(0)
}
var _sqlite3InitCallbackØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InitCallbackØ00__func__Ø000[0], str(50403), 20)
}
// Fill the InitData structure with an error message that indicates
// that the database is corrupt.
func _corruptSchema(tls *crt.TLS, _pData *XInitData, _zObj *int8, _zExtra *int8) {
var _1_z *int8
var _db *Xsqlite3
_db = (*Xsqlite3)(_pData.X0)
if (_db.X17) != 0 || ((_db.X6)&i32(65536)) != i32(0) {
goto _1
}
if _zObj == nil {
_zObj = str(50423)
}
_1_z = _sqlite3MPrintf(tls, _db, str(50425), unsafe.Pointer(_zObj))
if _zExtra != nil {
_1_z = _sqlite3MPrintf(tls, _db, str(50456), unsafe.Pointer(_1_z), unsafe.Pointer(_zExtra))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(_pData.X1)))
*(_pData.X1) = _1_z
_1:
*(*int32)(unsafe.Pointer(&(_pData.X3))) = func() int32 {
if (_db.X17) != 0 {
return _sqlite3NomemError(tls, i32(115702))
}
return _sqlite3CorruptError(tls, i32(115702))
}()
}
// Return a 32-bit integer value extracted from a string. If the
// string is not an integer, just return 0.
func _sqlite3Atoi(tls *crt.TLS, _z *int8) (r0 int32) {
var _x int32
_x = i32(0)
if _z != nil {
_sqlite3GetInt32(tls, _z, &_x)
}
return _x
}
// Two versions of the official API. Legacy and new use. In the legacy
// version, the original SQL text is not saved in the prepared statement
// and so if a schema change occurs, SQLITE_SCHEMA is returned by
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
func Xsqlite3_prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
var _rc int32
_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, i32(0), nil, _ppStmt, _pzTail)
func() {
if _rc != i32(0) && _ppStmt != nil && *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116414), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_prepareØ00__func__Ø000))), unsafe.Pointer(str(50464)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
func _sqlite3LockAndPrepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pOld *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
var _rc int32
if _ppStmt == nil {
return _sqlite3MisuseError(tls, i32(116341))
}
*_ppStmt = nil
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
return _sqlite3MisuseError(tls, i32(116345))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_sqlite3BtreeEnterAll(tls, _db)
_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
if _rc == i32(17) {
Xsqlite3_finalize(tls, *_ppStmt)
_rc = _sqlite3Prepare(tls, _db, _zSql, _nBytes, _saveSqlFlag, _pOld, _ppStmt, _pzTail)
}
_sqlite3BtreeLeaveAll(tls, _db)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
func() {
if _rc != i32(0) && *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116356), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3LockAndPrepareØ00__func__Ø000))), unsafe.Pointer(str(50505)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
// Compile the UTF-8 encoded SQL statement zSql into a statement handle.
func _sqlite3Prepare(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _saveSqlFlag int32, _pReprepare *TVdbe, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
var _rc, _i, _4_mxLen, _12_iFirst, _12_mx int32
var _zErrMsg, _3_zDb, _4_zSqlCopy *int8
var _1_pBt *XBtree
var _16_pVdbe *TVdbe
var _sParse XParse
var _21_pT *XTriggerPrg
_zErrMsg = nil
_rc = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_sParse), i32(0), u32(160))
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(&_sParse))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(400))))))))), i32(0), u32(84))
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X61))))) = _pReprepare
func() {
if _ppStmt == nil || *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116195), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50533)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_5:
if _i >= (_db.X5) {
goto _8
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_pBt == nil {
goto _9
}
func() {
if _sqlite3BtreeHoldsMutex(tls, _1_pBt) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116225), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50554)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeSchemaLocked(tls, _1_pBt)
if _rc != 0 {
_3_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X0
_sqlite3ErrorWithMsg(tls, _db, _rc, str(50582), unsafe.Pointer(_3_zDb))
goto _end_prepare
}
_9:
_i += 1
goto _5
_8:
_sqlite3VtabUnlockList(tls, _db)
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X0))))) = _db
if _nBytes < i32(0) || _nBytes != i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_nBytes-i32(1))))) == i32(0) {
goto _15
}
_4_mxLen = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(1))))
if _nBytes > _4_mxLen {
_sqlite3ErrorWithMsg(tls, _db, i32(18), str(50612))
_rc = _sqlite3ApiExit(tls, _db, i32(18))
goto _end_prepare
}
_4_zSqlCopy = _sqlite3DbStrNDup(tls, _db, _zSql, uint64(_nBytes))
if _4_zSqlCopy != nil {
_sqlite3RunParser(tls, &_sParse, _4_zSqlCopy, &_zErrMsg)
*(**int8)(unsafe.Pointer(&(_sParse.X62))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(int32((uintptr(unsafe.Pointer(_sParse.X62))-uintptr(unsafe.Pointer(_4_zSqlCopy)))/1))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_4_zSqlCopy))
goto _18
}
*(**int8)(unsafe.Pointer(&(_sParse.X62))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(_nBytes)))
_18:
goto _19
_15:
_sqlite3RunParser(tls, &_sParse, _zSql, &_zErrMsg)
_19:
func() {
if uint32(i32(0)) != (_sParse.X42) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116260), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50631)))
crt.X__builtin_abort(tls)
}
}()
if (_sParse.X3) == i32(101) {
*(*int32)(unsafe.Pointer(&(_sParse.X3))) = i32(0)
}
if (_sParse.X5) != 0 {
_schemaIsValid(tls, &_sParse)
}
if (_db.X17) != 0 {
*(*int32)(unsafe.Pointer(&(_sParse.X3))) = _sqlite3NomemError(tls, i32(116267))
}
if _pzTail != nil {
*_pzTail = _sParse.X62
}
_rc = _sParse.X3
if _rc != i32(0) || (*TVdbe)(_sParse.X2) == nil || (_sParse.X54) == 0 {
goto _28
}
if int32(_sParse.X54) == i32(2) {
_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.X2), i32(4))
_12_iFirst = i32(8)
_12_mx = i32(12)
goto _30
}
_sqlite3VdbeSetNumCols(tls, (*TVdbe)(_sParse.X2), i32(8))
_12_iFirst = i32(0)
_12_mx = i32(8)
_30:
_i = _12_iFirst
_31:
if _i >= _12_mx {
goto _34
}
_sqlite3VdbeSetColName(tls, (*TVdbe)(_sParse.X2), _i-_12_iFirst, i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PrepareØ00azColNameØ001)) + 4*uintptr(_i))), nil)
_i += 1
goto _31
_34:
_28:
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0) {
_16_pVdbe = (*TVdbe)(_sParse.X2)
_sqlite3VdbeSetSql(tls, _16_pVdbe, _zSql, int32((uintptr(unsafe.Pointer(_sParse.X62))-uintptr(unsafe.Pointer(_zSql)))/1), _saveSqlFlag)
}
if ((*TVdbe)(_sParse.X2) != nil) && ((_rc != i32(0)) || ((_db.X17) != 0)) {
_sqlite3VdbeFinalize(tls, (*TVdbe)(_sParse.X2))
func() {
if (*_ppStmt) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116303), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(50652)))
crt.X__builtin_abort(tls)
}
}()
goto _41
}
*_ppStmt = _sParse.X2
_41:
if _zErrMsg != nil {
_sqlite3ErrorWithMsg(tls, _db, _rc, str(24576), unsafe.Pointer(_zErrMsg))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg))
goto _43
}
_sqlite3Error(tls, _db, _rc)
_43:
if (*XTriggerPrg)(_sParse.X69) != nil {
_21_pT = (*XTriggerPrg)(_sParse.X69)
*(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sParse.X69))))) = (*XTriggerPrg)(_21_pT.X1)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_21_pT))
goto _43
}
_end_prepare:
_sqlite3ParserReset(tls, &_sParse)
_rc = _sqlite3ApiExit(tls, _db, _rc)
func() {
if (_rc & (_db.X11)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116326), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PrepareØ00__func__Ø000))), unsafe.Pointer(str(134)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_ = _sParse
panic(0)
}
var _sqlite3PrepareØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PrepareØ00__func__Ø000[0], str(50663), 15)
}
// Return SQLITE_LOCKED_SHAREDCACHE if another user of the same shared
// btree as the argument handle holds an exclusive lock on the
// sqlite_master table. Otherwise SQLITE_OK.
func _sqlite3BtreeSchemaLocked(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _rc int32
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68723), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_rc = _querySharedCacheTableLock(tls, _p, uint32(i32(1)), uint8(i32(1)))
func() {
if _rc != i32(0) && _rc != i32(262) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68726), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSchemaLockedØ00__func__Ø000))), unsafe.Pointer(str(50678)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeSchemaLockedØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSchemaLockedØ00__func__Ø000[0], str(50725), 25)
}
// Query to see if Btree handle p may obtain a lock of type eLock
// (READ_LOCK or WRITE_LOCK) on the table with root-page iTab. Return
// SQLITE_OK if the lock may be obtained (by calling
// setSharedCacheTableLock()), or SQLITE_LOCKED if not.
func _querySharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTab uint32, _eLock uint8) (r0 int32) {
var _pBt *XBtShared
var _pIter *XBtLock
_pBt = (*XBtShared)(_p.X1)
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59285), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eLock) != i32(1) && int32(_eLock) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59286), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50750)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59287), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(23676)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (((*Xsqlite3)(_p.X0).X6)&i32(16384)) != 0 && int32(_eLock) != i32(2) && _iTab != uint32(i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59288), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50788)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eLock) != i32(1) && (_p != (*XBtree)(_pBt.X26) || int32(_p.X2) != i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59294), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50855)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eLock) != i32(1) && int32(_pBt.X8) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59295), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50920)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) == 0 {
return i32(0)
}
if ((*XBtree)(_pBt.X26) != _p) && ((int32(_pBt.X10) & i32(32)) != i32(0)) {
return i32(262)
}
_pIter = (*XBtLock)(_pBt.X25)
_21:
if _pIter == nil {
goto _24
}
func() {
if int32(_pIter.X2) != i32(1) && int32(_pIter.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59320), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50972)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eLock) != i32(1) && (*XBtree)(_pIter.X0) != _p && int32(_pIter.X2) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59321), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(51024)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtree)(_pIter.X0) == _p || (_pIter.X1) != _iTab || int32(_pIter.X2) == int32(_eLock) {
goto _34
}
if int32(_eLock) == i32(2) {
func() {
if _p != (*XBtree)(_pBt.X26) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59325), unsafe.Pointer((*int8)(unsafe.Pointer(&_querySharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(51088)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(64))
sink14 = *p
}
}
return i32(262)
_34:
_pIter = (*XBtLock)(_pIter.X3)
goto _21
_24:
return i32(0)
}
var _querySharedCacheTableLockØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_querySharedCacheTableLockØ00__func__Ø000[0], str(51104), 26)
}
// Check schema cookies in all databases. If any cookie is out
// of date set pParse->rc to SQLITE_SCHEMA. If all schema cookies
// make no changes to pParse->rc.
func _schemaIsValid(tls *crt.TLS, _pParse *XParse) {
var _iDb, _rc, _cookie, _1_openedTransaction int32
var _db *Xsqlite3
var _1_pBt *XBtree
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (_pParse.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116091), unsafe.Pointer((*int8)(unsafe.Pointer(&_schemaIsValidØ00__func__Ø000))), unsafe.Pointer(str(51130)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116092), unsafe.Pointer((*int8)(unsafe.Pointer(&_schemaIsValidØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_iDb = i32(0)
_4:
if _iDb >= (_db.X5) {
goto _7
}
_1_openedTransaction = i32(0)
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X1)
if _1_pBt == nil {
goto _5
}
if _sqlite3BtreeIsInReadTrans(tls, _1_pBt) != 0 {
goto _9
}
_rc = _sqlite3BtreeBeginTrans(tls, _1_pBt, i32(0))
if (_rc == i32(7)) || (_rc == i32(3082)) {
_sqlite3OomFault(tls, _db)
}
if _rc != i32(0) {
return
}
_1_openedTransaction = i32(1)
_9:
_sqlite3BtreeGetMeta(tls, _1_pBt, i32(1), (*uint32)(unsafe.Pointer(&_cookie)))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116114), unsafe.Pointer((*int8)(unsafe.Pointer(&_schemaIsValidØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _cookie != ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X0) {
_sqlite3ResetOneSchema(tls, _db, _iDb)
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(17)
}
if _1_openedTransaction != 0 {
_sqlite3BtreeCommit(tls, _1_pBt)
}
_5:
_iDb += 1
goto _4
_7:
}
var _schemaIsValidØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_schemaIsValidØ00__func__Ø000[0], str(51185), 14)
}
// Return non-zero if a read (or write) transaction is active.
func _sqlite3BtreeIsInReadTrans(tls *crt.TLS, _p *XBtree) (r0 int32) {
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000))), unsafe.Pointer(str(9660)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68675), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIsInReadTransØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
return bool2int(int32(_p.X2) != i32(0))
}
var _sqlite3BtreeIsInReadTransØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIsInReadTransØ00__func__Ø000[0], str(51199), 26)
}
// 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 _sqlite3BtreeBeginTrans(tls *crt.TLS, _p *XBtree, _wrflag int32) (r0 int32) {
var _rc int32
var _3_pBlock *Xsqlite3
var _pBt *XBtShared
var _5_pIter *XBtLock
var _19_pPage1 *XMemPage
_pBt = (*XBtShared)(_p.X1)
_rc = i32(0)
_sqlite3BtreeEnter(tls, _p)
func() {
if int32((*XBtShared)(_p.X1).X8) == i32(0) && ((*XBtShared)(_p.X1).X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62247), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(9977)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtShared)(_p.X1).X8) < int32(_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62247), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(10038)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X2) == i32(2)) || ((int32(_p.X2) == i32(1)) && (_wrflag == 0)) {
goto _trans_begun
}
func() {
if int32(_pBt.X8) != i32(2) && int32(_pBt.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62256), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(51225)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pBt.X10) & i32(1)) != i32(0)) && _wrflag != 0 {
_rc = i32(8)
goto _trans_begun
}
_3_pBlock = nil
if (_wrflag != 0 && (int32(_pBt.X8) == i32(2))) || ((int32(_pBt.X10) & i32(64)) != i32(0)) {
_3_pBlock = (*Xsqlite3)((*XBtree)(_pBt.X26).X0)
goto _17
}
if _wrflag <= i32(1) {
goto _17
}
_5_pIter = (*XBtLock)(_pBt.X25)
_18:
if _5_pIter == nil {
goto _21
}
if (*XBtree)(_5_pIter.X0) != _p {
_3_pBlock = (*Xsqlite3)((*XBtree)(_5_pIter.X0).X0)
goto _21
}
_5_pIter = (*XBtLock)(_5_pIter.X3)
goto _18
_21:
_17:
if _3_pBlock != nil {
_rc = i32(262)
goto _trans_begun
}
_rc = _querySharedCacheTableLock(tls, _p, uint32(i32(1)), uint8(i32(1)))
if i32(0) != _rc {
goto _trans_begun
}
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-9))
sink14 = *p
}
if (_pBt.X18) == uint32(i32(0)) {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
}
_25:
_27:
if ((*XMemPage)(_pBt.X3) == nil) && (i32(0) == store1(&_rc, _lockBtree(tls, _pBt))) {
goto _27
}
if _rc != i32(0) || _wrflag == 0 {
goto _31
}
if (int32(_pBt.X10) & i32(1)) != i32(0) {
_rc = i32(8)
goto _33
}
_rc = _sqlite3PagerBegin(tls, (*XPager)(_pBt.X0), bool2int(_wrflag > i32(1)), _sqlite3TempInMemory(tls, (*Xsqlite3)(_p.X0)))
if _rc == i32(0) {
_rc = _newDatabase(tls, _pBt)
}
_33:
_31:
if _rc != i32(0) {
_unlockBtreeIfUnused(tls, _pBt)
}
if (((_rc & i32(255)) == i32(5)) && (int32(_pBt.X8) == i32(0))) && _btreeInvokeBusyHandler(tls, (unsafe.Pointer)(_pBt)) != 0 {
goto _25
}
if _rc != i32(0) {
goto _trans_begun
}
if int32(_p.X2) != i32(0) {
goto _39
}
*(*int32)(unsafe.Pointer(&(_pBt.X17))) += 1
if (_p.X3) != 0 {
func() {
if (*XBtree)((*XBtLock)(unsafe.Pointer(&(_p.X11))).X0) != _p || ((*XBtLock)(unsafe.Pointer(&(_p.X11))).X1) != uint32(i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62332), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(51293)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X2))) = uint8(i32(1))
*(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X3))))) = (*XBtLock)(_pBt.X25)
*(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25))))) = (*XBtLock)(unsafe.Pointer(&(_p.X11)))
}
_39:
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(func() int32 {
if _wrflag != 0 {
return i32(2)
}
return i32(1)
}())
if int32(_p.X2) > int32(_pBt.X8) {
*(*uint8)(unsafe.Pointer(&(_pBt.X8))) = _p.X2
}
if _wrflag == 0 {
goto _47
}
_19_pPage1 = (*XMemPage)(_pBt.X3)
func() {
if (*XBtree)(_pBt.X26) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62346), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(51332)))
crt.X__builtin_abort(tls)
}
}()
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X26))))) = _p
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-33))
sink14 = *p
}
if _wrflag > i32(1) {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(32))
sink14 = *p
}
}
if (_pBt.X18) == _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_19_pPage1.X19))+1*uintptr(i32(28))))) {
goto _51
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_19_pPage1.X23))
if _rc == i32(0) {
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_19_pPage1.X19))+1*uintptr(i32(28)))), _pBt.X18)
}
_51:
_47:
_trans_begun:
if (_rc == i32(0)) && _wrflag != 0 {
_rc = _sqlite3PagerOpenSavepoint(tls, (*XPager)(_pBt.X0), (*Xsqlite3)(_p.X0).X75)
}
func() {
if int32((*XBtShared)(_p.X1).X8) == i32(0) && ((*XBtShared)(_p.X1).X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62377), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(9977)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtShared)(_p.X1).X8) < int32(_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62377), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeBeginTransØ00__func__Ø000))), unsafe.Pointer(str(10038)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeBeginTransØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeBeginTransØ00__func__Ø000[0], str(51346), 23)
}
// Get a reference to pPage1 of the database file. This will
// also acquire a readlock on that file.
//
// SQLITE_OK is returned on success. If the file is not a
// well-formed database file, then SQLITE_CORRUPT is returned.
// SQLITE_BUSY is returned if the database is locked. SQLITE_NOMEM
// is returned if we run out of memory.
func _lockBtree(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
var _rc, _nPage, _nPageFile, _nPageHeader, _6_isOpen int32
var _2_pageSize, _2_usableSize uint32
var _2_page1 *uint8
var _pPage1 *XMemPage
_nPageFile = i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61941), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XMemPage)(_pBt.X3) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61942), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeØ00__func__Ø000))), unsafe.Pointer(str(51369)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerSharedLock(tls, (*XPager)(_pBt.X0))
if _rc != i32(0) {
return _rc
}
_rc = _btreeGetPage(tls, _pBt, uint32(i32(1)), &_pPage1, i32(0))
if _rc != i32(0) {
return _rc
}
_nPage = store1(&_nPageHeader, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(28))))))+uintptr(unsafe.Pointer(_pPage1.X19)))))))
_sqlite3PagerPagecount(tls, (*XPager)(_pBt.X0), &_nPageFile)
if (_nPage == i32(0)) || (crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(24))))))+uintptr(unsafe.Pointer(_pPage1.X19))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(92))))))+uintptr(unsafe.Pointer(_pPage1.X19))))), uint32(i32(4))) != i32(0)) {
_nPage = _nPageFile
}
if _nPage <= i32(0) {
goto _8
}
_2_page1 = _pPage1.X19
_rc = i32(26)
if crt.Xmemcmp(tls, (unsafe.Pointer)(_2_page1), (unsafe.Pointer)(&_zMagicHeader), uint32(i32(16))) != i32(0) {
goto _page1_init_failed
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(18))))) > i32(2) {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(19))))) > i32(2) {
goto _page1_init_failed
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(19))))) != i32(2) || (int32(_pBt.X10)&i32(16)) != i32(0) {
goto _13
}
_6_isOpen = i32(0)
_rc = _sqlite3PagerOpenWal(tls, (*XPager)(_pBt.X0), &_6_isOpen)
if _rc != i32(0) {
goto _page1_init_failed
}
if _6_isOpen == i32(0) {
_releasePage(tls, _pPage1)
return i32(0)
}
_rc = i32(26)
goto _17
_13:
_17:
if crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(21))))), (unsafe.Pointer)(str(51384)), uint32(i32(3))) != i32(0) {
goto _page1_init_failed
}
_2_pageSize = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(17))))) << uint(i32(16))))
if ((((_2_pageSize - uint32(i32(1))) & _2_pageSize) != uint32(i32(0))) || (_2_pageSize > uint32(i32(65536)))) || (_2_pageSize <= uint32(i32(256))) {
goto _page1_init_failed
}
func() {
if (_2_pageSize & uint32(i32(7))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62030), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeØ00__func__Ø000))), unsafe.Pointer(str(51388)))
crt.X__builtin_abort(tls)
}
}()
_2_usableSize = _2_pageSize - uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1)) + 1*uintptr(i32(20)))))
if _2_pageSize != (_pBt.X15) {
_releasePage(tls, _pPage1)
*(*uint32)(unsafe.Pointer(&(_pBt.X16))) = _2_usableSize
*(*uint32)(unsafe.Pointer(&(_pBt.X15))) = _2_pageSize
_freeTempSpace(tls, _pBt)
_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), int32(_2_pageSize-_2_usableSize))
return _rc
}
if ((((*Xsqlite3)(_pBt.X1).X6) & i32(65536)) == i32(0)) && (_nPage > _nPageFile) {
_rc = _sqlite3CorruptError(tls, i32(62055))
goto _page1_init_failed
}
if _2_usableSize < uint32(i32(480)) {
goto _page1_init_failed
}
*(*uint32)(unsafe.Pointer(&(_pBt.X15))) = _2_pageSize
*(*uint32)(unsafe.Pointer(&(_pBt.X16))) = _2_usableSize
*(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(52))))) != 0 {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_page1))+1*uintptr(i32(64))))) != 0 {
return i32(1)
}
return i32(0)
}())
_8:
*(*uint16)(unsafe.Pointer(&(_pBt.X11))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(64))) / uint32(i32(255))) - uint32(i32(23)))
*(*uint16)(unsafe.Pointer(&(_pBt.X12))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23)))
*(*uint16)(unsafe.Pointer(&(_pBt.X13))) = uint16((_pBt.X16) - uint32(i32(35)))
*(*uint16)(unsafe.Pointer(&(_pBt.X14))) = uint16(((((_pBt.X16) - uint32(i32(12))) * uint32(i32(32))) / uint32(i32(255))) - uint32(i32(23)))
if int32(_pBt.X11) > i32(127) {
*(*uint8)(unsafe.Pointer(&(_pBt.X9))) = uint8(i32(127))
goto _33
}
*(*uint8)(unsafe.Pointer(&(_pBt.X9))) = uint8(_pBt.X11)
_33:
func() {
if (int32(_pBt.X13) + i32(23)) > int32((_pBt.X15)-uint32(i32(8))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62094), unsafe.Pointer((*int8)(unsafe.Pointer(&_lockBtreeØ00__func__Ø000))), unsafe.Pointer(str(51406)))
crt.X__builtin_abort(tls)
}
}()
*(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = _pPage1
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(_nPage)
return i32(0)
_page1_init_failed:
_releasePage(tls, _pPage1)
*(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil
return _rc
_ = _nPageHeader
panic(0)
}
var _lockBtreeØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_lockBtreeØ00__func__Ø000[0], str(51445), 10)
}
// This function is called to obtain a shared lock on the database file.
// It is illegal to call sqlite3PagerGet() until after this function
// has been successfully called. If a shared-lock is already held when
// this function is called, it is a no-op.
//
// The following operations are also performed by this function.
//
// 1) If the pager is currently in PAGER_OPEN state (no lock held
// on the database file), then an attempt is made to obtain a
// SHARED lock on the database file. Immediately after obtaining
// the SHARED lock, the file-system is checked for a hot-journal,
// which is played back if present. Following any hot-journal
// rollback, the contents of the cache are validated by checking
// the 'change-counter' field of the database file header and
// discarded if they are found to be invalid.
//
// 2) If the pager is running in exclusive-mode, and there are currently
// no outstanding references to any pages, and is in the error state,
// then an attempt is made to clear the error state by discarding
// the contents of the page cache and rolling back any open journal
// file.
//
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs while locking the database, checking for a hot-journal file or
// rolling back a journal file, the IO error code is returned.
func _sqlite3PagerSharedLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _1_bHotJournal, _8_bExists, _9_fout, _9_f int32
var _15_nPage uint32
var _15_dbFileVers [16]int8
var _8_pVfs *Xsqlite3_vfs
_rc = i32(0)
func() {
if _sqlite3PcacheRefCount(tls, (*XPCache)(_pPager.X59)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52037), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51455)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52038), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(0) && int32(_pPager.X14) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52039), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51497)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X26) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52040), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11754)))
crt.X__builtin_abort(tls)
}
}()
if (*XWal)(_pPager.X60) != nil || int32(_pPager.X14) != i32(0) {
goto _10
}
_1_bHotJournal = i32(1)
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52045), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X10) != i32(0) && int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51556)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pager_wait_on_lock(tls, _pPager, i32(1))
if _rc != i32(0) {
func() {
if int32(_pPager.X15) != i32(0) && int32(_pPager.X15) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52050), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51609)))
crt.X__builtin_abort(tls)
}
}()
goto _failed
}
if int32(_pPager.X15) <= i32(1) {
_rc = _hasHotJournal(tls, _pPager, &_1_bHotJournal)
}
if _rc != i32(0) {
goto _failed
}
if _1_bHotJournal == 0 {
goto _22
}
if (_pPager.X12) != 0 {
_rc = i32(776)
goto _failed
}
_rc = _pagerLockDb(tls, _pPager, i32(4))
if _rc != i32(0) {
goto _failed
}
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil {
goto _25
}
_8_pVfs = (*Xsqlite3_vfs)(_pPager.X0)
_rc = _sqlite3OsAccess(tls, _8_pVfs, _pPager.X52, i32(0), &_8_bExists)
if _rc != i32(0) || _8_bExists == 0 {
goto _27
}
_9_fout = i32(0)
_9_f = i32(2050)
func() {
if (_pPager.X10) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51663)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsOpen(tls, _8_pVfs, _pPager.X52, (*Xsqlite3_file)(_pPager.X32), _9_f, &_9_fout)
func() {
if _rc == i32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(13510)))
crt.X__builtin_abort(tls)
}
}()
if (_rc == i32(0)) && (_9_fout&i32(1)) != 0 {
_rc = _sqlite3CantopenError(tls, i32(52114))
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
}
_27:
_25:
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
goto _35
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52129), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pagerSyncHotJournal(tls, _pPager)
if _rc == i32(0) {
_rc = _pager_playback(tls, _pPager, bool2int((_pPager.X10) == 0))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0))
}
goto _40
_35:
if (_pPager.X1) == 0 {
_pagerUnlockDb(tls, _pPager, i32(1))
}
_40:
if _rc != i32(0) {
_pager_error(tls, _pPager, _rc)
goto _failed
}
func() {
if int32(_pPager.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51681)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X15) != i32(1) && ((_pPager.X1) == 0 || int32(_pPager.X15) <= i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52161), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51708)))
crt.X__builtin_abort(tls)
}
}()
_22:
if (_pPager.X10) != 0 || (_pPager.X21) == 0 {
goto _49
}
_15_nPage = u32(0)
_rc = _pagerPagecount(tls, _pPager, &_15_nPage)
if _rc != 0 {
goto _failed
}
if _15_nPage <= uint32(i32(0)) {
goto _51
}
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(&_15_dbFileVers), int32(u32(16)), int64(i32(24)))
if (_rc != i32(0)) && (_rc != i32(522)) {
goto _failed
}
goto _54
_51:
crt.Xmemset(tls, (unsafe.Pointer)(&_15_dbFileVers), i32(0), u32(16))
_54:
if crt.Xmemcmp(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)(&_15_dbFileVers), u32(16)) == i32(0) {
goto _55
}
_pager_reset(tls, _pPager)
if (_pPager.X20) != 0 {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil)
}
_55:
_49:
_rc = _pagerOpenWalIfPresent(tls, _pPager)
func() {
if (*XWal)(_pPager.X60) != nil && _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52219), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51793)))
crt.X__builtin_abort(tls)
}
}()
_10:
if (*XWal)(_pPager.X60) != nil {
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pagerBeginReadTransaction(tls, _pPager)
}
if ((int32(_pPager.X10) == i32(0)) && (int32(_pPager.X14) == i32(0))) && (_rc == i32(0)) {
_rc = _pagerPagecount(tls, _pPager, (*uint32)(unsafe.Pointer(&(_pPager.X22))))
}
_failed:
if _rc != i32(0) {
func() {
if (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(11747)))
crt.X__builtin_abort(tls)
}
}()
_pager_unlock(tls, _pPager)
func() {
if int32(_pPager.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52236), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSharedLockØ00__func__Ø000))), unsafe.Pointer(str(51681)))
crt.X__builtin_abort(tls)
}
}()
goto _71
}
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X21))) = uint8(i32(1))
_71:
return _rc
_ = _15_dbFileVers
panic(0)
}
var _sqlite3PagerSharedLockØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSharedLockØ00__func__Ø000[0], str(51826), 23)
}
// Try to obtain a lock of type locktype on the database file. If
// a similar or greater lock is already held, this function is a no-op
// (returning SQLITE_OK immediately).
//
// Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke
// the busy callback if the lock is currently not available. Repeat
// until the busy callback returns false or until the attempt to
// obtain the lock succeeds.
//
// Return SQLITE_OK on success and an error code if we cannot obtain
// the lock. If the lock is obtained successfully, set the Pager.state
// variable to locktype before returning.
func _pager_wait_on_lock(tls *crt.TLS, _pPager *XPager, _locktype int32) (r0 int32) {
var _rc int32
func() {
if int32(_pPager.X15) < _locktype && (int32(_pPager.X15) != i32(0) || _locktype != i32(1)) && (int32(_pPager.X15) != i32(2) || _locktype != i32(4)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50819), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_wait_on_lockØ00__func__Ø000))), unsafe.Pointer(str(51849)))
crt.X__builtin_abort(tls)
}
}()
_6:
_rc = _pagerLockDb(tls, _pPager, _locktype)
if (_rc == i32(5)) && (_pPager.X53)(tls, _pPager.X54) != 0 {
goto _6
}
return _rc
}
var _pager_wait_on_lockØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_pager_wait_on_lockØ00__func__Ø000[0], str(51990), 19)
}
// Lock the database file to level eLock, which must be either SHARED_LOCK,
// RESERVED_LOCK or EXCLUSIVE_LOCK. If the caller is successful, set the
// Pager.eLock variable to the new locking state.
//
// Except, if Pager.eLock is set to UNKNOWN_LOCK when this function is
// called, do not modify it unless the new locking state is EXCLUSIVE_LOCK.
// See the comment above the #define of UNKNOWN_LOCK for an explanation
// of this.
func _pagerLockDb(tls *crt.TLS, _pPager *XPager, _eLock int32) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if _eLock != i32(1) && _eLock != i32(2) && _eLock != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48076), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerLockDbØ00__func__Ø000))), unsafe.Pointer(str(52009)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X15) >= _eLock && int32(_pPager.X15) != i32(5) {
goto _5
}
_rc = func() int32 {
if (_pPager.X11) != 0 {
return i32(0)
}
return _sqlite3OsLock(tls, (*Xsqlite3_file)(_pPager.X31), _eLock)
}()
if (_rc == i32(0)) && ((int32(_pPager.X15) != i32(5)) || (_eLock == i32(4))) {
*(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(_eLock)
}
_5:
return _rc
}
var _pagerLockDbØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pagerLockDbØ00__func__Ø000[0], str(52077), 12)
}
// This function is called after transitioning from PAGER_UNLOCK to
// PAGER_SHARED state. It tests if there is a hot journal present in
// the file-system for the given pager. A hot journal is one that
// needs to be played back. According to this function, a hot-journal
// file exists if the following criteria are met:
//
// * The journal file exists in the file system, and
// * No process holds a RESERVED or greater lock on the database file, and
// * The database file itself is greater than 0 bytes in size, and
// * The first byte of the journal file exists and is not 0x00.
//
// If the current size of the database file is 0 but a journal file
// exists, that is probably an old journal left over from a prior
// database with the same name. In this case the journal file is
// just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK
// is returned.
//
// This routine does not check if there is a master journal filename
// at the end of the file. If there is, and that master journal file
// does not exist, then the journal file is not really hot. In this
// case this routine will return a false-positive. The pager_playback()
// routine will discover that the journal file is not really hot and
// will not roll it back.
//
// If a hot-journal file is found to exist, *pExists is set to 1 and
// SQLITE_OK returned. If no hot-journal file is present, *pExists is
// set to 0 and SQLITE_OK returned. If an IO error occurs while trying
// to determine whether or not a hot-journal file exists, the IO error
// code is returned and the value of *pExists is undefined.
func _hasHotJournal(tls *crt.TLS, _pPager *XPager, _pExists *int32) (r0 int32) {
var _rc, _exists, _jrnlOpen, _2_locked, _8_f int32
var _3_nPage uint32
var _9_first uint8
var _pVfs *Xsqlite3_vfs
_pVfs = (*Xsqlite3_vfs)(_pPager.X0)
_rc = i32(0)
_exists = i32(1)
_jrnlOpen = bool2int((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil)
func() {
if (_pPager.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51916), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(12385)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51917), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(16508)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51918), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(51681)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _jrnlOpen != i32(0) && (_sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X32))&i32(2048)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51920), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(52089)))
crt.X__builtin_abort(tls)
}
}()
*_pExists = i32(0)
if _jrnlOpen == 0 {
_rc = _sqlite3OsAccess(tls, _pVfs, _pPager.X52, i32(0), &_exists)
}
if _rc != i32(0) || _exists == 0 {
goto _11
}
_2_locked = i32(0)
_rc = _sqlite3OsCheckReservedLock(tls, (*Xsqlite3_file)(_pPager.X31), &_2_locked)
if _rc != i32(0) || _2_locked != 0 {
goto _13
}
func() {
if int32(_pPager.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51943), unsafe.Pointer((*int8)(unsafe.Pointer(&_hasHotJournalØ00__func__Ø000))), unsafe.Pointer(str(11043)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pagerPagecount(tls, _pPager, &_3_nPage)
if _rc != i32(0) {
goto _16
}
if _3_nPage != uint32(i32(0)) || _jrnlOpen != 0 {
goto _18
}
_sqlite3BeginBenignMalloc(tls)
if _pagerLockDb(tls, _pPager, i32(2)) != i32(0) {
goto _19
}
_sqlite3OsDelete(tls, _pVfs, _pPager.X52, i32(0))
if (_pPager.X1) == 0 {
_pagerUnlockDb(tls, _pPager, i32(1))
}
_19:
_sqlite3EndBenignMalloc(tls)
goto _21
_18:
if _jrnlOpen == 0 {
_8_f = i32(2049)
_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.X52, (*Xsqlite3_file)(_pPager.X32), _8_f, &_8_f)
}
if _rc != i32(0) {
goto _23
}
_9_first = u8(0)
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_9_first), i32(1), int64(i32(0)))
if _rc == i32(522) {
_rc = i32(0)
}
if _jrnlOpen == 0 {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
}
*_pExists = bool2int(int32(_9_first) != i32(0))
goto _27
_23:
if _rc == i32(14) {
*_pExists = i32(1)
_rc = i32(0)
}
_27:
_21:
_16:
_13:
_11:
return _rc
}
var _hasHotJournalØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_hasHotJournalØ00__func__Ø000[0], str(52189), 14)
}
func _sqlite3OsCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
return (*(*func(*crt.TLS, *Xsqlite3_file, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{((*Xsqlite3_io_methods)(_id.X0).X9)})))(tls, _id, _pResOut)
}
// This function is called as part of the transition from PAGER_OPEN
// to PAGER_READER state to determine the size of the database file
// in pages (assuming the page size currently stored in Pager.pageSize).
//
// If no error occurs, SQLITE_OK is returned and the size of the database
// in pages is stored in *pnPage. Otherwise, an error code (perhaps
// SQLITE_IOERR_FSTAT) is returned and *pnPage is left unmodified.
func _pagerPagecount(tls *crt.TLS, _pPager *XPager, _pnPage *uint32) (r0 int32) {
var _1_rc int32
var _1_n int64
var _nPage uint32
func() {
if int32(_pPager.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50166), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(51681)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X15) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50167), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(52203)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50168), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(16508)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50169), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(11043)))
crt.X__builtin_abort(tls)
}
}()
_nPage = _sqlite3WalDbsize(tls, (*XWal)(_pPager.X60))
if _nPage != uint32(i32(0)) || func() int32 {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50177), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerPagecountØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _11
}
_1_n = i64(0)
_1_rc = _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X31), &_1_n)
if _1_rc != i32(0) {
return _1_rc
}
_nPage = uint32(((_1_n + int64(_pPager.X48)) - int64(i32(1))) / int64(_pPager.X48))
_11:
if _nPage > (_pPager.X49) {
*(*uint32)(unsafe.Pointer(&(_pPager.X49))) = _nPage
}
*_pnPage = _nPage
return i32(0)
}
var _pagerPagecountØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pagerPagecountØ00__func__Ø000[0], str(52230), 15)
}
// Return the size of the database in pages (or zero, if unknown).
func _sqlite3WalDbsize(tls *crt.TLS, _pWal *XWal) (r0 uint32) {
if (_pWal != nil) && func() int32 {
if int32(_pWal.X9) >= i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57179), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalDbsizeØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
return (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7
}
return uint32(i32(0))
}
var _sqlite3WalDbsizeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalDbsizeØ00__func__Ø000[0], str(52245), 17)
}
// Check if the *-wal file that corresponds to the database opened by pPager
// exists if the database is not empy, or verify that the *-wal file does
// not exist (by deleting it) if the database file is empty.
//
// If the database is not empty and the *-wal file exists, open the pager
// in WAL mode. If the database is empty or if no *-wal file exists and
// if no error occurs, make sure Pager.journalMode is not set to
// PAGER_JOURNALMODE_WAL.
//
// Return SQLITE_OK or an error code.
//
// The caller must hold a SHARED lock on the database file to call this
// function. Because an EXCLUSIVE lock on the db file is required to delete
// a WAL on a none-empty database, this ensures there is no race condition
// between the xAccess() below and an xDelete() being executed by some
// other connection.
func _pagerOpenWalIfPresent(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _1_isWal int32
var _1_nPage uint32
_rc = i32(0)
func() {
if int32(_pPager.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50219), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000))), unsafe.Pointer(str(51681)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X15) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50220), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenWalIfPresentØ00__func__Ø000))), unsafe.Pointer(str(52203)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X10) != 0 {
goto _4
}
_rc = _pagerPagecount(tls, _pPager, &_1_nPage)
if _rc != 0 {
return _rc
}
if _1_nPage != uint32(i32(0)) {
goto _6
}
_rc = _sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X61, i32(0))
if _rc == i32(5898) {
_rc = i32(0)
}
_1_isWal = i32(0)
goto _8
_6:
_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X61, i32(0), &_1_isWal)
_8:
if _rc != i32(0) {
goto _9
}
if _1_isWal != 0 {
_rc = _sqlite3PagerOpenWal(tls, _pPager, nil)
goto _12
}
if int32(_pPager.X2) == i32(5) {
*(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(0))
}
_12:
_9:
_4:
return _rc
}
var _pagerOpenWalIfPresentØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_pagerOpenWalIfPresentØ00__func__Ø000[0], str(52262), 22)
}
// The caller must be holding a SHARED lock on the database file to call
// this function.
//
// If the pager passed as the first argument is open on a real database
// file (not a temp file or an in-memory database), and the WAL file
// is not already open, make an attempt to open it now. If successful,
// return SQLITE_OK. If an error occurs or the VFS used by the pager does
// not support the xShmXXX() methods, return an error code. *pbOpen is
// not modified in either case.
//
// If the pager is open on a temp-file (or in-memory database), or if
// the WAL file is already open, set *pbOpen to 1 and return SQLITE_OK
// without doing anything.
func _sqlite3PagerOpenWal(tls *crt.TLS, _pPager *XPager, _pbOpen *int32) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54344), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(0) && _pbOpen == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54345), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52284)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(1) && _pbOpen != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54346), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pbOpen != nil && (*_pbOpen) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54347), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52361)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pbOpen == nil && ((_pPager.X10) != 0 || (*XWal)(_pPager.X60) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54348), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52385)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X10) != 0 || (*XWal)(_pPager.X60) != nil {
goto _16
}
if _sqlite3PagerWalSupported(tls, _pPager) == 0 {
return i32(14)
}
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
_rc = _pagerOpenWal(tls, _pPager)
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(5))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(0))
}
goto _19
_16:
*_pbOpen = i32(1)
_19:
return _rc
}
var _sqlite3PagerOpenWalØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerOpenWalØ00__func__Ø000[0], str(52435), 20)
}
// Return true if the underlying VFS for the given pager supports the
// primitives necessary for write-ahead logging.
func _sqlite3PagerWalSupported(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _pMethods *Xsqlite3_io_methods
_pMethods = (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0)
if (_pPager.X11) != 0 {
return i32(0)
}
return bool2int(((_pPager.X1) != 0) || (((_pMethods.X0) >= i32(2)) && ((*(*func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32
}{(_pMethods.X13)}))) != nil)))
}
// Call sqlite3WalOpen() to open the WAL handle. If the pager is in
// exclusive-locking mode when this function is called, take an EXCLUSIVE
// lock on the database file and use heap-memory to store the wal-index
// in. Otherwise, use the normal shared-memory.
func _pagerOpenWal(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if (*XWal)(_pPager.X60) != nil || int32(_pPager.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54296), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52455)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X15) != i32(1) && int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54297), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenWalØ00__func__Ø000))), unsafe.Pointer(str(52494)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X1) != 0 {
_rc = _pagerExclusiveLock(tls, _pPager)
}
if _rc == i32(0) {
_rc = _sqlite3WalOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), (*Xsqlite3_file)(_pPager.X31), _pPager.X61, int32(_pPager.X1), _pPager.X50, (**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60))))))
}
_pagerFixMaplimit(tls, _pPager)
return _rc
}
var _pagerOpenWalØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pagerOpenWalØ00__func__Ø000[0], str(52554), 13)
}
// Attempt to take an exclusive lock on the database file. If a PENDING lock
// is obtained instead, immediately release it.
func _pagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
func() {
if int32(_pPager.X15) != i32(1) && int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54276), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerExclusiveLockØ00__func__Ø000))), unsafe.Pointer(str(52494)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pagerLockDb(tls, _pPager, i32(4))
if _rc != i32(0) {
_pagerUnlockDb(tls, _pPager, i32(1))
}
return _rc
}
var _pagerExclusiveLockØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_pagerExclusiveLockØ00__func__Ø000[0], str(52567), 19)
}
// Open a connection to the WAL file zWalName. The database file must
// already be opened on connection pDbFd. The buffer that zWalName points
// to must remain valid for the lifetime of the returned Wal* handle.
//
// A SHARED lock should be held on the database file when this function
// is called. The purpose of this SHARED lock is to prevent any other
// client from unlinking the WAL or wal-index file. If another process
// were to do this just after this client opened one of these files, the
// system would be badly broken.
//
// If the log file is successfully opened, SQLITE_OK is returned and
// *ppWal is set to point to a new WAL handle. If an error occurs,
// an SQLite error code is returned and *ppWal is left unmodified.
func _sqlite3WalOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _pDbFd *Xsqlite3_file, _zWalName *int8, _bNoShm int32, _mxWalSize int64, _ppWal **XWal) (r0 int32) {
var _rc, _flags, _4_iDC int32
var _pRet *XWal
func() {
if _zWalName == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zWalName)) + 1*uintptr(i32(0))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55767), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000))), unsafe.Pointer(str(52586)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pDbFd == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(55768), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalOpenØ00__func__Ø000))), unsafe.Pointer(str(52610)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
i32(0)
*_ppWal = nil
_pRet = (*XWal)(_sqlite3MallocZero(tls, uint64(u32(120)+uint32(_pVfs.X1))))
if _pRet == nil {
return _sqlite3NomemError(tls, i32(55790))
}
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X0))))) = _pVfs
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X2))))) = (*Xsqlite3_file)(unsafe.Pointer((*XWal)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRet)) + 120*uintptr(i32(1))))))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X1))))) = _pDbFd
*(*int16)(unsafe.Pointer(&(_pRet.X9))) = int16(i32(-1))
*(*int64)(unsafe.Pointer(&(_pRet.X4))) = _mxWalSize
*(**int8)(unsafe.Pointer(&(_pRet.X21))) = _zWalName
*(*uint8)(unsafe.Pointer(&(_pRet.X16))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pRet.X17))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pRet.X11))) = uint8(func() int32 {
if _bNoShm != 0 {
return i32(2)
}
return i32(0)
}())
_flags = i32(524294)
_rc = _sqlite3OsOpen(tls, _pVfs, _zWalName, (*Xsqlite3_file)(_pRet.X2), _flags, &_flags)
if (_rc == i32(0)) && (_flags&i32(1)) != 0 {
*(*uint8)(unsafe.Pointer(&(_pRet.X14))) = uint8(i32(1))
}
if _rc != i32(0) {
_walIndexClose(tls, _pRet, i32(0))
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pRet.X2))
Xsqlite3_free(tls, (unsafe.Pointer)(_pRet))
goto _11
}
_4_iDC = _sqlite3OsDeviceCharacteristics(tls, _pDbFd)
if (_4_iDC & i32(1024)) != 0 {
*(*uint8)(unsafe.Pointer(&(_pRet.X16))) = uint8(i32(0))
}
if (_4_iDC & i32(4096)) != 0 {
*(*uint8)(unsafe.Pointer(&(_pRet.X17))) = uint8(i32(0))
}
*_ppWal = _pRet
_11:
return _rc
}
var _sqlite3WalOpenØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalOpenØ00__func__Ø000[0], str(52616), 15)
}
// Begin a read transaction on the WAL.
//
// This routine used to be called "pagerOpenSnapshot()" because it essentially
// makes a snapshot of the database at the current point in time and preserves
// that snapshot for use by the reader in spite of concurrently changes by
// other writers or checkpointers.
func _pagerBeginReadTransaction(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc, _changed int32
_changed = i32(0)
func() {
if (*XWal)(_pPager.X60) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50128), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000))), unsafe.Pointer(str(15826)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(0) && int32(_pPager.X14) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50129), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerBeginReadTransactionØ00__func__Ø000))), unsafe.Pointer(str(51497)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3WalEndReadTransaction(tls, (*XWal)(_pPager.X60))
_rc = _sqlite3WalBeginReadTransaction(tls, (*XWal)(_pPager.X60), &_changed)
if _rc == i32(0) && _changed == 0 {
goto _6
}
_pager_reset(tls, _pPager)
if (_pPager.X20) != 0 {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pPager.X31), int64(i32(0)), nil)
}
_6:
return _rc
}
var _pagerBeginReadTransactionØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_pagerBeginReadTransactionØ00__func__Ø000[0], str(52631), 26)
}
// Begin a read transaction on the database.
//
// This routine used to be called sqlite3OpenSnapshot() and with good reason:
// it takes a snapshot of the state of the WAL and wal-index for the current
// instant in time. The current thread will continue to use this snapshot.
// Other threads might append new content to the WAL and wal-index but
// that extra content is ignored by the current thread.
//
// If the database contents have changes since the previous read
// transaction, then *pChanged is set to 1 before returning. The
// Pager layer will use this to know that is cache is stale and
// needs to be flushed.
func _sqlite3WalBeginReadTransaction(tls *crt.TLS, _pWal *XWal, _pChanged *int32) (r0 int32) {
var _rc, _cnt int32
_cnt = i32(0)
_0:
_rc = _walTryBeginRead(tls, _pWal, _pChanged, i32(0), preInc1(&_cnt, 1))
if _rc == i32(-1) {
goto _0
}
return _rc
_ = _cnt
panic(0)
}
// Attempt to start a read transaction. This might fail due to a race or
// other transient condition. When that happens, it returns WAL_RETRY to
// indicate to the caller that it is safe to retry immediately.
//
// On success return SQLITE_OK. On a permanent failure (such an
// I/O error or an SQLITE_BUSY because another process is running
// recovery) return a positive error code.
//
// The useWal parameter is true to force the use of the WAL and disable
// the case where the WAL is bypassed because it has been completely
// checkpointed. If useWal==0 then this routine calls walIndexReadHdr()
// to make a copy of the wal-index header into pWal->hdr. If the
// wal-index header has changed, *pChanged is set to 1 (as an indication
// to the caller that the local paget cache is obsolete and needs to be
// flushed.) When useWal==1, the wal-index header is assumed to already
// be loaded and the pChanged parameter is unused.
//
// The caller must set the cnt parameter to the number of prior calls to
// this routine during the current read attempt that returned WAL_RETRY.
// This routine will start taking more aggressive measures to clear the
// race conditions after multiple WAL_RETRY returns, and after an excessive
// number of errors will ultimately return SQLITE_PROTOCOL. The
// SQLITE_PROTOCOL return indicates that some other process has gone rogue
// and is not honoring the locking protocol. There is a vanishingly small
// chance that SQLITE_PROTOCOL could be returned because of a run of really
// bad luck when there is lots of contention for the wal-index, but that
// possibility is so small that it can be safely neglected, we believe.
//
// On success, this routine obtains a read lock on
// WAL_READ_LOCK(pWal->readLock). The pWal->readLock integer is
// in the range 0 <= pWal->readLock < WAL_NREADER. If pWal->readLock==(-1)
// that means the Wal does not hold any read lock. The reader must not
// access any database page that is modified by a WAL frame up to and
// including frame number aReadMark[pWal->readLock]. The reader will
// use WAL frames up to and including pWal->hdr.mxFrame if pWal->readLock>0
// Or if pWal->readLock==0, then the reader will ignore the WAL
// completely and get all content directly from the database file.
// If the useWal parameter is 1 then the WAL will never be ignored and
// this routine will always set pWal->readLock>0 on success.
// When the read transaction is completed, the caller must release the
// lock on WAL_READ_LOCK(pWal->readLock) and set pWal->readLock to -1.
//
// This routine uses the nBackfill and aReadMark[] fields of the header
// to select a particular WAL_READ_LOCK() that strives to let the
// checkpoint process do as much work as possible. This routine might
// update values of the aReadMark[] array in the header, but if it does
// so it takes care to hold an exclusive lock on the corresponding
// WAL_READ_LOCK() while changing values.
func _walTryBeginRead(tls *crt.TLS, _pWal *XWal, _pChanged *int32, _useWal int32, _cnt int32) (r0 int32) {
var _mxI, _i, _rc, _1_nDelay int32
var _mxReadMark, _mxFrame, _13_thisMark uint32
var _pInfo *XWalCkptInfo
_rc = i32(0)
func() {
if int32(_pWal.X9) >= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56667), unsafe.Pointer((*int8)(unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000))), unsafe.Pointer(str(52657)))
crt.X__builtin_abort(tls)
}
}()
if _cnt <= i32(5) {
goto _2
}
_1_nDelay = i32(1)
if _cnt > i32(100) {
*(*uint8)(unsafe.Pointer(&(_pWal.X23))) = uint8(i32(1))
return i32(15)
}
if _cnt >= i32(10) {
_1_nDelay = ((_cnt - i32(9)) * (_cnt - i32(9))) * i32(39)
}
_sqlite3OsSleep(tls, (*Xsqlite3_vfs)(_pWal.X0), _1_nDelay)
_2:
if _useWal != 0 {
goto _5
}
_rc = _walIndexReadHdr(tls, _pWal, _pChanged)
if _rc != i32(5) {
goto _6
}
if (*(**uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pWal.X7)) + 4*uintptr(i32(0))))) == nil {
_rc = i32(-1)
goto _11
}
if i32(0) == store1(&_rc, _walLockShared(tls, _pWal, i32(2))) {
_walUnlockShared(tls, _pWal, i32(2))
_rc = i32(-1)
goto _11
}
if _rc == i32(5) {
_rc = i32(261)
}
_11:
_6:
if _rc != i32(0) {
return _rc
}
_5:
_pInfo = _walCkptInfo(tls, _pWal)
if _useWal != 0 || (_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
goto _14
}
_rc = _walLockShared(tls, _pWal, i32(3))
_walShmBarrier(tls, _pWal)
if _rc != i32(0) {
goto _15
}
if crt.Xmemcmp(tls, (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u32(48)) != 0 {
_walUnlockShared(tls, _pWal, i32(3))
return i32(-1)
}
*(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(0))
return i32(0)
_15:
if _rc != i32(5) {
return _rc
}
_14:
_mxReadMark = uint32(i32(0))
_mxI = i32(0)
_mxFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
_i = i32(1)
_19:
if _i >= i32(5) {
goto _22
}
_13_thisMark = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_i)))
if (_mxReadMark <= _13_thisMark) && (_13_thisMark <= _mxFrame) {
func() {
if _13_thisMark == u32(4294967295) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56781), unsafe.Pointer((*int8)(unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000))), unsafe.Pointer(str(52674)))
crt.X__builtin_abort(tls)
}
}()
_mxReadMark = _13_thisMark
_mxI = _i
}
_i += 1
goto _19
_22:
if (int32(_pWal.X14)&i32(2)) != i32(0) || _mxReadMark >= _mxFrame && _mxI != i32(0) {
goto _29
}
_i = i32(1)
_30:
if _i >= i32(5) {
goto _33
}
_rc = _walLockExclusive(tls, _pWal, i32(3)+_i, i32(1))
if _rc == i32(0) {
_mxReadMark = store5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1)))))+4*uintptr(_i))), _mxFrame)
_mxI = _i
_walUnlockExclusive(tls, _pWal, i32(3)+_i, i32(1))
goto _33
}
if _rc != i32(5) {
return _rc
}
_i += 1
goto _30
_33:
_29:
if _mxI == i32(0) {
func() {
if _rc != i32(5) && (int32(_pWal.X14)&i32(2)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56802), unsafe.Pointer((*int8)(unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000))), unsafe.Pointer(str(52702)))
crt.X__builtin_abort(tls)
}
}()
return func() int32 {
if _rc == i32(5) {
return i32(-1)
}
return i32(520)
}()
}
_rc = _walLockShared(tls, _pWal, i32(3)+_mxI)
if _rc != 0 {
return func() int32 {
if _rc == i32(5) {
return i32(-1)
}
return _rc
}()
}
*(*uint32)(unsafe.Pointer(&(_pWal.X19))) = (_pInfo.X0) + uint32(i32(1))
_walShmBarrier(tls, _pWal)
if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pInfo.X1))))) + 4*uintptr(_mxI)))) != _mxReadMark) || crt.Xmemcmp(tls, (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), u32(48)) != 0 {
_walUnlockShared(tls, _pWal, i32(3)+_mxI)
return i32(-1)
}
func() {
if _mxReadMark > ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(56852), unsafe.Pointer((*int8)(unsafe.Pointer(&_walTryBeginReadØ00__func__Ø000))), unsafe.Pointer(str(52758)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(_mxI)
return _rc
}
var _walTryBeginReadØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_walTryBeginReadØ00__func__Ø000[0], str(52788), 16)
}
var _zMagicHeader [16]int8
func init() {
crt.Xstrncpy(nil, &_zMagicHeader[0], str(52804), 16)
}
// Begin a write-transaction on the specified pager object. If a
// write-transaction has already been opened, this function is a no-op.
//
// If the exFlag argument is false, then acquire at least a RESERVED
// lock on the database file. If exFlag is true, then acquire at least
// an EXCLUSIVE lock. If such a lock is already held, no locking
// functions need be called.
//
// If the subjInMemory argument is non-zero, then any sub-journal opened
// within this transaction will be opened as an in-memory file. This
// has no effect if the sub-journal is already opened (as it may be when
// running in exclusive mode) or if the transaction does not require a
// sub-journal. If the subjInMemory argument is zero, then any required
// sub-journal is implemented in-memory if pPager is an in-memory database,
// or using a temporary file otherwise.
func _sqlite3PagerBegin(tls *crt.TLS, _pPager *XPager, _exFlag int32, _subjInMemory int32) (r0 int32) {
var _rc int32
_rc = i32(0)
if (_pPager.X26) != 0 {
return _pPager.X26
}
func() {
if int32(_pPager.X14) < i32(1) || int32(_pPager.X14) >= i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(52820)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X19))) = uint8(_subjInMemory)
if func() int32 {
if int32(_pPager.X14) == i32(1) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52682), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _6
}
func() {
if (*XBitvec)(_pPager.X30) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(13488)))
crt.X__builtin_abort(tls)
}
}()
if (*XWal)(_pPager.X60) == nil {
goto _9
}
if (_pPager.X1) == 0 || _sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(-1)) == 0 {
goto _11
}
_rc = _pagerLockDb(tls, _pPager, i32(4))
if _rc != i32(0) {
return _rc
}
_sqlite3WalExclusiveMode(tls, (*XWal)(_pPager.X60), i32(1))
_11:
_rc = _sqlite3WalBeginWriteTransaction(tls, (*XWal)(_pPager.X60))
goto _13
_9:
_rc = _pagerLockDb(tls, _pPager, i32(2))
if (_rc == i32(0)) && _exFlag != 0 {
_rc = _pager_wait_on_lock(tls, _pPager, i32(4))
}
_13:
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(2))
*(*uint32)(unsafe.Pointer(&(_pPager.X25))) = _pPager.X22
*(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _pPager.X22
*(*uint32)(unsafe.Pointer(&(_pPager.X23))) = _pPager.X22
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = int64(i32(0))
}
func() {
if _rc != i32(0) && int32(_pPager.X14) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52732), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(52879)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc == i32(0) && int32(_pPager.X14) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52733), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(52925)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(52734), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerBeginØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
_6:
return _rc
}
var _sqlite3PagerBeginØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerBeginØ00__func__Ø000[0], str(52978), 18)
}
// This function starts a write transaction on the WAL.
//
// A read transaction must have already been started by a prior call
// to sqlite3WalBeginReadTransaction().
//
// If another thread or process has written into the database since
// the read transaction was started, then it is not possible for this
// thread to write as doing so would cause a fork. So this routine
// returns SQLITE_BUSY in that case and no write transaction is started.
//
// There can only be a single writer active at a time.
func _sqlite3WalBeginWriteTransaction(tls *crt.TLS, _pWal *XWal) (r0 int32) {
var _rc int32
func() {
if int32(_pWal.X9) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57204), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000))), unsafe.Pointer(str(19227)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pWal.X12) != i32(0) || (_pWal.X20) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57205), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalBeginWriteTransactionØ00__func__Ø000))), unsafe.Pointer(str(52996)))
crt.X__builtin_abort(tls)
}
}()
if (_pWal.X14) != 0 {
return i32(8)
}
_rc = _walLockExclusive(tls, _pWal, i32(0), i32(1))
if _rc != 0 {
return _rc
}
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(1))
if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_walIndexHdr(tls, _pWal)), u32(48)) != i32(0) {
_walUnlockExclusive(tls, _pWal, i32(0), i32(1))
*(*uint8)(unsafe.Pointer(&(_pWal.X12))) = uint8(i32(0))
_rc = i32(517)
}
return _rc
}
var _sqlite3WalBeginWriteTransactionØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalBeginWriteTransactionØ00__func__Ø000[0], str(53036), 32)
}
// This function returns true if main-memory should be used instead of
// a temporary file for transient pager files and statement journals.
// The value returned depends on the value of db->temp_store (runtime
// parameter) and the compile time value of SQLITE_TEMP_STORE. The
// following table describes the relationship between these two values
// and this functions return value.
//
// SQLITE_TEMP_STORE db->temp_store Location of temporary database
// ----------------- -------------- ------------------------------
// 0 any file (return 0)
// 1 1 file (return 0)
// 1 2 memory (return 1)
// 1 0 file (return 0)
// 2 1 file (return 0)
// 2 2 memory (return 1)
// 2 0 memory (return 1)
// 3 any memory (return 1)
func _sqlite3TempInMemory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
return bool2int(int32(_db.X16) == i32(2))
}
// If pBt points to an empty file then convert that empty file
// into a new empty database by initializing the first page of
// the database.
func _newDatabase(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
var _rc int32
var _data *uint8
var _pP1 *XMemPage
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62159), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
if (_pBt.X18) > uint32(i32(0)) {
return i32(0)
}
_pP1 = (*XMemPage)(_pBt.X3)
func() {
if _pP1 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62164), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(53068)))
crt.X__builtin_abort(tls)
}
}()
_data = _pP1.X19
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pP1.X23))
if _rc != 0 {
return _rc
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_data), (unsafe.Pointer)(&_zMagicHeader), u32(16))
i32(0)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(16)))) = uint8(((_pBt.X15) >> uint(i32(8))) & uint32(i32(255)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(17)))) = uint8(((_pBt.X15) >> uint(i32(16))) & uint32(i32(255)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(18)))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(19)))) = uint8(i32(1))
func() {
if (_pBt.X16) > (_pBt.X15) || ((_pBt.X16)+uint32(i32(255))) < (_pBt.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62174), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(53075)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(20)))) = uint8((_pBt.X15) - (_pBt.X16))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(21)))) = uint8(i32(64))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(22)))) = uint8(i32(32))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(23)))) = uint8(i32(32))
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(24))))), i32(0), uint32(i32(76)))
_zeroPage(tls, _pP1, i32(13))
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(2))
sink14 = *p
}
func() {
if int32(_pBt.X5) != i32(1) && int32(_pBt.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62183), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(53144)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pBt.X6) != i32(1) && int32(_pBt.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62184), unsafe.Pointer((*int8)(unsafe.Pointer(&_newDatabaseØ00__func__Ø000))), unsafe.Pointer(str(53185)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(52)))), uint32(_pBt.X5))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(i32(64)))), uint32(_pBt.X6))
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) = uint32(i32(1))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(i32(31)))) = uint8(i32(1))
return i32(0)
}
var _newDatabaseØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_newDatabaseØ00__func__Ø000[0], str(53226), 12)
}
// Set up a raw page so that it looks like a database page holding
// no entries.
func _zeroPage(tls *crt.TLS, _pPage *XMemPage, _flags int32) {
var _first uint16
var _hdr uint8
var _data *uint8
var _pBt *XBtShared
_data = _pPage.X19
_pBt = (*XBtShared)(_pPage.X18)
_hdr = _pPage.X6
func() {
if _sqlite3PagerPagenumber(tls, (*XPgHdr)(_pPage.X23)) != (_pPage.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60959), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53238)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerGetExtra(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_pPage) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60960), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(20336)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerGetData(tls, (*XPgHdr)(_pPage.X23)) != (unsafe.Pointer)(_data) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60961), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53290)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60962), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60963), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pBt.X10) & i32(4)) != 0 {
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr)))), i32(0), (_pBt.X16)-uint32(_hdr))
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr))) = uint8(int8(_flags))
_first = uint16(int32(_hdr) + func() int32 {
if (_flags & i32(8)) == i32(0) {
return i32(12)
}
return i32(8)
}())
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(1))))), i32(0), uint32(i32(4)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7)))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8((_pBt.X16) >> uint(i32(8)))
return _data
}()))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_pBt.X16)
*(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16((_pBt.X16) - uint32(_first))
_decodeFlags(tls, _pPage, _flags)
*(*uint16)(unsafe.Pointer(&(_pPage.X12))) = _first
*(**uint8)(unsafe.Pointer(&(_pPage.X20))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pBt.X16)))
*(**uint8)(unsafe.Pointer(&(_pPage.X21))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_first)))
*(**uint8)(unsafe.Pointer(&(_pPage.X22))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pPage.X7)))
*(*uint8)(unsafe.Pointer(&(_pPage.X9))) = uint8(i32(0))
func() {
if (_pBt.X15) < uint32(i32(512)) || (_pBt.X15) > uint32(i32(65536)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60979), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroPageØ00__func__Ø000))), unsafe.Pointer(str(53374)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pPage.X15))) = uint16((_pBt.X15) - uint32(i32(1)))
*(*uint16)(unsafe.Pointer(&(_pPage.X14))) = uint16(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(1))
}
// Return the page number for page pPg.
func _sqlite3PagerPagenumber(tls *crt.TLS, _pPg *XPgHdr) (r0 uint32) {
return _pPg.X5
}
var _zeroPageØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_zeroPageØ00__func__Ø000[0], str(53417), 9)
}
func _sqlite3PagerIswriteable(tls *crt.TLS, _pPg *XPgHdr) (r0 int32) {
return int32(_pPg.X6) & i32(4)
}
// Decode the flags byte (the first byte of the header) for a page
// and initialize fields of the MemPage structure accordingly.
//
// Only the following combinations are supported. Anything different
// indicates a corrupt database files:
//
// PTF_ZERODATA
// PTF_ZERODATA | PTF_LEAF
// PTF_LEAFDATA | PTF_INTKEY
// PTF_LEAFDATA | PTF_INTKEY | PTF_LEAF
func _decodeFlags(tls *crt.TLS, _pPage *XMemPage, _flagByte int32) (r0 int32) {
var _pBt *XBtShared
func() {
if int32(_pPage.X6) != func() int32 {
if (_pPage.X4) == uint32(i32(1)) {
return i32(100)
}
return i32(0)
}() {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60762), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeFlagsØ00__func__Ø000))), unsafe.Pointer(str(53426)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60763), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeFlagsØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPage.X5))) = uint8(_flagByte >> uint(i32(3)))
i32(0)
{
p := &_flagByte
*p = (*p) & i32(-9)
sink1 = *p
}
*(*uint8)(unsafe.Pointer(&(_pPage.X7))) = uint8(i32(4) - (i32(4) * int32(_pPage.X5)))
*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&(_pPage.X24))))) = _cellSizePtr
_pBt = (*XBtShared)(_pPage.X18)
if _flagByte != i32(5) {
goto _6
}
i32(0)
i32(0)
*(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(1))
if (_pPage.X5) != 0 {
*(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(1))
*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtr
goto _8
}
*(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(0))
*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8) uint16)(unsafe.Pointer(&(_pPage.X24))))) = _cellSizePtrNoPayload
*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtrNoPayload
_8:
*(*uint16)(unsafe.Pointer(&(_pPage.X10))) = _pBt.X13
*(*uint16)(unsafe.Pointer(&(_pPage.X11))) = _pBt.X14
goto _11
_6:
if _flagByte == i32(2) {
i32(0)
i32(0)
*(*uint8)(unsafe.Pointer(&(_pPage.X2))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPage.X3))) = uint8(i32(0))
*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer))(unsafe.Pointer(&(_pPage.X25))))) = _btreeParseCellPtrIndex
*(*uint16)(unsafe.Pointer(&(_pPage.X10))) = _pBt.X11
*(*uint16)(unsafe.Pointer(&(_pPage.X11))) = _pBt.X12
goto _11
}
return _sqlite3CorruptError(tls, i32(60802))
_11:
*(*uint8)(unsafe.Pointer(&(_pPage.X8))) = _pBt.X9
return i32(0)
}
var _decodeFlagsØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_decodeFlagsØ00__func__Ø000[0], str(53471), 12)
}
// The following routines are implementations of the MemPage.xCellSize
// method.
//
// Compute the total number of bytes that a Cell needs in the cell
// data area of the btree-page. The return number includes the cell
// data header and the local payload, but not any overflow page or
// the space used by the cell pointer.
//
// cellSizePtrNoPayload() => table internal nodes
// cellSizePtr() => all index nodes & table leaf nodes
func _cellSizePtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
var _5_minLocal int32
var _nSize uint32
var _pIter, _pEnd *uint8
var _debuginfo XCellInfo
_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pPage.X7)))))))
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, &_debuginfo)
_nSize = uint32(*_pIter)
if _nSize < uint32(i32(128)) {
goto _0
}
_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8))))
{
p := &_nSize
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_1:
_nSize = (_nSize << uint(i32(7))) | uint32(int32(*preInc13(&_pIter, 1))&i32(127))
if (int32(*_pIter) >= i32(128)) && (uintptr(unsafe.Pointer(_pIter)) < uintptr(unsafe.Pointer(_pEnd))) {
goto _1
}
_0:
*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
if (_pPage.X2) == 0 {
goto _3
}
_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(9))))
_4:
if (int32(*postInc13(&_pIter, 1))&i32(128)) != 0 && (uintptr(unsafe.Pointer(_pIter)) < uintptr(unsafe.Pointer(_pEnd))) {
goto _4
}
_3:
if _nSize > uint32(_pPage.X10) {
goto _7
}
{
p := &_nSize
*p = (*p) + uint32(int32((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))
sink5 = *p
}
if _nSize < uint32(i32(4)) {
_nSize = uint32(i32(4))
}
goto _9
_7:
_5_minLocal = int32(_pPage.X11)
_nSize = uint32(_5_minLocal) + ((_nSize - uint32(_5_minLocal)) % (((*XBtShared)(_pPage.X18).X16) - uint32(i32(4))))
if _nSize > uint32(_pPage.X10) {
_nSize = uint32(_5_minLocal)
}
{
p := &_nSize
*p = (*p) + uint32(i32(4)+int32(uint16(int32((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))))
sink5 = *p
}
_9:
func() {
if _nSize != uint32(_debuginfo.X4) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60301), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrØ00__func__Ø000))), unsafe.Pointer(str(53483)))
crt.X__builtin_abort(tls)
}
}()
return uint16(_nSize)
_ = _debuginfo
panic(0)
}
var _cellSizePtrØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_cellSizePtrØ00__func__Ø000[0], str(53520), 12)
}
func _btreeParseCellPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
var _nPayload uint32
var _iKey uint64
var _pIter, _1_pEnd, _3_pEnd *uint8
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60140), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X5) != i32(0) && int32(_pPage.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60141), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000))), unsafe.Pointer(str(53532)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPage.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60142), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000))), unsafe.Pointer(str(53565)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60143), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrØ00__func__Ø000))), unsafe.Pointer(str(53583)))
crt.X__builtin_abort(tls)
}
}()
_pIter = _pCell
_nPayload = uint32(*_pIter)
if _nPayload < uint32(i32(128)) {
goto _9
}
_1_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8))))
{
p := &_nPayload
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_10:
_nPayload = (_nPayload << uint(i32(7))) | uint32(int32(*preInc13(&_pIter, 1))&i32(127))
if (int32(*_pIter) >= i32(128)) && (uintptr(unsafe.Pointer(_pIter)) < uintptr(unsafe.Pointer(_1_pEnd))) {
goto _10
}
_9:
*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
_iKey = uint64(*_pIter)
if _iKey < uint64(i32(128)) {
goto _12
}
_3_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(7))))
{
p := &_iKey
*p = (*p) & uint64(i32(127))
sink17 = *p
}
_13:
_iKey = (_iKey << uint(i32(7))) | uint64(int32(*preInc13(&_pIter, 1))&i32(127))
if int32(*_pIter) < i32(128) {
goto _14
}
if uintptr(unsafe.Pointer(_pIter)) >= uintptr(unsafe.Pointer(_3_pEnd)) {
_iKey = (_iKey << uint(i32(8))) | uint64(*preInc13(&_pIter, 1))
goto _14
}
goto _13
_14:
_12:
*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
*(*int64)(unsafe.Pointer(&(_pInfo.X0))) = *(*int64)(unsafe.Pointer(&_iKey))
*(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = _nPayload
*(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = _pIter
if _nPayload > uint32(_pPage.X10) {
goto _17
}
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(_nPayload + uint32(uint16(int32((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))))
if int32(_pInfo.X4) < i32(4) {
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4))
}
*(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_nPayload)
goto _19
_17:
_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
_19:
}
var _btreeParseCellPtrØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_btreeParseCellPtrØ00__func__Ø000[0], str(53606), 18)
}
// This is common tail processing for btreeParseCellPtr() and
// btreeParseCellPtrIndex() for the case when the cell does not fit entirely
// on a single B-tree page. Make necessary adjustments to the CellInfo
// structure.
func _btreeParseCellAdjustSizeForOverflow(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
var _minLocal, _maxLocal, _surplus int32
_minLocal = int32(_pPage.X11)
_maxLocal = int32(_pPage.X10)
_surplus = int32(uint32(_minLocal) + (((_pInfo.X2) - uint32(_minLocal)) % (((*XBtShared)(_pPage.X18).X16) - uint32(i32(4)))))
if _surplus <= _maxLocal {
*(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_surplus)
goto _1
}
*(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_minLocal)
_1:
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(int32(uint16(int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pInfo.X1))+1*uintptr(_pInfo.X3)))))-uintptr(unsafe.Pointer(_pCell)))/1))) + i32(4))
}
func _cellSizePtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8) (r0 uint16) {
var _pIter, _pEnd *uint8
var _debuginfo XCellInfo
_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(4))))))))
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, &_debuginfo)
func() {
if int32(_pPage.X7) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60319), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53624)))
crt.X__builtin_abort(tls)
}
}()
_pEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIter)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(9))))))))
_2:
if (int32(*postInc13(&_pIter, 1))&i32(128)) != 0 && (uintptr(unsafe.Pointer(_pIter)) < uintptr(unsafe.Pointer(_pEnd))) {
goto _2
}
func() {
if int32(_debuginfo.X4) != int32(uint16(int32((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60322), unsafe.Pointer((*int8)(unsafe.Pointer(&_cellSizePtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53647)))
crt.X__builtin_abort(tls)
}
}()
return uint16(int32((uintptr(unsafe.Pointer(_pIter)) - uintptr(unsafe.Pointer(_pCell))) / 1))
_ = _debuginfo
panic(0)
}
var _cellSizePtrNoPayloadØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_cellSizePtrNoPayloadØ00__func__Ø000[0], str(53699), 21)
}
// The following routines are implementations of the MemPage.xParseCell()
// method.
//
// Parse a cell content block and fill in the CellInfo structure.
//
// btreeParseCellPtr() => table btree leaf nodes
// btreeParseCellNoPayload() => table btree internal nodes
// btreeParseCellPtrIndex() => index btree nodes
//
// There is also a wrapper function btreeParseCell() that works for
// all MemPage types and that references the cell by index rather than
// by pointer.
func _btreeParseCellPtrNoPayload(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60119), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60120), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53720)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X7) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60121), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrNoPayloadØ00__func__Ø000))), unsafe.Pointer(str(53624)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4) + int32(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(i32(4)))), (*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&(_pInfo.X0))))))))
*(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = uint32(i32(0))
*(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(i32(0))
*(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = nil
}
var _btreeParseCellPtrNoPayloadØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_btreeParseCellPtrNoPayloadØ00__func__Ø000[0], str(53735), 27)
}
// Read a 64-bit variable-length integer from memory starting at p[0].
// Return the number of bytes read. The value is stored in *v.
func _sqlite3GetVarint(tls *crt.TLS, _p *uint8, _v *uint64) (r0 uint8) {
var _a, _b, _s uint32
_a = uint32(*_p)
if (_a & uint32(i32(128))) == 0 {
*_v = uint64(_a)
return uint8(i32(1))
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_b = uint32(*_p)
if (_b & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_a = _a << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
*_v = uint64(_a)
return uint8(i32(2))
}
i32(0)
i32(0)
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_a = _a << uint(i32(14))
{
p := &_a
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_a & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
{
p := &_b
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_b = _b << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
*_v = uint64(_a)
return uint8(i32(3))
}
{
p := &_a
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_b = _b << uint(i32(14))
{
p := &_b
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_b & uint32(i32(128))) == 0 {
{
p := &_b
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
_a = _a << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
*_v = uint64(_a)
return uint8(i32(4))
}
{
p := &_b
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
_s = _a
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_a = _a << uint(i32(14))
{
p := &_a
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_a & uint32(i32(128))) == 0 {
_b = _b << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
_s = _s >> uint(i32(18))
*_v = (uint64(_s) << uint(i32(32))) | uint64(_a)
return uint8(i32(5))
}
_s = _s << uint(i32(7))
{
p := &_s
*p = (*p) | _b
sink5 = *p
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_b = _b << uint(i32(14))
{
p := &_b
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_b & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
_a = _a << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
_s = _s >> uint(i32(18))
*_v = (uint64(_s) << uint(i32(32))) | uint64(_a)
return uint8(i32(6))
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_a = _a << uint(i32(14))
{
p := &_a
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_a & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & u32(4028612735)
sink5 = *p
}
{
p := &_b
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
_b = _b << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
_s = _s >> uint(i32(11))
*_v = (uint64(_s) << uint(i32(32))) | uint64(_a)
return uint8(i32(7))
}
{
p := &_a
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_b = _b << uint(i32(14))
{
p := &_b
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_b & uint32(i32(128))) == 0 {
{
p := &_b
*p = (*p) & u32(4028612735)
sink5 = *p
}
_a = _a << uint(i32(7))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
_s = _s >> uint(i32(4))
*_v = (uint64(_s) << uint(i32(32))) | uint64(_a)
return uint8(i32(8))
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_a = _a << uint(i32(15))
{
p := &_a
*p = (*p) | uint32(*_p)
sink5 = *p
}
{
p := &_b
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
_b = _b << uint(i32(8))
{
p := &_a
*p = (*p) | _b
sink5 = *p
}
_s = _s << uint(i32(4))
_b = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(-4)))))
{
p := &_b
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_b = _b >> uint(i32(3))
{
p := &_s
*p = (*p) | _b
sink5 = *p
}
*_v = (uint64(_s) << uint(i32(32))) | uint64(_a)
return uint8(i32(9))
}
func _btreeParseCellPtrIndex(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) {
var _nPayload uint32
var _pIter, _1_pEnd *uint8
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60207), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X5) != i32(0) && int32(_pPage.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60208), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000))), unsafe.Pointer(str(53532)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60209), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeParseCellPtrIndexØ00__func__Ø000))), unsafe.Pointer(str(53762)))
crt.X__builtin_abort(tls)
}
}()
_pIter = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pPage.X7)))))))
_nPayload = uint32(*_pIter)
if _nPayload < uint32(i32(128)) {
goto _7
}
_1_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIter)) + 1*uintptr(i32(8))))
{
p := &_nPayload
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_8:
_nPayload = (_nPayload << uint(i32(7))) | uint32(int32(*preInc13(&_pIter, 1))&i32(127))
if (int32(*_pIter) >= i32(128)) && (uintptr(unsafe.Pointer(_pIter)) < uintptr(unsafe.Pointer(_1_pEnd))) {
goto _8
}
_7:
*(*uintptr)(unsafe.Pointer(&_pIter)) += uintptr(1)
*(*int64)(unsafe.Pointer(&(_pInfo.X0))) = int64(_nPayload)
*(*uint32)(unsafe.Pointer(&(_pInfo.X2))) = _nPayload
*(**uint8)(unsafe.Pointer(&(_pInfo.X1))) = _pIter
if _nPayload > uint32(_pPage.X10) {
goto _10
}
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(_nPayload + uint32(uint16(int32((uintptr(unsafe.Pointer(_pIter))-uintptr(unsafe.Pointer(_pCell)))/1))))
if int32(_pInfo.X4) < i32(4) {
*(*uint16)(unsafe.Pointer(&(_pInfo.X4))) = uint16(i32(4))
}
*(*uint16)(unsafe.Pointer(&(_pInfo.X3))) = uint16(_nPayload)
goto _12
_10:
_btreeParseCellAdjustSizeForOverflow(tls, _pPage, _pCell, _pInfo)
_12:
}
var _btreeParseCellPtrIndexØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_btreeParseCellPtrIndexØ00__func__Ø000[0], str(53783), 23)
}
// Invoke the busy handler for a btree.
func _btreeInvokeBusyHandler(tls *crt.TLS, _pArg unsafe.Pointer) (r0 int32) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_pArg)
func() {
if (*Xsqlite3)(_pBt.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61201), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000))), unsafe.Pointer(str(53806)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pBt.X1).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61202), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInvokeBusyHandlerØ00__func__Ø000))), unsafe.Pointer(str(53814)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3InvokeBusyHandler(tls, (*t19)(unsafe.Pointer(&((*Xsqlite3)(_pBt.X1).X71))))
}
var _btreeInvokeBusyHandlerØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_btreeInvokeBusyHandlerØ00__func__Ø000[0], str(53849), 23)
}
// Invoke the given busy handler.
//
// This routine is called when an operation failed with a lock.
// If this routine returns non-zero, the lock is retried. If it
// returns 0, the operation aborts with an SQLITE_BUSY error.
func _sqlite3InvokeBusyHandler(tls *crt.TLS, _p *t19) (r0 int32) {
var _rc int32
if (func() int32 {
if _p == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InvokeBusyHandlerØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 || (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_p.X0)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{nil})))) || ((_p.X2) < i32(0)) {
return i32(0)
}
_rc = (_p.X0)(tls, _p.X1, _p.X2)
if _rc == i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X2))) = i32(-1)
goto _6
}
*(*int32)(unsafe.Pointer(&(_p.X2))) += 1
_6:
return _rc
}
var _sqlite3InvokeBusyHandlerØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InvokeBusyHandlerØ00__func__Ø000[0], str(53872), 25)
}
func _sqlite3PagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
func() {
if int32(_pPager.X14) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53654), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(10980)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53655), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if (_nSavepoint > (_pPager.X38)) && ((_pPager.X3) != 0) {
return _pagerOpenSavepoint(tls, _pPager, _nSavepoint)
}
return i32(0)
}
var _sqlite3PagerOpenSavepointØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerOpenSavepointØ00__func__Ø000[0], str(53897), 26)
}
// Check that there are at least nSavepoint savepoints open. If there are
// currently less than nSavepoints open, then open one or more savepoints
// to make up the difference. If the number of savepoints is already
// equal to nSavepoint, then this function is a no-op.
//
// If a memory allocation fails, SQLITE_NOMEM is returned. If an error
// occurs while opening the sub-journal file, then an IO error code is
// returned. Otherwise, SQLITE_OK.
func _pagerOpenSavepoint(tls *crt.TLS, _pPager *XPager, _nSavepoint int32) (r0 int32) {
var _rc, _nCurrent, _ii int32
var _aNew *XPagerSavepoint
_rc = i32(0)
_nCurrent = _pPager.X38
func() {
if int32(_pPager.X14) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53614), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(10980)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53615), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nSavepoint <= _nCurrent || (_pPager.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53616), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(53923)))
crt.X__builtin_abort(tls)
}
}()
_aNew = (*XPagerSavepoint)(_sqlite3Realloc(tls, _pPager.X37, uint64(u32(44)*uint32(_nSavepoint))))
if _aNew == nil {
return _sqlite3NomemError(tls, i32(53626))
}
crt.Xmemset(tls, (unsafe.Pointer)((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew))+44*uintptr(_nCurrent)))), i32(0), uint32(_nSavepoint-_nCurrent)*u32(44))
*(**XPagerSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X37))))) = _aNew
_ii = _nCurrent
_8:
if _ii >= _nSavepoint {
goto _11
}
*(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X3))) = _pPager.X22
if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && ((_pPager.X34) > int64(i32(0))) {
*(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X0))) = _pPager.X34
goto _14
}
*(*int64)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X0))) = int64(_pPager.X47)
_14:
*(*uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X4))) = _pPager.X29
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X2))))) = _sqlite3BitvecCreate(tls, _pPager.X22)
if (*XBitvec)((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew))+44*uintptr(_ii))).X2) == nil {
return _sqlite3NomemError(tls, i32(53642))
}
if (*XWal)(_pPager.X60) != nil {
_sqlite3WalSavepoint(tls, (*XWal)(_pPager.X60), (*uint32)(unsafe.Pointer((*[4]uint32)(unsafe.Pointer(&((*XPagerSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aNew)) + 44*uintptr(_ii))).X5))))))
}
*(*int32)(unsafe.Pointer(&(_pPager.X38))) = _ii + i32(1)
_ii += 1
goto _8
_11:
func() {
if (_pPager.X38) != _nSavepoint {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53649), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpenSavepointØ00__func__Ø000))), unsafe.Pointer(str(53965)))
crt.X__builtin_abort(tls)
}
}()
_assertTruncateConstraint(tls, _pPager)
return _rc
}
var _pagerOpenSavepointØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_pagerOpenSavepointØ00__func__Ø000[0], str(53996), 19)
}
// Argument aWalData must point to an array of WAL_SAVEPOINT_NDATA u32
// values. This function populates the array with values required to
// "rollback" the write position of the WAL handle back to the current
// point in the event of a savepoint rollback (via WalSavepointUndo()).
func _sqlite3WalSavepoint(tls *crt.TLS, _pWal *XWal, _aWalData *uint32) {
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57300), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalSavepointØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(0)))) = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(2)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aWalData)) + 4*uintptr(i32(3)))) = _pWal.X22
}
var _sqlite3WalSavepointØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalSavepointØ00__func__Ø000[0], str(54015), 20)
}
func _assertTruncateConstraint(tls *crt.TLS, _pPager *XPager) {
_sqlite3PcacheIterateDirty(tls, (*XPCache)(_pPager.X59), _assertTruncateConstraintCb)
}
// For all dirty pages currently in the cache, invoke the specified
// callback. This is only used if the SQLITE_CHECK_PAGES macro is
// defined.
func _sqlite3PcacheIterateDirty(tls *crt.TLS, _pCache *XPCache, _xIter func(*crt.TLS, *XPgHdr)) {
var _pDirty *XPgHdr
_pDirty = (*XPgHdr)(_pCache.X0)
_0:
if _pDirty == nil {
goto _3
}
_xIter(tls, _pDirty)
_pDirty = (*XPgHdr)(_pDirty.X9)
goto _0
_3:
}
func _assertTruncateConstraintCb(tls *crt.TLS, _pPg *XPgHdr) {
func() {
if (int32(_pPg.X6) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50854), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000))), unsafe.Pointer(str(54035)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _subjRequiresPage(tls, _pPg) != 0 && (_pPg.X5) > ((*XPager)(_pPg.X4).X22) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50855), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertTruncateConstraintCbØ00__func__Ø000))), unsafe.Pointer(str(54058)))
crt.X__builtin_abort(tls)
}
}()
}
var _assertTruncateConstraintCbØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_assertTruncateConstraintCbØ00__func__Ø000[0], str(54115), 27)
}
// 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 _sqlite3BtreeGetMeta(tls *crt.TLS, _p *XBtree, _idx int32, _pMeta *uint32) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
func() {
if int32(_p.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67861), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000))), unsafe.Pointer(str(54142)))
crt.X__builtin_abort(tls)
}
}()
func() {
if i32(0) != _querySharedCacheTableLock(tls, _p, uint32(i32(1)), uint8(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67862), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000))), unsafe.Pointer(str(54164)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XMemPage)(_pBt.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67863), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000))), unsafe.Pointer(str(54228)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _idx < i32(0) || _idx > i32(15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetMetaØ00__func__Ø000))), unsafe.Pointer(str(54240)))
crt.X__builtin_abort(tls)
}
}()
if _idx == i32(15) {
*_pMeta = _sqlite3PagerDataVersion(tls, (*XPager)(_pBt.X0)) + (_p.X8)
goto _10
}
*_pMeta = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)+(_idx*i32(4))))))
_10:
_sqlite3BtreeLeave(tls, _p)
}
var _sqlite3BtreeGetMetaØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeGetMetaØ00__func__Ø000[0], str(54258), 20)
}
// Return the pPager->iDataVersion value
func _sqlite3PagerDataVersion(tls *crt.TLS, _pPager *XPager) (r0 uint32) {
func() {
if int32(_pPager.X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48656), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerDataVersionØ00__func__Ø000))), unsafe.Pointer(str(54278)))
crt.X__builtin_abort(tls)
}
}()
return _pPager.X39
}
var _sqlite3PagerDataVersionØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerDataVersionØ00__func__Ø000[0], str(54304), 24)
}
// Reset the schema for the database at index iDb. Also reset the
// TEMP schema.
func _sqlite3ResetOneSchema(tls *crt.TLS, _db *Xsqlite3, _iDb int32) {
var _pDb *XDb
func() {
if _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100217), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000))), unsafe.Pointer(str(54328)))
crt.X__builtin_abort(tls)
}
}()
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSchema)(_pDb.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000))), unsafe.Pointer(str(54340)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3SchemaClear(tls, _pDb.X4)
if _iDb != i32(1) {
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1))))
func() {
if (*XSchema)(_pDb.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResetOneSchemaØ00__func__Ø000))), unsafe.Pointer(str(54340)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3SchemaClear(tls, _pDb.X4)
}
}
var _sqlite3ResetOneSchemaØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ResetOneSchemaØ00__func__Ø000[0], str(54356), 22)
}
// Do both phases of a commit.
func _sqlite3BtreeCommit(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _rc int32
_sqlite3BtreeEnter(tls, _p)
_rc = _sqlite3BtreeCommitPhaseOne(tls, _p, nil)
if _rc == i32(0) {
_rc = _sqlite3BtreeCommitPhaseTwo(tls, _p, i32(0))
}
_sqlite3BtreeLeave(tls, _p)
return _rc
}
// 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. zMaster points to
// the name of a master journal file that should be written into the
// individual journal file, or is NULL, indicating no master journal file
// (single database transaction).
//
// When this is called, the master 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 _sqlite3BtreeCommitPhaseOne(tls *crt.TLS, _p *XBtree, _zMaster *int8) (r0 int32) {
var _rc int32
var _1_pBt *XBtShared
_rc = i32(0)
if int32(_p.X2) != i32(2) {
goto _0
}
_1_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
if (_1_pBt.X5) == 0 {
goto _1
}
_rc = _autoVacuumCommit(tls, _1_pBt)
if _rc != i32(0) {
_sqlite3BtreeLeave(tls, _p)
return _rc
}
_1:
if (_1_pBt.X7) != 0 {
_sqlite3PagerTruncateImage(tls, (*XPager)(_1_pBt.X0), _1_pBt.X18)
}
_rc = _sqlite3PagerCommitPhaseOne(tls, (*XPager)(_1_pBt.X0), _zMaster, i32(0))
_sqlite3BtreeLeave(tls, _p)
_0:
return _rc
}
// This routine is called prior to sqlite3PagerCommit when a transaction
// is committed for an auto-vacuum database.
//
// If SQLITE_OK is returned, then *pnTrunc is set to the number of pages
// the database file should be truncated to during the commit process.
// i.e. the database has been reorganized so that only the first *pnTrunc
// pages are in use.
func _autoVacuumCommit(tls *crt.TLS, _pBt *XBtShared) (r0 int32) {
var _rc, _nRef int32
var _1_nFin, _1_nFree, _1_iFree, _1_nOrig uint32
var _pPager *XPager
_rc = i32(0)
_pPager = (*XPager)(_pBt.X0)
_nRef = _sqlite3PagerRefcount(tls, _pPager)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62757), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_invalidateAllOverflowCache(tls, _pBt)
func() {
if (_pBt.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62759), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000))), unsafe.Pointer(str(54378)))
crt.X__builtin_abort(tls)
}
}()
if (_pBt.X6) != 0 {
goto _4
}
_1_nOrig = _btreePagecount(tls, _pBt)
if (_ptrmapPageno(tls, _pBt, _1_nOrig) == _1_nOrig) || (_1_nOrig == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
return _sqlite3CorruptError(tls, i32(62772))
}
_1_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))))
_1_nFin = _finalDbSize(tls, _pBt, _1_nOrig, _1_nFree)
if _1_nFin > _1_nOrig {
return _sqlite3CorruptError(tls, i32(62777))
}
if _1_nFin < _1_nOrig {
_rc = _saveAllCursors(tls, _pBt, uint32(i32(0)), nil)
}
_1_iFree = _1_nOrig
_9:
if _1_iFree <= _1_nFin || _rc != i32(0) {
goto _13
}
_rc = _incrVacuumStep(tls, _pBt, _1_nFin, _1_iFree, i32(1))
_1_iFree -= 1
goto _9
_13:
if ((_rc == i32(101)) || (_rc == i32(0))) && (_1_nFree > uint32(i32(0))) {
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))), uint32(i32(0)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))), uint32(i32(0)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _1_nFin)
*(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) = _1_nFin
}
if _rc != i32(0) {
_sqlite3PagerRollback(tls, _pPager)
}
_4:
func() {
if _nRef < _sqlite3PagerRefcount(tls, _pPager) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62797), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoVacuumCommitØ00__func__Ø000))), unsafe.Pointer(str(54394)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _autoVacuumCommitØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_autoVacuumCommitØ00__func__Ø000[0], str(54429), 17)
}
// Invalidate the overflow page-list cache for all cursors opened
// on the shared btree structure pBt.
func _invalidateAllOverflowCache(tls *crt.TLS, _pBt *XBtShared) {
var _p *XBtCursor
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59514), unsafe.Pointer((*int8)(unsafe.Pointer(&_invalidateAllOverflowCacheØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XBtCursor)(_pBt.X2)
_2:
if _p == nil {
goto _5
}
{
p := (*uint8)(unsafe.Pointer(&(_p.X10)))
*p = uint8(int32(*p) & i32(-5))
sink2 = *p
}
_p = (*XBtCursor)(_p.X2)
goto _2
_5:
}
var _invalidateAllOverflowCacheØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_invalidateAllOverflowCacheØ00__func__Ø000[0], str(54446), 27)
}
// The database opened by the first argument is an auto-vacuum database
// nOrig pages in size containing nFree free pages. Return the expected
// size of the database in pages following an auto-vacuum operation.
func _finalDbSize(tls *crt.TLS, _pBt *XBtShared, _nOrig uint32, _nFree uint32) (r0 uint32) {
var _nEntry int32
var _nPtrmap, _nFin uint32
_nEntry = int32((_pBt.X16) / uint32(i32(5)))
_nPtrmap = (((_nFree - _nOrig) + _ptrmapPageno(tls, _pBt, _nOrig)) + uint32(_nEntry)) / uint32(_nEntry)
_nFin = (_nOrig - _nFree) - _nPtrmap
if (_nOrig > ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) && (_nFin < ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
_nFin -= 1
}
_1:
if (_ptrmapPageno(tls, _pBt, _nFin) == _nFin) || (_nFin == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
_nFin -= 1
goto _1
}
return _nFin
}
// Perform a single step of an incremental-vacuum. If successful, return
// SQLITE_OK. If there is no work to do (and therefore no point in
// calling this function again), return SQLITE_DONE. Or, if an error
// occurs, return some other error code.
//
// More specifically, this function attempts to re-organize the database so
// that the last page of the file currently in use is no longer in use.
//
// Parameter nFin is the number of pages that this database would contain
// were this function called until it returns SQLITE_DONE.
//
// If the bCommit parameter is non-zero, this function assumes that the
// caller will keep calling incrVacuumStep() until it returns SQLITE_DONE
// or an error. bCommit is passed true for an auto-vacuum-on-commit
// operation, or false for an incremental vacuum.
func _incrVacuumStep(tls *crt.TLS, _pBt *XBtShared, _nFin uint32, _iLastPg uint32, _bCommit int32) (r0 int32) {
var _rc int32
var _nFreeList, _1_iPtrPage, _6_iFreePg, _8_iFreePg, _8_iNear uint32
var _1_eType, _8_eMode uint8
var _6_pFreePg, _8_pLastPg, _11_pFreePg *XMemPage
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62592), unsafe.Pointer((*int8)(unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iLastPg <= _nFin {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62593), unsafe.Pointer((*int8)(unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000))), unsafe.Pointer(str(54473)))
crt.X__builtin_abort(tls)
}
}()
if _ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg || _iLastPg == ((uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1))) {
goto _5
}
_nFreeList = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))))
if _nFreeList == uint32(i32(0)) {
return i32(101)
}
_rc = _ptrmapGet(tls, _pBt, _iLastPg, &_1_eType, &_1_iPtrPage)
if _rc != i32(0) {
return _rc
}
if int32(_1_eType) == i32(1) {
return _sqlite3CorruptError(tls, i32(62609))
}
if int32(_1_eType) != i32(2) {
goto _9
}
if _bCommit != i32(0) {
goto _10
}
_rc = _allocateBtreePage(tls, _pBt, &_6_pFreePg, &_6_iFreePg, _iLastPg, uint8(i32(1)))
if _rc != i32(0) {
return _rc
}
func() {
if _6_iFreePg != _iLastPg {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62625), unsafe.Pointer((*int8)(unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000))), unsafe.Pointer(str(54486)))
crt.X__builtin_abort(tls)
}
}()
_releasePage(tls, _6_pFreePg)
_10:
goto _14
_9:
_8_eMode = u8(0)
_8_iNear = u32(0)
_rc = _btreeGetPage(tls, _pBt, _iLastPg, &_8_pLastPg, i32(0))
if _rc != i32(0) {
return _rc
}
if _bCommit == i32(0) {
_8_eMode = uint8(i32(2))
_8_iNear = _nFin
}
_16:
_rc = _allocateBtreePage(tls, _pBt, &_11_pFreePg, &_8_iFreePg, _8_iNear, _8_eMode)
if _rc != i32(0) {
_releasePage(tls, _8_pLastPg)
return _rc
}
_releasePage(tls, _11_pFreePg)
if _bCommit != 0 && (_8_iFreePg > _nFin) {
goto _16
}
func() {
if _8_iFreePg >= _iLastPg {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62659), unsafe.Pointer((*int8)(unsafe.Pointer(&_incrVacuumStepØ00__func__Ø000))), unsafe.Pointer(str(54503)))
crt.X__builtin_abort(tls)
}
}()
_rc = _relocatePage(tls, _pBt, _8_pLastPg, _1_eType, _1_iPtrPage, _8_iFreePg, _bCommit)
_releasePage(tls, _8_pLastPg)
if _rc != i32(0) {
return _rc
}
_14:
_5:
if _bCommit != i32(0) {
goto _23
}
_24:
_iLastPg -= 1
if (_iLastPg == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _iLastPg) == _iLastPg) {
goto _24
}
*(*uint8)(unsafe.Pointer(&(_pBt.X7))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) = _iLastPg
_23:
return i32(0)
}
var _incrVacuumStepØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_incrVacuumStepØ00__func__Ø000[0], str(54519), 15)
}
// Allocate a new page from the database file.
//
// The new page is marked as dirty. (In other words, sqlite3PagerWrite()
// has already been called on the new page.) The new page has also
// been referenced and the calling routine is responsible for calling
// sqlite3PagerUnref() on the new page when it is done.
//
// SQLITE_OK is returned on success. Any other return value indicates
// an error. *ppPage is set to NULL in the event of an error.
//
// If the "nearby" parameter is not 0, then an effort is made to
// locate a page close to the page number "nearby". This can be used in an
// attempt to keep related pages close to each other in the database file,
// which in turn can make database access faster.
//
// If the eMode parameter is BTALLOC_EXACT and the nearby page exists
// anywhere on the free-list, then it is guaranteed to be returned. If
// eMode is BTALLOC_LT then the page returned will be less than or equal
// to nearby if any such page exists. If eMode is BTALLOC_ANY then there
// are no restrictions on which page is returned.
func _allocateBtreePage(tls *crt.TLS, _pBt *XBtShared, _ppPage **XMemPage, _pPgno *uint32, _nearby uint32, _eMode uint8) (r0 int32) {
var _rc, _34_dist, _35_d2, _39_noContent, _43_bNoContent int32
var _n, _k, _mxPage, _2_iTrunk, _2_nSearch, _22_iNewTrunk, _29_closest, _29_iPage, _30_i uint32
var _2_searchList, _4_eType uint8
var _29_aData *uint8
var _pPage1, _pTrunk, _pPrevTrunk, _22_pNewTrunk, _44_pPg *XMemPage
_pTrunk = nil
_pPrevTrunk = nil
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64690), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eMode) != i32(0) && (_nearby <= uint32(i32(0)) || (_pBt.X5) == 0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64691), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54534)))
crt.X__builtin_abort(tls)
}
}()
_pPage1 = (*XMemPage)(_pBt.X3)
_mxPage = _btreePagecount(tls, _pBt)
_n = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))))
if _n >= _mxPage {
return _sqlite3CorruptError(tls, i32(64699))
}
if _n <= uint32(i32(0)) {
goto _7
}
_2_searchList = u8(0)
_2_nSearch = u32(0)
if int32(_eMode) != i32(1) {
goto _8
}
if _nearby > _mxPage {
goto _9
}
func() {
if _nearby <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64715), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54599)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pBt.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64716), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54378)))
crt.X__builtin_abort(tls)
}
}()
_rc = _ptrmapGet(tls, _pBt, _nearby, &_4_eType, nil)
if _rc != 0 {
return _rc
}
if int32(_4_eType) == i32(2) {
_2_searchList = uint8(i32(1))
}
_9:
goto _17
_8:
if int32(_eMode) == i32(2) {
_2_searchList = uint8(i32(1))
}
_17:
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.X23))
if _rc != 0 {
return _rc
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))), _n-uint32(i32(1)))
_19:
_pPrevTrunk = _pTrunk
if _pPrevTrunk != nil {
_2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0)))))
goto _21
}
_2_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))))
_21:
if (_2_iTrunk > _mxPage) || (postInc5(&_2_nSearch, uint32(1)) > _n) {
_rc = _sqlite3CorruptError(tls, i32(64755))
goto _24
}
_rc = _btreeGetUnusedPage(tls, _pBt, _2_iTrunk, &_pTrunk, i32(0))
_24:
if _rc != 0 {
_pTrunk = nil
goto _end_allocate_page
}
func() {
if _pTrunk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64763), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54608)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTrunk.X19) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64764), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54618)))
crt.X__builtin_abort(tls)
}
}()
_k = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4)))))
if _k != uint32(i32(0)) || _2_searchList != 0 {
goto _31
}
func() {
if _pPrevTrunk != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64772), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54635)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.X23))
if _rc != 0 {
goto _end_allocate_page
}
*_pPgno = _2_iTrunk
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint32(i32(4)))
*_ppPage = _pTrunk
_pTrunk = nil
goto _57
_31:
if _k > (((_pBt.X16) / uint32(i32(4))) - uint32(i32(2))) {
_rc = _sqlite3CorruptError(tls, i32(64784))
goto _end_allocate_page
}
if _2_searchList == 0 || _nearby != _2_iTrunk && (_2_iTrunk >= _nearby || int32(_eMode) != i32(2)) {
goto _41
}
*_pPgno = _2_iTrunk
*_ppPage = _pTrunk
_2_searchList = uint8(i32(0))
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.X23))
if _rc != 0 {
goto _end_allocate_page
}
if _k != uint32(i32(0)) {
goto _43
}
if _pPrevTrunk == nil {
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint32(i32(4)))
goto _45
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.X23))
if _rc != i32(0) {
goto _end_allocate_page
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint32(i32(4)))
_45:
goto _47
_43:
_22_iNewTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(8)))))
if _22_iNewTrunk > _mxPage {
_rc = _sqlite3CorruptError(tls, i32(64818))
goto _end_allocate_page
}
_rc = _btreeGetUnusedPage(tls, _pBt, _22_iNewTrunk, &_22_pNewTrunk, i32(0))
if _rc != i32(0) {
goto _end_allocate_page
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_22_pNewTrunk.X23))
if _rc != i32(0) {
_releasePage(tls, _22_pNewTrunk)
goto _end_allocate_page
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(0))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(0))))), uint32(i32(4)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(4)))), _k-uint32(i32(1)))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_22_pNewTrunk.X19))+1*uintptr(i32(8))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(12))))), (_k-uint32(i32(1)))*uint32(i32(4)))
_releasePage(tls, _22_pNewTrunk)
if _pPrevTrunk == nil {
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage1.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64836), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54649)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))), _22_iNewTrunk)
goto _54
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPrevTrunk.X23))
if _rc != 0 {
goto _end_allocate_page
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrevTrunk.X19))+1*uintptr(i32(0)))), _22_iNewTrunk)
_54:
_47:
_pTrunk = nil
goto _57
_41:
if _k <= uint32(i32(0)) {
goto _57
}
_29_aData = _pTrunk.X19
if _nearby <= uint32(i32(0)) {
goto _58
}
_29_closest = uint32(i32(0))
if int32(_eMode) != i32(2) {
goto _59
}
_30_i = uint32(i32(0))
_60:
if _30_i >= _k {
goto _63
}
_29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4)))))))
if _29_iPage <= _nearby {
_29_closest = _30_i
goto _63
}
_30_i += 1
goto _60
_63:
goto _65
_59:
_34_dist = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(i32(8)))))-_nearby))
_30_i = uint32(i32(1))
_66:
if _30_i >= _k {
goto _69
}
_35_d2 = _sqlite3AbsInt32(tls, int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_30_i*uint32(i32(4)))))))-_nearby))
if _35_d2 < _34_dist {
_29_closest = _30_i
_34_dist = _35_d2
}
_30_i += 1
goto _66
_69:
_65:
goto _71
_58:
_29_closest = uint32(i32(0))
_71:
_29_iPage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4)))))))
if _29_iPage > _mxPage {
_rc = _sqlite3CorruptError(tls, i32(64883))
goto _end_allocate_page
}
if _2_searchList != 0 && (_29_iPage != _nearby && (_29_iPage >= _nearby || int32(_eMode) != i32(2))) {
goto _76
}
*_pPgno = _29_iPage
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.X23))
if _rc != 0 {
goto _end_allocate_page
}
if _29_closest < (_k - uint32(i32(1))) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(8))+(_29_closest*uint32(i32(4))))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(uint32(i32(4))+(_k*uint32(i32(4))))))), uint32(i32(4)))
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_29_aData))+1*uintptr(i32(4)))), _k-uint32(i32(1)))
_39_noContent = func() int32 {
if _btreeGetHasContent(tls, _pBt, *_pPgno) == 0 {
return i32(1)
}
return i32(0)
}()
_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _39_noContent)
if _rc != i32(0) {
goto _81
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).X23))
if _rc != i32(0) {
_releasePage(tls, *_ppPage)
*_ppPage = nil
}
_81:
_2_searchList = uint8(i32(0))
_76:
_57:
_releasePage(tls, _pPrevTrunk)
_pPrevTrunk = nil
if _2_searchList != 0 {
goto _19
}
goto _83
_7:
_43_bNoContent = func() int32 {
if i32(0) == int32(_pBt.X7) {
return i32(1)
}
return i32(0)
}()
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23))
if _rc != 0 {
return _rc
}
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1
if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1
}
if (_pBt.X5) == 0 || _ptrmapPageno(tls, _pBt, _pBt.X18) != (_pBt.X18) {
goto _89
}
_44_pPg = nil
func() {
if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64950), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54690)))
crt.X__builtin_abort(tls)
}
}()
_rc = _btreeGetUnusedPage(tls, _pBt, _pBt.X18, &_44_pPg, _43_bNoContent)
if _rc == i32(0) {
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_44_pPg.X23))
_releasePage(tls, _44_pPg)
}
if _rc != 0 {
return _rc
}
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1
if (_pBt.X18) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
*(*uint32)(unsafe.Pointer(&(_pBt.X18))) += 1
}
_89:
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(28))))))+uintptr(unsafe.Pointer((*XMemPage)(_pBt.X3).X19)))), _pBt.X18)
*_pPgno = _pBt.X18
func() {
if (*_pPgno) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64964), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54725)))
crt.X__builtin_abort(tls)
}
}()
_rc = _btreeGetUnusedPage(tls, _pBt, *_pPgno, _ppPage, _43_bNoContent)
if _rc != 0 {
return _rc
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*_ppPage).X23))
if _rc != i32(0) {
_releasePage(tls, *_ppPage)
*_ppPage = nil
}
_83:
func() {
if (*_pPgno) == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64975), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54725)))
crt.X__builtin_abort(tls)
}
}()
_end_allocate_page:
_releasePage(tls, _pTrunk)
_releasePage(tls, _pPrevTrunk)
func() {
if _rc == i32(0) && _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).X23)) > i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64980), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54756)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc == i32(0) && int32((*_ppPage).X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64981), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateBtreePageØ00__func__Ø000))), unsafe.Pointer(str(54821)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_ = _2_nSearch
panic(0)
}
var _allocateBtreePageØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_allocateBtreePageØ00__func__Ø000[0], str(54859), 18)
}
// Get an unused page.
//
// This works just like btreeGetPage() with the addition:
//
// * If the page is already in use for some other purpose, immediately
// release it and return an SQLITE_CURRUPT error.
// * Make sure the isInit flag is clear
func _btreeGetUnusedPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _flags int32) (r0 int32) {
var _rc int32
_rc = _btreeGetPage(tls, _pBt, _pgno, _ppPage, _flags)
if _rc != i32(0) {
goto _0
}
if _sqlite3PagerPageRefcount(tls, (*XPgHdr)((*_ppPage).X23)) > i32(1) {
_releasePage(tls, *_ppPage)
*_ppPage = nil
return _sqlite3CorruptError(tls, i32(61159))
}
*(*uint8)(unsafe.Pointer(&((*_ppPage).X0))) = uint8(i32(0))
goto _2
_0:
*_ppPage = nil
_2:
return _rc
}
// Return the number of references to the specified page.
func _sqlite3PagerPageRefcount(tls *crt.TLS, _pPage *XPgHdr) (r0 int32) {
return _sqlite3PcachePageRefcount(tls, _pPage)
}
// Compute the absolute value of a 32-bit signed integer, of possible. Or
// if the integer has a value of -2147483648, return +2147483647
func _sqlite3AbsInt32(tls *crt.TLS, _x int32) (r0 int32) {
if _x >= i32(0) {
return _x
}
if _x == i32(-2147483648) {
return i32(2147483647)
}
return -_x
}
// Query the BtShared.pHasContent vector.
//
// This function is called when a free-list leaf page is removed from the
// free-list for reuse. It returns false if it is safe to retrieve the
// page from the pager layer with the 'no-content' flag set. True otherwise.
func _btreeGetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
var _p *XBitvec
_p = (*XBitvec)(_pBt.X22)
return bool2int((_p != nil) && ((_pgno > _sqlite3BitvecSize(tls, _p)) || _sqlite3BitvecTest(tls, _p, _pgno) != 0))
}
// Return the value of the iSize parameter specified when Bitvec *p
// was created.
func _sqlite3BitvecSize(tls *crt.TLS, _p *XBitvec) (r0 uint32) {
return _p.X0
}
// Move the open database page pDbPage to location iFreePage in the
// database. The pDbPage reference remains valid.
//
// The isCommit flag indicates that there is no need to remember that
// the journal needs to be sync()ed before database page pDbPage->pgno
// can be written to. The caller has already promised not to write to that
// page.
func _relocatePage(tls *crt.TLS, _pBt *XBtShared, _pDbPage *XMemPage, _eType uint8, _iPtrPage uint32, _iFreePage uint32, _isCommit int32) (r0 int32) {
var _rc int32
var _iDbPage, _4_nextOvfl uint32
var _pPager *XPager
var _pPtrPage *XMemPage
_iDbPage = _pDbPage.X4
_pPager = (*XPager)(_pBt.X0)
func() {
if int32(_eType) != i32(4) && int32(_eType) != i32(3) && int32(_eType) != i32(5) && int32(_eType) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62508), unsafe.Pointer((*int8)(unsafe.Pointer(&_relocatePageØ00__func__Ø000))), unsafe.Pointer(str(54877)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62510), unsafe.Pointer((*int8)(unsafe.Pointer(&_relocatePageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtShared)(_pDbPage.X18) != _pBt {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62511), unsafe.Pointer((*int8)(unsafe.Pointer(&_relocatePageØ00__func__Ø000))), unsafe.Pointer(str(54977)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerMovepage(tls, _pPager, (*XPgHdr)(_pDbPage.X23), _iFreePage, _isCommit)
if _rc != i32(0) {
return _rc
}
*(*uint32)(unsafe.Pointer(&(_pDbPage.X4))) = _iFreePage
if int32(_eType) != i32(5) && int32(_eType) != i32(1) {
goto _11
}
_rc = _setChildPtrmaps(tls, _pDbPage)
if _rc != i32(0) {
return _rc
}
goto _13
_11:
_4_nextOvfl = _sqlite3Get4byte(tls, _pDbPage.X19)
if _4_nextOvfl == uint32(i32(0)) {
goto _14
}
_ptrmapPut(tls, _pBt, _4_nextOvfl, uint8(i32(4)), _iFreePage, &_rc)
if _rc != i32(0) {
return _rc
}
_14:
_13:
if int32(_eType) == i32(1) {
goto _16
}
_rc = _btreeGetPage(tls, _pBt, _iPtrPage, &_pPtrPage, i32(0))
if _rc != i32(0) {
return _rc
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPtrPage.X23))
if _rc != i32(0) {
_releasePage(tls, _pPtrPage)
return _rc
}
_rc = _modifyPagePointer(tls, _pPtrPage, _iDbPage, _iFreePage, _eType)
_releasePage(tls, _pPtrPage)
if _rc == i32(0) {
_ptrmapPut(tls, _pBt, _iFreePage, _eType, _iPtrPage, &_rc)
}
_16:
return _rc
}
var _relocatePageØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_relocatePageØ00__func__Ø000[0], str(54995), 13)
}
// Move the page pPg to location pgno in the file.
//
// There must be no references to the page previously located at
// pgno (which we call pPgOld) though that page is allowed to be
// in cache. If the page previously located at pgno is not already
// in the rollback journal, it is not put there by by this routine.
//
// References to the page pPg remain valid. Updating any
// meta-data associated with pPg (i.e. data stored in the nExtra bytes
// allocated along with the page) is the responsibility of the caller.
//
// A transaction must be active when this routine is called. It used to be
// required that a statement transaction was not active, but this restriction
// has been removed (CREATE INDEX needs to move a page when a statement
// transaction is active).
//
// If the fourth argument, isCommit, is non-zero, then this page is being
// moved as part of a database reorganization just before the transaction
// is being committed. In this case, it is guaranteed that the database page
// pPg refers to will not be written to again within this transaction.
//
// This function may return SQLITE_NOMEM or an IO error code if an error
// occurs. Otherwise, it returns SQLITE_OK.
func _sqlite3PagerMovepage(tls *crt.TLS, _pPager *XPager, _pPg *XPgHdr, _pgno uint32, _isCommit int32) (r0 int32) {
var _rc int32
var _needSyncPgno, _origPgno uint32
var _pPgOld, _8_pPgHdr *XPgHdr
_needSyncPgno = u32(0)
func() {
if int32(_pPg.X7) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55008)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55020)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53890), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X10) == 0 && (_pPager.X13) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53895), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55096)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X10) == 0 {
goto _10
}
_rc = _sqlite3PagerWrite(tls, _pPg)
if _rc != 0 {
return _rc
}
_10:
if ((int32(_pPg.X6) & i32(2)) != i32(0)) && (i32(0) != store1(&_rc, _subjournalPageIfRequired(tls, _pPg))) {
return _rc
}
if (int32(_pPg.X6)&i32(8)) != 0 && (_isCommit == 0) {
_needSyncPgno = _pPg.X5
func() {
if int32(_pPager.X2) != i32(2) && _pageInJournal(tls, _pPager, _pPg) == 0 && (_pPg.X5) <= (_pPager.X23) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53938), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55123)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pPg.X6) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53940), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(54035)))
crt.X__builtin_abort(tls)
}
}()
}
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) & i32(-9))
sink14 = *p
}
_pPgOld = _sqlite3PagerLookup(tls, _pPager, _pgno)
func() {
if _pPgOld != nil && int32(_pPgOld.X7) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53950), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55228)))
crt.X__builtin_abort(tls)
}
}()
if _pPgOld == nil {
goto _25
}
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) | (int32(_pPgOld.X6) & i32(8)))
sink14 = *p
}
if (_pPager.X10) != 0 {
_sqlite3PcacheMove(tls, _pPgOld, (_pPager.X22)+uint32(i32(1)))
goto _27
}
_sqlite3PcacheDrop(tls, _pPgOld)
_27:
_25:
_origPgno = _pPg.X5
_sqlite3PcacheMove(tls, _pPg, _pgno)
_sqlite3PcacheMakeDirty(tls, _pPg)
if ((_pPager.X10) != 0) && (_pPgOld != nil) {
_sqlite3PcacheMove(tls, _pPgOld, _origPgno)
_sqlite3PagerUnrefNotNull(tls, _pPgOld)
}
if _needSyncPgno == 0 {
goto _30
}
_rc = _sqlite3PagerGet(tls, _pPager, _needSyncPgno, &_8_pPgHdr, i32(0))
if _rc == i32(0) {
goto _31
}
if _needSyncPgno <= (_pPager.X23) {
func() {
if (_pPager.X58) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMovepageØ00__func__Ø000))), unsafe.Pointer(str(55255)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BitvecClear(tls, (*XBitvec)(_pPager.X30), _needSyncPgno, (unsafe.Pointer)(_pPager.X58))
}
return _rc
_31:
{
p := (*uint16)(unsafe.Pointer(&(_8_pPgHdr.X6)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
_sqlite3PcacheMakeDirty(tls, _8_pPgHdr)
_sqlite3PagerUnrefNotNull(tls, _8_pPgHdr)
_30:
return i32(0)
}
var _sqlite3PagerMovepageØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerMovepageØ00__func__Ø000[0], str(55276), 21)
}
// Change the page number of page p to newPgno.
func _sqlite3PcacheMove(tls *crt.TLS, _p *XPgHdr, _newPgno uint32) {
var _pCache *XPCache
_pCache = (*XPCache)(_p.X8)
func() {
if int32(_p.X7) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44751), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _newPgno <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44752), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000))), unsafe.Pointer(str(55297)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44753), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheMoveØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3_pcache_page, uint32, uint32))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32)
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X9)})))(tls, _pCache.X12, (*Xsqlite3_pcache_page)(_p.X0), _p.X5, _newPgno)
*(*uint32)(unsafe.Pointer(&(_p.X5))) = _newPgno
if (int32(_p.X6)&i32(2)) != 0 && (int32(_p.X6)&i32(8)) != 0 {
_pcacheManageDirtyList(tls, _p, uint8(i32(3)))
}
}
var _sqlite3PcacheMoveØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheMoveØ00__func__Ø000[0], str(55307), 18)
}
// 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 _sqlite3BitvecClear(tls *crt.TLS, _p *XBitvec, _i uint32, _pBuf unsafe.Pointer) {
var _1_bin, _4_j, _6_h uint32
var _4_aiValues *uint32
if _p == nil {
return
}
func() {
if _i <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(43951), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BitvecClearØ00__func__Ø000))), unsafe.Pointer(str(12970)))
crt.X__builtin_abort(tls)
}
}()
_i -= 1
_3:
if (_p.X2) == 0 {
goto _4
}
_1_bin = _i / (_p.X2)
_i = _i % (_p.X2)
_p = *(**XBitvec)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]unsafe.Pointer)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_1_bin)))
if _p == nil {
return
}
goto _3
_4:
if (_p.X0) <= u32(4000) {
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[500]uint8)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_i/uint32(i32(8)))))
*p = uint8(int32(*p) & (^(i32(1) << uint(int32(_i&uint32(i32(7)))))))
sink2 = *p
}
goto _7
}
_4_aiValues = (*uint32)(_pBuf)
crt.Xmemcpy(tls, (unsafe.Pointer)(_4_aiValues), (unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), u32(500))
crt.Xmemset(tls, (unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3)))))), i32(0), u32(500))
*(*uint32)(unsafe.Pointer(&(_p.X1))) = uint32(i32(0))
_4_j = uint32(i32(0))
_8:
if _4_j >= u32(125) {
goto _11
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))) == 0 || (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))) == (_i+uint32(i32(1))) {
goto _13
}
_6_h = (((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))) - uint32(i32(1))) * uint32(i32(1))) % u32(125)
*(*uint32)(unsafe.Pointer(&(_p.X1))) += 1
_14:
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_6_h)))) == 0 {
goto _15
}
_6_h += 1
if _6_h >= u32(125) {
_6_h = uint32(i32(0))
}
goto _14
_15:
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[125]uint32)(unsafe.Pointer((*t22)(unsafe.Pointer(&(_p.X3))))))) + 4*uintptr(_6_h))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_aiValues)) + 4*uintptr(_4_j)))
_13:
_4_j += 1
goto _8
_11:
_7:
}
var _sqlite3BitvecClearØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BitvecClearØ00__func__Ø000[0], str(55325), 19)
}
// Set the pointer-map entries for all children of page pPage. Also, if
// pPage contains cells that point to overflow pages, set the pointer
// map entries for the overflow pages as well.
func _setChildPtrmaps(tls *crt.TLS, _pPage *XMemPage) (r0 int32) {
var _i, _nCell, _rc int32
var _pgno, _2_childPgno, _3_childPgno uint32
var _1_pCell *uint8
var _pBt *XBtShared
_pBt = (*XBtShared)(_pPage.X18)
_pgno = _pPage.X4
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62396), unsafe.Pointer((*int8)(unsafe.Pointer(&_setChildPtrmapsØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
_rc = _btreeInitPage(tls, _pPage)
if _rc != i32(0) {
return _rc
}
_nCell = int32(_pPage.X14)
_i = i32(0)
_3:
if _i >= _nCell {
goto _6
}
_1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))< uint32(i32(65536)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60845), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(53374)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pPage.X15))) = uint16((_1_pBt.X15) - uint32(i32(1)))
*(*uint8)(unsafe.Pointer(&(_pPage.X9))) = uint8(i32(0))
_1_usableSize = int32(_1_pBt.X16)
*(*uint16)(unsafe.Pointer(&(_pPage.X12))) = store14(&_1_cellOffset, uint16((int32(_1_hdr)+i32(8))+int32(_pPage.X7)))
*(**uint8)(unsafe.Pointer(&(_pPage.X20))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_1_usableSize)))
*(**uint8)(unsafe.Pointer(&(_pPage.X21))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_1_cellOffset)))
*(**uint8)(unsafe.Pointer(&(_pPage.X22))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(_pPage.X7)))
_1_top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1)
*(*uint16)(unsafe.Pointer(&(_pPage.X14))) = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(3)))))) + 1*uintptr(i32(1))))))
if uint32(_pPage.X14) > (((_1_pBt.X15) - uint32(i32(8))) / uint32(i32(6))) {
return _sqlite3CorruptError(tls, i32(60862))
}
func() {
if int32(_pPage.X14) <= i32(0) && _1_top != _1_usableSize && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60869), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeInitPageØ00__func__Ø000))), unsafe.Pointer(str(55542)))
crt.X__builtin_abort(tls)
}
}()
_1_iCellFirst = int32(_1_cellOffset) + (i32(2) * int32(_pPage.X14))
_1_iCellLast = _1_usableSize - i32(4)
if (((*Xsqlite3)(_1_pBt.X1).X6) & i32(536870912)) == 0 {
goto _22
}
if (_pPage.X5) == 0 {
_1_iCellLast -= 1
}
_3_i = i32(0)
_24:
if _3_i >= int32(_pPage.X14) {
goto _27
}
_1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_cellOffset)+(_3_i*i32(2))))))) + 1*uintptr(i32(1)))))
if (_1_pc < _1_iCellFirst) || (_1_pc > _1_iCellLast) {
return _sqlite3CorruptError(tls, i32(60890))
}
_3_sz = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc)))))
if (_1_pc + _3_sz) > _1_usableSize {
return _sqlite3CorruptError(tls, i32(60895))
}
_3_i += 1
goto _24
_27:
if (_pPage.X5) == 0 {
_1_iCellLast += 1
}
_22:
_1_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(int32(_1_hdr)+i32(1)))))) + 1*uintptr(i32(1)))))
_1_nFree = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data)) + 1*uintptr(int32(_1_hdr)+i32(7))))) + _1_top
if _1_pc <= i32(0) {
goto _32
}
if _1_pc < _1_iCellFirst {
return _sqlite3CorruptError(tls, i32(60913))
}
_33:
if _1_pc > _1_iCellLast {
return _sqlite3CorruptError(tls, i32(60917))
}
_7_next = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc))))) + 1*uintptr(i32(1))))))
_7_size = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_data))+1*uintptr(_1_pc+i32(2)))))) + 1*uintptr(i32(1))))))
_1_nFree = int32(uint32(_1_nFree) + _7_size)
if _7_next <= ((uint32(_1_pc) + _7_size) + uint32(i32(3))) {
goto _35
}
_1_pc = int32(_7_next)
goto _33
_35:
if _7_next > uint32(i32(0)) {
return _sqlite3CorruptError(tls, i32(60926))
}
if (uint32(_1_pc) + _7_size) > uint32(_1_usableSize) {
return _sqlite3CorruptError(tls, i32(60929))
}
_32:
if _1_nFree > _1_usableSize {
return _sqlite3CorruptError(tls, i32(60941))
}
*(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16(_1_nFree - _1_iCellFirst)
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(1))
_12:
return i32(0)
}
var _btreeInitPageØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_btreeInitPageØ00__func__Ø000[0], str(55590), 14)
}
// If the cell pCell, part of page pPage contains a pointer
// to an overflow page, insert an entry into the pointer-map
// for the overflow page.
func _ptrmapPutOvflPtr(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pRC *int32) {
var _1_ovfl uint32
var _info XCellInfo
if (*_pRC) != 0 {
return
}
func() {
if _pCell == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60344), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutOvflPtrØ00__func__Ø000))), unsafe.Pointer(str(55604)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, &_info)
if uint32(_info.X3) < (_info.X2) {
_1_ovfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(int32(_info.X4)-i32(4)))))
_ptrmapPut(tls, (*XBtShared)(_pPage.X18), _1_ovfl, uint8(i32(3)), _pPage.X4, _pRC)
}
_ = _info
}
var _ptrmapPutOvflPtrØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_ptrmapPutOvflPtrØ00__func__Ø000[0], str(55613), 17)
}
// Write an entry into the pointer map.
//
// This routine updates the pointer map entry for page number 'key'
// so that it maps to type 'eType' and parent page number 'pgno'.
//
// If *pRC is initially non-zero (non-SQLITE_OK) then this routine is
// a no-op. If an error occurs, the appropriate error code is written
// into *pRC.
func _ptrmapPut(tls *crt.TLS, _pBt *XBtShared, _key uint32, _eType uint8, _parent uint32, _pRC *int32) {
var _offset, _rc int32
var _iPtrmap uint32
var _pPtrmap *uint8
var _pDbPage *XPgHdr
if (*_pRC) != 0 {
return
}
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59967), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if i32(0) != bool2int(_ptrmapPageno(tls, _pBt, (uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1))) == ((uint32(_sqlite3PendingByte)/(_pBt.X15))+uint32(i32(1)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59969), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(55630)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pBt.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59971), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(54378)))
crt.X__builtin_abort(tls)
}
}()
if _key == uint32(i32(0)) {
*_pRC = _sqlite3CorruptError(tls, i32(59973))
return
}
_iPtrmap = _ptrmapPageno(tls, _pBt, _key)
_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.X0), _iPtrmap, &_pDbPage, i32(0))
if _rc != i32(0) {
*_pRC = _rc
return
}
_offset = int32(uint32(i32(5)) * ((_key - _iPtrmap) - uint32(i32(1))))
if _offset < i32(0) {
*_pRC = _sqlite3CorruptError(tls, i32(59984))
goto _ptrmap_exit
}
func() {
if _offset > (int32(_pBt.X16) - i32(5)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59987), unsafe.Pointer((*int8)(unsafe.Pointer(&_ptrmapPutØ00__func__Ø000))), unsafe.Pointer(str(20097)))
crt.X__builtin_abort(tls)
}
}()
_pPtrmap = (*uint8)(_sqlite3PagerGetData(tls, _pDbPage))
if int32(_eType) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset)))) && _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1))))) == _parent {
goto _ptrmap_exit
}
*_pRC = store1(&_rc, _sqlite3PagerWrite(tls, _pDbPage))
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap)) + 1*uintptr(_offset))) = _eType
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPtrmap))+1*uintptr(_offset+i32(1)))), _parent)
}
_ptrmap_exit:
_sqlite3PagerUnref(tls, _pDbPage)
}
var _ptrmapPutØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_ptrmapPutØ00__func__Ø000[0], str(55676), 10)
}
// Somewhere on pPage is a pointer to page iFrom. Modify this pointer so
// that it points to iTo. Parameter eType describes the type of pointer to
// be modified, as follows:
//
// PTRMAP_BTREE: pPage is a btree-page. The pointer points at a child
// page of pPage.
//
// PTRMAP_OVERFLOW1: pPage is a btree-page. The pointer points at an overflow
// page pointed to by one of the cells on pPage.
//
// PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next
// overflow page in the list.
func _modifyPagePointer(tls *crt.TLS, _pPage *XMemPage, _iFrom uint32, _iTo uint32, _eType uint8) (r0 int32) {
var _3_i, _3_nCell, _3_rc int32
var _4_pCell *uint8
var _5_info XCellInfo
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62435), unsafe.Pointer((*int8)(unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62436), unsafe.Pointer((*int8)(unsafe.Pointer(&_modifyPagePointerØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
if int32(_eType) != i32(4) {
goto _4
}
if _sqlite3Get4byte(tls, _pPage.X19) != _iFrom {
return _sqlite3CorruptError(tls, i32(62440))
}
_sqlite3Put4byte(tls, _pPage.X19, _iTo)
goto _6
_4:
_3_rc = _btreeInitPage(tls, _pPage)
if _3_rc != 0 {
return _3_rc
}
_3_nCell = int32(_pPage.X14)
_3_i = i32(0)
_8:
if _3_i >= _3_nCell {
goto _11
}
_4_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_3_i))))) + 1*uintptr(i32(0)))))<= (_5_info.X2) {
goto _13
}
if uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_5_info.X4))))))))) > uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((*XBtShared)(_pPage.X18).X16))))))))) {
return _sqlite3CorruptError(tls, i32(62459))
}
if _iFrom == _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_5_info.X4)))))))))-uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(4))))))))) {
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_5_info.X4)))))))))-uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(4)))))))), _iTo)
goto _11
}
_13:
goto _16
_12:
if _sqlite3Get4byte(tls, _4_pCell) == _iFrom {
_sqlite3Put4byte(tls, _4_pCell, _iTo)
goto _11
}
_16:
_3_i += 1
goto _8
_11:
if _3_i != _3_nCell {
goto _18
}
if (int32(_eType) != i32(5)) || (_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))) != _iFrom) {
return _sqlite3CorruptError(tls, i32(62477))
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8)))), _iTo)
_18:
_6:
return i32(0)
_ = _5_info
panic(0)
}
var _modifyPagePointerØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_modifyPagePointerØ00__func__Ø000[0], str(55686), 18)
}
// Truncate the in-memory database file image to nPage pages. This
// function does not actually modify the database file on disk. It
// just sets the internal state of the pager object so that the
// truncation will be done when the current transaction is committed.
//
// This function is only called right before committing a transaction.
// Once this function has been called, the transaction must either be
// rolled back or committed. It is not safe to call this function and
// then continue writing to the database.
func _sqlite3PagerTruncateImage(tls *crt.TLS, _pPager *XPager, _nPage uint32) {
func() {
if (_pPager.X22) < _nPage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50876), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000))), unsafe.Pointer(str(55704)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X14) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerTruncateImageØ00__func__Ø000))), unsafe.Pointer(str(13332)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pPager.X22))) = _nPage
}
var _sqlite3PagerTruncateImageØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerTruncateImageØ00__func__Ø000[0], str(55726), 26)
}
// Sync the database file for the pager pPager. zMaster points to the name
// of a master journal file that should be written into the individual
// journal file. zMaster may be NULL, which is interpreted as no master
// journal (a single database transaction).
//
// This routine ensures that:
//
// * The database file change-counter is updated,
// * the journal is synced (unless the atomic-write optimization is used),
// * all dirty pages are written to the database file,
// * the database file is truncated (if required), and
// * the database file synced.
//
// The only thing that remains to commit the transaction is to finalize
// (delete, truncate or zero the first part of) the journal file (or
// delete the master journal file if specified).
//
// Note that if zMaster==NULL, this does not overwrite a previous value
// passed to an sqlite3PagerCommitPhaseOne() call.
//
// If the final parameter - noSync - is true, then the database file itself
// is not synced. The caller must call sqlite3PagerSync() directly to
// sync the database file before calling CommitPhaseTwo() to delete the
// journal file in this case.
func _sqlite3PagerCommitPhaseOne(tls *crt.TLS, _pPager *XPager, _zMaster *int8, _noSync int32) (r0 int32) {
var _rc int32
var _9_nNew uint32
var _3_pList, _3_pPageOne *XPgHdr
_rc = i32(0)
func() {
if int32(_pPager.X14) != i32(2) && int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) && int32(_pPager.X14) != i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53228), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55752)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53233), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (_pPager.X26) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53236), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _pPager.X26
}
if _sqlite3FaultSim(tls, i32(400)) != 0 {
return i32(10)
}
if int32(_pPager.X14) < i32(3) {
return i32(0)
}
func() {
if int32(_pPager.X13) != i32(0) && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53247), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55898)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53248), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(19565)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == _pagerFlushOnCommit(tls, _pPager, i32(1)) {
_sqlite3BackupRestart(tls, (*Xsqlite3_backup)(_pPager.X36))
goto _commit_phase_one_exit
}
if (*XWal)(_pPager.X60) == nil {
goto _20
}
_3_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59))
_3_pPageOne = nil
if _3_pList == nil {
_rc = _sqlite3PagerGet(tls, _pPager, uint32(i32(1)), &_3_pPageOne, i32(0))
_3_pList = _3_pPageOne
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pList.X3))))) = nil
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53265), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if _3_pList != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53266), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_rc = _pagerWalFrames(tls, _pPager, _3_pList, _pPager.X22, i32(1))
}
_sqlite3PagerUnref(tls, _3_pPageOne)
if _rc == i32(0) {
_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.X59))
}
goto _28
_20:
_rc = _pager_incr_changecounter(tls, _pPager, i32(0))
if _rc != i32(0) {
goto _commit_phase_one_exit
}
_rc = _writeMasterJournal(tls, _pPager, _zMaster)
if _rc != i32(0) {
goto _commit_phase_one_exit
}
_rc = _syncJournal(tls, _pPager, i32(0))
if _rc != i32(0) {
goto _commit_phase_one_exit
}
_rc = _pager_write_pagelist(tls, _pPager, _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59)))
if _rc != i32(0) {
func() {
if _rc == i32(2826) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53349), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55927)))
crt.X__builtin_abort(tls)
}
}()
goto _commit_phase_one_exit
}
_sqlite3PcacheCleanAll(tls, (*XPCache)(_pPager.X59))
if (_pPager.X22) <= (_pPager.X24) {
goto _35
}
_9_nNew = (_pPager.X22) - uint32(bool2int((_pPager.X22) == uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))))
func() {
if int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseOneØ00__func__Ø000))), unsafe.Pointer(str(55952)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pager_truncate(tls, _pPager, _9_nNew)
if _rc != i32(0) {
goto _commit_phase_one_exit
}
_35:
if _noSync == 0 {
_rc = _sqlite3PagerSync(tls, _pPager, _zMaster)
}
_28:
_commit_phase_one_exit:
if (_rc == i32(0)) && ((*XWal)(_pPager.X60) == nil) {
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(5))
}
return _rc
}
var _sqlite3PagerCommitPhaseOneØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseOneØ00__func__Ø000[0], str(55987), 27)
}
func _sqlite3FaultSim(tls *crt.TLS, _iTest int32) (r0 int32) {
var _xCallback func(*crt.TLS, int32) int32
_xCallback = _sqlite3Config.X37
return func() int32 {
if _xCallback != nil {
return _xCallback(tls, _iTest)
}
return i32(0)
}()
}
func _pagerWalFrames(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr, _nTruncate uint32, _isCommit int32) (r0 int32) {
var _rc, _nList int32
var _p *XPgHdr
var _2_ppNext **XPgHdr
func() {
if (*XWal)(_pPager.X60) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50067), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56014)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50068), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56027)))
crt.X__builtin_abort(tls)
}
}()
_p = _pList
_4:
if _p == nil || (*XPgHdr)(_p.X3) == nil {
goto _8
}
func() {
if (_p.X5) >= ((*XPgHdr)(_p.X3).X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50072), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56033)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XPgHdr)(_p.X3)
goto _4
_8:
func() {
if (*XPgHdr)(_pList.X3) != nil && _isCommit == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50076), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56059)))
crt.X__builtin_abort(tls)
}
}()
if _isCommit == 0 {
goto _14
}
_2_ppNext = &_pList
_nList = i32(0)
_p = _pList
_15:
if store25(_2_ppNext, _p) == nil {
goto _18
}
if (_p.X5) <= _nTruncate {
_2_ppNext = (**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3)))))
_nList += 1
}
_p = (*XPgHdr)(_p.X3)
goto _15
_18:
func() {
if _pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50090), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerWalFramesØ00__func__Ø000))), unsafe.Pointer(str(56027)))
crt.X__builtin_abort(tls)
}
}()
goto _22
_14:
_nList = i32(1)
_22:
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(2))))
*p = (*p) + _nList
sink1 = *p
}
if (_pList.X5) == uint32(i32(1)) {
_pager_write_changecounter(tls, _pList)
}
_rc = _sqlite3WalFrames(tls, (*XWal)(_pPager.X60), _pPager.X48, _pList, _nTruncate, _isCommit, int32(_pPager.X8))
if _rc != i32(0) || (*Xsqlite3_backup)(_pPager.X36) == nil {
goto _25
}
_p = _pList
_26:
if _p == nil {
goto _29
}
_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.X36), _p.X5, (*uint8)(_p.X1))
_p = (*XPgHdr)(_p.X3)
goto _26
_29:
_25:
return _rc
}
var _pagerWalFramesØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pagerWalFramesØ00__func__Ø000[0], str(56088), 15)
}
// Update the value of the change-counter at offsets 24 and 92 in
// the header and the sqlite version number at offset 96.
//
// This is an unconditional update. See also the pager_incr_changecounter()
// routine which only updates the change-counter if the update is actually
// needed, as determined by the pPager->changeCountDone state variable.
func _pager_write_changecounter(tls *crt.TLS, _pPg *XPgHdr) {
var _change_counter uint32
_change_counter = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer((*[16]int8)(unsafe.Pointer(&((*XPager)(_pPg.X4).X40)))))))) + uint32(i32(1))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*int8)(_pPg.X1)))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(24)))))))), _change_counter)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*int8)(_pPg.X1)))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(92)))))))), _change_counter)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*int8)(_pPg.X1)))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(96)))))))), uint32(i32(3019003)))
}
// Write a set of frames to the log. The caller must hold the write-lock
// on the log file (obtained using sqlite3WalBeginWriteTransaction()).
func _sqlite3WalFrames(tls *crt.TLS, _pWal *XWal, _szPage int32, _pList *XPgHdr, _nTruncate uint32, _isCommit int32, _sync_flags int32) (r0 int32) {
var _rc, _nExtra, _szFrame, _6_nDbSize, _11_bSync, _12_sectorSize int32
var _iOffset, _8_iOff, _15_sz int64
var _iFrame, _iFirst, _7_iWrite uint32
var _8_pData unsafe.Pointer
var _3_aWalHdr [32]uint8
var _p, _pLast *XPgHdr
var _3_aCksum [2]uint32
var _pLive *XWalIndexHdr
var _w XWalWriter
_pLast = nil
_nExtra = i32(0)
_iFirst = u32(0)
func() {
if _pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(56027)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pWal.X12) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(15606)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isCommit != i32(0)) != (_nTruncate != uint32(i32(0))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57541), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(56103)))
crt.X__builtin_abort(tls)
}
}()
_pLive = _walIndexHdr(tls, _pWal)
if crt.Xmemcmp(tls, (unsafe.Pointer)((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18)))), (unsafe.Pointer)(_pLive), u32(48)) != i32(0) {
_iFirst = (_pLive.X6) + uint32(i32(1))
}
if i32(0) != store1(&_rc, _walRestartLog(tls, _pWal)) {
return _rc
}
_iFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
if _iFrame != uint32(i32(0)) {
goto _8
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(0)))), uint32(i32(931071618)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(4)))), uint32(i32(3007000)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(8)))), uint32(_szPage))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(12)))), _pWal.X22)
if (_pWal.X22) == uint32(i32(0)) {
Xsqlite3_randomness(tls, i32(8), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))))
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(16))))), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), uint32(i32(8)))
_walChecksumBytes(tls, i32(1), (*uint8)(unsafe.Pointer(&_3_aWalHdr)), i32(24), nil, (*uint32)(unsafe.Pointer(&_3_aCksum)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(24)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(0)))))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aWalHdr))+1*uintptr(i32(28)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(1)))))
*(*uint32)(unsafe.Pointer(&(_pWal.X8))) = uint32(_szPage)
*(*uint8)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(0))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_aCksum)) + 4*uintptr(i32(1))))
*(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(1))
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_3_aWalHdr), int32(u32(32)), int64(i32(0)))
if _rc != i32(0) {
return _rc
}
if (_pWal.X16) == 0 || _sync_flags == 0 {
goto _12
}
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pWal.X2), _sync_flags&i32(19))
if _rc != 0 {
return _rc
}
_12:
_8:
func() {
if int32(_pWal.X8) != _szPage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57605), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(56133)))
crt.X__builtin_abort(tls)
}
}()
*(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pWal
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X1))))) = (*Xsqlite3_file)(_pWal.X2)
*(*int64)(unsafe.Pointer(&(_w.X2))) = int64(i32(0))
*(*int32)(unsafe.Pointer(&(_w.X3))) = _sync_flags
*(*int32)(unsafe.Pointer(&(_w.X4))) = _szPage
_iOffset = int64(i32(32)) + (int64((_iFrame+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))
_szFrame = _szPage + i32(24)
_p = _pList
_16:
if _p == nil {
goto _19
}
if _iFirst == 0 || (*XPgHdr)(_p.X3) == nil && _isCommit != i32(0) {
goto _22
}
_7_iWrite = uint32(i32(0))
_rc = _sqlite3WalFindFrame(tls, _pWal, _p.X5, &_7_iWrite)
func() {
if _rc != i32(0) && _7_iWrite != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57627), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(56159)))
crt.X__builtin_abort(tls)
}
}()
if _7_iWrite < _iFirst {
goto _26
}
_8_iOff = (int64(i32(32)) + (int64(_7_iWrite-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(24))
if ((_pWal.X20) == uint32(i32(0))) || (_7_iWrite < (_pWal.X20)) {
*(*uint32)(unsafe.Pointer(&(_pWal.X20))) = _7_iWrite
}
_8_pData = _p.X1
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), _8_pData, _szPage, _8_iOff)
if _rc != 0 {
return _rc
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) & i32(-65))
sink14 = *p
}
goto _17
_26:
_22:
_iFrame += 1
func() {
if _iOffset != (int64(i32(32)) + (int64(_iFrame-uint32(i32(1))) * int64(_szPage+i32(24)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57647), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(56186)))
crt.X__builtin_abort(tls)
}
}()
_6_nDbSize = int32(func() uint32 {
if _isCommit != 0 && ((*XPgHdr)(_p.X3) == nil) {
return _nTruncate
}
return uint32(i32(0))
}())
_rc = _walWriteOneFrame(tls, &_w, _p, _6_nDbSize, _iOffset)
if _rc != 0 {
return _rc
}
_pLast = _p
{
p := &_iOffset
*p = (*p) + int64(_szFrame)
sink6 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) | i32(64))
sink14 = *p
}
_17:
_p = (*XPgHdr)(_p.X3)
goto _16
_19:
if _isCommit == 0 || (_pWal.X20) == 0 {
goto _37
}
_rc = _walRewriteChecksums(tls, _pWal, _iFrame)
if _rc != 0 {
return _rc
}
_37:
if _isCommit == 0 || (_sync_flags&i32(32)) == i32(0) {
goto _40
}
_11_bSync = i32(1)
if (_pWal.X17) == 0 {
goto _41
}
_12_sectorSize = _sqlite3SectorSize(tls, (*Xsqlite3_file)(_pWal.X2))
*(*int64)(unsafe.Pointer(&(_w.X2))) = (((_iOffset + int64(_12_sectorSize)) - int64(i32(1))) / int64(_12_sectorSize)) * int64(_12_sectorSize)
_11_bSync = bool2int((_w.X2) == _iOffset)
_42:
if _iOffset >= (_w.X2) {
goto _43
}
_rc = _walWriteOneFrame(tls, &_w, _pLast, int32(_nTruncate), _iOffset)
if _rc != 0 {
return _rc
}
{
p := &_iOffset
*p = (*p) + int64(_szFrame)
sink6 = *p
}
_nExtra += 1
goto _42
_43:
_41:
if _11_bSync != 0 {
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57691), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WalFramesØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_w.X1), _sync_flags&i32(19))
}
_40:
if _isCommit == 0 || (_pWal.X15) == 0 || (_pWal.X4) < int64(i32(0)) {
goto _50
}
_15_sz = _pWal.X4
if (int64(i32(32)) + (int64(((_iFrame+uint32(_nExtra))+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) > (_pWal.X4) {
_15_sz = int64(i32(32)) + (int64(((_iFrame+uint32(_nExtra))+uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))
}
_walLimitSize(tls, _pWal, _15_sz)
*(*uint8)(unsafe.Pointer(&(_pWal.X15))) = uint8(i32(0))
_50:
_iFrame = (*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6
_p = _pList
_52:
if _p == nil || _rc != i32(0) {
goto _56
}
if (int32(_p.X6) & i32(64)) == i32(0) {
goto _53
}
_iFrame += 1
_rc = _walIndexAppend(tls, _pWal, _iFrame, _p.X5)
_53:
_p = (*XPgHdr)(_p.X3)
goto _52
_56:
if (_rc == i32(0)) && (_nExtra > i32(0)) {
_iFrame += 1
_nExtra -= 1
_rc = _walIndexAppend(tls, _pWal, _iFrame, _pLast.X5)
goto _56
}
if _rc != i32(0) {
goto _61
}
*(*uint16)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X5))) = uint16((_szPage & i32(65280)) | (_szPage >> uint(i32(16))))
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6))) = _iFrame
if _isCommit != 0 {
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X2))) += 1
*(*uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X7))) = _nTruncate
}
if _isCommit != 0 {
_walIndexWriteHdr(tls, _pWal)
*(*uint32)(unsafe.Pointer(&(_pWal.X3))) = _iFrame
}
_61:
return _rc
_ = _w
_ = _3_aWalHdr
_ = _3_aCksum
panic(0)
}
var _sqlite3WalFramesØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WalFramesØ00__func__Ø000[0], str(56226), 17)
}
// This function is called just before writing a set of frames to the log
// file (see sqlite3WalFrames()). It checks to see if, instead of appending
// to the current log file, it is possible to overwrite the start of the
// existing log file with the new frames (i.e. "reset" the log). If so,
// it sets pWal->hdr.mxFrame to 0. Otherwise, pWal->hdr.mxFrame is left
// unchanged.
//
// SQLITE_OK is returned if no error is encountered (regardless of whether
// or not pWal->hdr.mxFrame is modified). An SQLite error code is returned
// if an error occurs.
func _walRestartLog(tls *crt.TLS, _pWal *XWal) (r0 int32) {
var _rc, _cnt, _5_notUsed int32
var _2_salt1 uint32
var _1_pInfo *XWalCkptInfo
_rc = i32(0)
if int32(_pWal.X9) != i32(0) {
goto _0
}
_1_pInfo = _walCkptInfo(tls, _pWal)
func() {
if (_1_pInfo.X0) != ((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57356), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRestartLogØ00__func__Ø000))), unsafe.Pointer(str(22957)))
crt.X__builtin_abort(tls)
}
}()
if (_1_pInfo.X0) <= uint32(i32(0)) {
goto _3
}
Xsqlite3_randomness(tls, i32(4), (unsafe.Pointer)(&_2_salt1))
_rc = _walLockExclusive(tls, _pWal, i32(4), i32(4))
if _rc == i32(0) {
_walRestartHdr(tls, _pWal, _2_salt1)
_walUnlockExclusive(tls, _pWal, i32(4), i32(4))
goto _6
}
if _rc != i32(5) {
return _rc
}
_6:
_3:
_walUnlockShared(tls, _pWal, i32(3))
*(*int16)(unsafe.Pointer(&(_pWal.X9))) = int16(i32(-1))
_cnt = i32(0)
_7:
_rc = _walTryBeginRead(tls, _pWal, &_5_notUsed, i32(1), preInc1(&_cnt, 1))
if _rc == i32(-1) {
goto _7
}
func() {
if (_rc & i32(255)) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57384), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRestartLogØ00__func__Ø000))), unsafe.Pointer(str(56243)))
crt.X__builtin_abort(tls)
}
}()
_0:
return _rc
_ = _cnt
_ = _5_notUsed
panic(0)
}
var _walRestartLogØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_walRestartLogØ00__func__Ø000[0], str(56266), 14)
}
// Write out a single frame of the WAL
func _walWriteOneFrame(tls *crt.TLS, _p *XWalWriter, _pPage *XPgHdr, _nTruncate int32, _iOffset int64) (r0 int32) {
var _rc int32
var _pData unsafe.Pointer
var _aFrame [24]uint8
_pData = _pPage.X1
_walEncodeFrame(tls, (*XWal)(_p.X0), _pPage.X5, uint32(_nTruncate), (*uint8)(_pData), (*uint8)(unsafe.Pointer(&_aFrame)))
_rc = _walWriteToLog(tls, _p, (unsafe.Pointer)(&_aFrame), int32(u32(24)), _iOffset)
if _rc != 0 {
return _rc
}
_rc = _walWriteToLog(tls, _p, _pData, _p.X4, _iOffset+int64(u32(24)))
return _rc
_ = _aFrame
panic(0)
}
// This function encodes a single frame header and writes it to a buffer
// supplied by the caller. A frame-header is made up of a series of
// 4-byte big-endian integers, as follows:
//
// 0: Page number.
// 4: For commit records, the size of the database image in pages
// after the commit. For all other records, zero.
// 8: Salt-1 (copied from the wal-header)
// 12: Salt-2 (copied from the wal-header)
// 16: Checksum-1.
// 20: Checksum-2.
func _walEncodeFrame(tls *crt.TLS, _pWal *XWal, _iPage uint32, _nTruncate uint32, _aData *uint8, _aFrame *uint8) {
var _nativeCksum int32
var _aCksum *uint32
_aCksum = (*uint32)(unsafe.Pointer((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8)))))
i32(0)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(0)))), _iPage)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(4)))), _nTruncate)
if (_pWal.X20) == uint32(i32(0)) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), (unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X9)))), uint32(i32(8)))
_nativeCksum = bool2int(int32((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X4) == i32(0))
_walChecksumBytes(tls, _nativeCksum, _aFrame, i32(8), _aCksum, _aCksum)
_walChecksumBytes(tls, _nativeCksum, _aData, int32(_pWal.X8), _aCksum, _aCksum)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(16)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(0)))))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(20)))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCksum)) + 4*uintptr(i32(1)))))
goto _1
}
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrame))+1*uintptr(i32(8))))), i32(0), uint32(i32(16)))
_1:
}
// Write iAmt bytes of content into the WAL file beginning at iOffset.
// Do a sync when crossing the p->iSyncPoint boundary.
//
// In other words, if iSyncPoint is in between iOffset and iOffset+iAmt,
// first write the part before iSyncPoint, then sync, then write the
// rest.
func _walWriteToLog(tls *crt.TLS, _p *XWalWriter, _pContent unsafe.Pointer, _iAmt int32, _iOffset int64) (r0 int32) {
var _rc, _1_iFirstAmt int32
if _iOffset >= (_p.X2) || (_iOffset+int64(_iAmt)) < (_p.X2) {
goto _1
}
_1_iFirstAmt = int32((_p.X2) - _iOffset)
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X1), _pContent, _1_iFirstAmt, _iOffset)
if _rc != 0 {
return _rc
}
{
p := &_iOffset
*p = (*p) + int64(_1_iFirstAmt)
sink6 = *p
}
{
p := &_iAmt
*p = (*p) - _1_iFirstAmt
sink1 = *p
}
_pContent = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_1_iFirstAmt))))) + uintptr(unsafe.Pointer((*int8)(_pContent))))))
func() {
if ((_p.X3) & i32(3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57427), unsafe.Pointer((*int8)(unsafe.Pointer(&_walWriteToLogØ00__func__Ø000))), unsafe.Pointer(str(56280)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_p.X1), (_p.X3)&i32(19))
if (_iAmt == i32(0)) || _rc != 0 {
return _rc
}
_1:
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X1), _pContent, _iAmt, _iOffset)
return _rc
}
var _walWriteToLogØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_walWriteToLogØ00__func__Ø000[0], str(56333), 14)
}
// This function is called as part of committing a transaction within which
// one or more frames have been overwritten. It updates the checksums for
// all frames written to the wal file by the current transaction starting
// with the earliest to have been overwritten.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
func _walRewriteChecksums(tls *crt.TLS, _pWal *XWal, _iLast uint32) (r0 int32) {
var _szPage, _rc int32
var _iCksumOff, _3_iOff int64
var _iRead, _4_iPgno, _4_nDbSize uint32
var _aBuf *uint8
var _aFrame [24]uint8
_szPage = int32(_pWal.X8)
_rc = i32(0)
_aBuf = (*uint8)(Xsqlite3_malloc(tls, _szPage+i32(24)))
if _aBuf == nil {
return _sqlite3NomemError(tls, i32(57477))
}
func() {
if (_pWal.X20) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(57484), unsafe.Pointer((*int8)(unsafe.Pointer(&_walRewriteChecksumsØ00__func__Ø000))), unsafe.Pointer(str(56347)))
crt.X__builtin_abort(tls)
}
}()
if (_pWal.X20) == uint32(i32(1)) {
_iCksumOff = int64(i32(24))
goto _4
}
_iCksumOff = (int64(i32(32)) + (int64(((_pWal.X20)-uint32(i32(1)))-uint32(i32(1))) * int64(_szPage+i32(24)))) + int64(i32(16))
_4:
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_aBuf), int32(u32(8)), _iCksumOff)
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(0)))) = _sqlite3Get4byte(tls, _aBuf)
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&((*XWalIndexHdr)(unsafe.Pointer(&(_pWal.X18))).X8))))) + 4*uintptr(i32(1)))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(u32(4)))))
_iRead = _pWal.X20
*(*uint32)(unsafe.Pointer(&(_pWal.X20))) = uint32(i32(0))
_5:
if _rc != i32(0) || _iRead > _iLast {
goto _9
}
_3_iOff = int64(i32(32)) + (int64(_iRead-uint32(i32(1))) * int64(_szPage+i32(24)))
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(_aBuf), _szPage+i32(24), _3_iOff)
if _rc == i32(0) {
_4_iPgno = _sqlite3Get4byte(tls, _aBuf)
_4_nDbSize = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(i32(4)))))
_walEncodeFrame(tls, _pWal, _4_iPgno, _4_nDbSize, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aBuf))+1*uintptr(i32(24)))), (*uint8)(unsafe.Pointer(&_aFrame)))
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pWal.X2), (unsafe.Pointer)(&_aFrame), int32(u32(24)), _3_iOff)
}
_iRead += 1
goto _5
_9:
Xsqlite3_free(tls, (unsafe.Pointer)(_aBuf))
return _rc
_ = _aFrame
panic(0)
}
var _walRewriteChecksumsØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_walRewriteChecksumsØ00__func__Ø000[0], str(56364), 20)
}
// This routine is called to increment the value of the database file
// change-counter, stored as a 4-byte big-endian integer starting at
// byte offset 24 of the pager file. The secondary change counter at
// 92 is also updated, as is the SQLite version number at offset 96.
//
// But this only happens if the pPager->changeCountDone flag is false.
// To avoid excess churning of page 1, the update only happens once.
// See also the pager_write_changecounter() routine that does an
// unconditional update of the change counters.
//
// If the isDirectMode flag is zero, then this is done by calling
// sqlite3PagerWrite() on page 1, then modifying the contents of the
// page data. In this case the file will be updated when the current
// transaction is committed.
//
// The isDirectMode flag may only be non-zero if the library was compiled
// with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case,
// if isDirect is non-zero, then the database file is updated directly
// by writing an updated version of page 1 using a call to the
// sqlite3OsWrite() function.
func _pager_incr_changecounter(tls *crt.TLS, _pPager *XPager, _isDirectMode int32) (r0 int32) {
var _rc int32
var _4_zBuf, _6_pCopy unsafe.Pointer
var _1_pPgHdr *XPgHdr
_rc = i32(0)
func() {
if int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53073), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(55020)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53076), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isDirectMode != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53090), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(56384)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X16) != 0 || func() int32 {
if (_pPager.X22) > uint32(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53096), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _10
}
func() {
if (_pPager.X10) != 0 || (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53099), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(56400)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerGet(tls, _pPager, uint32(i32(1)), &_1_pPgHdr, i32(0))
func() {
if _1_pPgHdr != nil && _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53103), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(56440)))
crt.X__builtin_abort(tls)
}
}()
if i32(1) != 0 && func() int32 {
if _rc == i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53110), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_incr_changecounterØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_rc = _sqlite3PagerWrite(tls, _1_pPgHdr)
}
if _rc != i32(0) {
goto _21
}
_pager_write_changecounter(tls, _1_pPgHdr)
goto _22
_22:
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = uint8(i32(1))
_21:
_sqlite3PagerUnref(tls, _1_pPgHdr)
_10:
return _rc
_ = _4_zBuf
_ = _6_pCopy
panic(0)
}
var _pager_incr_changecounterØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_pager_incr_changecounterØ00__func__Ø000[0], str(56467), 25)
}
// Write the supplied master journal name into the journal file for pager
// pPager at the current location. The master journal name must be the last
// thing written to a journal file. If the pager is in full-sync mode, the
// journal file descriptor is advanced to the next sector boundary before
// anything is written. The format is:
//
// + 4 bytes: PAGER_MJ_PGNO.
// + N bytes: Master journal filename in utf-8.
// + 4 bytes: N (length of master journal name in bytes, no nul-terminator).
// + 4 bytes: Master journal name checksum.
// + 8 bytes: aJournalMagic[].
//
// The master journal page checksum is the sum of the bytes in the master
// journal name, where each byte is interpreted as a signed 8-bit integer.
//
// If zMaster is a NULL pointer (occurs for a single database transaction),
// this call is a no-op.
func _writeMasterJournal(tls *crt.TLS, _pPager *XPager, _zMaster *int8) (r0 int32) {
var _rc, _nMaster int32
var _iHdrOff, _jrnlSize int64
var _cksum uint32
_cksum = u32(0)
func() {
if int32(_pPager.X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48585), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000))), unsafe.Pointer(str(12025)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48586), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
if ((_zMaster == nil) || (int32(_pPager.X2) == i32(4))) || ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil) {
return i32(0)
}
*(*uint8)(unsafe.Pointer(&(_pPager.X17))) = uint8(i32(1))
func() {
if (_pPager.X35) > (_pPager.X34) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(48595), unsafe.Pointer((*int8)(unsafe.Pointer(&_writeMasterJournalØ00__func__Ø000))), unsafe.Pointer(str(13683)))
crt.X__builtin_abort(tls)
}
}()
_nMaster = i32(0)
_9:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_nMaster)))) == 0 {
goto _12
}
{
p := &_cksum
*p = (*p) + uint32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zMaster)) + 1*uintptr(_nMaster))))
sink5 = *p
}
_nMaster += 1
goto _9
_12:
if (_pPager.X5) != 0 {
*(*int64)(unsafe.Pointer(&(_pPager.X34))) = _journalHdrOffset(tls, _pPager)
}
_iHdrOff = _pPager.X34
if ((((i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), _iHdrOff, uint32((_sqlite3PendingByte/(_pPager.X48))+i32(1))))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(_zMaster), _nMaster, _iHdrOff+int64(i32(4)))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), (_iHdrOff+int64(i32(4)))+int64(_nMaster), uint32(_nMaster))))) || (i32(0) != store1(&_rc, _write32bits(tls, (*Xsqlite3_file)(_pPager.X32), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(4)), _cksum)))) || (i32(0) != store1(&_rc, _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_aJournalMagic), i32(8), ((_iHdrOff+int64(i32(4)))+int64(_nMaster))+int64(i32(8))))) {
return _rc
}
{
p := (*int64)(unsafe.Pointer(&(_pPager.X34)))
*p = (*p) + int64(_nMaster+i32(20))
sink6 = *p
}
if (i32(0) == store1(&_rc, _sqlite3OsFileSize(tls, (*Xsqlite3_file)(_pPager.X32), &_jrnlSize))) && (_jrnlSize > (_pPager.X34)) {
_rc = _sqlite3OsTruncate(tls, (*Xsqlite3_file)(_pPager.X32), _pPager.X34)
}
return _rc
}
var _writeMasterJournalØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_writeMasterJournalØ00__func__Ø000[0], str(56492), 19)
}
// Sync the journal. In other words, make sure all the pages that have
// been written to the journal have actually reached the surface of the
// disk and can be restored in the event of a hot-journal rollback.
//
// If the Pager.noSync flag is set, then this function is a no-op.
// Otherwise, the actions required depend on the journal-mode and the
// device characteristics of the file-system, as follows:
//
// * If the journal file is an in-memory journal file, no action need
// be taken.
//
// * Otherwise, if the device does not support the SAFE_APPEND property,
// then the nRec field of the most recently written journal header
// is updated to contain the number of journal records that have
// been written following it. If the pager is operating in full-sync
// mode, then the journal file is synced before this field is updated.
//
// * If the device does not support the SEQUENTIAL property, then
// journal file is synced.
//
// Or, in pseudo-code:
//
// if( NOT ){
// if( NOT SAFE_APPEND ){
// if( ) xSync();
//
// }
// if( NOT SEQUENTIAL ) xSync();
// }
//
// If successful, this routine clears the PGHDR_NEED_SYNC flag of every
// page currently held in memory before returning SQLITE_OK. If an IO
// error is encountered, then the IO error code is returned to the caller.
func _syncJournal(tls *crt.TLS, _pPager *XPager, _newHdr int32) (r0 int32) {
var _rc, _2_iDc int32
var _3_iNextHdrOffset int64
var _3_aMagic [8]uint8
var _3_zHeader [12]uint8
func() {
if int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51120), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(55020)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51123), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51124), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerExclusiveLock(tls, _pPager)
if _rc != i32(0) {
return _rc
}
if (_pPager.X4) != 0 {
goto _8
}
func() {
if (_pPager.X10) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51130), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(51663)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil || int32(_pPager.X2) == i32(4) {
goto _12
}
_2_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51133), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(13626)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != (_2_iDc & i32(512)) {
goto _15
}
crt.Xmemcpy(tls, (unsafe.Pointer)(&_3_zHeader), (unsafe.Pointer)(&_aJournalMagic), u32(8))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_3_zHeader))+1*uintptr(u32(8)))), uint32(_pPager.X27))
_3_iNextHdrOffset = _journalHdrOffset(tls, _pPager)
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_3_aMagic), i32(8), _3_iNextHdrOffset)
if (_rc == i32(0)) && (i32(0) == crt.Xmemcmp(tls, (unsafe.Pointer)(&_3_aMagic), (unsafe.Pointer)(&_aJournalMagic), uint32(i32(8)))) {
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_syncJournalØ00zerobyteØ001), i32(1), _3_iNextHdrOffset)
}
if (_rc != i32(0)) && (_rc != i32(522)) {
return _rc
}
if (_pPager.X5) == 0 || i32(0) != (_2_iDc&i32(1024)) {
goto _21
}
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), int32(_pPager.X9))
if _rc != i32(0) {
return _rc
}
_21:
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X32), (unsafe.Pointer)(&_3_zHeader), int32(u32(12)), _pPager.X35)
if _rc != i32(0) {
return _rc
}
_15:
if i32(0) != (_2_iDc & i32(1024)) {
goto _24
}
_rc = _sqlite3OsSync(tls, (*Xsqlite3_file)(_pPager.X32), int32(_pPager.X9)|func() int32 {
if int32(_pPager.X9) == i32(3) {
return i32(16)
}
return i32(0)
}())
if _rc != i32(0) {
return _rc
}
_24:
*(*int64)(unsafe.Pointer(&(_pPager.X35))) = _pPager.X34
if _newHdr == 0 || i32(0) != (_2_iDc&i32(512)) {
goto _29
}
*(*int32)(unsafe.Pointer(&(_pPager.X27))) = i32(0)
_rc = _writeJournalHdr(tls, _pPager)
if _rc != i32(0) {
return _rc
}
_29:
goto _31
_12:
*(*int64)(unsafe.Pointer(&(_pPager.X35))) = _pPager.X34
_31:
_8:
_sqlite3PcacheClearSyncFlags(tls, (*XPCache)(_pPager.X59))
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(4))
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51224), unsafe.Pointer((*int8)(unsafe.Pointer(&_syncJournalØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
_ = _3_aMagic
_ = _3_zHeader
panic(0)
}
var _syncJournalØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_syncJournalØ00__func__Ø000[0], str(56511), 12)
}
// This function may only be called while a write-transaction is active in
// rollback. If the connection is in WAL mode, this call is a no-op.
// Otherwise, if the connection does not already have an EXCLUSIVE lock on
// the database file, an attempt is made to obtain one.
//
// If the EXCLUSIVE lock is already held or the attempt to obtain it is
// successful, or the connection is in WAL mode, SQLITE_OK is returned.
// Otherwise, either SQLITE_BUSY or an SQLITE_IOERR_XXX error code is
// returned.
func _sqlite3PagerExclusiveLock(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
_rc = _pPager.X26
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53181), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) {
goto _2
}
func() {
if int32(_pPager.X14) != i32(3) && int32(_pPager.X14) != i32(4) && int32(_pPager.X14) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53183), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000))), unsafe.Pointer(str(56523)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53187), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerExclusiveLockØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == bool2int((*XWal)(_pPager.X60) != nil) {
_rc = _pager_wait_on_lock(tls, _pPager, i32(4))
}
_2:
return _rc
}
var _sqlite3PagerExclusiveLockØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerExclusiveLockØ00__func__Ø000[0], str(56638), 26)
}
var _syncJournalØ00zerobyteØ001 uint8
// Clear the PGHDR_NEED_SYNC flag from all dirty pages.
func _sqlite3PcacheClearSyncFlags(tls *crt.TLS, _pCache *XPCache) {
var _p *XPgHdr
_p = (*XPgHdr)(_pCache.X0)
_0:
if _p == nil {
goto _3
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X6)))
*p = uint16(int32(*p) & i32(-9))
sink14 = *p
}
_p = (*XPgHdr)(_p.X9)
goto _0
_3:
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCache.X2))))) = (*XPgHdr)(_pCache.X1)
}
// The argument is the first in a linked list of dirty pages connected
// by the PgHdr.pDirty pointer. This function writes each one of the
// in-memory pages in the list to the database file. The argument may
// be NULL, representing an empty list. In this case this function is
// a no-op.
//
// The pager must hold at least a RESERVED lock when this function
// is called. Before writing anything to the database file, this lock
// is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained,
// SQLITE_BUSY is returned and no data is written to the database file.
//
// If the pager is a temp-file pager and the actual file-system file
// is not yet open, it is created and opened before any data is
// written out.
//
// Once the lock has been upgraded and, if necessary, the file opened,
// the pages are written out to the database file in list order. Writing
// a page is skipped if it meets either of the following criteria:
//
// * The page number is greater than Pager.dbSize, or
// * The PGHDR_DONT_WRITE flag is set on the page.
//
// If writing out a page causes the database file to grow, Pager.dbFileSize
// is updated accordingly. If page 1 is written out, then the value cached
// in Pager.dbFileVers[] is updated to match the new value stored in
// the database file.
//
// If everything is successful, SQLITE_OK is returned. If an IO error
// occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot
// be obtained, SQLITE_BUSY is returned.
func _pager_write_pagelist(tls *crt.TLS, _pPager *XPager, _pList *XPgHdr) (r0 int32) {
var _rc int32
var _2_szFile, _4_offset int64
var _3_pgno uint32
var _4_pData *int8
_rc = i32(0)
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51264), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X10) == 0 && int32(_pPager.X14) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51265), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56664)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X15) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51266), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(18888)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (*XPgHdr)(_pList.X3) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51267), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56719)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
func() {
if (_pPager.X10) == 0 || _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51274), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56758)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pagerOpentemp(tls, _pPager, (*Xsqlite3_file)(_pPager.X31), int32(_pPager.X46))
}
func() {
if _rc == i32(0) && (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51281), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56792)))
crt.X__builtin_abort(tls)
}
}()
if ((_rc == i32(0)) && ((_pPager.X25) < (_pPager.X22))) && (((*XPgHdr)(_pList.X3) != nil) || ((_pList.X5) > (_pPager.X25))) {
_2_szFile = int64(_pPager.X48) * int64(_pPager.X22)
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(5), (unsafe.Pointer)(&_2_szFile))
*(*uint32)(unsafe.Pointer(&(_pPager.X25))) = _pPager.X22
}
_20:
if _rc != i32(0) || _pList == nil {
goto _22
}
_3_pgno = _pList.X5
if _3_pgno > (_pPager.X22) || i32(0) != (int32(_pList.X6)&i32(16)) {
goto _25
}
_4_offset = int64(_3_pgno-uint32(i32(1))) * int64(_pPager.X48)
func() {
if (int32(_pList.X6) & i32(8)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51306), unsafe.Pointer((*int8)(unsafe.Pointer(&_pager_write_pagelistØ00__func__Ø000))), unsafe.Pointer(str(56828)))
crt.X__builtin_abort(tls)
}
}()
if (_pList.X5) == uint32(i32(1)) {
_pager_write_changecounter(tls, _pList)
}
_4_pData = (*int8)(_pList.X1)
_rc = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_4_pData), _pPager.X48, _4_offset)
if _3_pgno == uint32(i32(1)) {
crt.Xmemcpy(tls, (unsafe.Pointer)((*[16]int8)(unsafe.Pointer(&(_pPager.X40)))), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_pData))+1*uintptr(i32(24))))), u32(16))
}
if _3_pgno > (_pPager.X24) {
*(*uint32)(unsafe.Pointer(&(_pPager.X24))) = _3_pgno
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(i32(2)))) += 1
_sqlite3BackupUpdate(tls, (*Xsqlite3_backup)(_pPager.X36), _3_pgno, (*uint8)(_pList.X1))
goto _31
_25:
_31:
_pList = (*XPgHdr)(_pList.X3)
goto _20
_22:
return _rc
_ = _2_szFile
panic(0)
}
var _pager_write_pagelistØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_pager_write_pagelistØ00__func__Ø000[0], str(56862), 21)
}
// Open a temporary file.
//
// Write the file descriptor into *pFile. Return SQLITE_OK on success
// or some other error code if we fail. The OS will automatically
// delete the temporary file when it is closed.
//
// The flags passed to the VFS layer xOpen() call are those specified
// by parameter vfsFlags ORed with the following:
//
// SQLITE_OPEN_READWRITE
// SQLITE_OPEN_CREATE
// SQLITE_OPEN_EXCLUSIVE
// SQLITE_OPEN_DELETEONCLOSE
func _pagerOpentemp(tls *crt.TLS, _pPager *XPager, _pFile *Xsqlite3_file, _vfsFlags int32) (r0 int32) {
var _rc int32
{
p := &_vfsFlags
*p = (*p) | i32(30)
sink1 = *p
}
_rc = _sqlite3OsOpen(tls, (*Xsqlite3_vfs)(_pPager.X0), nil, _pFile, _vfsFlags, nil)
func() {
if _rc == i32(0) && (*Xsqlite3_io_methods)(_pFile.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50570), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerOpentempØ00__func__Ø000))), unsafe.Pointer(str(56883)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _pagerOpentempØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_pagerOpentempØ00__func__Ø000[0], str(56914), 14)
}
// 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 master 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 _sqlite3BtreeCommitPhaseTwo(tls *crt.TLS, _p *XBtree, _bCleanup int32) (r0 int32) {
var _1_rc int32
var _1_pBt *XBtShared
if int32(_p.X2) == i32(0) {
return i32(0)
}
_sqlite3BtreeEnter(tls, _p)
func() {
if int32((*XBtShared)(_p.X1).X8) == i32(0) && ((*XBtShared)(_p.X1).X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(9977)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XBtShared)(_p.X1).X8) < int32(_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(10038)))
crt.X__builtin_abort(tls)
}
}()
if int32(_p.X2) != i32(2) {
goto _6
}
_1_pBt = (*XBtShared)(_p.X1)
func() {
if int32(_1_pBt.X8) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62932), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(56928)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_1_pBt.X17) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62933), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(56960)))
crt.X__builtin_abort(tls)
}
}()
_1_rc = _sqlite3PagerCommitPhaseTwo(tls, (*XPager)(_1_pBt.X0))
if (_1_rc != i32(0)) && (_bCleanup == i32(0)) {
_sqlite3BtreeLeave(tls, _p)
return _1_rc
}
*(*uint32)(unsafe.Pointer(&(_p.X8))) -= 1
*(*uint8)(unsafe.Pointer(&(_1_pBt.X8))) = uint8(i32(1))
_btreeClearHasContent(tls, _1_pBt)
_6:
_btreeEndTransaction(tls, _p)
_sqlite3BtreeLeave(tls, _p)
return i32(0)
}
var _sqlite3BtreeCommitPhaseTwoØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCommitPhaseTwoØ00__func__Ø000[0], str(56980), 27)
}
// When this function is called, the database file has been completely
// updated to reflect the changes made by the current transaction and
// synced to disk. The journal file still exists in the file-system
// though, and if a failure occurs at this point it will eventually
// be used as a hot-journal and the current transaction rolled back.
//
// This function finalizes the journal file, either by deleting,
// truncating or partially zeroing it, so that it cannot be used
// for hot-journal rollback. Once this is done the transaction is
// irrevocably committed.
//
// If an error occurs, an IO error code is returned and the pager
// moves into the error state. Otherwise, SQLITE_OK is returned.
func _sqlite3PagerCommitPhaseTwo(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
_rc = i32(0)
if func() int32 {
if (_pPager.X26) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _pPager.X26
}
func() {
if int32(_pPager.X14) != i32(2) && int32(_pPager.X14) != i32(5) && ((*XWal)(_pPager.X60) == nil || int32(_pPager.X14) != i32(3)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53406), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(57007)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53410), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pPager.X14) == i32(2)) && ((_pPager.X1) != 0)) && (int32(_pPager.X2) == i32(1)) {
func() {
if (_pPager.X34) != int64(_pPager.X47) && (_pPager.X34) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCommitPhaseTwoØ00__func__Ø000))), unsafe.Pointer(str(57150)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1))
return i32(0)
}
*(*uint32)(unsafe.Pointer(&(_pPager.X39))) += 1
_rc = _pager_end_transaction(tls, _pPager, int32(_pPager.X17), i32(1))
return _pager_error(tls, _pPager, _rc)
}
var _sqlite3PagerCommitPhaseTwoØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerCommitPhaseTwoØ00__func__Ø000[0], str(57216), 27)
}
// Set the number of result columns that will be returned by this SQL
// statement. This is now set at compile time, rather than during
// execution of the vdbe program so that sqlite3_column_count() can
// be called on an SQL statement before sqlite3_step().
func _sqlite3VdbeSetNumCols(tls *crt.TLS, _p *TVdbe, _nResColumn int32) {
var _n int32
var _db *Xsqlite3
var _pColName *XMem
_db = (*Xsqlite3)(_p.X0)
_releaseMemArray(tls, (*XMem)(_p.X20), int32(_p.X29)*i32(2))
_sqlite3DbFree(tls, _db, _p.X20)
_n = _nResColumn * i32(2)
*(*uint16)(unsafe.Pointer(&(_p.X29))) = uint16(_nResColumn)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X20))))) = store20(&_pColName, (*XMem)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(48)*uint32(_n)))))
if (*XMem)(_p.X20) == nil {
return
}
_initMemArray(tls, (*XMem)(_p.X20), _n, (*Xsqlite3)(_p.X0), uint16(i32(1)))
_ = _pColName
}
// Release an array of N Mem elements
func _releaseMemArray(tls *crt.TLS, _p *XMem, _N int32) {
var _1_db *Xsqlite3
var _1_pEnd *XMem
if _p == nil || _N == 0 {
goto _1
}
_1_pEnd = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 48*uintptr(_N)))
_1_db = (*Xsqlite3)(_p.X9)
if (_1_db.X79) == nil {
goto _2
}
_3:
if (_p.X7) != 0 {
_sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_p.X6))
}
if uintptr(unsafe.Pointer(preInc20(&_p, 48))) < uintptr(unsafe.Pointer(_1_pEnd)) {
goto _3
}
return
_2:
func() {
if (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+48*uintptr(i32(1)))) != _1_pEnd && (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+48*uintptr(i32(0)))).X9) != (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p))+48*uintptr(i32(1)))).X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72960), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000))), unsafe.Pointer(str(57243)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeCheckMemInvariants(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72961), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseMemArrayØ00__func__Ø000))), unsafe.Pointer(str(6177)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X1) & i32(9312)) != 0 {
_sqlite3VdbeMemRelease(tls, _p)
goto _13
}
if (_p.X7) != 0 {
_sqlite3DbFreeNN(tls, _1_db, (unsafe.Pointer)(_p.X6))
*(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0)
}
_13:
*(*uint16)(unsafe.Pointer(&(_p.X1))) = uint16(i32(128))
if uintptr(unsafe.Pointer(preInc20(&_p, 48))) < uintptr(unsafe.Pointer(_1_pEnd)) {
goto _2
}
_1:
}
var _releaseMemArrayØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_releaseMemArrayØ00__func__Ø000[0], str(57277), 16)
}
// Initialize an array of N Mem element.
func _initMemArray(tls *crt.TLS, _p *XMem, _N int32, _db *Xsqlite3, _flags uint16) {
_0:
if postInc1(&_N, int32(-1)) > i32(0) {
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _db
*(*uint16)(unsafe.Pointer(&(_p.X1))) = _flags
*(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = nil
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(48)
goto _0
}
}
// Set the name of the idx'th column to be returned by the SQL statement.
// zName must be a pointer to a nul terminated string.
//
// This call must be made after a call to sqlite3VdbeSetNumCols().
//
// The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC
// or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed
// to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed.
func _sqlite3VdbeSetColName(tls *crt.TLS, _p *TVdbe, _idx int32, _var int32, _zName *int8, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
var _rc int32
var _pColName *XMem
func() {
if _idx >= int32(_p.X29) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57293)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _var >= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57311)))
crt.X__builtin_abort(tls)
}
}()
if ((*Xsqlite3)(_p.X0).X17) != 0 {
func() {
if _zName != nil && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57325)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3NomemError(tls, i32(73619))
}
func() {
if (*XMem)(_p.X20) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73621), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57356)))
crt.X__builtin_abort(tls)
}
}()
_pColName = (*XMem)(unsafe.Pointer(uintptr(_p.X20) + 48*uintptr(_idx+(_var*int32(_p.X29)))))
_rc = _sqlite3VdbeMemSetStr(tls, _pColName, _zName, i32(-1), uint8(i32(1)), _xDel)
func() {
if _rc == i32(0) && _zName != nil && (int32(_pColName.X1)&i32(512)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73624), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetColNameØ00__func__Ø000))), unsafe.Pointer(str(57371)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3VdbeSetColNameØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSetColNameØ00__func__Ø000[0], str(57420), 22)
}
var _sqlite3PrepareØ00azColNameØ001 [12]*int8
func init() {
_sqlite3PrepareØ00azColNameØ001 = [12]*int8{str(57442), str(57447), str(57454), str(57457), str(57460), str(57463), str(57466), str(57469), str(57477), str(57486), str(26370), str(57492)}
}
// Remember the SQL string for a prepared statement.
func _sqlite3VdbeSetSql(tls *crt.TLS, _p *TVdbe, _z *int8, _n int32, _isPrepareV2 int32) {
func() {
if _isPrepareV2 != i32(1) && _isPrepareV2 != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71478), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000))), unsafe.Pointer(str(57499)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil {
return
}
if _isPrepareV2 == 0 {
*(*uint32)(unsafe.Pointer(&(_p.X41))) = uint32(i32(0))
}
func() {
if (_p.X36) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71484), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetSqlØ00__func__Ø000))), unsafe.Pointer(str(57532)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_p.X36))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_p.X0), _z, uint64(_n))
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(uint8(_isPrepareV2)), 512, 9)
}
var _sqlite3VdbeSetSqlØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSetSqlØ00__func__Ø000[0], str(57543), 18)
}
// Clean up and delete a VDBE after execution. Return an integer which is
// the result code. Write any error message text into *pzErrMsg.
func _sqlite3VdbeFinalize(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _rc int32
_rc = i32(0)
if ((_p.X5) == uint32(i32(770837923))) || ((_p.X5) == uint32(i32(832317811))) {
_rc = _sqlite3VdbeReset(tls, _p)
func() {
if (_rc & ((*Xsqlite3)(_p.X0).X11)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74365), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFinalizeØ00__func__Ø000))), unsafe.Pointer(str(57561)))
crt.X__builtin_abort(tls)
}
}()
}
_sqlite3VdbeDelete(tls, _p)
return _rc
}
// Clean up a VDBE after execution but do not delete the VDBE just yet.
// Write any error messages into *pzErrMsg. Return the result code.
//
// After this routine is run, the VDBE should be ready to be executed
// again.
//
// To look at it another way, this routine resets the state of the
// virtual machine from VDBE_MAGIC_RUN or VDBE_MAGIC_HALT back to
// VDBE_MAGIC_INIT.
func _sqlite3VdbeReset(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_p.X0)
_sqlite3VdbeHalt(tls, _p)
if (_p.X9) < i32(0) {
goto _0
}
_sqlite3VdbeTransferError(tls, _p)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = nil
if ((uint32((_p.X32)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
}
goto _4
_0:
if (_p.X10) != 0 && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) {
_sqlite3ErrorWithMsg(tls, _db, _p.X10, func() *int8 {
if (_p.X22) != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_p.X22))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = nil
}
_4:
_Cleanup(tls, _p)
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(1224384374))
return (_p.X10) & (_db.X11)
}
// This routine is called the when a VDBE tries to halt. If the VDBE
// has made changes and is in autocommit mode, then commit those
// changes. If a rollback is needed, then do the rollback.
//
// This routine is the only way to move the state of a VM from
// SQLITE_MAGIC_RUN to SQLITE_MAGIC_HALT. It is harmless to
// call this on a VM that is in the SQLITE_MAGIC_HALT state.
//
// Return an error code. If the commit could not complete because of
// lock contention, return SQLITE_BUSY. If SQLITE_BUSY is returned, it
// means the close did not happen and needs to be repeated.
func _sqlite3VdbeHalt(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _rc, _3_mrc, _3_eStatementOp, _3_isSpecialError int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_p.X0)
if (_p.X5) != uint32(i32(770837923)) {
return i32(0)
}
if (_db.X17) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(74044))
}
_closeAllCursors(tls, _p)
_checkActiveVdbeCnt(tls, _db)
if (_p.X9) < i32(0) || ((uint32((_p.X32)>>uint(i32(8)))<>uint(i32(31))) == 0 {
goto _3
}
_3_eStatementOp = i32(0)
_sqlite3VdbeEnter(tls, _p)
_3_mrc = (_p.X10) & i32(255)
_3_isSpecialError = bool2int((((_3_mrc == i32(7)) || (_3_mrc == i32(10))) || (_3_mrc == i32(9))) || (_3_mrc == i32(13)))
if _3_isSpecialError == 0 {
goto _7
}
if ((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != 0 && _3_mrc == i32(9) {
goto _9
}
if ((_3_mrc == i32(7)) || (_3_mrc == i32(13))) && (((uint32((_p.X32)>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) != 0) {
_3_eStatementOp = i32(2)
goto _13
}
_sqlite3RollbackAll(tls, _db, i32(516))
_sqlite3CloseSavepoints(tls, _db)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
_13:
_9:
_7:
if (_p.X10) == i32(0) {
_sqlite3VdbeCheckFk(tls, _p, i32(0))
}
if (_db.X64) > i32(0) && (**XVTable)(unsafe.Pointer(_db.X67)) == nil || (_db.X15) == 0 || (_db.X36) != bool2int(int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) == i32(0)) {
goto _18
}
if (_p.X10) != i32(0) && (int32(_p.X30) != i32(3) || _3_isSpecialError != 0) {
goto _21
}
_rc = _sqlite3VdbeCheckFk(tls, _p, i32(1))
if _rc == i32(0) {
goto _22
}
if func() int32 {
if ((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_sqlite3VdbeLeave(tls, _p)
return i32(1)
}
_rc = i32(787)
goto _26
_22:
_rc = _vdbeCommit(tls, _db, _p)
_26:
if (_rc == i32(5)) && (((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0) {
_sqlite3VdbeLeave(tls, _p)
return i32(5)
}
if _rc != i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = _rc
_sqlite3RollbackAll(tls, _db, i32(0))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
goto _31
}
*(*int64)(unsafe.Pointer(&(_db.X77))) = int64(i32(0))
*(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0))
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-33554433)
sink1 = *p
}
_sqlite3CommitInternalChanges(tls, _db)
_31:
goto _32
_21:
_sqlite3RollbackAll(tls, _db, i32(0))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
_32:
*(*int32)(unsafe.Pointer(&(_db.X76))) = i32(0)
goto _34
_18:
if _3_eStatementOp != i32(0) {
goto _34
}
if ((_p.X10) == i32(0)) || (int32(_p.X30) == i32(3)) {
_3_eStatementOp = i32(1)
goto _39
}
if int32(_p.X30) == i32(2) {
_3_eStatementOp = i32(2)
goto _39
}
_sqlite3RollbackAll(tls, _db, i32(516))
_sqlite3CloseSavepoints(tls, _db)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
_39:
_34:
if _3_eStatementOp == 0 {
goto _40
}
_rc = _sqlite3VdbeCloseStatement(tls, _p, _3_eStatementOp)
if _rc == 0 {
goto _41
}
if ((_p.X10) == i32(0)) || (((_p.X10) & i32(255)) == i32(19)) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = _rc
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = nil
}
_sqlite3RollbackAll(tls, _db, i32(516))
_sqlite3CloseSavepoints(tls, _db)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
_41:
_40:
if ((uint32((_p.X32)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) == 0 {
goto _44
}
if _3_eStatementOp != i32(2) {
_sqlite3VdbeSetChanges(tls, _db, _p.X11)
goto _46
}
_sqlite3VdbeSetChanges(tls, _db, i32(0))
_46:
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
_44:
_sqlite3VdbeLeave(tls, _p)
_3:
if (_p.X9) < i32(0) {
goto _47
}
*(*int32)(unsafe.Pointer(&(_db.X34))) -= 1
if ((uint32((_p.X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 {
*(*int32)(unsafe.Pointer(&(_db.X36))) -= 1
}
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(*int32)(unsafe.Pointer(&(_db.X35))) -= 1
}
func() {
if (_db.X34) < (_db.X35) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74194), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57587)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X35) < (_db.X36) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74195), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57618)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X36) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74196), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57648)))
crt.X__builtin_abort(tls)
}
}()
_47:
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(832317811))
_checkActiveVdbeCnt(tls, _db)
if (_db.X17) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(74201))
}
if (_db.X15) != 0 {
}
func() {
if (_db.X34) <= i32(0) && int32(_db.X15) != i32(0) && (_db.X76) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74212), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeHaltØ00__func__Ø000))), unsafe.Pointer(str(57666)))
crt.X__builtin_abort(tls)
}
}()
return func() int32 {
if (_p.X10) == i32(5) {
return i32(5)
}
return i32(0)
}()
}
// Close all cursors.
//
// Also release any dynamic memory held by the VM in the Vdbe.aMem memory
// cell array. This is necessary as the memory cell array may contain
// pointers to VdbeFrame objects, which may in turn contain pointers to
// open cursors.
func _closeAllCursors(tls *crt.TLS, _p *TVdbe) {
var _1_pFrame, _3_pDel *XVdbeFrame
if (*XVdbeFrame)(_p.X38) == nil {
goto _0
}
_1_pFrame = (*XVdbeFrame)(_p.X38)
_1:
if (*XVdbeFrame)(_1_pFrame.X1) == nil {
goto _4
}
_1_pFrame = (*XVdbeFrame)(_1_pFrame.X1)
goto _1
_4:
_sqlite3VdbeFrameRestore(tls, _1_pFrame)
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = nil
*(*int32)(unsafe.Pointer(&(_p.X40))) = i32(0)
_0:
func() {
if (_p.X40) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73539), unsafe.Pointer((*int8)(unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(57726)))
crt.X__builtin_abort(tls)
}
}()
_closeCursorsInFrame(tls, _p)
if (*XMem)(_p.X18) != nil {
_releaseMemArray(tls, (*XMem)(_p.X18), _p.X6)
}
_7:
if (*XVdbeFrame)(_p.X39) != nil {
_3_pDel = (*XVdbeFrame)(_p.X39)
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X39))))) = (*XVdbeFrame)(_3_pDel.X1)
_sqlite3VdbeFrameDelete(tls, _3_pDel)
goto _7
}
if (*XAuxData)(_p.X43) != nil {
_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_p.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))), i32(-1), i32(0))
}
func() {
if (*XAuxData)(_p.X43) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73552), unsafe.Pointer((*int8)(unsafe.Pointer(&_closeAllCursorsØ00__func__Ø000))), unsafe.Pointer(str(57739)))
crt.X__builtin_abort(tls)
}
}()
}
// Copy the values stored in the VdbeFrame structure to its Vdbe. This
// is used, for example, when a trigger sub-program is halted to restore
// control to the main program.
func _sqlite3VdbeFrameRestore(tls *crt.TLS, _pFrame *XVdbeFrame) (r0 int32) {
var _v *TVdbe
_v = (*TVdbe)(_pFrame.X0)
_closeCursorsInFrame(tls, _v)
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X17))))) = (*XVdbeOp)(_pFrame.X2)
*(*int32)(unsafe.Pointer(&(_v.X27))) = _pFrame.X12
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X18))))) = (*XMem)(_pFrame.X4)
*(*int32)(unsafe.Pointer(&(_v.X6))) = _pFrame.X13
*(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_v.X23))))) = (**XVdbeCursor)(unsafe.Pointer(_pFrame.X5))
*(*int32)(unsafe.Pointer(&(_v.X7))) = _pFrame.X10
*(*int64)(unsafe.Pointer(&((*Xsqlite3)(_v.X0).X7))) = _pFrame.X8
*(*int32)(unsafe.Pointer(&(_v.X11))) = _pFrame.X16
*(*int32)(unsafe.Pointer(&((*Xsqlite3)(_v.X0).X29))) = _pFrame.X17
_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)(_v.X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X43))))), i32(-1), i32(0))
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_v.X43))))) = (*XAuxData)(_pFrame.X9)
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrame.X9))))) = nil
return _pFrame.X11
}
// Close all cursors in the current frame.
func _closeCursorsInFrame(tls *crt.TLS, _p *TVdbe) {
var _1_i int32
var _2_pC *XVdbeCursor
if (**XVdbeCursor)(unsafe.Pointer(_p.X23)) == nil {
goto _0
}
_1_i = i32(0)
_1:
if _1_i >= (_p.X7) {
goto _4
}
_2_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_1_i)))
if _2_pC != nil {
_sqlite3VdbeFreeCursor(tls, _p, _2_pC)
*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_1_i))) = nil
}
_1_i += 1
goto _1
_4:
_0:
}
// Close a VDBE cursor and release all the resources that cursor
// happens to hold.
func _sqlite3VdbeFreeCursor(tls *crt.TLS, _p *TVdbe, _pCx *XVdbeCursor) {
var _7_pVCur *Xsqlite3_file
var _7_pModule *Xsqlite3_module
if _pCx == nil {
return
}
func() {
if (*XBtree)(_pCx.X8) != nil && int32(_pCx.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73451), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000))), unsafe.Pointer(str(57754)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_pCx.X0) {
case i32(0):
goto _6
case i32(1):
goto _5
case i32(2):
goto _7
default:
goto _8
}
_5:
_sqlite3VdbeSorterClose(tls, (*Xsqlite3)(_p.X0), _pCx)
goto _8
_6:
if ((uint32(_pCx.X7) << uint(i32(31))) >> uint(i32(31))) == 0 {
goto _9
}
if (*XBtree)(_pCx.X8) != nil {
_sqlite3BtreeClose(tls, (*XBtree)(_pCx.X8))
}
goto _11
_9:
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73463), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000))), unsafe.Pointer(str(57799)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeCloseCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14)))))))
_11:
goto _8
_7:
_7_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14))))))
_7_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_7_pVCur.X0).X0)
func() {
if ((*Xsqlite3_vtab)(_7_pVCur.X0).X1) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73472), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFreeCursorØ00__func__Ø000))), unsafe.Pointer(str(57818)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*Xsqlite3_vtab)(_7_pVCur.X0).X1))) -= 1
(*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_7_pModule.X7)})))(tls, _7_pVCur)
goto _8
_8:
}
var _sqlite3VdbeFreeCursorØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeFreeCursorØ00__func__Ø000[0], str(57839), 22)
}
// Free any cursor components allocated by sqlite3VdbeSorterXXX routines.
func _sqlite3VdbeSorterClose(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor) {
var _pSorter *XVdbeSorter
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87275), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterCloseØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
if _pSorter != nil {
_sqlite3VdbeSorterReset(tls, _db, _pSorter)
Xsqlite3_free(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSorter))
*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))) = nil
}
}
var _sqlite3VdbeSorterCloseØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterCloseØ00__func__Ø000[0], str(57892), 23)
}
// Reset a sorting cursor back to its original empty state.
func _sqlite3VdbeSorterReset(tls *crt.TLS, _db *Xsqlite3, _pSorter *XVdbeSorter) {
var _i int32
var _2_pTask *XSortSubtask
_vdbeSorterJoinAll(tls, _pSorter, i32(0))
func() {
if (_pSorter.X13) == 0 && (*XPmaReader)(_pSorter.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87243), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterResetØ00__func__Ø000))), unsafe.Pointer(str(57915)))
crt.X__builtin_abort(tls)
}
}()
if (*XPmaReader)(_pSorter.X4) != nil {
_vdbePmaReaderClear(tls, (*XPmaReader)(_pSorter.X4))
_sqlite3DbFree(tls, _db, _pSorter.X4)
*(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X4))))) = nil
}
_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pSorter.X5))
*(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X5))))) = nil
_i = i32(0)
_4:
if _i >= int32(_pSorter.X15) {
goto _7
}
_2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_i)))
_vdbeSortSubtaskCleanup(tls, _db, _2_pTask)
*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pTask.X2))))) = _pSorter
_i += 1
goto _4
_7:
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))
}
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = nil
*(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_pSorter.X12))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_pSorter.X10))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pSorter.X2))) = i32(0)
_sqlite3DbFree(tls, _db, _pSorter.X8)
*(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X8))))) = nil
}
// Join all outstanding threads launched by SorterWrite() to create
// level-0 PMAs.
func _vdbeSorterJoinAll(tls *crt.TLS, _pSorter *XVdbeSorter, _rcin int32) (r0 int32) {
var _rc, _i, _1_rc2 int32
var _1_pTask *XSortSubtask
_rc = _rcin
_i = int32(_pSorter.X15) - i32(1)
_0:
if _i < i32(0) {
goto _3
}
_1_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_i)))
_1_rc2 = _vdbeSorterJoinThread(tls, _1_pTask)
if _rc == i32(0) {
_rc = _1_rc2
}
_i -= 1
goto _0
_3:
return _rc
}
// Join thread pTask->thread.
func _vdbeSorterJoinThread(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
var _rc int32
var _1_pRet unsafe.Pointer
_rc = i32(0)
if (*XSQLiteThread)(_pTask.X0) != nil {
_1_pRet = (unsafe.Pointer)(uintptr(1))
_sqlite3ThreadJoin(tls, (*XSQLiteThread)(_pTask.X0), &_1_pRet)
_rc = int32(uintptr(_1_pRet))
func() {
if (_pTask.X1) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87133), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterJoinThreadØ00__func__Ø000))), unsafe.Pointer(str(57959)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pTask.X1))) = i32(0)
*(**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X0))))) = nil
}
return _rc
}
// Get the results of the thread
func _sqlite3ThreadJoin(tls *crt.TLS, _p *XSQLiteThread, _ppOut *unsafe.Pointer) (r0 int32) {
var _rc int32
func() {
if _ppOut == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26937), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000))), unsafe.Pointer(str(57975)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if _p == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26938), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadJoinØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _sqlite3NomemError(tls, i32(26938))
}
if (_p.X1) != 0 {
*_ppOut = _p.X2
_rc = i32(0)
goto _6
}
_rc = func() int32 {
if crt.Xpthread_join(tls, _p.X0, _ppOut) != 0 {
return i32(1)
}
return i32(0)
}()
_6:
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
return _rc
}
var _sqlite3ThreadJoinØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ThreadJoinØ00__func__Ø000[0], str(57984), 18)
}
var _vdbeSorterJoinThreadØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterJoinThreadØ00__func__Ø000[0], str(58002), 21)
}
var _sqlite3VdbeSorterResetØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterResetØ00__func__Ø000[0], str(58023), 23)
}
// Free all memory belonging to the PmaReader object passed as the
// argument. All structure fields are set to zero before returning.
func _vdbePmaReaderClear(tls *crt.TLS, _pReadr *XPmaReader) {
Xsqlite3_free(tls, (unsafe.Pointer)(_pReadr.X5))
Xsqlite3_free(tls, (unsafe.Pointer)(_pReadr.X7))
if (_pReadr.X9) != nil {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), (unsafe.Pointer)(_pReadr.X9))
}
_vdbeIncrFree(tls, (*XIncrMerger)(_pReadr.X10))
crt.Xmemset(tls, (unsafe.Pointer)(_pReadr), i32(0), u32(52))
}
// Free all resources associated with the IncrMerger object indicated by
// the first argument.
func _vdbeIncrFree(tls *crt.TLS, _pIncr *XIncrMerger) {
if _pIncr == nil {
goto _0
}
if (_pIncr.X5) == 0 {
goto _1
}
_vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.X0))
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+12*uintptr(i32(0)))).X0) != nil {
_sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+12*uintptr(i32(0)))).X0))
}
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+12*uintptr(i32(1)))).X0) != nil {
_sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6)))))+12*uintptr(i32(1)))).X0))
}
_1:
_vdbeMergeEngineFree(tls, (*XMergeEngine)(_pIncr.X1))
Xsqlite3_free(tls, (unsafe.Pointer)(_pIncr))
_0:
}
func _sqlite3OsCloseFree(tls *crt.TLS, _pFile *Xsqlite3_file) {
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20383), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OsCloseFreeØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OsClose(tls, _pFile)
Xsqlite3_free(tls, (unsafe.Pointer)(_pFile))
}
var _sqlite3OsCloseFreeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OsCloseFreeØ00__func__Ø000[0], str(58052), 19)
}
// Free the MergeEngine object passed as the only argument.
func _vdbeMergeEngineFree(tls *crt.TLS, _pMerger *XMergeEngine) {
var _i int32
if _pMerger == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= (_pMerger.X0) {
goto _4
}
_vdbePmaReaderClear(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+52*uintptr(_i))))
_i += 1
goto _1
_4:
_0:
Xsqlite3_free(tls, (unsafe.Pointer)(_pMerger))
}
// Free all resources owned by the object indicated by argument pTask. All
// fields of *pTask are zeroed before returning.
func _vdbeSortSubtaskCleanup(tls *crt.TLS, _db *Xsqlite3, _pTask *XSortSubtask) {
_sqlite3DbFree(tls, _db, _pTask.X3)
if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil {
Xsqlite3_free(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pTask.X4))).X1))
goto _1
}
func() {
if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87067), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSortSubtaskCleanupØ00__func__Ø000))), unsafe.Pointer(str(58071)))
crt.X__builtin_abort(tls)
}
}()
_vdbeSorterRecordFree(tls, nil, (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pTask.X4))).X0))
_1:
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) != nil {
_sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0))
}
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0) != nil {
_sqlite3OsCloseFree(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0))
}
crt.Xmemset(tls, (unsafe.Pointer)(_pTask), i32(0), u32(60))
}
var _vdbeSortSubtaskCleanupØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSortSubtaskCleanupØ00__func__Ø000[0], str(58094), 23)
}
// Free the list of sorted records starting at pRecord.
func _vdbeSorterRecordFree(tls *crt.TLS, _db *Xsqlite3, _pRecord *XSorterRecord) {
var _p, _pNext *XSorterRecord
_p = _pRecord
_0:
if _p == nil {
goto _3
}
_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1))))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p))
_p = _pNext
goto _0
_3:
}
// If parameter iOp is less than zero, then invoke the destructor for
// all auxiliary data pointers currently cached by the VM passed as
// the first argument.
//
// Or, if iOp is greater than or equal to zero, then the destructor is
// only invoked for those auxiliary data pointers created by the user
// function invoked by the OP_Function opcode at instruction iOp of
// VM pVdbe, and only then if:
//
// * the associated function parameter is the 32nd or later (counting
// from left to right), or
//
// * the corresponding bit in argument mask is clear (where the first
// function parameter corresponds to bit 0 etc.).
func _sqlite3VdbeDeleteAuxData(tls *crt.TLS, _db *Xsqlite3, _pp **XAuxData, _iOp int32, _mask int32) {
var _1_pAux *XAuxData
_0:
if (*_pp) == nil {
goto _1
}
_1_pAux = *_pp
if _iOp >= i32(0) && ((_1_pAux.X0) != _iOp || (_1_pAux.X1) < i32(0) || (_1_pAux.X1) <= i32(31) && (uint32(_mask)&(u32(1)<= (_p.X15) {
goto _3
}
_sqlite3VdbeFreeCursor(tls, (*TVdbe)(_p.X0), *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apCsr)) + 4*uintptr(_i))))
_i += 1
goto _0
_3:
_releaseMemArray(tls, _aMem, _p.X14)
_sqlite3VdbeDeleteAuxData(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))), i32(-1), i32(0))
_sqlite3DbFree(tls, (*Xsqlite3)((*TVdbe)(_p.X0).X0), (unsafe.Pointer)(_p))
}
func _checkActiveVdbeCnt(tls *crt.TLS, _db *Xsqlite3) {
var _cnt, _nWrite, _nRead int32
var _p *TVdbe
_cnt = i32(0)
_nWrite = i32(0)
_nRead = i32(0)
_p = (*TVdbe)(_db.X1)
_0:
if _p == nil {
goto _1
}
if Xsqlite3_stmt_busy(tls, (unsafe.Pointer)(_p)) == 0 {
goto _2
}
_cnt += 1
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) == i32(0) {
_nWrite += 1
}
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_nRead += 1
}
_2:
_p = (*TVdbe)(_p.X2)
goto _0
_1:
func() {
if _cnt != (_db.X34) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73910), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58133)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nWrite != (_db.X36) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73911), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58154)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nRead != (_db.X35) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73912), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkActiveVdbeCntØ00__func__Ø000))), unsafe.Pointer(str(58177)))
crt.X__builtin_abort(tls)
}
}()
}
// Return true if the prepared statement is in need of being reset.
func Xsqlite3_stmt_busy(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _v *TVdbe
_v = (*TVdbe)(_pStmt)
return bool2int(((_v != nil) && ((_v.X5) == uint32(i32(770837923)))) && ((_v.X9) >= i32(0)))
}
var _checkActiveVdbeCntØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_checkActiveVdbeCntØ00__func__Ø000[0], str(58198), 19)
}
// If SQLite is compiled to support shared-cache mode and to be threadsafe,
// this routine obtains the mutex associated with each BtShared structure
// that may be accessed by the VM passed as an argument. In doing so it also
// sets the BtShared.db member of each of the BtShared structures, ensuring
// that the correct busy-handler callback is invoked if required.
//
// If SQLite is not threadsafe but does support shared-cache mode, then
// sqlite3BtreeEnter() is invoked to set the BtShared.db variables
// of all of BtShared structures accessible via the database handle
// associated with the VM.
//
// If SQLite is not threadsafe and does not support shared-cache mode, this
// function is a no-op.
//
// The p->btreeMask field is a bitmask of all btrees that the prepared
// statement p will ever use. Let N be the number of bits in p->btreeMask
// corresponding to btrees that use shared cache. Then the runtime of
// this routine is N*N. But as N is rarely more than 1, this should not
// be a problem.
func _sqlite3VdbeEnter(tls *crt.TLS, _p *TVdbe) {
var _i, _nDb int32
var _db *Xsqlite3
var _aDb *XDb
if (_p.X34) == uint32(i32(0)) {
return
}
_db = (*Xsqlite3)(_p.X0)
_aDb = (*XDb)(_db.X4)
_nDb = _db.X5
_i = i32(0)
_1:
if _i >= _nDb {
goto _4
}
if ((_i != i32(1)) && (((_p.X34) & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 {
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+16*uintptr(_i))).X1) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72873), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeEnterØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_sqlite3BtreeEnter(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+16*uintptr(_i))).X1))
}
_i += 1
goto _1
_4:
}
var _sqlite3VdbeEnterØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeEnterØ00__func__Ø000[0], str(58217), 17)
}
func _sqlite3VdbeCheckFk(tls *crt.TLS, _p *TVdbe, _deferred int32) (r0 int32) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_p.X0)
if (_deferred != 0 && (((_db.X77) + (_db.X78)) > int64(i32(0)))) || ((_deferred == 0) && ((_p.X14) > int64(i32(0)))) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(787)
*(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2))
_sqlite3VdbeError(tls, _p, str(58234))
return i32(1)
}
return i32(0)
}
// Change the error string stored in Vdbe.zErrMsg
func _sqlite3VdbeError(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_p.X22))
_ap = args
*(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3VMPrintf(tls, (*Xsqlite3)(_p.X0), _zFormat, _ap)
_ap = nil
}
var _sqlite3VdbeHaltØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeHaltØ00__func__Ø000[0], str(58264), 16)
}
func _sqlite3VdbeLeave(tls *crt.TLS, _p *TVdbe) {
if (_p.X34) == uint32(i32(0)) {
return
}
_vdbeLeave(tls, _p)
}
// Unlock all of the btrees previously locked by a call to sqlite3VdbeEnter().
func _vdbeLeave(tls *crt.TLS, _p *TVdbe) {
var _i, _nDb int32
var _db *Xsqlite3
var _aDb *XDb
_db = (*Xsqlite3)(_p.X0)
_aDb = (*XDb)(_db.X4)
_nDb = _db.X5
_i = i32(0)
_0:
if _i >= _nDb {
goto _3
}
if ((_i != i32(1)) && (((_p.X34) & (u32(1) << uint(_i))) != uint32(i32(0)))) && func() int32 {
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+16*uintptr(_i))).X1) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72893), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeLeaveØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_sqlite3BtreeLeave(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aDb))+16*uintptr(_i))).X1))
}
_i += 1
goto _0
_3:
}
var _vdbeLeaveØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_vdbeLeaveØ00__func__Ø000[0], str(58280), 10)
}
// A read or write transaction may or may not be active on database handle
// db. If a transaction is active, commit it. If there is a
// write-transaction spanning more than one database file, this routine
// takes care of the master journal trickery.
func _vdbeCommit(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
var _i, _nTrans, _rc, _needXcommit, _13_res, _13_retryCount, _13_nMainFile int32
var _13_offset int64
var _14_iRandom uint32
var _13_zMaster, _13_zMainFile, _21_zFile *int8
var _1_pBt, _8_pBt, _10_pBt, _20_pBt, _25_pBt, _29_pBt *XBtree
var _2_pPager *XPager
var _13_pMaster *Xsqlite3_file
var _13_pVfs *Xsqlite3_vfs
_nTrans = i32(0)
_rc = i32(0)
_needXcommit = i32(0)
_rc = _sqlite3VtabSync(tls, _db, _p)
_i = i32(0)
_0:
if _rc != i32(0) || _i >= (_db.X5) {
goto _4
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
goto _5
}
_needXcommit = i32(1)
_sqlite3BtreeEnter(tls, _1_pBt)
_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
if (int32((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X2) != i32(1)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_vdbeCommitØ00aMJNeededØ001)) + 1*uintptr(_sqlite3PagerGetJournalMode(tls, _2_pPager))))) != 0) {
func() {
if _i == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73684), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58290)))
crt.X__builtin_abort(tls)
}
}()
_nTrans += 1
}
_rc = _sqlite3PagerExclusiveLock(tls, _2_pPager)
_sqlite3BtreeLeave(tls, _1_pBt)
_5:
_i += 1
goto _0
_4:
if _rc != i32(0) {
return _rc
}
if _needXcommit == 0 || (_db.X46) == nil {
goto _12
}
_rc = (_db.X46)(tls, _db.X45)
if _rc != 0 {
return i32(531)
}
_12:
if i32(0) != _sqlite3Strlen30(tls, _sqlite3BtreeGetFilename(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1))) && _nTrans > i32(1) {
goto _15
}
_i = i32(0)
_16:
if _rc != i32(0) || _i >= (_db.X5) {
goto _20
}
_8_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _8_pBt != nil {
_rc = _sqlite3BtreeCommitPhaseOne(tls, _8_pBt, nil)
}
_i += 1
goto _16
_20:
_i = i32(0)
_22:
if _rc != i32(0) || _i >= (_db.X5) {
goto _26
}
_10_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _10_pBt != nil {
_rc = _sqlite3BtreeCommitPhaseTwo(tls, _10_pBt, i32(0))
}
_i += 1
goto _22
_26:
if _rc == i32(0) {
_sqlite3VtabCommit(tls, _db)
}
goto _29
_15:
_13_pVfs = (*Xsqlite3_vfs)(_db.X0)
_13_zMaster = nil
_13_zMainFile = _sqlite3BtreeGetFilename(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1))
_13_pMaster = nil
_13_offset = i64(0)
_13_retryCount = i32(0)
_13_nMainFile = _sqlite3Strlen30(tls, _13_zMainFile)
_13_zMaster = _sqlite3MPrintf(tls, _db, str(58295), unsafe.Pointer(_13_zMainFile))
if _13_zMaster == nil {
return _sqlite3NomemError(tls, i32(73756))
}
_30:
if _13_retryCount == 0 {
goto _32
}
if _13_retryCount > i32(100) {
Xsqlite3_log(tls, i32(13), str(58311), unsafe.Pointer(_13_zMaster))
_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(0))
goto _34
}
if _13_retryCount == i32(1) {
Xsqlite3_log(tls, i32(13), str(58325), unsafe.Pointer(_13_zMaster))
}
_32:
_13_retryCount += 1
Xsqlite3_randomness(tls, int32(u32(4)), (unsafe.Pointer)(&_14_iRandom))
Xsqlite3_snprintf(tls, i32(13), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zMaster))+1*uintptr(_13_nMainFile))), str(58340), (_14_iRandom>>uint(i32(8)))&uint32(i32(16777215)), _14_iRandom&uint32(i32(255)))
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zMaster)) + 1*uintptr(_sqlite3Strlen30(tls, _13_zMaster)-i32(3))))) != i32(57) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73774), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58353)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsAccess(tls, _13_pVfs, _13_zMaster, i32(0), &_13_res)
if (_rc == i32(0)) && _13_res != 0 {
goto _30
}
_34:
if _rc == i32(0) {
_rc = _sqlite3OsOpenMalloc(tls, _13_pVfs, _13_zMaster, &_13_pMaster, i32(16406), nil)
}
if _rc != i32(0) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster))
return _rc
}
_i = i32(0)
_42:
if _i >= (_db.X5) {
goto _45
}
_20_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _sqlite3BtreeIsInTrans(tls, _20_pBt) == 0 {
goto _46
}
_21_zFile = _sqlite3BtreeGetJournalname(tls, _20_pBt)
if _21_zFile == nil {
goto _43
}
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_zFile)) + 1*uintptr(i32(0))))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73803), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58394)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3OsWrite(tls, _13_pMaster, (unsafe.Pointer)(_21_zFile), _sqlite3Strlen30(tls, _21_zFile)+i32(1), _13_offset)
{
p := &_13_offset
*p = (*p) + int64(_sqlite3Strlen30(tls, _21_zFile)+i32(1))
sink6 = *p
}
if _rc != i32(0) {
_sqlite3OsCloseFree(tls, _13_pMaster)
_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(0))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster))
return _rc
}
_46:
_43:
_i += 1
goto _42
_45:
if (i32(0) == (_sqlite3OsDeviceCharacteristics(tls, _13_pMaster) & i32(1024))) && (i32(0) != store1(&_rc, _sqlite3OsSync(tls, _13_pMaster, i32(2)))) {
_sqlite3OsCloseFree(tls, _13_pMaster)
_sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(0))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster))
return _rc
}
_i = i32(0)
_53:
if _rc != i32(0) || _i >= (_db.X5) {
goto _57
}
_25_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _25_pBt != nil {
_rc = _sqlite3BtreeCommitPhaseOne(tls, _25_pBt, _13_zMaster)
}
_i += 1
goto _53
_57:
_sqlite3OsCloseFree(tls, _13_pMaster)
func() {
if _rc == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73844), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCommitØ00__func__Ø000))), unsafe.Pointer(str(58406)))
crt.X__builtin_abort(tls)
}
}()
if _rc != i32(0) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster))
return _rc
}
_rc = _sqlite3OsDelete(tls, _13_pVfs, _13_zMaster, i32(1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_13_zMaster))
_13_zMaster = nil
if _rc != 0 {
return _rc
}
_sqlite3BeginBenignMalloc(tls)
_i = i32(0)
_63:
if _i >= (_db.X5) {
goto _66
}
_29_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _29_pBt != nil {
_sqlite3BtreeCommitPhaseTwo(tls, _29_pBt, i32(1))
}
_i += 1
goto _63
_66:
_sqlite3EndBenignMalloc(tls)
_sqlite3VtabCommit(tls, _db)
_29:
return _rc
}
// Invoke the xSync method of all virtual tables in the sqlite3.aVTrans
// array. Return the error code for the first error that occurs, or
// SQLITE_OK if all xSync operations are successful.
//
// If an error message is available, leave it in p->zErrMsg.
func _sqlite3VtabSync(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) (r0 int32) {
var _i, _rc int32
var _1_pVtab *Xsqlite3_vtab
var _aVTrans **XVTable
var _1_x func(*crt.TLS, *Xsqlite3_vtab) int32
_rc = i32(0)
_aVTrans = (**XVTable)(unsafe.Pointer(_db.X67))
*(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = nil
_i = i32(0)
_0:
if _rc != i32(0) || _i >= (_db.X64) {
goto _4
}
_1_pVtab = (*Xsqlite3_vtab)((*(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aVTrans)) + 4*uintptr(_i)))).X2)
if (_1_pVtab != nil) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{store49(&_1_x, *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_module)(_1_pVtab.X0).X15)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{nil}))) {
_rc = _1_x(tls, _1_pVtab)
_sqlite3VtabImportErrmsg(tls, _p, _1_pVtab)
}
_i += 1
goto _0
_4:
*(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = _aVTrans
return _rc
}
// Transfer error message text from an sqlite3_vtab.zErrMsg (text stored
// in memory obtained from sqlite3_malloc) into a Vdbe.zErrMsg (text stored
// in memory obtained from sqlite3DbMalloc).
func _sqlite3VtabImportErrmsg(tls *crt.TLS, _p *TVdbe, _pVtab *Xsqlite3_vtab) {
var _1_db *Xsqlite3
if (_pVtab.X2) != nil {
_1_db = (*Xsqlite3)(_p.X0)
_sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3DbStrDup(tls, _1_db, _pVtab.X2)
Xsqlite3_free(tls, (unsafe.Pointer)(_pVtab.X2))
*(**int8)(unsafe.Pointer(&(_pVtab.X2))) = nil
}
}
var _vdbeCommitØ00aMJNeededØ001 [6]uint8
func init() {
_vdbeCommitØ00aMJNeededØ001 = [6]uint8{1, 1, 0, 1, 0, 0}
}
// Return the current journal mode.
func _sqlite3PagerGetJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
return int32(_pPager.X2)
}
var _vdbeCommitØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_vdbeCommitØ00__func__Ø000[0], str(58422), 11)
}
// 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 _sqlite3BtreeGetFilename(tls *crt.TLS, _p *XBtree) (r0 *int8) {
func() {
if (*XPager)((*XBtShared)(_p.X1).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68620), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetFilenameØ00__func__Ø000))), unsafe.Pointer(str(58433)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3PagerFilename(tls, (*XPager)((*XBtShared)(_p.X1).X0), i32(1))
}
var _sqlite3BtreeGetFilenameØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeGetFilenameØ00__func__Ø000[0], str(58451), 24)
}
// Return the full pathname of the database file.
//
// Except, if the pager is in-memory only, then return an empty string if
// nullIfMemDb is true. This routine is called with nullIfMemDb==1 when
// used to report the filename to the user, for compatibility with legacy
// behavior. But when the Btree needs to know the filename for matching to
// shared cache, it uses nullIfMemDb==0 so that in-memory databases can
// participate in shared-cache.
func _sqlite3PagerFilename(tls *crt.TLS, _pPager *XPager, _nullIfMemDb int32) (r0 *int8) {
return func() *int8 {
if _nullIfMemDb != 0 && ((_pPager.X13) != 0) {
return str(0)
}
return (_pPager.X51)
}()
}
// Invoke the xCommit method of all virtual tables in the
// sqlite3.aVTrans array. Then clear the array itself.
func _sqlite3VtabCommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
_callFinaliser(tls, _db, int32(u32(64)))
return i32(0)
}
func _sqlite3OsOpenMalloc(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFile *int8, _ppFile **Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
var _rc int32
var _pFile *Xsqlite3_file
_pFile = (*Xsqlite3_file)(_sqlite3MallocZero(tls, uint64(_pVfs.X1)))
if _pFile == nil {
goto _0
}
_rc = _sqlite3OsOpen(tls, _pVfs, _zFile, _pFile, _flags, _pOutFlags)
if _rc != i32(0) {
Xsqlite3_free(tls, (unsafe.Pointer)(_pFile))
goto _2
}
*_ppFile = _pFile
_2:
goto _3
_0:
_rc = _sqlite3NomemError(tls, i32(20378))
_3:
return _rc
}
// 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 _sqlite3BtreeGetJournalname(tls *crt.TLS, _p *XBtree) (r0 *int8) {
func() {
if (*XPager)((*XBtShared)(_p.X1).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68633), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeGetJournalnameØ00__func__Ø000))), unsafe.Pointer(str(58433)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3PagerJournalname(tls, (*XPager)((*XBtShared)(_p.X1).X0))
}
var _sqlite3BtreeGetJournalnameØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeGetJournalnameØ00__func__Ø000[0], str(58475), 27)
}
// Return the full pathname of the journal file.
func _sqlite3PagerJournalname(tls *crt.TLS, _pPager *XPager) (r0 *int8) {
return _pPager.X52
}
// This routine is called when a commit occurs.
func _sqlite3CommitInternalChanges(tls *crt.TLS, _db *Xsqlite3) {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-3)
sink1 = *p
}
}
func _sqlite3VdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
if ((*Xsqlite3)(_p.X0).X76) != 0 && (_p.X12) != 0 {
return _vdbeCloseStatement(tls, _p, _eOp)
}
return i32(0)
}
// If the Vdbe passed as the first argument opened a statement-transaction,
// close it now. Argument eOp must be either SAVEPOINT_ROLLBACK or
// SAVEPOINT_RELEASE. If it is SAVEPOINT_ROLLBACK, then the statement
// transaction is rolled back. If eOp is SAVEPOINT_RELEASE, then the
// statement transaction is committed.
//
// If an IO error occurs, an SQLITE_IOERR_XXX error code is returned.
// Otherwise SQLITE_OK.
func _vdbeCloseStatement(tls *crt.TLS, _p *TVdbe, _eOp int32) (r0 int32) {
var _rc, _i, _iSavepoint, _1_rc2 int32
var _db *Xsqlite3
var _1_pBt *XBtree
_db = (*Xsqlite3)(_p.X0)
_rc = i32(0)
_iSavepoint = (_p.X12) - i32(1)
func() {
if _eOp != i32(2) && _eOp != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73934), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58502)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X76) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73935), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58552)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X12) != ((_db.X76) + (_db.X75)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73936), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeCloseStatementØ00__func__Ø000))), unsafe.Pointer(str(58569)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_7:
if _i >= (_db.X5) {
goto _10
}
_1_rc2 = i32(0)
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_pBt == nil {
goto _11
}
if _eOp == i32(2) {
_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, i32(2), _iSavepoint)
}
if _1_rc2 == i32(0) {
_1_rc2 = _sqlite3BtreeSavepoint(tls, _1_pBt, i32(1), _iSavepoint)
}
if _rc == i32(0) {
_rc = _1_rc2
}
_11:
_i += 1
goto _7
_10:
*(*int32)(unsafe.Pointer(&(_db.X76))) -= 1
*(*int32)(unsafe.Pointer(&(_p.X12))) = i32(0)
if _rc != i32(0) {
goto _15
}
if _eOp == i32(2) {
_rc = _sqlite3VtabSavepoint(tls, _db, i32(2), _iSavepoint)
}
if _rc == i32(0) {
_rc = _sqlite3VtabSavepoint(tls, _db, i32(1), _iSavepoint)
}
_15:
if _eOp == i32(2) {
*(*int64)(unsafe.Pointer(&(_db.X77))) = _p.X15
*(*int64)(unsafe.Pointer(&(_db.X78))) = _p.X16
}
return _rc
}
var _vdbeCloseStatementØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_vdbeCloseStatementØ00__func__Ø000[0], str(58616), 19)
}
// 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 _sqlite3BtreeSavepoint(tls *crt.TLS, _p *XBtree, _op int32, _iSavepoint int32) (r0 int32) {
var _rc int32
var _1_pBt *XBtShared
_rc = i32(0)
if _p == nil || int32(_p.X2) != i32(2) {
goto _1
}
_1_pBt = (*XBtShared)(_p.X1)
func() {
if _op != i32(1) && _op != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63136), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000))), unsafe.Pointer(str(14924)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iSavepoint < i32(0) && (_iSavepoint != i32(-1) || _op != i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63137), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000))), unsafe.Pointer(str(58635)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
if _op == i32(2) {
_rc = _saveAllCursors(tls, _1_pBt, uint32(i32(0)), nil)
}
if _rc == i32(0) {
_rc = _sqlite3PagerSavepoint(tls, (*XPager)(_1_pBt.X0), _op, _iSavepoint)
}
if _rc != i32(0) {
goto _11
}
if (_iSavepoint < i32(0)) && ((int32(_1_pBt.X10) & i32(8)) != i32(0)) {
*(*uint32)(unsafe.Pointer(&(_1_pBt.X18))) = uint32(i32(0))
}
_rc = _newDatabase(tls, _1_pBt)
*(*uint32)(unsafe.Pointer(&(_1_pBt.X18))) = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(28))))))+uintptr(unsafe.Pointer((*XMemPage)(_1_pBt.X3).X19)))))
func() {
if (_1_pBt.X18) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63155), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSavepointØ00__func__Ø000))), unsafe.Pointer(str(58695)))
crt.X__builtin_abort(tls)
}
}()
_11:
_sqlite3BtreeLeave(tls, _p)
_1:
return _rc
}
var _sqlite3BtreeSavepointØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSavepointØ00__func__Ø000[0], str(58708), 22)
}
// Invoke either the xSavepoint, xRollbackTo or xRelease method of all
// virtual tables that currently have an open transaction. Pass iSavepoint
// as the second argument to the virtual table method invoked.
//
// If op is SAVEPOINT_BEGIN, the xSavepoint method is invoked. If it is
// SAVEPOINT_ROLLBACK, the xRollbackTo method. Otherwise, if op is
// SAVEPOINT_RELEASE, then the xRelease method of each virtual table with
// an open transaction is invoked.
//
// If any virtual table method returns an error code other than SQLITE_OK,
// processing is abandoned and the error returned to the caller of this
// function immediately. If all calls to virtual table methods are successful,
// SQLITE_OK is returned.
func _sqlite3VtabSavepoint(tls *crt.TLS, _db *Xsqlite3, _op int32, _iSavepoint int32) (r0 int32) {
var _rc, _1_i int32
var _2_pVTab *XVTable
var _2_pMod *Xsqlite3_module
var _3_xMethod func(*crt.TLS, *Xsqlite3_vtab, int32) int32
_rc = i32(0)
func() {
if _op != i32(1) && _op != i32(2) && _op != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125979), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000))), unsafe.Pointer(str(58730)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iSavepoint < i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125980), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabSavepointØ00__func__Ø000))), unsafe.Pointer(str(58797)))
crt.X__builtin_abort(tls)
}
}()
if (**XVTable)(unsafe.Pointer(_db.X67)) == nil {
goto _6
}
_1_i = i32(0)
_7:
if _rc != i32(0) || _1_i >= (_db.X64) {
goto _11
}
_2_pVTab = *(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 4*uintptr(_1_i)))
_2_pMod = (*Xsqlite3_module)((*XModule)(_2_pVTab.X1).X0)
if (*Xsqlite3_vtab)(_2_pVTab.X2) == nil || (_2_pMod.X0) < i32(2) {
goto _13
}
switch _op {
case i32(0):
goto _15
case i32(2):
goto _16
default:
goto _17
}
_15:
_3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_2_pMod.X20)}))
*(*int32)(unsafe.Pointer(&(_2_pVTab.X5))) = _iSavepoint + i32(1)
goto _18
_16:
_3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_2_pMod.X22)}))
goto _18
_17:
_3_xMethod = *(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_2_pMod.X21)}))
goto _18
_18:
if (_3_xMethod != nil) && ((_2_pVTab.X5) > _iSavepoint) {
_rc = _3_xMethod(tls, (*Xsqlite3_vtab)(_2_pVTab.X2), _iSavepoint)
}
_13:
_1_i += 1
goto _7
_11:
_6:
return _rc
}
var _sqlite3VtabSavepointØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabSavepointØ00__func__Ø000[0], str(58812), 21)
}
// This routine sets the value to be returned by subsequent calls to
// sqlite3_changes() on the database handle 'db'.
func _sqlite3VdbeSetChanges(tls *crt.TLS, _db *Xsqlite3, _nChange int32) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetChangesØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_db.X29))) = _nChange
{
p := (*int32)(unsafe.Pointer(&(_db.X30)))
*p = (*p) + _nChange
sink1 = *p
}
}
var _sqlite3VdbeSetChangesØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSetChangesØ00__func__Ø000[0], str(58833), 22)
}
// Copy the error code and error message belonging to the VDBE passed
// as the first argument to its database handle (so that they will be
// returned by calls to sqlite3_errcode() and sqlite3_errmsg()).
//
// This function does not clear the VDBE error code or message, just
// copies them to the database handle.
func _sqlite3VdbeTransferError(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _rc int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_p.X0)
_rc = _p.X10
if (_p.X22) == nil {
goto _0
}
*(*uint8)(unsafe.Pointer(&(_db.X18))) += 1
_sqlite3BeginBenignMalloc(tls)
if (*XMem)(_db.X56) == nil {
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X56))))) = _sqlite3ValueNew(tls, _db)
}
_sqlite3ValueSetStr(tls, (*XMem)(_db.X56), i32(-1), (unsafe.Pointer)(_p.X22), uint8(i32(1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_sqlite3EndBenignMalloc(tls)
*(*uint8)(unsafe.Pointer(&(_db.X18))) -= 1
*(*int32)(unsafe.Pointer(&(_db.X10))) = _rc
goto _2
_0:
_sqlite3Error(tls, _db, _rc)
_2:
return _rc
}
// Clean up the VM after a single run.
func _Cleanup(tls *crt.TLS, _p *TVdbe) {
var _i int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_p.X0)
if (**XVdbeCursor)(unsafe.Pointer(_p.X23)) == nil {
goto _4
}
_i = i32(0)
_1:
if _i >= (_p.X7) {
goto _4
}
func() {
if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_i)))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73565), unsafe.Pointer((*int8)(unsafe.Pointer(&_CleanupØ00__func__Ø000))), unsafe.Pointer(str(58855)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _1
_4:
if (*XMem)(_p.X18) == nil {
goto _7
}
_i = i32(0)
_8:
if _i >= (_p.X6) {
goto _11
}
func() {
if int32((*XMem)(unsafe.Pointer(uintptr(_p.X18)+48*uintptr(_i))).X1) != i32(128) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73567), unsafe.Pointer((*int8)(unsafe.Pointer(&_CleanupØ00__func__Ø000))), unsafe.Pointer(str(58870)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _8
_11:
_7:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = nil
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil
}
var _CleanupØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_CleanupØ00__func__Ø000[0], str(58902), 8)
}
var _sqlite3VdbeFinalizeØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeFinalizeØ00__func__Ø000[0], str(58910), 20)
}
// Delete an entire VDBE.
func _sqlite3VdbeDelete(tls *crt.TLS, _p *TVdbe) {
var _db *Xsqlite3
if func() int32 {
if _p == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74449), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
_db = (*Xsqlite3)(_p.X0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74451), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeClearObject(tls, _db, _p)
if (*TVdbe)(_p.X1) != nil {
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_p.X1).X2))))) = (*TVdbe)(_p.X2)
goto _6
}
func() {
if (*TVdbe)(_db.X1) != _p {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74456), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeDeleteØ00__func__Ø000))), unsafe.Pointer(str(58930)))
crt.X__builtin_abort(tls)
}
}()
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X1))))) = (*TVdbe)(_p.X2)
_6:
if (*TVdbe)(_p.X2) != nil {
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TVdbe)(_p.X2).X1))))) = (*TVdbe)(_p.X1)
}
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(1443283912))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
var _sqlite3VdbeDeleteØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeDeleteØ00__func__Ø000[0], str(58943), 18)
}
// Free all memory associated with the Vdbe passed as the second argument,
// except for object itself, which is preserved.
//
// The difference between this function and sqlite3VdbeDelete() is that
// VdbeDelete() also unlinks the Vdbe from the list of VMs associated with
// the database connection and frees the object itself.
func _sqlite3VdbeClearObject(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
var _pSub, _pNext *XSubProgram
func() {
if (*Xsqlite3)(_p.X0) != nil && (*Xsqlite3)(_p.X0) != _db {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeClearObjectØ00__func__Ø000))), unsafe.Pointer(str(58961)))
crt.X__builtin_abort(tls)
}
}()
_releaseMemArray(tls, (*XMem)(_p.X20), int32(_p.X29)*i32(2))
_pSub = (*XSubProgram)(_p.X42)
_3:
if _pSub == nil {
goto _6
}
_pNext = (*XSubProgram)(_pSub.X6)
_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_pSub.X0), _pSub.X1)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSub))
_pSub = _pNext
goto _3
_6:
if (_p.X5) != uint32(i32(381479589)) {
_releaseMemArray(tls, (*XMem)(_p.X24), int32(_p.X4))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X25))
_sqlite3DbFree(tls, _db, _p.X37)
}
_vdbeFreeOpArray(tls, _db, (*XVdbeOp)(_p.X17), _p.X27)
_sqlite3DbFree(tls, _db, _p.X20)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X36))
}
var _sqlite3VdbeClearObjectØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeClearObjectØ00__func__Ø000[0], str(58983), 23)
}
// Free the space allocated for aOp and any p4 values allocated for the
// opcodes contained within. If aOp is not NULL it is assumed to contain
// nOp entries.
func _vdbeFreeOpArray(tls *crt.TLS, _db *Xsqlite3, _aOp *XVdbeOp, _nOp int32) {
var _1_pOp *XVdbeOp
if _aOp == nil {
goto _0
}
_1_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_nOp-i32(1))))
_1:
if uintptr(unsafe.Pointer(_1_pOp)) < uintptr(unsafe.Pointer(_aOp)) {
goto _4
}
if (_1_pOp.X1) != 0 {
_freeP4(tls, _db, int32(_1_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6))))))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pOp.X7))
*(*uintptr)(unsafe.Pointer(&_1_pOp)) += uintptr(4294967272)
goto _1
_4:
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_aOp))
_0:
}
// Free all memory allocations in the pParse object
func _sqlite3ParserReset(tls *crt.TLS, _pParse *XParse) {
var _1_db *Xsqlite3
if _pParse == nil {
goto _0
}
_1_db = (*Xsqlite3)(_pParse.X0)
_sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_pParse.X26))
_sqlite3ExprListDelete(tls, _1_db, (*XExprList)(_pParse.X27))
if _1_db != nil {
func() {
if ((*t7)(unsafe.Pointer(&(_1_db.X58))).X0) < uint32(_pParse.X12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116168), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParserResetØ00__func__Ø000))), unsafe.Pointer(str(59006)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_1_db.X58))).X0)))
*p = (*p) - uint32(_pParse.X12)
sink5 = *p
}
}
*(*uint8)(unsafe.Pointer(&(_pParse.X12))) = uint8(i32(0))
_0:
}
var _sqlite3ParserResetØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ParserResetØ00__func__Ø000[0], str(59057), 19)
}
// The following routine destroys a virtual machine that is created by
// the sqlite3_compile() routine. The integer returned is an SQLITE_
// success/failure code that describes the result of executing the virtual
// machine.
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
func Xsqlite3_finalize(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _rc int32
var _2_db *Xsqlite3
var _2_v *TVdbe
if _pStmt == nil {
_rc = i32(0)
goto _1
}
_2_v = (*TVdbe)(_pStmt)
_2_db = (*Xsqlite3)(_2_v.X0)
if _vdbeSafety(tls, _2_v) != 0 {
return _sqlite3MisuseError(tls, i32(76202))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.X3))
if (_2_v.X26) > int64(i32(0)) {
_invokeProfileCallback(tls, _2_db, _2_v)
}
_rc = _sqlite3VdbeFinalize(tls, _2_v)
_rc = _sqlite3ApiExit(tls, _2_db, _rc)
_sqlite3LeaveMutexAndCloseZombie(tls, _2_db)
_1:
return _rc
}
// Invoke the profile callback. This routine is only called if we already
// know that the profile callback is defined and needs to be invoked.
func _invokeProfileCallback(tls *crt.TLS, _db *Xsqlite3, _p *TVdbe) {
var _iNow, _iElapse int64
func() {
if (_p.X26) <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76160), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59076)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, uint64)
}{(_db.X43)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, uint64)
}{nil})) && (int32(_db.X24)&i32(2)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76161), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59091)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76162), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(49896)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X36) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76163), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeProfileCallbackØ00__func__Ø000))), unsafe.Pointer(str(59149)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.X0), &_iNow)
_iElapse = (_iNow - (_p.X26)) * int64(i32(1000000))
if (_db.X43) != nil {
(_db.X43)(tls, _db.X44, _p.X36, uint64(_iElapse))
}
if (int32(_db.X24) & i32(2)) != 0 {
(_db.X41)(tls, uint32(i32(2)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(&_iElapse))
}
*(*int64)(unsafe.Pointer(&(_p.X26))) = int64(i32(0))
}
var _invokeProfileCallbackØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_invokeProfileCallbackØ00__func__Ø000[0], str(59160), 22)
}
var _sqlite3LockAndPrepareØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3LockAndPrepareØ00__func__Ø000[0], str(59182), 22)
}
var _sqlite3_prepareØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_prepareØ00__func__Ø000[0], str(59204), 16)
}
// Return UTF-8 encoded English language explanation of the most recent
// error.
func Xsqlite3_errmsg(tls *crt.TLS, _db *Xsqlite3) (r0 *int8) {
var _z *int8
if _db == nil {
return _sqlite3ErrStr(tls, _sqlite3NomemError(tls, i32(142705)))
}
if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, i32(142708)))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if (_db.X17) != 0 {
_z = _sqlite3ErrStr(tls, _sqlite3NomemError(tls, i32(142712)))
goto _3
}
_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.X56))))
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142716), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_errmsgØ00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
if _z == nil {
_z = _sqlite3ErrStr(tls, _db.X10)
}
_3:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _z
}
// Return a static string that describes the kind of error specified in the
// argument.
func _sqlite3ErrStr(tls *crt.TLS, _rc int32) (r0 *int8) {
var _zErr *int8
_zErr = str(59220)
switch _rc {
case i32(516):
goto _1
default:
goto _2
}
_1:
_zErr = str(59234)
goto _3
_2:
{
p := &_rc
*p = (*p) & i32(255)
sink1 = *p
}
if (func() int32 {
if _rc >= i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141905), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ErrStrØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && (_rc < i32(27))) && ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3ErrStrØ00aMsgØ001)) + 4*uintptr(_rc)))) != nil) {
_zErr = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3ErrStrØ00aMsgØ001)) + 4*uintptr(_rc)))
}
goto _3
_3:
return _zErr
}
var _sqlite3ErrStrØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ErrStrØ00__func__Ø000[0], str(59256), 14)
}
var _sqlite3ErrStrØ00aMsgØ001 [27]*int8
func init() {
_sqlite3ErrStrØ00aMsgØ001 = [27]*int8{str(59270), str(59283), nil, str(59319), str(59344), str(59375), str(59394), str(59419), str(59433), str(59470), str(59482), str(59497), str(59530), str(59548), str(59573), str(59602), str(59619), str(59642), str(6810), str(59670), str(59688), str(59706), str(59745), str(59776), str(59797), str(59829), str(59863)}
}
var _sqlite3_errmsgØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_errmsgØ00__func__Ø000[0], str(59902), 15)
}
// 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 _sqlite3FindIndex(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDb *int8) (r0 *XIndex) {
var _i, _1_j int32
var _1_pSchema *XSchema
var _p *XIndex
_p = nil
func() {
if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100120), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000))), unsafe.Pointer(str(59917)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_3:
if _i >= (_db.X5) {
goto _6
}
_1_j = func() int32 {
if _i < i32(2) {
return (_i ^ i32(1))
}
return _i
}()
_1_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_1_j))).X4)
func() {
if _1_pSchema == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100124), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000))), unsafe.Pointer(str(59959)))
crt.X__builtin_abort(tls)
}
}()
if (_zDb != nil) && _sqlite3StrICmp(tls, _zDb, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_1_j))).X0) != 0 {
goto _4
}
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _1_j, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100126), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindIndexØ00__func__Ø000))), unsafe.Pointer(str(59967)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XIndex)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_1_pSchema.X3))), _zName))
if _p != nil {
goto _6
}
_4:
_i += 1
goto _3
_6:
return _p
}
var _sqlite3FindIndexØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FindIndexØ00__func__Ø000[0], str(60000), 17)
}
// Free any prior content in *pz and replace it with a copy of zNew.
func _sqlite3SetString(tls *crt.TLS, _pz **int8, _db *Xsqlite3, _zNew *int8) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*_pz))
*_pz = _sqlite3DbStrDup(tls, _db, _zNew)
}
// 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 _sqlite3BtreeSetCacheSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61662), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetCacheSizeØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_sqlite3PagerSetCachesize(tls, (*XPager)(_pBt.X0), _mxPage)
_sqlite3BtreeLeave(tls, _p)
return i32(0)
}
var _sqlite3BtreeSetCacheSizeØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetCacheSizeØ00__func__Ø000[0], str(60017), 25)
}
// Change the maximum number of in-memory pages that are allowed
// before attempting to recycle clean and unused pages.
func _sqlite3PagerSetCachesize(tls *crt.TLS, _pPager *XPager, _mxPage int32) {
_sqlite3PcacheSetCachesize(tls, (*XPCache)(_pPager.X59), _mxPage)
}
// Set the suggested cache-size value.
func _sqlite3PcacheSetCachesize(tls *crt.TLS, _pCache *XPCache, _mxPage int32) {
func() {
if (_pCache.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44939), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetCachesizeØ00__func__Ø000))), unsafe.Pointer(str(15958)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pCache.X4))) = _mxPage
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X5)(tls, _pCache.X12, _numberOfCachePages(tls, _pCache))
}
var _sqlite3PcacheSetCachesizeØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheSetCachesizeØ00__func__Ø000[0], str(60042), 26)
}
// Load the content of the sqlite_stat1 and sqlite_stat3/4 tables. The
// contents of sqlite_stat1 are used to populate the Index.aiRowEst[]
// arrays. The contents of sqlite_stat3/4 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_STAT3/4 was defined
// during compilation and the sqlite_stat3/4 table is present, no data is
// read from it.
//
// If SQLITE_ENABLE_STAT3/4 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 _sqlite3AnalysisLoad(tls *crt.TLS, _db *Xsqlite3, _iDb int32) (r0 int32) {
var _rc int32
var _zSql *int8
var _pSchema *XSchema
var _i *XHashElem
var _1_pTab *XTable
var _2_pIdx, _6_pIdx *XIndex
var _sInfo XanalysisInfo
_rc = i32(0)
_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98772), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000))), unsafe.Pointer(str(60068)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98775), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X2))).X2)
_7:
if _i == nil {
goto _10
}
_1_pTab = (*XTable)(_i.X2)
{
p := (*uint32)(unsafe.Pointer(&(_1_pTab.X9)))
*p = (*p) & uint32(i32(-17))
sink5 = *p
}
_i = (*XHashElem)(_i.X0)
goto _7
_10:
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2)
_11:
if _i == nil {
goto _14
}
_2_pIdx = (*XIndex)(_i.X2)
storebits3((*int8)(unsafe.Pointer(&(_2_pIdx.X16))), int8(i32(0)), 128, 7)
_i = (*XHashElem)(_i.X0)
goto _11
_14:
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sInfo.X0))))) = _db
*(**int8)(unsafe.Pointer(&(_sInfo.X1))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
if _sqlite3FindTable(tls, _db, str(60088), _sInfo.X1) == nil {
goto _15
}
_zSql = _sqlite3MPrintf(tls, _db, str(60101), unsafe.Pointer(_sInfo.X1))
if _zSql == nil {
_rc = _sqlite3NomemError(tls, i32(98796))
goto _17
}
_rc = Xsqlite3_exec(tls, _db, _zSql, _analysisLoader, (unsafe.Pointer)(&_sInfo), nil)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql))
_17:
_15:
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98804), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalysisLoadØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2)
_20:
if _i == nil {
goto _23
}
_6_pIdx = (*XIndex)(_i.X2)
if ((uint32((_6_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 {
_sqlite3DefaultRowEst(tls, _6_pIdx)
}
_i = (*XHashElem)(_i.X0)
goto _20
_23:
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
return _rc
_ = _sInfo
panic(0)
}
var _sqlite3AnalysisLoadØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AnalysisLoadØ00__func__Ø000[0], str(60142), 20)
}
// 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 _sqlite3FindTable(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _zDatabase *int8) (r0 *XTable) {
var _i, _2_j int32
var _p *XTable
_p = nil
func() {
if _zDatabase == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99999), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000))), unsafe.Pointer(str(60162)))
crt.X__builtin_abort(tls)
}
}()
_3:
_i = i32(0)
_5:
if _i >= (_db.X5) {
goto _8
}
_2_j = func() int32 {
if _i < i32(2) {
return (_i ^ i32(1))
}
return _i
}()
if _zDatabase != nil && _sqlite3StrICmp(tls, _zDatabase, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_2_j))).X0) != i32(0) {
goto _12
}
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindTableØ00__func__Ø000))), unsafe.Pointer(str(59967)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XTable)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_2_j))).X4).X2))), _zName))
if _p != nil {
return _p
}
_12:
_i += 1
goto _5
_8:
if _sqlite3StrICmp(tls, _zName, str(50026)) != i32(0) {
goto _4
}
if Xsqlite3_stricmp(tls, _zDatabase, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X0) != i32(0) {
goto _4
}
_zName = str(50007)
goto _3
_4:
return nil
}
var _sqlite3FindTableØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FindTableØ00__func__Ø000[0], str(60210), 17)
}
// This callback is invoked once for each index when reading the
// sqlite_stat1 table.
//
// argv[0] = name of the table
// argv[1] = name of the index (might be NULL)
// argv[2] = results of analysis - on integer for each column
//
// Entries for which argv[1]==NULL simply record the number of rows in
// the table.
func _analysisLoader(tls *crt.TLS, _pData unsafe.Pointer, _argc int32, _argv **int8, _NotUsed **int8) (r0 int32) {
var _6_nCol int32
var _z *int8
var _6_aiRowEst *uint32
var _pTable *XTable
var _pIndex *XIndex
var _8_fakeIdx XIndex
var _pInfo *XanalysisInfo
_pInfo = (*XanalysisInfo)(_pData)
func() {
if _argc != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98427), unsafe.Pointer((*int8)(unsafe.Pointer(&_analysisLoaderØ00__func__Ø000))), unsafe.Pointer(str(50294)))
crt.X__builtin_abort(tls)
}
}()
_ = _argc
if ((_argv == nil) || ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == nil)) || ((*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))) == nil) {
return i32(0)
}
_pTable = _sqlite3FindTable(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), _pInfo.X1)
if _pTable == nil {
return i32(0)
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) == nil {
_pIndex = nil
goto _9
}
if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) == i32(0) {
_pIndex = _sqlite3PrimaryKeyIndex(tls, _pTable)
goto _9
}
_pIndex = _sqlite3FindIndex(tls, (*Xsqlite3)(_pInfo.X0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))), _pInfo.X1)
_9:
_z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))
if _pIndex == nil {
goto _10
}
_6_aiRowEst = nil
_6_nCol = int32(_pIndex.X13) + i32(1)
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 4, 2)
_decodeIntArray(tls, _z, _6_nCol, _6_aiRowEst, _pIndex.X2, _pIndex)
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 128, 7)
if (*XExpr)(_pIndex.X9) == nil {
*(*int16)(unsafe.Pointer(&(_pTable.X12))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X2)) + 2*uintptr(i32(0))))
{
p := (*uint32)(unsafe.Pointer(&(_pTable.X9)))
*p = (*p) | uint32(i32(16))
sink5 = *p
}
}
goto _12
_10:
*(*int16)(unsafe.Pointer(&(_8_fakeIdx.X12))) = _pTable.X13
_decodeIntArray(tls, _z, i32(1), nil, (*int16)(unsafe.Pointer(&(_pTable.X12))), &_8_fakeIdx)
*(*int16)(unsafe.Pointer(&(_pTable.X13))) = _8_fakeIdx.X12
{
p := (*uint32)(unsafe.Pointer(&(_pTable.X9)))
*p = (*p) | uint32(i32(16))
sink5 = *p
}
_12:
return i32(0)
_ = _8_fakeIdx
panic(0)
}
var _analysisLoaderØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_analysisLoaderØ00__func__Ø000[0], str(60227), 15)
}
// The first argument points to a nul-terminated string containing a
// list of space separated integers. Read the first nOut of these into
// the array aOut[].
func _decodeIntArray(tls *crt.TLS, _zIntArray *int8, _nOut int32, _aOut *uint32, _aLog *int16, _pIndex *XIndex) {
var _c, _i int32
var _v uint32
var _z *int8
_z = _zIntArray
func() {
if _z == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98365), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000))), unsafe.Pointer(str(44451)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if (*_z) == 0 || _i >= _nOut {
goto _6
}
_v = uint32(i32(0))
_7:
if (store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))) >= i32(48)) && (_c <= i32(57)) {
_v = ((_v * uint32(i32(10))) + uint32(_c)) - uint32(i32(48))
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _7
}
func() {
if _aOut != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98377), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000))), unsafe.Pointer(str(60242)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _aLog == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98379), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000))), unsafe.Pointer(str(60250)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLog)) + 2*uintptr(_i))) = _sqlite3LogEst(tls, uint64(_v))
if int32(*_z) == i32(32) {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
}
_i += 1
goto _2
_6:
func() {
if _pIndex == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98385), unsafe.Pointer((*int8)(unsafe.Pointer(&_decodeIntArrayØ00__func__Ø000))), unsafe.Pointer(str(60258)))
crt.X__builtin_abort(tls)
}
}()
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 4, 2)
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 64, 6)
_17:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == 0 {
goto _18
}
if Xsqlite3_strglob(tls, str(60268), _z) == i32(0) {
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 4, 2)
goto _23
}
if Xsqlite3_strglob(tls, str(60279), _z) == i32(0) {
*(*int16)(unsafe.Pointer(&(_pIndex.X12))) = _sqlite3LogEst(tls, uint64(_sqlite3Atoi(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(3)))))))))))
goto _23
}
if Xsqlite3_strglob(tls, str(60289), _z) == i32(0) {
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 64, 6)
}
_23:
if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(32)) {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _23
}
_25:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(32) {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _25
}
goto _17
_18:
}
var _decodeIntArrayØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_decodeIntArrayØ00__func__Ø000[0], str(60301), 15)
}
// The sqlite3_strglob() interface. Return 0 on a match (like strcmp()) and
// non-zero if there is no match.
func Xsqlite3_strglob(tls *crt.TLS, _zGlobPattern *int8, _zString *int8) (r0 int32) {
return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zGlobPattern)), (*uint8)(unsafe.Pointer(_zString)), &_globInfo, uint32(i32(91)))
}
// Compare two UTF-8 strings for equality where the first string is
// a GLOB or LIKE expression. Return values:
//
// SQLITE_MATCH: Match
// SQLITE_NOMATCH: No match
// SQLITE_NOWILDCARDMATCH: No match in spite of having * or % wildcards.
//
// Globbing rules:
//
// '*' Matches any sequence of zero or more characters.
//
// '?' Matches exactly one character.
//
// [...] Matches one character from the enclosed list of
// characters.
//
// [^...] Matches one character not in the enclosed list.
//
// With the [...] and [^...] matching, a ']' character can be included
// in the list by making it the first character after '[' or '^'. A
// range of characters can be specified using '-'. Example:
// "[a-z]" matches any single lower-case letter. To match a '-', make
// it the last character in the list.
//
// Like matching rules:
//
// '%' Matches any sequence of zero or more characters
//
// *** '_' Matches any one character
//
// Ec Where E is the "esc" character and c is any other
// character, including '%', '_', and esc, match exactly c.
//
// The comments within this routine usually assume glob matching.
//
// This routine is usually quick, but can be N**2 in the worst case.
func _patternCompare(tls *crt.TLS, _zPattern *uint8, _zString *uint8, _pInfo *TcompareInfo, _matchOther uint32) (r0 int32) {
var _9_bMatch, _13_bMatch, _17_bMatch, _21_seen, _21_invert int32
var _c, _c2, _matchOne, _matchAll, _13_cx, _21_prior_c uint32
var _noCase uint8
var _zEscaped *uint8
_matchOne = uint32(_pInfo.X1)
_matchAll = uint32(_pInfo.X0)
_noCase = _pInfo.X3
_zEscaped = nil
_0:
if store5(&_c, func() uint32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) {
return uint32(*postInc13(&_zPattern, 1))
}
return _sqlite3Utf8Read(tls, &_zPattern)
}()) == uint32(i32(0)) {
goto _1
}
if _c != _matchAll {
goto _4
}
_5:
if store5(&_c, func() uint32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) < i32(128) {
return uint32(*postInc13(&_zPattern, 1))
}
return _sqlite3Utf8Read(tls, &_zPattern)
}()) != _matchAll && _c != _matchOne {
goto _6
}
if (_c == _matchOne) && (_sqlite3Utf8Read(tls, &_zString) == uint32(i32(0))) {
return i32(2)
}
goto _5
_6:
if _c == uint32(i32(0)) {
return i32(0)
}
if _c != _matchOther {
goto _14
}
if int32(_pInfo.X2) != i32(0) {
goto _15
}
_c = _sqlite3Utf8Read(tls, &_zPattern)
if _c == uint32(i32(0)) {
return i32(2)
}
goto _17
_15:
func() {
if _matchOther >= uint32(i32(128)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106217), unsafe.Pointer((*int8)(unsafe.Pointer(&_patternCompareØ00__func__Ø000))), unsafe.Pointer(str(60316)))
crt.X__builtin_abort(tls)
}
}()
_20:
if (*_zString) == 0 {
goto _21
}
_9_bMatch = _patternCompare(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern))+1*uintptr(i32(-1)))), _zString, _pInfo, _matchOther)
if _9_bMatch != i32(1) {
return _9_bMatch
}
if int32(*postInc13(&_zString, 1)) < i32(192) {
goto _23
}
_24:
if (int32(*_zString) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_zString)) += uintptr(1)
goto _24
}
_23:
goto _20
_21:
return i32(2)
_17:
_14:
if _c > uint32(i32(128)) {
goto _26
}
if _noCase != 0 {
_13_cx = _c & uint32(^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_c))))) & i32(32)))
_c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c)))))
goto _28
}
_13_cx = _c
_28:
if store5(&_c2, uint32(*postInc13(&_zString, 1))) == uint32(i32(0)) {
goto _30
}
if (_c2 != _c) && (_c2 != _13_cx) {
goto _28
}
_13_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
if _13_bMatch != i32(1) {
return _13_bMatch
}
goto _28
_30:
goto _34
_26:
_35:
if store5(&_c2, func() uint32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zString)) + 1*uintptr(i32(0))))) < i32(128) {
return uint32(*postInc13(&_zString, 1))
}
return _sqlite3Utf8Read(tls, &_zString)
}()) == uint32(i32(0)) {
goto _36
}
if _c2 != _c {
goto _35
}
_17_bMatch = _patternCompare(tls, _zPattern, _zString, _pInfo, _matchOther)
if _17_bMatch != i32(1) {
return _17_bMatch
}
goto _35
_36:
_34:
return i32(2)
_4:
if _c != _matchOther {
goto _41
}
if int32(_pInfo.X2) != i32(0) {
goto _42
}
_c = _sqlite3Utf8Read(tls, &_zPattern)
if _c == uint32(i32(0)) {
return i32(1)
}
_zEscaped = _zPattern
goto _44
_42:
_21_prior_c = uint32(i32(0))
_21_seen = i32(0)
_21_invert = i32(0)
_c = _sqlite3Utf8Read(tls, &_zString)
if _c == uint32(i32(0)) {
return i32(1)
}
_c2 = _sqlite3Utf8Read(tls, &_zPattern)
if _c2 == uint32(i32(94)) {
_21_invert = i32(1)
_c2 = _sqlite3Utf8Read(tls, &_zPattern)
}
if _c2 != uint32(i32(93)) {
goto _47
}
if _c == uint32(i32(93)) {
_21_seen = i32(1)
}
_c2 = _sqlite3Utf8Read(tls, &_zPattern)
_47:
if _c2 == 0 || _c2 == uint32(i32(93)) {
goto _50
}
if _c2 != uint32(i32(45)) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(93) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) || _21_prior_c <= uint32(i32(0)) {
goto _55
}
_c2 = _sqlite3Utf8Read(tls, &_zPattern)
if (_c >= _21_prior_c) && (_c <= _c2) {
_21_seen = i32(1)
}
_21_prior_c = uint32(i32(0))
goto _58
_55:
if _c == _c2 {
_21_seen = i32(1)
}
_21_prior_c = _c2
_58:
_c2 = _sqlite3Utf8Read(tls, &_zPattern)
goto _47
_50:
if (_c2 == uint32(i32(0))) || ((_21_seen ^ _21_invert) == i32(0)) {
return i32(1)
}
goto _0
_44:
_41:
_c2 = func() uint32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zString)) + 1*uintptr(i32(0))))) < i32(128) {
return uint32(*postInc13(&_zString, 1))
}
return _sqlite3Utf8Read(tls, &_zString)
}()
if _c == _c2 {
goto _0
}
if (((_noCase != 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c))))) == int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_c2))))))) && (_c < uint32(i32(128)))) && (_c2 < uint32(i32(128))) {
goto _0
}
if ((_c == _matchOne) && (_zPattern != _zEscaped)) && (_c2 != uint32(i32(0))) {
goto _0
}
return i32(1)
_1:
return func() int32 {
if int32(*_zString) == i32(0) {
return i32(0)
}
return i32(1)
}()
}
func _sqlite3Utf8Read(tls *crt.TLS, _pz **uint8) (r0 uint32) {
var _c uint32
_c = uint32(*postInc13(_pz, 1))
if _c < uint32(i32(192)) {
goto _0
}
_c = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3Utf8Trans1)) + 1*uintptr(_c-uint32(i32(192))))))
_1:
if (int32(*(*_pz)) & i32(192)) == i32(128) {
_c = (_c << uint(i32(6))) + uint32(i32(63)&int32(*postInc13(_pz, 1)))
goto _1
}
if ((_c < uint32(i32(128))) || ((_c & u32(4294965248)) == uint32(i32(55296)))) || ((_c & u32(4294967294)) == uint32(i32(65534))) {
_c = uint32(i32(65533))
}
_0:
return _c
}
var _patternCompareØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_patternCompareØ00__func__Ø000[0], str(60332), 15)
}
var _globInfo TcompareInfo
func init() {
_globInfo = TcompareInfo{X0: u8(42), X1: u8(63), X2: u8(91), X3: u8(0)}
}
// 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 _sqlite3DefaultRowEst(tls *crt.TLS, _pIdx *XIndex) {
var _nCopy, _i int32
var _a *int16
var _aVal [5]int16
_aVal = [5]int16{i16(33), i16(32), i16(30), i16(28), i16(26)}
_a = _pIdx.X2
_nCopy = func() int32 {
if i32(5) < int32(_pIdx.X13) {
return i32(5)
}
return int32(_pIdx.X13)
}()
func() {
if ((uint32((_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103155), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60347)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0)))) = (*XTable)(_pIdx.X3).X12
if (*XExpr)(_pIdx.X9) != nil {
{
p := (*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0))))
*p = int16(int32(*p) - i32(10))
sink18 = *p
}
}
func() {
if i32(10) != int32(_sqlite3LogEst(tls, uint64(i32(2)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103161), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60363)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0))))) < i32(33) {
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(i32(0)))) = int16(i32(33))
}
func() {
if i32(33) != int32(_sqlite3LogEst(tls, uint64(i32(10)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103162), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60384)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)((*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a))+2*uintptr(i32(1))))), (unsafe.Pointer)(&_aVal), uint32(_nCopy)*u32(2))
_i = _nCopy + i32(1)
_10:
if _i > int32(_pIdx.X13) {
goto _13
}
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(_i))) = int16(i32(23))
func() {
if i32(23) != int32(_sqlite3LogEst(tls, uint64(i32(5)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103168), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(60406)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _10
_13:
func() {
if i32(0) != int32(_sqlite3LogEst(tls, uint64(i32(1)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103171), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DefaultRowEstØ00__func__Ø000))), unsafe.Pointer(str(46381)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pIdx.X15) != i32(0) {
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 2*uintptr(_pIdx.X13))) = int16(i32(0))
}
_ = _aVal
}
var _sqlite3DefaultRowEstØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DefaultRowEstØ00__func__Ø000[0], str(60427), 21)
}
// 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 _sqlite3FindDbName(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 int32) {
var _i int32
var _1_pDb *XDb
_i = i32(-1)
if _zName == nil {
goto _0
}
*func() **XDb { _i = (_db.X5) - i32(1); return &_1_pDb }() = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
_1:
if _i < i32(0) {
goto _4
}
if i32(0) == Xsqlite3_stricmp(tls, _1_pDb.X0, _zName) {
goto _4
}
if (_i == i32(0)) && (i32(0) == Xsqlite3_stricmp(tls, str(60448), _zName)) {
goto _4
}
*(*uintptr)(unsafe.Pointer(func() **XDb { _i -= 1; return &_1_pDb }())) += uintptr(4294967280)
goto _1
_4:
_0:
return _i
}
// Check to see if zTabName is really the name of a pragma. If it is,
// then register an eponymous virtual table for that pragma and return
// a pointer to the Module object for the new virtual table.
func _sqlite3PragmaVtabRegister(tls *crt.TLS, _db *Xsqlite3, _zName *int8) (r0 *XModule) {
var _pName *XPragmaName
func() {
if Xsqlite3_strnicmp(tls, _zName, str(49814), i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115653), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000))), unsafe.Pointer(str(60453)))
crt.X__builtin_abort(tls)
}
}()
_pName = _pragmaLocate(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_zName))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(7)))))))))
if _pName == nil {
return nil
}
if (int32(_pName.X2) & i32(48)) == i32(0) {
return nil
}
func() {
if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zName) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115657), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaVtabRegisterØ00__func__Ø000))), unsafe.Pointer(str(60494)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3VtabCreateModule(tls, _db, _zName, &_pragmaVtabModule, (unsafe.Pointer)(_pName), nil)
}
var _sqlite3PragmaVtabRegisterØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PragmaVtabRegisterØ00__func__Ø000[0], str(60534), 26)
}
// Locate a pragma in the aPragmaName[] array.
func _pragmaLocate(tls *crt.TLS, _zName *int8) (r0 *XPragmaName) {
var _upr, _lwr, _mid, _rc int32
_mid = i32(0)
_lwr = i32(0)
_upr = i32(66)
_0:
if _lwr > _upr {
goto _1
}
_mid = (_lwr + _upr) / i32(2)
_rc = Xsqlite3_stricmp(tls, _zName, (*XPragmaName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPragmaName))+12*uintptr(_mid))).X0)
if _rc == i32(0) {
goto _1
}
if _rc < i32(0) {
_upr = _mid - i32(1)
goto _4
}
_lwr = _mid + i32(1)
_4:
goto _0
_1:
return func() *XPragmaName {
if _lwr > _upr {
return nil
}
return (*XPragmaName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPragmaName)) + 12*uintptr(_mid)))
}()
}
var _aPragmaName [67]XPragmaName
func init() {
_aPragmaName = [67]XPragmaName{XPragmaName{X0: str(60560), X1: u8(0), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(8)}, XPragmaName{X0: str(60575), X1: u8(1), X2: u8(149), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60587), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(1048576)}, XPragmaName{X0: str(60603), X1: u8(3), X2: u8(16), X3: u8(46), X4: u8(1), X5: u32(0)}, XPragmaName{X0: str(60616), X1: u8(4), X2: u8(149), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60627), X1: u8(5), X2: u8(148), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60639), X1: u8(6), X2: u8(2), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60659), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(536870912)}, XPragmaName{X0: str(60675), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(16)}, XPragmaName{X0: str(60696), X1: u8(7), X2: u8(16), X3: u8(29), X4: u8(2), X5: u32(0)}, XPragmaName{X0: str(60711), X1: u8(8), X2: u8(16), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60727), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(128)}, XPragmaName{X0: str(60741), X1: u8(0), X2: u8(24), X3: u8(0), X4: u8(0), X5: u32(15)}, XPragmaName{X0: str(60754), X1: u8(10), X2: u8(17), X3: u8(26), X4: u8(3), X5: u32(0)}, XPragmaName{X0: str(60768), X1: u8(11), X2: u8(149), X3: u8(0), X4: u8(1), X5: u32(0)}, XPragmaName{X0: str(60787), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(33554432)}, XPragmaName{X0: str(60806), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(256)}, XPragmaName{X0: str(60829), X1: u8(12), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60838), X1: u8(13), X2: u8(1), X3: u8(39), X4: u8(4), X5: u32(0)}, XPragmaName{X0: str(60856), X1: u8(14), X2: u8(97), X3: u8(31), X4: u8(8), X5: u32(0)}, XPragmaName{X0: str(60873), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(524288)}, XPragmaName{X0: str(60886), X1: u8(0), X2: u8(24), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60901), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(4)}, XPragmaName{X0: str(60919), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(8)}, XPragmaName{X0: str(60929), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(8192)}, XPragmaName{X0: str(60954), X1: u8(15), X2: u8(3), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(60973), X1: u8(16), X2: u8(97), X3: u8(12), X4: u8(3), X5: u32(0)}, XPragmaName{X0: str(60984), X1: u8(17), X2: u8(97), X3: u8(21), X4: u8(5), X5: u32(0)}, XPragmaName{X0: str(60995), X1: u8(16), X2: u8(97), X3: u8(15), X4: u8(6), X5: u32(1)}, XPragmaName{X0: str(61007), X1: u8(18), X2: u8(1), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61023), X1: u8(19), X2: u8(145), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61036), X1: u8(20), X2: u8(144), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61055), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(32768)}, XPragmaName{X0: str(61074), X1: u8(41), X2: u8(16), X3: u8(47), X4: u8(2), X5: u32(0)}, XPragmaName{X0: str(61086), X1: u8(22), X2: u8(144), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61099), X1: u8(23), X2: u8(145), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61114), X1: u8(24), X2: u8(0), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61124), X1: u8(25), X2: u8(33), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61133), X1: u8(23), X2: u8(145), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61144), X1: u8(26), X2: u8(148), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61154), X1: u8(42), X2: u8(0), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61167), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(67108864)}, XPragmaName{X0: str(61178), X1: u8(18), X2: u8(1), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61190), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(16384)}, XPragmaName{X0: str(61207), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(262144)}, XPragmaName{X0: str(61226), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(131072)}, XPragmaName{X0: str(61252), X1: u8(0), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(1)}, XPragmaName{X0: str(61267), X1: u8(27), X2: u8(16), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61281), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(64)}, XPragmaName{X0: str(61300), X1: u8(28), X2: u8(2), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61314), X1: u8(29), X2: u8(16), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61330), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(512)}, XPragmaName{X0: str(61340), X1: u8(43), X2: u8(145), X3: u8(7), X4: u8(5), X5: u32(0)}, XPragmaName{X0: str(61346), X1: u8(30), X2: u8(149), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61358), X1: u8(31), X2: u8(97), X3: u8(1), X4: u8(6), X5: u32(0)}, XPragmaName{X0: str(61369), X1: u8(32), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61380), X1: u8(33), X2: u8(4), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61401), X1: u8(34), X2: u8(16), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61409), X1: u8(0), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(6)}, XPragmaName{X0: str(61422), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(4096)}, XPragmaName{X0: str(61438), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(1537)}, XPragmaName{X0: str(61449), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(134217728)}, XPragmaName{X0: str(61458), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(1024)}, XPragmaName{X0: str(61471), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(1)}, XPragmaName{X0: str(61482), X1: u8(35), X2: u8(0), X3: u8(0), X4: u8(0), X5: u32(0)}, XPragmaName{X0: str(61501), X1: u8(36), X2: u8(1), X3: u8(43), X4: u8(3), X5: u32(0)}, XPragmaName{X0: str(61516), X1: u8(2), X2: u8(20), X3: u8(0), X4: u8(0), X5: u32(67584)}}
}
var _pragmaVtabModule Xsqlite3_module
func init() {
_pragmaVtabModule = Xsqlite3_module{X0: i32(0), X1: nil, X2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{_pragmaVtabConnect})), X3: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32
}{_pragmaVtabBestIndex})), X4: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{_pragmaVtabDisconnect})), X5: nil, X6: *(*func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_file) int32
}{_pragmaVtabOpen})), X7: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_pragmaVtabClose})), X8: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, *int8, int32, **XMem) int32
}{_pragmaVtabFilter})), X9: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_pragmaVtabNext})), X10: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_pragmaVtabEof})), X11: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32
}{_pragmaVtabColumn})), X12: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int64) int32
}{_pragmaVtabRowid})), X13: nil, X14: nil, X15: nil, X16: nil, X17: nil, X18: nil, X19: nil, X20: nil, X21: nil, X22: nil}
}
// Pragma virtual table module xConnect method.
func _pragmaVtabConnect(tls *crt.TLS, _db *Xsqlite3, _pAux unsafe.Pointer, _argc int32, _argv **int8, _ppVtab **Xsqlite3_vtab, _pzErr **int8) (r0 int32) {
var _rc, _i, _j int32
var _cSep int8
var _acc XStrAccum
var _zBuf [200]int8
var _pPragma *XPragmaName
var _pTab *XPragmaVtab
_pPragma = (*XPragmaName)(_pAux)
_pTab = nil
_cSep = i8(40)
_sqlite3StrAccumInit(tls, &_acc, nil, (*int8)(unsafe.Pointer(&_zBuf)), int32(u32(200)), i32(0))
_sqlite3StrAccumAppendAll(tls, &_acc, str(61532))
*func() *int32 { _i = i32(0); return &_j }() = int32(_pPragma.X3)
_0:
if _i >= int32(_pPragma.X4) {
goto _3
}
_sqlite3XPrintf(tls, &_acc, str(61547), int32(_cSep), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pragCName)) + 4*uintptr(_j)))))
_cSep = int8(i32(44))
*func() *int32 { _i += 1; return &_j }() += 1
goto _0
_3:
if _i == i32(0) {
_sqlite3XPrintf(tls, &_acc, str(61554), unsafe.Pointer(_pPragma.X0))
_cSep = int8(i32(44))
_i += 1
}
_j = i32(0)
if (int32(_pPragma.X2) & i32(32)) != 0 {
_sqlite3StrAccumAppendAll(tls, &_acc, str(61560))
_j += 1
}
if (int32(_pPragma.X2) & i32(192)) != 0 {
_sqlite3StrAccumAppendAll(tls, &_acc, str(61572))
_j += 1
}
_sqlite3StrAccumAppend(tls, &_acc, str(37898), i32(1))
_sqlite3StrAccumFinish(tls, &_acc)
func() {
if crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zBuf))) >= u32(199) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115419), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabConnectØ00__func__Ø000))), unsafe.Pointer(str(61587)))
crt.X__builtin_abort(tls)
}
}()
_rc = Xsqlite3_declare_vtab(tls, _db, (*int8)(unsafe.Pointer(&_zBuf)))
if _rc != i32(0) {
goto _9
}
_pTab = (*XPragmaVtab)(Xsqlite3_malloc(tls, int32(u32(24))))
if _pTab == nil {
_rc = i32(7)
goto _11
}
crt.Xmemset(tls, (unsafe.Pointer)(_pTab), i32(0), u32(24))
*(**XPragmaName)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _pPragma
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1))))) = _db
*(*uint8)(unsafe.Pointer(&(_pTab.X4))) = uint8(_i)
*(*uint8)(unsafe.Pointer(&(_pTab.X3))) = uint8(_j)
_11:
goto _12
_9:
*_pzErr = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_errmsg(tls, _db)))
_12:
*_ppVtab = (*Xsqlite3_vtab)(unsafe.Pointer(_pTab))
return _rc
_ = _acc
_ = _zBuf
panic(0)
}
// Append the complete text of zero-terminated string z[] to the p string.
func _sqlite3StrAccumAppendAll(tls *crt.TLS, _p *XStrAccum, _z *int8) {
_sqlite3StrAccumAppend(tls, _p, _z, _sqlite3Strlen30(tls, _z))
}
var _pragCName [49]*int8
func init() {
_pragCName = [49]*int8{str(60616), str(61617), str(61621), str(61626), str(61631), str(61639), str(61650), str(61653), str(61657), str(61661), str(61666), str(61671), str(61676), str(61617), str(61621), str(61676), str(61617), str(61621), str(61682), str(61687), str(61692), str(61696), str(61621), str(61700), str(61707), str(61714), str(61696), str(61621), str(61722), str(61696), str(61621), str(61727), str(61696), str(61730), str(26370), str(61736), str(61739), str(61749), str(61759), str(61730), str(27227), str(61765), str(61772), str(61777), str(61782), str(61786), str(61799), str(61807), str(61816)}
}
var _pragmaVtabConnectØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_pragmaVtabConnectØ00__func__Ø000[0], str(61823), 18)
}
// Figure out the best index to use to search a pragma virtual table.
//
// There are not really any index choices. But we want to encourage the
// query planner to give == constraints on as many hidden parameters as
// possible, and especially on the first hidden parameter. So return a
// high cost if hidden parameters are unconstrained.
func _pragmaVtabBestIndex(tls *crt.TLS, _tab *Xsqlite3_vtab, _pIdxInfo *Xsqlite3_index_info) (r0 int32) {
var _i, _j int32
var _seen [2]int32
var _pTab *XPragmaVtab
var _pConstraint *Tsqlite3_index_constraint
_pTab = (*XPragmaVtab)(unsafe.Pointer(_tab))
*(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(1)
if int32(_pTab.X3) == i32(0) {
return i32(0)
}
_pConstraint = (*Tsqlite3_index_constraint)(_pIdxInfo.X1)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0)))) = i32(0)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1)))) = i32(0)
_i = i32(0)
_1:
if _i >= (_pIdxInfo.X0) {
goto _4
}
if int32(_pConstraint.X2) == i32(0) {
goto _2
}
if int32(_pConstraint.X1) != i32(2) {
goto _2
}
if (_pConstraint.X0) < int32(_pTab.X4) {
goto _2
}
_j = (_pConstraint.X0) - int32(_pTab.X4)
func() {
if _j >= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115472), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabBestIndexØ00__func__Ø000))), unsafe.Pointer(str(61841)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(_j))) = _i + i32(1)
_2:
*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pConstraint }())) += uintptr(12)
goto _1
_4:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0))))) == i32(0) {
*(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = 2.147483647e+09
*(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(2147483647))
return i32(0)
}
_j = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(0))))) - i32(1)
*(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X0))) = i32(1)
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X1))) = uint8(i32(1))
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1))))) == i32(0) {
return i32(0)
}
*(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(20)
*(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(20))
_j = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_seen)) + 4*uintptr(i32(1))))) - i32(1)
*(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X0))) = i32(2)
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr(_pIdxInfo.X4) + 8*uintptr(_j))).X1))) = uint8(i32(1))
return i32(0)
_ = _seen
panic(0)
}
var _pragmaVtabBestIndexØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_pragmaVtabBestIndexØ00__func__Ø000[0], str(61847), 20)
}
// Pragma virtual table module xDisconnect method.
func _pragmaVtabDisconnect(tls *crt.TLS, _pVtab *Xsqlite3_vtab) (r0 int32) {
var _pTab *XPragmaVtab
_pTab = (*XPragmaVtab)(unsafe.Pointer(_pVtab))
Xsqlite3_free(tls, (unsafe.Pointer)(_pTab))
return i32(0)
}
// Create a new cursor for the pragma virtual table
func _pragmaVtabOpen(tls *crt.TLS, _pVtab *Xsqlite3_vtab, _ppCursor **Xsqlite3_file) (r0 int32) {
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(Xsqlite3_malloc(tls, int32(u32(24))))
if _pCsr == nil {
return i32(7)
}
crt.Xmemset(tls, (unsafe.Pointer)(_pCsr), i32(0), u32(24))
*(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_file)(unsafe.Pointer(&(_pCsr.X0))).X0))))) = _pVtab
*_ppCursor = (*Xsqlite3_file)(unsafe.Pointer(&(_pCsr.X0)))
return i32(0)
}
// Close a pragma virtual table cursor
func _pragmaVtabClose(tls *crt.TLS, _cur *Xsqlite3_file) (r0 int32) {
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_cur))
_pragmaVtabCursorClear(tls, _pCsr)
Xsqlite3_free(tls, (unsafe.Pointer)(_pCsr))
return i32(0)
}
// Clear all content from pragma virtual table cursor.
func _pragmaVtabCursorClear(tls *crt.TLS, _pCsr *XPragmaVtabCursor) {
var _i int32
Xsqlite3_finalize(tls, _pCsr.X1)
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))) = nil
_i = i32(0)
_0:
if _i >= i32(2) {
goto _3
}
Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(_i)))))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(_i))) = nil
_i += 1
goto _0
_3:
}
// Pragma virtual table module xFilter method.
func _pragmaVtabFilter(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _idxNum int32, _idxStr *int8, _argc int32, _argv **XMem) (r0 int32) {
var _rc, _i, _j int32
var _zSql *int8
var _acc XStrAccum
var _pTab *XPragmaVtab
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.X0)))
_pragmaVtabCursorClear(tls, _pCsr)
_j = func() int32 {
if (int32((*XPragmaName)(_pTab.X2).X2) & i32(32)) != i32(0) {
return i32(0)
}
return i32(1)
}()
_i = i32(0)
_2:
if _i >= _argc {
goto _5
}
func() {
if _j >= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115558), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabFilterØ00__func__Ø000))), unsafe.Pointer(str(61867)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(_j))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i))))))
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(_j)))) == nil {
return i32(7)
}
*func() *int32 { _i += 1; return &_j }() += 1
goto _2
_5:
_sqlite3StrAccumInit(tls, &_acc, nil, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pTab.X1).X31))))) + 4*uintptr(i32(1)))))
_sqlite3StrAccumAppendAll(tls, &_acc, str(61892))
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(i32(1))))) != nil {
_sqlite3XPrintf(tls, &_acc, str(61900), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(i32(1))))))
}
_sqlite3StrAccumAppendAll(tls, &_acc, (*XPragmaName)(_pTab.X2).X0)
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(i32(0))))) != nil {
_sqlite3XPrintf(tls, &_acc, str(61904), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(i32(0))))))
}
_zSql = _sqlite3StrAccumFinish(tls, &_acc)
if _zSql == nil {
return i32(7)
}
_rc = Xsqlite3_prepare_v2(tls, (*Xsqlite3)(_pTab.X1), _zSql, i32(-1), (*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))), nil)
Xsqlite3_free(tls, (unsafe.Pointer)(_zSql))
if _rc != i32(0) {
*(**int8)(unsafe.Pointer(&((*Xsqlite3_vtab)(unsafe.Pointer(&(_pTab.X0))).X2))) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_pTab.X1))))
return _rc
}
return _pragmaVtabNext(tls, _pVtabCursor)
_ = _acc
panic(0)
}
var _pragmaVtabFilterØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_pragmaVtabFilterØ00__func__Ø000[0], str(61908), 17)
}
func Xsqlite3_prepare_v2(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail **int8) (r0 int32) {
var _rc int32
_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, _nBytes, i32(1), nil, _ppStmt, _pzTail)
func() {
if _rc != i32(0) && _ppStmt != nil && *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116426), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_prepare_v2Ø00__func__Ø000))), unsafe.Pointer(str(50464)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3_prepare_v2Ø00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_prepare_v2Ø00__func__Ø000[0], str(61925), 19)
}
// Advance the pragma virtual table cursor to the next row
func _pragmaVtabNext(tls *crt.TLS, _pVtabCursor *Xsqlite3_file) (r0 int32) {
var _rc int32
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
_rc = i32(0)
*(*int64)(unsafe.Pointer(&(_pCsr.X2))) += 1
func() {
if (_pCsr.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115529), unsafe.Pointer((*int8)(unsafe.Pointer(&_pragmaVtabNextØ00__func__Ø000))), unsafe.Pointer(str(61944)))
crt.X__builtin_abort(tls)
}
}()
if i32(100) != Xsqlite3_step(tls, _pCsr.X1) {
_rc = Xsqlite3_finalize(tls, _pCsr.X1)
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X1))) = nil
_pragmaVtabCursorClear(tls, _pCsr)
}
return _rc
}
var _pragmaVtabNextØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pragmaVtabNextØ00__func__Ø000[0], str(61958), 15)
}
// This is the top-level implementation of sqlite3_step(). Call
// sqlite3Step() to do most of the work. If a schema error occurs,
// call sqlite3Reprepare() and try again.
func Xsqlite3_step(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _rc, _rc2, _cnt, _2_savedPc int32
var _3_zErr *int8
var _db *Xsqlite3
var _v *TVdbe
_rc = i32(0)
_rc2 = i32(0)
_v = (*TVdbe)(_pStmt)
_cnt = i32(0)
if _vdbeSafetyNotNull(tls, _v) != 0 {
return _sqlite3MisuseError(tls, i32(76755))
}
_db = (*Xsqlite3)(_v.X0)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(0)), 2, 1)
_1:
if store1(&_rc, _sqlite3Step(tls, _v)) != i32(17) || postInc1(&_cnt, int32(1)) >= i32(50) {
goto _2
}
_2_savedPc = _v.X9
_rc2 = store1(&_rc, _sqlite3Reprepare(tls, _v))
if _rc != i32(0) {
goto _2
}
Xsqlite3_reset(tls, _pStmt)
if _2_savedPc >= i32(0) {
storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(1)), 2, 1)
}
func() {
if int32((uint32(_v.X32)<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76767), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_stepØ00__func__Ø000))), unsafe.Pointer(str(61973)))
crt.X__builtin_abort(tls)
}
}()
goto _1
_2:
if _rc2 == i32(0) {
goto _8
}
_3_zErr = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, (*XMem)(_db.X56))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_v.X22))
if (_db.X17) == 0 {
*(**int8)(unsafe.Pointer(&(_v.X22))) = _sqlite3DbStrDup(tls, _db, _3_zErr)
*(*int32)(unsafe.Pointer(&(_v.X10))) = _rc2
goto _10
}
*(**int8)(unsafe.Pointer(&(_v.X22))) = nil
*(*int32)(unsafe.Pointer(&(_v.X10))) = store1(&_rc, _sqlite3NomemError(tls, i32(76785)))
_10:
_8:
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
_ = _cnt
panic(0)
}
// Execute the statement pStmt, either until a row of data is ready, the
// statement is completely executed or an error occurs.
//
// This routine implements the bulk of the logic behind the sqlite_step()
// API. The only thing omitted is the automatic recompile if a
// schema change has occurred. That detail is handled by the
// outer sqlite3_step() wrapper procedure.
func _sqlite3Step(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _rc int32
var _db *Xsqlite3
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76621), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(9660)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X5) != uint32(i32(770837923)) {
Xsqlite3_reset(tls, (unsafe.Pointer)(_p))
}
_db = (*Xsqlite3)(_p.X0)
if (_db.X17) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(7)
return _sqlite3NomemError(tls, i32(76654))
}
if ((_p.X9) <= i32(0)) && (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(17)
_rc = i32(1)
goto _end_of_step
}
if (_p.X9) >= i32(0) {
goto _6
}
if (_db.X34) == i32(0) {
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0)
}
func() {
if (_db.X36) <= i32(0) && int32(_db.X15) != i32(0) && ((_db.X77) != int64(i32(0)) || (_db.X78) != int64(i32(0))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76671), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(61987)))
crt.X__builtin_abort(tls)
}
}()
if ((((_db.X43) != nil) || ((int32(_db.X24) & i32(2)) != i32(0))) && (((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0)) && ((_p.X36) != nil) {
_sqlite3OsCurrentTimeInt64(tls, (*Xsqlite3_vfs)(_db.X0), (*int64)(unsafe.Pointer(&(_p.X26))))
goto _17
}
func() {
if (_p.X26) != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62078)))
crt.X__builtin_abort(tls)
}
}()
_17:
*(*int32)(unsafe.Pointer(&(_db.X34))) += 1
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) == i32(0) {
*(*int32)(unsafe.Pointer(&(_db.X36))) += 1
}
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(*int32)(unsafe.Pointer(&(_db.X35))) += 1
}
*(*int32)(unsafe.Pointer(&(_p.X9))) = i32(0)
_6:
*(*int32)(unsafe.Pointer(&(_p.X28))) = i32(0)
if ((uint32((_p.X32)>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) != 0 {
_rc = _sqlite3VdbeList(tls, _p)
goto _23
}
*(*int32)(unsafe.Pointer(&(_db.X37))) += 1
_rc = _sqlite3VdbeExec(tls, _p)
*(*int32)(unsafe.Pointer(&(_db.X37))) -= 1
_23:
if _rc == i32(100) {
goto _25
}
if (_p.X26) > int64(i32(0)) {
_invokeProfileCallback(tls, _db, _p)
}
_25:
if _rc != i32(101) {
goto _26
}
func() {
if (_p.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76709), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62094)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_p.X10))) = _doWalCallbacks(tls, _db)
if (_p.X10) != i32(0) {
_rc = i32(1)
}
_26:
*(*int32)(unsafe.Pointer(&(_db.X10))) = _rc
if i32(7) == _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _p.X10) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = _sqlite3NomemError(tls, i32(76718))
}
_end_of_step:
func() {
if _rc != i32(100) && _rc != i32(101) && _rc != i32(1) && (_rc&i32(255)) != i32(5) && _rc != i32(21) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76728), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62111)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X10) == i32(100) || (_p.X10) == i32(101)) && (_p.X10) != (_p.X28) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76731), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StepØ00__func__Ø000))), unsafe.Pointer(str(62212)))
crt.X__builtin_abort(tls)
}
}()
if ((((uint32((_p.X32)>>uint(i32(9))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_rc != i32(100))) && (_rc != i32(101)) {
_rc = _sqlite3VdbeTransferError(tls, _p)
}
return _rc & (_db.X11)
}
var _sqlite3StepØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StepØ00__func__Ø000[0], str(62273), 12)
}
// Terminate the current execution of an SQL statement and reset it
// back to its starting state so that it can be reused. A success code from
// the prior execution is returned.
//
// This routine sets the error code and string returned by
// sqlite3_errcode(), sqlite3_errmsg() and sqlite3_errmsg16().
func Xsqlite3_reset(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _rc int32
var _2_db *Xsqlite3
var _2_v *TVdbe
if _pStmt == nil {
_rc = i32(0)
goto _1
}
_2_v = (*TVdbe)(_pStmt)
_2_db = (*Xsqlite3)(_2_v.X0)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_2_db.X3))
if (_2_v.X26) > int64(i32(0)) {
_invokeProfileCallback(tls, _2_db, _2_v)
}
_rc = _sqlite3VdbeReset(tls, _2_v)
_sqlite3VdbeRewind(tls, _2_v)
func() {
if (_rc & (_2_db.X11)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_resetØ00__func__Ø000))), unsafe.Pointer(str(62285)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3ApiExit(tls, _2_db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_2_db.X3))
_1:
return _rc
}
// Rewind the VDBE back to the beginning in preparation for
// running it.
func _sqlite3VdbeRewind(tls *crt.TLS, _p *TVdbe) {
var _i int32
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73299), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X5) != uint32(i32(381479589)) && (_p.X5) != uint32(i32(1224384374)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73300), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(62310)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X27) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73304), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(41716)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X5))) = uint32(i32(770837923))
_i = i32(0)
_7:
if _i >= (_p.X6) {
goto _10
}
func() {
if (*Xsqlite3)((*XMem)(unsafe.Pointer(uintptr(_p.X18)+48*uintptr(_i))).X9) != (*Xsqlite3)(_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73311), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRewindØ00__func__Ø000))), unsafe.Pointer(str(62366)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _7
_10:
*(*int32)(unsafe.Pointer(&(_p.X9))) = i32(-1)
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2))
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
*(*uint32)(unsafe.Pointer(&(_p.X8))) = uint32(i32(1))
*(*uint8)(unsafe.Pointer(&(_p.X31))) = uint8(i32(255))
*(*int32)(unsafe.Pointer(&(_p.X12))) = i32(0)
*(*int64)(unsafe.Pointer(&(_p.X14))) = int64(i32(0))
}
var _sqlite3VdbeRewindØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeRewindØ00__func__Ø000[0], str(62387), 18)
}
var _sqlite3_resetØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_resetØ00__func__Ø000[0], str(62405), 14)
}
// Give a listing of the program in the virtual machine.
//
// The interface is the same as sqlite3VdbeExec(). But instead of
// running the code, it invokes the callback once for each instruction.
// This feature is used to implement "EXPLAIN".
//
// When p->explain==1, each instruction is listed. When
// p->explain==2, only OP_Explain instructions are listed and these
// are shown in a different format. p->explain==2 is used to implement
// EXPLAIN QUERY PLAN.
//
// When p->explain==1, first the main program is listed, then each of
// the trigger subprograms are listed one by one.
func _sqlite3VdbeList(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _nRow, _nSub, _i, _rc, _10_j, _13_nByte, _13_j int32
var _8_zP4 *int8
var _db *Xsqlite3
var _pSub, _pMem *XMem
var _8_pOp *XVdbeOp
var _apSub **XSubProgram
_nSub = i32(0)
_apSub = nil
_pSub = nil
_db = (*Xsqlite3)(_p.X0)
_rc = i32(0)
_pMem = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 48*uintptr(i32(1))))
func() {
if ((uint32((_p.X32)>>uint(i32(2))) << uint(i32(30))) >> uint(i32(30))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73035), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62419)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X5) != uint32(i32(770837923)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73036), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62430)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X10) != i32(0) && (_p.X10) != i32(5) && (_p.X10) != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73037), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62455)))
crt.X__builtin_abort(tls)
}
}()
_releaseMemArray(tls, _pMem, i32(8))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil
if (_p.X10) == _sqlite3NomemError(tls, i32(73046)) {
_sqlite3OomFault(tls, _db)
return i32(1)
}
_nRow = _p.X27
if int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) != i32(1) {
goto _9
}
func() {
if (_p.X6) <= i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73066), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62517)))
crt.X__builtin_abort(tls)
}
}()
_pSub = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 48*uintptr(i32(9))))
if (int32(_pSub.X1) & i32(16)) != 0 {
_nSub = int32(uint32(_pSub.X4) / u32(4))
_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.X5))
}
_i = i32(0)
_13:
if _i >= _nSub {
goto _16
}
{
p := &_nRow
*p = (*p) + ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(_i)))).X1)
sink1 = *p
}
_i += 1
goto _13
_16:
_9:
_i = postInc1((*int32)(unsafe.Pointer(&(_p.X9))), int32(1))
if ((_i < _nRow) && (int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) == i32(2))) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_i))).X0) != i32(165)) {
goto _9
}
if _i >= _nRow {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0)
_rc = i32(101)
goto _23
}
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(9)
_rc = i32(1)
_sqlite3VdbeError(tls, _p, _sqlite3ErrStr(tls, _p.X10))
goto _23
}
if _i < (_p.X27) {
_8_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_i)))
goto _25
}
{
p := &_i
*p = (*p) - (_p.X27)
sink1 = *p
}
_10_j = i32(0)
_26:
if _i < ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(_10_j)))).X1) {
goto _29
}
{
p := &_i
*p = (*p) - ((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(_10_j)))).X1)
sink1 = *p
}
_10_j += 1
goto _26
_29:
_8_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(_10_j)))).X0) + 24*uintptr(_i)))
_25:
if int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) != i32(1) {
goto _30
}
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_i)
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(2562))
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = _sqlite3OpcodeName(tls, int32(_8_pOp.X0))
func() {
if (_pMem.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73113), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62527)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5)
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
if int32(_8_pOp.X1) != i32(-13) {
goto _33
}
_13_nByte = int32(uint32(_nSub+i32(1)) * u32(4))
_13_j = i32(0)
_34:
if _13_j >= _nSub {
goto _37
}
if (*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(_13_j)))) == (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_8_pOp.X6)))))) {
goto _37
}
_13_j += 1
goto _34
_37:
if (_13_j == _nSub) && (i32(0) == _sqlite3VdbeMemGrow(tls, _pSub, _13_nByte, bool2int(_nSub != i32(0)))) {
_apSub = (**XSubProgram)(unsafe.Pointer(_pSub.X5))
*(**XSubProgram)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apSub)) + 4*uintptr(postInc1(&_nSub, int32(1))))) = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_8_pOp.X6))))))
{
p := (*uint16)(unsafe.Pointer(&(_pSub.X1)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
*(*int32)(unsafe.Pointer(&(_pSub.X4))) = int32(uint32(_nSub) * u32(4))
}
_33:
_30:
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X3)
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X4)
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(_8_pOp.X5)
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(100)) != 0 {
func() {
if ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73151), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62538)))
crt.X__builtin_abort(tls)
}
}()
return i32(1)
}
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514))
_8_zP4 = _displayP4(tls, _8_pOp, _pMem.X5, _pMem.X7)
if _8_zP4 != (_pMem.X5) {
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(0)
_sqlite3VdbeMemSetStr(tls, _pMem, _8_zP4, i32(-1), uint8(i32(1)), nil)
goto _45
}
func() {
if (_pMem.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62527)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = _sqlite3Strlen30(tls, _pMem.X5)
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
_45:
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
if int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) != i32(1) {
goto _48
}
if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(4)) != 0 {
func() {
if ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73168), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62538)))
crt.X__builtin_abort(tls)
}
}()
return i32(1)
}
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514))
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = i32(2)
Xsqlite3_snprintf(tls, i32(3), _pMem.X5, str(62558), int32(_8_pOp.X2))
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
if _sqlite3VdbeMemClearAndResize(tls, _pMem, i32(500)) != 0 {
func() {
if ((*Xsqlite3)(_p.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73179), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeListØ00__func__Ø000))), unsafe.Pointer(str(62538)))
crt.X__builtin_abort(tls)
}
}()
return i32(1)
}
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(514))
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = _displayComment(tls, _8_pOp, _8_zP4, _pMem.X5, i32(500))
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = uint8(i32(1))
_48:
*(*uint16)(unsafe.Pointer(&(_p.X29))) = uint16(i32(8) - (i32(4) * (int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) - i32(1))))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 48*uintptr(i32(1))))
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0)
_rc = i32(100)
_23:
return _rc
}
var _sqlite3VdbeListØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeListØ00__func__Ø000[0], str(62563), 16)
}
// Execute as much of a VDBE program as we can.
// This is the core of sqlite3_step().
func _sqlite3VdbeExec(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _nExtraDelete, _rc, _iCompare, _3_i, _3_once, _25_pcDest, _27_pcx, _45_cnt, _51_n, _51_p1, _51_p2, _55_n, _60_i, _87_n, _88_i, _113_res, _113_res2, _140_n, _140_i, _140_p1, _140_p2, _140_idx, _140_bRev, _143_k, _143_mx, _151_v1, _151_v2, _169_c, _179_p2, _179_len, _179_i, _215_nHdr, _215_nVarint, _215_nField, _215_file_format, _215_i, _215_j, _229_p1, _229_nName, _229_iSavepoint, _229_ii, _240_isTransaction, _244_isSchemaChange, _256_desiredAutoCommit, _256_iRollback, _266_iMeta, _266_iGen, _277_iMeta, _277_iDb, _277_iCookie, _282_nField, _282_p2, _282_iDb, _282_wrFlag, _295_pgno, _303_res, _303_oc, _303_nField, _303_eqOnly, _313_i, _324_alreadyExists, _324_takeJump, _324_ii, _324_res, _334_res, _340_res, _340_cnt, _356_seekResult, _356_op, _366_opflags, _377_res, _377_nKeyCol, _390_res, _394_res, _397_res, _400_res, _406_res, _414_res, _417_i, _420_iMoved, _420_iDb, _424_nChange, _430_pgno, _430_flags, _434_iDb, _445_nRoot, _445_nErr, _454_iSet, _454_exists, _458_nMem, _458_nByte, _485_n, _486_i, _496_i, _499_eNew, _499_eOld, _515_p1, _526_nArg, _526_iQuery, _526_res, _526_i, _532_res, _536_nArg, _536_i, _548_i int32
var _66_nByte, _73_iA, _73_iB, _94_iA, _94_iB, _215_nByte, _215_nZero, _228_nEntry, _303_iKey, _340_v, _367_iKey, _382_v, _394_sz, _408_rowid, _451_val, _479_x, _536_rowid int64
var _73_bIntint, _113_affinity int8
var _nVmStep, _nProgressLimit, _2_iPrior, _164_iAddr, _179_offset, _179_avail, _179_t, _215_serial_type, _215_len, _379_n, _546_newMax uint32
var _94_uA, _179_offset64, _215_nData, _334_iKey uint64
var _140_aPermute, _445_aRoot *int32
var _213_zAffinity, _215_zAffinity, _229_zName, _356_zDb, _366_zDb, _434_zMaster, _434_zSql, _445_z, _499_zFilename, _517_z, _519_zTab, _548_zTrace, _550_z, _551_z *int8
var _458_t unsafe.Pointer
var _73_rA, _73_rB float64
var _45_nullFlag, _73_flags, _73_type1, _73_type2, _113_flags1, _113_flags3 uint16
var _resetSchemaOnFault, _encoding, _11_opProperty, _94_op, _514_isWriteLock, _538_vtabOnConflict, _557_opProperty uint8
var _179_zData, _179_zHdr, _179_zEndHdr, _215_zNewRecord *uint8
var _179_aOffset *uint32
var _496_aRes [3]int32
var _db *Xsqlite3
var _266_pBt, _282_pX, _499_pBt, _509_pBt, _546_pBt *XBtree
var _278_pDb, _282_pDb, _430_pDb *XDb
var _499_pPager *XPager
var _356_pTab, _366_pTab *XTable
var _528_sContext Xsqlite3_context
var _87_pCtx, _88_pCtx, _485_pCtx, _486_pCtx *Xsqlite3_context
var _179_sMem, _486_t, _519_sMem XMem
var _aMem, _pIn1, _pIn2, _pIn3, _pOut, _49_pVar, _60_pMem, _179_pDest, _179_pReg, _215_pRec, _215_pData0, _215_pLast, _340_pMem, _356_pData, _356_pKey, _445_pnErr, _458_pRt, _458_pMem, _458_pEnd, _465_pIn, _486_pMem, _493_pMem, _496_pMem, _526_pQuery, _526_pArgc, _528_pDest, _535_pName, _536_pX *XMem
var _526_apArg, _536_apArg **XMem
var _522_pVCur, _526_pVCur *Xsqlite3_file
var _179_pCrsr, _228_pCrsr, _334_pCrsr, _379_pCrsr, _390_pCrsr, _394_pCrsr, _397_pCrsr, _406_pCrsr *XBtCursor
var _324_pFree, _324_pIdxKey *XUnpackedRecord
var _303_r, _324_r, _406_r, _414_r XUnpackedRecord
var _140_pKeyInfo, _282_pKeyInfo, _292_pKeyInfo *XKeyInfo
var _356_x, _403_x XBtreePayload
var _27_pFrame, _340_pFrame, _458_pFrame, _465_pFrame, _473_pFrame *XVdbeFrame
var _aOp, _pOp, _pOrigOp, _24_pCaller *XVdbeOp
var _458_pProgram *XSubProgram
var _518_pVTab *XVTable
var _140_pColl *XCollSeq
var _382_pVtab, _522_pVtab, _526_pVtab, _528_pVtab, _532_pVtab, _535_pVtab, _536_pVtab *Xsqlite3_vtab
var _179_pC, _282_pCur, _291_pOrig, _291_pCx, _292_pCx, _298_pCx, _299_pC, _301_pCx, _303_pC, _324_pC, _334_pC, _340_pC, _356_pC, _366_pC, _377_pC, _378_pC, _379_pC, _382_pC, _388_pC, _390_pC, _394_pC, _397_pC, _400_pC, _403_pC, _406_pC, _408_pC, _408_pTabCur, _414_pC, _427_pC, _522_pCur, _526_pCur, _528_pCur, _532_pCur *XVdbeCursor
var _382_pModule, _522_pModule, _526_pModule, _528_pModule, _532_pModule, _536_pModule *Xsqlite3_module
var _229_pNew, _229_pSavepoint, _229_pTmp *XSavepoint
var _434_initData XInitData
var _550_x func(*crt.TLS, unsafe.Pointer, *int8)
_aOp = (*XVdbeOp)(_p.X17)
_pOp = _aOp
_nExtraDelete = i32(0)
_rc = i32(0)
_db = (*Xsqlite3)(_p.X0)
_resetSchemaOnFault = u8(0)
_encoding = _db.X14
_iCompare = i32(0)
_nVmStep = u32(0)
_nProgressLimit = u32(0)
_aMem = (*XMem)(_p.X18)
_pIn1 = nil
_pIn2 = nil
_pIn3 = nil
_pOut = nil
func() {
if (_p.X5) != uint32(i32(770837923)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78878), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62430)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeEnter(tls, _p)
if (_p.X10) == i32(7) {
goto _no_mem
}
func() {
if (_p.X10) != i32(0) && ((_p.X10)&i32(255)) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78885), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62579)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_p.X32)>>uint(i32(8)))<>uint(i32(31))) == 0 && int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62625)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_p.X13))) = int64(i32(0))
func() {
if int32((uint32((_p.X32)>>uint(i32(2)))<>uint(i32(30))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78888), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62656)))
crt.X__builtin_abort(tls)
}
}()
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))) = nil
*(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0)
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 {
goto _abort_due_to_interrupt
}
if (_db.X61) != nil {
_2_iPrior = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(4))))
func() {
if uint32(i32(0)) >= (_db.X63) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62670)))
crt.X__builtin_abort(tls)
}
}()
_nProgressLimit = (_db.X63) - (_2_iPrior % (_db.X63))
}
_sqlite3BeginBenignMalloc(tls)
if (_p.X9) != i32(0) || (((*Xsqlite3)(_p.X0).X6)&i32(134218753)) == i32(0) {
goto _16
}
_3_once = i32(1)
_sqlite3VdbePrintSql(tls, _p)
if (((*Xsqlite3)(_p.X0).X6) & i32(1024)) == 0 {
goto _17
}
crt.Xprintf(tls, str(62691))
_3_i = i32(0)
_18:
if _3_i >= (_p.X27) {
goto _21
}
_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), _3_i, (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+24*uintptr(_3_i))))
_3_i += 1
goto _18
_21:
_17:
if (((*Xsqlite3)(_p.X0).X6) & i32(134217728)) == 0 {
goto _22
}
_3_i = i32(0)
_23:
if _3_i >= (_p.X27) {
goto _26
}
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+24*uintptr(_3_i))).X0) != i32(165) {
goto _27
}
if _3_once != 0 {
crt.Xprintf(tls, str(62714))
}
crt.Xprintf(tls, str(62732), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_3_i))).X6)))))))
_3_once = i32(0)
_27:
_3_i += 1
goto _23
_26:
_22:
if (((*Xsqlite3)(_p.X0).X6) & i32(1)) != 0 {
crt.Xprintf(tls, str(62736))
}
_16:
_sqlite3EndBenignMalloc(tls)
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_p.X9)))
_30:
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_pOp)) < uintptr(unsafe.Pointer(_aOp)) || uintptr(unsafe.Pointer(_pOp)) >= uintptr(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+24*uintptr(_p.X27))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78932), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62749)))
crt.X__builtin_abort(tls)
}
}()
_nVmStep += 1
if ((_db.X6) & i32(1)) != 0 {
_sqlite3VdbePrintOp(tls, (*crt.XFILE)(Xstdout), int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24), _pOp)
}
_11_opProperty = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0)))
if (int32(_11_opProperty) & i32(2)) == i32(0) {
goto _40
}
func() {
if (_pOp.X3) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78967), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62778)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62788)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X3))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62822)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X3)))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78970), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62849)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X3, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X3))))
}
_40:
if (int32(_11_opProperty) & i32(4)) == i32(0) {
goto _50
}
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78974), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62905)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62939)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4)))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78977), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62966)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X4, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))))
}
_50:
if (int32(_11_opProperty) & i32(8)) == i32(0) {
goto _60
}
func() {
if (_pOp.X5) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78982), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78983), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63056)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeCheckMemInvariants(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5)))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78984), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63083)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))))
}
_60:
if (int32(_11_opProperty) & i32(16)) != i32(0) {
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78988), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78989), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62905)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))))
}
if (int32(_11_opProperty) & i32(32)) != i32(0) {
func() {
if (_pOp.X5) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78993), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))))
}
_pOrigOp = _pOp
switch int32(_pOp.X0) {
case i32(0):
goto _144
case i32(1):
goto _145
case i32(2):
goto _146
case i32(3):
goto _184
case i32(4):
goto _185
case i32(5):
goto _185
case i32(6):
goto _1549
case i32(7):
goto _1549
case i32(8):
goto _225
case i32(9):
goto _226
case i32(10):
goto _227
case i32(11):
goto _235
case i32(12):
goto _239
case i32(13):
goto _81
case i32(14):
goto _82
case i32(15):
goto _84
case i32(16):
goto _86
case i32(17):
goto _117
case i32(18):
goto _129
case i32(19):
goto _132
case i32(20):
goto _134
case i32(21):
goto _135
case i32(22):
goto _135
case i32(23):
goto _139
case i32(24):
goto _159
case i32(25):
goto _159
case i32(26):
goto _159
case i32(27):
goto _159
case i32(28):
goto _163
case i32(29):
goto _163
case i32(30):
goto _163
case i32(31):
goto _166
case i32(32):
goto _1258
case i32(33):
goto _179
case i32(34):
goto _180
case i32(35):
goto _181
case i32(36):
goto _181
case i32(37):
goto _183
case i32(38):
goto _194
case i32(39):
goto _194
case i32(40):
goto _194
case i32(41):
goto _194
case i32(42):
goto _211
case i32(43):
goto _212
case i32(44):
goto _213
case i32(45):
goto _216
case i32(46):
goto _218
case i32(47):
goto _220
case i32(48):
goto _221
case i32(49):
goto _228
case i32(50):
goto _237
case i32(51):
goto _242
case i32(52):
goto _83
case i32(53):
goto _85
case i32(54):
goto _87
case i32(55):
goto _88
case i32(56):
goto _89
case i32(57):
goto _90
case i32(58):
goto _93
case i32(59):
goto _94
case i32(60):
goto _95
case i32(61):
goto _96
case i32(62):
goto _97
case i32(63):
goto _98
case i32(64):
goto _99
case i32(65):
goto _100
case i32(66):
goto _101
case i32(67):
goto _102
case i32(68):
goto _109
case i32(69):
goto _110
case i32(70):
goto _130
case i32(71):
goto _130
case i32(72):
goto _111
case i32(73):
goto _116
case i32(74):
goto _118
case i32(75):
goto _137
case i32(76):
goto _138
case i32(77):
goto _120
case i32(78):
goto _120
case i32(79):
goto _120
case i32(80):
goto _120
case i32(81):
goto _120
case i32(82):
goto _120
case i32(83):
goto _126
case i32(84):
goto _112
case i32(85):
goto _112
case i32(86):
goto _112
case i32(87):
goto _112
case i32(88):
goto _104
case i32(89):
goto _104
case i32(90):
goto _104
case i32(91):
goto _104
case i32(92):
goto _104
case i32(93):
goto _103
case i32(94):
goto _119
case i32(95):
goto _133
case i32(96):
goto _127
case i32(97):
goto _92
case i32(98):
goto _128
case i32(99):
goto _140
case i32(100):
goto _141
case i32(101):
goto _142
case i32(102):
goto _143
case i32(103):
goto _147
case i32(104):
goto _148
case i32(105):
goto _149
case i32(106):
goto _1013
case i32(107):
goto _1013
case i32(108):
goto _152
case i32(109):
goto _153
case i32(110):
goto _153
case i32(111):
goto _155
case i32(112):
goto _156
case i32(113):
goto _157
case i32(114):
goto _158
case i32(116):
goto _168
case i32(117):
goto _169
case i32(118):
goto _170
case i32(119):
goto _170
case i32(120):
goto _172
case i32(121):
goto _173
case i32(122):
goto _174
case i32(123):
goto _175
case i32(124):
goto _176
case i32(125):
goto _177
case i32(126):
goto _178
case i32(127):
goto _189
case i32(128):
goto _189
case i32(129):
goto _191
case i32(130):
goto _192
case i32(131):
goto _192
case i32(132):
goto _91
case i32(133):
goto _198
case i32(134):
goto _199
case i32(135):
goto _200
case i32(136):
goto _201
case i32(137):
goto _201
case i32(138):
goto _203
case i32(139):
goto _204
case i32(140):
goto _205
case i32(141):
goto _206
case i32(142):
goto _207
case i32(143):
goto _208
case i32(144):
goto _209
case i32(145):
goto _210
case i32(146):
goto _214
case i32(147):
goto _215
case i32(148):
goto _217
case i32(149):
goto _219
case i32(150):
goto _222
case i32(151):
goto _223
case i32(152):
goto _224
case i32(153):
goto _229
case i32(154):
goto _230
case i32(155):
goto _231
case i32(156):
goto _232
case i32(157):
goto _233
case i32(158):
goto _234
case i32(159):
goto _236
case i32(160):
goto _238
case i32(161):
goto _240
case i32(162):
goto _241
default:
goto _243
}
_81:
_jump_to_p2_and_check_for_interrupt:
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_pOp.X4)-i32(1))))
_check_for_interrupt:
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) != 0 {
goto _abort_due_to_interrupt
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_db.X61)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil})) || _nVmStep < _nProgressLimit {
goto _246
}
func() {
if (_db.X63) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79076), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63129)))
crt.X__builtin_abort(tls)
}
}()
_nProgressLimit = (_nVmStep + (_db.X63)) - (_nVmStep % (_db.X63))
if (_db.X61)(tls, _db.X62) != 0 {
_rc = i32(9)
goto _abort_due_to_error
}
_246:
goto _250
_82:
func() {
if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79094), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149)))
crt.X__builtin_abort(tls)
}
}()
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if bool2int((int32(_pIn1.X1)&i32(9312)) != i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79096), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63196)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = int64(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24))
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X3, _pIn1)
}
_jump_to_p2:
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_pOp.X4)-i32(1))))
goto _250
_83:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if int32(_pIn1.X1) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63220)))
crt.X__builtin_abort(tls)
}
}()
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))))))
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(128))
goto _250
_84:
func() {
if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) < i32(0) || (_pOp.X4) >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79135), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63241)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) < i32(0) || (_pOp.X5) >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79136), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63270)))
crt.X__builtin_abort(tls)
}
}()
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_pOut.X1) & i32(9312)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79138), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63299)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64((_pOp.X5) - i32(1))
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
if (_pOp.X4) != 0 {
goto _jump_to_p2
}
goto _250
_85:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if int32(_pIn1.X1) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79156), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63220)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) < int64(i32(0)) || (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) >= int64(_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79157), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63321)))
crt.X__builtin_abort(tls)
}
}()
_24_pCaller = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))))))
func() {
if int32(_24_pCaller.X0) != i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79159), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63354)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_24_pCaller.X4) < i32(0) || (_24_pCaller.X4) >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63380)))
crt.X__builtin_abort(tls)
}
}()
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_24_pCaller.X4)-i32(1))))
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(128))
goto _250
_86:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if bool2int((int32(_pIn1.X1)&i32(9312)) != i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63196)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16(i32(4))
_25_pcDest = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = int64(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24))
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X3, _pIn1)
}
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_25_pcDest)))
goto _250
_87:
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if (int32(_pIn3.X1) & i32(1)) == i32(0) {
goto _250
}
_88:
_27_pcx = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
if (_pOp.X3) != i32(0) || (*XVdbeFrame)(_p.X38) == nil {
goto _286
}
_27_pFrame = (*XVdbeFrame)(_p.X38)
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = (*XVdbeFrame)(_27_pFrame.X1)
*(*int32)(unsafe.Pointer(&(_p.X40))) -= 1
_sqlite3VdbeSetChanges(tls, _db, _p.X11)
_27_pcx = _sqlite3VdbeFrameRestore(tls, _27_pFrame)
if (_pOp.X4) == i32(4) {
_27_pcx = ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_27_pcx))).X4) - i32(1)
}
_aOp = (*XVdbeOp)(_p.X17)
_aMem = (*XMem)(_p.X18)
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(_27_pcx)))
goto _250
_286:
*(*int32)(unsafe.Pointer(&(_p.X10))) = _pOp.X3
*(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(_pOp.X4)
*(*int32)(unsafe.Pointer(&(_p.X9))) = _27_pcx
func() {
if int32(_pOp.X2) > i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79263), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63417)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X10) == 0 {
goto _290
}
if (_pOp.X2) == 0 {
goto _291
}
_sqlite3VdbeError(tls, _p, str(63428), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00azTypeØ001)) + 4*uintptr(int32(_pOp.X2)-i32(1))))))
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil {
*(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3MPrintf(tls, _db, str(63449), unsafe.Pointer(_p.X22), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
}
goto _293
_291:
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
_293:
Xsqlite3_log(tls, _pOp.X3, str(63456), _27_pcx, unsafe.Pointer(_p.X36), unsafe.Pointer(_p.X22))
_290:
_rc = _sqlite3VdbeHalt(tls, _p)
func() {
if _rc != i32(5) && _rc != i32(0) && _rc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79282), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63480)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(5) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(5)
goto _299
}
func() {
if _rc != i32(0) && ((_p.X10)&i32(255)) != i32(19) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79286), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63533)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(0) && (_db.X77) <= int64(i32(0)) && (_db.X78) <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79287), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63582)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if (_p.X10) != 0 {
return i32(1)
}
return i32(101)
}()
_299:
goto _vdbe_return
_89:
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_pOp.X3)
goto _250
_90:
_pOut = _out2Prerelease(tls, _p, _pOp)
func() {
if (*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79312), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63645)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = *(*(**int64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _250
_91:
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(8))
func() {
if _sqlite3IsNaN(tls, *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79327), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63661)))
crt.X__builtin_abort(tls)
}
}()
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = *(*(**float64)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _250
_92:
func() {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79342), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63691)))
crt.X__builtin_abort(tls)
}
}()
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(58))
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
if int32(_encoding) == i32(1) {
goto _315
}
_rc = _sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), i32(-1), uint8(i32(1)), nil)
func() {
if _rc != i32(0) && _rc != i32(18) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79350), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63704)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != _sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding)) {
goto _no_mem
}
func() {
if (_pOut.X7) <= i32(0) || (_pOut.X6) != (_pOut.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79352), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63739)))
crt.X__builtin_abort(tls)
}
}()
func() {
if bool2int((int32(_pOut.X1)&i32(9312)) != i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79353), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63782)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pOut.X7))) = i32(0)
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) | i32(2048))
sink14 = *p
}
if int32(_pOp.X1) == i32(-1) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
}
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-1))
*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = _pOut.X5
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = _pOut.X4
_315:
if (_pOp.X3) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
goto _too_big
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79368), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_93:
func() {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63691)))
crt.X__builtin_abort(tls)
}
}()
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2562))
*(**int8)(unsafe.Pointer(&(_pOut.X5))) = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = _pOp.X3
*(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding
if (_pOp.X5) <= i32(0) {
goto _331
}
func() {
if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79394), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022)))
crt.X__builtin_abort(tls)
}
}()
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if (int32(_pIn3.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63806)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) == int64(_pOp.X2) {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2576))
}
_331:
goto _250
_94:
_pOut = _out2Prerelease(tls, _p, _pOp)
_45_cnt = (_pOp.X5) - (_pOp.X4)
func() {
if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79420), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = store14(&_45_nullFlag, uint16(func() int32 {
if (_pOp.X3) != 0 {
return i32(257)
}
return i32(1)
}()))
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = i32(0)
_341:
if _45_cnt > i32(0) {
*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
_sqlite3VdbeMemSetNull(tls, _pOut)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = _45_nullFlag
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = i32(0)
_45_cnt -= 1
goto _341
}
goto _250
_95:
func() {
if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79443), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149)))
crt.X__builtin_abort(tls)
}
}()
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-160)) | i32(1))
goto _250
_96:
func() {
if (_pOp.X3) > i32(1000000000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79456), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63828)))
crt.X__builtin_abort(tls)
}
}()
_pOut = _out2Prerelease(tls, _p, _pOp)
_sqlite3VdbeMemSetStr(tls, _pOut, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), _pOp.X3, uint8(i32(0)), nil)
*(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding
goto _250
_97:
func() {
if (_pOp.X3) <= i32(0) || (_pOp.X3) > int32(_p.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79475), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63857)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil && (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != _sqlite3VListNumToName(tls, _p.X25, _pOp.X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79476), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63887)))
crt.X__builtin_abort(tls)
}
}()
_49_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 48*uintptr((_pOp.X3)-i32(1))))
if _sqlite3VdbeMemTooBig(tls, _49_pVar) != 0 {
goto _too_big
}
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemShallowCopy(tls, _pOut, _49_pVar, i32(2048))
goto _250
_98:
_51_n = _pOp.X5
_51_p1 = _pOp.X3
_51_p2 = _pOp.X4
func() {
if _51_n <= i32(0) || _51_p1 <= i32(0) || _51_p2 <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79504), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63955)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_51_p1+_51_n) > _51_p2 && (_51_p2+_51_n) > _51_p1 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79505), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63975)))
crt.X__builtin_abort(tls)
}
}()
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_51_p1)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_51_p2)))
_362:
func() {
if uintptr(unsafe.Pointer(_pOut)) > uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79510), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63996)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_pIn1)) > uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79511), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64034)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pIn1.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79512), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64072)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
_sqlite3VdbeMemMove(tls, _pOut, _pIn1)
if (uintptr(unsafe.Pointer((*XMem)(_pOut.X11))) >= uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_51_p1)))))) && (uintptr(unsafe.Pointer((*XMem)(_pOut.X11))) < uintptr(unsafe.Pointer(_pOut))) {
{
p := (**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11)))))
*p = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 48*uintptr((_pOp.X4)-_51_p1)))
sink20 = *p
}
}
if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
goto _no_mem
}
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, postInc1(&_51_p2, int32(1)), _pOut)
}
*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
if preInc1(&_51_n, -1) != 0 {
goto _362
}
goto _250
_99:
_55_n = _pOp.X5
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
func() {
if _pOut == _pIn1 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79542), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64089)))
crt.X__builtin_abort(tls)
}
}()
_376:
_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, i32(4096))
if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
goto _no_mem
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11))))) = nil
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, ((_pOp.X4)+(_pOp.X5))-_55_n, _pOut)
}
if postInc1(&_55_n, int32(-1)) == i32(0) {
goto _377
}
*(*uintptr)(unsafe.Pointer(&_pOut)) += uintptr(48)
*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
goto _376
_377:
goto _250
_100:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
func() {
if _pOut == _pIn1 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79573), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64089)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemShallowCopy(tls, _pOut, _pIn1, i32(4096))
if (*XMem)(_pOut.X11) == nil {
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X11))))) = _pIn1
}
goto _250
_101:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_pIn1.X1) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64100)))
crt.X__builtin_abort(tls)
}
}()
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemSetInt64(tls, _pOut, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))))
goto _250
_102:
func() {
if int32(_p.X29) != (_pOp.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64127)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79610), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62778)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pOp.X3) + (_pOp.X4)) > ((((_p.X6) + i32(1)) - (_p.X7)) + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64150)))
crt.X__builtin_abort(tls)
}
}()
if ((*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_db.X61)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil}))) && (_nVmStep >= _nProgressLimit)) && ((_db.X61)(tls, _db.X62) != i32(0)) {
_rc = i32(9)
goto _abort_due_to_error
}
if i32(0) != store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(0))) {
func() {
if ((_db.X6) & i32(128)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79629), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64194)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_p.X32)>>uint(i32(6))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79630), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64221)))
crt.X__builtin_abort(tls)
}
}()
goto _abort_due_to_error
}
func() {
if (_p.X12) != i32(0) && ((_db.X6)&i32(128)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64240)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeCloseStatement(tls, _p, i32(1))
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79651), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X8))) = ((_p.X8) + uint32(i32(2))) | uint32(i32(1))
_60_pMem = store20((**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X21))))), (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X3))))
_60_i = i32(0)
_406:
if _60_i >= (_pOp.X4) {
goto _409
}
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79662), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64287)))
crt.X__builtin_abort(tls)
}
}()
if ((int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))).X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i)))) != 0 {
goto _no_mem
}
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))).X1)&i32(4096)) != i32(0) && (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))).X1)&i32(18)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79664), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64308)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemNulTerminate(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))))
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, (_pOp.X3)+_60_i, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_60_pMem))+48*uintptr(_60_i))))
}
_60_i += 1
goto _406
_409:
if (_db.X17) != 0 {
goto _no_mem
}
if (int32(_db.X24) & i32(4)) != 0 {
(_db.X41)(tls, uint32(i32(4)), _db.X42, (unsafe.Pointer)(_p), nil)
}
*(*int32)(unsafe.Pointer(&(_p.X9))) = int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24) + i32(1)
_rc = i32(100)
goto _vdbe_return
_103:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if _pIn1 == _pOut {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64382)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pIn1.X1) | int32(_pIn2.X1)) & i32(1)) != 0 {
_sqlite3VdbeMemSetNull(tls, _pOut)
goto _250
}
if func() int32 {
if (int32(_pIn1.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
}
return i32(0)
}() != 0 || func() int32 {
if (int32(_pIn2.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
}
return i32(0)
}() != 0 {
goto _no_mem
}
if ((int32(_pIn1.X1) & i32(18)) == i32(0)) && _sqlite3VdbeMemStringify(tls, _pIn1, _encoding, uint8(i32(0))) != 0 {
goto _no_mem
}
if ((int32(_pIn2.X1) & i32(18)) == i32(0)) && _sqlite3VdbeMemStringify(tls, _pIn2, _encoding, uint8(i32(0))) != 0 {
goto _no_mem
}
_66_nByte = int64((_pIn1.X4) + (_pIn2.X4))
if _66_nByte > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
goto _too_big
}
if _sqlite3VdbeMemGrow(tls, _pOut, int32(_66_nByte)+i32(2), bool2int(_pOut == _pIn2)) != 0 {
goto _no_mem
}
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(2))
if _pOut != _pIn2 {
crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut.X5), (unsafe.Pointer)(_pIn2.X5), uint32(_pIn2.X4))
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5))+1*uintptr(_pIn2.X4)))), (unsafe.Pointer)(_pIn1.X5), uint32(_pIn1.X4))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5)) + 1*uintptr(_66_nByte))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOut.X5)) + 1*uintptr(_66_nByte+int64(i32(1))))) = int8(i32(0))
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_66_nByte)
*(*uint8)(unsafe.Pointer(&(_pOut.X2))) = _encoding
goto _250
_104:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_73_type1 = _numericType(tls, _pIn1)
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_73_type2 = _numericType(tls, _pIn2)
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_73_flags = uint16(int32(_pIn1.X1) | int32(_pIn2.X1))
if ((int32(_73_type1) & int32(_73_type2)) & i32(4)) == i32(0) {
goto _436
}
_73_iA = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))
_73_iB = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))
_73_bIntint = int8(i32(1))
switch int32(_pOp.X0) {
case i32(88):
goto _438
case i32(89):
goto _439
case i32(90):
goto _440
case i32(91):
goto _441
default:
goto _442
}
_438:
if _sqlite3AddInt64(tls, &_73_iB, _73_iA) != 0 {
goto _fp_math
}
goto _444
_439:
if _sqlite3SubInt64(tls, &_73_iB, _73_iA) != 0 {
goto _fp_math
}
goto _444
_440:
if _sqlite3MulInt64(tls, &_73_iB, _73_iA) != 0 {
goto _fp_math
}
goto _444
_441:
if _73_iA == int64(i32(0)) {
goto _arithmetic_result_is_null
}
if (_73_iA == int64(i32(-1))) && (_73_iB == i64(-9223372036854775808)) {
goto _fp_math
}
{
p := &_73_iB
*p = (*p) / _73_iA
sink6 = *p
}
goto _444
_442:
if _73_iA == int64(i32(0)) {
goto _arithmetic_result_is_null
}
if _73_iA == int64(i32(-1)) {
_73_iA = int64(i32(1))
}
{
p := &_73_iB
*p = (*p) % _73_iA
sink6 = *p
}
goto _444
_444:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _73_iB
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4))
goto _454
_436:
if (int32(_73_flags) & i32(1)) != i32(0) {
goto _arithmetic_result_is_null
}
_73_bIntint = int8(i32(0))
_fp_math:
_73_rA = _sqlite3VdbeRealValue(tls, _pIn1)
_73_rB = _sqlite3VdbeRealValue(tls, _pIn2)
switch int32(_pOp.X0) {
case i32(88):
goto _456
case i32(89):
goto _457
case i32(90):
goto _458
case i32(91):
goto _459
default:
goto _460
}
_456:
{
p := &_73_rB
*p = (*p) + _73_rA
sink4 = *p
}
goto _461
_457:
{
p := &_73_rB
*p = (*p) - _73_rA
sink4 = *p
}
goto _461
_458:
{
p := &_73_rB
*p = (*p) * _73_rA
sink4 = *p
}
goto _461
_459:
if _73_rA == float64(0) {
goto _arithmetic_result_is_null
}
{
p := &_73_rB
*p = (*p) / _73_rA
sink4 = *p
}
goto _461
_460:
_73_iA = int64(_73_rA)
_73_iB = int64(_73_rB)
if _73_iA == int64(i32(0)) {
goto _arithmetic_result_is_null
}
if _73_iA == int64(i32(-1)) {
_73_iA = int64(i32(1))
}
_73_rB = float64(_73_iB % _73_iA)
goto _461
_461:
if _sqlite3IsNaN(tls, _73_rB) != 0 {
goto _arithmetic_result_is_null
}
*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _73_rB
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(8))
if (((int32(_73_type1) | int32(_73_type2)) & i32(8)) == i32(0)) && (_73_bIntint == 0) {
_sqlite3VdbeIntegerAffinity(tls, _pOut)
}
_454:
goto _250
_arithmetic_result_is_null:
_sqlite3VdbeMemSetNull(tls, _pOut)
goto _250
_109:
func() {
if int32(_pOp.X1) != i32(-3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79874), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64393)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X3) != 0 {
_sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X3))), int64(i32(0)))
}
goto _250
_110:
func() {
if int32(_pOp.X1) != i32(-4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64417)))
crt.X__builtin_abort(tls)
}
}()
_87_n = int32(_pOp.X2)
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79928), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _87_n != i32(0) && ((_pOp.X4) <= i32(0) || ((_pOp.X4)+_87_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79929), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64488)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) >= (_pOp.X4) && (_pOp.X5) < ((_pOp.X4)+_87_n) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64549)))
crt.X__builtin_abort(tls)
}
}()
_87_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(32)+(uint32(_87_n-i32(1))*u32(4)))))
if _87_pCtx == nil {
goto _no_mem
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X0))))) = nil
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X1))))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(*int32)(unsafe.Pointer(&(_87_pCtx.X4))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_87_pCtx.X3))))) = _p
*(*uint8)(unsafe.Pointer(&(_87_pCtx.X8))) = uint8(_87_n)
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-16))
*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _87_pCtx
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(72))
_111:
func() {
if int32(_pOp.X1) != i32(-16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79947), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64587)))
crt.X__builtin_abort(tls)
}
}()
_88_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if (*XMem)(_88_pCtx.X0) == _pOut {
goto _486
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X0))))) = _pOut
_88_i = int32(_88_pCtx.X8) - i32(1)
_487:
if _88_i < i32(0) {
goto _490
}
*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 4*uintptr(_88_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr((_pOp.X4)+_88_i)))
_88_i -= 1
goto _487
_490:
_486:
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
_88_i = i32(0)
_491:
if _88_i >= int32(_88_pCtx.X8) {
goto _494
}
func() {
if (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 4*uintptr(_88_i)))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(79963), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64611)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, (_pOp.X4)+_88_i, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))) + 4*uintptr(_88_i))))
}
_88_i += 1
goto _491
_494:
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1))
*(*uint8)(unsafe.Pointer(&(_88_pCtx.X7))) = uint8(i32(0))
(*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
}{((*XFuncDef)(_88_pCtx.X1).X4)})))(tls, _88_pCtx, int32(_88_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_88_pCtx.X9))))))
if (_88_pCtx.X7) == 0 {
goto _498
}
if (_88_pCtx.X5) != 0 {
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, _pOut)))
_rc = _88_pCtx.X5
}
_sqlite3VdbeDeleteAuxData(tls, _db, (**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))), _88_pCtx.X4, _pOp.X3)
if _rc != 0 {
goto _abort_due_to_error
}
_498:
if (int32(_pOut.X1) & i32(18)) == 0 {
goto _501
}
_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
if _sqlite3VdbeMemTooBig(tls, _pOut) != 0 {
goto _too_big
}
_501:
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _pOut)
}
goto _250
_112:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if ((int32(_pIn1.X1) | int32(_pIn2.X1)) & i32(1)) != 0 {
_sqlite3VdbeMemSetNull(tls, _pOut)
goto _250
}
_94_iA = _sqlite3VdbeIntValue(tls, _pIn2)
_94_iB = _sqlite3VdbeIntValue(tls, _pIn1)
_94_op = _pOp.X0
if int32(_94_op) == i32(84) {
{
p := &_94_iA
*p = (*p) & _94_iB
sink6 = *p
}
goto _509
}
if int32(_94_op) == i32(85) {
{
p := &_94_iA
*p = (*p) | _94_iB
sink6 = *p
}
goto _509
}
if _94_iB == int64(i32(0)) {
goto _509
}
func() {
if int32(_94_op) != i32(87) && int32(_94_op) != i32(86) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64637)))
crt.X__builtin_abort(tls)
}
}()
if _94_iB < int64(i32(0)) {
i32(0)
_94_op = uint8(i32(173) - int32(_94_op))
_94_iB = func() int64 {
if _94_iB > int64(i32(-64)) {
return (-_94_iB)
}
return int64(i32(64))
}()
}
if _94_iB >= int64(i32(64)) {
_94_iA = int64(func() int32 {
if (_94_iA >= int64(i32(0))) || (int32(_94_op) == i32(86)) {
return i32(0)
}
return i32(-1)
}())
goto _520
}
crt.Xmemcpy(tls, (unsafe.Pointer)(&_94_uA), (unsafe.Pointer)(&_94_iA), u32(8))
if int32(_94_op) == i32(86) {
{
p := &_94_uA
*p = (*p) << uint(int32(_94_iB))
sink17 = *p
}
goto _522
}
{
p := &_94_uA
*p = (*p) >> uint(int32(_94_iB))
sink17 = *p
}
if _94_iA < int64(i32(0)) {
{
p := &_94_uA
*p = (*p) | (u64(18446744073709551615) << uint(int32(int64(i32(64))-_94_iB)))
sink17 = *p
}
}
_522:
crt.Xmemcpy(tls, (unsafe.Pointer)(&_94_iA), (unsafe.Pointer)(&_94_uA), u32(8))
_520:
_509:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _94_iA
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4))
goto _250
_116:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
_sqlite3VdbeMemIntegerify(tls, _pIn1)
{
p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))
*p = (*p) + int64(_pOp.X4)
sink6 = *p
}
goto _250
_117:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(4)) != i32(0) {
goto _524
}
_applyAffinity(tls, _pIn1, int8(i32(67)), _encoding)
if (int32(_pIn1.X1) & i32(4)) != i32(0) {
goto _525
}
if (_pOp.X4) == i32(0) {
_rc = i32(20)
goto _abort_due_to_error
}
goto _jump_to_p2
_525:
_524:
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = uint16((int32(_pIn1.X1) & i32(-49664)) | i32(4))
goto _250
_118:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(4)) != 0 {
_sqlite3VdbeMemRealify(tls, _pIn1)
}
goto _250
_119:
func() {
if (_pOp.X4) < i32(65) || (_pOp.X4) > i32(69) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80151), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64675)))
crt.X__builtin_abort(tls)
}
}()
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_sqlite3VdbeMemAboutToChange(tls, _p, _pIn1)
_rc = func() int32 {
if (int32(_pIn1.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pIn1)
}
return i32(0)
}()
_sqlite3VdbeMemCast(tls, _pIn1, uint8(_pOp.X4), _encoding)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_120:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_113_flags1 = _pIn1.X1
_113_flags3 = _pIn3.X1
if ((int32(_113_flags1) | int32(_113_flags3)) & i32(1)) == 0 {
goto _535
}
if (int32(_pOp.X2) & i32(128)) == 0 {
goto _536
}
func() {
if int32(_pOp.X0) != i32(78) && int32(_pOp.X0) != i32(77) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80285), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64728)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_113_flags1) & i32(256)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80286), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64769)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pOp.X2) & i32(16)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80287), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64795)))
crt.X__builtin_abort(tls)
}
}()
if (((int32(_113_flags1) & int32(_113_flags3)) & i32(1)) != i32(0)) && ((int32(_113_flags3) & i32(256)) == i32(0)) {
_113_res = i32(0)
goto _546
}
_113_res = i32(1)
_546:
goto _547
_536:
if (int32(_pOp.X2) & i32(32)) == 0 {
goto _548
}
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_iCompare = i32(1)
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1))
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X4, _pOut)
}
goto _550
_548:
if (int32(_pOp.X2) & i32(16)) != 0 {
goto _jump_to_p2
}
_550:
goto _250
_547:
goto _compare_op
_535:
_113_affinity = int8(int32(_pOp.X2) & i32(71))
if int32(_113_affinity) < i32(67) {
goto _553
}
if ((int32(_113_flags1) | int32(_113_flags3)) & i32(2)) == 0 {
goto _554
}
if (int32(_113_flags1) & i32(14)) == i32(2) {
_applyNumericAffinity(tls, _pIn1, i32(0))
_113_flags3 = _pIn3.X1
}
if (int32(_113_flags3) & i32(14)) == i32(2) {
_applyNumericAffinity(tls, _pIn3, i32(0))
}
_554:
if ((int32(_pIn1.X1) & int32(_pIn3.X1)) & i32(4)) == i32(0) {
goto _557
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) {
_113_res = i32(1)
goto _compare_op
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) {
_113_res = i32(-1)
goto _compare_op
}
_113_res = i32(0)
goto _compare_op
_557:
goto _561
_553:
if int32(_113_affinity) != i32(66) {
goto _561
}
if ((int32(_113_flags1) & i32(2)) == i32(0)) && ((int32(_113_flags1) & i32(12)) != i32(0)) {
_sqlite3VdbeMemStringify(tls, _pIn1, _encoding, uint8(i32(1)))
_113_flags1 = uint16((int32(_pIn1.X1) & i32(-33280)) | (int32(_113_flags1) & i32(33279)))
func() {
if _pIn1 == _pIn3 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80343), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64828)))
crt.X__builtin_abort(tls)
}
}()
}
if ((int32(_113_flags3) & i32(2)) == i32(0)) && ((int32(_113_flags3) & i32(12)) != i32(0)) {
_sqlite3VdbeMemStringify(tls, _pIn3, _encoding, uint8(i32(1)))
_113_flags3 = uint16((int32(_pIn3.X1) & i32(-33280)) | (int32(_113_flags3) & i32(33279)))
}
_561:
func() {
if int32(_pOp.X1) != i32(-3) && (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80353), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64839)))
crt.X__builtin_abort(tls)
}
}()
_113_res = _sqlite3MemCompare(tls, _pIn3, _pIn1, (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
_compare_op:
switch int32(_pOp.X0) {
case i32(77):
goto _573
case i32(78):
goto _572
case i32(79):
goto _576
case i32(80):
goto _575
case i32(81):
goto _574
default:
goto _577
}
_572:
_113_res2 = bool2int(_113_res == i32(0))
goto _578
_573:
_113_res2 = _113_res
goto _578
_574:
_113_res2 = bool2int(_113_res < i32(0))
goto _578
_575:
_113_res2 = bool2int(_113_res <= i32(0))
goto _578
_576:
_113_res2 = bool2int(_113_res > i32(0))
goto _578
_577:
_113_res2 = bool2int(_113_res >= i32(0))
goto _578
_578:
func() {
if (int32(_pIn1.X1) & i32(1024)) != (int32(_113_flags1) & i32(1024)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80367), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64883)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pIn1.X1))) = _113_flags1
func() {
if (int32(_pIn3.X1) & i32(1024)) != (int32(_113_flags3) & i32(1024)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80369), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64929)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pIn3.X1))) = _113_flags3
if (int32(_pOp.X2) & i32(32)) == 0 {
goto _583
}
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_iCompare = _113_res
_113_res2 = bool2int(_113_res2 != i32(0))
if (int32(_pOp.X2) & i32(8)) == i32(0) {
goto _584
}
func() {
if int32(_pOp.X0) != i32(77) && int32(_pOp.X0) != i32(78) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80384), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64975)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _113_res2 != i32(0) && _113_res2 != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65016)))
crt.X__builtin_abort(tls)
}
}()
if bool2int(int32(_pOp.X0) == i32(78)) == _113_res2 {
goto _250
}
_584:
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_113_res2)
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X4, _pOut)
}
goto _593
_583:
if _113_res2 != 0 {
goto _jump_to_p2
}
_593:
goto _250
_126:
func() {
if uintptr(unsafe.Pointer(_pOp)) <= uintptr(unsafe.Pointer(_aOp)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80414), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65035)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X0) != i32(81) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X0) != i32(79) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80415), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65043)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X2) & i32(32)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80416), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65090)))
crt.X__builtin_abort(tls)
}
}()
if _iCompare != i32(0) {
goto _jump_to_p2
}
goto _250
_127:
func() {
if int32(_pOp.X1) != i32(-12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65118)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65143)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X0) != i32(98) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65154)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X2) & i32(1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80439), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65180)))
crt.X__builtin_abort(tls)
}
}()
goto _250
_128:
if (int32(_pOp.X2) & i32(1)) == i32(0) {
_140_aPermute = nil
goto _612
}
func() {
if uintptr(unsafe.Pointer(_pOp)) <= uintptr(unsafe.Pointer(_aOp)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65035)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X0) != i32(96) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80478), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65207)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X1) != i32(-12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80479), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65238)))
crt.X__builtin_abort(tls)
}
}()
_140_aPermute = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(-1)))).X6))))))) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))
func() {
if _140_aPermute == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80481), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65266)))
crt.X__builtin_abort(tls)
}
}()
_612:
_140_n = _pOp.X5
_140_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
func() {
if _140_n <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80485), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(1358)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _140_pKeyInfo == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80486), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(45040)))
crt.X__builtin_abort(tls)
}
}()
_140_p1 = _pOp.X3
_140_p2 = _pOp.X4
if _140_aPermute == nil {
goto _625
}
_143_mx = i32(0)
_143_k = i32(0)
_626:
if _143_k >= _140_n {
goto _629
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_143_k)))) > _143_mx {
_143_mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_143_k)))
}
_143_k += 1
goto _626
_629:
func() {
if _140_p1 <= i32(0) || (_140_p1+_143_mx) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65278)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _140_p2 <= i32(0) || (_140_p2+_143_mx) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80494), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65320)))
crt.X__builtin_abort(tls)
}
}()
goto _637
_625:
func() {
if _140_p1 <= i32(0) || (_140_p1+_140_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65362)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _140_p2 <= i32(0) || (_140_p2+_140_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80497), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65403)))
crt.X__builtin_abort(tls)
}
}()
_637:
_140_i = i32(0)
_644:
if _140_i >= _140_n {
goto _647
}
_140_idx = func() int32 {
if _140_aPermute != nil {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_aPermute)) + 4*uintptr(_140_i))))
}
return _140_i
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p1+_140_idx))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65444)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p2+_140_idx))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80503), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65470)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _140_p1+_140_idx, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p1+_140_idx))))
}
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _140_p2+_140_idx, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p2+_140_idx))))
}
func() {
if _140_i >= int32(_140_pKeyInfo.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80506), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65496)))
crt.X__builtin_abort(tls)
}
}()
_140_pColl = *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_140_pKeyInfo.X6))))) + 4*uintptr(_140_i)))
_140_bRev = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_140_pKeyInfo.X5)) + 1*uintptr(_140_i))))
_iCompare = _sqlite3MemCompare(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p1+_140_idx))), (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_140_p2+_140_idx))), _140_pColl)
if _iCompare == 0 {
goto _658
}
if _140_bRev != 0 {
_iCompare = -_iCompare
}
goto _647
_658:
_140_i += 1
goto _644
_647:
goto _250
_129:
if _iCompare < i32(0) {
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_pOp.X3)-i32(1))))
goto _663
}
if _iCompare == i32(0) {
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_pOp.X4)-i32(1))))
goto _663
}
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr((_pOp.X5)-i32(1))))
_663:
goto _250
_130:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(1)) != 0 {
_151_v1 = i32(2)
goto _665
}
_151_v1 = bool2int(_sqlite3VdbeIntValue(tls, _pIn1) != int64(i32(0)))
_665:
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
if (int32(_pIn2.X1) & i32(1)) != 0 {
_151_v2 = i32(2)
goto _667
}
_151_v2 = bool2int(_sqlite3VdbeIntValue(tls, _pIn2) != int64(i32(0)))
_667:
if int32(_pOp.X0) == i32(71) {
_151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00and_logicØ002)) + 1*uintptr((_151_v1*i32(3))+_151_v2))))
goto _669
}
_151_v1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00or_logicØ003)) + 1*uintptr((_151_v1*i32(3))+_151_v2))))
_669:
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if _151_v1 == i32(2) {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(1))
goto _671
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_151_v1)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(4))
_671:
goto _250
_132:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemSetNull(tls, _pOut)
if (int32(_pIn1.X1) & i32(1)) == i32(0) {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(bool2int(_sqlite3VdbeIntValue(tls, _pIn1) == 0))
}
goto _250
_133:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemSetNull(tls, _pOut)
if (int32(_pIn1.X1) & i32(1)) == i32(0) {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = ^_sqlite3VdbeIntValue(tls, _pIn1)
}
goto _250
_134:
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(i32(0)))).X0) != i32(51) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80644), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65515)))
crt.X__builtin_abort(tls)
}
}()
if (*XVdbeFrame)(_p.X38) == nil {
goto _676
}
_164_iAddr = uint32(int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer((*XVdbeOp)(_p.X17)))) / 24))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8)))))) & (i32(1) << uint(int32(_164_iAddr&uint32(i32(7)))))) != i32(0) {
goto _jump_to_p2
}
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XVdbeFrame)(_p.X38).X6)) + 1*uintptr(_164_iAddr/uint32(i32(8)))))
*p = uint8(int32(*p) | (i32(1) << uint(int32(_164_iAddr&uint32(i32(7))))))
sink2 = *p
}
goto _678
_676:
if ((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(i32(0)))).X3) == (_pOp.X3) {
goto _jump_to_p2
}
_678:
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(i32(0)))).X3
goto _250
_135:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(1)) != 0 {
_169_c = _pOp.X5
goto _681
}
_169_c = bool2int(_sqlite3VdbeRealValue(tls, _pIn1) != float64(0))
if int32(_pOp.X0) == i32(22) {
_169_c = bool2int(_169_c == 0)
}
_681:
if _169_c != 0 {
goto _jump_to_p2
}
goto _250
_137:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(1)) != i32(0) {
goto _jump_to_p2
}
goto _250
_138:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if (int32(_pIn1.X1) & i32(1)) == i32(0) {
goto _jump_to_p2
}
goto _250
_139:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80733), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80734), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65574)))
crt.X__builtin_abort(tls)
}
}()
if ((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))).X2) != 0 {
_sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem))+uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.X5)))))*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(48))))))))))))
goto _jump_to_p2
}
goto _250
_140:
_179_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
_179_p2 = _pOp.X4
_rc = _sqlite3VdbeCursorMoveto(tls, &_179_pC, &_179_p2)
if _rc != 0 {
goto _abort_due_to_error
}
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
_179_pDest = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_sqlite3VdbeMemAboutToChange(tls, _p, _179_pDest)
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80795), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _179_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _179_p2 >= int32(_179_pC.X18) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80797), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65601)))
crt.X__builtin_abort(tls)
}
}()
_179_aOffset = _179_pC.X21
func() {
if int32(_179_pC.X0) == i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65615)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_179_pC.X0) == i32(3) && (_179_pC.X2) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65642)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_179_pC.X0) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65686)))
crt.X__builtin_abort(tls)
}
}()
if (_179_pC.X11) == (_p.X8) {
goto _710
}
if (_179_pC.X2) == 0 {
goto _711
}
if int32(_179_pC.X0) == i32(3) {
func() {
if (*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65715)))
crt.X__builtin_abort(tls)
}
}()
_179_pReg = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14))))))))
func() {
if (int32(_179_pReg.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65739)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_179_pReg.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80809), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65762)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_179_pC.X23))) = store5((*uint32)(unsafe.Pointer(&(_179_pC.X24))), store5(&_179_avail, uint32(_179_pReg.X4)))
*(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = (*uint8)(unsafe.Pointer(_179_pReg.X5))
goto _719
}
_sqlite3VdbeMemSetNull(tls, _179_pDest)
goto _op_column_out
_719:
goto _720
_711:
_179_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14))))))
func() {
if int32(_179_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80818), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _179_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80819), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeCursorIsValid(tls, _179_pCrsr) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80820), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65813)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_179_pC.X23))) = _sqlite3BtreePayloadSize(tls, _179_pCrsr)
*(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = (*uint8)(_sqlite3BtreePayloadFetch(tls, _179_pCrsr, &_179_avail))
func() {
if _179_avail > uint32(i32(65536)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80823), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65846)))
crt.X__builtin_abort(tls)
}
}()
if (_179_pC.X23) <= _179_avail {
*(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = _179_pC.X23
goto _732
}
if (_179_pC.X23) > uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
goto _too_big
}
*(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = _179_avail
_732:
_720:
*(*uint32)(unsafe.Pointer(&(_179_pC.X11))) = _p.X8
*(*uint32)(unsafe.Pointer(&(_179_pC.X16))) = uint32(uint8(func() int32 {
if int32(*(_179_pC.X22)) < int32(u8(128)) {
return func() int32 { _179_offset = uint32(*(_179_pC.X22)); return i32(1) }()
}
return int32(_sqlite3GetVarint32(tls, _179_pC.X22, &_179_offset))
}()))
*(*uint16)(unsafe.Pointer(&(_179_pC.X19))) = uint16(i32(0))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0)))) = _179_offset
if _179_avail >= _179_offset {
goto _735
}
*(**uint8)(unsafe.Pointer(&(_179_pC.X22))) = nil
*(*uint32)(unsafe.Pointer(&(_179_pC.X24))) = uint32(i32(0))
if (_179_offset > uint32(i32(98307))) || (_179_offset > (_179_pC.X23)) {
_rc = _sqlite3CorruptError(tls, i32(80856))
goto _abort_due_to_error
}
goto _739
_735:
if _179_offset > uint32(i32(0)) {
_179_zData = _179_pC.X22
func() {
if int32(_179_pC.X19) > _179_p2 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80865), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65859)))
crt.X__builtin_abort(tls)
}
}()
goto _op_column_read_header
}
_739:
_710:
if int32(_179_pC.X19) > _179_p2 {
goto _742
}
if (_179_pC.X16) >= (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0))))) {
goto _743
}
if (_179_pC.X22) != nil {
goto _744
}
crt.Xmemset(tls, (unsafe.Pointer)(&_179_sMem), i32(0), u32(48))
_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))), uint32(i32(0)), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0)))), &_179_sMem)
if _rc != i32(0) {
goto _abort_due_to_error
}
_179_zData = (*uint8)(unsafe.Pointer(_179_sMem.X5))
goto _op_column_read_header
_744:
_179_zData = _179_pC.X22
_op_column_read_header:
_179_i = int32(_179_pC.X19)
_179_offset64 = uint64(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_i))))
_179_zHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_179_pC.X16)))))))
_179_zEndHdr = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_zData)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(i32(0)))))))))))
_747:
if store5(&_179_t, uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_zHdr)) + 1*uintptr(i32(0)))))) < uint32(i32(128)) {
*(*uintptr)(unsafe.Pointer(&_179_zHdr)) += uintptr(1)
{
p := &_179_offset64
*p = (*p) + uint64(_sqlite3VdbeOneByteSerialTypeLen(tls, uint8(_179_t)))
sink17 = *p
}
goto _749
}
{
p := &_179_zHdr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3GetVarint32(tls, _179_zHdr, &_179_t))))
sink13 = *p
}
{
p := &_179_offset64
*p = (*p) + uint64(_sqlite3VdbeSerialTypeLen(tls, _179_t))
sink17 = *p
}
_749:
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(postInc1(&_179_i, int32(1))))) = _179_t
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_i))) = uint32(_179_offset64 & uint64(u32(4294967295)))
if (_179_i <= _179_p2) && (uintptr(unsafe.Pointer(_179_zHdr)) < uintptr(unsafe.Pointer(_179_zEndHdr))) {
goto _747
}
if (uintptr(unsafe.Pointer(_179_zHdr)) < uintptr(unsafe.Pointer(_179_zEndHdr)) || uintptr(unsafe.Pointer(_179_zHdr)) <= uintptr(unsafe.Pointer(_179_zEndHdr)) && _179_offset64 == uint64(_179_pC.X23)) && _179_offset64 <= uint64(_179_pC.X23) {
goto _754
}
if (_179_pC.X22) == nil {
_sqlite3VdbeMemRelease(tls, &_179_sMem)
}
_rc = _sqlite3CorruptError(tls, i32(80915))
goto _abort_due_to_error
_754:
*(*uint16)(unsafe.Pointer(&(_179_pC.X19))) = uint16(_179_i)
*(*uint32)(unsafe.Pointer(&(_179_pC.X16))) = uint32(int32((uintptr(unsafe.Pointer(_179_zHdr)) - uintptr(unsafe.Pointer(_179_zData))) / 1))
if (_179_pC.X22) == nil {
_sqlite3VdbeMemRelease(tls, &_179_sMem)
}
goto _757
_743:
_179_t = uint32(i32(0))
_757:
if int32(_179_pC.X19) > _179_p2 {
goto _758
}
if int32(_pOp.X1) == i32(-7) {
_sqlite3VdbeMemShallowCopy(tls, _179_pDest, (*XMem)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))), i32(2048))
goto _760
}
_sqlite3VdbeMemSetNull(tls, _179_pDest)
_760:
goto _op_column_out
_758:
goto _761
_742:
_179_t = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(_179_p2)))
_761:
func() {
if _179_p2 >= int32(_179_pC.X19) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80946), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65878)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80947), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeCheckMemInvariants(tls, _179_pDest) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80948), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65896)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_179_pDest.X1) & i32(9312)) != i32(0) {
_sqlite3VdbeMemSetNull(tls, _179_pDest)
}
func() {
if _179_t != (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_179_pC.X25))))) + 4*uintptr(_179_p2)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(80952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65933)))
crt.X__builtin_abort(tls)
}
}()
if (_179_pC.X24) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2+i32(1))))) {
goto _771
}
_179_zData = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_179_pC.X22)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2))))))))))
if _179_t < uint32(i32(12)) {
_sqlite3VdbeSerialGet(tls, _179_zData, _179_t, _179_pDest)
goto _773
}
*(*int32)(unsafe.Pointer(&(_179_pDest.X4))) = store1(&_179_len, int32((_179_t-uint32(i32(12)))/uint32(i32(2))))
*(*uint8)(unsafe.Pointer(&(_179_pDest.X2))) = _encoding
if (_179_pDest.X7) >= (_179_len + i32(2)) {
goto _774
}
*(*uint16)(unsafe.Pointer(&(_179_pDest.X1))) = uint16(i32(1))
if _sqlite3VdbeMemGrow(tls, _179_pDest, _179_len+i32(2), i32(0)) != 0 {
goto _no_mem
}
goto _776
_774:
*(**int8)(unsafe.Pointer(&(_179_pDest.X5))) = _179_pDest.X6
_776:
crt.Xmemcpy(tls, (unsafe.Pointer)(_179_pDest.X5), (unsafe.Pointer)(_179_zData), uint32(_179_len))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_pDest.X5)) + 1*uintptr(_179_len))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_pDest.X5)) + 1*uintptr(_179_len+i32(1)))) = int8(i32(0))
*(*uint16)(unsafe.Pointer(&(_179_pDest.X1))) = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeExecØ00aFlagØ004)) + 2*uintptr(_179_t&uint32(i32(1)))))
_773:
goto _op_column_out
_771:
*(*uint8)(unsafe.Pointer(&(_179_pDest.X2))) = _encoding
if (((int32(_pOp.X2) & i32(192)) != i32(0)) && (((_179_t >= uint32(i32(12))) && ((_179_t & uint32(i32(1))) == uint32(i32(0)))) || ((int32(_pOp.X2) & i32(128)) != i32(0)))) || (store1(&_179_len, int32(_sqlite3VdbeSerialTypeLen(tls, _179_t))) == i32(0)) {
_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(&_sqlite3VdbeExecØ00aZeroØ005)), _179_t, _179_pDest)
goto _783
}
_rc = _sqlite3VdbeMemFromBtree(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_179_pC.X14)))))), *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_179_aOffset)) + 4*uintptr(_179_p2))), uint32(_179_len), _179_pDest)
if _rc != i32(0) {
goto _abort_due_to_error
}
_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(_179_pDest.X5)), _179_t, _179_pDest)
{
p := (*uint16)(unsafe.Pointer(&(_179_pDest.X1)))
*p = uint16(int32(*p) & i32(-4097))
sink14 = *p
}
_783:
_op_column_out:
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _179_pDest)
}
goto _250
_141:
_213_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if _213_zAffinity == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81025), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65950)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81026), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_213_zAffinity)) + 1*uintptr(_pOp.X4)))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65963)))
crt.X__builtin_abort(tls)
}
}()
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_792:
func() {
if uintptr(unsafe.Pointer(_pIn1)) > uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_p.X18)+48*uintptr(((_p.X6)+i32(1))-(_p.X7)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81030), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65985)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pIn1.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81031), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64072)))
crt.X__builtin_abort(tls)
}
}()
_applyAffinity(tls, _pIn1, *postInc0(&_213_zAffinity, 1), _encoding)
*(*uintptr)(unsafe.Pointer(&_pIn1)) += uintptr(48)
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_213_zAffinity)) + 1*uintptr(i32(0))))) != 0 {
goto _792
}
goto _250
_142:
_215_nData = uint64(i32(0))
_215_nHdr = i32(0)
_215_nZero = int64(i32(0))
_215_nField = _pOp.X3
_215_zAffinity = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if _215_nField <= i32(0) || (_pOp.X4) <= i32(0) || ((_pOp.X4)+_215_nField) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81092), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66028)))
crt.X__builtin_abort(tls)
}
}()
_215_pData0 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_215_nField)))
_215_nField = _pOp.X4
_215_pLast = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_pData0)) + 48*uintptr(_215_nField-i32(1))))
_215_file_format = int32(_p.X31)
func() {
if (_pOp.X5) >= (_pOp.X3) && (_pOp.X5) < ((_pOp.X3)+(_pOp.X4)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81099), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66096)))
crt.X__builtin_abort(tls)
}
}()
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
func() {
if uintptr(unsafe.Pointer(_215_pData0)) > uintptr(unsafe.Pointer(_215_pLast)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81105), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66140)))
crt.X__builtin_abort(tls)
}
}()
if _215_zAffinity == nil {
goto _806
}
_215_pRec = _215_pData0
_807:
_applyAffinity(tls, postInc20(&_215_pRec, 48), *postInc0(&_215_zAffinity, 1), _encoding)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zAffinity)) + 1*uintptr(i32(0))))) != i32(0) && uintptr(unsafe.Pointer(_215_pRec)) > uintptr(unsafe.Pointer(_215_pLast)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66154)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zAffinity)) + 1*uintptr(i32(0))))) != 0 {
goto _807
}
_806:
_215_pRec = _215_pLast
_811:
func() {
if (int32(_215_pRec.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81133), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66185)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_215_pRec.X8))) = store5(&_215_serial_type, _sqlite3VdbeSerialType(tls, _215_pRec, _215_file_format, &_215_len))
if (int32(_215_pRec.X1) & i32(16384)) == 0 {
goto _814
}
if _215_nData == 0 {
goto _815
}
if _sqlite3VdbeMemExpandBlob(tls, _215_pRec) != 0 {
goto _no_mem
}
goto _817
_815:
{
p := &_215_nZero
*p = (*p) + int64(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_215_pRec.X0))))))
sink6 = *p
}
{
p := &_215_len
*p = (*p) - uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_215_pRec.X0))))))
sink5 = *p
}
_817:
_814:
{
p := &_215_nData
*p = (*p) + uint64(_215_len)
sink17 = *p
}
{
p := &_215_nHdr
*p = (*p) + func() int32 {
if _215_serial_type <= uint32(i32(127)) {
return i32(1)
}
return _sqlite3VarintLen(tls, uint64(_215_serial_type))
}()
sink1 = *p
}
if _215_pRec == _215_pData0 {
goto _821
}
*(*uintptr)(unsafe.Pointer(&_215_pRec)) += uintptr(4294967248)
goto _811
_821:
if _215_nHdr <= i32(126) {
{
p := &_215_nHdr
*p = (*p) + i32(1)
sink1 = *p
}
goto _823
}
_215_nVarint = _sqlite3VarintLen(tls, uint64(_215_nHdr))
{
p := &_215_nHdr
*p = (*p) + _215_nVarint
sink1 = *p
}
if _215_nVarint < _sqlite3VarintLen(tls, uint64(_215_nHdr)) {
_215_nHdr += 1
}
_823:
_215_nByte = int64(uint64(_215_nHdr) + _215_nData)
if (_215_nByte + _215_nZero) > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
goto _too_big
}
if _sqlite3VdbeMemClearAndResize(tls, _pOut, int32(_215_nByte)) != 0 {
goto _no_mem
}
_215_zNewRecord = (*uint8)(unsafe.Pointer(_pOut.X5))
_215_i = int32(uint8(func() int32 {
if uint32(_215_nHdr) < u32(128) {
return func() int32 { *_215_zNewRecord = uint8(_215_nHdr); return i32(1) }()
}
return _sqlite3PutVarint(tls, _215_zNewRecord, uint64(_215_nHdr))
}()))
_215_j = _215_nHdr
func() {
if uintptr(unsafe.Pointer(_215_pData0)) > uintptr(unsafe.Pointer(_215_pLast)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81184), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66140)))
crt.X__builtin_abort(tls)
}
}()
_215_pRec = _215_pData0
_831:
_215_serial_type = _215_pRec.X8
{
p := &_215_i
*p = (*p) + int32(uint8(func() int32 {
if _215_serial_type < u32(128) {
return func() int32 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord)) + 1*uintptr(_215_i))) = uint8(_215_serial_type)
return i32(1)
}()
}
return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord))+1*uintptr(_215_i))), uint64(_215_serial_type))
}()))
sink1 = *p
}
{
p := &_215_j
*p = int32(uint32(*p) + _sqlite3VdbeSerialPut(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_215_zNewRecord))+1*uintptr(_215_j))), _215_pRec, _215_serial_type))
sink1 = *p
}
if uintptr(unsafe.Pointer(preInc20(&_215_pRec, 48))) <= uintptr(unsafe.Pointer(_215_pLast)) {
goto _831
}
func() {
if _215_i != _215_nHdr {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81195), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66202)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int64(_215_j) != _215_nByte {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81196), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66210)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81198), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = int32(_215_nByte)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(16))
if _215_nZero != 0 {
*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int32(_215_nZero)
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) | i32(16384))
sink14 = *p
}
}
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _pOut)
}
goto _250
_143:
func() {
if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))).X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66219)))
crt.X__builtin_abort(tls)
}
}()
_228_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))).X14))))))
func() {
if _228_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807)))
crt.X__builtin_abort(tls)
}
}()
_228_nEntry = int64(i32(0))
_rc = _sqlite3BtreeCount(tls, _228_pCrsr, &_228_nEntry)
if _rc != 0 {
goto _abort_due_to_error
}
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _228_nEntry
goto _250
_144:
_229_p1 = _pOp.X3
_229_zName = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if (*XSavepoint)(_db.X73) != nil && int32(_db.X15) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81255), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66262)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _229_p1 != i32(0) && _229_p1 != i32(1) && _229_p1 != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81256), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66301)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSavepoint)(_db.X73) == nil && int32(_db.X23) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81257), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66368)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _checkSavepointCount(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81258), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66416)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81259), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
if _229_p1 != i32(0) {
goto _862
}
if (_db.X36) > i32(0) {
_sqlite3VdbeError(tls, _p, str(66453))
_rc = i32(5)
goto _864
}
_229_nName = _sqlite3Strlen30(tls, _229_zName)
func() {
if int32(_db.X15) != i32(0) && (_db.X64) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66504)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VtabSavepoint(tls, _db, i32(0), (_db.X76)+(_db.X75))
if _rc != i32(0) {
goto _abort_due_to_error
}
_229_pNew = (*XSavepoint)(_sqlite3DbMallocRawNN(tls, _db, uint64((u32(24)+uint32(_229_nName))+uint32(i32(1)))))
if _229_pNew == nil {
goto _869
}
*(**int8)(unsafe.Pointer(&(_229_pNew.X0))) = (*int8)(unsafe.Pointer((*XSavepoint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_229_pNew)) + 24*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_229_pNew.X0), (unsafe.Pointer)(_229_zName), uint32(_229_nName+i32(1)))
if (_db.X15) != 0 {
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(1))
goto _871
}
*(*int32)(unsafe.Pointer(&(_db.X75))) += 1
_871:
*(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_229_pNew.X3))))) = (*XSavepoint)(_db.X73)
*(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = _229_pNew
*(*int64)(unsafe.Pointer(&(_229_pNew.X1))) = _db.X77
*(*int64)(unsafe.Pointer(&(_229_pNew.X2))) = _db.X78
_869:
_864:
goto _872
_862:
_229_iSavepoint = i32(0)
_229_pSavepoint = (*XSavepoint)(_db.X73)
_873:
if _229_pSavepoint == nil || _sqlite3StrICmp(tls, _229_pSavepoint.X0, _229_zName) == 0 {
goto _877
}
_229_iSavepoint += 1
_229_pSavepoint = (*XSavepoint)(_229_pSavepoint.X3)
goto _873
_877:
if _229_pSavepoint == nil {
_sqlite3VdbeError(tls, _p, str(66540), unsafe.Pointer(_229_zName))
_rc = i32(1)
goto _882
}
if ((_db.X36) > i32(0)) && (_229_p1 == i32(1)) {
_sqlite3VdbeError(tls, _p, str(66562))
_rc = i32(5)
goto _882
}
_240_isTransaction = bool2int(((*XSavepoint)(_229_pSavepoint.X3) == nil) && ((_db.X23) != 0))
if _240_isTransaction == 0 || _229_p1 != i32(1) {
goto _885
}
if store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(1))) != i32(0) {
goto _vdbe_return
}
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
if _sqlite3VdbeHalt(tls, _p) == i32(5) {
*(*int32)(unsafe.Pointer(&(_p.X9))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_p.X10))) = store1(&_rc, i32(5))
goto _vdbe_return
}
*(*uint8)(unsafe.Pointer(&(_db.X23))) = uint8(i32(0))
_rc = _p.X10
goto _888
_885:
_229_iSavepoint = ((_db.X75) - _229_iSavepoint) - i32(1)
if _229_p1 != i32(2) {
goto _889
}
_244_isSchemaChange = bool2int(((_db.X6) & i32(2)) != i32(0))
_229_ii = i32(0)
_890:
if _229_ii >= (_db.X5) {
goto _893
}
_rc = _sqlite3BtreeTripAllCursors(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_229_ii))).X1), i32(516), bool2int(_244_isSchemaChange == i32(0)))
if _rc != i32(0) {
goto _abort_due_to_error
}
_229_ii += 1
goto _890
_893:
goto _895
_889:
_244_isSchemaChange = i32(0)
_895:
_229_ii = i32(0)
_896:
if _229_ii >= (_db.X5) {
goto _899
}
_rc = _sqlite3BtreeSavepoint(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_229_ii))).X1), _229_p1, _229_iSavepoint)
if _rc != i32(0) {
goto _abort_due_to_error
}
_229_ii += 1
goto _896
_899:
if _244_isSchemaChange != 0 {
_sqlite3ExpirePreparedStatements(tls, _db)
_sqlite3ResetAllSchemasOfConnection(tls, _db)
*(*int32)(unsafe.Pointer(&(_db.X6))) = (_db.X6) | i32(2)
}
_888:
if (*XSavepoint)(_db.X73) != _229_pSavepoint {
_229_pTmp = (*XSavepoint)(_db.X73)
*(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_229_pTmp.X3)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_229_pTmp))
*(*int32)(unsafe.Pointer(&(_db.X75))) -= 1
goto _888
}
if _229_p1 != i32(1) {
goto _904
}
func() {
if _229_pSavepoint != (*XSavepoint)(_db.X73) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81387), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66616)))
crt.X__builtin_abort(tls)
}
}()
*(**XSavepoint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X73))))) = (*XSavepoint)(_229_pSavepoint.X3)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_229_pSavepoint))
if _240_isTransaction == 0 {
*(*int32)(unsafe.Pointer(&(_db.X75))) -= 1
}
goto _908
_904:
*(*int64)(unsafe.Pointer(&(_db.X77))) = _229_pSavepoint.X1
*(*int64)(unsafe.Pointer(&(_db.X78))) = _229_pSavepoint.X2
_908:
if _240_isTransaction != 0 && _229_p1 != i32(2) {
goto _910
}
_rc = _sqlite3VtabSavepoint(tls, _db, _229_p1, _229_iSavepoint)
if _rc != i32(0) {
goto _abort_due_to_error
}
_910:
_882:
_872:
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_145:
_256_desiredAutoCommit = _pOp.X3
_256_iRollback = _pOp.X4
func() {
if _256_desiredAutoCommit != i32(1) && _256_desiredAutoCommit != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81424), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66643)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _256_desiredAutoCommit != i32(1) && _256_iRollback != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81425), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66688)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X34) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81426), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66725)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81427), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
if _256_desiredAutoCommit == int32(_db.X15) {
goto _923
}
if _256_iRollback != 0 {
func() {
if _256_desiredAutoCommit != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66743)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3RollbackAll(tls, _db, i32(516))
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
goto _932
}
if _256_desiredAutoCommit != 0 && ((_db.X36) > i32(0)) {
_sqlite3VdbeError(tls, _p, str(66764))
_rc = i32(5)
goto _abort_due_to_error
}
if store1(&_rc, _sqlite3VdbeCheckFk(tls, _p, i32(1))) != i32(0) {
goto _vdbe_return
}
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(_256_desiredAutoCommit)
_932:
if _sqlite3VdbeHalt(tls, _p) == i32(5) {
*(*int32)(unsafe.Pointer(&(_p.X9))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1) - _256_desiredAutoCommit)
*(*int32)(unsafe.Pointer(&(_p.X10))) = store1(&_rc, i32(5))
goto _vdbe_return
}
func() {
if (_db.X76) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81453), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66819)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3CloseSavepoints(tls, _db)
if (_p.X10) == i32(0) {
_rc = i32(101)
goto _937
}
_rc = i32(1)
_937:
goto _vdbe_return
_923:
_sqlite3VdbeError(tls, _p, func() *int8 {
if _256_desiredAutoCommit == 0 {
return str(66837)
}
return func() *int8 {
if _256_iRollback != 0 {
return str(66885)
}
return str(66928)
}()
}())
_rc = i32(1)
goto _abort_due_to_error
_146:
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81512), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) && (_pOp.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81513), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66969)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81515), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X4) != 0 && (((_db.X6) & i32(67108864)) != i32(0)) {
_rc = i32(8)
goto _abort_due_to_error
}
_266_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X1)
if _266_pBt == nil {
goto _955
}
_rc = _sqlite3BtreeBeginTrans(tls, _266_pBt, _pOp.X4)
if _rc == i32(0) {
goto _956
}
if (_rc & i32(255)) == i32(5) {
*(*int32)(unsafe.Pointer(&(_p.X9))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(*int32)(unsafe.Pointer(&(_p.X10))) = _rc
goto _vdbe_return
}
goto _abort_due_to_error
_956:
if (_pOp.X4) == 0 || ((uint32((_p.X32)>>uint(i32(6)))<>uint(i32(31))) == 0 || int32(_db.X15) != i32(0) && (_db.X35) <= i32(1) {
goto _961
}
func() {
if _sqlite3BtreeIsInTrans(tls, _266_pBt) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81538), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67062)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X12) == i32(0) {
func() {
if (_db.X76) < i32(0) || (_db.X75) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81540), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67089)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_db.X76))) += 1
*(*int32)(unsafe.Pointer(&(_p.X12))) = (_db.X75) + (_db.X76)
}
_rc = _sqlite3VtabSavepoint(tls, _db, i32(0), (_p.X12)-i32(1))
if _rc == i32(0) {
_rc = _sqlite3BtreeBeginStmt(tls, _266_pBt, _p.X12)
}
*(*int64)(unsafe.Pointer(&(_p.X15))) = _db.X77
*(*int64)(unsafe.Pointer(&(_p.X16))) = _db.X78
_961:
_sqlite3BtreeGetMeta(tls, _266_pBt, i32(1), (*uint32)(unsafe.Pointer(&_266_iMeta)))
_266_iGen = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X4).X1
goto _969
_955:
_266_iGen = store1(&_266_iMeta, i32(0))
_969:
func() {
if int32(_pOp.X2) != i32(0) && int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81567), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67128)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X2) == 0 || _266_iMeta == (_pOp.X5) && _266_iGen == (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) {
goto _975
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p.X22))
*(**int8)(unsafe.Pointer(&(_p.X22))) = _sqlite3DbStrDup(tls, _db, str(59642))
if ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X4).X0) != _266_iMeta {
_sqlite3ResetOneSchema(tls, _db, _pOp.X3)
}
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
_rc = i32(17)
_975:
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_147:
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
_277_iDb = _pOp.X3
_277_iCookie = _pOp.X5
func() {
if (_pOp.X5) >= i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81614), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67164)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _277_iDb < i32(0) || _277_iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_277_iDb))).X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(60068)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_277_iDb))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81617), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeGetMeta(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_277_iDb))).X1), _277_iCookie, (*uint32)(unsafe.Pointer(&_277_iMeta)))
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_277_iMeta)
goto _250
_148:
func() {
if (_pOp.X4) >= i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67222)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_278_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3)))
func() {
if (*XBtree)(_278_pDb.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81642), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67265)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _pOp.X3, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67277)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_278_pDb.X1), _pOp.X4, uint32(_pOp.X5))
if (_pOp.X4) == i32(1) {
*(*int32)(unsafe.Pointer(&((*XSchema)(_278_pDb.X4).X0))) = _pOp.X5
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
goto _1004
}
if (_pOp.X4) == i32(2) {
*(*uint8)(unsafe.Pointer(&((*XSchema)(_278_pDb.X4).X7))) = uint8(_pOp.X5)
}
_1004:
if (_pOp.X3) == i32(1) {
_sqlite3ExpirePreparedStatements(tls, _db)
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0)
}
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_149:
func() {
if int32(_pOp.X2) != i32(0) && int32(_pOp.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67316)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81740), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67353)))
crt.X__builtin_abort(tls)
}
}()
_282_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
if (_282_pCur != nil) && ((_282_pCur.X17) == uint32(_pOp.X4)) {
func() {
if int32(_282_pCur.X1) != (_pOp.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67377)))
crt.X__builtin_abort(tls)
}
}()
goto _open_cursor_set_hints
}
_1013:
func() {
if int32(_pOp.X0) != i32(107) && int32(_pOp.X2) != i32(0) && int32(_pOp.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81751), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67396)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81752), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) != i32(106) && int32(_pOp.X0) != i32(105) && int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81753), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67462)))
crt.X__builtin_abort(tls)
}
}()
if ((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0 {
_rc = i32(516)
goto _abort_due_to_error
}
_282_nField = i32(0)
_282_pKeyInfo = nil
_282_p2 = _pOp.X4
_282_iDb = _pOp.X5
func() {
if _282_iDb < i32(0) || _282_iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_282_iDb))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81766), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192)))
crt.X__builtin_abort(tls)
}
}()
_282_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_282_iDb)))
_282_pX = (*XBtree)(_282_pDb.X1)
func() {
if _282_pX == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81769), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67534)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pOp.X0) != i32(107) {
goto _1034
}
i32(0)
_282_wrFlag = i32(4) | (int32(_pOp.X2) & i32(8))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _282_iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81773), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if int32((*XSchema)(_282_pDb.X4).X7) < int32(_p.X31) {
*(*uint8)(unsafe.Pointer(&(_p.X31))) = (*XSchema)(_282_pDb.X4).X7
}
goto _1038
_1034:
_282_wrFlag = i32(0)
_1038:
if (int32(_pOp.X2) & i32(16)) != 0 {
func() {
if _282_p2 <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81781), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67540)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _282_p2 > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67545)))
crt.X__builtin_abort(tls)
}
}()
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_282_p2)))
func() {
if (int32(_pIn2.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67574)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pIn2.X1) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81785), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67591)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemIntegerify(tls, _pIn2)
_282_p2 = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0))))))
func() {
if _282_p2 < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67618)))
crt.X__builtin_abort(tls)
}
}()
}
if int32(_pOp.X1) == i32(-5) {
_282_pKeyInfo = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
func() {
if int32(_282_pKeyInfo.X1) != int32(_db.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67624)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_282_pKeyInfo.X4) != _db {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81797), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67647)))
crt.X__builtin_abort(tls)
}
}()
_282_nField = int32(_282_pKeyInfo.X2) + int32(_282_pKeyInfo.X3)
goto _1056
}
if int32(_pOp.X1) == i32(-11) {
_282_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
}
_1056:
func() {
if (_pOp.X3) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81802), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _282_nField < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67675)))
crt.X__builtin_abort(tls)
}
}()
_282_pCur = _allocateCursor(tls, _p, _pOp.X3, _282_nField, _282_iDb, uint8(i32(0)))
if _282_pCur == nil {
goto _no_mem
}
*(*uint8)(unsafe.Pointer(&(_282_pCur.X2))) = uint8(i32(1))
storebits3((*int8)(unsafe.Pointer(&(_282_pCur.X7))), int8(i32(1)), 4, 2)
*(*uint32)(unsafe.Pointer(&(_282_pCur.X17))) = uint32(_282_p2)
*(*uint8)(unsafe.Pointer(&(_282_pCur.X6))) = uint8(_282_wrFlag)
_rc = _sqlite3BtreeCursor(tls, _282_pX, _282_p2, _282_wrFlag, _282_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_282_pCur.X14)))))))
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_282_pCur.X15))))) = _282_pKeyInfo
*(*uint8)(unsafe.Pointer(&(_282_pCur.X4))) = uint8(bool2int(int32(_pOp.X1) != i32(-5)))
_open_cursor_set_hints:
i32(0)
i32(0)
_sqlite3BtreeCursorHintFlags(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_282_pCur.X14)))))), uint32(int32(_pOp.X2)&i32(3)))
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_152:
_291_pOrig = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X4)))
func() {
if (*XBtree)(_291_pOrig.X8) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81847), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67685)))
crt.X__builtin_abort(tls)
}
}()
_291_pCx = _allocateCursor(tls, _p, _pOp.X3, int32(_291_pOrig.X18), i32(-1), uint8(i32(0)))
if _291_pCx == nil {
goto _no_mem
}
*(*uint8)(unsafe.Pointer(&(_291_pCx.X2))) = uint8(i32(1))
storebits3((*int8)(unsafe.Pointer(&(_291_pCx.X7))), int8(i32(1)), 1, 0)
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_291_pCx.X15))))) = (*XKeyInfo)(_291_pOrig.X15)
*(*uint8)(unsafe.Pointer(&(_291_pCx.X4))) = _291_pOrig.X4
_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_291_pOrig.X8), i32(1), i32(4), (*XKeyInfo)(_291_pCx.X15), (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_291_pCx.X14)))))))
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81860), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
goto _250
_153:
func() {
if (_pOp.X3) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81903), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67700)))
crt.X__builtin_abort(tls)
}
}()
_292_pCx = _allocateCursor(tls, _p, _pOp.X3, _pOp.X4, i32(-1), uint8(i32(0)))
if _292_pCx == nil {
goto _no_mem
}
*(*uint8)(unsafe.Pointer(&(_292_pCx.X2))) = uint8(i32(1))
storebits3((*int8)(unsafe.Pointer(&(_292_pCx.X7))), int8(i32(1)), 1, 0)
_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), nil, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_292_pCx.X8))))), i32(5)|int32(_pOp.X2), _sqlite3VdbeExecØ00vfsFlagsØ006)
if _rc == i32(0) {
_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_292_pCx.X8), i32(1))
}
if _rc != i32(0) {
goto _1074
}
if store50((**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_292_pCx.X15))))), store50(&_292_pKeyInfo, (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))) == nil {
goto _1075
}
func() {
if int32(_pOp.X1) != i32(-5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81921), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67353)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_292_pCx.X8), &_295_pgno, i32(2)|int32(_pOp.X2))
if _rc == i32(0) {
func() {
if _295_pgno != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81924), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67711)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_292_pKeyInfo.X4) != _db {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67647)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_292_pKeyInfo.X1) != int32(_db.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67624)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), _295_pgno, i32(4), _292_pKeyInfo, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_292_pCx.X14)))))))
}
*(*uint8)(unsafe.Pointer(&(_292_pCx.X4))) = uint8(i32(0))
goto _1085
_1075:
_rc = _sqlite3BtreeCursor(tls, (*XBtree)(_292_pCx.X8), i32(1), i32(4), nil, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_292_pCx.X14)))))))
*(*uint8)(unsafe.Pointer(&(_292_pCx.X4))) = uint8(i32(1))
_1085:
_1074:
if _rc != 0 {
goto _abort_due_to_error
}
storebits3((*int8)(unsafe.Pointer(&(_292_pCx.X7))), int8(bool2int(int32(_pOp.X2) != i32(8))), 4, 2)
goto _250
_155:
func() {
if (_pOp.X3) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81955), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81956), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67700)))
crt.X__builtin_abort(tls)
}
}()
_298_pCx = _allocateCursor(tls, _p, _pOp.X3, _pOp.X4, i32(-1), uint8(i32(1)))
if _298_pCx == nil {
goto _no_mem
}
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_298_pCx.X15))))) = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
func() {
if (*Xsqlite3)((*XKeyInfo)(_298_pCx.X15).X4) != _db {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67731)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XKeyInfo)(_298_pCx.X15).X1) != int32(_db.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81961), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67753)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeSorterInit(tls, _db, _pOp.X5, _298_pCx)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_156:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_299_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_299_pC.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(81978), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781)))
crt.X__builtin_abort(tls)
}
}()
if postInc6((*int64)(unsafe.Pointer(&(_299_pC.X9))), int64(1)) == int64(i32(0)) {
goto _jump_to_p2
}
goto _250
_157:
func() {
if (_pOp.X3) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82004), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67664)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82005), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67794)))
crt.X__builtin_abort(tls)
}
}()
_301_pCx = _allocateCursor(tls, _p, _pOp.X3, _pOp.X5, i32(-1), uint8(i32(3)))
if _301_pCx == nil {
goto _no_mem
}
*(*uint8)(unsafe.Pointer(&(_301_pCx.X2))) = uint8(i32(1))
*(*int32)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_301_pCx.X14))))) = _pOp.X4
*(*uint8)(unsafe.Pointer(&(_301_pCx.X4))) = uint8(i32(1))
func() {
if int32(_pOp.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67805)))
crt.X__builtin_abort(tls)
}
}()
goto _250
_158:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82021), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3))))
*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3))) = nil
goto _250
_159:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67816)))
crt.X__builtin_abort(tls)
}
}()
_303_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _303_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82148), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_303_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82149), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
i32(0)
func() {
if ((uint32((_303_pC.X7)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82153), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67827)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82154), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
_303_oc = int32(_pOp.X0)
_303_eqOnly = i32(0)
*(*uint8)(unsafe.Pointer(&(_303_pC.X2))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_303_pC.X5))) = _pOp.X0
if (_303_pC.X4) == 0 {
goto _1126
}
func() {
if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), uint32(i32(2))) != i32(0) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82164), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67859)))
crt.X__builtin_abort(tls)
}
}()
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if (int32(_pIn3.X1) & i32(14)) == i32(2) {
_applyNumericAffinity(tls, _pIn3, i32(0))
}
_303_iKey = _sqlite3VdbeIntValue(tls, _pIn3)
if (int32(_pIn3.X1) & i32(4)) != i32(0) {
goto _1131
}
if (int32(_pIn3.X1) & i32(8)) == i32(0) {
goto _jump_to_p2
}
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) >= float64(_303_iKey) {
goto _1133
}
i32(0)
i32(0)
i32(0)
if (_303_oc & i32(1)) == i32(1) {
_303_oc -= 1
}
goto _1136
_1133:
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) <= float64(_303_iKey) {
goto _1136
}
i32(0)
i32(0)
i32(0)
if (_303_oc & i32(1)) == i32(0) {
_303_oc += 1
}
_1136:
_1131:
_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), nil, int64(uint64(_303_iKey)), i32(0), &_303_res)
*(*int64)(unsafe.Pointer(&(_303_pC.X20))) = _303_iKey
if _rc != i32(0) {
goto _abort_due_to_error
}
goto _1139
_1126:
if _sqlite3BtreeCursorHasHint(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), uint32(i32(2))) != 0 {
_303_eqOnly = i32(1)
func() {
if int32(_pOp.X0) != i32(26) && int32(_pOp.X0) != i32(25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67933)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X0) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67982)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(1)))).X3) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(0)))).X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68033)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(1)))).X4) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(0)))).X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68054)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(1)))).X5) != ((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(0)))).X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82225), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68075)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(1)))).X6)))))) != (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(0)))).X6)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68096)))
crt.X__builtin_abort(tls)
}
}()
}
_303_nField = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82230), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _303_nField <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68143)))
crt.X__builtin_abort(tls)
}
}()
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_303_r.X0))))) = (*XKeyInfo)(_303_pC.X15)
*(*uint16)(unsafe.Pointer(&(_303_r.X2))) = uint16(_303_nField)
*(*int8)(unsafe.Pointer(&(_303_r.X3))) = int8(func() int32 {
if (i32(1) & (_303_oc - i32(24))) != 0 {
return i32(-1)
}
return i32(1)
}())
func() {
if _303_oc == i32(27) && int32(_303_r.X3) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82243), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68152)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _303_oc == i32(25) && int32(_303_r.X3) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82244), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68186)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _303_oc == i32(26) && int32(_303_r.X3) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82245), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68220)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _303_oc == i32(24) && int32(_303_r.X3) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82246), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68254)))
crt.X__builtin_abort(tls)
}
}()
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_303_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_313_i = i32(0)
_1173:
if _313_i >= int32(_303_r.X2) {
goto _1176
}
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr(_303_r.X1)+48*uintptr(_313_i))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82250), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68288)))
crt.X__builtin_abort(tls)
}
}()
_313_i += 1
goto _1173
_1176:
*(*uint8)(unsafe.Pointer(&(_303_r.X7))) = uint8(i32(0))
_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_r, int64(i32(0)), i32(0), &_303_res)
if _rc != i32(0) {
goto _abort_due_to_error
}
if _303_eqOnly != 0 && (int32(_303_r.X7) == i32(0)) {
func() {
if _303_res == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82258), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68311)))
crt.X__builtin_abort(tls)
}
}()
goto _seek_not_found
}
_1139:
*(*uint8)(unsafe.Pointer(&(_303_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_303_pC.X11))) = uint32(i32(0))
if _303_oc < i32(26) {
goto _1184
}
func() {
if _303_oc != i32(26) && _303_oc != i32(27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82267), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68318)))
crt.X__builtin_abort(tls)
}
}()
if _303_res >= i32(0) && (_303_res != i32(0) || _303_oc != i32(27)) {
goto _1190
}
_303_res = i32(0)
_rc = _sqlite3BtreeNext(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_res)
if _rc != i32(0) {
goto _abort_due_to_error
}
goto _1192
_1190:
_303_res = i32(0)
_1192:
goto _seek_not_found
_1184:
func() {
if _303_oc != i32(24) && _303_oc != i32(25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68349)))
crt.X__builtin_abort(tls)
}
}()
if _303_res <= i32(0) && (_303_res != i32(0) || _303_oc != i32(24)) {
goto _1199
}
_303_res = i32(0)
_rc = _sqlite3BtreePrevious(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))), &_303_res)
if _rc != i32(0) {
goto _abort_due_to_error
}
goto _1201
_1199:
_303_res = _sqlite3BtreeEof(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_303_pC.X14)))))))
_1201:
_seek_not_found:
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82289), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
if _303_res != 0 {
goto _jump_to_p2
}
if _303_eqOnly != 0 {
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X0) != i32(40) && int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(1)))).X0) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82294), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67982)))
crt.X__builtin_abort(tls)
}
}()
*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(24)
}
goto _250
_163:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82375), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82376), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121)))
crt.X__builtin_abort(tls)
}
}()
_324_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _324_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82378), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_324_pC.X5))) = _pOp.X0
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if int32(_324_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82383), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_324_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82384), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_324_pC.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68380)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) <= i32(0) {
goto _1223
}
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_324_r.X0))))) = (*XKeyInfo)(_324_pC.X15)
*(*uint16)(unsafe.Pointer(&(_324_r.X2))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_324_r.X1))))) = _pIn3
_324_ii = i32(0)
_1224:
if _324_ii >= int32(_324_r.X2) {
goto _1227
}
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+48*uintptr(_324_ii))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82392), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68395)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+48*uintptr(_324_ii))).X1)&i32(16384)) != i32(0) && ((*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+48*uintptr(_324_ii))).X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82393), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68419)))
crt.X__builtin_abort(tls)
}
}()
if _324_ii == 0 {
goto _1234
}
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, (_pOp.X5)+_324_ii, (*XMem)(unsafe.Pointer(uintptr(_324_r.X1)+48*uintptr(_324_ii))))
}
_1234:
_324_ii += 1
goto _1224
_1227:
_324_pIdxKey = &_324_r
_324_pFree = nil
goto _1235
_1223:
func() {
if (int32(_pIn3.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82400), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68471)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if (int32(_pIn3.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pIn3)
}
return i32(0)
}()
func() {
if _rc != i32(0) && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82402), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
if _rc != 0 {
goto _no_mem
}
_324_pFree = store51(&_324_pIdxKey, _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_324_pC.X15)))
if _324_pIdxKey == nil {
goto _no_mem
}
_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_324_pC.X15), _pIn3.X4, (unsafe.Pointer)(_pIn3.X5), _324_pIdxKey)
_1235:
*(*int8)(unsafe.Pointer(&(_324_pIdxKey.X3))) = int8(i32(0))
_324_takeJump = i32(0)
if int32(_pOp.X0) != i32(28) {
goto _1245
}
_324_ii = i32(0)
_1246:
if _324_ii >= int32(_324_pIdxKey.X2) {
goto _1249
}
if (int32((*XMem)(unsafe.Pointer(uintptr(_324_pIdxKey.X1)+48*uintptr(_324_ii))).X1) & i32(1)) != 0 {
_324_takeJump = i32(1)
goto _1249
}
_324_ii += 1
goto _1246
_1249:
_1245:
_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_324_pC.X14)))))), _324_pIdxKey, int64(i32(0)), i32(0), &_324_res)
if _324_pFree != nil {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_324_pFree))
}
if _rc != i32(0) {
goto _abort_due_to_error
}
*(*int32)(unsafe.Pointer(&(_324_pC.X12))) = _324_res
_324_alreadyExists = bool2int(_324_res == i32(0))
*(*uint8)(unsafe.Pointer(&(_324_pC.X2))) = uint8(i32(1) - _324_alreadyExists)
*(*uint8)(unsafe.Pointer(&(_324_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_324_pC.X11))) = uint32(i32(0))
if int32(_pOp.X0) != i32(30) {
goto _1253
}
if _324_alreadyExists != 0 {
goto _jump_to_p2
}
goto _1255
_1253:
if _324_takeJump != 0 || (_324_alreadyExists == 0) {
goto _jump_to_p2
}
_1255:
goto _250
_166:
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if (int32(_pIn3.X1) & i32(4)) != i32(0) {
goto _1258
}
_applyAffinity(tls, _pIn3, int8(i32(67)), _encoding)
if (int32(_pIn3.X1) & i32(4)) == i32(0) {
goto _jump_to_p2
}
_1258:
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if (int32(_pIn3.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63806)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82503), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_334_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _334_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82505), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_334_pC.X5))) = uint8(i32(0))
func() {
if (_334_pC.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82509), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68494)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_334_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82510), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
_334_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_334_pC.X14))))))
func() {
if _334_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82512), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68506)))
crt.X__builtin_abort(tls)
}
}()
_334_res = i32(0)
_334_iKey = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0))))))
_rc = _sqlite3BtreeMovetoUnpacked(tls, _334_pCrsr, nil, int64(_334_iKey), i32(0), &_334_res)
func() {
if _rc != i32(0) && _334_res != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82516), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68515)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_334_pC.X20))) = int64(_334_iKey)
*(*uint8)(unsafe.Pointer(&(_334_pC.X2))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_334_pC.X11))) = uint32(i32(0))
*(*uint8)(unsafe.Pointer(&(_334_pC.X3))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_334_pC.X12))) = _334_res
if _334_res == i32(0) {
goto _1276
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82524), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X4) == i32(0) {
_rc = _sqlite3CorruptError(tls, i32(82526))
goto _1280
}
goto _jump_to_p2
_1280:
_1276:
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_168:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82544), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82545), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65574)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))).X0) == i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82546), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68539)))
crt.X__builtin_abort(tls)
}
}()
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = postInc6((*int64)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))).X9))), int64(1))
goto _250
_169:
_340_v = int64(i32(0))
_340_res = i32(0)
_pOut = _out2Prerelease(tls, _p, _pOp)
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82579), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_340_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _340_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_340_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82582), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82583), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_340_pC.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82598), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68494)))
crt.X__builtin_abort(tls)
}
}()
if ((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 {
goto _1300
}
_rc = _sqlite3BtreeLast(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))), &_340_res)
if _rc != i32(0) {
goto _abort_due_to_error
}
if _340_res != 0 {
_340_v = int64(i32(1))
goto _1303
}
func() {
if _sqlite3BtreeCursorIsValid(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14))))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68581)))
crt.X__builtin_abort(tls)
}
}()
_340_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))))
if _340_v >= i64(9223372036854775807) {
storebits3((*int8)(unsafe.Pointer(&(_340_pC.X7))), int8(i32(1)), 2, 1)
goto _1307
}
_340_v += 1
_1307:
_1303:
_1300:
if (_pOp.X5) == 0 {
goto _1308
}
func() {
if (_pOp.X5) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82631), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012)))
crt.X__builtin_abort(tls)
}
}()
if (*XVdbeFrame)(_p.X38) == nil {
goto _1311
}
_340_pFrame = (*XVdbeFrame)(_p.X38)
_1312:
if (*XVdbeFrame)(_340_pFrame.X1) == nil {
goto _1315
}
_340_pFrame = (*XVdbeFrame)(_340_pFrame.X1)
goto _1312
_1315:
func() {
if (_pOp.X5) > (_340_pFrame.X13) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82635), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68623)))
crt.X__builtin_abort(tls)
}
}()
_340_pMem = (*XMem)(unsafe.Pointer(uintptr(_340_pFrame.X4) + 48*uintptr(_pOp.X5)))
goto _1318
_1311:
func() {
if (_pOp.X5) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63022)))
crt.X__builtin_abort(tls)
}
}()
_340_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_sqlite3VdbeMemAboutToChange(tls, _p, _340_pMem)
_1318:
func() {
if (int32(_340_pMem.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68645)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _340_pMem)
}
_sqlite3VdbeMemIntegerify(tls, _340_pMem)
func() {
if (int32(_340_pMem.X1) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82647), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68662)))
crt.X__builtin_abort(tls)
}
}()
if ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) == i64(9223372036854775807)) || (((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0) {
_rc = i32(13)
goto _abort_due_to_error
}
if _340_v < ((*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) + int64(i32(1))) {
_340_v = (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0)))))) + int64(i32(1))
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_340_pMem.X0))))) = _340_v
_1308:
if ((uint32((_340_pC.X7)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) == 0 {
goto _1329
}
func() {
if (_pOp.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82663), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68689)))
crt.X__builtin_abort(tls)
}
}()
_340_cnt = i32(0)
_1332:
Xsqlite3_randomness(tls, int32(u32(8)), (unsafe.Pointer)(&_340_v))
{
p := &_340_v
*p = (*p) & i64(4611686018427387903)
sink6 = *p
}
_340_v += 1
if ((store1(&_rc, _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_340_pC.X14)))))), nil, int64(uint64(_340_v)), i32(0), &_340_res)) == i32(0)) && (_340_res == i32(0))) && (preInc1(&_340_cnt, 1) < i32(100)) {
goto _1332
}
if _rc != 0 {
goto _abort_due_to_error
}
if _340_res == i32(0) {
_rc = i32(13)
goto _abort_due_to_error
}
func() {
if _340_v <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82678), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68700)))
crt.X__builtin_abort(tls)
}
}()
_1329:
*(*uint8)(unsafe.Pointer(&(_340_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_340_pC.X11))) = uint32(i32(0))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _340_v
goto _250
_170:
_356_op = i32(0)
_356_pData = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82743), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_356_pData.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82744), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68704)))
crt.X__builtin_abort(tls)
}
}()
_356_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _356_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_356_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82747), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_356_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82748), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pOp.X2)&i32(64)) == 0 && (_356_pC.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68722)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-15) && int32(_pOp.X1) < i32(-2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82750), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68763)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X4, _356_pData)
}
if int32(_pOp.X0) != i32(118) {
goto _1357
}
_356_pKey = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if (int32(_356_pKey.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82755), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68811)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_356_pKey.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82756), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68833)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _356_pKey)
}
*(*int64)(unsafe.Pointer(&(_356_x.X1))) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_356_pKey.X0)))))
goto _1363
_1357:
func() {
if int32(_pOp.X0) != i32(119) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82760), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68850)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_356_x.X1))) = int64(_pOp.X5)
_1363:
if (int32(_pOp.X1) == i32(-15)) && ((_db.X50) != nil) {
func() {
if int32(_356_pC.X1) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68876)))
crt.X__builtin_abort(tls)
}
}()
_356_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_356_pC.X1))).X0
_356_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
func() {
if (int32(_pOp.X2)&i32(64)) == 0 && ((_356_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82768), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68887)))
crt.X__builtin_abort(tls)
}
}()
_356_op = func() int32 {
if (int32(_pOp.X2) & i32(4)) != 0 {
return i32(23)
}
return i32(18)
}()
goto _1375
}
_356_pTab = nil
_356_zDb = nil
_1375:
if (int32(_pOp.X2) & i32(1)) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X11))) += 1
}
if (int32(_pOp.X2) & i32(32)) != 0 {
*(*int64)(unsafe.Pointer(&(_db.X7))) = _356_x.X1
}
if (int32(_356_pData.X1) & i32(1)) != 0 {
*(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X2))) = nil
*(*int32)(unsafe.Pointer(&(_356_x.X5))) = i32(0)
goto _1379
}
func() {
if (int32(_356_pData.X1) & i32(18)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68931)))
crt.X__builtin_abort(tls)
}
}()
*(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X2))) = (unsafe.Pointer)(_356_pData.X5)
*(*int32)(unsafe.Pointer(&(_356_x.X5))) = _356_pData.X4
_1379:
_356_seekResult = func() int32 {
if (int32(_pOp.X2) & i32(16)) != 0 {
return (_356_pC.X12)
}
return i32(0)
}()
if (int32(_356_pData.X1) & i32(16384)) != 0 {
*(*int32)(unsafe.Pointer(&(_356_x.X6))) = *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_356_pData.X0)))))
goto _1385
}
*(*int32)(unsafe.Pointer(&(_356_x.X6))) = i32(0)
_1385:
*(*unsafe.Pointer)(unsafe.Pointer(&(_356_x.X0))) = nil
_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_356_pC.X14)))))), &_356_x, int32(_pOp.X2)&i32(10), _356_seekResult)
*(*uint8)(unsafe.Pointer(&(_356_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_356_pC.X11))) = uint32(i32(0))
if _rc != 0 {
goto _abort_due_to_error
}
if ((_db.X50) != nil) && _356_op != 0 {
(_db.X50)(tls, _db.X49, _356_op, _356_zDb, _356_pTab.X0, _356_x.X1)
}
goto _250
_172:
_366_opflags = _pOp.X4
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82859), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_366_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _366_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82861), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_366_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82862), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82863), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_366_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pOp.X1) == i32(-15)) && ((((*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X9) & uint32(i32(32))) == uint32(i32(0)))) && (int32(_pOp.X2) == i32(0)) {
_367_iKey = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))))
func() {
if (_366_pC.X20) != _367_iKey {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82872), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68987)))
crt.X__builtin_abort(tls)
}
}()
}
if int32(_pOp.X1) != i32(-15) || (_db.X50) == nil {
goto _1406
}
func() {
if int32(_366_pC.X1) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82882), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68876)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82883), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69010)))
crt.X__builtin_abort(tls)
}
}()
_366_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_366_pC.X1))).X0
_366_pTab = (*XTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
if ((int32(_pOp.X2) & i32(2)) != i32(0)) && ((_366_pC.X4) != 0) {
*(*int64)(unsafe.Pointer(&(_366_pC.X20))) = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))))
}
goto _1413
_1406:
_366_zDb = nil
_366_pTab = nil
_1413:
func() {
if (int32(_pOp.X2) & i32(-7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82911), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69026)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
if (*XVdbeFrame)(_p.X38) != nil {
goto _1416
}
if ((int32((uint32(_366_pC.X7)<>uint(i32(31))) == i32(0)) && ((int32(_pOp.X2) & i32(4)) == i32(0))) && ((int32(_366_pC.X6) & i32(8)) == i32(0)) {
_nExtraDelete += 1
}
if ((_pOp.X4) & i32(1)) != 0 {
_nExtraDelete -= 1
}
_1416:
_rc = _sqlite3BtreeDelete(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_366_pC.X14)))))), uint8(_pOp.X2))
*(*uint32)(unsafe.Pointer(&(_366_pC.X11))) = uint32(i32(0))
*(*int32)(unsafe.Pointer(&(_366_pC.X12))) = i32(0)
if _rc != 0 {
goto _abort_due_to_error
}
if (_366_opflags & i32(1)) == 0 {
goto _1422
}
*(*int32)(unsafe.Pointer(&(_p.X11))) += 1
if ((_db.X50) != nil) && (((_366_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) {
(_db.X50)(tls, _db.X49, i32(9), _366_zDb, _366_pTab.X0, _366_pC.X20)
func() {
if int32(_366_pC.X1) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82940), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68876)))
crt.X__builtin_abort(tls)
}
}()
}
_1422:
goto _250
_173:
_sqlite3VdbeSetChanges(tls, _db, _p.X11)
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
goto _250
_174:
_377_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_377_pC.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82980), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(82981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121)))
crt.X__builtin_abort(tls)
}
}()
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_377_nKeyCol = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
_377_res = i32(0)
_rc = _sqlite3VdbeSorterCompare(tls, _377_pC, _pIn3, _377_nKeyCol, &_377_res)
if _rc != 0 {
goto _abort_due_to_error
}
if _377_res != 0 {
goto _jump_to_p2
}
goto _250
_175:
_pOut = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_378_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_378_pC.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeSorterRowkey(tls, _378_pC, _pOut)
func() {
if _rc == i32(0) && (int32(_pOut.X1)&i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69081)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
if _rc != 0 {
goto _abort_due_to_error
}
*(*uint32)(unsafe.Pointer(&((*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X5)))).X11))) = uint32(i32(0))
goto _250
_176:
_pOut = _out2Prerelease(tls, _p, _pOp)
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83053), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_379_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _379_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83055), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_379_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83056), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if bool2int(int32(_379_pC.X0) == i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83057), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69123)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_379_pC.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83058), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69139)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_379_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
_379_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_379_pC.X14))))))
func() {
if int32(_379_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83070), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeCursorIsValid(tls, _379_pCrsr) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83071), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65813)))
crt.X__builtin_abort(tls)
}
}()
_379_n = _sqlite3BtreePayloadSize(tls, _379_pCrsr)
if _379_n > uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
goto _too_big
}
_rc = _sqlite3VdbeMemFromBtree(tls, _379_pCrsr, uint32(i32(0)), _379_n, _pOut)
if _rc != 0 {
goto _abort_due_to_error
}
if (_pOp.X5) != 0 {
goto _1463
}
if ((int32(_pOut.X1) & i32(4096)) != i32(0)) && _sqlite3VdbeMemMakeWriteable(tls, _pOut) != 0 {
goto _no_mem
}
_1463:
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X4, _pOut)
}
goto _250
_177:
_pOut = _out2Prerelease(tls, _p, _pOp)
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83107), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_382_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _382_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_382_pC.X0) == i32(3) && (_382_pC.X2) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83110), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65642)))
crt.X__builtin_abort(tls)
}
}()
if (_382_pC.X2) != 0 {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1))
goto _250
}
if (_382_pC.X3) != 0 {
_382_v = _382_pC.X20
goto _1483
}
if int32(_382_pC.X0) != i32(2) {
goto _1477
}
func() {
if (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83118), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69154)))
crt.X__builtin_abort(tls)
}
}()
_382_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))).X0)
_382_pModule = (*Xsqlite3_module)(_382_pVtab.X0)
func() {
if (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int64) int32
}{(_382_pModule.X12)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83121), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69170)))
crt.X__builtin_abort(tls)
}
}()
_rc = (*(*func(*crt.TLS, *Xsqlite3_file, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int64) int32
}{(_382_pModule.X12)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))), &_382_v)
_sqlite3VtabImportErrmsg(tls, _p, _382_pVtab)
if _rc != 0 {
goto _abort_due_to_error
}
goto _1483
_1477:
func() {
if int32(_382_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83127), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83128), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeCursorRestore(tls, _382_pC)
if _rc != 0 {
goto _abort_due_to_error
}
if (_382_pC.X2) != 0 {
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1))
goto _250
}
_382_v = _sqlite3BtreeIntegerKey(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_382_pC.X14)))))))
_1483:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _382_v
goto _250
_178:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83150), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_388_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _388_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83152), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_388_pC.X2))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&(_388_pC.X11))) = uint32(i32(0))
if int32(_388_pC.X0) == i32(0) {
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_388_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83156), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeClearCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_388_pC.X14)))))))
}
goto _250
_179:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_390_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _390_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83188), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_390_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83189), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
_390_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_390_pC.X14))))))
_390_res = i32(0)
func() {
if _390_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83192), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68506)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_390_pC.X12))) = _pOp.X5
*(*uint8)(unsafe.Pointer(&(_390_pC.X5))) = uint8(i32(33))
if (_pOp.X5) != i32(0) && _sqlite3BtreeCursorIsValidNN(tls, _390_pCrsr) != 0 {
goto _1508
}
_rc = _sqlite3BtreeLast(tls, _390_pCrsr, &_390_res)
*(*uint8)(unsafe.Pointer(&(_390_pC.X2))) = uint8(_390_res)
*(*uint8)(unsafe.Pointer(&(_390_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_390_pC.X11))) = uint32(i32(0))
if _rc != 0 {
goto _abort_due_to_error
}
if (_pOp.X4) <= i32(0) {
goto _1510
}
if _390_res != 0 {
goto _jump_to_p2
}
_1510:
goto _1512
_1508:
func() {
if (_pOp.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83208), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69186)))
crt.X__builtin_abort(tls)
}
}()
_1512:
goto _250
_180:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_394_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _394_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
_394_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_394_pC.X14))))))
func() {
if _394_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83228), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeFirst(tls, _394_pCrsr, &_394_res)
if _rc != 0 {
goto _abort_due_to_error
}
if _394_res != i32(0) {
goto _1523
}
_394_sz = _sqlite3BtreeRowCountEst(tls, _394_pCrsr)
if func() int32 {
if _394_sz >= int64(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83233), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && (int32(_sqlite3LogEst(tls, uint64(_394_sz))) < (_pOp.X5)) {
_394_res = i32(1)
}
_1523:
if _394_res != 0 {
goto _jump_to_p2
}
goto _250
_181:
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(2)))) += 1
_183:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_397_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _397_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83290), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_397_pC.X0) == i32(1)) != (int32(_pOp.X0) == i32(35)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83291), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69197)))
crt.X__builtin_abort(tls)
}
}()
_397_res = i32(1)
*(*uint8)(unsafe.Pointer(&(_397_pC.X5))) = uint8(i32(37))
if int32(_397_pC.X0) == i32(1) {
_rc = _sqlite3VdbeSorterRewind(tls, _397_pC, &_397_res)
goto _1537
}
func() {
if int32(_397_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83299), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
_397_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_397_pC.X14))))))
func() {
if _397_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83301), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65807)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeFirst(tls, _397_pCrsr, &_397_res)
*(*uint8)(unsafe.Pointer(&(_397_pC.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_397_pC.X11))) = uint32(i32(0))
_1537:
if _rc != 0 {
goto _abort_due_to_error
}
*(*uint8)(unsafe.Pointer(&(_397_pC.X2))) = uint8(_397_res)
func() {
if (_pOp.X4) <= i32(0) || (_pOp.X4) >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69240)))
crt.X__builtin_abort(tls)
}
}()
if _397_res != 0 {
goto _jump_to_p2
}
goto _250
_184:
_400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_400_pC.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67781)))
crt.X__builtin_abort(tls)
}
}()
_400_res = i32(0)
_rc = _sqlite3VdbeSorterNext(tls, _db, _400_pC, &_400_res)
goto _next_tail
_185:
if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))) == nil {
goto _250
}
_1549:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83399), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X2) >= i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83400), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69268)))
crt.X__builtin_abort(tls)
}
}()
_400_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
_400_res = _pOp.X5
func() {
if _400_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83403), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_400_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_400_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83405), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _400_res != i32(0) && (_400_res != i32(1) || int32(_400_pC.X4) != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83406), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69299)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(7) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{_sqlite3BtreeNext})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83408), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69336)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(6) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{_sqlite3BtreePrevious})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83409), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69395)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(5) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{_sqlite3BtreeNext})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83410), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69458)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(4) && *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{(*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *XBtCursor, *int32) int32
}{_sqlite3BtreePrevious})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83411), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69523)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(7) && int32(_pOp.X0) == i32(5) && int32(_400_pC.X5) != i32(27) && int32(_400_pC.X5) != i32(26) && int32(_400_pC.X5) != i32(37) && int32(_400_pC.X5) != i32(30) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83415), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69592)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X0) == i32(6) && int32(_pOp.X0) == i32(4) && int32(_400_pC.X5) != i32(24) && int32(_400_pC.X5) != i32(25) && int32(_400_pC.X5) != i32(33) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83418), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69742)))
crt.X__builtin_abort(tls)
}
}()
_rc = (*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))})))(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_400_pC.X14)))))), &_400_res)
_next_tail:
*(*uint32)(unsafe.Pointer(&(_400_pC.X11))) = uint32(i32(0))
if _rc != 0 {
goto _abort_due_to_error
}
if _400_res == i32(0) {
*(*uint8)(unsafe.Pointer(&(_400_pC.X2))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(_pOp.X2))) += 1
goto _jump_to_p2_and_check_for_interrupt
}
*(*uint8)(unsafe.Pointer(&(_400_pC.X2))) = uint8(i32(1))
goto _check_for_interrupt
_189:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83480), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_403_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _403_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83482), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_403_pC.X0) == i32(1)) != (int32(_pOp.X0) == i32(127)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83483), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69866)))
crt.X__builtin_abort(tls)
}
}()
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
func() {
if (int32(_pIn2.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83485), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69911)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pOp.X2) & i32(1)) != 0 {
*(*int32)(unsafe.Pointer(&(_p.X11))) += 1
}
func() {
if int32(_403_pC.X0) != i32(0) && int32(_pOp.X0) != i32(127) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83487), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69934)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_403_pC.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83488), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68380)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if (int32(_pIn2.X1) & i32(16384)) != 0 {
return _sqlite3VdbeMemExpandBlob(tls, _pIn2)
}
return i32(0)
}()
if _rc != 0 {
goto _abort_due_to_error
}
if int32(_pOp.X0) == i32(127) {
_rc = _sqlite3VdbeSorterWrite(tls, _403_pC, _pIn2)
goto _1612
}
*(*int64)(unsafe.Pointer(&(_403_x.X1))) = int64(_pIn2.X4)
*(*unsafe.Pointer)(unsafe.Pointer(&(_403_x.X0))) = (unsafe.Pointer)(_pIn2.X5)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_403_x.X3))))) = (*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_aMem)) + uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(_pOp.X5)))))*uintptr(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr(48)))))))))))
*(*uint16)(unsafe.Pointer(&(_403_x.X4))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_rc = _sqlite3BtreeInsert(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_403_pC.X14)))))), &_403_x, int32(_pOp.X2)&i32(10), func() int32 {
if (int32(_pOp.X2) & i32(16)) != 0 {
return (_403_pC.X12)
}
return i32(0)
}())
func() {
if int32(_403_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_403_pC.X11))) = uint32(i32(0))
_1612:
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_191:
func() {
if (_pOp.X5) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83522), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63012)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) <= i32(0) || ((_pOp.X4)+(_pOp.X5)) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83523), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(69994)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83524), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_406_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _406_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83526), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_406_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83527), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
_406_pCrsr = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_406_pC.X14))))))
func() {
if _406_pCrsr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83529), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68506)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83530), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67805)))
crt.X__builtin_abort(tls)
}
}()
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_406_r.X0))))) = (*XKeyInfo)(_406_pC.X15)
*(*uint16)(unsafe.Pointer(&(_406_r.X2))) = uint16(_pOp.X5)
*(*int8)(unsafe.Pointer(&(_406_r.X3))) = int8(i32(0))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_406_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_rc = _sqlite3BtreeMovetoUnpacked(tls, _406_pCrsr, &_406_r, int64(i32(0)), i32(0), &_406_res)
if _rc != 0 {
goto _abort_due_to_error
}
if _406_res != i32(0) {
goto _1635
}
_rc = _sqlite3BtreeDelete(tls, _406_pCrsr, uint8(i32(4)))
if _rc != 0 {
goto _abort_due_to_error
}
_1635:
func() {
if int32(_406_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83541), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_406_pC.X11))) = uint32(i32(0))
*(*int32)(unsafe.Pointer(&(_406_pC.X12))) = i32(0)
goto _250
_192:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_408_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _408_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83583), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_408_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83584), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83585), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_408_pC.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83586), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68380)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_408_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_408_pC.X2) != 0 && int32(_pOp.X0) != i32(131) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83588), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70051)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeCursorRestore(tls, _408_pC)
if func() int32 {
if _rc != i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _abort_due_to_error
}
if (_408_pC.X2) != 0 {
goto _1658
}
_408_rowid = int64(i32(0))
_rc = _sqlite3VdbeIdxRowid(tls, _db, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pC.X14)))))), &_408_rowid)
if _rc != i32(0) {
goto _abort_due_to_error
}
if int32(_pOp.X0) == i32(130) {
func() {
if (_pOp.X5) < i32(0) || (_pOp.X5) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83606), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70092)))
crt.X__builtin_abort(tls)
}
}()
_408_pTabCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X5)))
func() {
if _408_pTabCur == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83608), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70125)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_408_pTabCur.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70136)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_408_pTabCur.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83610), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70169)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_408_pTabCur.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70192)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_408_pTabCur.X2))) = uint8(i32(0))
*(*int64)(unsafe.Pointer(&(_408_pTabCur.X20))) = _408_rowid
*(*uint8)(unsafe.Pointer(&(_408_pTabCur.X3))) = uint8(i32(1))
func() {
if int32(_pOp.X1) != i32(-12) && (*(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70209)))
crt.X__builtin_abort(tls)
}
}()
*(**int32)(unsafe.Pointer(&(_408_pTabCur.X10))) = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
*(**XVdbeCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_408_pTabCur.X13))))) = _408_pC
goto _1675
}
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _408_rowid
_1675:
goto _1676
_1658:
func() {
if int32(_pOp.X0) != i32(131) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83623), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70251)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetNull(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))))
_1676:
goto _250
_194:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83681), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_414_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _414_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32((_414_pC.X7)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83684), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67827)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_414_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83685), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_414_pC.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83686), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_414_pC.X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83687), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X2) != i32(0) && int32(_pOp.X2) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83688), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70276)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83689), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121)))
crt.X__builtin_abort(tls)
}
}()
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_414_r.X0))))) = (*XKeyInfo)(_414_pC.X15)
*(*uint16)(unsafe.Pointer(&(_414_r.X2))) = uint16(*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
if int32(_pOp.X0) < i32(40) {
func() {
if int32(_pOp.X0) != i32(38) && int32(_pOp.X0) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83693), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70301)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(&(_414_r.X3))) = int8(i32(-1))
goto _1701
}
func() {
if int32(_pOp.X0) != i32(41) && int32(_pOp.X0) != i32(40) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83696), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70348)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(&(_414_r.X3))) = int8(i32(0))
_1701:
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_414_r.X1))))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_417_i = i32(0)
_1705:
if _417_i >= int32(_414_r.X2) {
goto _1708
}
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr(_414_r.X1)+48*uintptr(_417_i))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68288)))
crt.X__builtin_abort(tls)
}
}()
_417_i += 1
goto _1705
_1708:
_414_res = i32(0)
_rc = _sqlite3VdbeIdxKeyCompare(tls, _db, _414_pC, &_414_r, &_414_res)
i32(0)
if (int32(_pOp.X0) & i32(1)) == i32(0) {
func() {
if int32(_pOp.X0) != i32(38) && int32(_pOp.X0) != i32(40) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83707), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70395)))
crt.X__builtin_abort(tls)
}
}()
_414_res = -_414_res
goto _1715
}
func() {
if int32(_pOp.X0) != i32(41) && int32(_pOp.X0) != i32(39) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83710), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70442)))
crt.X__builtin_abort(tls)
}
}()
_414_res += 1
_1715:
if _rc != 0 {
goto _abort_due_to_error
}
if _414_res > i32(0) {
goto _jump_to_p2
}
goto _250
_198:
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83750), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83751), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70489)))
crt.X__builtin_abort(tls)
}
}()
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(1))
if (_db.X35) > ((_db.X38) + i32(1)) {
_rc = i32(6)
*(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(i32(2))
goto _abort_due_to_error
}
_420_iDb = _pOp.X5
func() {
if ((_p.X33) & (u32(1) << uint(_420_iDb))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83760), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67192)))
crt.X__builtin_abort(tls)
}
}()
_420_iMoved = i32(0)
_rc = _sqlite3BtreeDropTable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_420_iDb))).X1), _pOp.X3, &_420_iMoved)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_420_iMoved)
if _rc != 0 {
goto _abort_due_to_error
}
if _420_iMoved != i32(0) {
_sqlite3RootPageMoved(tls, _db, _420_iDb, _420_iMoved, _pOp.X3)
func() {
if int32(_resetSchemaOnFault) != i32(0) && int32(_resetSchemaOnFault) != (_420_iDb+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83770), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70499)))
crt.X__builtin_abort(tls)
}
}()
_resetSchemaOnFault = uint8(_420_iDb + i32(1))
}
goto _250
_199:
_424_nChange = i32(0)
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_pOp.X4))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70550)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeClearTable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_pOp.X4))).X1), _pOp.X3, func() *int32 {
if (_pOp.X5) != 0 {
return &_424_nChange
}
return nil
}())
if (_pOp.X5) == 0 {
goto _1740
}
{
p := (*int32)(unsafe.Pointer(&(_p.X11)))
*p = (*p) + _424_nChange
sink1 = *p
}
if (_pOp.X5) > i32(0) {
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63056)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))))
{
p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5))).X0)))))
*p = (*p) + int64(_424_nChange)
sink6 = *p
}
}
_1740:
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_200:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83828), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65541)))
crt.X__builtin_abort(tls)
}
}()
_427_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if _427_pC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83830), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65595)))
crt.X__builtin_abort(tls)
}
}()
if int32(_427_pC.X0) == i32(1) {
_sqlite3VdbeSorterReset(tls, _db, (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_427_pC.X14)))))))
goto _1751
}
func() {
if int32(_427_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83834), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((uint32(_427_pC.X7) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83835), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70584)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeClearTableOfCursor(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_427_pC.X14)))))))
if _rc != 0 {
goto _abort_due_to_error
}
_1751:
goto _250
_201:
_pOut = _out2Prerelease(tls, _p, _pOp)
_430_pgno = i32(0)
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83874), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83875), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83876), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_430_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3)))
func() {
if (*XBtree)(_430_pDb.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83878), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67265)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pOp.X0) == i32(137) {
_430_flags = i32(1)
goto _1767
}
_430_flags = i32(2)
_1767:
_rc = _sqlite3BtreeCreateTable(tls, (*XBtree)(_430_pDb.X1), &_430_pgno, _430_flags)
if _rc != 0 {
goto _abort_due_to_error
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_430_pgno)
goto _250
_203:
*(*uint8)(unsafe.Pointer(&(_db.X26))) += 1
_rc = Xsqlite3_exec(tls, _db, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), nil, nil, nil)
*(*uint8)(unsafe.Pointer(&(_db.X26))) -= 1
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_204:
_434_iDb = i32(0)
_1770:
if _434_iDb >= (_db.X5) {
goto _1773
}
func() {
if _434_iDb != i32(1) && _sqlite3BtreeHoldsMutex(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_434_iDb))).X1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83923), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(49956)))
crt.X__builtin_abort(tls)
}
}()
_434_iDb += 1
goto _1770
_1773:
_434_iDb = _pOp.X3
func() {
if _434_iDb < i32(0) || _434_iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83928), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_434_iDb))).X4).X9) & i32(1)) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83929), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70600)))
crt.X__builtin_abort(tls)
}
}()
_434_zMaster = str(50026)
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_434_initData.X0))))) = _db
*(*int32)(unsafe.Pointer(&(_434_initData.X2))) = _pOp.X3
*(***int8)(unsafe.Pointer(&(_434_initData.X1))) = (**int8)(unsafe.Pointer(&(_p.X22)))
_434_zSql = _sqlite3MPrintf(tls, _db, str(70640), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_434_iDb))).X0), unsafe.Pointer(_434_zMaster), unsafe.Pointer(*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
if _434_zSql == nil {
_rc = _sqlite3NomemError(tls, i32(83939))
goto _1783
}
func() {
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83941), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(49896)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_434_initData.X3))) = i32(0)
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83944), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
_rc = Xsqlite3_exec(tls, _db, _434_zSql, _sqlite3InitCallback, (unsafe.Pointer)(&_434_initData), nil)
if _rc == i32(0) {
_rc = _434_initData.X3
}
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_434_zSql))
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X2))) = uint8(i32(0))
_1783:
if _rc == 0 {
goto _1789
}
_sqlite3ResetAllSchemasOfConnection(tls, _db)
if _rc == i32(7) {
goto _no_mem
}
goto _abort_due_to_error
_1789:
goto _250
_205:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(83969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3AnalysisLoad(tls, _db, _pOp.X3)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_206:
_sqlite3UnlinkAndDeleteTable(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _250
_207:
_sqlite3UnlinkAndDeleteIndex(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _250
_208:
_sqlite3UnlinkAndDeleteTrigger(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
goto _250
_209:
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84043), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
_445_nRoot = _pOp.X4
_445_aRoot = *(**int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if _445_nRoot <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70704)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_445_aRoot)) + 4*uintptr(_445_nRoot)))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84047), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70712)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84048), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
_445_pnErr = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if (int32(_445_pnErr.X1) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84050), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70728)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_445_pnErr.X1) & i32(18)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84051), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70756)))
crt.X__builtin_abort(tls)
}
}()
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if int32(_pOp.X2) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84053), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70795)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(int32(_pOp.X2)))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84054), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70811)))
crt.X__builtin_abort(tls)
}
}()
_445_z = _sqlite3BtreeIntegrityCheck(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_pOp.X2))).X1), _445_aRoot, _445_nRoot, int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_445_pnErr.X0))))))+i32(1), &_445_nErr)
_sqlite3VdbeMemSetNull(tls, _pIn1)
if _445_nErr == i32(0) {
func() {
if _445_z != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70845)))
crt.X__builtin_abort(tls)
}
}()
goto _1817
}
if _445_z == nil {
goto _no_mem
}
{
p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_445_pnErr.X0)))))
*p = (*p) - int64(_445_nErr-i32(1))
sink6 = *p
}
_sqlite3VdbeMemSetStr(tls, _pIn1, _445_z, i32(-1), uint8(i32(1)), Xsqlite3_free)
_1817:
_sqlite3VdbeChangeEncoding(tls, _pIn1, int32(_encoding))
goto _250
_210:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
func() {
if (int32(_pIn2.X1) & i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84083), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67591)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pIn1.X1) & i32(32)) != i32(0) {
goto _1820
}
_sqlite3VdbeMemSetRowSet(tls, _pIn1)
if (int32(_pIn1.X1) & i32(32)) == i32(0) {
goto _no_mem
}
_1820:
_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0))))))
goto _250
_211:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
if ((int32(_pIn1.X1) & i32(32)) == i32(0)) || (_sqlite3RowSetNext(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), &_451_val) == i32(0)) {
_sqlite3VdbeMemSetNull(tls, _pIn1)
goto _jump_to_p2_and_check_for_interrupt
}
_sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X5))), _451_val)
goto _check_for_interrupt
_212:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_454_iSet = *(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
func() {
if (int32(_pIn3.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84149), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70850)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pIn1.X1) & i32(32)) != i32(0) {
goto _1827
}
_sqlite3VdbeMemSetRowSet(tls, _pIn1)
if (int32(_pIn1.X1) & i32(32)) == i32(0) {
goto _no_mem
}
_1827:
func() {
if int32(_pOp.X1) != i32(-11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84159), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(68121)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _454_iSet != i32(-1) && _454_iSet < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70870)))
crt.X__builtin_abort(tls)
}
}()
if _454_iSet == 0 {
goto _1834
}
_454_exists = _sqlite3RowSetTest(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), _454_iSet, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0))))))
if _454_exists != 0 {
goto _jump_to_p2
}
_1834:
if _454_iSet >= i32(0) {
_sqlite3RowSetInsert(tls, (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0))))))
}
goto _250
_213:
_458_pProgram = (*XSubProgram)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_458_pRt = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
func() {
if (_458_pProgram.X1) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84202), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70890)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X2) == 0 {
goto _1839
}
_458_t = _458_pProgram.X5
_458_pFrame = (*XVdbeFrame)(_p.X38)
_1840:
if _458_pFrame == nil || (_458_pFrame.X7) == _458_t {
goto _1844
}
_458_pFrame = (*XVdbeFrame)(_458_pFrame.X1)
goto _1840
_1844:
if _458_pFrame != nil {
goto _250
}
_1839:
if (_p.X40) >= (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(10))))) {
_rc = i32(1)
_sqlite3VdbeError(tls, _p, str(70906))
goto _abort_due_to_error
}
if (int32(_458_pRt.X1) & i32(64)) != i32(0) {
goto _1847
}
_458_nMem = (_458_pProgram.X2) + (_458_pProgram.X3)
func() {
if _458_nMem <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70943)))
crt.X__builtin_abort(tls)
}
}()
if (_458_pProgram.X3) == i32(0) {
_458_nMem += 1
}
_458_nByte = int32(((u32(80) + (uint32(_458_nMem) * u32(48))) + (uint32(_458_pProgram.X3) * u32(4))) + uint32(((_458_pProgram.X1)+i32(7))/i32(8)))
_458_pFrame = (*XVdbeFrame)(_sqlite3DbMallocZero(tls, _db, uint64(_458_nByte)))
if _458_pFrame == nil {
goto _no_mem
}
_sqlite3VdbeMemRelease(tls, _458_pRt)
*(*uint16)(unsafe.Pointer(&(_458_pRt.X1))) = uint16(i32(64))
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_458_pRt.X0))))))) = _458_pFrame
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X0))))) = _p
*(*int32)(unsafe.Pointer(&(_458_pFrame.X14))) = _458_nMem
*(*int32)(unsafe.Pointer(&(_458_pFrame.X15))) = _458_pProgram.X3
*(*int32)(unsafe.Pointer(&(_458_pFrame.X11))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X4))))) = (*XMem)(_p.X18)
*(*int32)(unsafe.Pointer(&(_458_pFrame.X13))) = _p.X6
*(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X5))))) = (**XVdbeCursor)(unsafe.Pointer(_p.X23))
*(*int32)(unsafe.Pointer(&(_458_pFrame.X10))) = _p.X7
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X2))))) = (*XVdbeOp)(_p.X17)
*(*int32)(unsafe.Pointer(&(_458_pFrame.X12))) = _p.X27
*(*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X7))) = _458_pProgram.X5
_458_pEnd = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame))+1*uintptr(u32(80)))))) + 48*uintptr(_458_pFrame.X14)))
_458_pMem = (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame)) + 1*uintptr(u32(80))))))
_1852:
if _458_pMem == _458_pEnd {
goto _1855
}
*(*uint16)(unsafe.Pointer(&(_458_pMem.X1))) = uint16(i32(128))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pMem.X9))))) = _db
*(*uintptr)(unsafe.Pointer(&_458_pMem)) += uintptr(48)
goto _1852
_1855:
goto _1856
_1847:
_458_pFrame = (*XVdbeFrame)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_458_pRt.X0))))))
func() {
if ((_458_pProgram.X2)+(_458_pProgram.X3)) != (_458_pFrame.X14) && ((_458_pProgram.X3) != i32(0) || ((_458_pProgram.X2)+i32(1)) != (_458_pFrame.X14)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84274), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(70950)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_458_pProgram.X3) != (_458_pFrame.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71061)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24) != (_458_pFrame.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84277), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71095)))
crt.X__builtin_abort(tls)
}
}()
_1856:
*(*int32)(unsafe.Pointer(&(_p.X40))) += 1
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X1))))) = (*XVdbeFrame)(_p.X38)
*(*int64)(unsafe.Pointer(&(_458_pFrame.X8))) = _db.X7
*(*int32)(unsafe.Pointer(&(_458_pFrame.X16))) = _p.X11
*(*int32)(unsafe.Pointer(&(_458_pFrame.X17))) = (*Xsqlite3)(_p.X0).X29
func() {
if (*XAuxData)(_458_pFrame.X9) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84285), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71124)))
crt.X__builtin_abort(tls)
}
}()
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_458_pFrame.X9))))) = (*XAuxData)(_p.X43)
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X43))))) = nil
*(*int32)(unsafe.Pointer(&(_p.X11))) = i32(0)
*(**XVdbeFrame)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X38))))) = _458_pFrame
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = store20(&_aMem, (*XMem)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_458_pFrame))+1*uintptr(u32(80)))))))
*(*int32)(unsafe.Pointer(&(_p.X6))) = _458_pFrame.X14
*(*int32)(unsafe.Pointer(&(_p.X7))) = int32(uint16(_458_pFrame.X15))
*(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X23))))) = (**XVdbeCursor)(unsafe.Pointer((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_p.X6)))))
*(**uint8)(unsafe.Pointer(&(_458_pFrame.X6))) = (*uint8)(unsafe.Pointer((**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_458_pProgram.X3)))))
crt.Xmemset(tls, (unsafe.Pointer)(_458_pFrame.X6), i32(0), uint32(((_458_pProgram.X1)+i32(7))/i32(8)))
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = store40(&_aOp, (*XVdbeOp)(_458_pProgram.X0))
*(*int32)(unsafe.Pointer(&(_p.X27))) = _458_pProgram.X1
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 24*uintptr(i32(-1))))
goto _250
_214:
_pOut = _out2Prerelease(tls, _p, _pOp)
_465_pFrame = (*XVdbeFrame)(_p.X38)
_465_pIn = (*XMem)(unsafe.Pointer(uintptr(_465_pFrame.X4) + 48*uintptr((_pOp.X3)+((*XVdbeOp)(unsafe.Pointer(uintptr(_465_pFrame.X2)+24*uintptr(_465_pFrame.X11))).X3))))
_sqlite3VdbeMemShallowCopy(tls, _pOut, _465_pIn, i32(4096))
goto _250
_215:
if ((_db.X6) & i32(33554432)) != 0 {
{
p := (*int64)(unsafe.Pointer(&(_db.X78)))
*p = (*p) + int64(_pOp.X4)
sink6 = *p
}
goto _1870
}
if (_pOp.X3) != 0 {
{
p := (*int64)(unsafe.Pointer(&(_db.X77)))
*p = (*p) + int64(_pOp.X4)
sink6 = *p
}
goto _1870
}
{
p := (*int64)(unsafe.Pointer(&(_p.X14)))
*p = (*p) + int64(_pOp.X4)
sink6 = *p
}
_1870:
goto _250
_216:
if (_pOp.X3) == 0 {
goto _1871
}
if ((_db.X77) == int64(i32(0))) && ((_db.X78) == int64(i32(0))) {
goto _jump_to_p2
}
goto _1874
_1871:
if ((_p.X14) == int64(i32(0))) && ((_db.X78) == int64(i32(0))) {
goto _jump_to_p2
}
_1874:
goto _250
_217:
if (*XVdbeFrame)(_p.X38) == nil {
goto _1877
}
_473_pFrame = (*XVdbeFrame)(_p.X38)
_1878:
if (*XVdbeFrame)(_473_pFrame.X1) == nil {
goto _1881
}
_473_pFrame = (*XVdbeFrame)(_473_pFrame.X1)
goto _1878
_1881:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr(_473_pFrame.X4) + 48*uintptr(_pOp.X3)))
goto _1882
_1877:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_1882:
func() {
if (int32(_pIn1.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84394), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64072)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemIntegerify(tls, _pIn1)
_pIn2 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemIntegerify(tls, _pIn2)
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))) {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn2.X0)))))
}
goto _250
_218:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_pIn1.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > int64(i32(0)) {
{
p := (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))
*p = (*p) - int64(_pOp.X5)
sink6 = *p
}
goto _jump_to_p2
}
goto _250
_219:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
_pIn3 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_pOut = _out2Prerelease(tls, _p, _pOp)
func() {
if (int32(_pIn1.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84449), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71164)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pIn3.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84450), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63806)))
crt.X__builtin_abort(tls)
}
}()
_479_x = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))
if (_479_x <= int64(i32(0))) || _sqlite3AddInt64(tls, &_479_x, func() int64 {
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0)))))) > int64(i32(0)) {
return (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn3.X0))))))
}
return int64(i32(0))
}()) != 0 {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(i32(-1))
goto _1897
}
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = _479_x
_1897:
goto _250
_220:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_pIn1.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) == 0 {
goto _1900
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > int64(i32(0)) {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) -= 1
}
goto _jump_to_p2
_1900:
goto _250
_221:
_pIn1 = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_pIn1.X1) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84494), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71144)))
crt.X__builtin_abort(tls)
}
}()
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) > i64(-9223372036854775808) {
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0))))) -= 1
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pIn1.X0)))))) == int64(i32(0)) {
goto _jump_to_p2
}
goto _250
_222:
func() {
if int32(_pOp.X1) != i32(-4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84534), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64417)))
crt.X__builtin_abort(tls)
}
}()
_485_n = int32(_pOp.X2)
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _485_n != i32(0) && ((_pOp.X4) <= i32(0) || ((_pOp.X4)+_485_n) > ((((_p.X6)+i32(1))-(_p.X7))+i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64488)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) >= (_pOp.X4) && (_pOp.X5) < ((_pOp.X4)+_485_n) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84538), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64549)))
crt.X__builtin_abort(tls)
}
}()
_485_pCtx = (*Xsqlite3_context)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(32)+(uint32(_485_n-i32(1))*u32(4)))))
if _485_pCtx == nil {
goto _no_mem
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X2))))) = nil
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X1))))) = (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(*int32)(unsafe.Pointer(&(_485_pCtx.X4))) = int32((uintptr(unsafe.Pointer(_pOp)) - uintptr(unsafe.Pointer(_aOp))) / 24)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_485_pCtx.X3))))) = _p
*(*uint8)(unsafe.Pointer(&(_485_pCtx.X8))) = uint8(_485_n)
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-16))
*(**Xsqlite3_context)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _485_pCtx
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(151))
_223:
func() {
if int32(_pOp.X1) != i32(-16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84557), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64587)))
crt.X__builtin_abort(tls)
}
}()
_486_pCtx = (*Xsqlite3_context)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_486_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
if (*XMem)(_486_pCtx.X2) == _486_pMem {
goto _1921
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X2))))) = _486_pMem
_486_i = int32(_486_pCtx.X8) - i32(1)
_1922:
if _486_i < i32(0) {
goto _1925
}
*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 4*uintptr(_486_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr((_pOp.X4)+_486_i)))
_486_i -= 1
goto _1922
_1925:
_1921:
_486_i = i32(0)
_1926:
if _486_i >= int32(_486_pCtx.X8) {
goto _1929
}
func() {
if (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 4*uintptr(_486_i)))).X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84572), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64611)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, (_pOp.X4)+_486_i, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))) + 4*uintptr(_486_i))))
}
_486_i += 1
goto _1926
_1929:
*(*int32)(unsafe.Pointer(&(_486_pMem.X4))) += 1
_sqlite3VdbeMemInit(tls, &_486_t, _db, uint16(i32(1)))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X0))))) = &_486_t
*(*uint8)(unsafe.Pointer(&(_486_pCtx.X7))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_486_pCtx.X6))) = uint8(i32(0))
(*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
}{((*XFuncDef)(_486_pCtx.X1).X4)})))(tls, _486_pCtx, int32(_486_pCtx.X8), (**XMem)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_486_pCtx.X9))))))
if (_486_pCtx.X7) == 0 {
goto _1933
}
if (_486_pCtx.X5) != 0 {
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, &_486_t)))
_rc = _486_pCtx.X5
}
_sqlite3VdbeMemRelease(tls, &_486_t)
if _rc != 0 {
goto _abort_due_to_error
}
goto _1936
_1933:
func() {
if int32(_486_t.X1) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71186)))
crt.X__builtin_abort(tls)
}
}()
_1936:
if (_486_pCtx.X6) == 0 {
goto _1939
}
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X0) != i32(68) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84594), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71204)))
crt.X__builtin_abort(tls)
}
}()
_486_i = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(-1)))).X3
if _486_i != 0 {
_sqlite3VdbeMemSetInt64(tls, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_486_i))), int64(i32(1)))
}
_1939:
goto _250
_224:
func() {
if (_pOp.X3) <= i32(0) || (_pOp.X3) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(63149)))
crt.X__builtin_abort(tls)
}
}()
_493_pMem = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (int32(_493_pMem.X1) & i32(-8194)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71231)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeMemFinalize(tls, _493_pMem, (*XFuncDef)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))))
if _rc != 0 {
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, _493_pMem)))
goto _abort_due_to_error
}
_sqlite3VdbeChangeEncoding(tls, _493_pMem, int32(_encoding))
if _sqlite3VdbeMemTooBig(tls, _493_pMem) != 0 {
goto _too_big
}
goto _250
_225:
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(0)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(1)))) = store1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(2)))), i32(-1))
func() {
if (_pOp.X4) != i32(0) && (_pOp.X4) != i32(1) && (_pOp.X4) != i32(2) && (_pOp.X4) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84652), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71270)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3Checkpoint(tls, _db, _pOp.X3, _pOp.X4, (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(1)))), (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes))+4*uintptr(i32(2)))))
if _rc == 0 {
goto _1957
}
if _rc != i32(5) {
goto _abort_due_to_error
}
_rc = i32(0)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(i32(0)))) = i32(1)
_1957:
*func() **XMem { _496_i = i32(0); return &_496_pMem }() = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_1959:
if _496_i >= i32(3) {
goto _1962
}
_sqlite3VdbeMemSetInt64(tls, _496_pMem, int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_496_aRes)) + 4*uintptr(_496_i)))))
*(*uintptr)(unsafe.Pointer(func() **XMem { _496_i += 1; return &_496_pMem }())) += uintptr(48)
goto _1959
_1962:
goto _250
_226:
_pOut = _out2Prerelease(tls, _p, _pOp)
_499_eNew = _pOp.X5
func() {
if _499_eNew != i32(0) && _499_eNew != i32(3) && _499_eNew != i32(1) && _499_eNew != i32(2) && _499_eNew != i32(4) && _499_eNew != i32(5) && _499_eNew != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84693), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71417)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84702), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_499_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X1)
_499_pPager = _sqlite3BtreePager(tls, _499_pBt)
_499_eOld = _sqlite3PagerGetJournalMode(tls, _499_pPager)
if _499_eNew == i32(-1) {
_499_eNew = _499_eOld
}
if _sqlite3PagerOkToChangeJournalMode(tls, _499_pPager) == 0 {
_499_eNew = _499_eOld
}
_499_zFilename = _sqlite3PagerFilename(tls, _499_pPager, i32(1))
if (_499_eNew == i32(5)) && ((_sqlite3Strlen30(tls, _499_zFilename) == i32(0)) || (_sqlite3PagerWalSupported(tls, _499_pPager) == 0)) {
_499_eNew = _499_eOld
}
if _499_eNew == _499_eOld || _499_eOld != i32(5) && _499_eNew != i32(5) {
goto _1983
}
if ((_db.X15) == 0) || ((_db.X35) > i32(1)) {
_rc = i32(1)
_sqlite3VdbeError(tls, _p, str(71648), unsafe.Pointer(func() *int8 {
if _499_eNew == i32(5) {
return str(71700)
}
return str(71705)
}()))
goto _abort_due_to_error
}
if _499_eOld != i32(5) {
goto _1989
}
_rc = _sqlite3PagerCloseWal(tls, _499_pPager, _db)
if _rc == i32(0) {
_sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
}
goto _1992
_1989:
if _499_eOld == i32(4) {
_sqlite3PagerSetJournalMode(tls, _499_pPager, i32(2))
}
_1992:
func() {
if _sqlite3BtreeIsInTrans(tls, _499_pBt) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71712)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(0) {
_rc = _sqlite3BtreeSetVersion(tls, _499_pBt, func() int32 {
if _499_eNew == i32(5) {
return i32(2)
}
return i32(1)
}())
}
_1983:
if _rc != 0 {
_499_eNew = _499_eOld
}
_499_eNew = _sqlite3PagerSetJournalMode(tls, _499_pPager, _499_eNew)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(2562))
*(**int8)(unsafe.Pointer(&(_pOut.X5))) = _sqlite3JournalModename(tls, _499_eNew)
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = _sqlite3Strlen30(tls, _pOut.X5)
*(*uint8)(unsafe.Pointer(&(_pOut.X2))) = uint8(i32(1))
_sqlite3VdbeChangeEncoding(tls, _pOut, int32(_encoding))
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_227:
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84782), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3RunVacuum(tls, (**int8)(unsafe.Pointer(&(_p.X22))), _db, _pOp.X3)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_228:
func() {
if (_pOp.X3) < i32(0) || (_pOp.X3) >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_pOp.X3))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84800), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67028)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_509_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X1)
_rc = _sqlite3BtreeIncrVacuum(tls, _509_pBt)
if _rc == 0 {
goto _2010
}
if _rc != i32(101) {
goto _abort_due_to_error
}
_rc = i32(0)
goto _jump_to_p2
_2010:
goto _250
_229:
if (_pOp.X3) == 0 {
_sqlite3ExpirePreparedStatements(tls, _db)
goto _2013
}
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
_2013:
goto _250
_230:
_514_isWriteLock = uint8(_pOp.X5)
if _514_isWriteLock == 0 && i32(0) != ((_db.X6)&i32(16384)) {
goto _2015
}
_515_p1 = _pOp.X3
func() {
if _515_p1 < i32(0) || _515_p1 >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71742)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X33) & (u32(1) << uint(_515_p1))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84854), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71762)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_514_isWriteLock) != i32(0) && int32(_514_isWriteLock) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84855), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71791)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeLockTable(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_515_p1))).X1), _pOp.X4, _514_isWriteLock)
if _rc == 0 {
goto _2024
}
if (_rc & i32(255)) == i32(6) {
_517_z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))
_sqlite3VdbeError(tls, _p, str(71824), unsafe.Pointer(_517_z))
}
goto _abort_due_to_error
_2024:
_2015:
goto _250
_231:
_518_pVTab = (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
_rc = _sqlite3VtabBegin(tls, _db, _518_pVTab)
if _518_pVTab != nil {
_sqlite3VtabImportErrmsg(tls, _p, (*Xsqlite3_vtab)(_518_pVTab.X2))
}
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_232:
crt.Xmemset(tls, (unsafe.Pointer)(&_519_sMem), i32(0), u32(48))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_519_sMem.X9))))) = _db
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))).X1) & i32(2)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84903), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71853)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))).X1) & i32(2048)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84904), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71888)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeMemCopy(tls, &_519_sMem, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOp.X4))))
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_519_zTab = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, &_519_sMem)))
func() {
if _519_zTab == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84908), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71926)))
crt.X__builtin_abort(tls)
}
}()
if _519_zTab != nil {
_rc = _sqlite3VtabCallCreate(tls, _db, _pOp.X3, _519_zTab, (**int8)(unsafe.Pointer(&(_p.X22))))
}
_sqlite3VdbeMemRelease(tls, &_519_sMem)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_233:
*(*int32)(unsafe.Pointer(&(_db.X38))) += 1
_rc = _sqlite3VtabCallDestroy(tls, _db, _pOp.X3, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(*int32)(unsafe.Pointer(&(_db.X38))) -= 1
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_234:
func() {
if ((uint32((_p.X32)>>uint(i32(8))) << uint(i32(31))) >> uint(i32(31))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84946), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(66440)))
crt.X__builtin_abort(tls)
}
}()
_522_pCur = nil
_522_pVCur = nil
_522_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2)
if (_522_pVtab == nil) || func() int32 {
if (*Xsqlite3_module)(_522_pVtab.X0) == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84950), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_rc = i32(6)
goto _abort_due_to_error
}
_522_pModule = (*Xsqlite3_module)(_522_pVtab.X0)
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, **Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
}{(_522_pModule.X6)})))(tls, _522_pVtab, &_522_pVCur)
_sqlite3VtabImportErrmsg(tls, _p, _522_pVtab)
if _rc != 0 {
goto _abort_due_to_error
}
*(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_522_pVCur.X0))))) = _522_pVtab
_522_pCur = _allocateCursor(tls, _p, _pOp.X3, i32(0), i32(-1), uint8(i32(2)))
if _522_pCur != nil {
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_522_pCur.X14))))))) = _522_pVCur
*(*int32)(unsafe.Pointer(&(_522_pVtab.X1))) += 1
goto _2048
}
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(84968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_522_pModule.X7)})))(tls, _522_pVCur)
goto _no_mem
_2048:
goto _250
_235:
_526_pQuery = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_526_pArgc = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_pQuery)) + 48*uintptr(i32(1))))
_526_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if (int32(_526_pQuery.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71951)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _526_pQuery)
}
func() {
if int32(_526_pCur.X0) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85014), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71970)))
crt.X__builtin_abort(tls)
}
}()
_526_pVCur = (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_526_pCur.X14))))))
_526_pVtab = (*Xsqlite3_vtab)(_526_pVCur.X0)
_526_pModule = (*Xsqlite3_module)(_526_pVtab.X0)
func() {
if (int32(_526_pQuery.X1)&i32(4)) == i32(0) || int32(_526_pArgc.X1) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85020), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71999)))
crt.X__builtin_abort(tls)
}
}()
_526_nArg = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_526_pArgc.X0))))))
_526_iQuery = int32(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_526_pQuery.X0))))))
_526_res = i32(0)
_526_apArg = (**XMem)(unsafe.Pointer(_p.X19))
_526_i = i32(0)
_2059:
if _526_i >= _526_nArg {
goto _2062
}
*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_apArg)) + 4*uintptr(_526_i))) = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_526_pArgc)) + 48*uintptr(_526_i+i32(1))))
_526_i += 1
goto _2059
_2062:
_rc = (*(*func(*crt.TLS, *Xsqlite3_file, int32, *int8, int32, **XMem) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32
}{(_526_pModule.X8)})))(tls, _526_pVCur, _526_iQuery, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), _526_nArg, _526_apArg)
_sqlite3VtabImportErrmsg(tls, _p, _526_pVtab)
if _rc != 0 {
goto _abort_due_to_error
}
_526_res = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_526_pModule.X10)})))(tls, _526_pVCur)
*(*uint8)(unsafe.Pointer(&(_526_pCur.X2))) = uint8(i32(0))
if _526_res != 0 {
goto _jump_to_p2
}
goto _250
_236:
_528_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_528_pCur.X0) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85056), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71970)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X5) <= i32(0) || (_pOp.X5) > (((_p.X6)+i32(1))-(_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85057), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(64441)))
crt.X__builtin_abort(tls)
}
}()
_528_pDest = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_sqlite3VdbeMemAboutToChange(tls, _p, _528_pDest)
if (_528_pCur.X2) != 0 {
_sqlite3VdbeMemSetNull(tls, _528_pDest)
goto _250
}
_528_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_528_pCur.X14)))))).X0)
_528_pModule = (*Xsqlite3_module)(_528_pVtab.X0)
func() {
if (*(*func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32
}{(_528_pModule.X11)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85066), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72051)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_528_sContext), i32(0), u32(32))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_528_sContext.X0))))) = _528_pDest
*(*uint16)(unsafe.Pointer(&(_528_pDest.X1))) = uint16((int32(_528_pDest.X1) & i32(-49664)) | i32(1))
_rc = (*(*func(*crt.TLS, *Xsqlite3_file, *Xsqlite3_context, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32
}{(_528_pModule.X11)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_528_pCur.X14)))))), &_528_sContext, _pOp.X4)
_sqlite3VtabImportErrmsg(tls, _p, _528_pVtab)
if (_528_sContext.X5) != 0 {
_rc = _528_sContext.X5
}
_sqlite3VdbeChangeEncoding(tls, _528_pDest, int32(_encoding))
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X5, _528_pDest)
}
if _sqlite3VdbeMemTooBig(tls, _528_pDest) != 0 {
goto _too_big
}
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_237:
_532_res = i32(0)
_532_pCur = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_pOp.X3)))
func() {
if int32(_532_pCur.X0) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85102), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(71970)))
crt.X__builtin_abort(tls)
}
}()
if (_532_pCur.X2) != 0 {
goto _250
}
_532_pVtab = (*Xsqlite3_vtab)((*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14)))))).X0)
_532_pModule = (*Xsqlite3_module)(_532_pVtab.X0)
func() {
if (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_532_pModule.X9)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85108), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72068)))
crt.X__builtin_abort(tls)
}
}()
_rc = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_532_pModule.X9)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14)))))))
_sqlite3VtabImportErrmsg(tls, _p, _532_pVtab)
if _rc != 0 {
goto _abort_due_to_error
}
_532_res = (*(*func(*crt.TLS, *Xsqlite3_file) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_532_pModule.X10)})))(tls, (*Xsqlite3_file)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_532_pCur.X14)))))))
if _532_res == 0 {
goto _jump_to_p2_and_check_for_interrupt
}
goto _check_for_interrupt
_238:
_535_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2)
_535_pName = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X3)))
func() {
if (*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8) int32
}{((*Xsqlite3_module)(_535_pVtab.X0).X19)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85142), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72083)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_535_pName.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85143), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72107)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85144), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) != 0 {
_registerTrace(tls, _pOp.X3, _535_pName)
}
func() {
if (int32(_535_pName.X1) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72125)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3VdbeChangeEncoding(tls, _535_pName, i32(1))
if _rc != 0 {
goto _abort_due_to_error
}
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8) int32
}{((*Xsqlite3_module)(_535_pVtab.X0).X19)})))(tls, _535_pVtab, _535_pName.X5)
_sqlite3VtabImportErrmsg(tls, _p, _535_pVtab)
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0)
if _rc != 0 {
goto _abort_due_to_error
}
goto _250
_239:
func() {
if (_pOp.X4) != i32(1) && int32(_pOp.X2) != i32(3) && int32(_pOp.X2) != i32(1) && int32(_pOp.X2) != i32(2) && int32(_pOp.X2) != i32(4) && int32(_pOp.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72148)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32((_p.X32)>>uint(i32(7)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85200), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(67250)))
crt.X__builtin_abort(tls)
}
}()
_536_pVtab = (*Xsqlite3_vtab)((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X2)
if (_536_pVtab == nil) || func() int32 {
if (*Xsqlite3_module)(_536_pVtab.X0) == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85202), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_rc = i32(6)
goto _abort_due_to_error
}
_536_pModule = (*Xsqlite3_module)(_536_pVtab.X0)
_536_nArg = _pOp.X4
func() {
if int32(_pOp.X1) != i32(-8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85208), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72269)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
}{(_536_pModule.X13)}))) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85209), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _2112
}
_538_vtabOnConflict = _db.X22
_536_apArg = (**XMem)(unsafe.Pointer(_p.X19))
_536_pX = (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem)) + 48*uintptr(_pOp.X5)))
_536_i = i32(0)
_2113:
if _536_i >= _536_nArg {
goto _2116
}
func() {
if (int32(_536_pX.X1) & i32(128)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85214), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72290)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemAboutToChange(tls, _p, _536_pX)
*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 4*uintptr(_536_i))) = _536_pX
*(*uintptr)(unsafe.Pointer(&_536_pX)) += uintptr(48)
_536_i += 1
goto _2113
_2116:
*(*uint8)(unsafe.Pointer(&(_db.X22))) = uint8(_pOp.X2)
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
}{(_536_pModule.X13)})))(tls, _536_pVtab, _536_nArg, _536_apArg, &_536_rowid)
*(*uint8)(unsafe.Pointer(&(_db.X22))) = _538_vtabOnConflict
_sqlite3VtabImportErrmsg(tls, _p, _536_pVtab)
if (_rc == i32(0)) && (_pOp.X3) != 0 {
func() {
if _536_nArg <= i32(1) || (*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 4*uintptr(i32(0))))) == nil || (int32((*(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_536_apArg)) + 4*uintptr(i32(0))))).X1)&i32(1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85224), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72305)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_db.X7))) = _536_rowid
}
if (_rc&i32(255)) != i32(19) || ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))).X4) == 0 {
goto _2126
}
if int32(_pOp.X2) == i32(4) {
_rc = i32(0)
goto _2128
}
*(*uint8)(unsafe.Pointer(&(_p.X30))) = uint8(func() int32 {
if int32(_pOp.X2) == i32(5) {
return i32(2)
}
return int32(_pOp.X2)
}())
_2128:
goto _2131
_2126:
*(*int32)(unsafe.Pointer(&(_p.X11))) += 1
_2131:
if _rc != 0 {
goto _abort_due_to_error
}
_2112:
goto _250
_240:
_pOut = _out2Prerelease(tls, _p, _pOp)
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_sqlite3BtreeLastPage(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_pOp.X3))).X1)))
goto _250
_241:
_pOut = _out2Prerelease(tls, _p, _pOp)
_546_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_pOp.X3))).X1)
_546_newMax = uint32(i32(0))
if (_pOp.X5) == 0 {
goto _2133
}
_546_newMax = _sqlite3BtreeLastPage(tls, _546_pBt)
if _546_newMax < uint32(_pOp.X5) {
_546_newMax = uint32(_pOp.X5)
}
_2133:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pOut.X0))))) = int64(_sqlite3BtreeMaxPageCount(tls, _546_pBt, int32(_546_newMax)))
goto _250
_242:
func() {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil && crt.Xstrncmp(tls, *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))), str(72354), uint32(i32(3))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85309), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72358)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pOp != (*XVdbeOp)(_p.X17) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85310), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72409)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_db.X24)&i32(129)) == i32(0) || ((uint32((_p.X32)>>uint(i32(1)))<>uint(i32(31))) != 0 || store0(&_548_zTrace, func() *int8 {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil {
return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
}
return (_p.X36)
}()) == nil {
goto _2144
}
if (int32(_db.X24) & i32(128)) != 0 {
_550_x = *(*func(*crt.TLS, unsafe.Pointer, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
}{(_db.X41)}))
_550_z = _sqlite3VdbeExpandSql(tls, _p, _548_zTrace)
_550_x(tls, _db.X42, _550_z)
Xsqlite3_free(tls, (unsafe.Pointer)(_550_z))
goto _2148
}
if (_db.X37) > i32(1) {
_551_z = _sqlite3MPrintf(tls, _db, str(72421), unsafe.Pointer(_548_zTrace))
(_db.X41)(tls, uint32(i32(1)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(_551_z))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_551_z))
goto _2148
}
(_db.X41)(tls, uint32(i32(1)), _db.X42, (unsafe.Pointer)(_p), (unsafe.Pointer)(_548_zTrace))
_2148:
_2144:
if (((_db.X6) & i32(512)) != i32(0)) && (store0(&_548_zTrace, func() *int8 {
if (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6)))))) != nil {
return (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
}
return (_p.X36)
}()) != nil) {
_sqlite3DebugPrintf(tls, str(72427), unsafe.Pointer(_548_zTrace))
}
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85351), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
if (_pOp.X3) < (_sqlite3Config.X39) {
goto _2155
}
_548_i = i32(1)
_2156:
if _548_i >= (_p.X27) {
goto _2159
}
if int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_548_i))).X0) == i32(20) {
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_548_i))).X3))) = i32(0)
}
_548_i += 1
goto _2156
_2159:
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = i32(0)
_2155:
*(*int32)(unsafe.Pointer(&(_pOp.X3))) += 1
goto _jump_to_p2
_243:
func() {
if int32(_pOp.X0) != i32(164) && int32(_pOp.X0) != i32(165) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85397), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72442)))
crt.X__builtin_abort(tls)
}
}()
goto _250
_250:
func() {
if uintptr(unsafe.Pointer(_pOp)) < uintptr(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+24*uintptr(i32(-1)))))) || uintptr(unsafe.Pointer(_pOp)) >= uintptr(unsafe.Pointer((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+24*uintptr((_p.X27)-i32(1)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85423), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72490)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(1)) == 0 {
goto _2167
}
_557_opProperty = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOrigOp.X0)))
if _rc != i32(0) {
crt.Xprintf(tls, str(72526), _rc)
}
if (int32(_557_opProperty) & i32(16)) != 0 {
_registerTrace(tls, _pOrigOp.X4, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOrigOp.X4))))
}
if (int32(_557_opProperty) & i32(32)) != 0 {
_registerTrace(tls, _pOrigOp.X5, (*XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aMem))+48*uintptr(_pOrigOp.X5))))
}
_2167:
*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(24)
goto _30
_abort_due_to_error:
if (_db.X17) != 0 {
_rc = _sqlite3NomemError(tls, i32(85444))
}
func() {
if _rc == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85445), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72533)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X22) == nil) && (_rc != i32(3082)) {
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
}
*(*int32)(unsafe.Pointer(&(_p.X10))) = _rc
_sqlite3SystemError(tls, _db, _rc)
Xsqlite3_log(tls, _rc, str(72536), int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer(_aOp)))/24), unsafe.Pointer(_p.X36), unsafe.Pointer(_p.X22))
_sqlite3VdbeHalt(tls, _p)
if _rc == i32(3082) {
_sqlite3OomFault(tls, _db)
}
_rc = i32(1)
if int32(_resetSchemaOnFault) > i32(0) {
_sqlite3ResetOneSchema(tls, _db, int32(_resetSchemaOnFault)-i32(1))
}
_vdbe_return:
{
p := (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_p.X35))))) + 4*uintptr(i32(4))))
*p = (*p) + uint32(int32(_nVmStep))
sink5 = *p
}
_sqlite3VdbeLeave(tls, _p)
func() {
if _rc == i32(0) && _nExtraDelete != i32(0) && Xsqlite3_strlike(tls, str(72568), _p.X36, uint32(i32(0))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85468), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72576)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_too_big:
_sqlite3VdbeError(tls, _p, str(6810))
_rc = i32(18)
goto _abort_due_to_error
_no_mem:
_sqlite3OomFault(tls, _db)
_sqlite3VdbeError(tls, _p, str(59419))
_rc = _sqlite3NomemError(tls, i32(85486))
goto _abort_due_to_error
_abort_due_to_interrupt:
func() {
if (*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57)))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85493), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExecØ00__func__Ø000))), unsafe.Pointer(str(72652)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if (_db.X17) != 0 {
return _sqlite3NomemError(tls, i32(85494))
}
return i32(9)
}()
*(*int32)(unsafe.Pointer(&(_p.X10))) = _rc
_sqlite3VdbeError(tls, _p, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
goto _abort_due_to_error
_ = _94_uA
_ = _179_sMem
_ = _303_r
_ = _324_r
_ = _340_cnt
_ = _356_x
_ = _403_x
_ = _406_r
_ = _414_r
_ = _434_initData
_ = _486_t
_ = _496_aRes
_ = _519_sMem
_ = _528_sContext
panic(0)
}
var _sqlite3VdbeExecØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeExecØ00__func__Ø000[0], str(72673), 16)
}
// Print the SQL that was used to generate a VDBE program.
func _sqlite3VdbePrintSql(tls *crt.TLS, _p *TVdbe) {
var _z *int8
var _2_pOp *XVdbeOp
_z = nil
if (_p.X36) != nil {
_z = _p.X36
goto _2
}
if (_p.X27) < i32(1) {
goto _2
}
_2_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(i32(0))))
if int32(_2_pOp.X0) != i32(51) || (*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_2_pOp.X6)))))) == nil {
goto _4
}
_z = *(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_2_pOp.X6)))))
_5:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(1)) != 0 {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _5
}
_4:
_2:
if _z != nil {
crt.Xprintf(tls, str(72689), unsafe.Pointer(_z))
}
}
func _registerTrace(tls *crt.TLS, _iReg int32, _p *XMem) {
crt.Xprintf(tls, str(72700), _iReg)
_memTracePrint(tls, _p)
crt.Xprintf(tls, str(37700))
_sqlite3VdbeCheckMemInvariants(tls, _p)
}
// Print the value of a register for tracing purposes:
func _memTracePrint(tls *crt.TLS, _p *XMem) {
var _7_zBuf [200]int8
if (int32(_p.X1) & i32(128)) != 0 {
crt.Xprintf(tls, str(72711))
goto _11
}
if (int32(_p.X1) & i32(1)) != 0 {
crt.Xprintf(tls, str(72722))
goto _11
}
if (int32(_p.X1) & i32(6)) == i32(6) {
crt.Xprintf(tls, str(72728), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
goto _11
}
if (int32(_p.X1) & i32(4)) != 0 {
crt.Xprintf(tls, str(72737), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
goto _11
}
if (int32(_p.X1) & i32(8)) != 0 {
crt.Xprintf(tls, str(72745), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
goto _11
}
if (int32(_p.X1) & i32(32)) != 0 {
crt.Xprintf(tls, str(72751))
goto _11
}
_sqlite3VdbeMemPrettyPrint(tls, _p, (*int8)(unsafe.Pointer(&_7_zBuf)))
crt.Xprintf(tls, str(47037), unsafe.Pointer((*int8)(unsafe.Pointer(&_7_zBuf))))
_11:
if (int32(_p.X1) & i32(32768)) != 0 {
crt.Xprintf(tls, str(72761), int32(_p.X3))
}
_ = _7_zBuf
}
// Write a nice string representation of the contents of cell pMem
// into buffer zBuf, length nBuf.
func _sqlite3VdbeMemPrettyPrint(tls *crt.TLS, _pMem *XMem, _zBuf *int8) {
var _f, _1_i, _9_j, _9_k int32
var _1_c, _7_z int8
var _zCsr *int8
var _14_c uint8
_zCsr = _zBuf
_f = int32(_pMem.X1)
if (_f & i32(16)) == 0 {
goto _0
}
if (_f & i32(1024)) != 0 {
_1_c = int8(i32(122))
func() {
if (_f & i32(6144)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72777)))
crt.X__builtin_abort(tls)
}
}()
goto _12
}
if (_f & i32(2048)) != 0 {
_1_c = int8(i32(116))
func() {
if (_f & i32(5120)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78600), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72809)))
crt.X__builtin_abort(tls)
}
}()
goto _12
}
if (_f & i32(4096)) != 0 {
_1_c = int8(i32(101))
func() {
if (_f & i32(3072)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78603), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72838)))
crt.X__builtin_abort(tls)
}
}()
goto _12
}
_1_c = int8(i32(115))
_12:
*postInc0(&_zCsr, 1) = _1_c
Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72868), _pMem.X4)
{
p := &_zCsr
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr))))
sink0 = *p
}
_1_i = i32(0)
_13:
if _1_i >= i32(16) || _1_i >= (_pMem.X4) {
goto _17
}
Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72872), int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_1_i))))&i32(255))
{
p := &_zCsr
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr))))
sink0 = *p
}
_1_i += 1
goto _13
_17:
_1_i = i32(0)
_18:
if _1_i >= i32(16) || _1_i >= (_pMem.X4) {
goto _22
}
_7_z = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_1_i)))
if (int32(_7_z) < i32(32)) || (int32(_7_z) > i32(126)) {
*postInc0(&_zCsr, 1) = int8(i32(46))
goto _25
}
*postInc0(&_zCsr, 1) = _7_z
_25:
_1_i += 1
goto _18
_22:
*postInc0(&_zCsr, 1) = int8(i32(93))
if (_f & i32(16384)) != 0 {
Xsqlite3_snprintf(tls, i32(100), _zCsr, str(72877), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
{
p := &_zCsr
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zCsr))))
sink0 = *p
}
}
*_zCsr = int8(i32(0))
goto _28
_0:
if (_f & i32(2)) == 0 {
goto _28
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(32))
if (_f & i32(1024)) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(122))
func() {
if (_f & i32(6144)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78630), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72777)))
crt.X__builtin_abort(tls)
}
}()
goto _40
}
if (_f & i32(2048)) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(116))
func() {
if (_f & i32(5120)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78633), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72809)))
crt.X__builtin_abort(tls)
}
}()
goto _40
}
if (_f & i32(4096)) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(101))
func() {
if (_f & i32(3072)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78636), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemPrettyPrintØ00__func__Ø000))), unsafe.Pointer(str(72838)))
crt.X__builtin_abort(tls)
}
}()
goto _40
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(1)))) = int8(i32(115))
_40:
_9_k = i32(2)
Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))), str(37915), _pMem.X4)
{
p := &_9_k
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))))
sink1 = *p
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(91))
_9_j = i32(0)
_41:
if _9_j >= i32(15) || _9_j >= (_pMem.X4) {
goto _45
}
_14_c = uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_9_j))))
if (int32(_14_c) >= i32(32)) && (int32(_14_c) < i32(127)) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(_14_c)
goto _48
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(46))
_48:
_9_j += 1
goto _41
_45:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(93))
Xsqlite3_snprintf(tls, i32(100), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3VdbeMemPrettyPrintØ00encnamesØ001)) + 4*uintptr(_pMem.X2))))
{
p := &_9_k
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(_9_k))))
sink1 = *p
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(postInc1(&_9_k, int32(1))))) = int8(i32(0))
_28:
}
var _sqlite3VdbeMemPrettyPrintØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemPrettyPrintØ00__func__Ø000[0], str(72882), 26)
}
var _sqlite3VdbeMemPrettyPrintØ00encnamesØ001 [4]*int8
func init() {
_sqlite3VdbeMemPrettyPrintØ00encnamesØ001 = [4]*int8{str(72908), str(72912), str(72916), str(72923)}
}
// This routine prepares a memory cell for modification by breaking
// its link to a shallow copy and by marking any current shallow
// copies of this cell as invalid.
//
// This is used for testing and debugging only - to make sure shallow
// copies are not misused.
func _sqlite3VdbeMemAboutToChange(tls *crt.TLS, _pVdbe *TVdbe, _pMem *XMem) {
var _i int32
var _pX *XMem
*func() **XMem { _i = i32(0); return &_pX }() = (*XMem)(_pVdbe.X18)
_0:
if _i >= (_pVdbe.X6) {
goto _3
}
if (*XMem)(_pX.X11) == _pMem {
{
p := (*uint16)(unsafe.Pointer(&(_pX.X1)))
*p = uint16(int32(*p) | i32(128))
sink14 = *p
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X11))))) = nil
}
*(*uintptr)(unsafe.Pointer(func() **XMem { _i += 1; return &_pX }())) += uintptr(48)
goto _0
_3:
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X11))))) = nil
}
var _sqlite3VdbeExecØ00azTypeØ001 [4]*int8
func init() {
_sqlite3VdbeExecØ00azTypeØ001 = [4]*int8{str(72930), str(25590), str(25597), str(72939)}
}
func _out2Prerelease(tls *crt.TLS, _p *TVdbe, _pOp *XVdbeOp) (r0 *XMem) {
var _pOut *XMem
func() {
if (_pOp.X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78831), unsafe.Pointer((*int8)(unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000))), unsafe.Pointer(str(62895)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOp.X4) > (((_p.X6) + i32(1)) - (_p.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78832), unsafe.Pointer((*int8)(unsafe.Pointer(&_out2PrereleaseØ00__func__Ø000))), unsafe.Pointer(str(62905)))
crt.X__builtin_abort(tls)
}
}()
_pOut = (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 48*uintptr(_pOp.X4)))
_sqlite3VdbeMemAboutToChange(tls, _p, _pOut)
if (int32(_pOut.X1) & i32(9312)) != i32(0) {
return _out2PrereleaseWithClear(tls, _pOut)
}
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
return _pOut
}
var _out2PrereleaseØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_out2PrereleaseØ00__func__Ø000[0], str(72951), 15)
}
// Return the register of pOp->p2 after first preparing it to be
// overwritten with an integer value.
func _out2PrereleaseWithClear(tls *crt.TLS, _pOut *XMem) (r0 *XMem) {
_sqlite3VdbeMemSetNull(tls, _pOut)
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16(i32(4))
return _pOut
}
// Return true if the Mem object contains a TEXT or BLOB that is
// too large - whose size exceeds SQLITE_MAX_LENGTH.
func _sqlite3VdbeMemTooBig(tls *crt.TLS, _p *XMem) (r0 int32) {
var _1_n int32
func() {
if (*Xsqlite3)(_p.X9) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70450), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemTooBigØ00__func__Ø000))), unsafe.Pointer(str(23676)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X1) & i32(18)) == 0 {
goto _2
}
_1_n = _p.X4
if (int32(_p.X1) & i32(16384)) != 0 {
{
p := &_1_n
*p = (*p) + (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_p.X0))))))
sink1 = *p
}
}
return bool2int(_1_n > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X9).X31))))) + 4*uintptr(i32(0))))))
_2:
return i32(0)
}
var _sqlite3VdbeMemTooBigØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemTooBigØ00__func__Ø000[0], str(72966), 21)
}
func _sqlite3VdbeMemShallowCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _srcType int32) {
func() {
if (int32(_pFrom.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000))), unsafe.Pointer(str(72987)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pTo.X9) != (*Xsqlite3)(_pFrom.X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70497), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000))), unsafe.Pointer(str(73018)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pTo.X1) & i32(9312)) != i32(0) {
_vdbeClrCopy(tls, _pTo, _pFrom, _srcType)
return
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u32(20))
if (int32(_pFrom.X1) & i32(2048)) == i32(0) {
{
p := (*uint16)(unsafe.Pointer(&(_pTo.X1)))
*p = uint16(int32(*p) & i32(-7169))
sink14 = *p
}
func() {
if _srcType != i32(4096) && _srcType != i32(2048) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemShallowCopyØ00__func__Ø000))), unsafe.Pointer(str(73037)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pTo.X1)))
*p = uint16(int32(*p) | _srcType)
sink14 = *p
}
}
}
var _sqlite3VdbeMemShallowCopyØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemShallowCopyØ00__func__Ø000[0], str(73079), 26)
}
// Make an shallow copy of pFrom into pTo. Prior contents of
// pTo are freed. The pFrom->z field is not duplicated. If
// pFrom->z is used, then pTo->z points to the same thing as pFrom->z
// and flags gets srcType (either MEM_Ephem or MEM_Static).
func _vdbeClrCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem, _eType int32) {
_vdbeMemClearExternAndSetNull(tls, _pTo)
func() {
if (int32(_pTo.X1) & i32(9312)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70492), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeClrCopyØ00__func__Ø000))), unsafe.Pointer(str(73105)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemShallowCopy(tls, _pTo, _pFrom, _eType)
}
var _vdbeClrCopyØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_vdbeClrCopyØ00__func__Ø000[0], str(73126), 12)
}
// Transfer the contents of pFrom to pTo. Any existing value in pTo is
// freed. If pFrom contains ephemeral data, a copy is made.
//
// pFrom contains an SQL NULL when this routine returns.
func _sqlite3VdbeMemMove(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) {
func() {
if (*Xsqlite3)(_pFrom.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pFrom.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70535), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000))), unsafe.Pointer(str(73138)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pTo.X9) != nil && Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70536), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000))), unsafe.Pointer(str(73191)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pFrom.X9) != nil && (*Xsqlite3)(_pTo.X9) != nil && (*Xsqlite3)(_pFrom.X9) != (*Xsqlite3)(_pTo.X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemMoveØ00__func__Ø000))), unsafe.Pointer(str(73240)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemRelease(tls, _pTo)
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u32(48))
*(*uint16)(unsafe.Pointer(&(_pFrom.X1))) = uint16(i32(1))
*(*int32)(unsafe.Pointer(&(_pFrom.X7))) = i32(0)
}
var _sqlite3VdbeMemMoveØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemMoveØ00__func__Ø000[0], str(73289), 19)
}
// Return the numeric type for pMem, either MEM_Int or MEM_Real or both or
// none.
//
// Unlike applyNumericAffinity(), this routine does not modify pMem->flags.
// But it does set pMem->u.r and pMem->u.i appropriately.
func _numericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
if (int32(_pMem.X1) & i32(12)) != 0 {
return uint16(int32(_pMem.X1) & i32(12))
}
if (int32(_pMem.X1) & i32(18)) != 0 {
return _computeNumericType(tls, _pMem)
}
return uint16(i32(0))
}
// pMem currently only holds a string type (or maybe a BLOB that we can
// interpret as a string if we want to). Compute its corresponding
// numeric type, if has one. Set the pMem->u.r and pMem->u.i fields
// accordingly.
func _computeNumericType(tls *crt.TLS, _pMem *XMem) (r0 uint16) {
func() {
if (int32(_pMem.X1) & i32(12)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78553), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000))), unsafe.Pointer(str(73308)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(18)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78554), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeNumericTypeØ00__func__Ø000))), unsafe.Pointer(str(73346)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AtoF(tls, _pMem.X5, (*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) == i32(0) {
return uint16(i32(0))
}
if _sqlite3Atoi64(tls, _pMem.X5, (*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))), _pMem.X4, _pMem.X2) == i32(0) {
return uint16(i32(4))
}
return uint16(i32(8))
}
var _computeNumericTypeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_computeNumericTypeØ00__func__Ø000[0], str(73384), 19)
}
// 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 _sqlite3AddInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
var _iA int64
_iA = *_pA
if _iB < int64(i32(0)) {
goto _0
}
if (_iA > int64(i32(0))) && ((i64(9223372036854775807) - _iA) < _iB) {
return i32(1)
}
goto _3
_0:
if (_iA < int64(i32(0))) && ((-(_iA + i64(9223372036854775807))) > (_iB + int64(i32(1)))) {
return i32(1)
}
_3:
{
p := _pA
*p = (*p) + _iB
sink6 = *p
}
return i32(0)
}
func _sqlite3SubInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
if _iB != i64(-9223372036854775808) {
goto _0
}
if (*_pA) >= int64(i32(0)) {
return i32(1)
}
{
p := _pA
*p = (*p) - _iB
sink6 = *p
}
return i32(0)
_0:
return _sqlite3AddInt64(tls, _pA, -_iB)
}
func _sqlite3MulInt64(tls *crt.TLS, _pA *int64, _iB int64) (r0 int32) {
var _iA int64
_iA = *_pA
if _iB <= int64(i32(0)) {
goto _0
}
if _iA > (i64(9223372036854775807) / _iB) {
return i32(1)
}
if _iA < (i64(-9223372036854775808) / _iB) {
return i32(1)
}
goto _4
_0:
if _iB >= int64(i32(0)) {
goto _4
}
if _iA <= int64(i32(0)) {
goto _5
}
if _iB < (i64(-9223372036854775808) / _iA) {
return i32(1)
}
goto _8
_5:
if _iA >= int64(i32(0)) {
goto _8
}
if _iB == i64(-9223372036854775808) {
return i32(1)
}
if _iA == i64(-9223372036854775808) {
return i32(1)
}
if (-_iA) > (i64(9223372036854775807) / (-_iB)) {
return i32(1)
}
_8:
_4:
*_pA = _iA * _iB
return i32(0)
}
// 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 _sqlite3MemCompare(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq) (r0 int32) {
var _f1, _f2, _combined_flags int32
_f1 = int32(_pMem1.X1)
_f2 = int32(_pMem2.X1)
_combined_flags = _f1 | _f2
func() {
if (_combined_flags & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75263), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000))), unsafe.Pointer(str(73403)))
crt.X__builtin_abort(tls)
}
}()
if (_combined_flags & i32(1)) != 0 {
return (_f2 & i32(1)) - (_f1 & i32(1))
}
if (_combined_flags & i32(12)) == 0 {
goto _3
}
if ((_f1 & _f2) & i32(4)) == i32(0) {
goto _4
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) < (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) {
return i32(-1)
}
if (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) > (*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) {
return i32(1)
}
return i32(0)
_4:
if ((_f1 & _f2) & i32(8)) == i32(0) {
goto _7
}
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) {
return i32(-1)
}
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0)))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0)))))) {
return i32(1)
}
return i32(0)
_7:
if (_f1 & i32(4)) == i32(0) {
goto _10
}
if (_f2 & i32(8)) != i32(0) {
return _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0))))))
}
return i32(-1)
_10:
if (_f1 & i32(8)) == i32(0) {
goto _13
}
if (_f2 & i32(4)) != i32(0) {
return -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem2.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem1.X0))))))
}
return i32(-1)
_13:
return i32(1)
_3:
if (_combined_flags & i32(2)) == 0 {
goto _16
}
if (_f1 & i32(2)) == i32(0) {
return i32(1)
}
if (_f2 & i32(2)) == i32(0) {
return i32(-1)
}
func() {
if int32(_pMem1.X2) != int32(_pMem2.X2) && ((*Xsqlite3)(_pMem1.X9).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75313), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000))), unsafe.Pointer(str(73436)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pMem1.X2) != i32(1) && int32(_pMem1.X2) != i32(2) && int32(_pMem1.X2) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75314), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000))), unsafe.Pointer(str(73486)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pColl != nil && (_pColl.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75321), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MemCompareØ00__func__Ø000))), unsafe.Pointer(str(73570)))
crt.X__builtin_abort(tls)
}
}()
if _pColl != nil {
return _vdbeCompareMemString(tls, _pMem1, _pMem2, _pColl, nil)
}
_16:
return _sqlite3BlobCompare(tls, _pMem1, _pMem2)
}
var _sqlite3MemCompareØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MemCompareØ00__func__Ø000[0], str(73592), 18)
}
// Do a comparison between a 64-bit signed integer and a 64-bit floating-point
// number. Return negative, zero, or positive if the first (i64) is less than,
// equal to, or greater than the second (double).
func _sqlite3IntFloatCompare(tls *crt.TLS, _i int64, _r float64) (r0 int32) {
var _2_y int64
var _1_x, _2_s float64
goto _0
_0:
if _r < (-9.223372036854776e+18) {
return i32(1)
}
if _r > (9.223372036854776e+18) {
return i32(-1)
}
_2_y = int64(_r)
if _i < _2_y {
return i32(-1)
}
if _i <= _2_y {
goto _7
}
if (_2_y == i64(-9223372036854775808)) && (_r > float64(0)) {
return i32(-1)
}
return i32(1)
_7:
_2_s = float64(_i)
if _2_s < _r {
return i32(-1)
}
if _2_s > _r {
return i32(1)
}
return i32(0)
_ = _1_x
panic(0)
}
// Both *pMem1 and *pMem2 contain string values. Compare the two values
// using the collation sequence pColl. As usual, return a negative , zero
// or positive value if *pMem1 is less than, equal to or greater than
// *pMem2, respectively. Similar in spirit to "rc = (*pMem1) - (*pMem2);".
func _vdbeCompareMemString(tls *crt.TLS, _pMem1 *XMem, _pMem2 *XMem, _pColl *XCollSeq, _prcErr *uint8) (r0 int32) {
var _2_rc, _2_n1, _2_n2 int32
var _2_v1, _2_v2 unsafe.Pointer
var _2_c1, _2_c2 XMem
if int32(_pMem1.X2) == int32(_pColl.X1) {
return (_pColl.X3)(tls, _pColl.X2, _pMem1.X4, (unsafe.Pointer)(_pMem1.X5), _pMem2.X4, (unsafe.Pointer)(_pMem2.X5))
}
_sqlite3VdbeMemInit(tls, &_2_c1, (*Xsqlite3)(_pMem1.X9), uint16(i32(1)))
_sqlite3VdbeMemInit(tls, &_2_c2, (*Xsqlite3)(_pMem1.X9), uint16(i32(1)))
_sqlite3VdbeMemShallowCopy(tls, &_2_c1, _pMem1, i32(4096))
_sqlite3VdbeMemShallowCopy(tls, &_2_c2, _pMem2, i32(4096))
_2_v1 = _sqlite3ValueText(tls, &_2_c1, _pColl.X1)
_2_n1 = func() int32 {
if _2_v1 == nil {
return i32(0)
}
return (_2_c1.X4)
}()
_2_v2 = _sqlite3ValueText(tls, &_2_c2, _pColl.X1)
_2_n2 = func() int32 {
if _2_v2 == nil {
return i32(0)
}
return (_2_c2.X4)
}()
_2_rc = (_pColl.X3)(tls, _pColl.X2, _2_n1, _2_v1, _2_n2, _2_v2)
if ((_2_v1 == nil) || (_2_v2 == nil)) && (_prcErr != nil) {
*_prcErr = uint8(_sqlite3NomemError(tls, i32(75166)))
}
_sqlite3VdbeMemRelease(tls, &_2_c1)
_sqlite3VdbeMemRelease(tls, &_2_c2)
return _2_rc
_ = _2_c1
_ = _2_c2
panic(0)
}
// Initialize bulk memory to be a consistent Mem object.
//
// The minimum amount of initialization feasible is performed.
func _sqlite3VdbeMemInit(tls *crt.TLS, _pMem *XMem, _db *Xsqlite3, _flags uint16) {
func() {
if (int32(_flags) & i32(-33280)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70341), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemInitØ00__func__Ø000))), unsafe.Pointer(str(73610)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = _flags
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X9))))) = _db
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0)
}
var _sqlite3VdbeMemInitØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemInitØ00__func__Ø000[0], str(73637), 19)
}
// 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 _sqlite3BlobCompare(tls *crt.TLS, _pB1 *XMem, _pB2 *XMem) (r0 int32) {
var _c, _n1, _n2 int32
_n1 = _pB1.X4
_n2 = _pB2.X4
func() {
if (int32(_pB1.X1)&i32(16384)) != i32(0) && _n1 != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75199), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000))), unsafe.Pointer(str(73656)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pB2.X1)&i32(16384)) != i32(0) && _n2 != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75200), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BlobCompareØ00__func__Ø000))), unsafe.Pointer(str(73692)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pB1.X1) | int32(_pB2.X1)) & i32(16384)) == 0 {
goto _6
}
if ((int32(_pB1.X1) & int32(_pB2.X1)) & i32(16384)) != 0 {
return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB1.X0)))))) - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB2.X0))))))
}
if (int32(_pB1.X1) & i32(16384)) == 0 {
goto _9
}
if _isAllZero(tls, _pB2.X5, _pB2.X4) == 0 {
return i32(-1)
}
return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB1.X0)))))) - _n2
_9:
if _isAllZero(tls, _pB1.X5, _pB1.X4) == 0 {
return i32(1)
}
return _n1 - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pB2.X0))))))
_6:
_c = crt.Xmemcmp(tls, (unsafe.Pointer)(_pB1.X5), (unsafe.Pointer)(_pB2.X5), uint32(func() int32 {
if _n1 > _n2 {
return _n2
}
return _n1
}()))
if _c != 0 {
return _c
}
return _n1 - _n2
}
var _sqlite3BlobCompareØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BlobCompareØ00__func__Ø000[0], str(73728), 19)
}
// The input pBlob is guaranteed to be a Blob that is not marked
// with MEM_Zero. Return true if it could be a zero-blob.
func _isAllZero(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
var _i int32
_i = i32(0)
_0:
if _i >= _n {
goto _3
}
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i)))) != 0 {
return i32(0)
}
_i += 1
goto _0
_3:
return i32(1)
}
var _sqlite3VdbeExecØ00and_logicØ002 [9]uint8
func init() {
_sqlite3VdbeExecØ00and_logicØ002 = [9]uint8{0, 0, 0, 0, 1, 2, 0, 2, 2}
}
var _sqlite3VdbeExecØ00or_logicØ003 [9]uint8
func init() {
_sqlite3VdbeExecØ00or_logicØ003 = [9]uint8{0, 1, 2, 1, 1, 1, 2, 1, 2}
}
// Make sure the cursor p is ready to read or write the row to which it
// was last positioned. Return an error code if an OOM fault or I/O error
// prevents us from positioning the cursor to its correct position.
//
// If a MoveTo operation is pending on the given cursor, then do that
// MoveTo now. If no move is pending, check to see if the row has been
// deleted out from under the cursor and if it has, mark the row as
// a NULL row.
//
// If the cursor is already pointing to the correct row and that row has
// not been deleted out from under the cursor, then this routine is a no-op.
func _sqlite3VdbeCursorMoveto(tls *crt.TLS, _pp **XVdbeCursor, _piCol *int32) (r0 int32) {
var _2_iMap int32
var _p *XVdbeCursor
_p = *_pp
if int32(_p.X0) != i32(0) {
goto _0
}
if (_p.X3) == 0 {
goto _1
}
if ((_p.X10) != nil) && (store1(&_2_iMap, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X10)) + 4*uintptr(i32(1)+(*_piCol))))) > i32(0)) {
*_pp = (*XVdbeCursor)(_p.X13)
*_piCol = _2_iMap - i32(1)
return i32(0)
}
return _handleDeferredMoveto(tls, _p)
_1:
if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) != 0 {
return _handleMovedCursor(tls, _p)
}
_0:
return i32(0)
}
// The cursor "p" has a pending seek operation that has not yet been
// carried out. Seek the cursor now. If an error occurs, return
// the appropriate error code.
func _handleDeferredMoveto(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
var _res, _rc int32
func() {
if (_p.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74477), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000))), unsafe.Pointer(str(73747)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X4) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74478), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000))), unsafe.Pointer(str(73765)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74479), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleDeferredMovetoØ00__func__Ø000))), unsafe.Pointer(str(73776)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeMovetoUnpacked(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))), nil, _p.X20, i32(0), &_res)
if _rc != 0 {
return _rc
}
if _res != i32(0) {
return _sqlite3CorruptError(tls, i32(74482))
}
*(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(0))
*(*uint32)(unsafe.Pointer(&(_p.X11))) = uint32(i32(0))
return i32(0)
}
var _handleDeferredMovetoØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_handleDeferredMovetoØ00__func__Ø000[0], str(73803), 21)
}
// 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 _sqlite3BtreeMovetoUnpacked(tls *crt.TLS, _pCur *XBtCursor, _pIdxKey *XUnpackedRecord, _intKey int64, _biasRight int32, _pRes *int32) (r0 int32) {
var _rc, _12_lwr, _12_upr, _12_idx, _12_c, _25_nCell int32
var _14_nCellKey int64
var _12_chldPg uint32
var _28_pCellKey unsafe.Pointer
var _12_pCell, _28_pCellBody *uint8
var _12_pPage *XMemPage
var _xRecordCompare func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64180), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.X0).X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64181), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73849)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pRes == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73893)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pIdxKey == nil) != ((*XKeyInfo)(_pCur.X18) == nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64183), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73898)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) == i32(1) && (_pIdxKey == nil) != (int32(_pCur.X15) != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64184), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73932)))
crt.X__builtin_abort(tls)
}
}()
if _pIdxKey != nil || int32(_pCur.X12) != i32(1) || (int32(_pCur.X10)&i32(2)) == i32(0) {
goto _13
}
if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) == _intKey {
*_pRes = i32(0)
return i32(0)
}
if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) >= _intKey {
goto _15
}
if (int32(_pCur.X10) & i32(8)) != i32(0) {
*_pRes = i32(-1)
return i32(0)
}
if (((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)+int64(i32(1))) != _intKey || (_pCur.X9) != 0 {
goto _18
}
*_pRes = i32(0)
_rc = _sqlite3BtreeNext(tls, _pCur, _pRes)
if _rc != 0 {
return _rc
}
if (*_pRes) != i32(0) {
goto _20
}
_getCellInfo(tls, _pCur)
if ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0) == _intKey {
return i32(0)
}
_20:
_18:
_15:
_13:
if _pIdxKey != nil {
_xRecordCompare = _sqlite3VdbeFindCompare(tls, _pIdxKey)
*(*uint8)(unsafe.Pointer(&(_pIdxKey.X4))) = uint8(i32(0))
func() {
if int32(_pIdxKey.X3) != i32(1) && int32(_pIdxKey.X3) != i32(0) && int32(_pIdxKey.X3) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(73997)))
crt.X__builtin_abort(tls)
}
}()
goto _27
}
_xRecordCompare = nil
_27:
_rc = _moveToRoot(tls, _pCur)
if _rc != 0 {
return _rc
}
func() {
if (_pCur.X7) != uint32(i32(0)) && (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64233), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74073)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X7) != uint32(i32(0)) && ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64234), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74120)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(0) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64235), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74175)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(0) {
*_pRes = i32(-1)
func() {
if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74242)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(i32(0))))).X2) != int32(_pCur.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64241), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74299)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X15) == 0 && _pIdxKey == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64242), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74340)))
crt.X__builtin_abort(tls)
}
}()
_47:
_12_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
func() {
if int32(_12_pPage.X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64255), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74367)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_12_pPage.X2) != bool2int(_pIdxKey == nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64256), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74382)))
crt.X__builtin_abort(tls)
}
}()
_12_lwr = i32(0)
_12_upr = int32(_12_pPage.X14) - i32(1)
func() {
if _biasRight != i32(0) && _biasRight != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64259), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74410)))
crt.X__builtin_abort(tls)
}
}()
_12_idx = _12_upr >> uint(i32(1)-_biasRight)
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx)
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32
}{_xRecordCompare})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, unsafe.Pointer, *XUnpackedRecord) int32
}{nil})) {
goto _57
}
_58:
_12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))< int32(*postInc13(&_12_pCell, 1)) {
goto _63
}
if uintptr(unsafe.Pointer(_12_pCell)) >= uintptr(unsafe.Pointer(_12_pPage.X20)) {
return _sqlite3CorruptError(tls, i32(64268))
}
goto _62
_63:
_61:
_sqlite3GetVarint(tls, _12_pCell, (*uint64)(unsafe.Pointer(&_14_nCellKey)))
if _14_nCellKey >= _intKey {
goto _65
}
_12_lwr = _12_idx + i32(1)
if _12_lwr > _12_upr {
_12_c = i32(-1)
goto _60
}
goto _70
_65:
if _14_nCellKey <= _intKey {
goto _68
}
_12_upr = _12_idx - i32(1)
if _12_lwr > _12_upr {
_12_c = i32(1)
goto _60
}
goto _70
_68:
func() {
if _14_nCellKey != _intKey {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64279), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74439)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx)
if (_12_pPage.X5) == 0 {
_12_lwr = _12_idx
goto _moveto_next_layer
}
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
*(*int64)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0))) = _14_nCellKey
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
*_pRes = i32(0)
return i32(0)
_70:
func() {
if (_12_lwr + _12_upr) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64292), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74456)))
crt.X__builtin_abort(tls)
}
}()
_12_idx = (_12_lwr + _12_upr) >> uint(i32(1))
goto _58
_60:
goto _77
_57:
_78:
_12_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X22)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_idx))))) + 1*uintptr(i32(0)))))< i32(0) {
_12_upr = _12_idx - i32(1)
goto _97
}
func() {
if _12_c != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64368), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74580)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(0)
_rc = i32(0)
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx)
if (_pIdxKey.X4) != 0 {
_rc = i32(11)
}
goto _moveto_finish
_97:
if _12_lwr > _12_upr {
goto _80
}
func() {
if (_12_lwr + _12_upr) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64376), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74456)))
crt.X__builtin_abort(tls)
}
}()
_12_idx = (_12_lwr + _12_upr) >> uint(i32(1))
goto _78
_80:
_77:
func() {
if _12_lwr != (_12_upr+i32(1)) && ((_12_pPage.X2) == 0 || (_12_pPage.X5) != 0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64380), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74585)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_12_pPage.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64381), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(74631)))
crt.X__builtin_abort(tls)
}
}()
if (_12_pPage.X5) != 0 {
func() {
if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64383), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeMovetoUnpackedØ00__func__Ø000))), unsafe.Pointer(str(10597)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(_12_idx)
*_pRes = _12_c
_rc = i32(0)
goto _moveto_finish
}
_moveto_next_layer:
if _12_lwr >= int32(_12_pPage.X14) {
_12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X19))+1*uintptr(int32(_12_pPage.X6)+i32(8)))))
goto _114
}
_12_chldPg = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_12_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_12_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pPage.X21))+1*uintptr(i32(2)*_12_lwr))))) + 1*uintptr(i32(0)))))<= int32(_pPage.X14) {
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) -= 1
return _btreeNext(tls, _pCur, _pRes)
}
if (_pPage.X5) != 0 {
return i32(0)
}
return _moveToLeftmost(tls, _pCur)
}
var _sqlite3BtreeNextØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeNextØ00__func__Ø000[0], str(74825), 17)
}
// Advance the cursor to the next entry in the database. If
// successful then set *pRes=0. If the cursor
// was already pointing to the last entry in the database before
// this routine was called, then set *pRes=1.
//
// The main entry point is sqlite3BtreeNext(). That routine is optimized
// for the common case of merely incrementing the cell counter BtCursor.aiIdx
// to the next cell on the current page. The (slower) btreeNext() helper
// routine is called when it is necessary to move to a different page or
// to restore the cursor.
//
// The calling function will set *pRes to 0 or 1. The initial *pRes value
// will be 1 if the cursor being stepped corresponds to an SQL index and
// if this routine could have been skipped if that SQL index had been
// a unique index. Otherwise the caller will have set *pRes to zero.
// Zero is the common case. The btree implementation is free to use the
// initial *pRes value as a hint to improve performance, but the current
// SQLite btree implementation does not. (Note that the comdb2 btree
// implementation does use this hint, however.)
func _btreeNext(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
var _rc, _idx int32
var _pPage *XMemPage
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64471), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64472), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74777)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*_pRes) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64473), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74842)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(1) {
goto _7
}
func() {
if (int32(_pCur.X10) & i32(4)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64475), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74645)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if int32(_pCur.X12) >= i32(3) {
return _btreeRestoreCursorPosition(tls, _pCur)
}
return i32(0)
}()
if _rc != i32(0) {
return _rc
}
if i32(0) == int32(_pCur.X12) {
*_pRes = i32(1)
return i32(0)
}
if (_pCur.X9) == 0 {
goto _14
}
func() {
if int32(_pCur.X12) != i32(1) && int32(_pCur.X12) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64485), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74851)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1))
if (_pCur.X9) > i32(0) {
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0)
return i32(0)
}
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0)
_14:
_7:
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
_idx = int32(preInc14((*uint16)(unsafe.Pointer(&(_pCur.X16))), uint16(1)))
func() {
if (_pPage.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64497), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeNextØ00__func__Ø000))), unsafe.Pointer(str(74631)))
crt.X__builtin_abort(tls)
}
}()
if _idx < int32(_pPage.X14) {
goto _21
}
if (_pPage.X5) != 0 {
goto _22
}
_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(int32(_pPage.X6)+i32(8))))))
if _rc != 0 {
return _rc
}
return _moveToLeftmost(tls, _pCur)
_22:
if int32(_pCur.X14) == i32(0) {
*_pRes = i32(1)
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
return i32(0)
}
_moveToParent(tls, _pCur)
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
if int32(_pCur.X16) >= int32(_pPage.X14) {
goto _22
}
if (_pPage.X2) != 0 {
return _sqlite3BtreeNext(tls, _pCur, _pRes)
}
return i32(0)
_21:
if (_pPage.X5) != 0 {
return i32(0)
}
return _moveToLeftmost(tls, _pCur)
}
var _btreeNextØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_btreeNextØ00__func__Ø000[0], str(74911), 10)
}
// Restore the cursor to the position it was in (or as close to as possible)
// when saveCursorPosition() was called. Note that this call deletes the
// saved position info stored by saveCursorPosition(), so there can be
// at most one effective restoreCursorPosition() call after each
// saveCursorPosition().
func _btreeRestoreCursorPosition(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc, _skipNext int32
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59832), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59833), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(74921)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(4) {
return _pCur.X9
}
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
_rc = _btreeMoveto(tls, _pCur, _pCur.X6, _pCur.X5, i32(0), &_skipNext)
if _rc != i32(0) {
goto _5
}
Xsqlite3_free(tls, _pCur.X6)
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = nil
func() {
if int32(_pCur.X12) != i32(1) && int32(_pCur.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59842), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeRestoreCursorPositionØ00__func__Ø000))), unsafe.Pointer(str(74954)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*int32)(unsafe.Pointer(&(_pCur.X9)))
*p = (*p) | _skipNext
sink1 = *p
}
if (_pCur.X9) != 0 && (int32(_pCur.X12) == i32(1)) {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(2))
}
_5:
return _rc
}
var _btreeRestoreCursorPositionØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_btreeRestoreCursorPositionØ00__func__Ø000[0], str(75013), 27)
}
// In this version of BtreeMoveto, pKey is a packed index record
// such as is generated by the OP_MakeRecord opcode. Unpack the
// record and then call BtreeMovetoUnpacked() to do the work.
func _btreeMoveto(tls *crt.TLS, _pCur *XBtCursor, _pKey unsafe.Pointer, _nKey int64, _bias int32, _pRes *int32) (r0 int32) {
var _rc int32
var _pIdxKey *XUnpackedRecord
if _pKey == nil {
goto _0
}
func() {
if _nKey != int64(int32(_nKey)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59803), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeMovetoØ00__func__Ø000))), unsafe.Pointer(str(75040)))
crt.X__builtin_abort(tls)
}
}()
_pIdxKey = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)(_pCur.X18))
if _pIdxKey == nil {
return _sqlite3NomemError(tls, i32(59805))
}
_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)(_pCur.X18), int32(_nKey), _pKey, _pIdxKey)
if int32(_pIdxKey.X2) == i32(0) {
_rc = _sqlite3CorruptError(tls, i32(59808))
goto _moveto_done
}
goto _5
_0:
_pIdxKey = nil
_5:
_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, _pIdxKey, _nKey, _bias, _pRes)
_moveto_done:
if _pIdxKey != nil {
_sqlite3DbFree(tls, (*Xsqlite3)((*XKeyInfo)(_pCur.X18).X4), (unsafe.Pointer)(_pIdxKey))
}
return _rc
}
var _btreeMovetoØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_btreeMovetoØ00__func__Ø000[0], str(75061), 12)
}
// This routine is used to allocate sufficient space for an UnpackedRecord
// structure large enough to be used with sqlite3VdbeRecordUnpack() if
// the first argument is a pointer to KeyInfo structure pKeyInfo.
//
// The space is either allocated using sqlite3DbMallocRaw() or from within
// the unaligned buffer passed via the second and third arguments (presumably
// stack space). If the former, then *ppFree is set to a pointer that should
// be eventually freed by the caller using sqlite3DbFree(). Or, if the
// allocation comes from the pSpace/szSpace buffer, *ppFree is set to NULL
// before returning.
//
// If an OOM error occurs, NULL is returned.
func _sqlite3VdbeAllocUnpackedRecord(tls *crt.TLS, _pKeyInfo *XKeyInfo) (r0 *XUnpackedRecord) {
var _nByte int32
var _p *XUnpackedRecord
_nByte = int32(u32(16) + (u32(48) * uint32(int32(_pKeyInfo.X2)+i32(1))))
_p = (*XUnpackedRecord)(_sqlite3DbMallocRaw(tls, (*Xsqlite3)(_pKeyInfo.X4), uint64(_nByte)))
if _p == nil {
return nil
}
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XMem)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(u32(16))))))
func() {
if (_pKeyInfo.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74948), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000))), unsafe.Pointer(str(37852)))
crt.X__builtin_abort(tls)
}
}()
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pKeyInfo
*(*uint16)(unsafe.Pointer(&(_p.X2))) = uint16(int32(_pKeyInfo.X2) + i32(1))
return _p
}
var _sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000 [31]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeAllocUnpackedRecordØ00__func__Ø000[0], str(75073), 31)
}
func _sqlite3VdbeRecordUnpack(tls *crt.TLS, _pKeyInfo *XKeyInfo, _nKey int32, _pKey unsafe.Pointer, _p *XUnpackedRecord) {
var _d int32
var _idx, _szHdr, _1_serial_type uint32
var _u uint16
var _aKey *uint8
var _pMem *XMem
_aKey = (*uint8)(_pKey)
_pMem = (*XMem)(_p.X1)
*(*int8)(unsafe.Pointer(&(_p.X3))) = int8(i32(0))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pMem))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000))), unsafe.Pointer(str(6321)))
crt.X__builtin_abort(tls)
}
}()
_idx = uint32(uint8(func() int32 {
if int32(*_aKey) < int32(u8(128)) {
return func() int32 { _szHdr = uint32(*_aKey); return i32(1) }()
}
return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
}()))
_d = int32(_szHdr)
_u = uint16(i32(0))
_4:
if _idx >= _szHdr || _d > _nKey {
goto _5
}
{
p := &_idx
*p = (*p) + uint32(uint8(func() int32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(_idx)))) < int32(u8(128)) {
return func() int32 {
_1_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(_idx))))
return i32(1)
}()
}
return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey))+1*uintptr(_idx))), &_1_serial_type))
}()))
sink5 = *p
}
*(*uint8)(unsafe.Pointer(&(_pMem.X2))) = _pKeyInfo.X1
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMem.X9))))) = (*Xsqlite3)(_pKeyInfo.X4)
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0)
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = nil
{
p := &_d
*p = int32(uint32(*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey))+1*uintptr(_d))), _1_serial_type, _pMem))
sink1 = *p
}
*(*uintptr)(unsafe.Pointer(&_pMem)) += uintptr(48)
if int32(preInc14(&_u, uint16(1))) >= int32(_p.X2) {
goto _5
}
goto _4
_5:
func() {
if int32(_u) > (int32(_pKeyInfo.X2) + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74990), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordUnpackØ00__func__Ø000))), unsafe.Pointer(str(75104)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_p.X2))) = _u
}
var _sqlite3VdbeRecordUnpackØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeRecordUnpackØ00__func__Ø000[0], str(75128), 24)
}
// Read a 32-bit variable-length integer from memory starting at p[0].
// Return the number of bytes read. The value is stored in *v.
//
// If the varint stored in p[0] is larger than can fit in a 32-bit unsigned
// integer, then set *v to 0xffffffff.
//
// A MACRO version, getVarint32, is provided which inlines the
// single-byte case. All code should use the MACRO version as
// this function assumes the single-byte case has already been handled.
func _sqlite3GetVarint32(tls *crt.TLS, _p *uint8, _v *uint32) (r0 uint8) {
var _a, _b uint32
var _3_v64 uint64
var _3_n uint8
_a = uint32(*_p)
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_b = uint32(*_p)
if (_b & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_a = _a << uint(i32(7))
*_v = _a | _b
return uint8(i32(2))
}
*(*uintptr)(unsafe.Pointer(&_p)) += uintptr(1)
_a = _a << uint(i32(14))
{
p := &_a
*p = (*p) | uint32(*_p)
sink5 = *p
}
if (_a & uint32(i32(128))) == 0 {
{
p := &_a
*p = (*p) & uint32(i32(2080895))
sink5 = *p
}
{
p := &_b
*p = (*p) & uint32(i32(127))
sink5 = *p
}
_b = _b << uint(i32(7))
*_v = _a | _b
return uint8(i32(3))
}
{
p := &_p
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(2))))
sink13 = *p
}
_3_n = _sqlite3GetVarint(tls, _p, &_3_v64)
func() {
if int32(_3_n) <= i32(3) || int32(_3_n) > i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28722), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetVarint32Ø00__func__Ø000))), unsafe.Pointer(str(75152)))
crt.X__builtin_abort(tls)
}
}()
if (_3_v64 & u64(4294967295)) != _3_v64 {
*_v = u32(4294967295)
goto _6
}
*_v = uint32(_3_v64)
_6:
return _3_n
}
var _sqlite3GetVarint32Ø00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GetVarint32Ø00__func__Ø000[0], str(75164), 19)
}
func _sqlite3VdbeSerialGet(tls *crt.TLS, _buf *uint8, _serial_type uint32, _pMem *XMem) (r0 uint32) {
switch _serial_type {
case u32(0):
goto _1
case u32(1):
goto _4
case u32(2):
goto _5
case u32(3):
goto _6
case u32(4):
goto _7
case u32(5):
goto _8
case u32(6):
goto _9
case u32(7):
goto _9
case u32(8):
goto _11
case u32(9):
goto _11
case u32(10):
goto _1
case u32(11):
goto _1
default:
goto _13
}
_1:
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1))
goto _14
_4:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
return uint32(i32(1))
_5:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
return uint32(i32(2))
_6:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2))))))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
return uint32(i32(3))
_7:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((((i32(16777216) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(1))))) << uint(i32(16)))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(2))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(i32(3))))))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4))
return uint32(i32(4))
_8:
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))) = int64((((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_buf))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(2)))))))))) + 1*uintptr(i32(0)))))<= i32(20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63864), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToChildØ00__func__Ø000))), unsafe.Pointer(str(75251)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X14) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63865), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToChildØ00__func__Ø000))), unsafe.Pointer(str(75282)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X14) >= i32(19) {
return _sqlite3CorruptError(tls, i32(63867))
}
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-7))
sink2 = *p
}
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(1))))) = _pCur.X16
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0))
return _getAndInitPage(tls, _pBt, _newPgno, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+4*uintptr(_pCur.X14))), _pCur, int32(_pCur.X11))
}
var _moveToChildØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_moveToChildØ00__func__Ø000[0], str(75297), 12)
}
// Get a page from the pager and initialize it.
//
// If pCur!=0 then the page is being fetched as part of a moveToChild()
// call. Do additional sanity checking on the page in this case.
// And if the fetch fails, this routine must decrement pCur->iPage.
//
// The page is fetched as read-write unless pCur is not NULL and is
// a read-only cursor.
//
// If an error occurs, then *ppPage is undefined. It
// may remain unchanged, or it may be set to an invalid value.
func _getAndInitPage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _ppPage **XMemPage, _pCur *XBtCursor, _bReadOnly int32) (r0 int32) {
var _rc int32
var _pDbPage *XPgHdr
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61081), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pCur != nil && _ppPage != (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+4*uintptr(_pCur.X14))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61082), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75309)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pCur != nil && _bReadOnly != int32(_pCur.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61083), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75355)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pCur != nil && int32(_pCur.X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61084), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75397)))
crt.X__builtin_abort(tls)
}
}()
if _pgno > _btreePagecount(tls, _pBt) {
_rc = _sqlite3CorruptError(tls, i32(61087))
goto _getAndInitPage_error
}
_rc = _sqlite3PagerGet(tls, (*XPager)(_pBt.X0), _pgno, &_pDbPage, _bReadOnly)
if _rc != 0 {
goto _getAndInitPage_error
}
*_ppPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pDbPage))
if int32((*_ppPage).X0) != i32(0) {
goto _13
}
_btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
_rc = _btreeInitPage(tls, *_ppPage)
if _rc != i32(0) {
_releasePage(tls, *_ppPage)
goto _getAndInitPage_error
}
_13:
func() {
if ((*_ppPage).X4) != _pgno {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61103), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75422)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*_ppPage).X19) != (*uint8)(_sqlite3PagerGetData(tls, _pDbPage)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61104), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75444)))
crt.X__builtin_abort(tls)
}
}()
if (_pCur != nil) && ((int32((*_ppPage).X14) < i32(1)) || (int32((*_ppPage).X2) != int32(_pCur.X15))) {
_rc = _sqlite3CorruptError(tls, i32(61109))
_releasePage(tls, *_ppPage)
goto _getAndInitPage_error
}
return i32(0)
_getAndInitPage_error:
if _pCur != nil {
*(*int8)(unsafe.Pointer(&(_pCur.X14))) -= 1
}
func() {
if _pgno == uint32(i32(0)) && _rc != i32(11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61118), unsafe.Pointer((*int8)(unsafe.Pointer(&_getAndInitPageØ00__func__Ø000))), unsafe.Pointer(str(75491)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _getAndInitPageØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_getAndInitPageØ00__func__Ø000[0], str(75521), 15)
}
// Move the cursor down to the left-most leaf entry beneath the
// entry to which it is currently pointing.
//
// The left-most leaf is the one with the smallest key - the first
// in ascending order.
func _moveToLeftmost(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc int32
var _pgno uint32
var _pPage *XMemPage
_rc = i32(0)
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64033), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64034), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
_4:
if (_rc == i32(0)) && ((store52(&_pPage, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X5) == 0) {
func() {
if int32(_pCur.X16) >= int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64036), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToLeftmostØ00__func__Ø000))), unsafe.Pointer(str(10682)))
crt.X__builtin_abort(tls)
}
}()
_pgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*int32(_pCur.X16)))))) + 1*uintptr(i32(0)))))<idx is set to the cell index that contains the pointer
// to the page we are coming from. If we are coming from the
// right-most child page then pCur->idx is set to one more than
// the largest cell index.
func _moveToParent(tls *crt.TLS, _pCur *XBtCursor) {
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63908), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToParentØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63909), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToParentØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63910), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToParentØ00__func__Ø000))), unsafe.Pointer(str(75551)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63911), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToParentØ00__func__Ø000))), unsafe.Pointer(str(75565)))
crt.X__builtin_abort(tls)
}
}()
_assertParentIndex(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(int32(_pCur.X14)-i32(1)))), int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(int32(_pCur.X14)-i32(1))))), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X4)
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-7))
sink2 = *p
}
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(int32(_pCur.X14)-i32(1))))
_releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1))))))
}
var _moveToParentØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_moveToParentØ00__func__Ø000[0], str(75591), 13)
}
// Page pParent is an internal (non-leaf) tree page. This function
// asserts that page number iChild is the left-child if the iIdx'th
// cell in page pParent. Or, if iIdx is equal to the total number of
// cells in pParent, that page number iChild is the right-child of
// the page.
func _assertParentIndex(tls *crt.TLS, _pParent *XMemPage, _iIdx int32, _iChild uint32) {
if (_sqlite3Config.X6) == i32(0) {
return
}
func() {
if _iIdx > int32(_pParent.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63888), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertParentIndexØ00__func__Ø000))), unsafe.Pointer(str(75604)))
crt.X__builtin_abort(tls)
}
}()
if _iIdx == int32(_pParent.X14) {
func() {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X19))+1*uintptr(int32(_pParent.X6)+i32(8))))) != _iChild {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63890), unsafe.Pointer((*int8)(unsafe.Pointer(&_assertParentIndexØ00__func__Ø000))), unsafe.Pointer(str(75625)))
crt.X__builtin_abort(tls)
}
}()
goto _6
}
func() {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*_iIdx))))) + 1*uintptr(i32(0)))))< i32(13) {
goto _0
}
_1_flags = int32((*XMem)(unsafe.Pointer(uintptr(_p.X1) + 48*uintptr(i32(0)))).X1)
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)(_p.X0).X5)) + 1*uintptr(i32(0))))) != 0 {
*(*int8)(unsafe.Pointer(&(_p.X5))) = int8(i32(1))
*(*int8)(unsafe.Pointer(&(_p.X6))) = int8(i32(-1))
goto _2
}
*(*int8)(unsafe.Pointer(&(_p.X5))) = int8(i32(-1))
*(*int8)(unsafe.Pointer(&(_p.X6))) = int8(i32(1))
_2:
if (_1_flags & i32(4)) != 0 {
return _vdbeRecordCompareInt
}
if ((_1_flags & i32(25)) == i32(0)) && ((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&((*XKeyInfo)(_p.X0).X6))))) + 4*uintptr(i32(0))))) == nil) {
func() {
if (_1_flags & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75785), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeFindCompareØ00__func__Ø000))), unsafe.Pointer(str(75741)))
crt.X__builtin_abort(tls)
}
}()
return _vdbeRecordCompareString
}
_0:
return _sqlite3VdbeRecordCompare
}
// This function is an optimized version of sqlite3VdbeRecordCompare()
// that (a) the first field of pPKey2 is an integer, and (b) the
// size-of-header varint at the start of (pKey1/nKey1) fits in a single
// byte (i.e. is less than 128).
//
// To avoid concerns about buffer overreads, this routine is only used
// on schemas where the maximum valid header size is 63 bytes or less.
func _vdbeRecordCompareInt(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
var _serial_type, _res int32
var _v, _lhs int64
var _y uint32
var _x uint64
var _aKey *uint8
_aKey = (*uint8)(unsafe.Pointer(uintptr(_pKey1) + 1*uintptr(int32(*(*uint8)(_pKey1))&i32(63))))
_serial_type = int32(*(*uint8)(unsafe.Pointer(uintptr(_pKey1) + 1*uintptr(i32(1)))))
_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.X0))
func() {
if int32(*(*uint8)(_pKey1)) > i32(63) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75613), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000))), unsafe.Pointer(str(75757)))
crt.X__builtin_abort(tls)
}
}()
switch _serial_type {
case i32(0):
goto _12
case i32(1):
goto _4
case i32(2):
goto _5
case i32(3):
goto _6
case i32(4):
goto _7
case i32(5):
goto _8
case i32(6):
goto _9
case i32(7):
goto _12
case i32(8):
goto _10
case i32(9):
goto _11
default:
goto _14
}
_4:
_lhs = int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))
goto _15
_5:
_lhs = int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))))
goto _15
_6:
_lhs = int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2))))))
goto _15
_7:
_y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))< _lhs {
_res = int32(_pPKey2.X5)
goto _21
}
if _v < _lhs {
_res = int32(_pPKey2.X6)
goto _21
}
if int32(_pPKey2.X2) > i32(1) {
_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, i32(1))
goto _21
}
_res = int32(_pPKey2.X3)
*(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1))
_21:
func() {
if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75684), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareIntØ00__func__Ø000))), unsafe.Pointer(str(75791)))
crt.X__builtin_abort(tls)
}
}()
return _res
_ = _y
panic(0)
}
// Count the number of fields (a.k.a. columns) in the record given by
// pKey,nKey. The verify that this count is less than or equal to the
// limit given by pKeyInfo->nField + pKeyInfo->nXField.
//
// If this constraint is not satisfied, it means that the high-speed
// vdbeRecordCompareInt() and vdbeRecordCompareString() routines will
// not work correctly. If this assert() ever fires, it probably means
// that the KeyInfo.nField or KeyInfo.nXField values were computed
// incorrectly.
func _vdbeAssertFieldCountWithinLimits(tls *crt.TLS, _nKey int32, _pKey unsafe.Pointer, _pKeyInfo *XKeyInfo) {
var _nField int32
var _szHdr, _idx, _notUsed uint32
var _aKey *uint8
_nField = i32(0)
_aKey = (*uint8)(_pKey)
if (_sqlite3Config.X6) == i32(0) {
return
}
_idx = uint32(uint8(func() int32 {
if int32(*_aKey) < int32(u8(128)) {
return func() int32 { _szHdr = uint32(*_aKey); return i32(1) }()
}
return int32(_sqlite3GetVarint32(tls, _aKey, &_szHdr))
}()))
func() {
if _nKey < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75123), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000))), unsafe.Pointer(str(75841)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _szHdr > uint32(_nKey) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75124), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000))), unsafe.Pointer(str(75849)))
crt.X__builtin_abort(tls)
}
}()
_7:
if _idx < _szHdr {
{
p := &_idx
*p = (*p) + uint32(uint8(func() int32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx)))))))) < int32(u8(128)) {
return func() int32 {
_notUsed = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx))))))))
return i32(1)
}()
}
return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx))))))), &_notUsed))
}()))
sink5 = *p
}
_nField += 1
goto _7
}
func() {
if _nField > (int32(_pKeyInfo.X2) + int32(_pKeyInfo.X3)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75129), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000))), unsafe.Pointer(str(75866)))
crt.X__builtin_abort(tls)
}
}()
_ = _notUsed
}
var _vdbeAssertFieldCountWithinLimitsØ00__func__Ø000 [33]int8
func init() {
crt.Xstrncpy(nil, &_vdbeAssertFieldCountWithinLimitsØ00__func__Ø000[0], str(75911), 33)
}
var _vdbeRecordCompareIntØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_vdbeRecordCompareIntØ00__func__Ø000[0], str(75944), 21)
}
func _sqlite3VdbeRecordCompare(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, i32(0))
}
// This function compares the two table rows or index records
// specified by {nKey1, pKey1} and pPKey2. It returns a negative, zero
// or positive integer if key1 is less than, equal to or
// greater than key2. The {nKey1, pKey1} key must be a blob
// created by the OP_MakeRecord opcode of the VDBE. The pPKey2
// key must be a parsed key such as obtained from
// sqlite3VdbeParseRecord.
//
// If argument bSkip is non-zero, it is assumed that the caller has already
// determined that the first fields of the keys are equal.
//
// Key1 and Key2 do not have to contain the same number of fields. If all
// fields that appear in both keys are equal, then pPKey2->default_rc is
// returned.
//
// If database corruption is discovered, set pPKey2->errCode to
// SQLITE_CORRUPT and return 0. If an OOM error is encountered,
// pPKey2->errCode is set to SQLITE_NOMEM and, if it is not NULL, the
// malloc-failed flag set on database handle (pPKey2->pKeyInfo->db).
func _sqlite3VdbeRecordCompareWithSkip(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord, _bSkip int32) (r0 int32) {
var _i, _rc, _26_nCmp, _29_nStr, _34_nCmp int32
var _9_lhs, _9_rhs int64
var _d1, _szHdr1, _idx1, _1_s1, _4_serial_type uint32
var _aKey1 *uint8
var _mem1 XMem
var _pRhs *XMem
var _pKeyInfo *XKeyInfo
_rc = i32(0)
_pRhs = (*XMem)(_pPKey2.X1)
_pKeyInfo = (*XKeyInfo)(_pPKey2.X0)
_aKey1 = (*uint8)(_pKey1)
if _bSkip != 0 {
_idx1 = uint32(i32(1) + int32(uint8(func() int32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1))))) < int32(u8(128)) {
return func() int32 {
_1_s1 = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1)))))
return i32(1)
}()
}
return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(i32(1)))), &_1_s1))
}())))
_szHdr1 = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(0)))))
_d1 = _szHdr1 + _sqlite3VdbeSerialTypeLen(tls, _1_s1)
_i = i32(1)
*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(48)
goto _3
}
_idx1 = uint32(uint8(func() int32 {
if int32(*_aKey1) < int32(u8(128)) {
return func() int32 { _szHdr1 = uint32(*_aKey1); return i32(1) }()
}
return int32(_sqlite3GetVarint32(tls, _aKey1, &_szHdr1))
}()))
_d1 = _szHdr1
if _d1 > uint32(_nKey1) {
*(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75426)))
return i32(0)
}
_i = i32(0)
_3:
*(*int32)(unsafe.Pointer(&(_mem1.X7))) = i32(0)
func() {
if (int32((*XKeyInfo)(_pPKey2.X0).X2)+int32((*XKeyInfo)(_pPKey2.X0).X3)) < int32(_pPKey2.X2) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75433), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(75965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XKeyInfo)(_pPKey2.X0).X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75435), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XKeyInfo)(_pPKey2.X0).X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76078)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _idx1 > _szHdr1 && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76105)))
crt.X__builtin_abort(tls)
}
}()
_17:
if (int32(_pRhs.X1) & i32(4)) == 0 {
goto _18
}
_4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1))))
if _4_serial_type >= uint32(i32(10)) {
_rc = i32(1)
goto _24
}
if _4_serial_type == uint32(i32(0)) {
_rc = i32(-1)
goto _24
}
if _4_serial_type == uint32(i32(7)) {
_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1)
_rc = -_sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0))))))
goto _24
}
_9_lhs = _vdbeRecordDecodeInt(tls, _4_serial_type, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))))
_9_rhs = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))
if _9_lhs < _9_rhs {
_rc = i32(-1)
goto _27
}
if _9_lhs > _9_rhs {
_rc = i32(1)
}
_27:
_24:
goto _73
_18:
if (int32(_pRhs.X1) & i32(8)) == 0 {
goto _29
}
_4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1))))
if _4_serial_type >= uint32(i32(10)) {
_rc = i32(1)
goto _33
}
if _4_serial_type == uint32(i32(0)) {
_rc = i32(-1)
goto _33
}
_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _4_serial_type, &_mem1)
if _4_serial_type != uint32(i32(7)) {
goto _34
}
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0)))))) < (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) {
_rc = i32(-1)
goto _37
}
if (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0)))))) > (*(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0)))))) {
_rc = i32(1)
}
_37:
goto _38
_34:
_rc = _sqlite3IntFloatCompare(tls, *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_mem1.X0))))), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0))))))
_38:
_33:
goto _73
_29:
if (int32(_pRhs.X1) & i32(2)) == 0 {
goto _40
}
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)
}
}()
if _4_serial_type < uint32(i32(12)) {
_rc = i32(-1)
goto _46
}
if (_4_serial_type & uint32(i32(1))) == 0 {
_rc = i32(1)
goto _46
}
*(*int32)(unsafe.Pointer(&(_mem1.X4))) = int32((_4_serial_type - uint32(i32(12))) / uint32(i32(2)))
if (_d1 + uint32(_mem1.X4)) > uint32(_nKey1) {
*(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75501)))
return i32(0)
}
if (*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 4*uintptr(_i)))) != nil {
*(*uint8)(unsafe.Pointer(&(_mem1.X2))) = _pKeyInfo.X1
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem1.X9))))) = (*Xsqlite3)(_pKeyInfo.X4)
*(*uint16)(unsafe.Pointer(&(_mem1.X1))) = uint16(i32(2))
*(**int8)(unsafe.Pointer(&(_mem1.X5))) = (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_d1)))))
_rc = _vdbeCompareMemString(tls, &_mem1, _pRhs, *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 4*uintptr(_i))), (*uint8)(unsafe.Pointer(&(_pPKey2.X4))))
goto _50
}
_26_nCmp = func() int32 {
if (_mem1.X4) < (_pRhs.X4) {
return (_mem1.X4)
}
return (_pRhs.X4)
}()
_rc = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1)))), (unsafe.Pointer)(_pRhs.X5), uint32(_26_nCmp))
if _rc == i32(0) {
_rc = (_mem1.X4) - (_pRhs.X4)
}
_50:
_46:
goto _73
_40:
if (int32(_pRhs.X1) & i32(16)) == 0 {
goto _55
}
func() {
if (int32(_pRhs.X1)&i32(16384)) != i32(0) && (_pRhs.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75521), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76132)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1)))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_idx1))), &_4_serial_type)
}
}()
if (_4_serial_type < uint32(i32(12))) || ((_4_serial_type & uint32(i32(1))) != 0) {
_rc = i32(-1)
goto _63
}
_29_nStr = int32((_4_serial_type - uint32(i32(12))) / uint32(i32(2)))
if (_d1 + uint32(_29_nStr)) > uint32(_nKey1) {
*(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75531)))
return i32(0)
}
if (int32(_pRhs.X1) & i32(16384)) == 0 {
goto _66
}
if _isAllZero(tls, (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))))), _29_nStr) == 0 {
_rc = i32(1)
goto _68
}
_rc = _29_nStr - (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pRhs.X0))))))
_68:
goto _69
_66:
_34_nCmp = func() int32 {
if _29_nStr < (_pRhs.X4) {
return _29_nStr
}
return (_pRhs.X4)
}()
_rc = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1)))), (unsafe.Pointer)(_pRhs.X5), uint32(_34_nCmp))
if _rc == i32(0) {
_rc = _29_nStr - (_pRhs.X4)
}
_69:
_63:
goto _73
_55:
_4_serial_type = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(_idx1))))
_rc = bool2int(_4_serial_type != uint32(i32(0)))
_73:
if _rc == i32(0) {
goto _74
}
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 {
_rc = -_rc
}
func() {
if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _rc) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75557), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76174)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_mem1.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75558), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76223)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_74:
_i += 1
*(*uintptr)(unsafe.Pointer(&_pRhs)) += uintptr(48)
{
p := &_d1
*p = (*p) + _sqlite3VdbeSerialTypeLen(tls, _4_serial_type)
sink5 = *p
}
{
p := &_idx1
*p = (*p) + uint32(_sqlite3VarintLen(tls, uint64(_4_serial_type)))
sink5 = *p
}
if ((_idx1 < _szHdr1) && (_i < int32(_pPKey2.X2))) && (_d1 <= uint32(_nKey1)) {
goto _17
}
func() {
if (_mem1.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75571), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76223)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X6) != i32(0) && _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, int32(_pPKey2.X3)) == 0 && ((*Xsqlite3)(_pKeyInfo.X4).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000))), unsafe.Pointer(str(76240)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1))
return int32(_pPKey2.X3)
_ = _mem1
panic(0)
}
// Return the length of the data corresponding to the supplied serial-type.
func _sqlite3VdbeSerialTypeLen(tls *crt.TLS, _serial_type uint32) (r0 uint32) {
if _serial_type >= uint32(i32(128)) {
return (_serial_type - uint32(i32(12))) / uint32(i32(2))
}
func() {
if _serial_type >= uint32(i32(12)) && uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))) != ((_serial_type-uint32(i32(12)))/uint32(i32(2))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeLenØ00__func__Ø000))), unsafe.Pointer(str(76349)))
crt.X__builtin_abort(tls)
}
}()
return uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type))))
}
var _sqlite3SmallTypeSizes [128]uint8
func init() {
_sqlite3SmallTypeSizes = [128]uint8{0, 1, 2, 3, 4, 6, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 57}
}
var _sqlite3VdbeSerialTypeLenØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeLenØ00__func__Ø000[0], str(76424), 25)
}
var _sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000 [33]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeRecordCompareWithSkipØ00__func__Ø000[0], str(76449), 33)
}
// The first argument passed to this function is a serial-type that
// corresponds to an integer - all values between 1 and 9 inclusive
// except 7. The second points to a buffer containing an integer value
// serialized according to serial_type. This function deserializes
// and returns the value.
func _vdbeRecordDecodeInt(tls *crt.TLS, _serial_type uint32, _aKey *uint8) (r0 int64) {
var _y uint32
var _4_x uint64
func() {
if (_sqlite3Config.X6) != i32(0) && (_serial_type < uint32(i32(1)) || _serial_type > uint32(i32(9)) || _serial_type == uint32(i32(7))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75344), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordDecodeIntØ00__func__Ø000))), unsafe.Pointer(str(76482)))
crt.X__builtin_abort(tls)
}
}()
switch _serial_type {
case u32(0):
goto _6
case u32(1):
goto _6
case u32(2):
goto _8
case u32(3):
goto _9
case u32(4):
goto _10
case u32(5):
goto _11
case u32(6):
goto _12
default:
goto _13
}
_6:
return int64(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))
_8:
return int64((i32(256) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))))
_9:
return int64(((i32(65536) * int32(int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1))))) << uint(i32(8)))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(2))))))
_10:
_y = (((uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(0))))) << uint(i32(24))) | uint32(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey)) + 1*uintptr(i32(1)))))< uint32(i32(98307)) {
return i32(11)
}
_d1 = _szHdr1
func() {
if (int32(_pKeyInfo.X2)+int32(_pKeyInfo.X3)) < int32(_pPKey2.X2) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75039), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76569)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pKeyInfo.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75040), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(37852)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pKeyInfo.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75041), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76634)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _idx1 > _szHdr1 && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75042), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76105)))
crt.X__builtin_abort(tls)
}
}()
_14:
{
p := &_idx1
*p = (*p) + uint32(uint8(func() int32 {
if int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx1)))))))) < int32(u8(128)) {
return func() int32 {
_1_serial_type1 = uint32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx1))))))))
return i32(1)
}()
}
return int32(_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_aKey1))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_idx1))))))), &_1_serial_type1))
}()))
sink5 = *p
}
if (((_d1 + _1_serial_type1) + uint32(i32(2))) > uint32(_nKey1)) && ((_d1 + _sqlite3VdbeSerialTypeLen(tls, _1_serial_type1)) > uint32(_nKey1)) {
goto _19
}
{
p := &_d1
*p = (*p) + _sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_d1))), _1_serial_type1, &_mem1)
sink5 = *p
}
_rc = _sqlite3MemCompare(tls, &_mem1, (*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+48*uintptr(_i))), *(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 4*uintptr(_i))))
if _rc == i32(0) {
goto _20
}
func() {
if (_mem1.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75069), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76223)))
crt.X__builtin_abort(tls)
}
}()
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyInfo.X5)) + 1*uintptr(_i)))) != 0 {
_rc = -_rc
}
goto _debugCompareEnd
_20:
_i += 1
if (_idx1 < _szHdr1) && (_i < int32(_pPKey2.X2)) {
goto _14
}
_19:
func() {
if (_mem1.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75082), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareDebugØ00__func__Ø000))), unsafe.Pointer(str(76223)))
crt.X__builtin_abort(tls)
}
}()
_rc = int32(_pPKey2.X3)
_debugCompareEnd:
if (_desiredResult == i32(0)) && (_rc == i32(0)) {
return i32(1)
}
if (_desiredResult < i32(0)) && (_rc < i32(0)) {
return i32(1)
}
if (_desiredResult > i32(0)) && (_rc > i32(0)) {
return i32(1)
}
if (_sqlite3Config.X6) == i32(0) {
return i32(1)
}
if ((*Xsqlite3)(_pKeyInfo.X4).X17) != 0 {
return i32(1)
}
return i32(0)
_ = _mem1
panic(0)
}
var _vdbeRecordCompareDebugØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_vdbeRecordCompareDebugØ00__func__Ø000[0], str(76653), 23)
}
// Return the number of bytes that will be needed to store the given
// 64-bit integer.
func _sqlite3VarintLen(tls *crt.TLS, _v uint64) (r0 int32) {
var _i int32
_i = i32(1)
_0:
if store17(func() (*uint64, uint64) { p := &_v; return p, ((*p) >> uint(i32(7))) }()) == uint64(i32(0)) {
goto _3
}
func() {
if _i >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28787), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VarintLenØ00__func__Ø000))), unsafe.Pointer(str(76676)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _0
_3:
return _i
}
var _sqlite3VarintLenØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VarintLenØ00__func__Ø000[0], str(76681), 17)
}
var _sqlite3VdbeFindCompareØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeFindCompareØ00__func__Ø000[0], str(76698), 23)
}
// This function is an optimized version of sqlite3VdbeRecordCompare()
// that (a) the first field of pPKey2 is a string, that (b) the first field
// uses the collation sequence BINARY and (c) that the size-of-header varint
// at the start of (pKey1/nKey1) fits in a single byte.
func _vdbeRecordCompareString(tls *crt.TLS, _nKey1 int32, _pKey1 unsafe.Pointer, _pPKey2 *XUnpackedRecord) (r0 int32) {
var _serial_type, _res, _3_nCmp, _3_nStr, _3_szHdr int32
var _aKey1 *uint8
_aKey1 = (*uint8)(_pKey1)
func() {
if (int32((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+48*uintptr(i32(0)))).X1) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75702), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000))), unsafe.Pointer(str(76721)))
crt.X__builtin_abort(tls)
}
}()
_vdbeAssertFieldCountWithinLimits(tls, _nKey1, _pKey1, (*XKeyInfo)(_pPKey2.X0))
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(1))))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_serial_type)))
}
}()
if _serial_type < i32(12) {
_res = int32(_pPKey2.X5)
goto _7
}
if (_serial_type & i32(1)) == 0 {
_res = int32(_pPKey2.X6)
goto _7
}
_3_szHdr = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1)) + 1*uintptr(i32(0)))))
_3_nStr = (_serial_type - i32(12)) / i32(2)
if (_3_szHdr + _3_nStr) > _nKey1 {
*(*uint8)(unsafe.Pointer(&(_pPKey2.X4))) = uint8(_sqlite3CorruptError(tls, i32(75716)))
return i32(0)
}
_3_nCmp = func() int32 {
if ((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1) + 48*uintptr(i32(0)))).X4) < _3_nStr {
return ((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1) + 48*uintptr(i32(0)))).X4)
}
return _3_nStr
}()
_res = crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aKey1))+1*uintptr(_3_szHdr)))), (unsafe.Pointer)((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1)+48*uintptr(i32(0)))).X5), uint32(_3_nCmp))
if _res != i32(0) {
goto _11
}
_res = _3_nStr - ((*XMem)(unsafe.Pointer(uintptr(_pPKey2.X1) + 48*uintptr(i32(0)))).X4)
if _res != i32(0) {
goto _12
}
if int32(_pPKey2.X2) > i32(1) {
_res = _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _pPKey2, i32(1))
goto _14
}
_res = int32(_pPKey2.X3)
*(*uint8)(unsafe.Pointer(&(_pPKey2.X7))) = uint8(i32(1))
_14:
goto _17
_12:
if _res > i32(0) {
_res = int32(_pPKey2.X6)
goto _17
}
_res = int32(_pPKey2.X5)
_17:
goto _20
_11:
if _res > i32(0) {
_res = int32(_pPKey2.X6)
goto _20
}
_res = int32(_pPKey2.X5)
_20:
_7:
func() {
if _vdbeRecordCompareDebug(tls, _nKey1, _pKey1, _pPKey2, _res) == 0 && (_sqlite3Config.X6) != i32(0) && ((*Xsqlite3)((*XKeyInfo)(_pPKey2.X0).X4).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75743), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeRecordCompareStringØ00__func__Ø000))), unsafe.Pointer(str(76753)))
crt.X__builtin_abort(tls)
}
}()
return _res
}
var _vdbeRecordCompareStringØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_vdbeRecordCompareStringØ00__func__Ø000[0], str(76855), 24)
}
// Move the cursor to point to the root page of its b-tree structure.
//
// If the table has a virtual root page, then the cursor is moved to point
// to the virtual root page instead of the actual root page. A table has a
// virtual root page when the actual root page contains no cells and a
// single child page. This can only happen with the table rooted at page 1.
//
// If the b-tree structure is empty, the cursor state is set to
// CURSOR_INVALID. Otherwise, the cursor is set to point to the first
// cell located on the root (or virtual root) page and the cursor state
// is set to CURSOR_VALID.
//
// If this function returns successfully, it may be assumed that the
// page-header flags indicate that the [virtual] root-page is the expected
// kind of b-tree page (i.e. if when opening the cursor the caller did not
// specify a KeyInfo structure the flags byte is set to 0x05 or 0x0D,
// indicating a table b-tree, or if the caller did specify a KeyInfo
// structure the flags byte is set to 0x02 or 0x0A, indicating an index
// b-tree).
func _moveToRoot(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc int32
var _11_subpage uint32
var _pRoot *XMemPage
_rc = i32(0)
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63949), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
i32(0)
if int32(_pCur.X12) < i32(3) {
goto _2
}
if int32(_pCur.X12) == i32(4) {
func() {
if (_pCur.X9) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63955), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76879)))
crt.X__builtin_abort(tls)
}
}()
return _pCur.X9
}
_sqlite3BtreeClearCursor(tls, _pCur)
_2:
if int32(_pCur.X14) < i32(0) {
goto _6
}
if (_pCur.X14) == 0 {
goto _7
}
_8:
func() {
if (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63964), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76905)))
crt.X__builtin_abort(tls)
}
}()
_releasePageNotNull(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1))))))
if (_pCur.X14) != 0 {
goto _8
}
goto _skip_init
_7:
goto _13
_6:
if (_pCur.X7) == uint32(i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
return i32(0)
}
func() {
if int32(_pCur.X14) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63973), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76934)))
crt.X__builtin_abort(tls)
}
}()
_rc = _getAndInitPage(tls, (*XBtShared)((*XBtree)(_pCur.X0).X1), _pCur.X7, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+4*uintptr(i32(0)))), nil, int32(_pCur.X11))
if _rc != i32(0) {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
return _rc
}
*(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pCur.X15))) = (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(i32(0))))).X2
_13:
_pRoot = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(i32(0))))
func() {
if (_pRoot.X4) != (_pCur.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63984), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76952)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pRoot.X2) != i32(1) && int32(_pRoot.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63996), unsafe.Pointer((*int8)(unsafe.Pointer(&_moveToRootØ00__func__Ø000))), unsafe.Pointer(str(76980)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pRoot.X0) == i32(0)) || (bool2int((*XKeyInfo)(_pCur.X18) == nil) != int32(_pRoot.X2)) {
return _sqlite3CorruptError(tls, i32(63998))
}
_skip_init:
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-15))
sink2 = *p
}
_pRoot = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(i32(0))))
if int32(_pRoot.X14) > i32(0) {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1))
goto _28
}
if (_pRoot.X5) != 0 {
goto _26
}
if (_pRoot.X4) != uint32(i32(1)) {
return _sqlite3CorruptError(tls, i32(64011))
}
_11_subpage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8)))))
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1))
_rc = _moveToChild(tls, _pCur, _11_subpage)
goto _28
_26:
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
_28:
return _rc
}
var _moveToRootØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_moveToRootØ00__func__Ø000[0], str(77017), 11)
}
// 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 _sqlite3BtreeCursorHasMoved(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
return bool2int(int32(_pCur.X12) != i32(1))
}
// Something has moved cursor "p" out of place. Maybe the row it was
// pointed to was deleted out from under it. Or maybe the btree was
// rebalanced. Whatever the cause, try to restore "p" to the place it
// is supposed to be pointing. If the row was deleted out from under the
// cursor, set the cursor to point to a NULL row.
func _handleMovedCursor(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
var _isDifferentRow, _rc int32
func() {
if int32(_p.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74500), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000))), unsafe.Pointer(str(73776)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74501), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000))), unsafe.Pointer(str(77028)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74502), unsafe.Pointer((*int8)(unsafe.Pointer(&_handleMovedCursorØ00__func__Ø000))), unsafe.Pointer(str(77045)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeCursorRestore(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14)))))), &_isDifferentRow)
*(*uint32)(unsafe.Pointer(&(_p.X11))) = uint32(i32(0))
if _isDifferentRow != 0 {
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(1))
}
return _rc
}
var _handleMovedCursorØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_handleMovedCursorØ00__func__Ø000[0], str(77087), 18)
}
// 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 _sqlite3BtreeCursorRestore(tls *crt.TLS, _pCur *XBtCursor, _pDifferentRow *int32) (r0 int32) {
var _rc int32
func() {
if _pCur == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59888), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000))), unsafe.Pointer(str(77105)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59889), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000))), unsafe.Pointer(str(77113)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if int32(_pCur.X12) >= i32(3) {
return _btreeRestoreCursorPosition(tls, _pCur)
}
return i32(0)
}()
if _rc != 0 {
*_pDifferentRow = i32(1)
return _rc
}
if int32(_pCur.X12) != i32(1) {
*_pDifferentRow = i32(1)
goto _8
}
func() {
if (_pCur.X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59898), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorRestoreØ00__func__Ø000))), unsafe.Pointer(str(77140)))
crt.X__builtin_abort(tls)
}
}()
*_pDifferentRow = i32(0)
_8:
return i32(0)
}
var _sqlite3BtreeCursorRestoreØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCursorRestoreØ00__func__Ø000[0], str(77158), 26)
}
// The next routine used only within assert() statements
// Return true if the given BtCursor is valid. A valid cursor is one
// that is currently pointing to a row in a (non-empty) table.
// This is a verification routine is used only within assert() statements.
func _sqlite3BtreeCursorIsValid(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
return bool2int((_pCur != nil) && (int32(_pCur.X12) == i32(1)))
}
// 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 _sqlite3BtreePayloadFetch(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
return _fetchPayload(tls, _pCur, _pAmt)
}
// Return a pointer to payload information from the entry that the
// pCur cursor is pointing to. The pointer is to the beginning of
// the key if index btrees (pPage->intKey==0) and is the data for
// table btrees (pPage->intKey==1). The number of bytes of available
// key/data is written into *pAmt. If *pAmt==0, then the value
// returned will not be a valid pointer.
//
// This routine is an optimization. It is common for the entire key
// and data to fit on the local page and for there to be no overflow
// pages. When that is so, this routine can be used to access the
// key and data without making a copy. If the key and/or data spills
// onto overflow pages, then accessPayload() must be used to reassemble
// the key/data and copy it into a preallocated buffer.
//
// The pointer returned by this routine looks directly into the cached
// page of the database. The data might change or move the next time
// any btree routine is called.
func _fetchPayload(tls *crt.TLS, _pCur *XBtCursor, _pAmt *uint32) (r0 unsafe.Pointer) {
var _amt uint32
func() {
if _pCur == nil || int32(_pCur.X14) < i32(0) || (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63816), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77184)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63817), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.X0).X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63818), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(73849)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63819), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63820), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(10597)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63821), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77239)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1)) <= uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X19)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63822), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77258)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1)) >= uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X20)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63823), unsafe.Pointer((*int8)(unsafe.Pointer(&_fetchPayloadØ00__func__Ø000))), unsafe.Pointer(str(77325)))
crt.X__builtin_abort(tls)
}
}()
_amt = uint32(int32((uintptr(unsafe.Pointer((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X20)) - uintptr(unsafe.Pointer((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1))) / 1))
if uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3) < _amt {
_amt = uint32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X3)
}
*_pAmt = _amt
return (unsafe.Pointer)((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X1)
}
var _fetchPayloadØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_fetchPayloadØ00__func__Ø000[0], str(77394), 13)
}
func _sqlite3VdbeMemFromBtree(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
var _rc int32
var _available uint32
var _zData *int8
_available = u32(0)
_rc = i32(0)
func() {
if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70690), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000))), unsafe.Pointer(str(77407)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(9312)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70691), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000))), unsafe.Pointer(str(77439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000))), unsafe.Pointer(str(6728)))
crt.X__builtin_abort(tls)
}
}()
_zData = (*int8)(_sqlite3BtreePayloadFetch(tls, _pCur, &_available))
func() {
if _zData == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70697), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemFromBtreeØ00__func__Ø000))), unsafe.Pointer(str(77461)))
crt.X__builtin_abort(tls)
}
}()
if (_offset + _amt) <= _available {
*(**int8)(unsafe.Pointer(&(_pMem.X5))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zData)) + 1*uintptr(_offset)))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(4112))
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(_amt)
goto _9
}
_rc = _vdbeMemFromBtreeResize(tls, _pCur, _offset, _amt, _pMem)
_9:
return _rc
}
var _sqlite3VdbeMemFromBtreeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemFromBtreeØ00__func__Ø000[0], str(77470), 24)
}
// Move data out of a btree key or data field and into a Mem structure.
// The data is payload from the entry that pCur is currently pointing
// to. offset and amt determine what portion of the data or key to retrieve.
// The result is written into the pMem element.
//
// The pMem object must have been initialized. This routine will use
// pMem->zMalloc to hold the content from the btree, if possible. New
// pMem->zMalloc space will be allocated if necessary. The calling routine
// is responsible for making sure that the pMem object is eventually
// destroyed.
//
// If this routine fails for any reason (malloc returns NULL or unable
// to read from the disk) then the pMem is left in an inconsistent state.
func _vdbeMemFromBtreeResize(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pMem *XMem) (r0 int32) {
var _rc int32
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1))
if i32(0) != store1(&_rc, _sqlite3VdbeMemClearAndResize(tls, _pMem, int32(_amt+uint32(i32(2))))) {
goto _0
}
_rc = _sqlite3BtreePayload(tls, _pCur, _offset, _amt, (unsafe.Pointer)(_pMem.X5))
if _rc == i32(0) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_amt))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(_amt+uint32(i32(1))))) = int8(i32(0))
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(528))
*(*int32)(unsafe.Pointer(&(_pMem.X4))) = int32(_amt)
goto _2
}
_sqlite3VdbeMemRelease(tls, _pMem)
_2:
_0:
return _rc
}
func _sqlite3VdbeOneByteSerialTypeLen(tls *crt.TLS, _serial_type uint8) (r0 uint8) {
func() {
if int32(_serial_type) >= i32(128) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000))), unsafe.Pointer(str(77494)))
crt.X__builtin_abort(tls)
}
}()
return *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))
}
var _sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeOneByteSerialTypeLenØ00__func__Ø000[0], str(77510), 32)
}
var _sqlite3VdbeExecØ00aFlagØ004 [2]uint16
func init() {
_sqlite3VdbeExecØ00aFlagØ004 = [2]uint16{u16(16), u16(514)}
}
var _sqlite3VdbeExecØ00aZeroØ005 [16]uint8
// Return the serial-type for the value stored in pMem.
func _sqlite3VdbeSerialType(tls *crt.TLS, _pMem *XMem, _file_format int32, _pLen *uint32) (r0 uint32) {
var _flags int32
var _2_i int64
var _n uint32
var _2_u uint64
_flags = int32(_pMem.X1)
func() {
if _pLen == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74602), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000))), unsafe.Pointer(str(77542)))
crt.X__builtin_abort(tls)
}
}()
if (_flags & i32(1)) != 0 {
*_pLen = uint32(i32(0))
return uint32(i32(0))
}
if (_flags & i32(4)) == 0 {
goto _3
}
_2_i = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))
if _2_i < int64(i32(0)) {
_2_u = uint64(^_2_i)
goto _5
}
_2_u = uint64(_2_i)
_5:
if _2_u > uint64(i32(127)) {
goto _6
}
if ((_2_i & int64(i32(1))) == _2_i) && (_file_format >= i32(4)) {
*_pLen = uint32(i32(0))
return uint32(i32(8)) + uint32(_2_u)
}
*_pLen = uint32(i32(1))
return uint32(i32(1))
_6:
if _2_u <= uint64(i32(32767)) {
*_pLen = uint32(i32(2))
return uint32(i32(2))
}
if _2_u <= uint64(i32(8388607)) {
*_pLen = uint32(i32(3))
return uint32(i32(3))
}
if _2_u <= uint64(i32(2147483647)) {
*_pLen = uint32(i32(4))
return uint32(i32(4))
}
if _2_u <= uint64(i64(140737488355327)) {
*_pLen = uint32(i32(6))
return uint32(i32(5))
}
*_pLen = uint32(i32(8))
return uint32(i32(6))
_3:
if (_flags & i32(8)) != 0 {
*_pLen = uint32(i32(8))
return uint32(i32(7))
}
func() {
if ((*Xsqlite3)(_pMem.X9).X17) == 0 && (_flags&i32(18)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000))), unsafe.Pointer(str(77550)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pMem.X4) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialTypeØ00__func__Ø000))), unsafe.Pointer(str(6001)))
crt.X__builtin_abort(tls)
}
}()
_n = uint32(_pMem.X4)
if (_flags & i32(16384)) != 0 {
{
p := &_n
*p = (*p) + uint32(*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
sink5 = *p
}
}
*_pLen = _n
return ((_n * uint32(i32(2))) + uint32(i32(12))) + uint32(bool2int((_flags&i32(2)) != i32(0)))
}
var _sqlite3VdbeSerialTypeØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSerialTypeØ00__func__Ø000[0], str(77601), 22)
}
func _sqlite3PutVarint(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
if _v <= uint64(i32(127)) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(_v & uint64(i32(127)))
return i32(1)
}
if _v <= uint64(i32(16383)) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(0)))) = uint8(((_v >> uint(i32(7))) & uint64(i32(127))) | uint64(i32(128)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(1)))) = uint8(_v & uint64(i32(127)))
return i32(2)
}
return _putVarint64(tls, _p, _v)
}
// Write a 64-bit variable-length integer to memory starting at p[0].
// The length of data write will be between 1 and 9 bytes. The number
// of bytes written is returned.
//
// A variable-length integer consists of the lower 7 bits of each byte
// for all bytes that have the 8th bit set and one byte with the 8th
// bit clear. Except, if we get to the 9th byte, it stores the full
// 8 bits and is the last byte.
func _putVarint64(tls *crt.TLS, _p *uint8, _v uint64) (r0 int32) {
var _i, _j, _n int32
var _buf [10]uint8
if (_v & u64(18374686479671623680)) == 0 {
goto _0
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(i32(8)))) = uint8(_v)
{
p := &_v
*p = (*p) >> uint(i32(8))
sink17 = *p
}
_i = i32(7)
_1:
if _i < i32(0) {
goto _4
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(_i))) = uint8((_v & uint64(i32(127))) | uint64(i32(128)))
{
p := &_v
*p = (*p) >> uint(i32(7))
sink17 = *p
}
_i -= 1
goto _1
_4:
return i32(9)
_0:
_n = i32(0)
_5:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(postInc1(&_n, int32(1))))) = uint8((_v & uint64(i32(127))) | uint64(i32(128)))
{
p := &_v
*p = (*p) >> uint(i32(7))
sink17 = *p
}
if _v != uint64(i32(0)) {
goto _5
}
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(i32(0))))
*p = uint8(int32(*p) & i32(127))
sink2 = *p
}
func() {
if _n > i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(28455), unsafe.Pointer((*int8)(unsafe.Pointer(&_putVarint64Ø00__func__Ø000))), unsafe.Pointer(str(77623)))
crt.X__builtin_abort(tls)
}
}()
*func() *int32 { _i = i32(0); return &_j }() = _n - i32(1)
_8:
if _j < i32(0) {
goto _11
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_buf)) + 1*uintptr(_j)))
*func() *int32 { _j -= 1; return &_i }() += 1
goto _8
_11:
return _n
_ = _buf
panic(0)
}
var _putVarint64Ø00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_putVarint64Ø00__func__Ø000[0], str(77628), 12)
}
func _sqlite3VdbeSerialPut(tls *crt.TLS, _buf *uint8, _pMem *XMem, _serial_type uint32) (r0 uint32) {
var _len, _1_i uint32
var _1_v uint64
if _serial_type > uint32(i32(7)) || _serial_type <= uint32(i32(0)) {
goto _1
}
if _serial_type == uint32(i32(7)) {
i32(0)
crt.Xmemcpy(tls, (unsafe.Pointer)(&_1_v), (unsafe.Pointer)((*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))), u32(8))
goto _3
}
_1_v = uint64(*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
_3:
_len = store5(&_1_i, uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_serial_type)))))
func() {
if _1_i <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000))), unsafe.Pointer(str(12970)))
crt.X__builtin_abort(tls)
}
}()
_6:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_buf)) + 1*uintptr(preInc5(&_1_i, uint32(4294967295))))) = uint8(_1_v & uint64(i32(255)))
{
p := &_1_v
*p = (*p) >> uint(i32(8))
sink17 = *p
}
if _1_i != 0 {
goto _6
}
return _len
_1:
if _serial_type < uint32(i32(12)) {
goto _7
}
func() {
if ((_pMem.X4) + func() int32 {
if (int32(_pMem.X1) & i32(16384)) != 0 {
return (*(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))
}
return i32(0)
}()) != int32(_sqlite3VdbeSerialTypeLen(tls, _serial_type)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74775), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSerialPutØ00__func__Ø000))), unsafe.Pointer(str(77640)))
crt.X__builtin_abort(tls)
}
}()
_len = uint32(_pMem.X4)
if _len > uint32(i32(0)) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_buf), (unsafe.Pointer)(_pMem.X5), _len)
}
return _len
_7:
return uint32(i32(0))
}
var _sqlite3VdbeSerialPutØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSerialPutØ00__func__Ø000[0], str(77739), 21)
}
// 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 _sqlite3BtreeCount(tls *crt.TLS, _pCur *XBtCursor, _pnEntry *int64) (r0 int32) {
var _rc, _2_iIdx int32
var _nEntry int64
var _2_pPage *XMemPage
_nEntry = i64(0)
if (_pCur.X7) == uint32(i32(0)) {
*_pnEntry = int64(i32(0))
return i32(0)
}
_rc = _moveToRoot(tls, _pCur)
_1:
if _rc != i32(0) {
goto _2
}
_2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
if ((_2_pPage.X5) != 0) || ((_2_pPage.X2) == 0) {
{
p := &_nEntry
*p = (*p) + int64(_2_pPage.X14)
sink6 = *p
}
}
if (_2_pPage.X5) == 0 {
goto _5
}
_6:
if int32(_pCur.X14) == i32(0) {
*_pnEntry = _nEntry
return _moveToRoot(tls, _pCur)
}
_moveToParent(tls, _pCur)
if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) {
goto _6
}
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) += 1
_2_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
_5:
_2_iIdx = int32(_pCur.X16)
if _2_iIdx == int32(_2_pPage.X14) {
_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pPage.X19))+1*uintptr(int32(_2_pPage.X6)+i32(8))))))
goto _9
}
_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_2_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_2_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pPage.X21))+1*uintptr(i32(2)*_2_iIdx))))) + 1*uintptr(i32(0)))))< i32(15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(77952)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
func() {
if int32(_p.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67893), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(77829)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XMemPage)(_pBt.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67894), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(77970)))
crt.X__builtin_abort(tls)
}
}()
_pP1 = (*XMemPage)(_pBt.X3).X19
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23))
if _rc != i32(0) {
goto _7
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pP1))+1*uintptr(i32(36)+(_idx*i32(4))))), _iMeta)
if _idx == i32(7) {
func() {
if (_pBt.X5) == 0 && _iMeta != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67901), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(77985)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iMeta != uint32(i32(0)) && _iMeta != uint32(i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67902), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeUpdateMetaØ00__func__Ø000))), unsafe.Pointer(str(78013)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(_iMeta)
}
_7:
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeUpdateMetaØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeUpdateMetaØ00__func__Ø000[0], str(78034), 23)
}
// Allocate VdbeCursor number iCur. Return a pointer to it. Return NULL
// if we run out of memory.
func _allocateCursor(tls *crt.TLS, _p *TVdbe, _iCur int32, _nField int32, _iDb int32, _eCurType uint8) (r0 *XVdbeCursor) {
var _nByte int32
var _pMem *XMem
var _pCx *XVdbeCursor
_pMem = func() *XMem {
if _iCur > i32(0) {
return (*XMem)(unsafe.Pointer(uintptr(_p.X18) + 48*uintptr((_p.X6)-_iCur)))
}
return (*XMem)(_p.X18)
}()
_pCx = nil
_nByte = int32((u32(88) + (u32(8) * uint32(_nField))) + uint32(func() int32 {
if int32(_eCurType) == i32(0) {
return _sqlite3BtreeCursorSize(tls)
}
return i32(0)
}()))
func() {
if _iCur < i32(0) || _iCur >= (_p.X7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78418), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateCursorØ00__func__Ø000))), unsafe.Pointer(str(78057)))
crt.X__builtin_abort(tls)
}
}()
if (*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_iCur)))) != nil {
_sqlite3VdbeFreeCursor(tls, _p, *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_iCur))))
*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_iCur))) = nil
}
if i32(0) != _sqlite3VdbeMemClearAndResize(tls, _pMem, _nByte) {
goto _8
}
*(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X23)) + 4*uintptr(_iCur))) = store53(&_pCx, (*XVdbeCursor)(unsafe.Pointer(_pMem.X5)))
crt.Xmemset(tls, (unsafe.Pointer)(_pCx), i32(0), u32(32))
*(*uint8)(unsafe.Pointer(&(_pCx.X0))) = _eCurType
*(*int8)(unsafe.Pointer(&(_pCx.X1))) = int8(_iDb)
*(*int16)(unsafe.Pointer(&(_pCx.X18))) = int16(_nField)
*(**uint32)(unsafe.Pointer(&(_pCx.X21))) = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_pCx.X25))))) + 4*uintptr(_nField)))
if int32(_eCurType) == i32(0) {
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14))))))) = (*XBtCursor)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMem.X5)) + 1*uintptr(u32(88)+(u32(8)*uint32(_nField)))))))
_sqlite3BtreeCursorZero(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCx.X14)))))))
}
_8:
return _pCx
}
// 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 _sqlite3BtreeCursorSize(tls *crt.TLS) (r0 int32) {
return int32(u32(192))
}
var _allocateCursorØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_allocateCursorØ00__func__Ø000[0], str(78084), 15)
}
// 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 _sqlite3BtreeCursorZero(tls *crt.TLS, _p *XBtCursor) {
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(64))
}
func _sqlite3BtreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
var _rc int32
if _iTable < i32(1) {
_rc = _sqlite3CorruptError(tls, i32(63273))
goto _1
}
_sqlite3BtreeEnter(tls, _p)
_rc = _btreeCursor(tls, _p, _iTable, _wrFlag, _pKeyInfo, _pCur)
_sqlite3BtreeLeave(tls, _p)
_1:
return _rc
}
// Create a new cursor for the BTree whose root is on the page
// iTable. If a read-only cursor is requested, it is assumed that
// the caller already has at least a read-only transaction open
// on the database already. If a write-cursor is requested, then
// the caller is assumed to have an open write transaction.
//
// If the BTREE_WRCSR bit of wrFlag is clear, then the cursor can only
// be used for reading. If the BTREE_WRCSR bit is set, then the cursor
// can be used for reading or for writing if other conditions for writing
// are also met. These are the conditions that must be met in order
// for writing to be allowed:
//
// 1: The cursor must have been opened with wrFlag containing BTREE_WRCSR
//
// 2: Other database connections that share the same pager cache
// but which are not in the READ_UNCOMMITTED state may not have
// cursors open with wrFlag==0 on the same table. Otherwise
// the changes made by this write cursor would be visible to
// the read cursors in the other database connection.
//
// 3: The database must be writable (not on read-only media)
//
// 4: There must be an active transaction.
//
// The BTREE_FORDELETE bit of wrFlag may optionally be set if BTREE_WRCSR
// is set. If FORDELETE is set, that is a hint to the implementation that
// this cursor will only be used to seek to and delete entries of an index
// as part of a larger DELETE statement. The FORDELETE hint is not used by
// this implementation. But in a hypothetical alternative storage engine
// in which index entries are automatically deleted when corresponding table
// rows are deleted, the FORDELETE flag is a hint that all SEEK and DELETE
// operations on this cursor can be no-ops and all READ operations can
// return a null row (2-bytes: 0x01 0x00).
//
// No checking is done to make sure that page iTable really is the
// root page of a b-tree. If it is not, then the cursor acquired
// will not work correctly.
//
// It is assumed that the sqlite3BtreeCursorZero() has been called
// on pCur to initialize the memory space prior to invoking this routine.
func _btreeCursor(tls *crt.TLS, _p *XBtree, _iTable int32, _wrFlag int32, _pKeyInfo *XKeyInfo, _pCur *XBtCursor) (r0 int32) {
var _pBt *XBtShared
var _pX *XBtCursor
_pBt = (*XBtShared)(_p.X1)
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63214), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _wrFlag != i32(0) && _wrFlag != i32(4) && _wrFlag != i32(12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63215), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78099)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasSharedCacheTableLock(tls, _p, uint32(_iTable), bool2int(_pKeyInfo != nil), func() int32 {
if _wrFlag != 0 {
return i32(2)
}
return i32(1)
}()) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63224), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78173)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _wrFlag != i32(0) && _hasReadConflicts(tls, _p, uint32(_iTable)) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63225), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78235)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63228), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(54142)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _wrFlag != i32(0) && int32(_p.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63229), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78277)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XMemPage)(_pBt.X3) == nil || ((*XMemPage)(_pBt.X3).X19) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63230), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78314)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _wrFlag != i32(0) && (int32(_pBt.X10)&i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63231), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78348)))
crt.X__builtin_abort(tls)
}
}()
if _wrFlag == 0 {
goto _24
}
_allocateTempSpace(tls, _pBt)
if (_pBt.X27) == nil {
return _sqlite3NomemError(tls, i32(63235))
}
_24:
if (_iTable == i32(1)) && (_btreePagecount(tls, _pBt) == uint32(i32(0))) {
func() {
if _wrFlag != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63238), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCursorØ00__func__Ø000))), unsafe.Pointer(str(78396)))
crt.X__builtin_abort(tls)
}
}()
_iTable = i32(0)
}
*(*uint32)(unsafe.Pointer(&(_pCur.X7))) = uint32(_iTable)
*(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(-1))
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X18))))) = _pKeyInfo
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X0))))) = _p
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X1))))) = _pBt
*(*uint8)(unsafe.Pointer(&(_pCur.X10))) = uint8(func() int32 {
if _wrFlag != 0 {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pCur.X11))) = uint8(func() int32 {
if _wrFlag != 0 {
return i32(0)
}
return i32(2)
}())
_pX = (*XBtCursor)(_pBt.X2)
_34:
if _pX == nil {
goto _37
}
if (_pX.X7) == uint32(_iTable) {
{
p := (*uint8)(unsafe.Pointer(&(_pX.X10)))
*p = uint8(int32(*p) | i32(32))
sink2 = *p
}
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(32))
sink2 = *p
}
}
_pX = (*XBtCursor)(_pX.X2)
goto _34
_37:
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X2))))) = (*XBtCursor)(_pBt.X2)
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X2))))) = _pCur
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
return i32(0)
}
var _btreeCursorØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_btreeCursorØ00__func__Ø000[0], str(78406), 12)
}
// **** This function is only used as part of an assert() statement. ***
//
// Check to see if pBtree holds the required locks to read or write to the
// table with root page iRoot. Return 1 if it does and 0 if not.
//
// For example, when writing to a table with root-page iRoot via
// Btree connection pBtree:
//
// assert( hasSharedCacheTableLock(pBtree, iRoot, 0, WRITE_LOCK) );
//
// When writing to an index that resides in a sharable database, the
// caller should have first obtained a lock specifying the root page of
// the corresponding table. This makes things a bit more complicated,
// as this module treats each table as a separate structure. To determine
// the table corresponding to the index being written, this
// function has to search through the database schema.
//
// Instead of a lock on the table/index rooted at page iRoot, the caller may
// hold a write-lock on the schema table (root page 1). This is also
// acceptable.
func _hasSharedCacheTableLock(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32, _isIndex int32, _eLockType int32) (r0 int32) {
var _iTab uint32
var _pSchema *XSchema
var _3_p *XHashElem
var _pLock *XBtLock
var _4_pIdx *XIndex
_pSchema = (*XSchema)((*XBtShared)(_pBtree.X1).X19)
_iTab = u32(0)
if (int32(_pBtree.X3) == i32(0)) || ((_eLockType == i32(1)) && (((*Xsqlite3)(_pBtree.X0).X6)&i32(16384)) != 0) {
return i32(1)
}
if _isIndex != 0 && ((_pSchema == nil) || ((int32(_pSchema.X9) & i32(1)) == i32(0))) {
return i32(1)
}
if _isIndex == 0 {
goto _6
}
_3_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X3))).X2)
_7:
if _3_p == nil {
goto _10
}
_4_pIdx = (*XIndex)(_3_p.X2)
if (_4_pIdx.X11) != int32(_iRoot) {
goto _11
}
if _iTab != 0 {
return i32(1)
}
_iTab = uint32((*XTable)(_4_pIdx.X3).X7)
_11:
_3_p = (*XHashElem)(_3_p.X0)
goto _7
_10:
goto _13
_6:
_iTab = _iRoot
_13:
_pLock = (*XBtLock)((*XBtShared)(_pBtree.X1).X25)
_14:
if _pLock == nil {
goto _17
}
if (((*XBtree)(_pLock.X0) == _pBtree) && (((_pLock.X1) == _iTab) || ((int32(_pLock.X2) == i32(2)) && ((_pLock.X1) == uint32(i32(1)))))) && (int32(_pLock.X2) >= _eLockType) {
return i32(1)
}
_pLock = (*XBtLock)(_pLock.X3)
goto _14
_17:
return i32(0)
}
// **** This function may be used as part of assert() statements only. ****
//
// Return true if it would be illegal for pBtree to write into the
// table or index rooted at iRoot because other shared connections are
// simultaneously reading that same table or index.
//
// It is illegal for pBtree to write if some other Btree object that
// shares the same BtShared object is currently reading or writing
// the iRoot table. Except, if the other Btree object has the
// read-uncommitted flag set, then it is OK for the other object to
// have a read cursor.
//
// For example, before writing to any part of the table or index
// rooted at page iRoot, one should call:
//
// assert( !hasReadConflicts(pBtree, iRoot) );
func _hasReadConflicts(tls *crt.TLS, _pBtree *XBtree, _iRoot uint32) (r0 int32) {
var _p *XBtCursor
_p = (*XBtCursor)((*XBtShared)(_pBtree.X1).X2)
_0:
if _p == nil {
goto _3
}
if (((_p.X7) == _iRoot) && ((*XBtree)(_p.X0) != _pBtree)) && (i32(0) == (((*Xsqlite3)((*XBtree)(_p.X0).X0).X6) & i32(16384))) {
return i32(1)
}
_p = (*XBtCursor)(_p.X2)
goto _0
_3:
return i32(0)
}
// Make sure pBt->pTmpSpace points to an allocation of
// MX_CELL_SIZE(pBt) bytes with a 4-byte prefix for a left-child
// pointer.
func _allocateTempSpace(tls *crt.TLS, _pBt *XBtShared) {
if (_pBt.X27) != nil {
goto _0
}
*(**uint8)(unsafe.Pointer(&(_pBt.X27))) = (*uint8)(_sqlite3PageMalloc(tls, int32(_pBt.X15)))
if (_pBt.X27) != nil {
crt.Xmemset(tls, (unsafe.Pointer)(_pBt.X27), i32(0), uint32(i32(8)))
{
p := (**uint8)(unsafe.Pointer(&(_pBt.X27)))
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(4))))
sink13 = *p
}
}
_0:
}
// Provide flag hints to the cursor.
func _sqlite3BtreeCursorHintFlags(tls *crt.TLS, _pCur *XBtCursor, _x uint32) {
func() {
if _x != uint32(i32(2)) && _x != uint32(i32(1)) && _x != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59919), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorHintFlagsØ00__func__Ø000))), unsafe.Pointer(str(78418)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pCur.X13))) = uint8(_x)
}
var _sqlite3BtreeCursorHintFlagsØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCursorHintFlagsØ00__func__Ø000[0], str(78464), 28)
}
// 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 _sqlite3BtreeOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zFilename *int8, _db *Xsqlite3, _ppBtree **XBtree, _flags int32, _vfsFlags int32) (r0 int32) {
var _rc, _isTempDb, _isMemdb, _5_nFilename, _5_nFullPathname, _11_iDb, _25_i int32
var _5_zFullPathname *int8
var _nReserve uint8
var _mutexOpen, _5_mutexShared, _22_mutexShared *Xsqlite3_mutex
var _p, _12_pExisting, _25_pSib *XBtree
var _35_pFile *Xsqlite3_file
var _zDbHeader [100]uint8
var _pBt *XBtShared
_pBt = nil
_mutexOpen = nil
_rc = i32(0)
_isTempDb = bool2int((_zFilename == nil) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == i32(0)))
_isMemdb = bool2int((((_zFilename != nil) && (crt.Xstrcmp(tls, _zFilename, str(78492)) == i32(0))) || (_isTempDb != 0 && _sqlite3TempInMemory(tls, _db) != 0)) || ((_vfsFlags & i32(128)) != i32(0)))
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61256), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pVfs == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61257), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78501)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61258), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_flags & i32(255)) != _flags {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61259), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78509)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_flags&i32(8)) != i32(0) && (_flags&i32(4)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61262), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78529)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_flags&i32(4)) != i32(0) && _isTempDb == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61265), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78587)))
crt.X__builtin_abort(tls)
}
}()
if _isMemdb != 0 {
{
p := &_flags
*p = (*p) | i32(2)
sink1 = *p
}
}
if ((_vfsFlags & i32(256)) != i32(0)) && (_isMemdb != 0 || _isTempDb != 0) {
_vfsFlags = (_vfsFlags & i32(-257)) | i32(512)
}
_p = (*XBtree)(_sqlite3MallocZero(tls, uint64(u32(48))))
if _p == nil {
return _sqlite3NomemError(tls, i32(61275))
}
*(*uint8)(unsafe.Pointer(&(_p.X2))) = uint8(i32(0))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _db
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X0))))) = _p
*(*uint32)(unsafe.Pointer(&((*XBtLock)(unsafe.Pointer(&(_p.X11))).X1))) = uint32(i32(1))
if _isTempDb != i32(0) || _isMemdb != i32(0) && (_vfsFlags&i32(64)) == i32(0) {
goto _26
}
if (_vfsFlags & i32(131072)) == 0 {
goto _27
}
_5_nFilename = _sqlite3Strlen30(tls, _zFilename) + i32(1)
_5_nFullPathname = (_pVfs.X2) + i32(1)
_5_zFullPathname = (*int8)(_sqlite3Malloc(tls, uint64(func() int32 {
if _5_nFullPathname > _5_nFilename {
return _5_nFullPathname
}
return _5_nFilename
}())))
*(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1))
if _5_zFullPathname == nil {
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
return _sqlite3NomemError(tls, i32(61299))
}
if _isMemdb != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)(_5_zFullPathname), (unsafe.Pointer)(_zFilename), uint32(_5_nFilename))
goto _32
}
_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _5_nFullPathname, _5_zFullPathname)
if _rc != 0 {
Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname))
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
return _rc
}
_32:
_mutexOpen = _sqlite3MutexAlloc(tls, i32(4))
Xsqlite3_mutex_enter(tls, _mutexOpen)
_5_mutexShared = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _5_mutexShared)
_pBt = _sqlite3SharedCacheList
_34:
if _pBt == nil {
goto _37
}
func() {
if (_pBt.X23) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61319), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78625)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != crt.Xstrcmp(tls, _5_zFullPathname, _sqlite3PagerFilename(tls, (*XPager)(_pBt.X0), i32(0))) || _sqlite3PagerVfs(tls, (*XPager)(_pBt.X0)) != _pVfs {
goto _41
}
_11_iDb = (_db.X5) - i32(1)
_42:
if _11_iDb < i32(0) {
goto _45
}
_12_pExisting = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_11_iDb))).X1)
if (_12_pExisting != nil) && ((*XBtShared)(_12_pExisting.X1) == _pBt) {
Xsqlite3_mutex_leave(tls, _5_mutexShared)
Xsqlite3_mutex_leave(tls, _mutexOpen)
Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname))
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
return i32(19)
}
_11_iDb -= 1
goto _42
_45:
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pBt
*(*int32)(unsafe.Pointer(&(_pBt.X23))) += 1
goto _37
_41:
_pBt = (*XBtShared)(_pBt.X24)
goto _34
_37:
Xsqlite3_mutex_leave(tls, _5_mutexShared)
Xsqlite3_free(tls, (unsafe.Pointer)(_5_zFullPathname))
goto _48
_27:
*(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1))
_48:
_26:
if _pBt != nil {
goto _49
}
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
_pBt = (*XBtShared)(_sqlite3MallocZero(tls, uint64(u32(84))))
if _pBt == nil {
_rc = _sqlite3NomemError(tls, i32(61367))
goto _btree_open_out
}
_rc = _sqlite3PagerOpen(tls, _pVfs, (**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X0))))), _zFilename, int32(u32(84)), _flags, _vfsFlags, _pageReinit)
if _rc == i32(0) {
_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.X0), _db.X8)
_rc = _sqlite3PagerReadFileheader(tls, (*XPager)(_pBt.X0), int32(u32(100)), (*uint8)(unsafe.Pointer(&_zDbHeader)))
}
if _rc != i32(0) {
goto _btree_open_out
}
*(*uint8)(unsafe.Pointer(&(_pBt.X4))) = uint8(_flags)
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X1))))) = _db
_sqlite3PagerSetBusyhandler(tls, (*XPager)(_pBt.X0), _btreeInvokeBusyHandler, (unsafe.Pointer)(_pBt))
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _pBt
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X2))))) = nil
*(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X3))))) = nil
if _sqlite3PagerIsreadonly(tls, (*XPager)(_pBt.X0)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
}
*(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(16))))) << uint(i32(8))) | (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(17))))) << uint(i32(16))))
if (_pBt.X15) >= uint32(i32(512)) && (_pBt.X15) <= uint32(i32(65536)) && (((_pBt.X15)-uint32(i32(1)))&(_pBt.X15)) == uint32(i32(0)) {
goto _56
}
*(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32(i32(0))
if (_zFilename != nil) && (_isMemdb == 0) {
*(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(i32(0))
}
_nReserve = uint8(i32(0))
goto _59
_56:
_nReserve = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader)) + 1*uintptr(i32(20))))
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(2))
sink14 = *p
}
*(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader))+1*uintptr(i32(52))))) != 0 {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 {
if _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDbHeader))+1*uintptr(i32(64))))) != 0 {
return i32(1)
}
return i32(0)
}())
_59:
_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), int32(_nReserve))
if _rc != 0 {
goto _btree_open_out
}
*(*uint32)(unsafe.Pointer(&(_pBt.X16))) = (_pBt.X15) - uint32(_nReserve)
func() {
if ((_pBt.X15) & uint32(i32(7))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61424), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78637)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pBt.X23))) = i32(1)
if (_p.X3) == 0 {
goto _67
}
_22_mutexShared = _sqlite3MutexAlloc(tls, i32(2))
if i32(1) == 0 || (_sqlite3Config.X1) == 0 {
goto _69
}
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X21))))) = _sqlite3MutexAlloc(tls, i32(0))
if (*Xsqlite3_mutex)(_pBt.X21) == nil {
_rc = _sqlite3NomemError(tls, i32(61436))
goto _btree_open_out
}
_69:
Xsqlite3_mutex_enter(tls, _22_mutexShared)
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X24))))) = _sqlite3SharedCacheList
_sqlite3SharedCacheList = _pBt
bug20530(_sqlite3SharedCacheList)
Xsqlite3_mutex_leave(tls, _22_mutexShared)
_67:
_49:
if (_p.X3) == 0 {
goto _71
}
_25_i = i32(0)
_72:
if _25_i >= (_db.X5) {
goto _75
}
if store54(&_25_pSib, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_25_i))).X1)) == nil || (_25_pSib.X3) == 0 {
goto _77
}
_78:
if (*XBtree)(_25_pSib.X10) != nil {
_25_pSib = (*XBtree)(_25_pSib.X10)
goto _78
}
if uint32(uintptr(unsafe.Pointer((*XBtShared)(_p.X1)))) < uint32(uintptr(unsafe.Pointer((*XBtShared)(_25_pSib.X1)))) {
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _25_pSib
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))) = nil
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_25_pSib.X10))))) = _p
goto _81
}
_82:
if ((*XBtree)(_25_pSib.X9) != nil) && (uint32(uintptr(unsafe.Pointer((*XBtShared)((*XBtree)(_25_pSib.X9).X1)))) < uint32(uintptr(unsafe.Pointer((*XBtShared)(_p.X1))))) {
_25_pSib = (*XBtree)(_25_pSib.X9)
goto _82
}
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = (*XBtree)(_25_pSib.X9)
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X10))))) = _25_pSib
if (*XBtree)(_p.X9) != nil {
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XBtree)(_p.X9).X10))))) = _p
}
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_25_pSib.X9))))) = _p
_81:
goto _75
_77:
_25_i += 1
goto _72
_75:
_71:
*_ppBtree = _p
_btree_open_out:
if _rc == i32(0) {
goto _86
}
if (_pBt != nil) && ((*XPager)(_pBt.X0) != nil) {
_sqlite3PagerClose(tls, (*XPager)(_pBt.X0), nil)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_pBt))
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
*_ppBtree = nil
goto _89
_86:
if _sqlite3BtreeSchema(tls, _p, i32(0), nil) == nil {
_sqlite3PagerSetCachesize(tls, (*XPager)((*XBtShared)(_p.X1).X0), i32(-2000))
}
_35_pFile = _sqlite3PagerFile(tls, (*XPager)(_pBt.X0))
if (*Xsqlite3_io_methods)(_35_pFile.X0) != nil {
_sqlite3OsFileControlHint(tls, _35_pFile, i32(30), (unsafe.Pointer)((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X1)))))
}
_89:
if _mutexOpen != nil {
func() {
if Xsqlite3_mutex_held(tls, _mutexOpen) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61506), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78660)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, _mutexOpen)
}
func() {
if _rc == i32(0) && _sqlite3BtreeConnectionCount(tls, *_ppBtree) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61509), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeOpenØ00__func__Ø000))), unsafe.Pointer(str(78690)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_ = _zDbHeader
panic(0)
}
var _sqlite3BtreeOpenØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeOpenØ00__func__Ø000[0], str(78747), 17)
}
func _sqlite3OsFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nPathOut int32, _zPathOut *int8) (r0 int32) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPathOut)) + 1*uintptr(i32(0)))) = int8(i32(0))
return (*(*func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32
}{(_pVfs.X9)})))(tls, _pVfs, _zPath, _nPathOut, _zPathOut)
}
// Return the VFS structure for the pager.
func _sqlite3PagerVfs(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_vfs) {
return (*Xsqlite3_vfs)(_pPager.X0)
}
// Allocate and initialize a new Pager object and put a pointer to it
// in *ppPager. The pager should eventually be freed by passing it
// to sqlite3PagerClose().
//
// The zFilename argument is the path to the database file to open.
// If zFilename is NULL then a randomly-named temporary file is created
// and used as the file to be cached. Temporary files are be deleted
// automatically when they are closed. If zFilename is ":memory:" then
// all information is held in cache. It is never written to disk.
// This can be used to implement an in-memory database.
//
// The nExtra parameter specifies the number of bytes of space allocated
// along with each page reference. This space is available to the user
// via the sqlite3PagerGetExtra() API. When a new page is allocated, the
// first 8 bytes of this space are zeroed but the remainder is uninitialized.
// (The extra space is used by btree as the MemPage object.)
//
// The flags argument is used to specify properties that affect the
// operation of the pager. It should be passed some bitwise combination
// of the PAGER_* flags.
//
// The vfsFlags parameter is a bitmask to pass to the flags parameter
// of the xOpen() method of the supplied VFS when opening files.
//
// If the pager object is allocated and the specified file opened
// successfully, SQLITE_OK is returned and *ppPager set to point to
// the new pager object. If an error occurs, *ppPager is set to NULL
// and error code returned. This function may return SQLITE_NOMEM
// (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or
// various SQLITE_IO_XXX errors.
func _sqlite3PagerOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _ppPager **XPager, _zFilename *int8, _nExtra int32, _flags int32, _vfsFlags int32, _xReinit func(*crt.TLS, *XPgHdr)) (r0 int32) {
var _rc, _tempFile, _memDb, _readOnly, _journalFileSize, _nPathname, _useJournal, _pcacheSize, _nUri, _10_fout, _11_iDc int32
var _szPageDflt uint32
var _zPathname, _zUri, _3_z *int8
var _pPtr *uint8
var _pPager *XPager
_pPager = nil
_rc = i32(0)
_tempFile = i32(0)
_memDb = i32(0)
_readOnly = i32(0)
_zPathname = nil
_nPathname = i32(0)
_useJournal = bool2int((_flags & i32(1)) == i32(0))
_pcacheSize = _sqlite3PcacheSize(tls)
_szPageDflt = u32(4096)
_zUri = nil
_nUri = i32(0)
_journalFileSize = (_sqlite3JournalSize(tls, _pVfs) + i32(7)) & i32(-8)
*_ppPager = nil
if (_flags & i32(2)) == 0 {
goto _0
}
_memDb = i32(1)
if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 {
goto _2
}
_zPathname = _sqlite3DbStrDup(tls, nil, _zFilename)
if _zPathname == nil {
return _sqlite3NomemError(tls, i32(51601))
}
_nPathname = _sqlite3Strlen30(tls, _zPathname)
_zFilename = nil
_2:
_0:
if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 {
goto _5
}
_nPathname = (_pVfs.X2) + i32(1)
_zPathname = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_nPathname*i32(2))))
if _zPathname == nil {
return _sqlite3NomemError(tls, i32(51617))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPathname)) + 1*uintptr(i32(0)))) = int8(i32(0))
_rc = _sqlite3OsFullPathname(tls, _pVfs, _zFilename, _nPathname, _zPathname)
_nPathname = _sqlite3Strlen30(tls, _zPathname)
_3_z = store0(&_zUri, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename))+1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1)))))
_7:
if (*_3_z) != 0 {
{
p := &_3_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1))))
sink0 = *p
}
{
p := &_3_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _3_z)+i32(1))))
sink0 = *p
}
goto _7
}
_nUri = int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_z))+1*uintptr(i32(1)))))) - uintptr(unsafe.Pointer(_zUri))) / 1)
func() {
if _nUri < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51628), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78764)))
crt.X__builtin_abort(tls)
}
}()
if (_rc == i32(0)) && ((_nPathname + i32(8)) > (_pVfs.X2)) {
_rc = _sqlite3CantopenError(tls, i32(51636))
}
if _rc != i32(0) {
_sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname))
return _rc
}
_5:
_pPtr = (*uint8)(_sqlite3MallocZero(tls, uint64((((((((((((u32(224)+uint32((_pcacheSize+i32(7))&i32(-8)))+uint32(((_pVfs.X1)+i32(7))&i32(-8)))+uint32(_journalFileSize*i32(2)))+uint32(_nPathname))+uint32(i32(1)))+uint32(_nUri))+uint32(_nPathname))+uint32(i32(8)))+uint32(i32(2)))+uint32(_nPathname))+uint32(i32(4)))+uint32(i32(2)))))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)((unsafe.Pointer)(uintptr(_journalFileSize)))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78772)))
crt.X__builtin_abort(tls)
}
}()
if _pPtr == nil {
_sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname))
return _sqlite3NomemError(tls, i32(51670))
}
_pPager = (*XPager)(unsafe.Pointer(_pPtr))
*(**XPCache)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X59))))) = (*XPCache)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u32(224))))
}())))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X31))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_pcacheSize+i32(7))&i32(-8))))
}())))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X33))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(((_pVfs.X1)+i32(7))&i32(-8))))
}())))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X32))))) = (*Xsqlite3_file)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_journalFileSize)))
}())))
*(**int8)(unsafe.Pointer(&(_pPager.X51))) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_journalFileSize)))
}())))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*Xsqlite3_file)(_pPager.X32)))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51678), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78829)))
crt.X__builtin_abort(tls)
}
}()
if _zPathname == nil {
goto _19
}
func() {
if _nPathname <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51682), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78863)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pPager.X52))) = (*int8)(unsafe.Pointer(store13(func() (**uint8, *uint8) {
p := &_pPtr
return p, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_nPathname+i32(1))+_nUri)))
}())))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X51), (unsafe.Pointer)(_zPathname), uint32(_nPathname))
if _nUri != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X51))+1*uintptr(_nPathname+i32(1))))), (unsafe.Pointer)(_zUri), uint32(_nUri))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X52), (unsafe.Pointer)(_zPathname), uint32(_nPathname))
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X52))+1*uintptr(_nPathname)))), (unsafe.Pointer)(str(78875)), uint32(i32(10)))
*(**int8)(unsafe.Pointer(&(_pPager.X61))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X52)) + 1*uintptr((_nPathname+i32(8))+i32(1))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pPager.X61), (unsafe.Pointer)(_zPathname), uint32(_nPathname))
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPager.X61))+1*uintptr(_nPathname)))), (unsafe.Pointer)(str(78885)), uint32(i32(5)))
_sqlite3DbFree(tls, nil, (unsafe.Pointer)(_zPathname))
_19:
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X0))))) = _pVfs
*(*uint32)(unsafe.Pointer(&(_pPager.X46))) = uint32(_vfsFlags)
if _zFilename == nil || (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 {
goto _24
}
_10_fout = i32(0)
_rc = _sqlite3OsOpen(tls, _pVfs, _pPager.X51, (*Xsqlite3_file)(_pPager.X31), _vfsFlags, &_10_fout)
func() {
if _memDb != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51705), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78891)))
crt.X__builtin_abort(tls)
}
}()
_readOnly = _10_fout & i32(1)
if _rc != i32(0) {
goto _27
}
_11_iDc = _sqlite3OsDeviceCharacteristics(tls, (*Xsqlite3_file)(_pPager.X31))
if _readOnly != 0 {
goto _28
}
_setSectorSize(tls, _pPager)
i32(0)
if _szPageDflt >= (_pPager.X47) {
goto _29
}
if (_pPager.X47) > uint32(i32(8192)) {
_szPageDflt = uint32(i32(8192))
goto _31
}
_szPageDflt = _pPager.X47
_31:
_29:
_28:
*(*uint8)(unsafe.Pointer(&(_pPager.X11))) = uint8(Xsqlite3_uri_boolean(tls, _zFilename, str(78898), i32(0)))
if ((_11_iDc & i32(8192)) != i32(0)) || Xsqlite3_uri_boolean(tls, _zFilename, str(78905), i32(0)) != 0 {
{
p := &_vfsFlags
*p = (*p) | i32(1)
sink1 = *p
}
goto _act_like_temp_file
}
_27:
goto _34
_24:
_act_like_temp_file:
_tempFile = i32(1)
*(*uint8)(unsafe.Pointer(&(_pPager.X14))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X15))) = uint8(i32(4))
*(*uint8)(unsafe.Pointer(&(_pPager.X11))) = uint8(i32(1))
_readOnly = _vfsFlags & i32(1)
_34:
if _rc == i32(0) {
func() {
if int32(_pPager.X13) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51772), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78915)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerSetPagesize(tls, _pPager, &_szPageDflt, i32(-1))
}
if _rc == i32(0) {
_nExtra = (_nExtra + i32(7)) & i32(-8)
func() {
if _nExtra < i32(8) || _nExtra >= i32(1000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51780), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78932)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PcacheOpen(tls, int32(_szPageDflt), _nExtra, bool2int(_memDb == 0), func() func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32 {
if _memDb == 0 {
return _pagerStress
}
return nil
}(), (unsafe.Pointer)(_pPager), (*XPCache)(_pPager.X59))
}
if _rc != i32(0) {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X31))
_sqlite3PageFree(tls, (unsafe.Pointer)(_pPager.X58))
Xsqlite3_free(tls, (unsafe.Pointer)(_pPager))
return _rc
}
*(*uint8)(unsafe.Pointer(&(_pPager.X3))) = uint8(_useJournal)
*(*uint32)(unsafe.Pointer(&(_pPager.X49))) = uint32(i32(1073741823))
*(*uint8)(unsafe.Pointer(&(_pPager.X10))) = uint8(_tempFile)
func() {
if _tempFile != i32(0) && _tempFile != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(78957)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
*(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(_tempFile)
*(*uint8)(unsafe.Pointer(&(_pPager.X16))) = _pPager.X10
*(*uint8)(unsafe.Pointer(&(_pPager.X13))) = uint8(_memDb)
*(*uint8)(unsafe.Pointer(&(_pPager.X12))) = uint8(_readOnly)
func() {
if _useJournal == 0 && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79033)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X4))) = _pPager.X10
if (_pPager.X4) != 0 {
func() {
if int32(_pPager.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51818), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51819), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79084)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51820), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79105)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X8) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51821), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79126)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79150)))
crt.X__builtin_abort(tls)
}
}()
goto _62
}
*(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2))
*(*uint8)(unsafe.Pointer(&(_pPager.X8))) = uint8(i32(34))
*(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(2))
_62:
*(*uint16)(unsafe.Pointer(&(_pPager.X44))) = uint16(_nExtra)
*(*int64)(unsafe.Pointer(&(_pPager.X50))) = int64(i32(-1))
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && _tempFile == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51835), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOpenØ00__func__Ø000))), unsafe.Pointer(str(79175)))
crt.X__builtin_abort(tls)
}
}()
_setSectorSize(tls, _pPager)
if _useJournal == 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(2))
goto _68
}
if _memDb != 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(i32(4))
}
_68:
*(*func(*crt.TLS, *XPgHdr))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pPager.X56))))) = _xReinit
_setGetterMethod(tls, _pPager)
*_ppPager = _pPager
return i32(0)
}
// Return the size in bytes of a PCache object.
func _sqlite3PcacheSize(tls *crt.TLS) (r0 int32) {
return int32(u32(48))
}
// Return the number of bytes required to store a JournalFile that uses vfs
// pVfs to create the underlying on-disk files.
func _sqlite3JournalSize(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
return func() int32 {
if (_pVfs.X1) > i32(56) {
return (_pVfs.X1)
}
return i32(56)
}()
}
var _sqlite3PagerOpenØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerOpenØ00__func__Ø000[0], str(79206), 17)
}
// Return a boolean value for a query parameter.
func Xsqlite3_uri_boolean(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int32) (r0 int32) {
var _z *int8
_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
_bDflt = bool2int(_bDflt != i32(0))
return func() int32 {
if _z != nil {
return int32(_sqlite3GetBoolean(tls, _z, uint8(_bDflt)))
}
return _bDflt
}()
}
// This is a utility routine, useful to VFS implementations, that checks
// to see if a database file was a URI that contained a specific query
// parameter, and if so obtains the value of the query parameter.
//
// The zFilename argument is the filename pointer passed into the xOpen()
// method of a VFS implementation. The zParam argument is the name of the
// query parameter we seek. This routine returns the value of the zParam
// parameter if it exists. If the parameter does not exist, this routine
// returns a NULL pointer.
func Xsqlite3_uri_parameter(tls *crt.TLS, _zFilename *int8, _zParam *int8) (r0 *int8) {
var _1_x int32
if (_zFilename == nil) || (_zParam == nil) {
return nil
}
{
p := &_zFilename
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1))))
sink0 = *p
}
_2:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) == 0 {
goto _3
}
_1_x = crt.Xstrcmp(tls, _zFilename, _zParam)
{
p := &_zFilename
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1))))
sink0 = *p
}
if _1_x == i32(0) {
return _zFilename
}
{
p := &_zFilename
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _zFilename)+i32(1))))
sink0 = *p
}
goto _2
_3:
return nil
}
// Interpret the given string as a boolean value.
func _sqlite3GetBoolean(tls *crt.TLS, _z *int8, _dflt uint8) (r0 uint8) {
return uint8(bool2int(int32(_getSafetyLevel(tls, _z, i32(1), _dflt)) != i32(0)))
}
// Interpret the given string as a safety level. Return 0 for OFF,
// 1 for ON or NORMAL, 2 for FULL, and 3 for EXTRA. Return 1 for an empty or
// unrecognized string argument. The FULL and EXTRA option is disallowed
// if the omitFull parameter it 1.
//
// Note that the values returned are one less that the values that
// should be passed into sqlite3BtreeSetSafetyLevel(). The is done
// to support legacy SQL code. The safety level used to be boolean
// and older scripts may have used numbers 0 for OFF and 1 for ON.
func _getSafetyLevel(tls *crt.TLS, _z *int8, _omitFull int32, _dflt uint8) (r0 uint8) {
var _i, _n int32
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_z))))) & i32(4)) != 0 {
return uint8(_sqlite3Atoi(tls, _z))
}
_n = _sqlite3Strlen30(tls, _z)
_i = i32(0)
_1:
if _i >= i32(8) {
goto _4
}
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iLengthØ003)) + 1*uintptr(_i)))) == _n) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00zTextØ001))+1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iOffsetØ002)) + 1*uintptr(_i)))))), _z, _n) == i32(0))) && ((_omitFull == 0) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i)))) <= i32(1))) {
return *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_getSafetyLevelØ00iValueØ004)) + 1*uintptr(_i)))
}
_i += 1
goto _1
_4:
return _dflt
}
var _getSafetyLevelØ00iLengthØ003 [8]uint8
func init() {
_getSafetyLevelØ00iLengthØ003 = [8]uint8{2, 2, 3, 5, 3, 4, 5, 4}
}
var _getSafetyLevelØ00zTextØ001 [25]int8
func init() {
crt.Xstrncpy(nil, &_getSafetyLevelØ00zTextØ001[0], str(79223), 25)
}
var _getSafetyLevelØ00iOffsetØ002 [8]uint8
func init() {
_getSafetyLevelØ00iOffsetØ002 = [8]uint8{0, 1, 2, 4, 9, 12, 15, 20}
}
var _getSafetyLevelØ00iValueØ004 [8]uint8
func init() {
_getSafetyLevelØ00iValueØ004 = [8]uint8{1, 0, 0, 0, 1, 1, 3, 2}
}
// Create a new PCache object. Storage space to hold the object
// has already been allocated and is passed in as the p pointer.
// The caller discovers how much space needs to be allocated by
// calling sqlite3PcacheSize().
//
// szExtra is some extra space allocated for each page. The first
// 8 bytes of the extra space will be zeroed as the page is allocated,
// but remaining content will be uninitialized. Though it is opaque
// to this module, the extra space really ends up being the MemPage
// structure in the pager.
func _sqlite3PcacheOpen(tls *crt.TLS, _szPage int32, _szExtra int32, _bPurgeable int32, _xStress func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32, _pStress unsafe.Pointer, _p *XPCache) (r0 int32) {
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(48))
*(*int32)(unsafe.Pointer(&(_p.X6))) = i32(1)
*(*int32)(unsafe.Pointer(&(_p.X7))) = _szExtra
func() {
if _szExtra < i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44428), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheOpenØ00__func__Ø000))), unsafe.Pointer(str(79248)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_p.X8))) = uint8(_bPurgeable)
*(*uint8)(unsafe.Pointer(&(_p.X9))) = uint8(i32(2))
*(*func(*crt.TLS, unsafe.Pointer, *XPgHdr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_p.X10))))) = _xStress
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))) = _pStress
*(*int32)(unsafe.Pointer(&(_p.X4))) = i32(100)
*(*int32)(unsafe.Pointer(&(_p.X5))) = i32(1)
return _sqlite3PcacheSetPageSize(tls, _p, _szPage)
}
var _sqlite3PcacheOpenØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheOpenØ00__func__Ø000[0], str(79259), 18)
}
// This function is called by the pcache layer when it has reached some
// soft memory limit. The first argument is a pointer to a Pager object
// (cast as a void*). The pager is always 'purgeable' (not an in-memory
// database). The second argument is a reference to a page that is
// currently dirty but has no outstanding references. The page
// is always associated with the Pager object passed as the first
// argument.
//
// The job of this function is to make pPg clean by writing its contents
// out to the database file, if possible. This may involve syncing the
// journal file.
//
// If successful, sqlite3PcacheMakeClean() is called on the page and
// SQLITE_OK returned. If an IO error occurs while trying to make the
// page clean, the IO error code is returned. If the page cannot be
// made clean for some other reason, but no error occurs, then SQLITE_OK
// is returned by sqlite3PcacheMakeClean() is not called.
func _pagerStress(tls *crt.TLS, _p unsafe.Pointer, _pPg *XPgHdr) (r0 int32) {
var _rc int32
var _pPager *XPager
_pPager = (*XPager)(_p)
_rc = i32(0)
func() {
if (*XPager)(_pPg.X4) != _pPager {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51451), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerStressØ00__func__Ø000))), unsafe.Pointer(str(18492)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pPg.X6) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51452), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerStressØ00__func__Ø000))), unsafe.Pointer(str(54035)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (_pPager.X26) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51470), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerStressØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return i32(0)
}
if ((_pPager.X18) != 0) && (((int32(_pPager.X18) & i32(3)) != i32(0)) || ((int32(_pPg.X6) & i32(8)) != i32(0))) {
return i32(0)
}
*(**XPgHdr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPg.X3))))) = nil
if (*XWal)(_pPager.X60) == nil {
goto _10
}
_rc = _subjournalPageIfRequired(tls, _pPg)
if _rc == i32(0) {
_rc = _pagerWalFrames(tls, _pPager, _pPg, uint32(i32(0)), i32(0))
}
goto _12
_10:
if (int32(_pPg.X6)&i32(8)) != 0 || (int32(_pPager.X14) == i32(3)) {
_rc = _syncJournal(tls, _pPager, i32(1))
}
if _rc == i32(0) {
func() {
if (int32(_pPg.X6) & i32(8)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51499), unsafe.Pointer((*int8)(unsafe.Pointer(&_pagerStressØ00__func__Ø000))), unsafe.Pointer(str(79277)))
crt.X__builtin_abort(tls)
}
}()
_rc = _pager_write_pagelist(tls, _pPager, _pPg)
}
_12:
if _rc == i32(0) {
_sqlite3PcacheMakeClean(tls, _pPg)
}
return _pager_error(tls, _pPager, _rc)
}
var _pagerStressØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_pagerStressØ00__func__Ø000[0], str(79309), 12)
}
// During a rollback, when the pager reloads information into the cache
// so that the cache is restored to its original state at the start of
// the transaction, for each page restored this routine is called.
//
// This routine needs to reset the extra data section at the end of the
// page to agree with the restored data.
func _pageReinit(tls *crt.TLS, _pData *XPgHdr) {
var _pPage *XMemPage
_pPage = (*XMemPage)(_sqlite3PagerGetExtra(tls, _pData))
func() {
if _sqlite3PagerPageRefcount(tls, _pData) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61180), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageReinitØ00__func__Ø000))), unsafe.Pointer(str(79321)))
crt.X__builtin_abort(tls)
}
}()
if (_pPage.X0) == 0 {
goto _2
}
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61182), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageReinitØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0))
if _sqlite3PagerPageRefcount(tls, _pData) > i32(1) {
_btreeInitPage(tls, _pPage)
}
_2:
}
var _pageReinitØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_pageReinitØ00__func__Ø000[0], str(79355), 11)
}
// Change the maximum size of any memory mapping made of the database file.
func _sqlite3PagerSetMmapLimit(tls *crt.TLS, _pPager *XPager, _szMmap int64) {
*(*int64)(unsafe.Pointer(&(_pPager.X42))) = _szMmap
_pagerFixMaplimit(tls, _pPager)
}
// Read the first N bytes from the beginning of the file into memory
// that pDest points to.
//
// If the pager was opened on a transient file (zFilename==""), or
// opened on a file less than N bytes in size, the output buffer is
// zeroed and SQLITE_OK returned. The rationale for this is that this
// function is used to read database headers, and a new transient or
// zero sized database has a header than consists entirely of zeroes.
//
// If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered,
// the error code is returned to the caller and the contents of the
// output buffer undefined.
func _sqlite3PagerReadFileheader(tls *crt.TLS, _pPager *XPager, _N int32, _pDest *uint8) (r0 int32) {
var _rc int32
_rc = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(_pDest), i32(0), uint32(_N))
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000))), unsafe.Pointer(str(19565)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XWal)(_pPager.X60) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerReadFileheaderØ00__func__Ø000))), unsafe.Pointer(str(12168)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil {
goto _5
}
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pPager.X31), (unsafe.Pointer)(_pDest), _N, int64(i32(0)))
if _rc == i32(522) {
_rc = i32(0)
}
_5:
return _rc
}
var _sqlite3PagerReadFileheaderØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerReadFileheaderØ00__func__Ø000[0], str(79366), 27)
}
// Set the busy handler function.
//
// The pager invokes the busy-handler if sqlite3OsLock() returns
// SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock,
// or when trying to upgrade from a RESERVED lock to an EXCLUSIVE
// lock. It does *not* invoke the busy handler when upgrading from
// SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE
// (which occurs during hot-journal rollback). Summary:
//
// Transition | Invokes xBusyHandler
// --------------------------------------------------------
// NO_LOCK -> SHARED_LOCK | Yes
// SHARED_LOCK -> RESERVED_LOCK | No
// SHARED_LOCK -> EXCLUSIVE_LOCK | No
// RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes
//
// If the busy-handler callback returns non-zero, the lock is
// retried. If it returns zero, then the SQLITE_BUSY error is
// returned to the caller of the pager API function.
func _sqlite3PagerSetBusyhandler(tls *crt.TLS, _pPager *XPager, _xBusyHandler func(*crt.TLS, unsafe.Pointer) int32, _pBusyHandlerArg unsafe.Pointer) {
var _1_ap *unsafe.Pointer
*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_pPager.X53))) = _xBusyHandler
*(*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X54))) = _pBusyHandlerArg
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) != nil {
_1_ap = (*unsafe.Pointer)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_pPager.X53)))))
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct{ f unsafe.Pointer }{(*(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ap)) + 4*uintptr(i32(0)))))})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_xBusyHandler})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50605), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000))), unsafe.Pointer(str(79393)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ap)) + 4*uintptr(i32(1)))) != _pBusyHandlerArg {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50606), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetBusyhandlerØ00__func__Ø000))), unsafe.Pointer(str(79433)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OsFileControlHint(tls, (*Xsqlite3_file)(_pPager.X31), i32(15), (unsafe.Pointer)(_1_ap))
}
}
var _sqlite3PagerSetBusyhandlerØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSetBusyhandlerØ00__func__Ø000[0], str(79456), 27)
}
// Return TRUE if the database file is opened read-only. Return FALSE
// if the database is (in theory) writable.
func _sqlite3PagerIsreadonly(tls *crt.TLS, _pPager *XPager) (r0 uint8) {
return _pPager.X12
}
// 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 _sqlite3BtreeSchema(tls *crt.TLS, _p *XBtree, _nBytes int32, _xFree func(*crt.TLS, unsafe.Pointer)) (r0 unsafe.Pointer) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
if ((_pBt.X19) == nil) && _nBytes != 0 {
*(*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X19))) = _sqlite3DbMallocZero(tls, nil, uint64(_nBytes))
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pBt.X20))) = _xFree
}
_sqlite3BtreeLeave(tls, _p)
return _pBt.X19
}
// Return the file handle for the database file associated
// with the pager. This might return NULL if the file has
// not yet been opened.
func _sqlite3PagerFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
return (*Xsqlite3_file)(_pPager.X31)
}
// 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 _sqlite3BtreeConnectionCount(tls *crt.TLS, _p *XBtree) (r0 int32) {
return (*XBtShared)(_p.X1).X23
}
var _sqlite3VdbeExecØ00vfsFlagsØ006 int32
func init() {
_sqlite3VdbeExecØ00vfsFlagsØ006 = i32(1054)
}
func _sqlite3BtreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _flags int32) (r0 int32) {
var _rc int32
_sqlite3BtreeEnter(tls, _p)
_rc = _btreeCreateTable(tls, _p, _piTable, _flags)
_sqlite3BtreeLeave(tls, _p)
return _rc
}
// Create a new BTree table. Write into *piTable the page
// number for the root page of the new table.
//
// The type of type is determined by the flags parameter. Only the
// following values of flags are currently in use. Other values for
// flags might not work:
//
// BTREE_INTKEY|BTREE_LEAFDATA Used for SQL tables with rowid keys
// BTREE_ZERODATA Used for SQL indices
func _btreeCreateTable(tls *crt.TLS, _p *XBtree, _piTable *int32, _createTabFlags int32) (r0 int32) {
var _rc, _ptfFlags int32
var _pgnoRoot, _1_pgnoMove, _4_iPtrPage uint32
var _4_eType uint8
var _pBt *XBtShared
var _pRoot, _1_pPageMove *XMemPage
_pBt = (*XBtShared)(_p.X1)
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67483), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pBt.X8) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67484), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(56928)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pBt.X10) & i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67485), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(77853)))
crt.X__builtin_abort(tls)
}
}()
if (_pBt.X5) == 0 {
goto _6
}
_invalidateAllOverflowCache(tls, _pBt)
_sqlite3BtreeGetMeta(tls, _p, i32(4), &_pgnoRoot)
_pgnoRoot += 1
_7:
if (_pgnoRoot == _ptrmapPageno(tls, _pBt, _pgnoRoot)) || (_pgnoRoot == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
_pgnoRoot += 1
goto _7
}
func() {
if _pgnoRoot < uint32(i32(3)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67518), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79483)))
crt.X__builtin_abort(tls)
}
}()
_rc = _allocateBtreePage(tls, _pBt, &_1_pPageMove, &_1_pgnoMove, _pgnoRoot, uint8(i32(1)))
if _rc != i32(0) {
return _rc
}
if _1_pgnoMove == _pgnoRoot {
goto _14
}
_4_eType = u8(0)
_4_iPtrPage = u32(0)
_rc = _saveAllCursors(tls, _pBt, uint32(i32(0)), nil)
_releasePage(tls, _1_pPageMove)
if _rc != i32(0) {
return _rc
}
_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, i32(0))
if _rc != i32(0) {
return _rc
}
_rc = _ptrmapGet(tls, _pBt, _pgnoRoot, &_4_eType, &_4_iPtrPage)
if (int32(_4_eType) == i32(1)) || (int32(_4_eType) == i32(2)) {
_rc = _sqlite3CorruptError(tls, i32(67556))
}
if _rc != i32(0) {
_releasePage(tls, _pRoot)
return _rc
}
func() {
if int32(_4_eType) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67562), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79509)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_4_eType) == i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67563), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79532)))
crt.X__builtin_abort(tls)
}
}()
_rc = _relocatePage(tls, _pBt, _pRoot, _4_eType, _4_iPtrPage, _1_pgnoMove, i32(0))
_releasePage(tls, _pRoot)
if _rc != i32(0) {
return _rc
}
_rc = _btreeGetPage(tls, _pBt, _pgnoRoot, &_pRoot, i32(0))
if _rc != i32(0) {
return _rc
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.X23))
if _rc != i32(0) {
_releasePage(tls, _pRoot)
return _rc
}
goto _27
_14:
_pRoot = _1_pPageMove
_27:
_ptrmapPut(tls, _pBt, _pgnoRoot, uint8(i32(1)), uint32(i32(0)), &_rc)
if _rc != 0 {
_releasePage(tls, _pRoot)
return _rc
}
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67595), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79555)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeUpdateMeta(tls, _p, i32(4), _pgnoRoot)
if func() int32 {
if _rc != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67597), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_releasePage(tls, _pRoot)
return _rc
}
goto _34
_6:
_rc = _allocateBtreePage(tls, _pBt, &_pRoot, &_pgnoRoot, uint32(i32(1)), uint8(i32(0)))
if _rc != 0 {
return _rc
}
_34:
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67607), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79601)))
crt.X__builtin_abort(tls)
}
}()
if (_createTabFlags & i32(1)) != 0 {
_ptfFlags = i32(13)
goto _39
}
_ptfFlags = i32(10)
_39:
_zeroPage(tls, _pRoot, _ptfFlags)
_sqlite3PagerUnref(tls, (*XPgHdr)(_pRoot.X23))
func() {
if (int32(_pBt.X4)&i32(4)) != i32(0) && _pgnoRoot != uint32(i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67615), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeCreateTableØ00__func__Ø000))), unsafe.Pointer(str(79641)))
crt.X__builtin_abort(tls)
}
}()
*_piTable = int32(_pgnoRoot)
return i32(0)
}
var _btreeCreateTableØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_btreeCreateTableØ00__func__Ø000[0], str(79691), 17)
}
// Initialize the temporary index cursor just opened as a sorter cursor.
//
// Usually, the sorter module uses the value of (pCsr->pKeyInfo->nField)
// to determine the number of fields that should be compared from the
// records being sorted. However, if the value passed as argument nField
// is non-zero and the sorter is able to guarantee a stable sort, nField
// is used instead. This is used when sorting records for a CREATE INDEX
// statement. In this case, keys are always delivered to the sorter in
// order of the primary key, which happens to be make up the final part
// of the records being sorted. So if the sort is stable, there is never
// any reason to compare PK fields and they can be ignored for a small
// performance boost.
//
// The sorter can guarantee a stable sort when running in single-threaded
// mode, but not in multi-threaded mode.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
func _sqlite3VdbeSorterInit(tls *crt.TLS, _db *Xsqlite3, _nField int32, _pCsr *XVdbeCursor) (r0 int32) {
var _pgsz, _i, _szKeyInfo, _sz, _rc, _nWorker int32
var _7_mxCache int64
var _7_szPma uint32
var _pKeyInfo *XKeyInfo
var _pSorter *XVdbeSorter
var _6_pTask *XSortSubtask
_rc = i32(0)
if _sqlite3TempInMemory(tls, _db) != 0 || ((_sqlite3Config.X1) == i32(0)) {
_nWorker = i32(0)
goto _2
}
_nWorker = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(11))))
_2:
func() {
if (*XKeyInfo)(_pCsr.X15) == nil || (*XBtree)(_pCsr.X8) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000))), unsafe.Pointer(str(79708)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_szKeyInfo = int32(u32(24) + (uint32(int32((*XKeyInfo)(_pCsr.X15).X2)-i32(1)) * u32(4)))
_sz = int32(u32(124) + (uint32(_nWorker) * u32(60)))
_pSorter = (*XVdbeSorter)(_sqlite3DbMallocZero(tls, _db, uint64(_sz+_szKeyInfo)))
*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))) = _pSorter
if _pSorter == nil {
_rc = _sqlite3NomemError(tls, i32(86983))
goto _9
}
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X7))))) = store50(&_pKeyInfo, (*XKeyInfo)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(_pSorter))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_sz))))))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pKeyInfo), _pCsr.X15, uint32(_szKeyInfo))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X4))))) = nil
if _nField != 0 && (_nWorker == i32(0)) {
{
p := (*uint16)(unsafe.Pointer(&(_pKeyInfo.X3)))
*p = uint16(int32(*p) + (int32(_pKeyInfo.X2) - _nField))
sink14 = *p
}
*(*uint16)(unsafe.Pointer(&(_pKeyInfo.X2))) = uint16(_nField)
}
*(*int32)(unsafe.Pointer(&(_pSorter.X3))) = store1(&_pgsz, _sqlite3BtreeGetPageSize(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1)))
*(*uint8)(unsafe.Pointer(&(_pSorter.X15))) = uint8(_nWorker + i32(1))
*(*uint8)(unsafe.Pointer(&(_pSorter.X14))) = uint8(_nWorker - i32(1))
*(*uint8)(unsafe.Pointer(&(_pSorter.X13))) = uint8(bool2int(int32(_pSorter.X15) > i32(1)))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X6))))) = _db
_i = i32(0)
_12:
if _i >= int32(_pSorter.X15) {
goto _15
}
_6_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_i)))
*(**XVdbeSorter)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pTask.X2))))) = _pSorter
_i += 1
goto _12
_15:
if _sqlite3TempInMemory(tls, _db) != 0 {
goto _16
}
_7_szPma = _sqlite3Config.X27
*(*int32)(unsafe.Pointer(&(_pSorter.X0))) = int32(_7_szPma * uint32(_pgsz))
_7_mxCache = int64((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4).X10)
if _7_mxCache < int64(i32(0)) {
_7_mxCache = _7_mxCache * int64(i32(-1024))
goto _18
}
_7_mxCache = _7_mxCache * int64(_pgsz)
_18:
_7_mxCache = func() int64 {
if _7_mxCache < int64(i32(536870912)) {
return _7_mxCache
}
return int64(i32(536870912))
}()
*(*int32)(unsafe.Pointer(&(_pSorter.X1))) = func() int32 {
if (_pSorter.X0) > int32(_7_mxCache) {
return (_pSorter.X0)
}
return int32(_7_mxCache)
}()
if _sqlite3Config.X19 != nil {
goto _23
}
func() {
if (_pSorter.X10) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87023), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterInitØ00__func__Ø000))), unsafe.Pointer(str(79740)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _pgsz
*(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pgsz)))
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
_rc = _sqlite3NomemError(tls, i32(87026))
}
_23:
_16:
if ((int32(_pKeyInfo.X2) + int32(_pKeyInfo.X3)) < i32(13)) && (((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 4*uintptr(i32(0))))) == nil) || ((*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyInfo.X6))))) + 4*uintptr(i32(0))))) == (*XCollSeq)(_db.X2))) {
*(*uint8)(unsafe.Pointer(&(_pSorter.X16))) = uint8(i32(3))
}
_9:
return _rc
}
var _sqlite3VdbeSorterInitØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterInitØ00__func__Ø000[0], str(79760), 22)
}
// Return true if the cursor has a hint specified. This routine is
// only used from within assert() statements
func _sqlite3BtreeCursorHasHint(tls *crt.TLS, _pCsr *XBtCursor, _mask uint32) (r0 int32) {
return bool2int((uint32(_pCsr.X13) & _mask) != uint32(i32(0)))
}
func _sqlite3BtreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64636), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pRes == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74748)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*_pRes) != i32(0) && (*_pRes) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74756)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74777)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(0)
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-15))
sink2 = *p
}
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
if ((int32(_pCur.X12) != i32(1)) || (int32(_pCur.X16) == i32(0))) || (int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X5) == i32(0)) {
return _btreePrevious(tls, _pCur, _pRes)
}
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) -= 1
return i32(0)
}
var _sqlite3BtreePreviousØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreePreviousØ00__func__Ø000[0], str(79782), 21)
}
// Step the cursor to the back to the previous entry in the database. If
// successful then set *pRes=0. If the cursor
// was already pointing to the first entry in the database before
// this routine was called, then set *pRes=1.
//
// The main entry point is sqlite3BtreePrevious(). That routine is optimized
// for the common case of merely decrementing the cell counter BtCursor.aiIdx
// to the previous cell on the current page. The (slower) btreePrevious()
// helper routine is called when it is necessary to move to a different page
// or to restore the cursor.
//
// The calling function will set *pRes to 0 or 1. The initial *pRes value
// will be 1 if the cursor being stepped corresponds to an SQL index and
// if this routine could have been skipped if that SQL index had been
// a unique index. Otherwise the caller will have set *pRes to zero.
// Zero is the common case. The btree implementation is free to use the
// initial *pRes value as a hint to improve performance, but the current
// SQLite btree implementation does not. (Note that the comdb2 btree
// implementation does use this hint, however.)
func _btreePrevious(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
var _rc, _6_idx int32
var _pPage *XMemPage
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64580), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pRes == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64581), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74748)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*_pRes) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64582), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74842)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pCur.X9) != i32(0) && int32(_pCur.X12) == i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64583), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74777)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pCur.X10) & i32(14)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64584), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(79803)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64585), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(79869)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(1) {
goto _13
}
_rc = func() int32 {
if int32(_pCur.X12) >= i32(3) {
return _btreeRestoreCursorPosition(tls, _pCur)
}
return i32(0)
}()
if _rc != i32(0) {
return _rc
}
if i32(0) == int32(_pCur.X12) {
*_pRes = i32(1)
return i32(0)
}
if (_pCur.X9) == 0 {
goto _18
}
func() {
if int32(_pCur.X12) != i32(1) && int32(_pCur.X12) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64596), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74851)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(1))
if (_pCur.X9) < i32(0) {
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0)
return i32(0)
}
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(0)
_18:
_13:
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
func() {
if (_pPage.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64607), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePreviousØ00__func__Ø000))), unsafe.Pointer(str(74631)))
crt.X__builtin_abort(tls)
}
}()
if (_pPage.X5) != 0 {
goto _25
}
_6_idx = int32(_pCur.X16)
_rc = _moveToChild(tls, _pCur, _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_6_idx))))) + 1*uintptr(i32(0)))))<= int32(_pCur.X14) {
goto _9
}
func() {
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(_1_ii)))) != int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_1_ii)))).X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(79995)))
crt.X__builtin_abort(tls)
}
}()
_1_ii += 1
goto _6
_9:
func() {
if int32(_pCur.X16) != (int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) - i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64114), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(80036)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64115), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(80081)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
_5:
_rc = _moveToRoot(tls, _pCur)
if _rc != i32(0) {
goto _16
}
if i32(0) == int32(_pCur.X12) {
func() {
if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64123), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(74242)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(1)
goto _21
}
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64126), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLastØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(0)
_rc = _moveToRightmost(tls, _pCur)
if _rc == i32(0) {
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(8))
sink2 = *p
}
goto _25
}
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-9))
sink2 = *p
}
_25:
_21:
_16:
return _rc
}
var _sqlite3BtreeLastØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeLastØ00__func__Ø000[0], str(80113), 17)
}
// 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 _sqlite3BtreeInsert(tls *crt.TLS, _pCur *XBtCursor, _pX *XBtreePayload, _flags int32, _seekResult int32) (r0 int32) {
var _rc, _loc, _szNew, _idx int32
var _oldCell, _newCell *uint8
var _p *XBtree
var _pBt *XBtShared
var _9_info XCellInfo
var _pPage *XMemPage
var _7_r XUnpackedRecord
_loc = _seekResult
_szNew = i32(0)
_p = (*XBtree)(_pCur.X0)
_pBt = (*XBtShared)(_p.X1)
_newCell = nil
func() {
if (_flags & i32(10)) != _flags {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80130)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCur.X12) == i32(4) {
func() {
if (_pCur.X9) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(76879)))
crt.X__builtin_abort(tls)
}
}()
return _pCur.X9
}
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pCur.X10)&i32(1)) == i32(0) || int32(_pBt.X8) != i32(2) || (int32(_pBt.X10)&i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67117), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80181)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasSharedCacheTableLock(tls, _p, _pCur.X7, bool2int((*XKeyInfo)(_pCur.X18) != nil), i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67120), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80291)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pX.X0 == nil) != ((*XKeyInfo)(_pCur.X18) == nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67127), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80356)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pCur.X10) & i32(32)) == 0 {
goto _15
}
_rc = _saveAllCursors(tls, _pBt, _pCur.X7, _pCur)
if _rc != 0 {
return _rc
}
_15:
if (*XKeyInfo)(_pCur.X18) != nil {
goto _17
}
func() {
if _pX.X0 != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80391)))
crt.X__builtin_abort(tls)
}
}()
_invalidateIncrblobCursors(tls, _p, _pCur.X7, _pX.X1, i32(0))
func() {
if (_flags&i32(2)) != i32(0) && ((int32(_pCur.X10)&i32(2)) == i32(0) || (_pX.X1) != ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67153), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80403)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pCur.X10) & i32(2)) != i32(0)) && ((_pX.X1) == ((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X0)) {
_loc = i32(0)
goto _27
}
if _loc != i32(0) {
goto _27
}
_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, nil, _pX.X1, bool2int(_flags != i32(0)), &_loc)
if _rc != 0 {
return _rc
}
_27:
goto _31
_17:
if _loc != i32(0) || (_flags&i32(2)) != i32(0) {
goto _31
}
if (_pX.X4) != 0 {
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_r.X0))))) = (*XKeyInfo)(_pCur.X18)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_7_r.X1))))) = (*XMem)(_pX.X3)
*(*uint16)(unsafe.Pointer(&(_7_r.X2))) = _pX.X4
*(*int8)(unsafe.Pointer(&(_7_r.X3))) = int8(i32(0))
*(*uint8)(unsafe.Pointer(&(_7_r.X4))) = uint8(i32(0))
*(*int8)(unsafe.Pointer(&(_7_r.X5))) = int8(i32(0))
*(*int8)(unsafe.Pointer(&(_7_r.X6))) = int8(i32(0))
*(*uint8)(unsafe.Pointer(&(_7_r.X7))) = uint8(i32(0))
_rc = _sqlite3BtreeMovetoUnpacked(tls, _pCur, &_7_r, int64(i32(0)), bool2int(_flags != i32(0)), &_loc)
goto _33
}
_rc = _btreeMoveto(tls, _pCur, _pX.X0, _pX.X1, bool2int(_flags != i32(0)), &_loc)
_33:
if _rc != 0 {
return _rc
}
_31:
func() {
if int32(_pCur.X12) != i32(1) && (int32(_pCur.X12) != i32(0) || _loc == 0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80504)))
crt.X__builtin_abort(tls)
}
}()
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))
func() {
if (_pPage.X2) == 0 && (_pX.X1) < int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80572)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPage.X5) == 0 && (_pPage.X2) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80601)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPage.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67191), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(74631)))
crt.X__builtin_abort(tls)
}
}()
_newCell = _pBt.X27
func() {
if _newCell == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67193), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80631)))
crt.X__builtin_abort(tls)
}
}()
_rc = _fillInCell(tls, _pPage, _newCell, _pX, &_szNew)
if _rc != 0 {
goto _end_insert
}
func() {
if _szNew != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, _newCell)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67196), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80642)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _szNew > int32((_pBt.X15)-uint32(i32(8))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67197), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80682)))
crt.X__builtin_abort(tls)
}
}()
_idx = int32(_pCur.X16)
if _loc != i32(0) {
goto _54
}
func() {
if _idx >= int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67201), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80709)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))
if _rc != 0 {
goto _end_insert
}
_oldCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_idx))))) + 1*uintptr(i32(0)))))<= int32(_pPage.X11) {
goto _62
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
if uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_oldCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_szNew))))))))) > uintptr(unsafe.Pointer(_pPage.X20)) {
return _sqlite3CorruptError(tls, i32(67224))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_oldCell), (unsafe.Pointer)(_newCell), uint32(_szNew))
return i32(0)
_62:
_dropCell(tls, _pPage, _idx, int32(_9_info.X4), &_rc)
if _rc != 0 {
goto _end_insert
}
goto _72
_54:
if (_loc < i32(0)) && (int32(_pPage.X14) > i32(0)) {
func() {
if (_pPage.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67231), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80726)))
crt.X__builtin_abort(tls)
}
}()
_idx = int32(preInc14((*uint16)(unsafe.Pointer(&(_pCur.X16))), uint16(1)))
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-3))
sink2 = *p
}
goto _72
}
func() {
if (_pPage.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67235), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80726)))
crt.X__builtin_abort(tls)
}
}()
_72:
_insertCell(tls, _pPage, _idx, _newCell, _szNew, nil, uint32(i32(0)), &_rc)
func() {
if int32(_pPage.X9) != i32(0) && _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67238), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc == i32(0) && int32(_pPage.X14) <= i32(0) && int32(_pPage.X9) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67239), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80775)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&((*XCellInfo)(unsafe.Pointer(&(_pCur.X4))).X4))) = uint16(i32(0))
if (_pPage.X9) == 0 {
goto _82
}
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67263), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) & i32(-3))
sink2 = *p
}
_rc = _balance(tls, _pCur)
*(*uint8)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X9))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(0))
if (_flags&i32(2)) == 0 || _rc != i32(0) {
goto _86
}
_rc = _moveToRoot(tls, _pCur)
if (*XKeyInfo)(_pCur.X18) == nil {
goto _87
}
func() {
if _pCur.X6 != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80829)))
crt.X__builtin_abort(tls)
}
}()
*(*unsafe.Pointer)(unsafe.Pointer(&(_pCur.X6))) = _sqlite3Malloc(tls, uint64(_pX.X1))
if _pCur.X6 == nil {
_rc = i32(7)
goto _91
}
crt.Xmemcpy(tls, _pCur.X6, _pX.X0, uint32(_pX.X1))
_91:
_87:
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3))
*(*int64)(unsafe.Pointer(&(_pCur.X5))) = _pX.X1
_86:
_82:
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeInsertØ00__func__Ø000))), unsafe.Pointer(str(80843)))
crt.X__builtin_abort(tls)
}
}()
_end_insert:
return _rc
_ = _7_r
_ = _9_info
panic(0)
}
var _sqlite3BtreeInsertØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeInsertØ00__func__Ø000[0], str(80883), 19)
}
// This function is called before modifying the contents of a table
// to invalidate any incrblob cursors that are open on the
// row or one of the rows being modified.
//
// If argument isClearTable is true, then the entire contents of the
// table is about to be deleted. In this case invalidate all incrblob
// cursors open on any row within the table with root-page pgnoRoot.
//
// Otherwise, if argument isClearTable is false, then the row with
// rowid iRow is being replaced or deleted. In this case invalidate
// only those incrblob cursors open on that specific row.
func _invalidateIncrblobCursors(tls *crt.TLS, _pBtree *XBtree, _pgnoRoot uint32, _iRow int64, _isClearTable int32) {
var _p *XBtCursor
if int32(_pBtree.X5) == i32(0) {
return
}
func() {
if _sqlite3BtreeHoldsMutex(tls, _pBtree) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59542), unsafe.Pointer((*int8)(unsafe.Pointer(&_invalidateIncrblobCursorsØ00__func__Ø000))), unsafe.Pointer(str(80902)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pBtree.X5))) = uint8(i32(0))
_p = (*XBtCursor)((*XBtShared)(_pBtree.X1).X2)
_3:
if _p == nil {
goto _6
}
if (int32(_p.X10) & i32(16)) == i32(0) {
goto _7
}
*(*uint8)(unsafe.Pointer(&(_pBtree.X5))) = uint8(i32(1))
if ((_p.X7) == _pgnoRoot) && (_isClearTable != 0 || (((*XCellInfo)(unsafe.Pointer(&(_p.X4))).X0) == _iRow)) {
*(*uint8)(unsafe.Pointer(&(_p.X12))) = uint8(i32(0))
}
_7:
_p = (*XBtCursor)(_p.X2)
goto _3
_6:
}
var _invalidateIncrblobCursorsØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_invalidateIncrblobCursorsØ00__func__Ø000[0], str(80933), 26)
}
// Create the byte sequence used to represent a cell on page pPage
// and write that byte sequence into pCell[]. Overflow pages are
// allocated and filled in as necessary. The calling procedure
// is responsible for making sure sufficient space has been allocated
// for pCell[].
//
// Note that pCell does not necessary need to point to the pPage->aData
// area. pCell might point to some temporary storage. The cell will
// be constructed in this temporary area then copied into pPage->aData
// later.
func _fillInCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pX *XBtreePayload, _pnSize *int32) (r0 int32) {
var _nPayload, _nSrc, _n, _rc, _spaceLeft, _nHeader, _4_mn int32
var _pgnoOvfl, _7_pgnoPtrmap uint32
var _10_eType uint8
var _pSrc, _pPrior, _pPayload *uint8
var _pBt *XBtShared
var _5_info XCellInfo
var _pOvfl, _pToRelease *XMemPage
_pOvfl = nil
_pToRelease = nil
_pBt = (*XBtShared)(_pPage.X18)
_pgnoOvfl = u32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65233), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_pCell)) >= uintptr(unsafe.Pointer(_pPage.X19)) && uintptr(unsafe.Pointer(_pCell)) < uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65237), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(80959)))
crt.X__builtin_abort(tls)
}
}()
_nHeader = int32(_pPage.X7)
if (_pPage.X2) != 0 {
_nPayload = (_pX.X5) + (_pX.X6)
_pSrc = (*uint8)(_pX.X2)
_nSrc = _pX.X5
func() {
if (_pPage.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65246), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(53565)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_nHeader
*p = (*p) + int32(uint8(func() int32 {
if uint32(_nPayload) < u32(128) {
return func() int32 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload)
return i32(1)
}()
}
return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload))
}()))
sink1 = *p
}
{
p := &_nHeader
*p = (*p) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), *(*uint64)(unsafe.Pointer((*int64)(unsafe.Pointer(&(_pX.X1))))))
sink1 = *p
}
goto _11
}
func() {
if (_pX.X1) > int64(i32(2147483647)) || (_pX.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65250), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81060)))
crt.X__builtin_abort(tls)
}
}()
_nSrc = store1(&_nPayload, int32(_pX.X1))
_pSrc = (*uint8)(_pX.X0)
{
p := &_nHeader
*p = (*p) + int32(uint8(func() int32 {
if uint32(_nPayload) < u32(128) {
return func() int32 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader))) = uint8(_nPayload)
return i32(1)
}()
}
return _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(_nHeader))), uint64(_nPayload))
}()))
sink1 = *p
}
_11:
if _nPayload > int32(_pPage.X10) {
goto _17
}
_n = _nHeader + _nPayload
if _n < i32(4) {
_n = i32(4)
}
*_pnSize = _n
_spaceLeft = _nPayload
_pPrior = _pCell
goto _19
_17:
_4_mn = int32(_pPage.X11)
_n = int32(uint32(_4_mn) + (uint32(_nPayload-_4_mn) % (((*XBtShared)(_pPage.X18).X16) - uint32(i32(4)))))
if _n > int32(_pPage.X10) {
_n = _4_mn
}
_spaceLeft = _n
*_pnSize = (_n + _nHeader) + i32(4)
_pPrior = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader+_n)))
_19:
_pPayload = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell)) + 1*uintptr(_nHeader)))
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, &_5_info)
func() {
if _nHeader != int32((uintptr(unsafe.Pointer(_5_info.X1))-uintptr(unsafe.Pointer(_pCell)))/1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65293), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81096)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_5_info.X0) != (_pX.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65294), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81134)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*_pnSize) != int32(_5_info.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65295), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81154)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _spaceLeft != int32(_5_info.X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65296), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81176)))
crt.X__builtin_abort(tls)
}
}()
_29:
if _nPayload <= i32(0) {
goto _30
}
if _spaceLeft != i32(0) {
goto _31
}
_7_pgnoPtrmap = _pgnoOvfl
if (_pBt.X5) == 0 {
goto _32
}
_33:
_pgnoOvfl += 1
if (_ptrmapPageno(tls, _pBt, _pgnoOvfl) == _pgnoOvfl) || (_pgnoOvfl == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) {
goto _33
}
_32:
_rc = _allocateBtreePage(tls, _pBt, &_pOvfl, &_pgnoOvfl, _pgnoOvfl, uint8(i32(0)))
if (_pBt.X5) == 0 || _rc != i32(0) {
goto _36
}
_10_eType = uint8(func() int32 {
if _7_pgnoPtrmap != 0 {
return i32(4)
}
return i32(3)
}())
_ptrmapPut(tls, _pBt, _pgnoOvfl, _10_eType, _7_pgnoPtrmap, &_rc)
if _rc != 0 {
_releasePage(tls, _pOvfl)
}
_36:
if _rc != 0 {
_releasePage(tls, _pToRelease)
return _rc
}
func() {
if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65340), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_pPrior)) >= uintptr(unsafe.Pointer(_pPage.X19)) && uintptr(unsafe.Pointer(_pPrior)) < uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65344), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81263)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3Put4byte(tls, _pPrior, _pgnoOvfl)
_releasePage(tls, _pToRelease)
_pToRelease = _pOvfl
_pPrior = _pOvfl.X19
_sqlite3Put4byte(tls, _pPrior, uint32(i32(0)))
_pPayload = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOvfl.X19)) + 1*uintptr(i32(4))))
_spaceLeft = int32((_pBt.X16) - uint32(i32(4)))
_31:
_n = _nPayload
if _n > _spaceLeft {
_n = _spaceLeft
}
func() {
if _pToRelease != nil && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pToRelease.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65360), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uintptr(unsafe.Pointer(_pPayload)) >= uintptr(unsafe.Pointer(_pPage.X19)) && uintptr(unsafe.Pointer(_pPayload)) < uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(_pBt.X15))))) && _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65364), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81366)))
crt.X__builtin_abort(tls)
}
}()
if _nSrc <= i32(0) {
goto _56
}
if _n > _nSrc {
_n = _nSrc
}
func() {
if _pSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65369), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInCellØ00__func__Ø000))), unsafe.Pointer(str(81473)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_pPayload), (unsafe.Pointer)(_pSrc), uint32(_n))
goto _60
_56:
crt.Xmemset(tls, (unsafe.Pointer)(_pPayload), i32(0), uint32(_n))
_60:
{
p := &_nPayload
*p = (*p) - _n
sink1 = *p
}
{
p := &_pPayload
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink13 = *p
}
{
p := &_pSrc
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink13 = *p
}
{
p := &_nSrc
*p = (*p) - _n
sink1 = *p
}
{
p := &_spaceLeft
*p = (*p) - _n
sink1 = *p
}
goto _29
_30:
_releasePage(tls, _pToRelease)
return i32(0)
_ = _5_info
panic(0)
}
var _fillInCellØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_fillInCellØ00__func__Ø000[0], str(81478), 11)
}
// Free any overflow pages associated with the given Cell. Write the
// local Cell size (the number of bytes on the original page, omitting
// overflow) into *pnSize.
func _clearCell(tls *crt.TLS, _pPage *XMemPage, _pCell *uint8, _pInfo *XCellInfo) (r0 int32) {
var _rc, _nOvfl int32
var _ovflPgno, _ovflPageSize, _3_iNext uint32
var _pBt *XBtShared
var _3_pOvfl *XMemPage
_pBt = (*XBtShared)(_pPage.X18)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65147), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearCellØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, _pInfo)
if uint32(_pInfo.X3) == (_pInfo.X2) {
return i32(0)
}
if uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pInfo.X4)))))))))-uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(1)))))))))) > uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pPage.X15))))))))) {
return _sqlite3CorruptError(tls, i32(65153))
}
_ovflPgno = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_pInfo.X4)))))))))-uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(4)))))))))
func() {
if (_pBt.X16) <= uint32(i32(4)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65156), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearCellØ00__func__Ø000))), unsafe.Pointer(str(81489)))
crt.X__builtin_abort(tls)
}
}()
_ovflPageSize = (_pBt.X16) - uint32(i32(4))
_nOvfl = int32(((((_pInfo.X2) - uint32(_pInfo.X3)) + _ovflPageSize) - uint32(i32(1))) / _ovflPageSize)
func() {
if _nOvfl <= i32(0) && ((_sqlite3Config.X6) != i32(0) || ((_pInfo.X2)+_ovflPageSize) >= _ovflPageSize) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65159), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearCellØ00__func__Ø000))), unsafe.Pointer(str(81509)))
crt.X__builtin_abort(tls)
}
}()
_10:
if postInc1(&_nOvfl, int32(-1)) == 0 {
goto _11
}
_3_iNext = uint32(i32(0))
_3_pOvfl = nil
if (_ovflPgno < uint32(i32(2))) || (_ovflPgno > _btreePagecount(tls, _pBt)) {
return _sqlite3CorruptError(tls, i32(65169))
}
if _nOvfl == 0 {
goto _14
}
_rc = _getOverflowPage(tls, _pBt, _ovflPgno, &_3_pOvfl, &_3_iNext)
if _rc != 0 {
return _rc
}
_14:
if ((_3_pOvfl != nil) || (store52(&_3_pOvfl, _btreePageLookup(tls, _pBt, _ovflPgno)) != nil)) && (_sqlite3PagerPageRefcount(tls, (*XPgHdr)(_3_pOvfl.X23)) != i32(1)) {
_rc = _sqlite3CorruptError(tls, i32(65189))
goto _19
}
_rc = _freePage2(tls, _pBt, _3_pOvfl, _ovflPgno)
_19:
if _3_pOvfl != nil {
_sqlite3PagerUnref(tls, (*XPgHdr)(_3_pOvfl.X23))
}
if _rc != 0 {
return _rc
}
_ovflPgno = _3_iNext
goto _10
_11:
return i32(0)
}
var _clearCellØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_clearCellØ00__func__Ø000[0], str(81582), 10)
}
// Retrieve a page from the pager cache. If the requested page is not
// already in the pager cache return NULL. Initialize the MemPage.pBt and
// MemPage.aData elements if needed.
func _btreePageLookup(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 *XMemPage) {
var _pDbPage *XPgHdr
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61038), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreePageLookupØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_pDbPage = _sqlite3PagerLookup(tls, (*XPager)(_pBt.X0), _pgno)
if _pDbPage != nil {
return _btreePageFromDbPage(tls, _pDbPage, _pgno, _pBt)
}
return nil
}
var _btreePageLookupØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_btreePageLookupØ00__func__Ø000[0], str(81592), 16)
}
// This function is used to add page iPage to the database file free-list.
// It is assumed that the page is not already a part of the free-list.
//
// The value passed as the second argument to this function is optional.
// If the caller happens to have a pointer to the MemPage object
// corresponding to page iPage handy, it may pass it as the second value.
// Otherwise, it may pass NULL.
//
// If a pointer to a MemPage object is passed as the second argument,
// its reference count is not altered by this function.
func _freePage2(tls *crt.TLS, _pBt *XBtShared, _pMemPage *XMemPage, _iPage uint32) (r0 int32) {
var _rc, _nFree int32
var _iTrunk, _6_nLeaf uint32
var _pTrunk, _pPage1, _pPage *XMemPage
_pTrunk = nil
_iTrunk = u32(0)
_pPage1 = (*XMemPage)(_pBt.X3)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65005), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X6) != i32(0) && _iPage <= uint32(i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65006), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81608)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pMemPage != nil && (_pMemPage.X4) != _iPage {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65007), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81630)))
crt.X__builtin_abort(tls)
}
}()
if _iPage < uint32(i32(2)) {
return _sqlite3CorruptError(tls, i32(65009))
}
if _pMemPage != nil {
_pPage = _pMemPage
_sqlite3PagerRef(tls, (*XPgHdr)(_pPage.X23))
goto _10
}
_pPage = _btreePageLookup(tls, _pBt, _iPage)
_10:
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage1.X23))
if _rc != 0 {
goto _freepage_out
}
_nFree = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36))))))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(36)))), uint32(_nFree+i32(1)))
if (int32(_pBt.X10) & i32(4)) == 0 {
goto _12
}
if ((_pPage == nil) && (store1(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, i32(0))) != i32(0))) || (store1(&_rc, _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))) != i32(0)) {
goto _freepage_out
}
crt.Xmemset(tls, (unsafe.Pointer)(_pPage.X19), i32(0), (*XBtShared)(_pPage.X18).X15)
_12:
if (_pBt.X5) == 0 {
goto _16
}
_ptrmapPut(tls, _pBt, _iPage, uint8(i32(2)), uint32(i32(0)), &_rc)
if _rc != 0 {
goto _freepage_out
}
_16:
if _nFree == i32(0) {
goto _18
}
_iTrunk = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))))
_rc = _btreeGetPage(tls, _pBt, _iTrunk, &_pTrunk, i32(0))
if _rc != i32(0) {
goto _freepage_out
}
_6_nLeaf = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4)))))
func() {
if (_pBt.X16) <= uint32(i32(32)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65060), unsafe.Pointer((*int8)(unsafe.Pointer(&_freePage2Ø00__func__Ø000))), unsafe.Pointer(str(81665)))
crt.X__builtin_abort(tls)
}
}()
if _6_nLeaf > (((_pBt.X16) / uint32(i32(4))) - uint32(i32(2))) {
_rc = _sqlite3CorruptError(tls, i32(65062))
goto _freepage_out
}
if _6_nLeaf >= (((_pBt.X16) / uint32(i32(4))) - uint32(i32(8))) {
goto _23
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pTrunk.X23))
if _rc != i32(0) {
goto _24
}
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(i32(4)))), _6_nLeaf+uint32(i32(1)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrunk.X19))+1*uintptr(uint32(i32(8))+(_6_nLeaf*uint32(i32(4)))))), _iPage)
if (_pPage != nil) && ((int32(_pBt.X10) & i32(4)) == i32(0)) {
_sqlite3PagerDontWrite(tls, (*XPgHdr)(_pPage.X23))
}
_rc = _btreeSetHasContent(tls, _pBt, _iPage)
_24:
goto _freepage_out
_23:
_18:
if (_pPage == nil) && (i32(0) != store1(&_rc, _btreeGetPage(tls, _pBt, _iPage, &_pPage, i32(0)))) {
goto _freepage_out
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))
if _rc != i32(0) {
goto _freepage_out
}
_sqlite3Put4byte(tls, _pPage.X19, _iTrunk)
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19))+1*uintptr(i32(4)))), uint32(i32(0)))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage1.X19))+1*uintptr(i32(32)))), _iPage)
_freepage_out:
if _pPage != nil {
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0))
}
_releasePage(tls, _pPage)
_releasePage(tls, _pTrunk)
return _rc
}
var _freePage2Ø00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_freePage2Ø00__func__Ø000[0], str(81684), 10)
}
// Increment the reference count for page pPg.
func _sqlite3PagerRef(tls *crt.TLS, _pPg *XPgHdr) {
_sqlite3PcacheRef(tls, _pPg)
}
// Increase the reference count of a supplied page by 1.
func _sqlite3PcacheRef(tls *crt.TLS, _p *XPgHdr) {
func() {
if int32(_p.X7) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44653), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PcachePageSanity(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44654), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheRefØ00__func__Ø000))), unsafe.Pointer(str(13867)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_p.X7))) += 1
*(*int32)(unsafe.Pointer(&((*XPCache)(_p.X8).X3))) += 1
}
var _sqlite3PcacheRefØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheRefØ00__func__Ø000[0], str(81694), 17)
}
// A call to this routine tells the pager that it is not necessary to
// write the information on page pPg back to the disk, even though
// that page might be marked as dirty. This happens, for example, when
// the page has been added as a leaf of the freelist and so its
// content no longer matters.
//
// The overlying software layer calls this routine when all of the data
// on the given page is unused. The pager marks the page as clean so
// that it does not get written to disk.
//
// Tests show that this optimization can quadruple the speed of large
// DELETE operations.
//
// This optimization cannot be used with a temp-file, as the page may
// have been dirty at the start of the transaction. In that case, if
// memory pressure forces page pPg out of the cache, the data does need
// to be written out to disk so that it may be read back in if the
// current transaction is rolled back.
func _sqlite3PagerDontWrite(tls *crt.TLS, _pPg *XPgHdr) {
var _pPager *XPager
_pPager = (*XPager)(_pPg.X4)
if (((_pPager.X10) == 0) && (int32(_pPg.X6)&i32(2)) != 0) && ((_pPager.X38) == i32(0)) {
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_pPg.X6)))
*p = uint16(int32(*p) & i32(-5))
sink14 = *p
}
}
}
// Set bit pgno of the BtShared.pHasContent bitvec. This is called
// when a page that previously contained data becomes a free-list leaf
// page.
//
// The BtShared.pHasContent bitvec exists to work around an obscure
// bug caused by the interaction of two useful IO optimizations surrounding
// free-list leaf pages:
//
// 1) When all data is deleted from a page and the page becomes
// a free-list leaf page, the page is not written to the database
// (as free-list leaf pages contain no meaningful data). Sometimes
// such a page is not even journalled (as it will not be modified,
// why bother journalling it?).
//
// 2) When a free-list leaf page is reused, its content is not read
// from the database or written to the journal file (why should it
// be, if it is not at all meaningful?).
//
// By themselves, these optimizations work fine and provide a handy
// performance boost to bulk delete or insert operations. However, if
// a page is moved to the free-list and then reused within the same
// transaction, a problem comes up. If the page is not journalled when
// it is moved to the free-list and it is also not journalled when it
// is extracted from the free-list and reused, then the original data
// may be lost. In the event of a rollback, it may not be possible
// to restore the database to its original configuration.
//
// The solution is the BtShared.pHasContent bitvec. Whenever a page is
// moved to become a free-list leaf page, the corresponding bit is
// set in the bitvec. Whenever a leaf page is extracted from the free-list,
// optimization 2 above is omitted if the corresponding bit is already
// set in BtShared.pHasContent. The contents of the bitvec are cleared
// at the end of every transaction.
func _btreeSetHasContent(tls *crt.TLS, _pBt *XBtShared, _pgno uint32) (r0 int32) {
var _rc int32
_rc = i32(0)
if (*XBitvec)(_pBt.X22) != nil {
goto _0
}
func() {
if _pgno > (_pBt.X18) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59597), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeSetHasContentØ00__func__Ø000))), unsafe.Pointer(str(81711)))
crt.X__builtin_abort(tls)
}
}()
*(**XBitvec)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X22))))) = _sqlite3BitvecCreate(tls, _pBt.X18)
if (*XBitvec)(_pBt.X22) == nil {
_rc = _sqlite3NomemError(tls, i32(59600))
}
_0:
if (_rc == i32(0)) && (_pgno <= _sqlite3BitvecSize(tls, (*XBitvec)(_pBt.X22))) {
_rc = _sqlite3BitvecSet(tls, (*XBitvec)(_pBt.X22), _pgno)
}
return _rc
}
var _btreeSetHasContentØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_btreeSetHasContentØ00__func__Ø000[0], str(81728), 19)
}
// Remove the i-th cell from pPage. This routine effects pPage only.
// The cell content is not freed or deallocated. It is assumed that
// the cell content has been copied someplace else. This routine just
// removes the reference to the cell from pPage.
//
// "sz" must be the number of bytes in the cell.
func _dropCell(tls *crt.TLS, _pPage *XMemPage, _idx int32, _sz int32, _pRC *int32) {
var _rc, _hdr int32
var _pc uint32
var _data, _ptr *uint8
if (*_pRC) != 0 {
return
}
func() {
if _idx < i32(0) || _idx >= int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65400), unsafe.Pointer((*int8)(unsafe.Pointer(&_dropCellØ00__func__Ø000))), unsafe.Pointer(str(81747)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X6) != i32(0) && _sz != int32(_cellSize(tls, _pPage, _idx)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65401), unsafe.Pointer((*int8)(unsafe.Pointer(&_dropCellØ00__func__Ø000))), unsafe.Pointer(str(81774)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65402), unsafe.Pointer((*int8)(unsafe.Pointer(&_dropCellØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65403), unsafe.Pointer((*int8)(unsafe.Pointer(&_dropCellØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
_data = _pPage.X19
_ptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21)) + 1*uintptr(i32(2)*_idx)))
_pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_ptr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_ptr)) + 1*uintptr(i32(1))))))
_hdr = int32(_pPage.X6)
if (_pc < uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))< ((*XBtShared)(_pPage.X18).X16)) {
*_pRC = _sqlite3CorruptError(tls, i32(65411))
return
}
_rc = _freeSpace(tls, _pPage, uint16(_pc), uint16(_sz))
if _rc != 0 {
*_pRC = _rc
return
}
*(*uint16)(unsafe.Pointer(&(_pPage.X14))) -= 1
if int32(_pPage.X14) == i32(0) {
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1))))), i32(0), uint32(i32(4)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(((*XBtShared)(_pPage.X18).X16) >> uint(i32(8)))
return _data
}()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8((*XBtShared)(_pPage.X18).X16)
*(*uint16)(unsafe.Pointer(&(_pPage.X13))) = uint16(((((*XBtShared)(_pPage.X18).X16) - uint32(_pPage.X6)) - uint32(_pPage.X7)) - uint32(i32(8)))
goto _15
}
crt.Xmemmove(tls, (unsafe.Pointer)(_ptr), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_ptr))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(2))))))))), uint32(i32(2)*(int32(_pPage.X14)-_idx)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPage.X14) >> uint(i32(8)))
return _data
}()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPage.X14)
{
p := (*uint16)(unsafe.Pointer(&(_pPage.X13)))
*p = uint16(int32(*p) + i32(2))
sink14 = *p
}
_15:
}
var _dropCellØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_dropCellØ00__func__Ø000[0], str(81813), 9)
}
// This variation on cellSizePtr() is used inside of assert() statements
// only.
func _cellSize(tls *crt.TLS, _pPage *XMemPage, _iCell int32) (r0 uint16) {
return (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCell))))) + 1*uintptr(i32(0)))))<aData to the freelist.
// The first byte of the new free block is pPage->aData[iStart]
// and the size of the block is iSize bytes.
//
// Adjacent freeblocks are coalesced.
//
// Note that even though the freeblock list was checked by btreeInitPage(),
// that routine will not detect overlap between cells or freeblocks. Nor
// does it detect cells or freeblocks that encrouch into the reserved bytes
// at the end of the page. So do additional corruption checks inside this
// routine and return SQLITE_CORRUPT if any problems are found.
func _freeSpace(tls *crt.TLS, _pPage *XMemPage, _iStart uint16, _iSize uint16) (r0 int32) {
var _7_iPtrEnd int32
var _iLast, _iEnd uint32
var _iPtr, _iFreeBlk, _iOrigSize uint16
var _hdr, _nFrag uint8
var _data *uint8
_nFrag = u8(0)
_iOrigSize = _iSize
_iLast = ((*XBtShared)(_pPage.X18).X16) - uint32(i32(4))
_iEnd = uint32(int32(_iStart) + int32(_iSize))
_data = _pPage.X19
func() {
if (*XBtShared)(_pPage.X18) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60667), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(55360)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60668), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X6) != i32(0) && int32(_iStart) < ((int32(_pPage.X6)+i32(6))+int32(_pPage.X7)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60669), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81822)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X6) != i32(0) && _iEnd > ((*XBtShared)(_pPage.X18).X16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60670), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81883)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60671), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_iSize) < i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60672), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81928)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uint32(_iStart) > _iLast {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60673), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81937)))
crt.X__builtin_abort(tls)
}
}()
if (int32((*XBtShared)(_pPage.X18).X10) & i32(4)) != 0 {
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iStart)))), i32(0), uint32(_iSize))
}
_hdr = _pPage.X6
_iPtr = uint16(int32(_hdr) + i32(1))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_iPtr)+i32(1))))) == i32(0)) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_iPtr)))) == i32(0)) {
_iFreeBlk = uint16(i32(0))
goto _19
}
_20:
if int32(store14(&_iFreeBlk, uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))))<= int32(_iStart) {
goto _21
}
if int32(_iFreeBlk) >= (int32(_iPtr) + i32(4)) {
goto _22
}
if int32(_iFreeBlk) == i32(0) {
goto _21
}
return _sqlite3CorruptError(tls, i32(60692))
_22:
_iPtr = _iFreeBlk
goto _20
_21:
if uint32(_iFreeBlk) > _iLast {
return _sqlite3CorruptError(tls, i32(60696))
}
func() {
if int32(_iFreeBlk) <= int32(_iPtr) && int32(_iFreeBlk) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60697), unsafe.Pointer((*int8)(unsafe.Pointer(&_freeSpaceØ00__func__Ø000))), unsafe.Pointer(str(81951)))
crt.X__builtin_abort(tls)
}
}()
if _iFreeBlk == 0 || (_iEnd+uint32(i32(3))) < uint32(_iFreeBlk) {
goto _29
}
_nFrag = uint8(uint32(_iFreeBlk) - _iEnd)
if _iEnd > uint32(_iFreeBlk) {
return _sqlite3CorruptError(tls, i32(60707))
}
_iEnd = uint32(int32(_iFreeBlk) + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iFreeBlk)+i32(2)))))) + 1*uintptr(i32(1)))))))
if _iEnd > ((*XBtShared)(_pPage.X18).X16) {
return _sqlite3CorruptError(tls, i32(60709))
}
_iSize = uint16(_iEnd - uint32(_iStart))
_iFreeBlk = uint16((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iFreeBlk))))) + 1*uintptr(i32(1))))))
_29:
if int32(_iPtr) <= (int32(_hdr) + i32(1)) {
goto _32
}
_7_iPtrEnd = int32(_iPtr) + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iPtr)+i32(2)))))) + 1*uintptr(i32(1))))))
if (_7_iPtrEnd + i32(3)) < int32(_iStart) {
goto _33
}
if _7_iPtrEnd > int32(_iStart) {
return _sqlite3CorruptError(tls, i32(60721))
}
{
p := &_nFrag
*p = uint8(int32(*p) + (int32(_iStart) - _7_iPtrEnd))
sink2 = *p
}
_iSize = uint16(_iEnd - uint32(_iPtr))
_iStart = _iPtr
_33:
_32:
if int32(_nFrag) > int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7))))) {
return _sqlite3CorruptError(tls, i32(60727))
}
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_hdr)+i32(7))))
*p = uint8(int32(*p) - int32(_nFrag))
sink2 = *p
}
_19:
if int32(_iStart) != ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))))) {
goto _36
}
if int32(_iPtr) != (int32(_hdr) + i32(1)) {
return _sqlite3CorruptError(tls, i32(60734))
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(1)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8)))
return _data
}()))+1*uintptr(int32(_hdr)+i32(1)))))) + 1*uintptr(i32(1)))) = uint8(_iFreeBlk)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_iEnd >> uint(i32(8)))
return _data
}()))+1*uintptr(int32(_hdr)+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_iEnd)
goto _38
_36:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iPtr))))) + 1*uintptr(i32(0)))) = uint8(int32(_iStart) >> uint(i32(8)))
return _data
}()))+1*uintptr(_iPtr))))) + 1*uintptr(i32(1)))) = uint8(_iStart)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iStart))))) + 1*uintptr(i32(0)))) = uint8(int32(_iFreeBlk) >> uint(i32(8)))
return _data
}()))+1*uintptr(_iStart))))) + 1*uintptr(i32(1)))) = uint8(_iFreeBlk)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_iStart)+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(int32(_iSize) >> uint(i32(8)))
return _data
}()))+1*uintptr(int32(_iStart)+i32(2)))))) + 1*uintptr(i32(1)))) = uint8(_iSize)
_38:
{
p := (*uint16)(unsafe.Pointer(&(_pPage.X13)))
*p = uint16(int32(*p) + int32(_iOrigSize))
sink14 = *p
}
return i32(0)
}
var _freeSpaceØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_freeSpaceØ00__func__Ø000[0], str(81980), 10)
}
// Insert a new cell on pPage at cell index "i". pCell points to the
// content of the cell.
//
// If the cell content will fit on the page, then put it there. If it
// will not fit, then make a copy of the cell content into pTemp if
// pTemp is not null. Regardless of pTemp, allocate a new entry
// in pPage->apOvfl[] and make it point to the cell content (either
// in pTemp or the original pCell) and also record its index.
// Allocating a new entry in pPage->aCell[] implies that
// pPage->nOverflow is incremented.
//
// *pRC must be SQLITE_OK when this routine is called.
func _insertCell(tls *crt.TLS, _pPage *XMemPage, _i int32, _pCell *uint8, _sz int32, _pTemp *uint8, _iChild uint32, _pRC *int32) {
var _idx, _j, _4_rc int32
var _data, _pIns *uint8
_idx = i32(0)
func() {
if (*_pRC) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65461), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(81990)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _i < i32(0) || _i > (int32(_pPage.X14)+int32(_pPage.X9)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65462), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82006)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((((*XBtShared)(_pPage.X18).X15) - uint32(i32(8))) / uint32(i32(6))) > uint32(i32(10921)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65463), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82047)))
crt.X__builtin_abort(tls)
}
}()
func() {
if uint32(_pPage.X14) > ((((*XBtShared)(_pPage.X18).X15)-uint32(i32(8)))/uint32(i32(6))) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65464), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82074)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X9) > i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65465), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82122)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65467), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sz != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, _pCell)) && (_sz != i32(8) || _iChild <= uint32(i32(0))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65473), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82165)))
crt.X__builtin_abort(tls)
}
}()
if (_pPage.X9) == 0 && (_sz+i32(2)) <= int32(_pPage.X13) {
goto _19
}
if _pTemp != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTemp), (unsafe.Pointer)(_pCell), uint32(_sz))
_pCell = _pTemp
}
if _iChild != 0 {
_sqlite3Put4byte(tls, _pCell, _iChild)
}
_j = int32(postInc2((*uint8)(unsafe.Pointer(&(_pPage.X9))), uint8(1)))
func() {
if _j >= i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65486), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82223)))
crt.X__builtin_abort(tls)
}
}()
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pPage.X17))))) + 4*uintptr(_j))) = _pCell
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j))) = uint16(_i)
func() {
if _j != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j-i32(1))))) >= int32(uint16(_i)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65495), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82254)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _j != i32(0) && _i != (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPage.X16))))) + 2*uintptr(_j-i32(1)))))+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65496), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82288)))
crt.X__builtin_abort(tls)
}
}()
goto _30
_19:
_4_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pPage.X23))
if _4_rc != i32(0) {
*_pRC = _4_rc
return
}
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65503), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
_data = _pPage.X19
func() {
if (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_pPage.X12))) != (_pPage.X21) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65505), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82320)))
crt.X__builtin_abort(tls)
}
}()
_4_rc = _allocateSpace(tls, _pPage, _sz, &_idx)
if _4_rc != 0 {
*_pRC = _4_rc
return
}
func() {
if _idx < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65510), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82362)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _idx < ((int32(_pPage.X12)+(i32(2)*int32(_pPage.X14)))+i32(2)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65511), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82371)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_idx + _sz) > int32((*XBtShared)(_pPage.X18).X16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65512), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82427)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pPage.X13)))
*p = uint16(int32(*p) - int32(uint16(i32(2)+_sz)))
sink14 = *p
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_idx)))), (unsafe.Pointer)(_pCell), uint32(_sz))
if _iChild != 0 {
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_idx))), _iChild)
}
_pIns = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X21)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_i*i32(2))))))))
crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pIns))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(2))))))))), (unsafe.Pointer)(_pIns), uint32(i32(2)*(int32(_pPage.X14)-_i)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIns)) + 1*uintptr(i32(0)))) = uint8(_idx >> uint(i32(8)))
return _pIns
}())) + 1*uintptr(i32(1)))) = uint8(_idx)
*(*uint16)(unsafe.Pointer(&(_pPage.X14))) += 1
if int32(preInc2((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(4)))), byte(1))) == i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(int32(_pPage.X6)+i32(3)))) += 1
}
func() {
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(int32(_pPage.X6)+i32(3)))))) + 1*uintptr(i32(1)))))) != int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65524), unsafe.Pointer((*int8)(unsafe.Pointer(&_insertCellØ00__func__Ø000))), unsafe.Pointer(str(82465)))
crt.X__builtin_abort(tls)
}
}()
if ((*XBtShared)(_pPage.X18).X5) != 0 {
_ptrmapPutOvflPtr(tls, _pPage, _pCell, _pRC)
}
_30:
}
var _insertCellØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_insertCellØ00__func__Ø000[0], str(82515), 11)
}
// Allocate nByte bytes of space from within the B-Tree page passed
// as the first argument. Write into *pIdx the index into pPage->aData[]
// of the first byte of allocated space. Return either SQLITE_OK or
// an error code (usually SQLITE_CORRUPT).
//
// The caller guarantees that there is sufficient space to make the
// allocation. This routine might need to defragment in order to bring
// all the space together, however. This routine will avoid using
// the first two bytes past the cell pointer area since presumably this
// allocation is being made in order to insert a new cell, so we will
// also end up needing a new cell pointer.
func _allocateSpace(tls *crt.TLS, _pPage *XMemPage, _nByte int32, _pIdx *int32) (r0 int32) {
var _hdr, _top, _rc, _gap int32
var _data, _4_pSpace *uint8
_hdr = int32(_pPage.X6)
_data = _pPage.X19
_rc = i32(0)
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60574), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtShared)(_pPage.X18) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60575), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(20307)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60576), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nByte < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60577), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82526)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X13) < _nByte {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60578), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82535)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60579), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82555)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nByte >= int32(((*XBtShared)(_pPage.X18).X16)-uint32(i32(8))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60580), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82575)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X12) != ((_hdr + i32(12)) - (i32(4) * int32(_pPage.X5))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60582), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82615)))
crt.X__builtin_abort(tls)
}
}()
_gap = int32(_pPage.X12) + (i32(2) * int32(_pPage.X14))
func() {
if _gap > i32(65536) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60584), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82661)))
crt.X__builtin_abort(tls)
}
}()
_top = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))
func() {
if _top > int32((*XBtShared)(_pPage.X18).X16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60591), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82672)))
crt.X__builtin_abort(tls)
}
}()
if _gap <= _top {
goto _20
}
if (_top == i32(0)) && (((*XBtShared)(_pPage.X18).X16) == uint32(i32(65536))) {
_top = i32(65536)
goto _23
}
return _sqlite3CorruptError(tls, i32(60596))
_23:
_20:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(2))))) == 0 && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(1))))) == 0 || (_gap+i32(2)) > _top {
goto _26
}
_4_pSpace = _pageFindSlot(tls, _pPage, _nByte, &_rc)
if _4_pSpace != nil {
func() {
if uintptr(unsafe.Pointer(_4_pSpace)) < uintptr(unsafe.Pointer(_data)) || int32((uintptr(unsafe.Pointer(_4_pSpace))-uintptr(unsafe.Pointer(_data)))/1) >= i32(65536) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60610), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82705)))
crt.X__builtin_abort(tls)
}
}()
*_pIdx = int32((uintptr(unsafe.Pointer(_4_pSpace)) - uintptr(unsafe.Pointer(_data))) / 1)
return i32(0)
}
if _rc != 0 {
return _rc
}
_26:
if ((_gap + i32(2)) + _nByte) <= _top {
goto _33
}
func() {
if int32(_pPage.X14) <= i32(0) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60623), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82743)))
crt.X__builtin_abort(tls)
}
}()
_rc = _defragmentPage(tls, _pPage, func() int32 {
if i32(4) < (int32(_pPage.X13) - (i32(2) + _nByte)) {
return i32(4)
}
return (int32(_pPage.X13) - (i32(2) + _nByte))
}())
if _rc != 0 {
return _rc
}
_top = ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1)
func() {
if ((_gap + i32(2)) + _nByte) > _top {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60627), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82772)))
crt.X__builtin_abort(tls)
}
}()
_33:
{
p := &_top
*p = (*p) - _nByte
sink1 = *p
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_top >> uint(i32(8)))
return _data
}()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_top)
func() {
if (_top + _nByte) > int32((*XBtShared)(_pPage.X18).X16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60639), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateSpaceØ00__func__Ø000))), unsafe.Pointer(str(82789)))
crt.X__builtin_abort(tls)
}
}()
*_pIdx = _top
return i32(0)
}
var _allocateSpaceØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_allocateSpaceØ00__func__Ø000[0], str(82830), 14)
}
// Search the free-list on page pPg for space to store a cell nByte bytes in
// size. If one can be found, return a pointer to the space and remove it
// from the free-list.
//
// If no suitable space can be found on the free-list, return NULL.
//
// This function may detect corruption within pPg. If corruption is
// detected then *pRc is set to SQLITE_CORRUPT and NULL is returned.
//
// Slots on the free list that are between 1 and 3 bytes larger than nByte
// will be ignored if adding the extra space to the fragmentation count
// causes the fragmentation count to exceed 60.
func _pageFindSlot(tls *crt.TLS, _pPg *XMemPage, _nByte int32, _pRc *int32) (r0 *uint8) {
var _hdr, _iAddr, _pc, _x, _usableSize, _1_size int32
var _aData *uint8
_hdr = int32(_pPg.X6)
_aData = _pPg.X19
_iAddr = _hdr + i32(1)
_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr))))) + 1*uintptr(i32(1)))))
_usableSize = int32((*XBtShared)(_pPg.X18).X16)
func() {
if _pc <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60512), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageFindSlotØ00__func__Ø000))), unsafe.Pointer(str(82844)))
crt.X__builtin_abort(tls)
}
}()
_2:
if (_pc > (_usableSize - i32(4))) || (_pc < (_iAddr + i32(4))) {
*_pRc = _sqlite3CorruptError(tls, i32(60518))
return nil
}
_1_size = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(1)))))
if store1(&_x, _1_size-_nByte) < i32(0) {
goto _5
}
if (_pc < (int32(_pPg.X12) + (i32(2) * int32(_pPg.X14)))) || ((_1_size + _pc) > _usableSize) {
*_pRc = _sqlite3CorruptError(tls, i32(60529))
return nil
}
if _x >= i32(4) {
goto _9
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7))))) > i32(57) {
return nil
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_iAddr)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc)))), uint32(i32(2)))
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7))))
*p = uint8(int32(*p) + int32(uint8(_x)))
sink2 = *p
}
goto _11
_9:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(0)))) = uint8(_x >> uint(i32(8)))
return _aData
}()))+1*uintptr(_pc+i32(2)))))) + 1*uintptr(i32(1)))) = uint8(_x)
_11:
return (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_pc+_x)))
_5:
_iAddr = _pc
_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_pc))))) + 1*uintptr(i32(1)))))
if _pc != 0 {
goto _2
}
return nil
}
var _pageFindSlotØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_pageFindSlotØ00__func__Ø000[0], str(82849), 13)
}
// Defragment the page given. This routine reorganizes cells within the
// page so that there are no free-blocks on the free-block list.
//
// Parameter nMaxFrag is the maximum amount of fragmented space that may be
// present in the page after this routine returns.
//
// EVIDENCE-OF: R-44582-60138 SQLite may from time to time reorganize a
// b-tree page so that there are no freeblocks or fragment bytes, all
// unused bytes are contained in the unallocated space region, and all
// cells are packed tightly at the end of the page.
func _defragmentPage(tls *crt.TLS, _pPage *XMemPage, _nMaxFrag int32) (r0 int32) {
var _i, _pc, _hdr, _size, _usableSize, _cellOffset, _cbrk, _nCell, _iCellFirst, _iCellLast, _1_iFree, _2_iFree2, _3_sz2, _3_sz, _3_top, _11_x int32
var _data, _temp, _src, _3_pEnd, _3_pAddr, _8_pAddr *uint8
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60381), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtShared)(_pPage.X18) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60382), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(55360)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XBtShared)(_pPage.X18).X16) > uint32(i32(65536)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60383), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82862)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60384), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82555)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60385), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
_temp = nil
_src = store13(&_data, _pPage.X19)
_hdr = int32(_pPage.X6)
_cellOffset = int32(_pPage.X12)
_nCell = int32(_pPage.X14)
func() {
if _nCell != ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60391), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82909)))
crt.X__builtin_abort(tls)
}
}()
_iCellFirst = _cellOffset + (i32(2) * _nCell)
_usableSize = int32((*XBtShared)(_pPage.X18).X16)
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))) > _nMaxFrag {
goto _12
}
_1_iFree = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1)))))
if _1_iFree == 0 {
goto _13
}
_2_iFree2 = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree))))) + 1*uintptr(i32(1)))))
func() {
if _2_iFree2 != i32(0) && _2_iFree2 <= _1_iFree {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60411), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82939)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_1_iFree + ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1))))))) > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60412), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(82965)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _2_iFree2 != i32(0) && (_2_iFree2+((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0)))))< _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60413), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83010)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != _2_iFree2 && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_2_iFree2)))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_2_iFree2+i32(1))))) != i32(0)) {
goto _24
}
_3_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset+(_nCell*i32(2)))))
_3_sz2 = i32(0)
_3_sz = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+i32(2)))))) + 1*uintptr(i32(1)))))
_3_top = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))
if _2_iFree2 == 0 {
goto _25
}
if (_1_iFree + _3_sz) > _2_iFree2 {
return _sqlite3CorruptError(tls, i32(60422))
}
_3_sz2 = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_2_iFree2+i32(2)))))) + 1*uintptr(i32(1)))))
func() {
if ((((_1_iFree + _3_sz) + _3_sz2) + _2_iFree2) - (_1_iFree + _3_sz)) > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60424), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83070)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr((_1_iFree+_3_sz)+_3_sz2)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_1_iFree+_3_sz)))), uint32(_2_iFree2-(_1_iFree+_3_sz)))
{
p := &_3_sz
*p = (*p) + _3_sz2
sink1 = *p
}
_25:
_cbrk = _3_top + _3_sz
func() {
if (_cbrk + (_1_iFree - _3_top)) > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60429), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83115)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cbrk)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_3_top)))), uint32(_1_iFree-_3_top))
_3_pAddr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset)))
_31:
if uintptr(unsafe.Pointer(_3_pAddr)) >= uintptr(unsafe.Pointer(_3_pEnd)) {
goto _34
}
_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(1)))))
if _pc < _1_iFree {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz) >> uint(i32(8)))
return _3_pAddr
}())) + 1*uintptr(i32(1)))) = uint8(_pc + _3_sz)
goto _37
}
if _pc < _2_iFree2 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pAddr)) + 1*uintptr(i32(0)))) = uint8((_pc + _3_sz2) >> uint(i32(8)))
return _3_pAddr
}())) + 1*uintptr(i32(1)))) = uint8(_pc + _3_sz2)
}
_37:
{
p := &_3_pAddr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink13 = *p
}
goto _31
_34:
goto _defragment_out
_24:
_13:
_12:
_cbrk = _usableSize
_iCellLast = _usableSize - i32(4)
_i = i32(0)
_38:
if _i >= _nCell {
goto _41
}
_8_pAddr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellOffset+(_i*i32(2)))))
_pc = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(1)))))
if (_pc < _iCellFirst) || (_pc > _iCellLast) {
return _sqlite3CorruptError(tls, i32(60453))
}
func() {
if _pc < _iCellFirst || _pc > _iCellLast {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60455), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83146)))
crt.X__builtin_abort(tls)
}
}()
_size = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_src))+1*uintptr(_pc)))))
{
p := &_cbrk
*p = (*p) - _size
sink1 = *p
}
if (_cbrk < _iCellFirst) || ((_pc + _size) > _usableSize) {
return _sqlite3CorruptError(tls, i32(60459))
}
func() {
if (_cbrk+_size) > _usableSize || _cbrk < _iCellFirst {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60461), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83178)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_pAddr)) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8)))
return _8_pAddr
}())) + 1*uintptr(i32(1)))) = uint8(_cbrk)
if _temp != nil {
goto _52
}
if _cbrk == _pc {
goto _39
}
_temp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPage.X18).X0)))
_11_x = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_temp))+1*uintptr(_11_x)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_11_x)))), uint32((_cbrk+_size)-_11_x))
_src = _temp
_52:
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cbrk)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_src))+1*uintptr(_pc)))), uint32(_size))
_39:
_i += 1
goto _38
_41:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0))
_defragment_out:
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))) + _cbrk) - _iCellFirst) != int32(_pPage.X13) {
return _sqlite3CorruptError(tls, i32(60479))
}
func() {
if _cbrk < _iCellFirst {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60481), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(83220)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(_cbrk >> uint(i32(8)))
return _data
}()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(_cbrk)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(1)))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(2)))) = uint8(i32(0))
crt.Xmemset(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_iCellFirst)))), i32(0), uint32(_cbrk-_iCellFirst))
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pPage.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(60486), unsafe.Pointer((*int8)(unsafe.Pointer(&_defragmentPageØ00__func__Ø000))), unsafe.Pointer(str(53334)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
var _defragmentPageØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_defragmentPageØ00__func__Ø000[0], str(83237), 15)
}
// Return a pointer to the "temporary page" buffer held internally
// by the pager. This is a buffer that is big enough to hold the
// entire content of a database page. This buffer is used internally
// during rollback and will be overwritten whenever a rollback
// occurs. But other modules are free to use it too, as long as
// no rollbacks are happening.
func _sqlite3PagerTempSpace(tls *crt.TLS, _pPager *XPager) (r0 unsafe.Pointer) {
return (unsafe.Pointer)(_pPager.X58)
}
// The page that pCur currently points to has just been modified in
// some way. This function figures out if this modification means the
// tree needs to be balanced, and if so calls the appropriate balancing
// routine. Balancing routines are:
//
// balance_quick()
// balance_deeper()
// balance_nonroot()
func _balance(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
var _rc, _nMin, _balance_quick_called, _balance_deeper_called, _1_iPage, _7_iIdx int32
var _pFree, _10_pSpace *uint8
var _1_pPage, _7_pParent *XMemPage
var _aBalanceQuickSpace [13]uint8
_rc = i32(0)
_nMin = int32((((*XBtShared)(_pCur.X1).X16) * uint32(i32(2))) / uint32(i32(3)))
_pFree = nil
_balance_quick_called = i32(0)
_balance_deeper_called = i32(0)
_0:
_1_iPage = int32(_pCur.X14)
_1_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_1_iPage)))
if _1_iPage != i32(0) {
goto _1
}
if (_1_pPage.X9) == 0 {
goto _2
}
func() {
if _balance_deeper_called != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66966), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(83252)))
crt.X__builtin_abort(tls)
}
}()
_balance_deeper_called += 1
_rc = _balance_deeper(tls, _1_pPage, (**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19)))))+4*uintptr(i32(1)))))
if _rc == i32(0) {
*(*int8)(unsafe.Pointer(&(_pCur.X14))) = int8(i32(1))
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(i32(0)))) = uint16(i32(0))
func() {
if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(i32(1))))).X9) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66973), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(83277)))
crt.X__builtin_abort(tls)
}
}()
}
goto _8
_2:
goto _9
_8:
goto _13
_1:
if (int32(_1_pPage.X9) == i32(0)) && (int32(_1_pPage.X13) <= _nMin) {
goto _9
}
_7_pParent = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_1_iPage-i32(1))))
_7_iIdx = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[19]uint16)(unsafe.Pointer(&(_pCur.X17))))) + 2*uintptr(_1_iPage-i32(1)))))
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_7_pParent.X23))
if _rc != i32(0) {
goto _14
}
if (((((_1_pPage.X3) != 0) && (int32(_1_pPage.X9) == i32(1))) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_1_pPage.X16))))) + 2*uintptr(i32(0))))) == int32(_1_pPage.X14))) && ((_7_pParent.X4) != uint32(i32(1)))) && (int32(_7_pParent.X14) == _7_iIdx) {
func() {
if _balance_quick_called != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67006), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(83304)))
crt.X__builtin_abort(tls)
}
}()
_balance_quick_called += 1
_rc = _balance_quick(tls, _7_pParent, _1_pPage, (*uint8)(unsafe.Pointer(&_aBalanceQuickSpace)))
goto _22
}
_10_pSpace = (*uint8)(_sqlite3PageMalloc(tls, int32((*XBtShared)(_pCur.X1).X15)))
_rc = _balance_nonroot(tls, _7_pParent, _7_iIdx, _10_pSpace, bool2int(_1_iPage == i32(1)), int32(_pCur.X13)&i32(1))
if _pFree != nil {
_sqlite3PageFree(tls, (unsafe.Pointer)(_pFree))
}
_pFree = _10_pSpace
_22:
_14:
*(*uint8)(unsafe.Pointer(&(_1_pPage.X9))) = uint8(i32(0))
_releasePage(tls, _1_pPage)
*(*int8)(unsafe.Pointer(&(_pCur.X14))) -= 1
func() {
if int32(_pCur.X14) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67052), unsafe.Pointer((*int8)(unsafe.Pointer(&_balanceØ00__func__Ø000))), unsafe.Pointer(str(75282)))
crt.X__builtin_abort(tls)
}
}()
_13:
if _rc == i32(0) {
goto _0
}
_9:
if _pFree != nil {
_sqlite3PageFree(tls, (unsafe.Pointer)(_pFree))
}
return _rc
_ = _aBalanceQuickSpace
panic(0)
}
var _balanceØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_balanceØ00__func__Ø000[0], str(83328), 8)
}
// This function is called when the root page of a b-tree structure is
// overfull (has one or more overflow pages).
//
// A new child page is allocated and the contents of the current root
// page, including overflow cells, are copied into the child. The root
// page is then overwritten to make it an empty page with the right-child
// pointer pointing to the new page.
//
// Before returning, all pointer-map entries corresponding to pages
// that the new child-page now contains pointers to are updated. The
// entry corresponding to the new right-child pointer of the root
// page is also updated.
//
// If successful, *ppChild is set to contain a reference to the child
// page and SQLITE_OK is returned. In this case the caller is required
// to call releasePage() on *ppChild exactly once. If an error occurs,
// an error code is returned and *ppChild is set to 0.
func _balance_deeper(tls *crt.TLS, _pRoot *XMemPage, _ppChild **XMemPage) (r0 int32) {
var _rc int32
var _pgnoChild uint32
var _pBt *XBtShared
var _pChild *XMemPage
_pChild = nil
_pgnoChild = u32(0)
_pBt = (*XBtShared)(_pRoot.X18)
func() {
if int32(_pRoot.X9) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66895), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_deeperØ00__func__Ø000))), unsafe.Pointer(str(83336)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66896), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_deeperØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_pRoot.X23))
if _rc != i32(0) {
goto _4
}
_rc = _allocateBtreePage(tls, _pBt, &_pChild, &_pgnoChild, _pRoot.X4, uint8(i32(0)))
_copyNodeContent(tls, _pRoot, _pChild, &_rc)
if (_pBt.X5) != 0 {
_ptrmapPut(tls, _pBt, _pgnoChild, uint8(i32(5)), _pRoot.X4, &_rc)
}
_4:
if _rc != 0 {
*_ppChild = nil
_releasePage(tls, _pChild)
return _rc
}
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pChild.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66915), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_deeperØ00__func__Ø000))), unsafe.Pointer(str(83355)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pRoot.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66916), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_deeperØ00__func__Ø000))), unsafe.Pointer(str(79601)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pChild.X14) != int32(_pRoot.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66917), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_deeperØ00__func__Ø000))), unsafe.Pointer(str(83396)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pChild.X16)))), (unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pRoot.X16)))), uint32(_pRoot.X9)*u32(2))
crt.Xmemcpy(tls, (unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pChild.X17)))), (unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pRoot.X17)))), uint32(_pRoot.X9)*u32(4))
*(*uint8)(unsafe.Pointer(&(_pChild.X9))) = _pRoot.X9
_zeroPage(tls, _pRoot, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pChild.X19)) + 1*uintptr(i32(0)))))&i32(-9))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRoot.X19))+1*uintptr(int32(_pRoot.X6)+i32(8)))), _pgnoChild)
*_ppChild = _pChild
return i32(0)
}
var _balance_deeperØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_balance_deeperØ00__func__Ø000[0], str(83424), 15)
}
// This function is used to copy the contents of the b-tree node stored
// on page pFrom to page pTo. If page pFrom was not a leaf page, then
// the pointer-map entries for each child page are updated so that the
// parent page stored in the pointer map is page pTo. If pFrom contained
// any cells with overflow page pointers, then the corresponding pointer
// map entries are also updated so that the parent page is page pTo.
//
// If pFrom is currently carrying any overflow cells (entries in the
// MemPage.apOvfl[] array), they are not copied to pTo.
//
// Before returning, page pTo is reinitialized using btreeInitPage().
//
// The performance of this function is not critical. It is only used by
// the balance_shallower() and balance_deeper() procedures, neither of
// which are called often under normal circumstances.
func _copyNodeContent(tls *crt.TLS, _pFrom *XMemPage, _pTo *XMemPage, _pRC *int32) {
var _1_iFromHdr, _1_iToHdr, _1_rc, _1_iData int32
var _1_aFrom, _1_aTo *uint8
var _1_pBt *XBtShared
if (*_pRC) != i32(0) {
goto _0
}
_1_pBt = (*XBtShared)(_pFrom.X18)
_1_aFrom = _pFrom.X19
_1_aTo = _pTo.X19
_1_iFromHdr = int32(_pFrom.X6)
_1_iToHdr = func() int32 {
if (_pTo.X4) == uint32(i32(1)) {
return i32(100)
}
return i32(0)
}()
func() {
if (_pFrom.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66056), unsafe.Pointer((*int8)(unsafe.Pointer(&_copyNodeContentØ00__func__Ø000))), unsafe.Pointer(str(83439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pFrom.X13) < _1_iToHdr {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66057), unsafe.Pointer((*int8)(unsafe.Pointer(&_copyNodeContentØ00__func__Ø000))), unsafe.Pointer(str(83453)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1)))))) > int32(_1_pBt.X16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66058), unsafe.Pointer((*int8)(unsafe.Pointer(&_copyNodeContentØ00__func__Ø000))), unsafe.Pointer(str(83474)))
crt.X__builtin_abort(tls)
}
}()
_1_iData = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr+i32(5)))))) + 1*uintptr(i32(1)))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aTo))+1*uintptr(_1_iData)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iData)))), (_1_pBt.X16)-uint32(_1_iData))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aTo))+1*uintptr(_1_iToHdr)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aFrom))+1*uintptr(_1_iFromHdr)))), uint32(int32(_pFrom.X12)+(i32(2)*int32(_pFrom.X14))))
*(*uint8)(unsafe.Pointer(&(_pTo.X0))) = uint8(i32(0))
_1_rc = _btreeInitPage(tls, _pTo)
if _1_rc != i32(0) {
*_pRC = _1_rc
return
}
if (_1_pBt.X5) != 0 {
*_pRC = _setChildPtrmaps(tls, _pTo)
}
_0:
}
var _copyNodeContentØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_copyNodeContentØ00__func__Ø000[0], str(83527), 16)
}
// This version of balance() handles the common special case where
// a new entry is being inserted on the extreme right-end of the
// tree, in other words, when the new entry will become the largest
// entry in the tree.
//
// Instead of trying to balance the 3 right-most leaf pages, just add
// a new page to the right-hand side and put the one new entry in
// that page. This leaves the right side of the tree somewhat
// unbalanced. But odds are that we will be inserting new entries
// at the end soon afterwards so the nearly empty page will quickly
// fill up. On average.
//
// pPage is the leaf page which is the right-most page in the tree.
// pParent is its parent. pPage must have a single overflow entry
// which is also the right-most entry on the page.
//
// The pSpace buffer is used to store a temporary copy of the divider
// cell that will be inserted into pParent. Such a cell consists of a 4
// byte page number followed by a variable length integer. In other
// words, at most 13 bytes. Hence the pSpace buffer must be at
// least 13 bytes in size.
func _balance_quick(tls *crt.TLS, _pParent *XMemPage, _pPage *XMemPage, _pSpace *uint8) (r0 int32) {
var _rc int32
var _pgnoNew uint32
var _1_szCell uint16
var _1_pOut, _1_pCell, _1_pStop *uint8
var _pBt *XBtShared
var _pNew *XMemPage
_pBt = (*XBtShared)(_pPage.X18)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*XBtShared)(_pPage.X18).X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65907), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(20439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65908), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83543)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X9) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65909), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83585)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if int32(_pPage.X14) == i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65912), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _sqlite3CorruptError(tls, i32(65912))
}
_rc = _allocateBtreePage(tls, _pBt, &_pNew, &_pgnoNew, uint32(i32(0)), uint8(i32(0)))
if _rc != i32(0) {
goto _9
}
_1_pOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace)) + 1*uintptr(i32(4))))
_1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_pPage.X17))))) + 4*uintptr(i32(0))))
_1_szCell = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPage.X24)})))(tls, _pPage, _1_pCell)
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pNew.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65927), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83605)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X19)) + 1*uintptr(i32(0))))) != i32(13) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65928), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(83644)))
crt.X__builtin_abort(tls)
}
}()
_zeroPage(tls, _pNew, i32(13))
_rc = _rebuildPage(tls, _pNew, i32(1), &_1_pCell, &_1_szCell)
if func() int32 {
if _rc != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65931), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_quickØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _rc
}
*(*uint16)(unsafe.Pointer(&(_pNew.X13))) = uint16((((_pBt.X16) - uint32(_pNew.X12)) - uint32(i32(2))) - uint32(_1_szCell))
if (_pBt.X5) == 0 {
goto _17
}
_ptrmapPut(tls, _pBt, _pgnoNew, uint8(i32(5)), _pParent.X4, &_rc)
if int32(_1_szCell) > int32(_pNew.X11) {
_ptrmapPutOvflPtr(tls, _pNew, _1_pCell, &_rc)
}
_17:
_1_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*(int32(_pPage.X14)-i32(1))))))) + 1*uintptr(i32(0)))))<= _nCell {
goto _3
}
_1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_apCell)) + 4*uintptr(_i)))
if (uint32(uintptr(unsafe.Pointer(_1_pCell))) >= uint32(uintptr(unsafe.Pointer(_aData)))) && (uint32(uintptr(unsafe.Pointer(_1_pCell))) < uint32(uintptr(unsafe.Pointer(_pEnd)))) {
_1_pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTmp)) + 1*uintptr(int32((uintptr(unsafe.Pointer(_1_pCell))-uintptr(unsafe.Pointer(_aData)))/1))))
}
{
p := &_pData
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i))))))
sink13 = *p
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int32((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8)))
return _pCellptr
}())) + 1*uintptr(i32(1)))) = uint8(int32((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1))
{
p := &_pCellptr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink13 = *p
}
if uintptr(unsafe.Pointer(_pData)) < uintptr(unsafe.Pointer(_pCellptr)) {
return _sqlite3CorruptError(tls, i32(65622))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pData), (unsafe.Pointer)(_1_pCell), uint32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i)))))
func() {
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_szCell)) + 2*uintptr(_i)))) != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pPg.X24)})))(tls, _pPg, _1_pCell)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65624), unsafe.Pointer((*int8)(unsafe.Pointer(&_rebuildPageØ00__func__Ø000))), unsafe.Pointer(str(83710)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _0
_3:
*(*uint16)(unsafe.Pointer(&(_pPg.X14))) = uint16(_nCell)
*(*uint8)(unsafe.Pointer(&(_pPg.X9))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(0)))) = u8(0)
return _aData
}()))+1*uintptr(_hdr+i32(1)))))) + 1*uintptr(i32(1)))) = u8(0)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8)))
return _aData
}()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPg.X14)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int32((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8)))
return _aData
}()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(int32((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(_hdr+i32(7)))) = uint8(i32(0))
return i32(0)
}
var _rebuildPageØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_rebuildPageØ00__func__Ø000[0], str(83762), 12)
}
// This routine redistributes cells on the iParentIdx'th child of pParent
// (hereafter "the page") and up to 2 siblings so that all pages have about the
// same amount of free space. Usually a single sibling on either side of the
// page are used in the balancing, though both siblings might come from one
// side if the page is the first or last child of its parent. If the page
// has fewer than 2 siblings (something which can only happen if the page
// is a root page or a child of a root page) then all available siblings
// participate in the balancing.
//
// The number of siblings of the page might be increased or decreased by
// one or two in an effort to keep pages nearly full but not over full.
//
// Note that when this routine is called, some of the cells on the page
// might not actually be stored in MemPage.aData[]. This can happen
// if the page is overfull. This routine ensures that all cells allocated
// to the page and its siblings fit into MemPage.aData[] before returning.
//
// In the course of balancing the page and its siblings, cells may be
// inserted into or removed from the parent page (pParent). Doing so
// may cause the parent page to become overfull or underfull. If this
// happens, it is the responsibility of the caller to invoke the correct
// balancing routine to fix this problem (see the balance() routine).
//
// If this routine fails for any reason, it might leave the database
// in a corrupted state. So if this routine fails, the database should
// be rolled back.
//
// The third argument to this function, aOvflSpace, is a pointer to a
// buffer big enough to hold one page. If while inserting cells into the parent
// page (pParent) the parent page becomes overfull, this buffer is
// used to store the parent's overflow cells. Because this function inserts
// a maximum of four divider cells into the parent page, and the maximum
// size of a cell stored within an internal node is always less than 1/4
// of the page-size, the aOvflSpace[] buffer is guaranteed to be large
// enough for all overflow cells.
//
// If aOvflSpace is set to a null pointer, this function returns
// SQLITE_NOMEM.
func _balance_nonroot(tls *crt.TLS, _pParent *XMemPage, _iParentIdx int32, _aOvflSpace *uint8, _isRoot int32, _bBulk int32) (r0 int32) {
var _nMaxCells, _nNew, _nOld, _i, _j, _k, _nxDiv, _rc, _leafData, _usableSpace, _pageFlags, _iSpace1, _iOvflSpace, _szScratch, _13_iOff, _17_limit, _29_sz, _42_szRight, _42_szLeft, _42_r, _42_d, _54_iBest, _59_cntOldNext, _59_usableSize, _59_iNew, _59_iOld, _66_sz, _71_iPg, _72_iNew, _72_iOld, _72_nNewCell int32
var _pgno, _77_key uint32
var _leafCorrection, _17_maskPage, _23_sz uint16
var _pRight, _aSpace1, _17_aData, _17_piCell, _17_piEnd, _23_pTemp, _59_aOld, _60_pCell, _66_pCell, _66_pTemp *uint8
var _aPgno, _aPgOrder [5]uint32
var _pBt *XBtShared
var _68_info XCellInfo
var _17_pOld, _27_p, _46_pNew, _58_pOld, _59_pNew, _61_pOld, _66_pNew *XMemPage
var _b XCellArray
var _apOld [3]*XMemPage
var _apNew [5]*XMemPage
var _apDiv [2]*uint8
var _cntNew, _cntOld, _szNew [5]int32
var _abDone [5]uint8
var _aPgFlags [5]uint16
_nMaxCells = i32(0)
_nNew = i32(0)
_rc = i32(0)
_iSpace1 = i32(0)
_iOvflSpace = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_abDone), i32(0), u32(5))
*(*int32)(unsafe.Pointer(&(_b.X0))) = i32(0)
*(***uint8)(unsafe.Pointer(&(_b.X2))) = nil
_pBt = (*XBtShared)(_pParent.X18)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66166), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66167), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83543)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pParent.X9) != i32(0) && int32(_pParent.X9) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66178), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83774)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pParent.X9) != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pParent.X16))))) + 2*uintptr(i32(0))))) != _iParentIdx {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66179), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83821)))
crt.X__builtin_abort(tls)
}
}()
if _aOvflSpace == nil {
return _sqlite3NomemError(tls, i32(66182))
}
_i = int32(_pParent.X9) + int32(_pParent.X14)
if _i < i32(2) {
_nxDiv = i32(0)
goto _12
}
func() {
if _bBulk != i32(0) && _bBulk != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66200), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83877)))
crt.X__builtin_abort(tls)
}
}()
if _iParentIdx == i32(0) {
_nxDiv = i32(0)
goto _19
}
if _iParentIdx == _i {
_nxDiv = (_i - i32(2)) + _bBulk
goto _19
}
_nxDiv = _iParentIdx - i32(1)
_19:
_i = i32(2) - _bBulk
_12:
_nOld = _i + i32(1)
if ((_i + _nxDiv) - int32(_pParent.X9)) == int32(_pParent.X14) {
_pRight = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X19)) + 1*uintptr(int32(_pParent.X6)+i32(8))))
goto _21
}
_pRight = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pParent.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pParent.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pParent.X21))+1*uintptr(i32(2)*((_i+_nxDiv)-int32(_pParent.X9))))))) + 1*uintptr(i32(0)))))< int32(_pBt.X16) {
_rc = _sqlite3CorruptError(tls, i32(66253))
crt.Xmemset(tls, (unsafe.Pointer)(&_apOld), i32(0), uint32(_i+i32(1))*u32(4))
goto _balance_cleanup
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace))+1*uintptr(_13_iOff)))), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 4*uintptr(_i)))), uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))))
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 4*uintptr(_i))) = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace)) + 1*uintptr(int32((uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 4*uintptr(_i)))))-uintptr(unsafe.Pointer(_pParent.X19)))/1))))
_29:
_dropCell(tls, _pParent, (_i+_nxDiv)-int32(_pParent.X9), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))), &_rc)
_28:
goto _22
_23:
_nMaxCells = (_nMaxCells + i32(3)) & i32(-4)
_szScratch = int32(((uint32(_nMaxCells) * u32(4)) + (uint32(_nMaxCells) * u32(2))) + (_pBt.X15))
func() {
if _szScratch > (i32(6) * int32(_pBt.X15)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66279), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83898)))
crt.X__builtin_abort(tls)
}
}()
*(***uint8)(unsafe.Pointer(&(_b.X2))) = (**uint8)(_sqlite3ScratchMalloc(tls, _szScratch))
if (_b.X2) == nil {
_rc = _sqlite3NomemError(tls, i32(66282))
goto _balance_cleanup
}
*(**uint16)(unsafe.Pointer(&(_b.X3))) = (*uint16)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_nMaxCells)))))
_aSpace1 = (*uint8)(unsafe.Pointer((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_nMaxCells)))))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_aSpace1))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66287), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83930)))
crt.X__builtin_abort(tls)
}
}()
*(**XMemPage)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X1))))) = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(i32(0))))
_leafCorrection = uint16(int32((*XMemPage)(_b.X1).X5) * i32(4))
_leafData = int32((*XMemPage)(_b.X1).X3)
_i = i32(0)
_37:
if _i >= _nOld {
goto _40
}
_17_pOld = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i)))
_17_limit = int32(_17_pOld.X14)
_17_aData = _17_pOld.X19
_17_maskPage = _17_pOld.X15
_17_piCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_17_pOld.X12)))))))
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_pOld.X19)) + 1*uintptr(i32(0))))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0))))) {
_rc = _sqlite3CorruptError(tls, i32(66320))
goto _balance_cleanup
}
crt.Xmemset(tls, (unsafe.Pointer)((*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3))+2*uintptr(_b.X0)))), i32(0), u32(2)*uint32(_17_limit+int32(_17_pOld.X9)))
if int32(_17_pOld.X9) <= i32(0) {
goto _42
}
_17_limit = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(i32(0)))))
_j = i32(0)
_43:
if _j >= _17_limit {
goto _46
}
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(0)))))<= int32(_17_pOld.X9) {
goto _50
}
func() {
if _k != i32(0) && (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(_k-i32(1)))))+i32(1)) != int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_17_pOld.X16))))) + 2*uintptr(_k)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66350), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83960)))
crt.X__builtin_abort(tls)
}
}()
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0))) = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_17_pOld.X17))))) + 4*uintptr(_k)))
*(*int32)(unsafe.Pointer(&(_b.X0))) += 1
_k += 1
goto _47
_50:
_42:
_17_piEnd = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_17_pOld.X12))))))))) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(i32(2)*int32(_17_pOld.X14))))))))
_54:
if uintptr(unsafe.Pointer(_17_piCell)) < uintptr(unsafe.Pointer(_17_piEnd)) {
func() {
if (_b.X0) >= _nMaxCells {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66357), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84005)))
crt.X__builtin_abort(tls)
}
}()
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_17_aData)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_17_maskPage)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_piCell)) + 1*uintptr(i32(0)))))<= (_nOld-i32(1)) || _leafData != 0 {
goto _59
}
_23_sz = uint16(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))))
func() {
if (_b.X0) >= _nMaxCells {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66367), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84005)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) = _23_sz
_23_pTemp = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1)) + 1*uintptr(_iSpace1)))
{
p := &_iSpace1
*p = (*p) + int32(_23_sz)
sink1 = *p
}
func() {
if int32(_23_sz) > (int32(_pBt.X11) + i32(23)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66371), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84023)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iSpace1 > int32(_pBt.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66372), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84044)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_23_pTemp), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apDiv)) + 4*uintptr(_i)))), uint32(_23_sz))
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0))) = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_23_pTemp)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_leafCorrection)))))))
func() {
if int32(_leafCorrection) != i32(0) && int32(_leafCorrection) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66375), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84074)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) = uint16(int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) - int32(_leafCorrection))
if (_17_pOld.X5) == 0 {
func() {
if int32(_leafCorrection) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66378), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84113)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_17_pOld.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66379), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84131)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_17_pOld.X19))+1*uintptr(i32(8))))), uint32(i32(4)))
goto _74
}
func() {
if int32(_leafCorrection) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66384), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84150)))
crt.X__builtin_abort(tls)
}
}()
_77:
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) < i32(4) {
func() {
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0)))) != i32(3) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66388), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84168)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_b.X0)))) != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1))+1*uintptr(_iSpace1-i32(3)))) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66389), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84203)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSpace1)) + 1*uintptr(postInc1(&_iSpace1, int32(1))))) = uint8(i32(0))
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_b.X0))) += 1
goto _77
}
_74:
*(*int32)(unsafe.Pointer(&(_b.X0))) += 1
_59:
_i += 1
goto _37
_40:
_usableSpace = int32(((_pBt.X16) - uint32(i32(12))) + uint32(_leafCorrection))
_i = i32(0)
_85:
if _i >= _nOld {
goto _88
}
_27_p = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i)))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = _usableSpace - int32(_27_p.X13)
_j = i32(0)
_89:
if _j >= int32(_27_p.X9) {
goto _92
}
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))
*p = (*p) + (i32(2) + int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_27_p.X24)})))(tls, _27_p, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]*uint8)(unsafe.Pointer(&(_27_p.X17))))) + 4*uintptr(_j))))))
sink1 = *p
}
_j += 1
goto _89
_92:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_i)))
_i += 1
goto _85
_88:
_k = _nOld
_i = i32(0)
_93:
if _i >= _k {
goto _96
}
_97:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))) <= _usableSpace {
goto _98
}
if (_i + i32(1)) < _k {
goto _99
}
_k = _i + i32(2)
if _k > i32(5) {
_rc = _sqlite3CorruptError(tls, i32(66429))
goto _balance_cleanup
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_k-i32(1)))) = i32(0)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_k-i32(1)))) = _b.X0
_99:
_29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))))-i32(1)))
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))
*p = (*p) - _29_sz
sink1 = *p
}
if _leafData != 0 {
goto _101
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) < (_b.X0) {
_29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))))
goto _103
}
_29_sz = i32(0)
_103:
_101:
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i+i32(1))))
*p = (*p) + _29_sz
sink1 = *p
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) -= 1
goto _97
_98:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) >= (_b.X0) {
goto _105
}
_29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))))
if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))) + _29_sz) > _usableSpace {
goto _105
}
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))
*p = (*p) + _29_sz
sink1 = *p
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i))) += 1
if _leafData != 0 {
goto _107
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) < (_b.X0) {
_29_sz = i32(2) + int32(_cachedCellSize(tls, &_b, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))))
goto _109
}
_29_sz = i32(0)
_109:
_107:
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i+i32(1))))
*p = (*p) - _29_sz
sink1 = *p
}
goto _98
_105:
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) >= (_b.X0) {
_k = _i + i32(1)
goto _114
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))) <= func() int32 {
if _i > i32(0) {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1)))))
}
return i32(0)
}() {
_rc = _sqlite3CorruptError(tls, i32(66462))
goto _balance_cleanup
}
_114:
_i += 1
goto _93
_96:
_i = _k - i32(1)
_115:
if _i <= i32(0) {
goto _118
}
_42_szRight = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i)))
_42_szLeft = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i-i32(1))))
_42_r = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1))))) - i32(1)
_42_d = (_42_r + i32(1)) - _leafData
_cachedCellSize(tls, &_b, _42_d)
_119:
func() {
if _42_d >= _nMaxCells {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66488), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84256)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _42_r >= _nMaxCells {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66489), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84268)))
crt.X__builtin_abort(tls)
}
}()
_cachedCellSize(tls, &_b, _42_r)
if (_42_szRight != i32(0)) && (_bBulk != 0 || (((_42_szRight + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_d))))) + i32(2)) > (_42_szLeft - (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_r)))) + func() int32 {
if _i == (_k - i32(1)) {
return i32(0)
}
return i32(2)
}())))) {
goto _129
}
{
p := &_42_szRight
*p = (*p) + (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_d)))) + i32(2))
sink1 = *p
}
{
p := &_42_szLeft
*p = (*p) - (int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_42_r)))) + i32(2))
sink1 = *p
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1)))) = _42_r
_42_r -= 1
_42_d -= 1
if _42_r >= i32(0) {
goto _119
}
_129:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i))) = _42_szRight
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_i-i32(1)))) = _42_szLeft
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(1))))) <= func() int32 {
if _i > i32(1) {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i-i32(2)))))
}
return i32(0)
}() {
_rc = _sqlite3CorruptError(tls, i32(66504))
goto _balance_cleanup
}
_i -= 1
goto _115
_118:
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(i32(0))))) <= i32(0) && ((_pParent.X4) != uint32(i32(1)) || int32(_pParent.X14) != i32(0)) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66516), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84280)))
crt.X__builtin_abort(tls)
}
}()
_pageFlags = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(i32(0))))).X19)) + 1*uintptr(i32(0)))))
_i = i32(0)
_138:
if _i >= _k {
goto _141
}
if _i >= _nOld {
goto _142
}
_46_pNew = store52((**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew))+4*uintptr(_i))), *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i))))
*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i))) = nil
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)(_46_pNew.X23))
_nNew += 1
if _rc != 0 {
goto _balance_cleanup
}
goto _144
_142:
func() {
if _i <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66536), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(12970)))
crt.X__builtin_abort(tls)
}
}()
_rc = _allocateBtreePage(tls, _pBt, &_46_pNew, &_pgno, func() uint32 {
if _bBulk != 0 {
return uint32(i32(1))
}
return _pgno
}(), uint8(i32(0)))
if _rc != 0 {
goto _balance_cleanup
}
_zeroPage(tls, _46_pNew, _pageFlags)
*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i))) = _46_pNew
_nNew += 1
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_i))) = _b.X0
if (_pBt.X5) == 0 {
goto _150
}
_ptrmapPut(tls, _pBt, _46_pNew.X4, uint8(i32(5)), _pParent.X4, &_rc)
if _rc != i32(0) {
goto _balance_cleanup
}
_150:
_144:
_i += 1
goto _138
_141:
_i = i32(0)
_152:
if _i >= _nNew {
goto _155
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_i))) = store5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno))+4*uintptr(_i))), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X4)
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgFlags)) + 2*uintptr(_i))) = (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X23).X6
_j = i32(0)
_156:
if _j >= _i {
goto _159
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_j)))) == (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_i)))) {
func() {
if (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66577), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84349)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3CorruptError(tls, i32(66578))
goto _balance_cleanup
}
_j += 1
goto _156
_159:
_i += 1
goto _152
_155:
_i = i32(0)
_163:
if _i >= _nNew {
goto _166
}
_54_iBest = i32(0)
_j = i32(1)
_167:
if _j >= _nNew {
goto _170
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_j)))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest)))) {
_54_iBest = _j
}
_j += 1
goto _167
_170:
_pgno = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgOrder)) + 4*uintptr(_54_iBest))) = u32(4294967295)
if _54_iBest == _i {
goto _172
}
if _54_iBest > _i {
_sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_54_iBest)))).X23), ((_pBt.X18)+uint32(_54_iBest))+uint32(i32(1)), uint16(i32(0)))
}
_sqlite3PagerRekey(tls, (*XPgHdr)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X23), _pgno, *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgFlags)) + 2*uintptr(_54_iBest))))
*(*uint32)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X4))) = _pgno
_172:
_i += 1
goto _163
_166:
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66612), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83543)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3Put4byte(tls, _pRight, (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_nNew-i32(1))))).X4)
if ((_pageFlags & i32(8)) == i32(0)) && (_nOld != _nNew) {
_58_pOld = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() **XMemPage {
if _nNew > _nOld {
return (**XMemPage)(unsafe.Pointer(&_apNew))
}
return (**XMemPage)(unsafe.Pointer(&_apOld))
}())) + 4*uintptr(_nOld-i32(1))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_nNew-i32(1))))).X19))+1*uintptr(i32(8))))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_58_pOld.X19))+1*uintptr(i32(8))))), uint32(i32(4)))
}
if (_pBt.X5) == 0 {
goto _180
}
_59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(i32(0))))
_59_aOld = _59_pNew.X19
_59_cntOldNext = int32(_59_pNew.X14) + int32(_59_pNew.X9)
_59_usableSize = int32(_pBt.X16)
_59_iNew = i32(0)
_59_iOld = i32(0)
_i = i32(0)
_181:
if _i >= (_b.X0) {
goto _184
}
_60_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_i)))
if _i == _59_cntOldNext {
_61_pOld = func() *XMemPage {
if preInc1(&_59_iOld, 1) < _nNew {
return (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_59_iOld))))
}
return (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_59_iOld))))
}()
{
p := &_59_cntOldNext
*p = (*p) + ((int32(_61_pOld.X14) + int32(_61_pOld.X9)) + bool2int(_leafData == 0))
sink1 = *p
}
_59_aOld = _61_pOld.X19
}
if _i != (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_59_iNew)))) {
goto _188
}
_59_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(preInc1(&_59_iNew, 1))))
if _leafData == 0 {
goto _182
}
_188:
if _59_iOld < _nNew && (_59_pNew.X4) == (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aPgno)) + 4*uintptr(_59_iOld)))) && (uint32(uintptr(unsafe.Pointer(_60_pCell))) >= uint32(uintptr(unsafe.Pointer(_59_aOld))) && uint32(uintptr(unsafe.Pointer(_60_pCell))) < uint32(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_59_aOld))+1*uintptr(_59_usableSize))))))) {
goto _193
}
if _leafCorrection == 0 {
_ptrmapPut(tls, _pBt, _sqlite3Get4byte(tls, _60_pCell), uint8(i32(5)), _59_pNew.X4, &_rc)
}
if int32(_cachedCellSize(tls, &_b, _i)) > int32(_59_pNew.X11) {
_ptrmapPutOvflPtr(tls, _59_pNew, _60_pCell, &_rc)
}
if _rc != 0 {
goto _balance_cleanup
}
_193:
_182:
_i += 1
goto _181
_184:
_180:
_i = i32(0)
_197:
if _i >= (_nNew - i32(1)) {
goto _200
}
_66_pNew = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))
_j = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_i)))
func() {
if _j >= _nMaxCells {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66688), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84360)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_j)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66689), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84372)))
crt.X__builtin_abort(tls)
}
}()
_66_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_j)))
_66_sz = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_j)))) + int32(_leafCorrection)
_66_pTemp = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOvflSpace)) + 1*uintptr(_iOvflSpace)))
if (_66_pNew.X5) == 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_pNew.X19))+1*uintptr(i32(8))))), (unsafe.Pointer)(_66_pCell), uint32(i32(4)))
goto _208
}
if _leafData != 0 {
_j -= 1
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_66_pNew.X25)})))(tls, _66_pNew, *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X2)) + 4*uintptr(_j))), &_68_info)
_66_pCell = _66_pTemp
_66_sz = i32(4) + _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_pCell))+1*uintptr(i32(4)))), uint64(_68_info.X0))
_66_pTemp = nil
goto _208
}
{
p := &_66_pCell
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(4))))
sink13 = *p
}
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_b.X3)) + 2*uintptr(_j)))) == i32(4) {
func() {
if int32(_leafCorrection) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66721), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84150)))
crt.X__builtin_abort(tls)
}
}()
_66_sz = int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{(_pParent.X24)})))(tls, _pParent, _66_pCell))
}
_208:
{
p := &_iOvflSpace
*p = (*p) + _66_sz
sink1 = *p
}
func() {
if _66_sz > (int32(_pBt.X11) + i32(23)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66726), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84023)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iOvflSpace > int32(_pBt.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66727), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84387)))
crt.X__builtin_abort(tls)
}
}()
_insertCell(tls, _pParent, _nxDiv+_i, _66_pCell, _66_sz, _66_pTemp, _66_pNew.X4, &_rc)
if _rc != i32(0) {
goto _balance_cleanup
}
func() {
if _sqlite3PagerIswriteable(tls, (*XPgHdr)(_pParent.X23)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66730), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(83543)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _197
_200:
_i = i32(1) - _nNew
_219:
if _i >= _nNew {
goto _222
}
_71_iPg = func() int32 {
if _i < i32(0) {
return (-_i)
}
return _i
}()
func() {
if _71_iPg < i32(0) || _71_iPg >= _nNew {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66757), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84420)))
crt.X__builtin_abort(tls)
}
}()
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg)))) != 0 {
goto _220
}
if _i < i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) {
goto _230
}
func() {
if _71_iPg != i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg-i32(1))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66768), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84439)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg)))) < (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg)))) && (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg+i32(1))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66772), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84495)))
crt.X__builtin_abort(tls)
}
}()
if _71_iPg == i32(0) {
_72_iNew = store1(&_72_iOld, i32(0))
_72_nNewCell = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(i32(0))))
goto _239
}
_72_iOld = func() int32 {
if _71_iPg < _nOld {
return ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntOld)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0))
}
return (_b.X0)
}()
_72_iNew = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg-i32(1))))) + bool2int(_leafData == 0)
_72_nNewCell = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_cntNew)) + 4*uintptr(_71_iPg)))) - _72_iNew
_239:
_rc = _editPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_71_iPg))), _72_iOld, _72_iNew, _72_nNewCell, &_b)
if _rc != 0 {
goto _balance_cleanup
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_abDone)) + 1*uintptr(_71_iPg))) += 1
*(*uint16)(unsafe.Pointer(&((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_71_iPg)))).X13))) = uint16(_usableSpace - (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_szNew)) + 4*uintptr(_71_iPg)))))
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_71_iPg)))).X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66787), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84537)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_71_iPg)))).X14) != _72_nNewCell {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66788), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84562)))
crt.X__builtin_abort(tls)
}
}()
_230:
_220:
_i += 1
goto _219
_222:
func() {
if crt.Xmemcmp(tls, (unsafe.Pointer)(&_abDone), (unsafe.Pointer)(str(84590)), uint32(_nNew)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66793), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84596)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nOld <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66795), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84639)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nNew <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66796), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84646)))
crt.X__builtin_abort(tls)
}
}()
if (_isRoot != 0 && (int32(_pParent.X14) == i32(0))) && (int32(_pParent.X6) <= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(i32(0))))).X13)) {
func() {
if _nNew != i32(1) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66814), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84653)))
crt.X__builtin_abort(tls)
}
}()
_rc = _defragmentPage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(i32(0)))), i32(-1))
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(i32(0))))).X13) != ((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(i32(0))))).X19))+1*uintptr(i32(5)))))) + 1*uintptr(i32(0)))))<= _nNew {
goto _268
}
_77_key = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X19))+1*uintptr(i32(8)))))
_ptrmapPut(tls, _pBt, _77_key, uint8(i32(5)), (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i)))).X4, &_rc)
_i += 1
goto _265
_268:
_264:
func() {
if (_pParent.X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(66833), unsafe.Pointer((*int8)(unsafe.Pointer(&_balance_nonrootØ00__func__Ø000))), unsafe.Pointer(str(84782)))
crt.X__builtin_abort(tls)
}
}()
_i = _nNew
_271:
if _i >= _nOld {
goto _balance_cleanup
}
_freePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i))), &_rc)
_i += 1
goto _271
_balance_cleanup:
_sqlite3ScratchFree(tls, (unsafe.Pointer)(_b.X2))
_i = i32(0)
_275:
if _i >= _nOld {
goto _278
}
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apOld)) + 4*uintptr(_i))))
_i += 1
goto _275
_278:
_i = i32(0)
_279:
if _i >= _nNew {
goto _282
}
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apNew)) + 4*uintptr(_i))))
_i += 1
goto _279
_282:
return _rc
_ = _apOld
_ = _apNew
_ = _apDiv
_ = _cntNew
_ = _cntOld
_ = _szNew
_ = _abDone
_ = _aPgno
_ = _aPgOrder
_ = _aPgFlags
_ = _b
_ = _68_info
panic(0)
}
var _balance_nonrootØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_balance_nonrootØ00__func__Ø000[0], str(84798), 16)
}
// Allocate memory that is to be used and released right away.
// This routine is similar to alloca() in that it is not intended
// for situations where the memory might be held long-term. This
// routine is intended to get memory to old large transient data
// structures that would not normally fit on the stack of an
// embedded processor.
func _sqlite3ScratchMalloc(tls *crt.TLS, _n int32) (r0 unsafe.Pointer) {
var _p unsafe.Pointer
func() {
if _n <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24542), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000))), unsafe.Pointer(str(1358)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_sqlite3StatusHighwater(tls, i32(8), _n)
if ((_mem0.X4) != 0) && ((_sqlite3Config.X20) >= _n) {
_p = _mem0.X3
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = (*Xsqlite3_file)((*Xsqlite3_file)(_mem0.X3).X0)
*(*uint32)(unsafe.Pointer(&(_mem0.X4))) -= 1
_sqlite3StatusUp(tls, i32(3), i32(1))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _4
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
_p = _sqlite3Malloc(tls, uint64(_n))
if (_sqlite3Config.X0) != 0 && (_p != nil) {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_sqlite3StatusUp(tls, i32(4), _sqlite3MallocSize(tls, _p))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
}
_4:
func() {
if Xsqlite3_mutex_notheld(tls, (*Xsqlite3_mutex)(_mem0.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24562), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ScratchMallocØ00__func__Ø000))), unsafe.Pointer(str(84814)))
crt.X__builtin_abort(tls)
}
}()
return _p
}
var _sqlite3ScratchMallocØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ScratchMallocØ00__func__Ø000[0], str(84848), 21)
}
func _cachedCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
func() {
if _N < i32(0) || _N >= (_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65577), unsafe.Pointer((*int8)(unsafe.Pointer(&_cachedCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84869)))
crt.X__builtin_abort(tls)
}
}()
if (*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))) != 0 {
return *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))
}
return _computeCellSize(tls, _p, _N)
}
var _cachedCellSizeØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_cachedCellSizeØ00__func__Ø000[0], str(84888), 15)
}
// Return the size of the Nth element of the cell array
func _computeCellSize(tls *crt.TLS, _p *XCellArray, _N int32) (r0 uint16) {
func() {
if _N < i32(0) || _N >= (_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65571), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84869)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65572), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeCellSizeØ00__func__Ø000))), unsafe.Pointer(str(84903)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N))) = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(_N))))
return *(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_N)))
}
var _computeCellSizeØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_computeCellSizeØ00__func__Ø000[0], str(84919), 16)
}
// The page handle passed as the first argument refers to a dirty page
// with a page number other than iNew. This function changes the page's
// page number to iNew and sets the value of the PgHdr.flags field to
// the value passed as the third parameter.
func _sqlite3PagerRekey(tls *crt.TLS, _pPg *XPgHdr, _iNew uint32, _flags uint16) {
func() {
if (_pPg.X5) == _iNew {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54015), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerRekeyØ00__func__Ø000))), unsafe.Pointer(str(84935)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pPg.X6))) = _flags
_sqlite3PcacheMove(tls, _pPg, _iNew)
}
var _sqlite3PagerRekeyØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerRekeyØ00__func__Ø000[0], str(84951), 18)
}
// apCell[] and szCell[] contains pointers to and sizes of all cells in the
// pages being balanced. The current page, pPg, has pPg->nCell cells starting
// with apCell[iOld]. After balancing, this page should hold nNew cells
// starting at apCell[iNew].
//
// This routine makes the necessary adjustments to pPg so that it contains
// the correct cells after being balanced.
//
// The pPg->nFree field is invalid when this function returns. It is the
// responsibility of the caller to set it correctly.
func _editPage(tls *crt.TLS, _pPg *XMemPage, _iOld int32, _iNew int32, _nNew int32, _pCArray *XCellArray) (r0 int32) {
var _hdr, _nCell, _i, _iOldEnd, _iNewEnd, _1_nShift, _3_nAdd, _4_iCell, _6_iOff int32
var _aData, _pBegin, _pData, _pCellptr, _pTmp, _6_pCell *uint8
_aData = _pPg.X19
_hdr = int32(_pPg.X6)
_pBegin = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_nNew*i32(2))))
_nCell = int32(_pPg.X14)
_iOldEnd = (_iOld + int32(_pPg.X14)) + int32(_pPg.X9)
_iNewEnd = _iNew + _nNew
_pTmp = (*uint8)(_sqlite3PagerTempSpace(tls, (*XPager)((*XBtShared)(_pPg.X18).X0)))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTmp), (unsafe.Pointer)(_aData), (*XBtShared)(_pPg.X18).X16)
if _iOld < _iNew {
_1_nShift = _pageFreeArray(tls, _pPg, _iOld, _iNew-_iOld, _pCArray)
crt.Xmemmove(tls, (unsafe.Pointer)(_pPg.X21), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_1_nShift*i32(2))))), uint32(_nCell*i32(2)))
{
p := &_nCell
*p = (*p) - _1_nShift
sink1 = *p
}
}
if _iNewEnd < _iOldEnd {
{
p := &_nCell
*p = (*p) - _pageFreeArray(tls, _pPg, _iNewEnd, _iOldEnd-_iNewEnd, _pCArray)
sink1 = *p
}
}
_pData = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))))<= _iOld {
goto _3
}
_3_nAdd = func() int32 {
if _nNew < (_iOld - _iNew) {
return _nNew
}
return (_iOld - _iNew)
}()
func() {
if (_iOld-_iNew) >= _nNew && _nCell != i32(0) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65805), unsafe.Pointer((*int8)(unsafe.Pointer(&_editPageØ00__func__Ø000))), unsafe.Pointer(str(84969)))
crt.X__builtin_abort(tls)
}
}()
_pCellptr = _pPg.X21
crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr))+1*uintptr(_3_nAdd*i32(2))))), (unsafe.Pointer)(_pCellptr), uint32(_nCell*i32(2)))
if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew, _3_nAdd, _pCArray) != 0 {
goto _editpage_fail
}
{
p := &_nCell
*p = (*p) + _3_nAdd
sink1 = *p
}
_3:
_i = i32(0)
_11:
if _i >= int32(_pPg.X9) {
goto _14
}
_4_iCell = (_iOld + int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[4]uint16)(unsafe.Pointer(&(_pPg.X16))))) + 2*uintptr(_i))))) - _iNew
if _4_iCell < i32(0) || _4_iCell >= _nNew {
goto _16
}
_pCellptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_4_iCell*i32(2))))
crt.Xmemmove(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr))+1*uintptr(i32(2))))), (unsafe.Pointer)(_pCellptr), uint32((_nCell-_4_iCell)*i32(2)))
_nCell += 1
if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _4_iCell+_iNew, i32(1), _pCArray) != 0 {
goto _editpage_fail
}
_16:
_i += 1
goto _11
_14:
_pCellptr = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21)) + 1*uintptr(_nCell*i32(2))))
if _pageInsertArray(tls, _pPg, _pBegin, &_pData, _pCellptr, _iNew+_nCell, _nNew-_nCell, _pCArray) != 0 {
goto _editpage_fail
}
*(*uint16)(unsafe.Pointer(&(_pPg.X14))) = uint16(_nNew)
*(*uint8)(unsafe.Pointer(&(_pPg.X9))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0)))) = uint8(int32(_pPg.X14) >> uint(i32(8)))
return _aData
}()))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))) = uint8(_pPg.X14)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0)))) = uint8(int32((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8)))
return _aData
}()))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))) = uint8(int32((uintptr(unsafe.Pointer(_pData)) - uintptr(unsafe.Pointer(_aData))) / 1))
_i = i32(0)
_19:
if _i >= _nNew || (_sqlite3Config.X6) == i32(0) {
goto _23
}
_6_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i+_iNew)))
_6_iOff = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPg.X21))+1*uintptr(_i*i32(2)))))) + 1*uintptr(i32(1)))))
if (uint32(uintptr(unsafe.Pointer(_6_pCell))) >= uint32(uintptr(unsafe.Pointer(_aData)))) && (uint32(uintptr(unsafe.Pointer(_6_pCell))) < uint32(uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr((*XBtShared)(_pPg.X18).X16))))))) {
_6_pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTmp)) + 1*uintptr(int32((uintptr(unsafe.Pointer(_6_pCell))-uintptr(unsafe.Pointer(_aData)))/1))))
}
func() {
if i32(0) != crt.Xmemcmp(tls, (unsafe.Pointer)(_6_pCell), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData))+1*uintptr(_6_iOff)))), uint32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{((*XMemPage)(_pCArray.X1).X24)})))(tls, (*XMemPage)(_pCArray.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i+_iNew)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65849), unsafe.Pointer((*int8)(unsafe.Pointer(&_editPageØ00__func__Ø000))), unsafe.Pointer(str(85012)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _19
_23:
return i32(0)
_editpage_fail:
_populateCellCache(tls, _pCArray, _iNew, _nNew)
return _rebuildPage(tls, _pPg, _nNew, (**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2))+4*uintptr(_iNew))), (*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X3))+2*uintptr(_iNew))))
}
// Array apCell[] contains nCell pointers to b-tree cells. Array szCell
// contains the size in bytes of each such cell. This function adds the
// space associated with each cell in the array that is currently stored
// within the body of pPg to the pPg free-list. The cell-pointers and other
// fields of the page are not updated.
//
// This function returns the total number of cells added to the free-list.
func _pageFreeArray(tls *crt.TLS, _pPg *XMemPage, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
var _nRet, _i, _iEnd, _szFree, _2_sz int32
var _aData, _pEnd, _pStart, _pFree, _1_pCell *uint8
_aData = _pPg.X19
_pEnd = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr((*XBtShared)(_pPg.X18).X16)))
_pStart = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr((int32(_pPg.X6)+i32(8))+int32(_pPg.X7))))
_nRet = i32(0)
_iEnd = _iFirst + _nCell
_pFree = nil
_szFree = i32(0)
_i = _iFirst
_0:
if _i >= _iEnd {
goto _3
}
_1_pCell = *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i)))
if uint32(uintptr(unsafe.Pointer(_1_pCell))) < uint32(uintptr(unsafe.Pointer(_pStart))) || uint32(uintptr(unsafe.Pointer(_1_pCell))) >= uint32(uintptr(unsafe.Pointer(_pEnd))) {
goto _5
}
_2_sz = int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X3)) + 2*uintptr(_i))))
func() {
if _2_sz <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65732), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000))), unsafe.Pointer(str(85109)))
crt.X__builtin_abort(tls)
}
}()
if _pFree == (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pCell))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_2_sz))))))) {
goto _8
}
if _pFree != nil {
func() {
if uintptr(unsafe.Pointer(_pFree)) <= uintptr(unsafe.Pointer(_aData)) || int32((uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))/1) >= i32(65536) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65735), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000))), unsafe.Pointer(str(85114)))
crt.X__builtin_abort(tls)
}
}()
_freeSpace(tls, _pPg, uint16(int32((uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))/1)), uint16(_szFree))
}
_pFree = _1_pCell
_szFree = _2_sz
if uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pFree))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_2_sz))))))))) > uintptr(unsafe.Pointer(_pEnd)) {
return i32(0)
}
goto _14
_8:
_pFree = _1_pCell
{
p := &_szFree
*p = (*p) + _2_sz
sink1 = *p
}
_14:
_nRet += 1
_5:
_i += 1
goto _0
_3:
if _pFree != nil {
func() {
if uintptr(unsafe.Pointer(_pFree)) <= uintptr(unsafe.Pointer(_aData)) || int32((uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))/1) >= i32(65536) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65749), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageFreeArrayØ00__func__Ø000))), unsafe.Pointer(str(85114)))
crt.X__builtin_abort(tls)
}
}()
_freeSpace(tls, _pPg, uint16(int32((uintptr(unsafe.Pointer(_pFree))-uintptr(unsafe.Pointer(_aData)))/1)), uint16(_szFree))
}
return _nRet
}
var _pageFreeArrayØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_pageFreeArrayØ00__func__Ø000[0], str(85151), 14)
}
var _editPageØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_editPageØ00__func__Ø000[0], str(85165), 9)
}
// Array apCell[] contains nCell pointers to b-tree cells. Array szCell
// contains the size in bytes of each such cell. This function attempts to
// add the cells stored in the array to page pPg. If it cannot (because
// the page needs to be defragmented before the cells will fit), non-zero
// is returned. Otherwise, if the cells are added successfully, zero is
// returned.
//
// Argument pCellptr points to the first entry in the cell-pointer array
// (part of page pPg) to populate. After cell apCell[0] is written to the
// page body, a 16-bit offset is written to pCellptr. And so on, for each
// cell in the array. It is the responsibility of the caller to ensure
// that it is safe to overwrite this part of the cell-pointer array.
//
// When this function is called, *ppData points to the start of the
// content area on page pPg. If the size of the content area is extended,
// *ppData is updated to point to the new start of the content area
// before returning.
//
// Finally, argument pBegin points to the byte immediately following the
// end of the space required by this page for the cell-pointer area (for
// all cells - not just those inserted by the current call). If the content
// area must be extended to before this point in order to accomodate all
// cells in apCell[], then the cells do not fit and non-zero is returned.
func _pageInsertArray(tls *crt.TLS, _pPg *XMemPage, _pBegin *uint8, _ppData **uint8, _pCellptr *uint8, _iFirst int32, _nCell int32, _pCArray *XCellArray) (r0 int32) {
var _i, _iEnd, _1_sz, _1_rc int32
var _aData, _pData, _1_pSlot *uint8
_aData = _pPg.X19
_pData = *_ppData
_iEnd = _iFirst + _nCell
func() {
if (_sqlite3Config.X6) != i32(0) && int32(_pPg.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65677), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000))), unsafe.Pointer(str(85174)))
crt.X__builtin_abort(tls)
}
}()
_i = _iFirst
_3:
if _i >= _iEnd {
goto _6
}
_1_sz = int32(_cachedCellSize(tls, _pCArray, _i))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(1))))) != i32(0) || int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aData)) + 1*uintptr(i32(2))))) != i32(0)) && store13(&_1_pSlot, _pageFindSlot(tls, _pPg, _1_sz, &_1_rc)) != nil {
goto _9
}
if int32((uintptr(unsafe.Pointer(_pData))-uintptr(unsafe.Pointer(_pBegin)))/1) < _1_sz {
return i32(1)
}
{
p := &_pData
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(_1_sz)))
sink13 = *p
}
_1_pSlot = _pData
_9:
func() {
if uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_pSlot))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_1_sz))))))))) > uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i))))) && uintptr(unsafe.Pointer(_1_pSlot)) < uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i)))))+uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_1_sz))))))))) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65690), unsafe.Pointer((*int8)(unsafe.Pointer(&_pageInsertArrayØ00__func__Ø000))), unsafe.Pointer(str(85206)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemmove(tls, (unsafe.Pointer)(_1_pSlot), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCArray.X2)) + 4*uintptr(_i)))), uint32(_1_sz))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(func() *uint8 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellptr)) + 1*uintptr(i32(0)))) = uint8(int32((uintptr(unsafe.Pointer(_1_pSlot))-uintptr(unsafe.Pointer(_aData)))/1) >> uint(i32(8)))
return _pCellptr
}())) + 1*uintptr(i32(1)))) = uint8(int32((uintptr(unsafe.Pointer(_1_pSlot)) - uintptr(unsafe.Pointer(_aData))) / 1))
{
p := &_pCellptr
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(i32(2))))
sink13 = *p
}
_i += 1
goto _3
_6:
*_ppData = _pData
return i32(0)
_ = _1_rc
panic(0)
}
var _pageInsertArrayØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_pageInsertArrayØ00__func__Ø000[0], str(85285), 16)
}
// Make sure the cell sizes at idx, idx+1, ..., idx+N-1 have been
// computed.
func _populateCellCache(tls *crt.TLS, _p *XCellArray, _idx int32, _N int32) {
func() {
if _idx < i32(0) || (_idx+_N) > (_p.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65553), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85301)))
crt.X__builtin_abort(tls)
}
}()
_3:
if _N <= i32(0) {
goto _4
}
func() {
if (*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(_idx)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65555), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85327)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx)))) == i32(0) {
*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx))) = (*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(_idx))))
goto _8
}
func() {
if (_sqlite3Config.X6) != i32(0) && int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X3)) + 2*uintptr(_idx)))) != int32((*(*func(*crt.TLS, *XMemPage, *uint8) uint16)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8) uint16
}{((*XMemPage)(_p.X1).X24)})))(tls, (*XMemPage)(_p.X1), *(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(_idx))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(65559), unsafe.Pointer((*int8)(unsafe.Pointer(&_populateCellCacheØ00__func__Ø000))), unsafe.Pointer(str(85345)))
crt.X__builtin_abort(tls)
}
}()
_8:
_idx += 1
_N -= 1
goto _3
_4:
}
var _populateCellCacheØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_populateCellCacheØ00__func__Ø000[0], str(85419), 18)
}
func _freePage(tls *crt.TLS, _pPage *XMemPage, _pRC *int32) {
if (*_pRC) == i32(0) {
*_pRC = _freePage2(tls, (*XBtShared)(_pPage.X18), _pPage, _pPage.X4)
}
}
func _sqlite3ScratchFree(tls *crt.TLS, _p unsafe.Pointer) {
var _4_iSize int32
var _2_pSlot *Xsqlite3_file
if _p == nil {
goto _0
}
if (uint32(uintptr(_p)) >= uint32(uintptr(_sqlite3Config.X19))) && (uint32(uintptr(_p)) < uint32(uintptr(_mem0.X2))) {
_2_pSlot = (*Xsqlite3_file)(_p)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pSlot.X0))))) = (*Xsqlite3_file)(_mem0.X3)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_mem0.X3))))) = _2_pSlot
*(*uint32)(unsafe.Pointer(&(_mem0.X4))) += 1
func() {
if (_mem0.X4) > uint32(_sqlite3Config.X21) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(24597), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ScratchFreeØ00__func__Ø000))), unsafe.Pointer(str(85437)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StatusDown(tls, i32(3), i32(1))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _5
}
i32(0)
i32(0)
if (_sqlite3Config.X0) != 0 {
_4_iSize = _sqlite3MallocSize(tls, _p)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_sqlite3StatusDown(tls, i32(4), _4_iSize)
_sqlite3StatusDown(tls, i32(0), _4_iSize)
_sqlite3StatusDown(tls, i32(9), i32(1))
((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
goto _7
}
((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X1)(tls, _p)
_7:
_5:
_0:
}
var _sqlite3ScratchFreeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ScratchFreeØ00__func__Ø000[0], str(85492), 19)
}
// 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 _sqlite3BtreeDelete(tls *crt.TLS, _pCur *XBtCursor, _flags uint8) (r0 int32) {
var _rc, _iCellIdx, _iCellDepth, _bSkipnext, _4_notUsed, _7_nCell int32
var _7_n uint32
var _bPreserve uint8
var _pCell, _7_pTmp *uint8
var _p *XBtree
var _pBt *XBtShared
var _info XCellInfo
var _pPage, _7_pLeaf *XMemPage
_p = (*XBtree)(_pCur.X0)
_pBt = (*XBtShared)(_p.X1)
_bSkipnext = i32(0)
_bPreserve = uint8(int32(_flags) & i32(2))
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67323), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pBt.X8) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67324), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(56928)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pBt.X10) & i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67325), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(77853)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pCur.X10) & i32(1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67326), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85511)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasSharedCacheTableLock(tls, _p, _pCur.X7, bool2int((*XKeyInfo)(_pCur.X18) != nil), i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67327), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(80291)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasReadConflicts(tls, _p, _pCur.X7) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67328), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85543)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X16) >= int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67329), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(10597)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pCur.X12) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67330), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(10390)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_flags) & i32(-7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67331), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85580)))
crt.X__builtin_abort(tls)
}
}()
_iCellDepth = int32(_pCur.X14)
_iCellIdx = int32(_pCur.X16)
_pPage = *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_iCellDepth)))
_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_iCellIdx))))) + 1*uintptr(i32(0)))))< _iCellDepth {
_releasePage(tls, *(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(postInc3((*int8)(unsafe.Pointer(&(_pCur.X14))), int8(-1))))))
goto _40
}
_rc = _balance(tls, _pCur)
_39:
if _rc != i32(0) {
goto _42
}
if _bSkipnext == 0 {
goto _43
}
func() {
if _bPreserve == 0 || int32(_pCur.X14) != _iCellDepth && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67445), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85668)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pPage != (*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))) && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67446), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85721)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPage.X14) <= i32(0) && (_sqlite3Config.X6) != i32(0) || _iCellIdx > int32(_pPage.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeDeleteØ00__func__Ø000))), unsafe.Pointer(str(85768)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(2))
if _iCellIdx >= int32(_pPage.X14) {
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(-1)
*(*uint16)(unsafe.Pointer(&(_pCur.X16))) = uint16(int32(_pPage.X14) - i32(1))
goto _56
}
*(*int32)(unsafe.Pointer(&(_pCur.X9))) = i32(1)
_56:
goto _57
_43:
_rc = _moveToRoot(tls, _pCur)
if _bPreserve != 0 {
*(*uint8)(unsafe.Pointer(&(_pCur.X12))) = uint8(i32(3))
}
_57:
_42:
return _rc
_ = _info
_ = _4_notUsed
panic(0)
}
var _sqlite3BtreeDeleteØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeDeleteØ00__func__Ø000[0], str(85825), 19)
}
// Compare the key in memory cell pVal with the key that the sorter cursor
// passed as the first argument currently points to. For the purposes of
// the comparison, ignore the rowid field at the end of each record.
//
// If the sorter cursor key contains any NULL values, consider it to be
// less than pVal. Even if pVal also contains NULL values.
//
// If an error occurs, return an SQLite error code (i.e. SQLITE_NOMEM).
// Otherwise, set *pRes to a negative, zero or positive value if the
// key in pVal is smaller than, equal to or larger than the current sorter
// key.
//
// This routine forms the core of the OP_SorterCompare opcode, which in
// turn is used to verify uniqueness when constructing a UNIQUE INDEX.
func _sqlite3VdbeSorterCompare(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem, _nKeyCol int32, _pRes *int32) (r0 int32) {
var _i, _nKey int32
var _pKey unsafe.Pointer
var _r2 *XUnpackedRecord
var _pKeyInfo *XKeyInfo
var _pSorter *XVdbeSorter
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88740), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
_r2 = (*XUnpackedRecord)(_pSorter.X8)
_pKeyInfo = (*XKeyInfo)(_pCsr.X15)
if _r2 != nil {
goto _2
}
_r2 = store51((**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X8))))), _sqlite3VdbeAllocUnpackedRecord(tls, _pKeyInfo))
if _r2 == nil {
return _sqlite3NomemError(tls, i32(88746))
}
*(*uint16)(unsafe.Pointer(&(_r2.X2))) = uint16(_nKeyCol)
_2:
func() {
if int32(_r2.X2) != _nKeyCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterCompareØ00__func__Ø000))), unsafe.Pointer(str(85844)))
crt.X__builtin_abort(tls)
}
}()
_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
_sqlite3VdbeRecordUnpack(tls, _pKeyInfo, _nKey, _pKey, _r2)
_i = i32(0)
_6:
if _i >= _nKeyCol {
goto _9
}
if (int32((*XMem)(unsafe.Pointer(uintptr(_r2.X1)+48*uintptr(_i))).X1) & i32(1)) != 0 {
*_pRes = i32(-1)
return i32(0)
}
_i += 1
goto _6
_9:
*_pRes = _sqlite3VdbeRecordCompare(tls, _pVal.X4, (unsafe.Pointer)(_pVal.X5), _r2)
return i32(0)
}
var _sqlite3VdbeSorterCompareØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterCompareØ00__func__Ø000[0], str(85864), 25)
}
// Return a pointer to a buffer owned by the sorter that contains the
// current key.
func _vdbeSorterRowkey(tls *crt.TLS, _pSorter *XVdbeSorter, _pnKey *int32) (r0 unsafe.Pointer) {
var _pKey unsafe.Pointer
var _1_pReader *XPmaReader
if (_pSorter.X12) == 0 {
goto _0
}
if (_pSorter.X13) != 0 {
_1_pReader = (*XPmaReader)(_pSorter.X4)
goto _2
}
_1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr((*XMergeEngine)(_pSorter.X5).X3) + 52*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMergeEngine)(_pSorter.X5).X2)) + 4*uintptr(i32(1)))))))
_2:
*_pnKey = _1_pReader.X3
_pKey = (unsafe.Pointer)(_1_pReader.X6)
goto _3
_0:
*_pnKey = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0).X0
_pKey = (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))) + uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(8))))))))))))
_3:
return _pKey
}
// Copy the current sorter key into the memory cell pOut.
func _sqlite3VdbeSorterRowkey(tls *crt.TLS, _pCsr *XVdbeCursor, _pOut *XMem) (r0 int32) {
var _nKey int32
var _pKey unsafe.Pointer
var _pSorter *XVdbeSorter
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88699), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRowkeyØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
_pKey = _vdbeSorterRowkey(tls, _pSorter, &_nKey)
if _sqlite3VdbeMemClearAndResize(tls, _pOut, _nKey) != 0 {
return _sqlite3NomemError(tls, i32(88703))
}
*(*int32)(unsafe.Pointer(&(_pOut.X4))) = _nKey
*(*uint16)(unsafe.Pointer(&(_pOut.X1))) = uint16((int32(_pOut.X1) & i32(-49664)) | i32(16))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pOut.X5), _pKey, uint32(_nKey))
return i32(0)
}
var _sqlite3VdbeSorterRowkeyØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterRowkeyØ00__func__Ø000[0], str(85889), 24)
}
// Check to ensure that the cursor is valid. Restore the cursor
// if need be. Return any I/O error from the restore operation.
func _sqlite3VdbeCursorRestore(tls *crt.TLS, _p *XVdbeCursor) (r0 int32) {
func() {
if int32(_p.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(74514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCursorRestoreØ00__func__Ø000))), unsafe.Pointer(str(73776)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3BtreeCursorHasMoved(tls, (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_p.X14))))))) != 0 {
return _handleMovedCursor(tls, _p)
}
return i32(0)
}
var _sqlite3VdbeCursorRestoreØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeCursorRestoreØ00__func__Ø000[0], str(85913), 25)
}
// NDEBUG
func _sqlite3BtreeCursorIsValidNN(tls *crt.TLS, _pCur *XBtCursor) (r0 int32) {
func() {
if _pCur == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63381), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCursorIsValidNNØ00__func__Ø000))), unsafe.Pointer(str(77105)))
crt.X__builtin_abort(tls)
}
}()
return bool2int(int32(_pCur.X12) == i32(1))
}
var _sqlite3BtreeCursorIsValidNNØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCursorIsValidNNØ00__func__Ø000[0], str(85938), 28)
}
// 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 _sqlite3BtreeFirst(tls *crt.TLS, _pCur *XBtCursor, _pRes *int32) (r0 int32) {
var _rc int32
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64079), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.X0).X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64080), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(73849)))
crt.X__builtin_abort(tls)
}
}()
_rc = _moveToRoot(tls, _pCur)
if _rc != i32(0) {
goto _4
}
if int32(_pCur.X12) == i32(0) {
func() {
if (_pCur.X7) != uint32(i32(0)) && int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64084), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(74242)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(1)
goto _9
}
func() {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X14) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64087), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeFirstØ00__func__Ø000))), unsafe.Pointer(str(85966)))
crt.X__builtin_abort(tls)
}
}()
*_pRes = i32(0)
_rc = _moveToLeftmost(tls, _pCur)
_9:
_4:
return _rc
}
var _sqlite3BtreeFirstØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeFirstØ00__func__Ø000[0], str(86001), 18)
}
// Return an estimate for the number of rows in the table that pCur is
// pointing to. Return a negative number if no estimate is currently
// available.
func _sqlite3BtreeRowCountEst(tls *crt.TLS, _pCur *XBtCursor) (r0 int64) {
var _n int64
var _i uint8
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64430), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCur.X0).X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000))), unsafe.Pointer(str(73849)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if int32(_pCur.X12) != i32(1) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return int64(i32(-1))
}
if func() int32 {
if int32((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_pCur.X14)))).X5) == i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(64437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeRowCountEstØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return int64(i32(-1))
}
*func() *uint8 { _n = int64(i32(1)); return &_i }() = uint8(i32(0))
_10:
if int32(_i) > int32(_pCur.X14) {
goto _13
}
{
p := &_n
*p = (*p) * int64((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCur.X19))))) + 4*uintptr(_i)))).X14)
sink6 = *p
}
_i += 1
goto _10
_13:
return _n
}
var _sqlite3BtreeRowCountEstØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeRowCountEstØ00__func__Ø000[0], str(86019), 24)
}
// Once the sorter has been populated by calls to sqlite3VdbeSorterWrite,
// this function is called to prepare for iterating through the records
// in sorted order.
func _sqlite3VdbeSorterRewind(tls *crt.TLS, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
var _rc int32
var _pSorter *XVdbeSorter
_rc = i32(0)
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
func() {
if _pSorter == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88589), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(86043)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pSorter.X12) != i32(0) {
goto _4
}
if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil {
*_pbEof = i32(0)
_rc = _vdbeSorterSort(tls, (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+60*uintptr(i32(0)))), (*t47)(unsafe.Pointer(&(_pSorter.X9))))
goto _6
}
*_pbEof = i32(1)
_6:
return _rc
_4:
func() {
if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88608), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(86051)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeSorterFlushPMA(tls, _pSorter)
_rc = _vdbeSorterJoinAll(tls, _pSorter, _rc)
func() {
if (*XPmaReader)(_pSorter.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88618), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterRewindØ00__func__Ø000))), unsafe.Pointer(str(86071)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(0) {
_rc = _vdbeSorterSetupMerge(tls, _pSorter)
*_pbEof = i32(0)
}
return _rc
}
var _sqlite3VdbeSorterRewindØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterRewindØ00__func__Ø000[0], str(86091), 24)
}
// Sort the linked list of records headed at pTask->pList. Return
// SQLITE_OK if successful, or an SQLite error code (i.e. SQLITE_NOMEM) if
// an error occurs.
func _vdbeSorterSort(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 int32) {
var _i, _rc int32
var _p, _2_pNext *XSorterRecord
var _aSlot **XSorterRecord
_rc = _vdbeSortAllocUnpacked(tls, _pTask)
if _rc != i32(0) {
return _rc
}
_p = (*XSorterRecord)(_pList.X0)
*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&(_pTask.X6))))) = _vdbeSorterGetCompare(tls, (*XVdbeSorter)(_pTask.X2))
_aSlot = (**XSorterRecord)(_sqlite3MallocZero(tls, uint64(u32(256))))
if _aSlot == nil {
return _sqlite3NomemError(tls, i32(87425))
}
_1:
if _p == nil {
goto _3
}
if (_pList.X1) == nil {
goto _4
}
if (*uint8)(unsafe.Pointer(_p)) == (_pList.X1) {
_2_pNext = nil
goto _6
}
func() {
if (*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1)))))) >= _sqlite3MallocSize(tls, (unsafe.Pointer)(_pList.X1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87434), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000))), unsafe.Pointer(str(86115)))
crt.X__builtin_abort(tls)
}
}()
_2_pNext = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pList.X1)) + 1*uintptr(*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1))))))))))
_6:
goto _9
_4:
_2_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1))))))
_9:
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p.X1))))))) = nil
_i = i32(0)
_10:
if (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i)))) == nil {
goto _13
}
_p = _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i))))
*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i))) = nil
_i += 1
goto _10
_13:
*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i))) = _p
_p = _2_pNext
goto _1
_3:
_p = nil
_i = i32(0)
_14:
if _i >= i32(64) {
goto _17
}
if (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i)))) == nil {
goto _15
}
_p = func() *XSorterRecord {
if _p != nil {
return _vdbeSorterMerge(tls, _pTask, _p, *(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i))))
}
return (*(**XSorterRecord)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSlot)) + 4*uintptr(_i))))
}()
_15:
_i += 1
goto _14
_17:
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = _p
Xsqlite3_free(tls, (unsafe.Pointer)(_aSlot))
func() {
if int32((*XUnpackedRecord)(_pTask.X3).X4) != i32(0) && int32((*XUnpackedRecord)(_pTask.X3).X4) != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87458), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSortØ00__func__Ø000))), unsafe.Pointer(str(86160)))
crt.X__builtin_abort(tls)
}
}()
return int32((*XUnpackedRecord)(_pTask.X3).X4)
}
// If it has not already been allocated, allocate the UnpackedRecord
// structure at pTask->pUnpacked. Return SQLITE_OK if successful (or
// if no allocation was required), or SQLITE_NOMEM otherwise.
func _vdbeSortAllocUnpacked(tls *crt.TLS, _pTask *XSortSubtask) (r0 int32) {
if (*XUnpackedRecord)(_pTask.X3) != nil {
goto _0
}
*(**XUnpackedRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X3))))) = _sqlite3VdbeAllocUnpackedRecord(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7))
if (*XUnpackedRecord)(_pTask.X3) == nil {
return _sqlite3NomemError(tls, i32(87344))
}
*(*uint16)(unsafe.Pointer(&((*XUnpackedRecord)(_pTask.X3).X2))) = (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X2
*(*uint8)(unsafe.Pointer(&((*XUnpackedRecord)(_pTask.X3).X4))) = uint8(i32(0))
_0:
return i32(0)
}
// Return the SorterCompare function to compare values collected by the
// sorter object passed as the only argument.
func _vdbeSorterGetCompare(tls *crt.TLS, _p *XVdbeSorter) (r0 func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32) {
if int32(_p.X16) == i32(1) {
return _vdbeSorterCompareInt
}
if int32(_p.X16) == i32(2) {
return _vdbeSorterCompareText
}
return _vdbeSorterCompare
}
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is an INTEGER value.
func _vdbeSorterCompareInt(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
var _s1, _s2, _res, _1_i int32
var _1_n uint8
var _p1, _p2, _v1, _v2 *uint8
_p1 = (*uint8)(_pKey1)
_p2 = (*uint8)(_pKey2)
_s1 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(1)))))
_s2 = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(1)))))
_v1 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(0)))))))
_v2 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(0)))))))
func() {
if (_s1 <= i32(0) || _s1 >= i32(7)) && _s1 != i32(8) && _s1 != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86872), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000))), unsafe.Pointer(str(86240)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_s2 <= i32(0) || _s2 >= i32(7)) && _s2 != i32(8) && _s2 != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86873), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000))), unsafe.Pointer(str(86273)))
crt.X__builtin_abort(tls)
}
}()
if _s1 != _s2 {
goto _10
}
_1_n = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_vdbeSorterCompareIntØ00aLenØ001)) + 1*uintptr(_s1)))
_res = i32(0)
_1_i = i32(0)
_11:
if _1_i >= int32(_1_n) {
goto _14
}
if store1(&_res, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(_1_i))))-int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v2)) + 1*uintptr(_1_i))))) == i32(0) {
goto _15
}
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(i32(0))))) ^ int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v2)) + 1*uintptr(i32(0)))))) & i32(128)) != i32(0) {
_res = func() int32 {
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v1)) + 1*uintptr(i32(0))))) & i32(128)) != 0 {
return i32(-1)
}
return i32(1)
}()
}
goto _14
_15:
_1_i += 1
goto _11
_14:
goto _22
_10:
if (_s1 > i32(7)) && (_s2 > i32(7)) {
_res = _s1 - _s2
goto _22
}
if _s2 > i32(7) {
_res = i32(1)
goto _26
}
if _s1 > i32(7) {
_res = i32(-1)
goto _26
}
_res = _s1 - _s2
_26:
func() {
if _res == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86899), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCompareIntØ00__func__Ø000))), unsafe.Pointer(str(68311)))
crt.X__builtin_abort(tls)
}
}()
if _res <= i32(0) {
goto _29
}
if (int32(*_v1) & i32(128)) != 0 {
_res = i32(-1)
}
goto _31
_29:
if (int32(*_v2) & i32(128)) != 0 {
_res = i32(1)
}
_31:
_22:
if _res != i32(0) {
goto _33
}
if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X2) > i32(1) {
_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
}
goto _36
_33:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 {
_res = _res * i32(-1)
}
_36:
return _res
}
var _vdbeSorterCompareIntØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterCompareIntØ00__func__Ø000[0], str(86306), 21)
}
var _vdbeSorterCompareIntØ00aLenØ001 [10]uint8
func init() {
_vdbeSorterCompareIntØ00aLenØ001 = [10]uint8{0, 1, 2, 3, 4, 6, 8, 0, 0, 0}
}
// A version of vdbeSorterCompare() that assumes that it has already been
// determined that the first field of key1 is equal to the first field of
// key2.
func _vdbeSorterCompareTail(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
var _r2 *XUnpackedRecord
_r2 = (*XUnpackedRecord)(_pTask.X3)
if (*_pbKey2Cached) == i32(0) {
_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7), _nKey2, _pKey2, _r2)
*_pbKey2Cached = i32(1)
}
return _sqlite3VdbeRecordCompareWithSkip(tls, _nKey1, _pKey1, _r2, i32(1))
}
// A specially optimized version of vdbeSorterCompare() that assumes that
// the first field of each key is a TEXT value and that the collation
// sequence to compare them with is BINARY.
func _vdbeSorterCompareText(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
var _n1, _n2, _res int32
var _p1, _p2, _v1, _v2 *uint8
_p1 = (*uint8)(_pKey1)
_p2 = (*uint8)(_pKey2)
_v1 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(0)))))))
_v2 = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(0)))))))
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1)) + 1*uintptr(i32(1))))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p1))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n1)))
}
}()
_n1 = (_n1 - i32(13)) / i32(2)
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2)) + 1*uintptr(i32(1))))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p2))+1*uintptr(i32(1)))), (*uint32)(unsafe.Pointer(&_n2)))
}
}()
_n2 = (_n2 - i32(13)) / i32(2)
_res = crt.Xmemcmp(tls, (unsafe.Pointer)(_v1), (unsafe.Pointer)(_v2), uint32(func() int32 {
if _n1 < _n2 {
return _n1
}
return _n2
}()))
if _res == i32(0) {
_res = _n1 - _n2
}
if _res != i32(0) {
goto _7
}
if int32((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X2) > i32(1) {
_res = _vdbeSorterCompareTail(tls, _pTask, _pbKey2Cached, _pKey1, _nKey1, _pKey2, _nKey2)
}
goto _9
_7:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7).X5)) + 1*uintptr(i32(0))))) != 0 {
_res = _res * i32(-1)
}
_9:
return _res
}
// Compare key1 (buffer pKey1, size nKey1 bytes) with key2 (buffer pKey2,
// size nKey2 bytes). Use (pTask->pKeyInfo) for the collation sequences
// used by the comparison. Return the result of the comparison.
//
// If IN/OUT parameter *pbKey2Cached is true when this function is called,
// it is assumed that (pTask->pUnpacked) contains the unpacked version
// of key2. If it is false, (pTask->pUnpacked) is populated with the unpacked
// version of key2 and *pbKey2Cached set to true before returning.
//
// If an OOM error is encountered, (pTask->pUnpacked->error_rc) is set
// to SQLITE_NOMEM.
func _vdbeSorterCompare(tls *crt.TLS, _pTask *XSortSubtask, _pbKey2Cached *int32, _pKey1 unsafe.Pointer, _nKey1 int32, _pKey2 unsafe.Pointer, _nKey2 int32) (r0 int32) {
var _r2 *XUnpackedRecord
_r2 = (*XUnpackedRecord)(_pTask.X3)
if (*_pbKey2Cached) == 0 {
_sqlite3VdbeRecordUnpack(tls, (*XKeyInfo)((*XVdbeSorter)(_pTask.X2).X7), _nKey2, _pKey2, _r2)
*_pbKey2Cached = i32(1)
}
return _sqlite3VdbeRecordCompare(tls, _nKey1, _pKey1, _r2)
}
var _vdbeSorterSortØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterSortØ00__func__Ø000[0], str(86327), 15)
}
// Merge the two sorted lists p1 and p2 into a single list.
func _vdbeSorterMerge(tls *crt.TLS, _pTask *XSortSubtask, _p1 *XSorterRecord, _p2 *XSorterRecord) (r0 *XSorterRecord) {
var _bCached, _1_res int32
var _pFinal *XSorterRecord
var _pp **XSorterRecord
_pFinal = nil
_pp = &_pFinal
_bCached = i32(0)
func() {
if _p1 == nil || _p2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87364), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeØ00__func__Ø000))), unsafe.Pointer(str(86342)))
crt.X__builtin_abort(tls)
}
}()
_3:
_1_res = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
}{(_pTask.X6)})))(tls, _pTask, &_bCached, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p1))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(8)))))))))))), _p1.X0, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_p2))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(8)))))))))))), _p2.X0)
if _1_res > i32(0) {
goto _6
}
*_pp = _p1
_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p1.X1)))))))
_p1 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p1.X1))))))
if _p1 == nil {
*_pp = _p2
goto _5
}
goto _8
_6:
*_pp = _p2
_pp = (**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p2.X1)))))))
_p2 = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_p2.X1))))))
_bCached = i32(0)
if _p2 == nil {
*_pp = _p1
goto _5
}
_8:
goto _3
_5:
return _pFinal
_ = _bCached
panic(0)
}
var _vdbeSorterMergeØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterMergeØ00__func__Ø000[0], str(86357), 16)
}
// Flush the current contents of VdbeSorter.list to a new PMA, possibly
// using a background thread.
func _vdbeSorterFlushPMA(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
var _rc, _i, _nWorker, _1_iTest int32
var _5_pCtx unsafe.Pointer
var _5_aMem *uint8
var _pTask *XSortSubtask
_rc = i32(0)
_pTask = nil
_nWorker = int32(_pSorter.X15) - i32(1)
*(*uint8)(unsafe.Pointer(&(_pSorter.X12))) = uint8(i32(1))
_i = i32(0)
_0:
if _i >= _nWorker {
goto _3
}
_1_iTest = ((int32(_pSorter.X14) + _i) + i32(1)) % _nWorker
_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_1_iTest)))
if (_pTask.X1) != 0 {
_rc = _vdbeSorterJoinThread(tls, _pTask)
}
if (_rc != i32(0)) || ((*XSQLiteThread)(_pTask.X0) == nil) {
goto _3
}
_i += 1
goto _0
_3:
if _rc != i32(0) {
goto _7
}
if _i == _nWorker {
_rc = _vdbeSorterListToPMA(tls, (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+60*uintptr(_nWorker))), (*t47)(unsafe.Pointer(&(_pSorter.X9))))
goto _9
}
_5_aMem = (*t47)(unsafe.Pointer(&(_pTask.X4))).X1
_5_pCtx = (unsafe.Pointer)(_pTask)
func() {
if (*XSQLiteThread)(_pTask.X0) != nil || (_pTask.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87751), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86373)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pTask.X4))).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87752), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86410)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*t47)(unsafe.Pointer(&(_pTask.X4))).X1) != nil && ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87753), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushPMAØ00__func__Ø000))), unsafe.Pointer(str(86431)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pSorter.X14))) = uint8(int32((uintptr(unsafe.Pointer(_pTask)) - uintptr(unsafe.Pointer((*XSortSubtask)(unsafe.Pointer((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))))) / 60))
*(*t47)(unsafe.Pointer(&(_pTask.X4))) = _pSorter.X9
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = nil
*(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0)
if _5_aMem != nil {
*(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = _5_aMem
*(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _sqlite3MallocSize(tls, (unsafe.Pointer)(_5_aMem))
goto _20
}
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
goto _20
}
*(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_pSorter.X11)))
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
return _sqlite3NomemError(tls, i32(87764))
}
_20:
_rc = _vdbeSorterCreateThread(tls, _pTask, _vdbeSorterFlushThread, _5_pCtx)
_9:
_7:
return _rc
}
// Write the current contents of in-memory linked-list pList to a level-0
// PMA in the temp file belonging to sub-task pTask. Return SQLITE_OK if
// successful, or an SQLite error code otherwise.
//
// The format of a PMA is:
//
// * A varint. This varint contains the total number of bytes of content
// in the PMA (not including the varint itself).
//
// * One or more records packed end-to-end in order of ascending keys.
// Each record consists of a varint followed by a blob of data (the
// key). The varint is the number of bytes in the blob of data.
func _vdbeSorterListToPMA(tls *crt.TLS, _pTask *XSortSubtask, _pList *t47) (r0 int32) {
var _rc int32
var _iSz int64
var _db *Xsqlite3
var _4_p, _4_pNext *XSorterRecord
var _writer XPmaWriter
_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6)
_rc = i32(0)
_iSz = int64((_pList.X2)+_sqlite3VarintLen(tls, uint64(_pList.X2))) + ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1)
crt.Xmemset(tls, (unsafe.Pointer)(&_writer), i32(0), u32(32))
func() {
if (_pList.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87575), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86482)))
crt.X__builtin_abort(tls)
}
}()
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) == nil {
_rc = _vdbeSorterOpenTempFile(tls, _db, int64(i32(0)), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0))))))
func() {
if _rc == i32(0) && (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87580), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86497)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87581), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86530)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTask.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87582), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86550)))
crt.X__builtin_abort(tls)
}
}()
}
if _rc == i32(0) {
_vdbeSorterExtendFile(tls, _db, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0), (((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1)+int64(_pList.X2))+int64(i32(9)))
}
if _rc == i32(0) {
_rc = _vdbeSorterSort(tls, _pTask, _pList)
}
if _rc != i32(0) {
goto _12
}
_4_pNext = nil
_vdbePmaWriterInit(tls, (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X0), &_writer, (*XVdbeSorter)(_pTask.X2).X3, (*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1)
*(*int32)(unsafe.Pointer(&(_pTask.X5))) += 1
_vdbePmaWriteVarint(tls, &_writer, uint64(_pList.X2))
_4_p = (*XSorterRecord)(_pList.X0)
_13:
if _4_p == nil {
goto _16
}
_4_pNext = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_p.X1))))))
_vdbePmaWriteVarint(tls, &_writer, uint64(_4_p.X0))
_vdbePmaWriteBlob(tls, &_writer, (*uint8)((unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_4_p))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(8))))))))))))), _4_p.X0)
if (_pList.X1) == nil {
Xsqlite3_free(tls, (unsafe.Pointer)(_4_p))
}
_4_p = _4_pNext
goto _13
_16:
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = _4_p
_rc = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1))))
_12:
func() {
if _rc == i32(0) && (*XSorterRecord)(_pList.X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87614), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86565)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc == i32(0) && ((*XSorterFile)(unsafe.Pointer(&(_pTask.X7))).X1) != _iSz {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87615), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterListToPMAØ00__func__Ø000))), unsafe.Pointer(str(86598)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_ = _writer
panic(0)
}
var _vdbeSorterListToPMAØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterListToPMAØ00__func__Ø000[0], str(86637), 20)
}
// Allocate space for a file-handle and open a temporary file. If successful,
// set *ppFd to point to the malloc'd file-handle and return SQLITE_OK.
// Otherwise, set *ppFd to 0 and return an SQLite error code.
func _vdbeSorterOpenTempFile(tls *crt.TLS, _db *Xsqlite3, _nExtend int64, _ppFd **Xsqlite3_file) (r0 int32) {
var _rc int32
var _1_max int64
if _sqlite3FaultSim(tls, i32(202)) != 0 {
return i32(3338)
}
_rc = _sqlite3OsOpenMalloc(tls, (*Xsqlite3_vfs)(_db.X0), nil, _ppFd, i32(4126), &_rc)
if _rc != i32(0) {
goto _1
}
_1_max = i64(2147418112)
_sqlite3OsFileControlHint(tls, *_ppFd, i32(18), (unsafe.Pointer)(&_1_max))
if _nExtend > int64(i32(0)) {
_vdbeSorterExtendFile(tls, _db, *_ppFd, _nExtend)
}
_1:
return _rc
_ = _1_max
panic(0)
}
// The first argument is a file-handle open on a temporary file. The file
// is guaranteed to be nByte bytes or smaller in size. This function
// attempts to extend the file to nByte bytes in size and to ensure that
// the VFS has memory mapped it.
//
// Whether or not the file does end up memory mapped of course depends on
// the specific VFS implementation.
func _vdbeSorterExtendFile(tls *crt.TLS, _db *Xsqlite3, _pFd *Xsqlite3_file, _nByte int64) {
var _1_chunksize int32
var _1_p unsafe.Pointer
if (_nByte <= int64(_db.X32)) && (((*Xsqlite3_io_methods)(_pFd.X0).X0) >= i32(3)) {
_1_p = nil
_1_chunksize = i32(4096)
_sqlite3OsFileControlHint(tls, _pFd, i32(6), (unsafe.Pointer)(&_1_chunksize))
_sqlite3OsFileControlHint(tls, _pFd, i32(5), (unsafe.Pointer)(&_nByte))
_sqlite3OsFetch(tls, _pFd, int64(i32(0)), int32(_nByte), &_1_p)
_sqlite3OsUnfetch(tls, _pFd, int64(i32(0)), _1_p)
}
_ = _1_chunksize
}
// Initialize a PMA-writer object.
func _vdbePmaWriterInit(tls *crt.TLS, _pFd *Xsqlite3_file, _p *XPmaWriter, _nBuf int32, _iStart int64) {
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(32))
*(**uint8)(unsafe.Pointer(&(_p.X1))) = (*uint8)(_sqlite3Malloc(tls, uint64(_nBuf)))
if (_p.X1) == nil {
*(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3NomemError(tls, i32(87476))
goto _1
}
*(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X3))), int32(_iStart%int64(_nBuf)))
*(*int64)(unsafe.Pointer(&(_p.X5))) = _iStart - int64(_p.X3)
*(*int32)(unsafe.Pointer(&(_p.X2))) = _nBuf
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = _pFd
_1:
}
// Write value iVal encoded as a varint to the PMA. Return
// SQLITE_OK if successful, or an SQLite error code if an error occurs.
func _vdbePmaWriteVarint(tls *crt.TLS, _p *XPmaWriter, _iVal uint64) {
var _nByte int32
var _aByte [10]uint8
_nByte = _sqlite3PutVarint(tls, (*uint8)(unsafe.Pointer(&_aByte)), _iVal)
_vdbePmaWriteBlob(tls, _p, (*uint8)(unsafe.Pointer(&_aByte)), _nByte)
_ = _aByte
}
// Write nData bytes of data to the PMA. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
func _vdbePmaWriteBlob(tls *crt.TLS, _p *XPmaWriter, _pData *uint8, _nData int32) {
var _nRem, _1_nCopy int32
_nRem = _nData
_0:
if _nRem <= i32(0) || (_p.X0) != i32(0) {
goto _1
}
_1_nCopy = _nRem
if _1_nCopy > ((_p.X2) - (_p.X4)) {
_1_nCopy = (_p.X2) - (_p.X4)
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X4)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pData))+1*uintptr(_nData-_nRem)))), uint32(_1_nCopy))
{
p := (*int32)(unsafe.Pointer(&(_p.X4)))
*p = (*p) + _1_nCopy
sink1 = *p
}
if (_p.X4) == (_p.X2) {
*(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X3)))), (_p.X4)-(_p.X3), (_p.X5)+int64(_p.X3))
*(*int32)(unsafe.Pointer(&(_p.X3))) = store1((*int32)(unsafe.Pointer(&(_p.X4))), i32(0))
{
p := (*int64)(unsafe.Pointer(&(_p.X5)))
*p = (*p) + int64(_p.X2)
sink6 = *p
}
}
func() {
if (_p.X4) >= (_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87507), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaWriteBlobØ00__func__Ø000))), unsafe.Pointer(str(86657)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_nRem
*p = (*p) - _1_nCopy
sink1 = *p
}
goto _0
_1:
}
var _vdbePmaWriteBlobØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaWriteBlobØ00__func__Ø000[0], str(86679), 17)
}
// Flush any buffered data to disk and clean up the PMA-writer object.
// The results of using the PMA-writer after this call are undefined.
// Return SQLITE_OK if flushing the buffered data succeeds or is not
// required. Otherwise, return an SQLite error code.
//
// Before returning, set *piEof to the offset immediately following the
// last byte written to the file.
func _vdbePmaWriterFinish(tls *crt.TLS, _p *XPmaWriter, _piEof *int64) (r0 int32) {
var _rc int32
if (((_p.X0) == i32(0)) && func() int32 {
if (_p.X1) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87524), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaWriterFinishØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0) && ((_p.X4) > (_p.X3)) {
*(*int32)(unsafe.Pointer(&(_p.X0))) = _sqlite3OsWrite(tls, (*Xsqlite3_file)(_p.X6), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X1))+1*uintptr(_p.X3)))), (_p.X4)-(_p.X3), (_p.X5)+int64(_p.X3))
}
*_piEof = (_p.X5) + int64(_p.X4)
Xsqlite3_free(tls, (unsafe.Pointer)(_p.X1))
_rc = _p.X0
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(32))
return _rc
}
var _vdbePmaWriterFinishØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaWriterFinishØ00__func__Ø000[0], str(86696), 20)
}
var _vdbeSorterFlushPMAØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterFlushPMAØ00__func__Ø000[0], str(86716), 19)
}
// Launch a background thread to run xTask(pIn).
func _vdbeSorterCreateThread(tls *crt.TLS, _pTask *XSortSubtask, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
func() {
if (*XSQLiteThread)(_pTask.X0) != nil || (_pTask.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87148), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterCreateThreadØ00__func__Ø000))), unsafe.Pointer(str(86373)))
crt.X__builtin_abort(tls)
}
}()
return _sqlite3ThreadCreate(tls, (**XSQLiteThread)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTask.X0))))), _xTask, _pIn)
}
var _vdbeSorterCreateThreadØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterCreateThreadØ00__func__Ø000[0], str(86735), 23)
}
// Create a new thread
func _sqlite3ThreadCreate(tls *crt.TLS, _ppThread **XSQLiteThread, _xTask func(*crt.TLS, unsafe.Pointer) unsafe.Pointer, _pIn unsafe.Pointer) (r0 int32) {
var _rc int32
var _p *XSQLiteThread
func() {
if _ppThread == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26905), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000))), unsafe.Pointer(str(86758)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
}{_xTask})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26906), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000))), unsafe.Pointer(str(86770)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_sqlite3Config.X1) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(26908), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ThreadCreateØ00__func__Ø000))), unsafe.Pointer(str(86779)))
crt.X__builtin_abort(tls)
}
}()
*_ppThread = nil
_p = (*XSQLiteThread)(_sqlite3Malloc(tls, uint64(u32(20))))
if _p == nil {
return _sqlite3NomemError(tls, i32(26912))
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(20))
*(*func(*crt.TLS, unsafe.Pointer) unsafe.Pointer)(unsafe.Pointer(&(_p.X3))) = _xTask
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = _pIn
if _sqlite3FaultSim(tls, i32(200)) != 0 {
_rc = i32(1)
goto _8
}
_rc = crt.Xpthread_create(tls, (*uint32)(unsafe.Pointer(&(_p.X0))), nil, _xTask, _pIn)
_8:
if _rc != 0 {
*(*int32)(unsafe.Pointer(&(_p.X1))) = i32(1)
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))) = _xTask(tls, _pIn)
}
*_ppThread = _p
return i32(0)
}
var _sqlite3ThreadCreateØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ThreadCreateØ00__func__Ø000[0], str(86813), 20)
}
// The main routine for background threads that write level-0 PMAs.
func _vdbeSorterFlushThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
var _rc int32
var _pTask *XSortSubtask
_pTask = (*XSortSubtask)(_pCtx)
func() {
if (_pTask.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87700), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterFlushThreadØ00__func__Ø000))), unsafe.Pointer(str(86833)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeSorterListToPMA(tls, _pTask, (*t47)(unsafe.Pointer(&(_pTask.X4))))
*(*int32)(unsafe.Pointer(&(_pTask.X1))) = i32(1)
return (unsafe.Pointer)(uintptr(_rc))
}
var _vdbeSorterFlushThreadØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterFlushThreadØ00__func__Ø000[0], str(86849), 22)
}
// This function is called as part of an sqlite3VdbeSorterRewind() operation
// on a sorter that has written two or more PMAs to temporary files. It sets
// up either VdbeSorter.pMerger (for single threaded sorters) or pReader
// (for multi-threaded sorters) so that it can be used to iterate through
// all records stored in the sorter.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
func _vdbeSorterSetupMerge(tls *crt.TLS, _pSorter *XVdbeSorter) (r0 int32) {
var _rc, _i, _3_iTask int32
var _db *Xsqlite3
var _3_pReadr, _9_p *XPmaReader
var _7_pIncr *XIncrMerger
var _pTask0, _3_pLast *XSortSubtask
var _xCompare func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
var _pMain *XMergeEngine
_pTask0 = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(i32(0))))
_pMain = nil
_db = (*Xsqlite3)((*XVdbeSorter)(_pTask0.X2).X6)
_xCompare = _vdbeSorterGetCompare(tls, _pSorter)
_i = i32(0)
_0:
if _i >= int32(_pSorter.X15) {
goto _3
}
*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&((*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_i))).X6))))) = _xCompare
_i += 1
goto _0
_3:
_rc = _vdbeSorterMergeTreeBuild(tls, _pSorter, &_pMain)
if _rc != i32(0) {
goto _4
}
func() {
if int32(_pSorter.X13) != i32(0) && int32(_pSorter.X15) <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88517), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000))), unsafe.Pointer(str(86871)))
crt.X__builtin_abort(tls)
}
}()
if (_pSorter.X13) == 0 {
goto _8
}
_3_pReadr = nil
_3_pLast = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(int32(_pSorter.X15)-i32(1))))
_rc = _vdbeSortAllocUnpacked(tls, _3_pLast)
if _rc != i32(0) {
goto _9
}
_3_pReadr = (*XPmaReader)(_sqlite3DbMallocZero(tls, _db, uint64(u32(52))))
*(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X4))))) = _3_pReadr
if _3_pReadr == nil {
_rc = _sqlite3NomemError(tls, i32(88526))
}
_9:
if _rc != i32(0) {
goto _11
}
_rc = _vdbeIncrMergerNew(tls, _3_pLast, _pMain, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pReadr.X10))))))
if _rc != i32(0) {
goto _12
}
_vdbeIncrMergerSetThreads(tls, (*XIncrMerger)(_3_pReadr.X10))
_3_iTask = i32(0)
_13:
if _3_iTask >= (int32(_pSorter.X15) - i32(1)) {
goto _16
}
if store55(&_7_pIncr, (*XIncrMerger)((*XPmaReader)(unsafe.Pointer(uintptr(_pMain.X3)+52*uintptr(_3_iTask))).X10)) != nil {
_vdbeIncrMergerSetThreads(tls, _7_pIncr)
func() {
if (*XSortSubtask)(_7_pIncr.X0) == _3_pLast {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88536), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000))), unsafe.Pointer(str(86915)))
crt.X__builtin_abort(tls)
}
}()
}
_3_iTask += 1
goto _13
_16:
_3_iTask = i32(0)
_20:
if _rc != i32(0) || _3_iTask >= int32(_pSorter.X15) {
goto _24
}
_9_p = (*XPmaReader)(unsafe.Pointer(uintptr(_pMain.X3) + 52*uintptr(_3_iTask)))
func() {
if (*XIncrMerger)(_9_p.X10) != nil && ((*XSortSubtask)((*XIncrMerger)(_9_p.X10).X0) != (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+60*uintptr(_3_iTask))) || _3_iTask == (int32(_pSorter.X15)-i32(1)) && ((*XIncrMerger)(_9_p.X10).X5) != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88550), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterSetupMergeØ00__func__Ø000))), unsafe.Pointer(str(86935)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbePmaReaderIncrInit(tls, _9_p, i32(1))
_3_iTask += 1
goto _20
_24:
_12:
_pMain = nil
_11:
if _rc == i32(0) {
_rc = _vdbePmaReaderIncrMergeInit(tls, _3_pReadr, i32(2))
}
goto _31
_8:
_rc = _vdbeMergeEngineInit(tls, _pTask0, _pMain, i32(0))
*(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSorter.X5))))) = _pMain
_pMain = nil
_31:
_4:
if _rc != i32(0) {
_vdbeMergeEngineFree(tls, _pMain)
}
return _rc
}
// This function is called as part of a SorterRewind() operation on a sorter
// that has already written two or more level-0 PMAs to one or more temp
// files. It builds a tree of MergeEngine/IncrMerger/PmaReader objects that
// can be used to incrementally merge all PMAs on disk.
//
// If successful, SQLITE_OK is returned and *ppOut set to point to the
// MergeEngine object at the root of the tree before returning. Or, if an
// error occurs, an SQLite error code is returned and the final value
// of *ppOut is undefined.
func _vdbeSorterMergeTreeBuild(tls *crt.TLS, _pSorter *XVdbeSorter, _ppOut **XMergeEngine) (r0 int32) {
var _rc, _iTask, _3_nDepth, _5_i, _5_iSeq, _6_nReader int32
var _3_iReadOff int64
var _2_pTask *XSortSubtask
var _pMain, _3_pRoot, _6_pMerger *XMergeEngine
_pMain = nil
_rc = i32(0)
func() {
if (_pSorter.X13) == 0 && int32(_pSorter.X15) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88434), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000))), unsafe.Pointer(str(87052)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pSorter.X15) <= i32(1) {
goto _3
}
_pMain = _vdbeMergeEngineNew(tls, int32(_pSorter.X15))
if _pMain == nil {
_rc = _sqlite3NomemError(tls, i32(88437))
}
_3:
_iTask = i32(0)
_5:
if _rc != i32(0) || _iTask >= int32(_pSorter.X15) {
goto _9
}
_2_pTask = (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17))))) + 60*uintptr(_iTask)))
func() {
if (_2_pTask.X5) <= i32(0) && i32(1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88443), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000))), unsafe.Pointer(str(87094)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == 0 && (_2_pTask.X5) == 0 {
goto _14
}
_3_pRoot = nil
_3_nDepth = _vdbeSorterTreeDepth(tls, _2_pTask.X5)
_3_iReadOff = int64(i32(0))
if (_2_pTask.X5) <= i32(16) {
_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _2_pTask.X5, &_3_iReadOff, &_3_pRoot)
goto _16
}
_5_iSeq = i32(0)
_3_pRoot = _vdbeMergeEngineNew(tls, i32(16))
if _3_pRoot == nil {
_rc = _sqlite3NomemError(tls, i32(88455))
}
_5_i = i32(0)
_18:
if _5_i >= (_2_pTask.X5) || _rc != i32(0) {
goto _22
}
_6_pMerger = nil
_6_nReader = func() int32 {
if ((_2_pTask.X5) - _5_i) < i32(16) {
return ((_2_pTask.X5) - _5_i)
}
return i32(16)
}()
_rc = _vdbeMergeEngineLevel0(tls, _2_pTask, _6_nReader, &_3_iReadOff, &_6_pMerger)
if _rc == i32(0) {
_rc = _vdbeSorterAddToTree(tls, _2_pTask, _3_nDepth, postInc1(&_5_iSeq, int32(1)), _3_pRoot, _6_pMerger)
}
{
p := &_5_i
*p = (*p) + i32(16)
sink1 = *p
}
goto _18
_22:
_16:
if _rc != i32(0) {
goto _26
}
if _pMain != nil {
_rc = _vdbeIncrMergerNew(tls, _2_pTask, _3_pRoot, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPmaReader)(unsafe.Pointer(uintptr(_pMain.X3) + 52*uintptr(_iTask))).X10))))))
goto _28
}
func() {
if _pMain != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88475), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeSorterMergeTreeBuildØ00__func__Ø000))), unsafe.Pointer(str(87139)))
crt.X__builtin_abort(tls)
}
}()
_pMain = _3_pRoot
_28:
goto _31
_26:
_vdbeMergeEngineFree(tls, _3_pRoot)
_31:
_14:
_iTask += 1
goto _5
_9:
if _rc != i32(0) {
_vdbeMergeEngineFree(tls, _pMain)
_pMain = nil
}
*_ppOut = _pMain
return _rc
_ = _3_iReadOff
_ = _5_iSeq
panic(0)
}
var _vdbeSorterMergeTreeBuildØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterMergeTreeBuildØ00__func__Ø000[0], str(87148), 25)
}
// Allocate a new MergeEngine object capable of handling up to
// nReader PmaReader inputs.
//
// nReader is automatically rounded up to the next power of two.
// nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up.
func _vdbeMergeEngineNew(tls *crt.TLS, _nReader int32) (r0 *XMergeEngine) {
var _N, _nByte int32
var _pNew *XMergeEngine
_N = i32(2)
func() {
if _nReader > i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87191), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMergeEngineNewØ00__func__Ø000))), unsafe.Pointer(str(87173)))
crt.X__builtin_abort(tls)
}
}()
_2:
if _N < _nReader {
{
p := &_N
*p = (*p) + _N
sink1 = *p
}
goto _2
}
_nByte = int32(u32(16) + (uint32(_N) * u32(56)))
_pNew = func() *XMergeEngine {
if _sqlite3FaultSim(tls, i32(100)) != 0 {
return nil
}
return (*XMergeEngine)(_sqlite3MallocZero(tls, uint64(_nByte)))
}()
if _pNew != nil {
*(*int32)(unsafe.Pointer(&(_pNew.X0))) = _N
*(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = nil
*(**XPmaReader)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X3))))) = (*XPmaReader)(unsafe.Pointer((*XMergeEngine)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 16*uintptr(i32(1))))))
*(**int32)(unsafe.Pointer(&(_pNew.X2))) = (*int32)(unsafe.Pointer((*XPmaReader)(unsafe.Pointer(uintptr(_pNew.X3) + 52*uintptr(_N)))))
}
return _pNew
}
var _vdbeMergeEngineNewØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_vdbeMergeEngineNewØ00__func__Ø000[0], str(87205), 19)
}
// Return the depth of a tree comprising nPMA PMAs, assuming a fanout of
// SORTER_MAX_MERGE_COUNT. The returned value does not include leaf nodes.
//
// i.e.
//
// nPMA<=16 -> TreeDepth() == 0
// nPMA<=256 -> TreeDepth() == 1
// nPMA<=65536 -> TreeDepth() == 2
func _vdbeSorterTreeDepth(tls *crt.TLS, _nPMA int32) (r0 int32) {
var _nDepth int32
var _nDiv int64
_nDepth = i32(0)
_nDiv = i64(16)
_0:
if _nDiv < int64(_nPMA) {
_nDiv = _nDiv * int64(i32(16))
_nDepth += 1
goto _0
}
return _nDepth
}
// Allocate a new MergeEngine object to merge the contents of nPMA level-0
// PMAs from pTask->file. If no error occurs, set *ppOut to point to
// the new object and return SQLITE_OK. Or, if an error does occur, set *ppOut
// to NULL and return an SQLite error code.
//
// When this function is called, *piOffset is set to the offset of the
// first PMA to read from pTask->file. Assuming no error occurs, it is
// set to the offset immediately following the last byte of the last
// PMA before returning. If an error does occur, then the final value of
// *piOffset is undefined.
func _vdbeMergeEngineLevel0(tls *crt.TLS, _pTask *XSortSubtask, _nPMA int32, _piOffset *int64, _ppOut **XMergeEngine) (r0 int32) {
var _i, _rc int32
var _iOff, _1_nDummy int64
var _1_pReadr *XPmaReader
var _pNew *XMergeEngine
_iOff = *_piOffset
_rc = i32(0)
*_ppOut = store56(&_pNew, _vdbeMergeEngineNew(tls, _nPMA))
if _pNew == nil {
_rc = _sqlite3NomemError(tls, i32(88321))
}
_i = i32(0)
_1:
if _i >= _nPMA || _rc != i32(0) {
goto _5
}
_1_nDummy = int64(i32(0))
_1_pReadr = (*XPmaReader)(unsafe.Pointer(uintptr(_pNew.X3) + 52*uintptr(_i)))
_rc = _vdbePmaReaderInit(tls, _pTask, (*XSorterFile)(unsafe.Pointer(&(_pTask.X7))), _iOff, _1_pReadr, &_1_nDummy)
_iOff = _1_pReadr.X1
_i += 1
goto _1
_5:
if _rc != i32(0) {
_vdbeMergeEngineFree(tls, _pNew)
*_ppOut = nil
}
*_piOffset = _iOff
return _rc
_ = _1_nDummy
panic(0)
}
// Initialize PmaReader pReadr to scan through the PMA stored in file pFile
// starting at offset iStart and ending at offset iEof-1. This function
// leaves the PmaReader pointing to the first key in the PMA (or EOF if the
// PMA is empty).
//
// If the pnByte parameter is NULL, then it is assumed that the file
// contains a single PMA, and that that PMA omits the initial length varint.
func _vdbePmaReaderInit(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _iStart int64, _pReadr *XPmaReader, _pnByte *int64) (r0 int32) {
var _rc int32
var _1_nByte uint64
func() {
if (_pFile.X1) <= _iStart {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86747), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87224)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pReadr.X5) != nil || (_pReadr.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86748), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87243)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pReadr.X7) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86749), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87282)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pReadr.X9) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86750), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderInitØ00__func__Ø000))), unsafe.Pointer(str(87301)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbePmaReaderSeek(tls, _pTask, _pReadr, _pFile, _iStart)
if _rc == i32(0) {
_1_nByte = u64(0)
_rc = _vdbePmaReadVarint(tls, _pReadr, &_1_nByte)
*(*int64)(unsafe.Pointer(&(_pReadr.X1))) = int64(uint64(_pReadr.X0) + _1_nByte)
{
p := _pnByte
*p = int64(uint64(*p) + _1_nByte)
sink6 = *p
}
}
if _rc == i32(0) {
_rc = _vdbePmaReaderNext(tls, _pReadr)
}
return _rc
}
var _vdbePmaReaderInitØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaReaderInitØ00__func__Ø000[0], str(87317), 18)
}
// Attach PmaReader pReadr to file pFile (if it is not already attached to
// that file) and seek it to offset iOff within the file. Return SQLITE_OK
// if successful, or an SQLite error code if an error occurs.
func _vdbePmaReaderSeek(tls *crt.TLS, _pTask *XSortSubtask, _pReadr *XPmaReader, _pFile *XSorterFile, _iOff int64) (r0 int32) {
var _rc, _2_pgsz, _2_iBuf, _4_nRead int32
_rc = i32(0)
func() {
if (*XIncrMerger)(_pReadr.X10) != nil && ((*XIncrMerger)(_pReadr.X10).X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86652), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderSeekØ00__func__Ø000))), unsafe.Pointer(str(87335)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3FaultSim(tls, i32(201)) != 0 {
return i32(266)
}
if (_pReadr.X9) != nil {
_sqlite3OsUnfetch(tls, (*Xsqlite3_file)(_pReadr.X4), int64(i32(0)), (unsafe.Pointer)(_pReadr.X9))
*(**uint8)(unsafe.Pointer(&(_pReadr.X9))) = nil
}
*(*int64)(unsafe.Pointer(&(_pReadr.X0))) = _iOff
*(*int64)(unsafe.Pointer(&(_pReadr.X1))) = _pFile.X1
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pReadr.X4))))) = (*Xsqlite3_file)(_pFile.X0)
_rc = _vdbeSorterMapFile(tls, _pTask, _pFile, (**uint8)(unsafe.Pointer(&(_pReadr.X9))))
if _rc != i32(0) || (_pReadr.X9) != nil {
goto _6
}
_2_pgsz = (*XVdbeSorter)(_pTask.X2).X3
_2_iBuf = int32((_pReadr.X0) % int64(_2_pgsz))
if (_pReadr.X7) != nil {
goto _7
}
*(**uint8)(unsafe.Pointer(&(_pReadr.X7))) = (*uint8)(_sqlite3Malloc(tls, uint64(_2_pgsz)))
if (_pReadr.X7) == nil {
_rc = _sqlite3NomemError(tls, i32(86669))
}
*(*int32)(unsafe.Pointer(&(_pReadr.X8))) = _2_pgsz
_7:
if _rc != i32(0) || _2_iBuf == 0 {
goto _10
}
_4_nRead = _2_pgsz - _2_iBuf
if ((_pReadr.X0) + int64(_4_nRead)) > (_pReadr.X1) {
_4_nRead = int32((_pReadr.X1) - (_pReadr.X0))
}
_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_pReadr.X4), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pReadr.X7))+1*uintptr(_2_iBuf)))), _4_nRead, _pReadr.X0)
_10:
_6:
return _rc
}
var _vdbePmaReaderSeekØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaReaderSeekØ00__func__Ø000[0], str(87378), 18)
}
// Attempt to memory map file pFile. If successful, set *pp to point to the
// new mapping and return SQLITE_OK. If the mapping is not attempted
// (because the file is too large or the VFS layer is configured not to use
// mmap), return SQLITE_OK and set *pp to NULL.
//
// Or, if an error occurs, return an SQLite error code. The final value of
// *pp is undefined in this case.
func _vdbeSorterMapFile(tls *crt.TLS, _pTask *XSortSubtask, _pFile *XSorterFile, _pp **uint8) (r0 int32) {
var _rc int32
var _1_pFd *Xsqlite3_file
_rc = i32(0)
if (_pFile.X1) > int64((*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6).X32) {
goto _0
}
_1_pFd = (*Xsqlite3_file)(_pFile.X0)
if ((*Xsqlite3_io_methods)(_1_pFd.X0).X0) >= i32(3) {
_rc = _sqlite3OsFetch(tls, _1_pFd, int64(i32(0)), int32(_pFile.X1), (*unsafe.Pointer)(unsafe.Pointer(_pp)))
}
_0:
return _rc
}
// Read a varint from the stream of data accessed by p. Set *pnOut to
// the value read.
func _vdbePmaReadVarint(tls *crt.TLS, _p *XPmaReader, _pnOut *uint64) (r0 int32) {
var _iBuf, _4_i, _4_rc int32
var _4_a *uint8
var _4_aVarint [16]uint8
if (_p.X9) != nil {
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X9))+1*uintptr(_p.X0))), _pnOut))
sink6 = *p
}
goto _1
}
_iBuf = int32((_p.X0) % int64(_p.X8))
if _iBuf != 0 && (((_p.X8) - _iBuf) >= i32(9)) {
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64(_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7))+1*uintptr(_iBuf))), _pnOut))
sink6 = *p
}
goto _4
}
_4_i = i32(0)
_5:
_4_rc = _vdbePmaReadBlob(tls, _p, i32(1), &_4_a)
if _4_rc != 0 {
return _4_rc
}
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_4_aVarint)) + 1*uintptr(postInc1(&_4_i, int32(1))&i32(15)))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_a)) + 1*uintptr(i32(0))))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_4_a)) + 1*uintptr(i32(0))))) & i32(128)) != i32(0) {
goto _5
}
_sqlite3GetVarint(tls, (*uint8)(unsafe.Pointer(&_4_aVarint)), _pnOut)
_4:
_1:
return i32(0)
_ = _4_aVarint
_ = _4_i
panic(0)
}
// Read the next nByte bytes of data from the PMA p.
// If successful, set *ppOut to point to a buffer containing the data
// and return SQLITE_OK. Otherwise, if an error occurs, return an SQLite
// error code.
//
// The buffer returned in *ppOut is only valid until the
// next call to this function.
func _vdbePmaReadBlob(tls *crt.TLS, _p *XPmaReader, _nByte int32, _ppOut **uint8) (r0 int32) {
var _iBuf, _nAvail, _2_nRead, _2_rc, _6_nRem, _7_nNew, _8_rc, _8_nCopy int32
var _7_aNew, _8_aNext *uint8
if (_p.X9) != nil {
*_ppOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X9)) + 1*uintptr(_p.X0)))
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64(_nByte)
sink6 = *p
}
return i32(0)
}
func() {
if (_p.X7) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86514), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87396)))
crt.X__builtin_abort(tls)
}
}()
_iBuf = int32((_p.X0) % int64(_p.X8))
if _iBuf != i32(0) {
goto _3
}
if ((_p.X1) - (_p.X0)) > int64(_p.X8) {
_2_nRead = _p.X8
goto _5
}
_2_nRead = int32((_p.X1) - (_p.X0))
_5:
func() {
if _2_nRead <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86530), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87407)))
crt.X__builtin_abort(tls)
}
}()
_2_rc = _sqlite3OsRead(tls, (*Xsqlite3_file)(_p.X4), (unsafe.Pointer)(_p.X7), _2_nRead, _p.X0)
func() {
if _2_rc == i32(522) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86534), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87415)))
crt.X__builtin_abort(tls)
}
}()
if _2_rc != i32(0) {
return _2_rc
}
_3:
_nAvail = (_p.X8) - _iBuf
if _nByte <= _nAvail {
*_ppOut = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 1*uintptr(_iBuf)))
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64(_nByte)
sink6 = *p
}
goto _12
}
if (_p.X2) >= _nByte {
goto _13
}
_7_nNew = func() int32 {
if i32(128) > ((_p.X2) * i32(2)) {
return i32(128)
}
return ((_p.X2) * i32(2))
}()
_16:
if _nByte > _7_nNew {
_7_nNew = _7_nNew * i32(2)
goto _16
}
_7_aNew = (*uint8)(_sqlite3Realloc(tls, (unsafe.Pointer)(_p.X5), uint64(_7_nNew)))
if _7_aNew == nil {
return _sqlite3NomemError(tls, i32(86557))
}
*(*int32)(unsafe.Pointer(&(_p.X2))) = _7_nNew
*(**uint8)(unsafe.Pointer(&(_p.X5))) = _7_aNew
_13:
crt.Xmemcpy(tls, (unsafe.Pointer)(_p.X5), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7))+1*uintptr(_iBuf)))), uint32(_nAvail))
{
p := (*int64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + int64(_nAvail)
sink6 = *p
}
_6_nRem = _nByte - _nAvail
_19:
if _6_nRem <= i32(0) {
goto _20
}
_8_nCopy = _6_nRem
if _6_nRem > (_p.X8) {
_8_nCopy = _p.X8
}
_8_rc = _vdbePmaReadBlob(tls, _p, _8_nCopy, &_8_aNext)
if _8_rc != i32(0) {
return _8_rc
}
func() {
if _8_aNext == (_p.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86579), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReadBlobØ00__func__Ø000))), unsafe.Pointer(str(87443)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X5))+1*uintptr(_nByte-_6_nRem)))), (unsafe.Pointer)(_8_aNext), uint32(_8_nCopy))
{
p := &_6_nRem
*p = (*p) - _8_nCopy
sink1 = *p
}
goto _19
_20:
*_ppOut = _p.X5
_12:
return i32(0)
}
var _vdbePmaReadBlobØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaReadBlobØ00__func__Ø000[0], str(87460), 16)
}
// Advance PmaReader pReadr to the next key in its PMA. Return SQLITE_OK if
// no error occurs, or an SQLite error code if one does.
func _vdbePmaReaderNext(tls *crt.TLS, _pReadr *XPmaReader) (r0 int32) {
var _rc, _1_bEof int32
var _nRec uint64
var _1_pIncr *XIncrMerger
_rc = i32(0)
_nRec = u64(0)
if (_pReadr.X0) < (_pReadr.X1) {
goto _0
}
_1_pIncr = (*XIncrMerger)(_pReadr.X10)
_1_bEof = i32(1)
if _1_pIncr == nil {
goto _1
}
_rc = _vdbeIncrSwap(tls, _1_pIncr)
if (_rc == i32(0)) && ((_1_pIncr.X4) == i32(0)) {
_rc = _vdbePmaReaderSeek(tls, (*XSortSubtask)(_1_pIncr.X0), _pReadr, (*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_1_pIncr.X6)))))+12*uintptr(i32(0)))), _1_pIncr.X2)
_1_bEof = i32(0)
}
_1:
if _1_bEof != 0 {
_vdbePmaReaderClear(tls, _pReadr)
return _rc
}
_0:
if _rc == i32(0) {
_rc = _vdbePmaReadVarint(tls, _pReadr, &_nRec)
}
if _rc == i32(0) {
*(*int32)(unsafe.Pointer(&(_pReadr.X3))) = int32(_nRec)
_rc = _vdbePmaReadBlob(tls, _pReadr, int32(_nRec), (**uint8)(unsafe.Pointer(&(_pReadr.X6))))
}
return _rc
}
// This function is called when the PmaReader corresponding to pIncr has
// finished reading the contents of aFile[0]. Its purpose is to "refill"
// aFile[0] such that the PmaReader should start rereading it from the
// beginning.
//
// For single-threaded objects, this is accomplished by literally reading
// keys from pIncr->pMerger and repopulating aFile[0].
//
// For multi-threaded objects, all that is required is to wait until the
// background thread is finished (if it is not already) and then swap
// aFile[0] and aFile[1] in place. If the contents of pMerger have not
// been exhausted, this function also launches a new background thread
// to populate the new aFile[1].
//
// SQLITE_OK is returned on success, or an SQLite error code otherwise.
func _vdbeIncrSwap(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
var _rc int32
var _2_f0 XSorterFile
_rc = i32(0)
if (_pIncr.X5) == 0 {
goto _0
}
_rc = _vdbeSorterJoinThread(tls, (*XSortSubtask)(_pIncr.X0))
if _rc == i32(0) {
_2_f0 = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0))))
*(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1))))
*(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1)))) = _2_f0
}
if _rc != i32(0) {
goto _2
}
if ((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0)))).X1) == (_pIncr.X2) {
*(*int32)(unsafe.Pointer(&(_pIncr.X4))) = i32(1)
goto _4
}
_rc = _vdbeIncrBgPopulate(tls, _pIncr)
_4:
_2:
goto _5
_0:
_rc = _vdbeIncrPopulate(tls, _pIncr)
*(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0)))) = *(*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1))))
if ((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0)))).X1) == (_pIncr.X2) {
*(*int32)(unsafe.Pointer(&(_pIncr.X4))) = i32(1)
}
_5:
return _rc
}
// Launch a background thread to populate aFile[1] of pIncr.
func _vdbeIncrBgPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
var _p unsafe.Pointer
_p = (unsafe.Pointer)(_pIncr)
func() {
if (_pIncr.X5) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87940), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeIncrBgPopulateØ00__func__Ø000))), unsafe.Pointer(str(87476)))
crt.X__builtin_abort(tls)
}
}()
return _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.X0), _vdbeIncrPopulateThread, _p)
}
var _vdbeIncrBgPopulateØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_vdbeIncrBgPopulateØ00__func__Ø000[0], str(87494), 19)
}
// The main routine for background threads that populate aFile[1] of
// multi-threaded IncrMerger objects.
func _vdbeIncrPopulateThread(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
var _pRet unsafe.Pointer
var _pIncr *XIncrMerger
_pIncr = (*XIncrMerger)(_pCtx)
_pRet = (unsafe.Pointer)(uintptr(_vdbeIncrPopulate(tls, _pIncr)))
*(*int32)(unsafe.Pointer(&((*XSortSubtask)(_pIncr.X0).X1))) = i32(1)
return _pRet
}
// Read keys from pIncr->pMerger and populate pIncr->aFile[1]. The format
// of the data stored in aFile[1] is the same as that used by regular PMAs,
// except that the number-of-bytes varint is omitted from the start.
func _vdbeIncrPopulate(tls *crt.TLS, _pIncr *XIncrMerger) (r0 int32) {
var _rc, _rc2, _1_dummy, _1_nKey int32
var _iStart, _1_iEof int64
var _1_pReader *XPmaReader
var _pTask *XSortSubtask
var _pOut *XSorterFile
var _pMerger *XMergeEngine
var _writer XPmaWriter
_rc = i32(0)
_iStart = _pIncr.X2
_pOut = (*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1))))
_pTask = (*XSortSubtask)(_pIncr.X0)
_pMerger = (*XMergeEngine)(_pIncr.X1)
func() {
if (_pIncr.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87894), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000))), unsafe.Pointer(str(87513)))
crt.X__builtin_abort(tls)
}
}()
_vdbePmaWriterInit(tls, (*Xsqlite3_file)(_pOut.X0), &_writer, (*XVdbeSorter)(_pTask.X2).X3, _iStart)
_2:
if _rc != i32(0) {
goto _3
}
_1_pReader = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1)))))))
_1_nKey = _1_pReader.X3
_1_iEof = (_writer.X5) + int64(_writer.X4)
if (*Xsqlite3_file)(_1_pReader.X4) == nil {
goto _3
}
if ((_1_iEof + int64(_1_nKey)) + int64(_sqlite3VarintLen(tls, uint64(_1_nKey)))) > (_iStart + int64(_pIncr.X3)) {
goto _3
}
_vdbePmaWriteVarint(tls, &_writer, uint64(_1_nKey))
_vdbePmaWriteBlob(tls, &_writer, _1_pReader.X6, _1_nKey)
func() {
if (*XSortSubtask)((*XMergeEngine)(_pIncr.X1).X1) != _pTask {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87913), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeIncrPopulateØ00__func__Ø000))), unsafe.Pointer(str(87528)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pIncr.X1), &_1_dummy)
goto _2
_3:
_rc2 = _vdbePmaWriterFinish(tls, &_writer, (*int64)(unsafe.Pointer(&(_pOut.X1))))
if _rc == i32(0) {
_rc = _rc2
}
return _rc
_ = _writer
_ = _1_dummy
panic(0)
}
var _vdbeIncrPopulateØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_vdbeIncrPopulateØ00__func__Ø000[0], str(87557), 17)
}
// Advance the MergeEngine to its next entry.
// Set *pbEof to true there is no next entry because
// the MergeEngine has reached the end of all its inputs.
//
// Return SQLITE_OK if successful or an error code if an error occurs.
func _vdbeMergeEngineStep(tls *crt.TLS, _pMerger *XMergeEngine, _pbEof *int32) (r0 int32) {
var _rc, _iPrev, _1_i, _1_bCached, _2_iRes int32
var _1_pReadr1, _1_pReadr2 *XPmaReader
var _pTask *XSortSubtask
_iPrev = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1))))
_pTask = (*XSortSubtask)(_pMerger.X1)
_rc = _vdbePmaReaderNext(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+52*uintptr(_iPrev))))
if _rc != i32(0) {
goto _0
}
_1_bCached = i32(0)
_1_pReadr1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(_iPrev&i32(65534))))
_1_pReadr2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(_iPrev|i32(1))))
_1_i = ((_pMerger.X0) + _iPrev) / i32(2)
_1:
if _1_i <= i32(0) {
goto _4
}
if (*Xsqlite3_file)(_1_pReadr1.X4) == nil {
_2_iRes = i32(1)
goto _8
}
if (*Xsqlite3_file)(_1_pReadr2.X4) == nil {
_2_iRes = i32(-1)
goto _8
}
_2_iRes = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
}{(_pTask.X6)})))(tls, _pTask, &_1_bCached, (unsafe.Pointer)(_1_pReadr1.X6), _1_pReadr1.X3, (unsafe.Pointer)(_1_pReadr2.X6), _1_pReadr2.X3)
_8:
if (_2_iRes < i32(0)) || ((_2_iRes == i32(0)) && (uintptr(unsafe.Pointer(_1_pReadr1)) < uintptr(unsafe.Pointer(_1_pReadr2)))) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i))) = int32((uintptr(unsafe.Pointer(_1_pReadr1)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 52)
_1_pReadr2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i^i32(1)))))))
_1_bCached = i32(0)
goto _12
}
if (*Xsqlite3_file)(_1_pReadr1.X4) != nil {
_1_bCached = i32(0)
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i))) = int32((uintptr(unsafe.Pointer(_1_pReadr2)) - uintptr(unsafe.Pointer((*XPmaReader)(_pMerger.X3)))) / 52)
_1_pReadr1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_1_i^i32(1)))))))
_12:
_1_i = _1_i / i32(2)
goto _1
_4:
*_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+52*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(i32(1))))))).X4) == nil)
_0:
return func() int32 {
if _rc == i32(0) {
return int32((*XUnpackedRecord)(_pTask.X3).X4)
}
return _rc
}()
_ = _1_bCached
panic(0)
}
// pRoot is the root of an incremental merge-tree with depth nDepth (according
// to vdbeSorterTreeDepth()). pLeaf is the iSeq'th leaf to be added to the
// tree, counting from zero. This function adds pLeaf to the tree.
//
// If successful, SQLITE_OK is returned. If an error occurs, an SQLite error
// code is returned and pLeaf is freed.
func _vdbeSorterAddToTree(tls *crt.TLS, _pTask *XSortSubtask, _nDepth int32, _iSeq int32, _pRoot *XMergeEngine, _pLeaf *XMergeEngine) (r0 int32) {
var _rc, _nDiv, _i, _2_iIter int32
var _2_pReadr *XPmaReader
var _pIncr *XIncrMerger
var _p, _3_pNew *XMergeEngine
_rc = i32(0)
_nDiv = i32(1)
_p = _pRoot
_rc = _vdbeIncrMergerNew(tls, _pTask, _pLeaf, &_pIncr)
_i = i32(1)
_0:
if _i >= _nDepth {
goto _3
}
_nDiv = _nDiv * i32(16)
_i += 1
goto _0
_3:
_i = i32(1)
_4:
if _i >= _nDepth || _rc != i32(0) {
goto _8
}
_2_iIter = (_iSeq / _nDiv) % i32(16)
_2_pReadr = (*XPmaReader)(unsafe.Pointer(uintptr(_p.X3) + 52*uintptr(_2_iIter)))
if (*XIncrMerger)(_2_pReadr.X10) != nil {
goto _9
}
_3_pNew = _vdbeMergeEngineNew(tls, i32(16))
if _3_pNew == nil {
_rc = _sqlite3NomemError(tls, i32(88392))
goto _11
}
_rc = _vdbeIncrMergerNew(tls, _pTask, _3_pNew, (**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pReadr.X10))))))
_11:
_9:
if _rc == i32(0) {
_p = (*XMergeEngine)((*XIncrMerger)(_2_pReadr.X10).X1)
_nDiv = _nDiv / i32(16)
}
_i += 1
goto _4
_8:
if _rc == i32(0) {
*(**XIncrMerger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XPmaReader)(unsafe.Pointer(uintptr(_p.X3) + 52*uintptr(_iSeq%i32(16)))).X10))))) = _pIncr
goto _14
}
_vdbeIncrFree(tls, _pIncr)
_14:
return _rc
}
// Allocate and return a new IncrMerger object to read data from pMerger.
//
// If an OOM condition is encountered, return NULL. In this case free the
// pMerger argument before returning.
func _vdbeIncrMergerNew(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _ppOut **XIncrMerger) (r0 int32) {
var _rc int32
var _pIncr *XIncrMerger
_rc = i32(0)
_pIncr = store55(_ppOut, (*XIncrMerger)(func() unsafe.Pointer {
if _sqlite3FaultSim(tls, i32(100)) != 0 {
return unsafe.Pointer(nil)
}
return _sqlite3MallocZero(tls, uint64(u32(52)))
}()))
if _pIncr != nil {
*(**XMergeEngine)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIncr.X1))))) = _pMerger
*(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIncr.X0))))) = _pTask
*(*int32)(unsafe.Pointer(&(_pIncr.X3))) = func() int32 {
if (((*XVdbeSorter)(_pTask.X2).X2) + i32(9)) > (((*XVdbeSorter)(_pTask.X2).X1) / i32(2)) {
return (((*XVdbeSorter)(_pTask.X2).X2) + i32(9))
}
return (((*XVdbeSorter)(_pTask.X2).X1) / i32(2))
}()
{
p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1)))
*p = (*p) + int64(_pIncr.X3)
sink6 = *p
}
goto _5
}
_vdbeMergeEngineFree(tls, _pMerger)
_rc = _sqlite3NomemError(tls, i32(88016))
_5:
return _rc
}
var _vdbeSorterSetupMergeØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_vdbeSorterSetupMergeØ00__func__Ø000[0], str(87574), 21)
}
// Set the "use-threads" flag on object pIncr.
func _vdbeIncrMergerSetThreads(tls *crt.TLS, _pIncr *XIncrMerger) {
*(*int32)(unsafe.Pointer(&(_pIncr.X5))) = i32(1)
{
p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&((*XSortSubtask)(_pIncr.X0).X8))).X1)))
*p = (*p) - int64(_pIncr.X3)
sink6 = *p
}
}
// If the PmaReader passed as the first argument is not an incremental-reader
// (if pReadr->pIncr==0), then this function is a no-op. Otherwise, it invokes
// the vdbePmaReaderIncrMergeInit() function with the parameters passed to
// this routine to initialize the incremental merge.
//
// If the IncrMerger object is multi-threaded (IncrMerger.bUseThread==1),
// then a background thread is launched to call vdbePmaReaderIncrMergeInit().
// Or, if the IncrMerger is single threaded, the same function is called
// using the current thread.
func _vdbePmaReaderIncrInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
var _rc int32
var _2_pCtx unsafe.Pointer
var _pIncr *XIncrMerger
_pIncr = (*XIncrMerger)(_pReadr.X10)
_rc = i32(0)
if _pIncr == nil {
goto _0
}
func() {
if (_pIncr.X5) != i32(0) && _eMode != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88284), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrInitØ00__func__Ø000))), unsafe.Pointer(str(87595)))
crt.X__builtin_abort(tls)
}
}()
if (_pIncr.X5) != 0 {
_2_pCtx = (unsafe.Pointer)(_pReadr)
_rc = _vdbeSorterCreateThread(tls, (*XSortSubtask)(_pIncr.X0), _vdbePmaReaderBgIncrInit, _2_pCtx)
goto _5
}
_rc = _vdbePmaReaderIncrMergeInit(tls, _pReadr, _eMode)
_5:
_0:
return _rc
}
var _vdbePmaReaderIncrInitØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaReaderIncrInitØ00__func__Ø000[0], str(87640), 22)
}
// The main routine for vdbePmaReaderIncrMergeInit() operations run in
// background threads.
func _vdbePmaReaderBgIncrInit(tls *crt.TLS, _pCtx unsafe.Pointer) (r0 unsafe.Pointer) {
var _pRet unsafe.Pointer
var _pReader *XPmaReader
_pReader = (*XPmaReader)(_pCtx)
_pRet = (unsafe.Pointer)(uintptr(_vdbePmaReaderIncrMergeInit(tls, _pReader, i32(1))))
*(*int32)(unsafe.Pointer(&((*XSortSubtask)((*XIncrMerger)(_pReader.X10).X0).X1))) = i32(1)
return _pRet
}
// The PmaReader passed as the first argument is guaranteed to be an
// incremental-reader (pReadr->pIncr!=0). This function serves to open
// and/or initialize the temp file related fields of the IncrMerge
// object at (pReadr->pIncr).
//
// If argument eMode is set to INCRINIT_NORMAL, then all PmaReaders
// in the sub-tree headed by pReadr are also initialized. Data is then
// loaded into the buffers belonging to pReadr and it is set to point to
// the first key in its range.
//
// If argument eMode is set to INCRINIT_TASK, then pReadr is guaranteed
// to be a multi-threaded PmaReader and this function is being called in a
// background thread. In this case all PmaReaders in the sub-tree are
// initialized as for INCRINIT_NORMAL and the aFile[1] buffer belonging to
// pReadr is populated. However, pReadr itself is not set up to point
// to its first key. A call to vdbePmaReaderNext() is still required to do
// that.
//
// The reason this function does not call vdbePmaReaderNext() immediately
// in the INCRINIT_TASK case is that vdbePmaReaderNext() assumes that it has
// to block on thread (pTask->thread) before accessing aFile[1]. But, since
// this entire function is being run by thread (pTask->thread), that will
// lead to the current background thread attempting to join itself.
//
// Finally, if argument eMode is set to INCRINIT_ROOT, it may be assumed
// that pReadr->pIncr is a multi-threaded IncrMerge objects, and that all
// child-trees have already been initialized using IncrInit(INCRINIT_TASK).
// In this case vdbePmaReaderNext() is called on all child PmaReaders and
// the current PmaReader set to point to the first key in its range.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
func _vdbePmaReaderIncrMergeInit(tls *crt.TLS, _pReadr *XPmaReader, _eMode int32) (r0 int32) {
var _rc, _1_mxSz int32
var _db *Xsqlite3
var _pIncr *XIncrMerger
var _pTask *XSortSubtask
_rc = i32(0)
_pIncr = (*XIncrMerger)(_pReadr.X10)
_pTask = (*XSortSubtask)(_pIncr.X0)
_db = (*Xsqlite3)((*XVdbeSorter)(_pTask.X2).X6)
i32(0)
_rc = _vdbeMergeEngineInit(tls, _pTask, (*XMergeEngine)(_pIncr.X1), _eMode)
if _rc != i32(0) {
goto _0
}
_1_mxSz = _pIncr.X3
if (_pIncr.X5) == 0 {
goto _1
}
_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(0)))).X0))))))
if _rc == i32(0) {
_rc = _vdbeSorterOpenTempFile(tls, _db, int64(_1_mxSz), (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1)))).X0))))))
}
goto _3
_1:
if (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0) == nil {
func() {
if ((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1) <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88217), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000))), unsafe.Pointer(str(87662)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeSorterOpenTempFile(tls, _db, (*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1, (**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0))))))
*(*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1))) = int64(i32(0))
}
if _rc == i32(0) {
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]XSorterFile)(unsafe.Pointer(&(_pIncr.X6))))) + 12*uintptr(i32(1)))).X0))))) = (*Xsqlite3_file)((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X0)
*(*int64)(unsafe.Pointer(&(_pIncr.X2))) = (*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1
{
p := (*int64)(unsafe.Pointer(&((*XSorterFile)(unsafe.Pointer(&(_pTask.X8))).X1)))
*p = (*p) + int64(_1_mxSz)
sink6 = *p
}
}
_3:
_0:
if (_rc == i32(0)) && (_pIncr.X5) != 0 {
func() {
if _eMode != i32(2) && _eMode != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88241), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbePmaReaderIncrMergeInitØ00__func__Ø000))), unsafe.Pointer(str(87682)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeIncrPopulate(tls, _pIncr)
}
if (_rc == i32(0)) && (i32(0) != 0 || (_eMode != i32(1))) {
_rc = _vdbePmaReaderNext(tls, _pReadr)
}
return _rc
}
// Initialize the MergeEngine object passed as the second argument. Once this
// function returns, the first key of merged data may be read from the
// MergeEngine object in the usual fashion.
//
// If argument eMode is INCRINIT_ROOT, then it is assumed that any IncrMerge
// objects attached to the PmaReader objects that the merger reads from have
// already been populated, but that they have not yet populated aFile[0] and
// set the PmaReader objects up to read from it. In this case all that is
// required is to call vdbePmaReaderNext() on each PmaReader to point it at
// its first key.
//
// Otherwise, if eMode is any value other than INCRINIT_ROOT, then use
// vdbePmaReaderIncrMergeInit() to initialize each PmaReader that feeds data
// to pMerger.
//
// SQLITE_OK is returned if successful, or an SQLite error code otherwise.
func _vdbeMergeEngineInit(tls *crt.TLS, _pTask *XSortSubtask, _pMerger *XMergeEngine, _eMode int32) (r0 int32) {
var _rc, _i, _nTree int32
_rc = i32(0)
_nTree = _pMerger.X0
i32(0)
func() {
if (*XSortSubtask)(_pMerger.X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88133), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMergeEngineInitØ00__func__Ø000))), unsafe.Pointer(str(87727)))
crt.X__builtin_abort(tls)
}
}()
*(**XSortSubtask)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMerger.X1))))) = _pTask
_i = i32(0)
_2:
if _i >= _nTree {
goto _5
}
if i32(1) != 0 && (_eMode == i32(2)) {
_rc = _vdbePmaReaderNext(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+52*uintptr((_nTree-_i)-i32(1)))))
goto _8
}
_rc = _vdbePmaReaderIncrInit(tls, (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3)+52*uintptr(_i))), i32(0))
_8:
if _rc != i32(0) {
return _rc
}
_i += 1
goto _2
_5:
_i = (_pMerger.X0) - i32(1)
_10:
if _i <= i32(0) {
goto _13
}
_vdbeMergeEngineCompare(tls, _pMerger, _i)
_i -= 1
goto _10
_13:
return int32((*XUnpackedRecord)(_pTask.X3).X4)
}
var _vdbeMergeEngineInitØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_vdbeMergeEngineInitØ00__func__Ø000[0], str(87745), 20)
}
// Recompute pMerger->aTree[iOut] by comparing the next keys on the
// two PmaReaders that feed that entry. Neither of the PmaReaders
// are advanced. This routine merely does the comparison.
func _vdbeMergeEngineCompare(tls *crt.TLS, _pMerger *XMergeEngine, _iOut int32) {
var _i1, _i2, _iRes, _5_bCached, _5_res int32
var _p1, _p2 *XPmaReader
var _5_pTask *XSortSubtask
func() {
if _iOut >= (_pMerger.X0) || _iOut <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88048), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000))), unsafe.Pointer(str(87765)))
crt.X__builtin_abort(tls)
}
}()
if _iOut >= ((_pMerger.X0) / i32(2)) {
_i1 = (_iOut - ((_pMerger.X0) / i32(2))) * i32(2)
_i2 = _i1 + i32(1)
goto _4
}
_i1 = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_iOut*i32(2))))
_i2 = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr((_iOut*i32(2))+i32(1))))
_4:
_p1 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(_i1)))
_p2 = (*XPmaReader)(unsafe.Pointer(uintptr(_pMerger.X3) + 52*uintptr(_i2)))
if (*Xsqlite3_file)(_p1.X4) == nil {
_iRes = _i2
goto _8
}
if (*Xsqlite3_file)(_p2.X4) == nil {
_iRes = _i1
goto _8
}
_5_pTask = (*XSortSubtask)(_pMerger.X1)
_5_bCached = i32(0)
func() {
if (*XUnpackedRecord)(_5_pTask.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88069), unsafe.Pointer((*int8)(unsafe.Pointer(&_vdbeMergeEngineCompareØ00__func__Ø000))), unsafe.Pointer(str(87795)))
crt.X__builtin_abort(tls)
}
}()
_5_res = (*(*func(*crt.TLS, *XSortSubtask, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
}{(_5_pTask.X6)})))(tls, _5_pTask, &_5_bCached, (unsafe.Pointer)(_p1.X6), _p1.X3, (unsafe.Pointer)(_p2.X6), _p2.X3)
if _5_res <= i32(0) {
_iRes = _i1
goto _12
}
_iRes = _i2
_12:
_8:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pMerger.X2)) + 4*uintptr(_iOut))) = _iRes
_ = _5_bCached
}
var _vdbeMergeEngineCompareØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_vdbeMergeEngineCompareØ00__func__Ø000[0], str(87815), 23)
}
var _vdbePmaReaderIncrMergeInitØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_vdbePmaReaderIncrMergeInitØ00__func__Ø000[0], str(87838), 27)
}
// Advance to the next element in the sorter.
func _sqlite3VdbeSorterNext(tls *crt.TLS, _db *Xsqlite3, _pCsr *XVdbeCursor, _pbEof *int32) (r0 int32) {
var _rc int32
var _pSorter *XVdbeSorter
var _4_pFree *XSorterRecord
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88635), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
func() {
if (_pSorter.X12) == 0 && ((*XPmaReader)(_pSorter.X4) != nil || (*XMergeEngine)(_pSorter.X5) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88637), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(87865)))
crt.X__builtin_abort(tls)
}
}()
if (_pSorter.X12) == 0 {
goto _6
}
func() {
if (*XPmaReader)(_pSorter.X4) != nil && (*XMergeEngine)(_pSorter.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(87930)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pSorter.X13) != i32(0) && (*XPmaReader)(_pSorter.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(87973)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pSorter.X13) != i32(1) && (*XMergeEngine)(_pSorter.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88641), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(88017)))
crt.X__builtin_abort(tls)
}
}()
if (_pSorter.X13) != 0 {
_rc = _vdbePmaReaderNext(tls, (*XPmaReader)(_pSorter.X4))
*_pbEof = bool2int((*Xsqlite3_file)((*XPmaReader)(_pSorter.X4).X4) == nil)
goto _17
}
func() {
if (*XMergeEngine)(_pSorter.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88649), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(88061)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSortSubtask)((*XMergeEngine)(_pSorter.X5).X1) != (*XSortSubtask)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XSortSubtask)(unsafe.Pointer(&(_pSorter.X17)))))+60*uintptr(i32(0)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(88650), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterNextØ00__func__Ø000))), unsafe.Pointer(str(88081)))
crt.X__builtin_abort(tls)
}
}()
_rc = _vdbeMergeEngineStep(tls, (*XMergeEngine)(_pSorter.X5), _pbEof)
_17:
goto _22
_6:
_4_pFree = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0)
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = (*XSorterRecord)(*(*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_pFree.X1))))))
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_4_pFree.X1))))))) = nil
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
_vdbeSorterRecordFree(tls, _db, _4_pFree)
}
*_pbEof = bool2int((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) == nil)
_rc = i32(0)
_22:
return _rc
}
var _sqlite3VdbeSorterNextØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterNextØ00__func__Ø000[0], str(88127), 22)
}
// Add a record to the sorter.
func _sqlite3VdbeSorterWrite(tls *crt.TLS, _pCsr *XVdbeCursor, _pVal *XMem) (r0 int32) {
var _rc, _bFlush, _nReq, _nPMA, _t, _9_nMin, _10_iListOff, _10_nNew int32
var _10_aNew *uint8
var _pSorter *XVdbeSorter
var _pNew *XSorterRecord
_rc = i32(0)
func() {
if int32(_pCsr.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87790), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000))), unsafe.Pointer(str(57861)))
crt.X__builtin_abort(tls)
}
}()
_pSorter = (*XVdbeSorter)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pCsr.X14))))))
func() {
if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVal.X5)) + 1*uintptr(i32(1))))))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVal.X5))+1*uintptr(i32(1)))))), (*uint32)(unsafe.Pointer(&_t)))
}
}()
if ((_t > i32(0)) && (_t < i32(10))) && (_t != i32(7)) {
{
p := (*uint8)(unsafe.Pointer(&(_pSorter.X16)))
*p = uint8(int32(*p) & i32(1))
sink2 = *p
}
goto _10
}
if (_t > i32(10)) && (_t&i32(1)) != 0 {
{
p := (*uint8)(unsafe.Pointer(&(_pSorter.X16)))
*p = uint8(int32(*p) & i32(2))
sink2 = *p
}
goto _10
}
*(*uint8)(unsafe.Pointer(&(_pSorter.X16))) = uint8(i32(0))
_10:
func() {
if _pSorter == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000))), unsafe.Pointer(str(86043)))
crt.X__builtin_abort(tls)
}
}()
_nReq = int32(uint32(_pVal.X4) + u32(8))
_nPMA = (_pVal.X4) + _sqlite3VarintLen(tls, uint64(_pVal.X4))
if (_pSorter.X1) == 0 {
goto _13
}
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) != nil {
_bFlush = bool2int((_pSorter.X10) != 0 && (((_pSorter.X10) + _nReq) > (_pSorter.X1)))
goto _16
}
_bFlush = bool2int((((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2) > (_pSorter.X1)) || ((((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2) > (_pSorter.X0)) && _sqlite3HeapNearlyFull(tls) != 0))
_16:
if _bFlush != 0 {
_rc = _vdbeSorterFlushPMA(tls, _pSorter)
*(*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pSorter.X10))) = i32(0)
func() {
if _rc == i32(0) && (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(87834), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSorterWriteØ00__func__Ø000))), unsafe.Pointer(str(88149)))
crt.X__builtin_abort(tls)
}
}()
}
_13:
{
p := (*int32)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X2)))
*p = (*p) + _nPMA
sink1 = *p
}
if _nPMA > (_pSorter.X2) {
*(*int32)(unsafe.Pointer(&(_pSorter.X2))) = _nPMA
}
if ((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1) == nil {
goto _24
}
_9_nMin = (_pSorter.X10) + _nReq
if _9_nMin <= (_pSorter.X11) {
goto _25
}
_10_iListOff = int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) / 1)
_10_nNew = (_pSorter.X11) * i32(2)
_26:
if _10_nNew < _9_nMin {
_10_nNew = _10_nNew * i32(2)
goto _26
}
if _10_nNew > (_pSorter.X1) {
_10_nNew = _pSorter.X1
}
if _10_nNew < _9_nMin {
_10_nNew = _9_nMin
}
_10_aNew = (*uint8)(_sqlite3Realloc(tls, (unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1), uint64(_10_nNew)))
if _10_aNew == nil {
return _sqlite3NomemError(tls, i32(87855))
}
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_10_aNew)) + 1*uintptr(_10_iListOff)))))
*(**uint8)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) = _10_aNew
*(*int32)(unsafe.Pointer(&(_pSorter.X11))) = _10_nNew
_25:
_pNew = (*XSorterRecord)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1)) + 1*uintptr(_pSorter.X10)))))
{
p := (*int32)(unsafe.Pointer(&(_pSorter.X10)))
*p = (*p) + ((_nReq + i32(7)) & i32(-8))
sink1 = *p
}
if (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0) != nil {
*(*int32)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_pNew.X1))))) = int32((uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer((*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) - uintptr(unsafe.Pointer((*t47)(unsafe.Pointer(&(_pSorter.X9))).X1))) / 1)
}
goto _32
_24:
_pNew = (*XSorterRecord)(_sqlite3Malloc(tls, uint64(_nReq)))
if _pNew == nil {
return _sqlite3NomemError(tls, i32(87869))
}
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t48)(unsafe.Pointer(&(_pNew.X1))))))) = (*XSorterRecord)((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0)
_32:
crt.Xmemcpy(tls, (unsafe.Pointer)((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer(_pNew))+uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((*XSorterRecord)(unsafe.Pointer(uintptr(8)))))))))))), (unsafe.Pointer)(_pVal.X5), uint32(_pVal.X4))
*(*int32)(unsafe.Pointer(&(_pNew.X0))) = _pVal.X4
*(**XSorterRecord)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t47)(unsafe.Pointer(&(_pSorter.X9))).X0))))) = _pNew
return _rc
}
var _sqlite3VdbeSorterWriteØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSorterWriteØ00__func__Ø000[0], str(88189), 23)
}
// pCur points at an index entry created using the OP_MakeRecord opcode.
// Read the rowid (the last field in the record) and store it in *rowid.
// Return SQLITE_OK if everything works, or an error code otherwise.
//
// pCur might be pointing to text obtained from a corrupt database file.
// So the content cannot be trusted. Do appropriate checks on the content.
func _sqlite3VdbeIdxRowid(tls *crt.TLS, _db *Xsqlite3, _pCur *XBtCursor, _rowid *int64) (r0 int32) {
var _rc int32
var _nCellKey int64
var _szHdr, _typeRowid, _lenRowid uint32
var _m, _v XMem
_nCellKey = i64(0)
func() {
if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75814), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000))), unsafe.Pointer(str(77407)))
crt.X__builtin_abort(tls)
}
}()
_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
func() {
if (uint64(_nCellKey) & u64(4294967295)) != uint64(_nCellKey) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75816), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIdxRowidØ00__func__Ø000))), unsafe.Pointer(str(88212)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemInit(tls, &_m, _db, uint16(i32(0)))
_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, uint32(i32(0)), uint32(_nCellKey), &_m)
if _rc != 0 {
return _rc
}
func() {
if int32(*(*uint8)(unsafe.Pointer(_m.X5))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer(_m.X5)), &_szHdr)
}
}()
if (_szHdr < uint32(i32(3))) || (int32(_szHdr) > (_m.X4)) {
goto _idx_rowid_corruption
}
func() {
if int32(*(*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5)) + 1*uintptr(_szHdr-uint32(i32(1)))))))) >= int32(u8(128)) {
_sqlite3GetVarint32(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5))+1*uintptr(_szHdr-uint32(i32(1))))))), &_typeRowid)
}
}()
if ((_typeRowid < uint32(i32(1))) || (_typeRowid > uint32(i32(9)))) || (_typeRowid == uint32(i32(7))) {
goto _idx_rowid_corruption
}
_lenRowid = uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SmallTypeSizes)) + 1*uintptr(_typeRowid))))
if uint32(_m.X4) < (_szHdr + _lenRowid) {
goto _idx_rowid_corruption
}
_sqlite3VdbeSerialGet(tls, (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_m.X5))+1*uintptr(uint32(_m.X4)-_lenRowid))))), _typeRowid, &_v)
*_rowid = *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_v.X0)))))
_sqlite3VdbeMemRelease(tls, &_m)
return i32(0)
_idx_rowid_corruption:
_sqlite3VdbeMemRelease(tls, &_m)
return _sqlite3CorruptError(tls, i32(75864))
_ = _m
_ = _v
panic(0)
}
var _sqlite3VdbeIdxRowidØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeIdxRowidØ00__func__Ø000[0], str(88255), 20)
}
// Compare the key of the index entry that cursor pC is pointing to against
// the key string in pUnpacked. Write into *pRes a number
// that is negative, zero, or positive if pC is less than, equal to,
// or greater than pUnpacked. Return SQLITE_OK on success.
//
// pUnpacked is either created without a rowid or is truncated so that it
// omits the rowid at the end. The rowid at the end of the index entry
// is ignored as well. Hence, this routine only compares the prefixes
// of the keys prior to the final rowid, not the entire key.
func _sqlite3VdbeIdxKeyCompare(tls *crt.TLS, _db *Xsqlite3, _pC *XVdbeCursor, _pUnpacked *XUnpackedRecord, _res *int32) (r0 int32) {
var _rc int32
var _nCellKey int64
var _m XMem
var _pCur *XBtCursor
_nCellKey = i64(0)
func() {
if int32(_pC.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75889), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000))), unsafe.Pointer(str(65779)))
crt.X__builtin_abort(tls)
}
}()
_pCur = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_pC.X14))))))
func() {
if _sqlite3BtreeCursorIsValid(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75891), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeIdxKeyCompareØ00__func__Ø000))), unsafe.Pointer(str(77407)))
crt.X__builtin_abort(tls)
}
}()
_nCellKey = int64(_sqlite3BtreePayloadSize(tls, _pCur))
if (_nCellKey <= int64(i32(0))) || (_nCellKey > int64(i32(2147483647))) {
*_res = i32(0)
return _sqlite3CorruptError(tls, i32(75897))
}
_sqlite3VdbeMemInit(tls, &_m, _db, uint16(i32(0)))
_rc = _sqlite3VdbeMemFromBtree(tls, _pCur, uint32(i32(0)), uint32(_nCellKey), &_m)
if _rc != 0 {
return _rc
}
*_res = _sqlite3VdbeRecordCompare(tls, _m.X4, (unsafe.Pointer)(_m.X5), _pUnpacked)
_sqlite3VdbeMemRelease(tls, &_m)
return i32(0)
_ = _m
panic(0)
}
var _sqlite3VdbeIdxKeyCompareØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeIdxKeyCompareØ00__func__Ø000[0], str(88275), 25)
}
func _sqlite3BtreeDropTable(tls *crt.TLS, _p *XBtree, _iTable int32, _piMoved *int32) (r0 int32) {
var _rc int32
_sqlite3BtreeEnter(tls, _p)
_rc = _btreeDropTable(tls, _p, uint32(_iTable), _piMoved)
_sqlite3BtreeLeave(tls, _p)
return _rc
}
// Erase all information in a table and add the root of the table to
// the freelist. Except, the root of the principle table (the one on
// page 1) is never added to the freelist.
//
// This routine will fail with SQLITE_LOCKED if there are any open
// cursors on the table.
//
// If AUTOVACUUM is enabled and the page at iTable is not the last
// root page in the database file, then the last root page
// in the database file is moved into the slot formerly occupied by
// iTable and that last slot formerly occupied by the last root page
// is added to the freelist instead of iTable. In this say, all
// root pages are kept at the beginning of the database file, which
// is necessary for AUTOVACUUM to work right. *piMoved is set to the
// page number that used to be the last root page in the file before
// the move. If no page gets moved, *piMoved is set to 0.
// The last root page is recorded in meta[3] and the value of
// meta[3] is updated by this procedure.
func _btreeDropTable(tls *crt.TLS, _p *XBtree, _iTable uint32, _piMoved *int32) (r0 int32) {
var _rc int32
var _2_maxRootPgno uint32
var _pBt *XBtShared
var _pPage, _5_pMove *XMemPage
_pPage = nil
_pBt = (*XBtShared)(_p.X1)
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67751), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeDropTableØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67752), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeDropTableØ00__func__Ø000))), unsafe.Pointer(str(77829)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iTable < uint32(i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67753), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeDropTableØ00__func__Ø000))), unsafe.Pointer(str(88300)))
crt.X__builtin_abort(tls)
}
}()
_rc = _btreeGetPage(tls, _pBt, _iTable, &_pPage, i32(0))
if _rc != 0 {
return _rc
}
_rc = _sqlite3BtreeClearTable(tls, _p, int32(_iTable), nil)
if _rc != 0 {
_releasePage(tls, _pPage)
return _rc
}
*_piMoved = i32(0)
if (_pBt.X5) == 0 {
goto _8
}
_sqlite3BtreeGetMeta(tls, _p, i32(4), &_2_maxRootPgno)
if _iTable != _2_maxRootPgno {
goto _9
}
_freePage(tls, _pPage, &_rc)
_releasePage(tls, _pPage)
if _rc != i32(0) {
return _rc
}
goto _11
_9:
_releasePage(tls, _pPage)
_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, i32(0))
if _rc != i32(0) {
return _rc
}
_rc = _relocatePage(tls, _pBt, _5_pMove, uint8(i32(1)), uint32(i32(0)), _iTable, i32(0))
_releasePage(tls, _5_pMove)
if _rc != i32(0) {
return _rc
}
_5_pMove = nil
_rc = _btreeGetPage(tls, _pBt, _2_maxRootPgno, &_5_pMove, i32(0))
_freePage(tls, _5_pMove, &_rc)
_releasePage(tls, _5_pMove)
if _rc != i32(0) {
return _rc
}
*_piMoved = int32(_2_maxRootPgno)
_11:
_2_maxRootPgno -= 1
_15:
if (_2_maxRootPgno == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1)))) || (_ptrmapPageno(tls, _pBt, _2_maxRootPgno) == _2_maxRootPgno) {
_2_maxRootPgno -= 1
goto _15
}
func() {
if _2_maxRootPgno == ((uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67818), unsafe.Pointer((*int8)(unsafe.Pointer(&_btreeDropTableØ00__func__Ø000))), unsafe.Pointer(str(88310)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeUpdateMeta(tls, _p, i32(4), _2_maxRootPgno)
goto _20
_8:
_freePage(tls, _pPage, &_rc)
_releasePage(tls, _pPage)
_20:
return _rc
}
var _btreeDropTableØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_btreeDropTableØ00__func__Ø000[0], str(88346), 15)
}
// 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 _sqlite3BtreeClearTable(tls *crt.TLS, _p *XBtree, _iTable int32, _pnChange *int32) (r0 int32) {
var _rc int32
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
func() {
if int32(_p.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67702), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeClearTableØ00__func__Ø000))), unsafe.Pointer(str(77829)))
crt.X__builtin_abort(tls)
}
}()
_rc = _saveAllCursors(tls, _pBt, uint32(_iTable), nil)
if i32(0) == _rc {
_invalidateIncrblobCursors(tls, _p, uint32(_iTable), int64(i32(0)), i32(1))
_rc = _clearDatabasePage(tls, _pBt, uint32(_iTable), i32(0), _pnChange)
}
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeClearTableØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeClearTableØ00__func__Ø000[0], str(88361), 23)
}
// Erase the given database page and all its children. Return
// the page to the freelist.
func _clearDatabasePage(tls *crt.TLS, _pBt *XBtShared, _pgno uint32, _freePageFlag int32, _pnChange *int32) (r0 int32) {
var _rc, _i, _hdr int32
var _pCell *uint8
var _info XCellInfo
var _pPage *XMemPage
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pBt.X21)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(67644), unsafe.Pointer((*int8)(unsafe.Pointer(&_clearDatabasePageØ00__func__Ø000))), unsafe.Pointer(str(9280)))
crt.X__builtin_abort(tls)
}
}()
if _pgno > _btreePagecount(tls, _pBt) {
return _sqlite3CorruptError(tls, i32(67646))
}
_rc = _getAndInitPage(tls, _pBt, _pgno, &_pPage, nil, i32(0))
if _rc != 0 {
return _rc
}
if (_pPage.X1) != 0 {
_rc = _sqlite3CorruptError(tls, i32(67651))
goto _cleardatabasepage_out
}
*(*uint8)(unsafe.Pointer(&(_pPage.X1))) = uint8(i32(1))
_hdr = int32(_pPage.X6)
_i = i32(0)
_5:
if _i >= int32(_pPage.X14) {
goto _8
}
_pCell = (*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pPage.X19)) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(int32(_pPage.X15)&((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPage.X21))+1*uintptr(i32(2)*_i))))) + 1*uintptr(i32(0)))))<= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100357), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _zTabName == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100358), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000))), unsafe.Pointer(str(88451)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100359), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTableØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
_p = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X2))), _zTabName, nil))
_sqlite3DeleteTable(tls, _db, _p)
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
}
var _sqlite3UnlinkAndDeleteTableØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTableØ00__func__Ø000[0], str(88460), 28)
}
// For the index called zIdxName which is found in the database iDb,
// unlike that index from its Table then remove the index from
// the index hash table and free all memory structures associated
// with the index.
func _sqlite3UnlinkAndDeleteIndex(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zIdxName *int8) {
var _pHash *XHash
var _pIndex, _3_p *XIndex
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_pHash = (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X3)))
_pIndex = (*XIndex)(_sqlite3HashInsert(tls, _pHash, _zIdxName, nil))
if func() int32 {
if _pIndex != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100163), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _4
}
if (*XIndex)((*XTable)(_pIndex.X3).X2) == _pIndex {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XTable)(_pIndex.X3).X2))))) = (*XIndex)(_pIndex.X5)
goto _6
}
_3_p = (*XIndex)((*XTable)(_pIndex.X3).X2)
_7:
if func() int32 {
if _3_p != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100171), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && ((*XIndex)(_3_p.X5) != _pIndex) {
_3_p = (*XIndex)(_3_p.X5)
goto _7
}
if func() int32 {
if (_3_p != nil) && ((*XIndex)(_3_p.X5) == _pIndex) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100172), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_p.X5))))) = (*XIndex)(_pIndex.X5)
}
_6:
_freeIndex(tls, _db, _pIndex)
_4:
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
}
var _sqlite3UnlinkAndDeleteIndexØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteIndexØ00__func__Ø000[0], str(88488), 28)
}
// Remove a trigger from the hash tables of the sqlite* pointer.
func _sqlite3UnlinkAndDeleteTrigger(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zName *int8) {
var _pHash *XHash
var _pTrigger *XTrigger
var _2_pTab *XTable
var _2_pp **XTrigger
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123220), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_pHash = (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X4)))
_pTrigger = (*XTrigger)(_sqlite3HashInsert(tls, _pHash, _zName, nil))
if func() int32 {
if _pTrigger != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123223), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _4
}
if (*XSchema)(_pTrigger.X6) != (*XSchema)(_pTrigger.X7) {
goto _5
}
_2_pTab = _tableOfTrigger(tls, _pTrigger)
_2_pp = (**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pTab.X19)))))
_6:
if (*_2_pp) == _pTrigger {
goto _9
}
_2_pp = (**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_2_pp).X9)))))
goto _6
_9:
*_2_pp = (*XTrigger)((*_2_pp).X9)
_5:
_sqlite3DeleteTrigger(tls, _db, _pTrigger)
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
_4:
}
var _sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3UnlinkAndDeleteTriggerØ00__func__Ø000[0], str(88516), 30)
}
// Return a pointer to the Table structure for the table that a trigger
// is set on.
func _tableOfTrigger(tls *crt.TLS, _pTrigger *XTrigger) (r0 *XTable) {
return (*XTable)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTrigger.X7).X2))), _pTrigger.X1))
}
// 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.
func _sqlite3BtreeIntegrityCheck(tls *crt.TLS, _p *XBtree, _aRoot *int32, _nRoot int32, _mxErr int32, _pnErr *int32) (r0 *int8) {
var _savedDbFlags, _nRef int32
var _4_notUsed int64
var _i uint32
var _zErr [100]int8
var _pBt *XBtShared
var _sCheck XIntegrityCk
_pBt = (*XBtShared)(_p.X1)
_savedDbFlags = (*Xsqlite3)(_pBt.X1).X6
_sqlite3BtreeEnter(tls, _p)
func() {
if int32(_p.X2) <= i32(0) || int32(_pBt.X8) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68515), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000))), unsafe.Pointer(str(88546)))
crt.X__builtin_abort(tls)
}
}()
_nRef = _sqlite3PagerRefcount(tls, (*XPager)(_pBt.X0))
func() {
if _nRef < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68517), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000))), unsafe.Pointer(str(88601)))
crt.X__builtin_abort(tls)
}
}()
*(**XBtShared)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCheck.X0))))) = _pBt
*(**XPager)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCheck.X1))))) = (*XPager)(_pBt.X0)
*(*uint32)(unsafe.Pointer(&(_sCheck.X3))) = _btreePagecount(tls, (*XBtShared)(_sCheck.X0))
*(*int32)(unsafe.Pointer(&(_sCheck.X4))) = _mxErr
*(*int32)(unsafe.Pointer(&(_sCheck.X5))) = i32(0)
*(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(0)
*(**int8)(unsafe.Pointer(&(_sCheck.X7))) = nil
*(*int32)(unsafe.Pointer(&(_sCheck.X8))) = i32(0)
*(*int32)(unsafe.Pointer(&(_sCheck.X9))) = i32(0)
*(**uint8)(unsafe.Pointer(&(_sCheck.X2))) = nil
*(**uint32)(unsafe.Pointer(&(_sCheck.X11))) = nil
_sqlite3StrAccumInit(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))), nil, (*int8)(unsafe.Pointer(&_zErr)), int32(u32(100)), i32(1000000000))
*(*uint8)(unsafe.Pointer(&((*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))).X7))) = uint8(i32(1))
if (_sCheck.X3) == uint32(i32(0)) {
goto _integrity_ck_cleanup
}
*(**uint8)(unsafe.Pointer(&(_sCheck.X2))) = (*uint8)(_sqlite3MallocZero(tls, uint64(((_sCheck.X3)/uint32(i32(8)))+uint32(i32(1)))))
if (_sCheck.X2) == nil {
*(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(1)
goto _integrity_ck_cleanup
}
*(**uint32)(unsafe.Pointer(&(_sCheck.X11))) = (*uint32)(_sqlite3PageMalloc(tls, int32(_pBt.X15)))
if (_sCheck.X11) == nil {
*(*int32)(unsafe.Pointer(&(_sCheck.X6))) = i32(1)
goto _integrity_ck_cleanup
}
_i = (uint32(_sqlite3PendingByte) / (_pBt.X15)) + uint32(i32(1))
if _i <= (_sCheck.X3) {
_setPageReferenced(tls, &_sCheck, _i)
}
*(**int8)(unsafe.Pointer(&(_sCheck.X7))) = str(88609)
_checkList(tls, &_sCheck, i32(1), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(32)))))), int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))))))
*(**int8)(unsafe.Pointer(&(_sCheck.X7))) = nil
{
p := (*int32)(unsafe.Pointer(&((*Xsqlite3)(_pBt.X1).X6)))
*p = (*p) & i32(-536870913)
sink1 = *p
}
_i = uint32(i32(0))
_9:
if int32(_i) >= _nRoot || (_sCheck.X4) == 0 {
goto _13
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))) == i32(0) {
goto _10
}
if ((_pBt.X5) != 0) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))) > i32(1)) {
_checkPtrmap(tls, &_sCheck, uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i)))), uint8(i32(1)), uint32(i32(0)))
}
_checkTreePage(tls, &_sCheck, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRoot)) + 4*uintptr(_i))), &_4_notUsed, i64(9223372036854775807))
_10:
_i += 1
goto _9
_13:
*(*int32)(unsafe.Pointer(&((*Xsqlite3)(_pBt.X1).X6))) = _savedDbFlags
_i = uint32(i32(1))
_17:
if _i > (_sCheck.X3) || (_sCheck.X4) == 0 {
goto _integrity_ck_cleanup
}
if (_getPageReferenced(tls, &_sCheck, _i) == i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) != _i) || ((_pBt.X5) == 0)) {
_checkAppendMsg(tls, &_sCheck, str(88625), _i)
}
if (_getPageReferenced(tls, &_sCheck, _i) != i32(0)) && ((_ptrmapPageno(tls, _pBt, _i) == _i) && ((_pBt.X5) != 0)) {
_checkAppendMsg(tls, &_sCheck, str(88647), _i)
}
_i += 1
goto _17
_integrity_ck_cleanup:
_sqlite3PageFree(tls, (unsafe.Pointer)(_sCheck.X11))
Xsqlite3_free(tls, (unsafe.Pointer)(_sCheck.X2))
if (_sCheck.X6) != 0 {
_sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))))
*(*int32)(unsafe.Pointer(&(_sCheck.X5))) += 1
}
*_pnErr = _sCheck.X5
if (_sCheck.X5) == i32(0) {
_sqlite3StrAccumReset(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))))
}
func() {
if _nRef != _sqlite3PagerRefcount(tls, (*XPager)(_pBt.X0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68606), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIntegrityCheckØ00__func__Ø000))), unsafe.Pointer(str(88681)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeLeave(tls, _p)
return _sqlite3StrAccumFinish(tls, (*XStrAccum)(unsafe.Pointer(&(_sCheck.X10))))
_ = _sCheck
_ = _zErr
_ = _4_notUsed
panic(0)
}
var _sqlite3BtreeIntegrityCheckØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIntegrityCheckØ00__func__Ø000[0], str(88721), 27)
}
// Set the bit in the IntegrityCk.aPgRef[] array that corresponds to page iPg.
func _setPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) {
func() {
if _iPg > (_pCheck.X3) || i32(1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68037), unsafe.Pointer((*int8)(unsafe.Pointer(&_setPageReferencedØ00__func__Ø000))), unsafe.Pointer(str(88748)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8)))))
*p = uint8(int32(*p) | (i32(1) << uint(int32(_iPg&uint32(i32(7))))))
sink2 = *p
}
}
var _setPageReferencedØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_setPageReferencedØ00__func__Ø000[0], str(88799), 18)
}
// Check the integrity of the freelist or of an overflow page list.
// Verify that the number of pages on the list is N.
func _checkList(tls *crt.TLS, _pCheck *XIntegrityCk, _isFreeList int32, _iPage int32, _N int32) {
var _i, _expected, _iFirst, _4_n int32
var _8_iFreePage uint32
var _1_pOvflData *uint8
var _1_pOvflPage *XPgHdr
_expected = _N
_iFirst = _iPage
_0:
if postInc1(&_N, int32(-1)) <= i32(0) || (_pCheck.X4) == 0 {
goto _1
}
if _iPage < i32(1) {
_checkAppendMsg(tls, _pCheck, str(88817), _N+i32(1), _expected, _iFirst)
goto _1
}
if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
goto _1
}
if _sqlite3PagerGet(tls, (*XPager)(_pCheck.X1), uint32(_iPage), &_1_pOvflPage, i32(0)) != 0 {
_checkAppendMsg(tls, _pCheck, str(88874), _iPage)
goto _1
}
_1_pOvflData = (*uint8)(_sqlite3PagerGetData(tls, _1_pOvflPage))
if _isFreeList == 0 {
goto _6
}
_4_n = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOvflData))+1*uintptr(i32(4))))))
if ((*XBtShared)(_pCheck.X0).X5) != 0 {
_checkPtrmap(tls, _pCheck, uint32(_iPage), uint8(i32(2)), uint32(i32(0)))
}
if _4_n > ((int32((*XBtShared)(_pCheck.X0).X16) / i32(4)) - i32(2)) {
_checkAppendMsg(tls, _pCheck, str(88896), _iPage)
_N -= 1
goto _9
}
_i = i32(0)
_10:
if _i >= _4_n {
goto _13
}
_8_iFreePage = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOvflData))+1*uintptr(i32(8)+(_i*i32(4))))))
if ((*XBtShared)(_pCheck.X0).X5) != 0 {
_checkPtrmap(tls, _pCheck, _8_iFreePage, uint8(i32(2)), uint32(i32(0)))
}
_checkRef(tls, _pCheck, _8_iFreePage)
_i += 1
goto _10
_13:
{
p := &_N
*p = (*p) - _4_n
sink1 = *p
}
_9:
goto _15
_6:
if (((*XBtShared)(_pCheck.X0).X5) != 0) && (_N > i32(0)) {
_i = int32(_sqlite3Get4byte(tls, _1_pOvflData))
_checkPtrmap(tls, _pCheck, uint32(_i), uint8(i32(4)), uint32(_iPage))
}
_15:
_iPage = int32(_sqlite3Get4byte(tls, _1_pOvflData))
_sqlite3PagerUnref(tls, _1_pOvflPage)
if _isFreeList != 0 && (_N < bool2int(_iPage != i32(0))) {
_checkAppendMsg(tls, _pCheck, str(88935))
}
goto _0
_1:
}
// Append a message to the error message string.
func _checkAppendMsg(tls *crt.TLS, _pCheck *XIntegrityCk, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
if (_pCheck.X4) == 0 {
return
}
*(*int32)(unsafe.Pointer(&(_pCheck.X4))) -= 1
*(*int32)(unsafe.Pointer(&(_pCheck.X5))) += 1
_ap = args
if ((*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))).X3) != 0 {
_sqlite3StrAccumAppend(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), str(37700), i32(1))
}
if (_pCheck.X7) != nil {
_sqlite3XPrintf(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), _pCheck.X7, _pCheck.X8, _pCheck.X9)
}
_sqlite3VXPrintf(tls, (*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))), _zFormat, _ap)
_ap = nil
if int32((*XStrAccum)(unsafe.Pointer(&(_pCheck.X10))).X6) == i32(1) {
*(*int32)(unsafe.Pointer(&(_pCheck.X6))) = i32(1)
}
}
// Add 1 to the reference count for page iPage. If this is the second
// reference to the page, add an error message to pCheck->zErrMsg.
// Return 1 if there are 2 or more references to the page and 0 if
// if this is the first reference to the page.
//
// Also check that the page number is in bounds.
func _checkRef(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage uint32) (r0 int32) {
if _iPage == uint32(i32(0)) {
return i32(1)
}
if _iPage > (_pCheck.X3) {
_checkAppendMsg(tls, _pCheck, str(88974), _iPage)
return i32(1)
}
if _getPageReferenced(tls, _pCheck, _iPage) != 0 {
_checkAppendMsg(tls, _pCheck, str(88997), _iPage)
return i32(1)
}
_setPageReferenced(tls, _pCheck, _iPage)
return i32(0)
}
// Return non-zero if the bit in the IntegrityCk.aPgRef[] array that
// corresponds to page iPg is already set.
func _getPageReferenced(tls *crt.TLS, _pCheck *XIntegrityCk, _iPg uint32) (r0 int32) {
func() {
if _iPg > (_pCheck.X3) || i32(1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68029), unsafe.Pointer((*int8)(unsafe.Pointer(&_getPageReferencedØ00__func__Ø000))), unsafe.Pointer(str(88748)))
crt.X__builtin_abort(tls)
}
}()
return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCheck.X2)) + 1*uintptr(_iPg/uint32(i32(8)))))) & (i32(1) << uint(int32(_iPg&uint32(i32(7)))))
}
var _getPageReferencedØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_getPageReferencedØ00__func__Ø000[0], str(89022), 18)
}
// Check that the entry in the pointer-map for page iChild maps to
// page iParent, pointer type ptrType. If not, append an error message
// to pCheck.
func _checkPtrmap(tls *crt.TLS, _pCheck *XIntegrityCk, _iChild uint32, _eType uint8, _iParent uint32) {
var _rc int32
var _iPtrmapParent uint32
var _ePtrmapType uint8
_rc = _ptrmapGet(tls, (*XBtShared)(_pCheck.X0), _iChild, &_ePtrmapType, &_iPtrmapParent)
if _rc == i32(0) {
goto _0
}
if (_rc == i32(7)) || (_rc == i32(3082)) {
*(*int32)(unsafe.Pointer(&(_pCheck.X6))) = i32(1)
}
_checkAppendMsg(tls, _pCheck, str(89040), _iChild)
return
_0:
if (int32(_ePtrmapType) != int32(_eType)) || (_iPtrmapParent != _iParent) {
_checkAppendMsg(tls, _pCheck, str(89069), _iChild, int32(_eType), _iParent, int32(_ePtrmapType), _iPtrmapParent)
}
}
// Do various sanity checks on a single page of a tree. Return
// the tree depth. Root pages return 0. Parents of root pages
// return 1, and so forth.
//
// These checks are done:
//
// 1. Make sure that cells and freeblocks do not overlap
// but combine to completely cover the page.
// 2. Make sure integer cell keys are in order.
// 3. Check the integrity of overflow pages.
// 4. Recursively call checkTreePage on all children.
// 5. Verify that the depth of all children is the same.
func _checkTreePage(tls *crt.TLS, _pCheck *XIntegrityCk, _iPage int32, _piMinKey *int64, _maxKey int64) (r0 int32) {
var _i, _rc, _depth, _d2, _pgno, _nFrag, _hdr, _cellStart, _nCell, _doCoverageCheck, _keyCanBeEqual, _saved_v1, _saved_v2, _11_nPage, _20_size, _20_j int32
var _pc, _usableSize, _contentOffset, _x, _prev, _11_pgnoOvfl, _19_size uint32
var _saved_zPfx *int8
var _savedIsInit uint8
var _data, _pCell, _pCellIdx *uint8
var _heap *uint32
var _pBt *XBtShared
var _6_info XCellInfo
var _pPage *XMemPage
_pPage = nil
_depth = i32(-1)
_doCoverageCheck = i32(1)
_keyCanBeEqual = i32(1)
_heap = nil
_prev = u32(0)
_saved_zPfx = _pCheck.X7
_saved_v1 = _pCheck.X8
_saved_v2 = _pCheck.X9
_savedIsInit = u8(0)
_pBt = (*XBtShared)(_pCheck.X0)
_usableSize = _pBt.X16
if _iPage == i32(0) {
return i32(0)
}
if _checkRef(tls, _pCheck, uint32(_iPage)) != 0 {
return i32(0)
}
*(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89123)
*(*int32)(unsafe.Pointer(&(_pCheck.X8))) = _iPage
if store1(&_rc, _btreeGetPage(tls, _pBt, uint32(_iPage), &_pPage, i32(0))) != i32(0) {
_checkAppendMsg(tls, _pCheck, str(89133), _rc)
goto _end_of_check
}
_savedIsInit = _pPage.X0
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = uint8(i32(0))
if store1(&_rc, _btreeInitPage(tls, _pPage)) != i32(0) {
func() {
if _rc != i32(11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68286), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89171)))
crt.X__builtin_abort(tls)
}
}()
_checkAppendMsg(tls, _pCheck, str(89190), _rc)
goto _end_of_check
}
_data = _pPage.X19
_hdr = int32(_pPage.X6)
*(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89228)
_contentOffset = uint32(((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(5)))))) + 1*uintptr(i32(1)))))) - i32(1)) & i32(65535)) + i32(1))
func() {
if _contentOffset > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68297), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89254)))
crt.X__builtin_abort(tls)
}
}()
_nCell = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(3)))))) + 1*uintptr(i32(1)))))
func() {
if int32(_pPage.X14) != _nCell {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68302), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89280)))
crt.X__builtin_abort(tls)
}
}()
_cellStart = (_hdr + i32(12)) - (i32(4) * int32(_pPage.X5))
func() {
if (_pPage.X21) != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68307), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89300)))
crt.X__builtin_abort(tls)
}
}()
_pCellIdx = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_cellStart+(i32(2)*(_nCell-i32(1))))))
if (_pPage.X5) != 0 {
goto _12
}
_pgno = int32(_sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_hdr+i32(8))))))
if (_pBt.X5) != 0 {
*(**int8)(unsafe.Pointer(&(_pCheck.X7))) = str(89334)
_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(i32(5)), uint32(_iPage))
}
_depth = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
_keyCanBeEqual = i32(0)
goto _14
_12:
_heap = _pCheck.X11
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_heap)) + 4*uintptr(i32(0)))) = uint32(i32(0))
_14:
_i = _nCell - i32(1)
_15:
if _i < i32(0) || (_pCheck.X4) == 0 {
goto _19
}
*(*int32)(unsafe.Pointer(&(_pCheck.X9))) = _i
func() {
if _pCellIdx != (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_cellStart+(_i*i32(2))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68335), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89362)))
crt.X__builtin_abort(tls)
}
}()
_pc = uint32((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellIdx)) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCellIdx)) + 1*uintptr(i32(1))))))
{
p := &_pCellIdx
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) - 1*uintptr(i32(2))))
sink13 = *p
}
if (_pc < _contentOffset) || (_pc > (_usableSize - uint32(i32(4)))) {
_checkAppendMsg(tls, _pCheck, str(89395), _pc, _contentOffset, _usableSize-uint32(i32(4)))
_doCoverageCheck = i32(0)
goto _16
}
_pCell = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_pc)))
(*(*func(*crt.TLS, *XMemPage, *uint8, *XCellInfo))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
}{(_pPage.X25)})))(tls, _pPage, _pCell, &_6_info)
if (_pc + uint32(_6_info.X4)) > _usableSize {
_checkAppendMsg(tls, _pCheck, str(89425))
_doCoverageCheck = i32(0)
goto _16
}
if (_pPage.X2) == 0 {
goto _25
}
if func() int32 {
if _keyCanBeEqual != 0 {
return bool2int((_6_info.X0) > _maxKey)
}
return bool2int((_6_info.X0) >= _maxKey)
}() != 0 {
_checkAppendMsg(tls, _pCheck, str(89449), _6_info.X0)
}
_maxKey = _6_info.X0
_keyCanBeEqual = i32(0)
_25:
if (_6_info.X2) <= uint32(_6_info.X3) {
goto _29
}
func() {
if ((_pc + uint32(_6_info.X4)) - uint32(i32(4))) > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68365), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89473)))
crt.X__builtin_abort(tls)
}
}()
_11_nPage = int32(((((_6_info.X2) - uint32(_6_info.X3)) + _usableSize) - uint32(i32(5))) / (_usableSize - uint32(i32(4))))
_11_pgnoOvfl = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCell))+1*uintptr(int32(_6_info.X4)-i32(4)))))
if (_pBt.X5) != 0 {
_checkPtrmap(tls, _pCheck, _11_pgnoOvfl, uint8(i32(3)), uint32(_iPage))
}
_checkList(tls, _pCheck, i32(0), int32(_11_pgnoOvfl), _11_nPage)
_29:
if (_pPage.X5) != 0 {
goto _33
}
_pgno = int32(_sqlite3Get4byte(tls, _pCell))
if (_pBt.X5) != 0 {
_checkPtrmap(tls, _pCheck, uint32(_pgno), uint8(i32(5)), uint32(_iPage))
}
_d2 = _checkTreePage(tls, _pCheck, _pgno, &_maxKey, _maxKey)
_keyCanBeEqual = i32(0)
if _d2 != _depth {
_checkAppendMsg(tls, _pCheck, str(89507))
_depth = _d2
}
goto _36
_33:
_btreeHeapInsert(tls, _heap, (_pc< i32(0) {
func() {
if uint32(_i) > (_usableSize - uint32(i32(4))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68423), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89532)))
crt.X__builtin_abort(tls)
}
}()
_20_size = (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(0))))) << uint(i32(8))) | int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data))+1*uintptr(_i+i32(2)))))) + 1*uintptr(i32(1)))))
func() {
if uint32(_i+_20_size) > _usableSize {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68425), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89553)))
crt.X__builtin_abort(tls)
}
}()
_btreeHeapInsert(tls, _heap, (uint32(_i)< (_usableSize - uint32(i32(4))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68435), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkTreePageØ00__func__Ø000))), unsafe.Pointer(str(89596)))
crt.X__builtin_abort(tls)
}
}()
_i = _20_j
goto _44
}
_nFrag = i32(0)
_prev = _contentOffset - uint32(i32(1))
_55:
if _btreeHeapPull(tls, _heap, &_x) == 0 {
goto _56
}
if (_prev & uint32(i32(65535))) >= (_x >> uint(i32(16))) {
_checkAppendMsg(tls, _pCheck, str(89617), _x>>uint(i32(16)), _iPage)
goto _56
}
{
p := &_nFrag
*p = int32(uint32(*p) + (((_x >> uint(i32(16))) - (_prev & uint32(i32(65535)))) - uint32(i32(1))))
sink1 = *p
}
_prev = _x
goto _55
_56:
{
p := &_nFrag
*p = int32(uint32(*p) + ((_usableSize - (_prev & uint32(i32(65535)))) - uint32(i32(1))))
sink1 = *p
}
if ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_heap)) + 4*uintptr(i32(0))))) == uint32(i32(0))) && (_nFrag != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7)))))) {
_checkAppendMsg(tls, _pCheck, str(89654), _nFrag, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_data)) + 1*uintptr(_hdr+i32(7))))), _iPage)
}
_end_of_check:
if _doCoverageCheck == 0 {
*(*uint8)(unsafe.Pointer(&(_pPage.X0))) = _savedIsInit
}
_releasePage(tls, _pPage)
*(**int8)(unsafe.Pointer(&(_pCheck.X7))) = _saved_zPfx
*(*int32)(unsafe.Pointer(&(_pCheck.X8))) = _saved_v1
*(*int32)(unsafe.Pointer(&(_pCheck.X9))) = _saved_v2
return _depth + i32(1)
_ = _6_info
panic(0)
}
var _checkTreePageØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_checkTreePageØ00__func__Ø000[0], str(89706), 14)
}
// An implementation of a min-heap.
//
// aHeap[0] is the number of elements on the heap. aHeap[1] is the
// root element. The daughter nodes of aHeap[N] are aHeap[N*2]
// and aHeap[N*2+1].
//
// The heap property is this: Every node is less than or equal to both
// of its daughter nodes. A consequence of the heap property is that the
// root node aHeap[1] is always the minimum value currently in the heap.
//
// The btreeHeapInsert() routine inserts an unsigned 32-bit number onto
// the heap, preserving the heap property. The btreeHeapPull() routine
// removes the root element from the heap (the minimum value in the heap)
// and then moves other nodes around as necessary to preserve the heap
// property.
//
// This heap is used for cell overlap and coverage testing. Each u32
// entry represents the span of a cell or freeblock on a btree page.
// The upper 16 bits are the index of the first byte of a range and the
// lower 16 bits are the index of the last byte of that range.
func _btreeHeapInsert(tls *crt.TLS, _aHeap *uint32, _x uint32) {
var _j, _i uint32
_i = preInc5((*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap))+4*uintptr(i32(0)))), uint32(1))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = _x
_0:
if (store5(&_j, _i/uint32(i32(2))) > uint32(i32(0))) && ((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))))) {
_x = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = _x
_i = _j
goto _0
}
}
func _btreeHeapPull(tls *crt.TLS, _aHeap *uint32, _pOut *uint32) (r0 int32) {
var _j, _i, _x uint32
if store5(&_x, *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0))))) == uint32(i32(0)) {
return i32(0)
}
*_pOut = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(1))))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(1)))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_x)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_x))) = u32(4294967295)
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0)))) -= 1
_i = uint32(i32(1))
_1:
if store5(&_j, _i*uint32(i32(2))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(i32(0))))) {
goto _2
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) > (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j+uint32(i32(1)))))) {
_j += 1
}
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i)))) < (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))) {
goto _2
}
_x = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_i))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j)))
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aHeap)) + 4*uintptr(_j))) = _x
_i = _j
goto _1
_2:
return i32(1)
}
// Delete any previous value and set the value of pMem to be an
// empty boolean index.
func _sqlite3VdbeMemSetRowSet(tls *crt.TLS, _pMem *XMem) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_pMem.X9)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70429), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pMem.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70430), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(6728)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemRelease(tls, _pMem)
*(**int8)(unsafe.Pointer(&(_pMem.X6))) = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(i32(64))))
if (_db.X17) != 0 {
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(1))
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = i32(0)
goto _5
}
func() {
if (_pMem.X6) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70437), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(89720)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pMem.X7))) = _sqlite3DbMallocSize(tls, _db, (unsafe.Pointer)(_pMem.X6))
*(**XRowSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0))))))) = _sqlite3RowSetInit(tls, _db, (unsafe.Pointer)(_pMem.X6), uint32(_pMem.X7))
func() {
if (*XRowSet)(*(*unsafe.Pointer)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pMem.X0)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70440), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemSetRowSetØ00__func__Ø000))), unsafe.Pointer(str(89734)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&(_pMem.X1))) = uint16(i32(32))
_5:
}
var _sqlite3VdbeMemSetRowSetØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemSetRowSetØ00__func__Ø000[0], str(89753), 24)
}
// Turn bulk memory into a RowSet object. N bytes of memory
// are available at pSpace. The db pointer is used as a memory context
// for any subsequent allocations that need to occur.
// Return a pointer to the new RowSet object.
//
// It must be the case that N is sufficient to make a Rowset. If not
// an assertion fault occurs.
//
// If N is larger than the minimum, use the surplus as an initial
// allocation of entries available to be filled.
func _sqlite3RowSetInit(tls *crt.TLS, _db *Xsqlite3, _pSpace unsafe.Pointer, _N uint32) (r0 *XRowSet) {
var _p *XRowSet
func() {
if _N < u32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RowSetInitØ00__func__Ø000))), unsafe.Pointer(str(89777)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XRowSet)(_pSpace)
*(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = nil
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _db
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X5))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = (*TRowSetEntry)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(32)))))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p))))))))
*(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16((_N - u32(32)) / u32(16))
*(*uint16)(unsafe.Pointer(&(_p.X7))) = uint16(i32(1))
*(*int32)(unsafe.Pointer(&(_p.X8))) = i32(0)
return _p
}
var _sqlite3RowSetInitØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RowSetInitØ00__func__Ø000[0], str(89801), 18)
}
// Insert a new value into a RowSet.
//
// The mallocFailed flag of the database connection is set if a
// memory allocation fails.
func _sqlite3RowSetInsert(tls *crt.TLS, _p *XRowSet, _rowid int64) {
var _pEntry, _pLast *TRowSetEntry
func() {
if _p == nil || (int32(_p.X7)&i32(2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46475), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RowSetInsertØ00__func__Ø000))), unsafe.Pointer(str(89819)))
crt.X__builtin_abort(tls)
}
}()
_pEntry = _rowSetEntryAlloc(tls, _p)
if _pEntry == nil {
return
}
*(*int64)(unsafe.Pointer(&(_pEntry.X0))) = _rowid
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pEntry.X1))))) = nil
_pLast = (*TRowSetEntry)(_p.X3)
if _pLast == nil {
goto _4
}
if _rowid <= (_pLast.X0) {
{
p := (*uint16)(unsafe.Pointer(&(_p.X7)))
*p = uint16(int32(*p) & i32(-2))
sink14 = *p
}
}
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLast.X1))))) = _pEntry
goto _6
_4:
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pEntry
_6:
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _pEntry
}
var _sqlite3RowSetInsertØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RowSetInsertØ00__func__Ø000[0], str(89857), 20)
}
// Allocate a new RowSetEntry object that is associated with the
// given RowSet. Return a pointer to the new and completely uninitialized
// objected.
//
// In an OOM situation, the RowSet.db->mallocFailed flag is set and this
// routine returns NULL.
func _rowSetEntryAlloc(tls *crt.TLS, _p *XRowSet) (r0 *TRowSetEntry) {
var _1_pNew *TRowSetChunk
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46446), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryAllocØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
if int32(_p.X6) != i32(0) {
goto _2
}
_1_pNew = (*TRowSetChunk)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_p.X1), uint64(u32(1012))))
if _1_pNew == nil {
return nil
}
*(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X0))))) = (*TRowSetChunk)(_p.X0)
*(**TRowSetChunk)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _1_pNew
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = (*TRowSetEntry)(unsafe.Pointer((*[63]TRowSetEntry)(unsafe.Pointer(&(_1_pNew.X1)))))
*(*uint16)(unsafe.Pointer(&(_p.X6))) = uint16(u32(63))
_2:
*(*uint16)(unsafe.Pointer(&(_p.X6))) -= 1
return postInc57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))), 16)
}
var _rowSetEntryAllocØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_rowSetEntryAllocØ00__func__Ø000[0], str(89877), 17)
}
// Extract the smallest element from the RowSet.
// Write the element into *pRowid. Return 1 on success. Return
// 0 if the RowSet is already empty.
//
// After this routine has been called, the sqlite3RowSetInsert()
// routine may not be called again.
//
// This routine may not be called after sqlite3RowSetTest() has
// been used. Older versions of RowSet allowed that, but as the
// capability was not used by the code generator, it was removed
// for code economy.
func _sqlite3RowSetNext(tls *crt.TLS, _p *XRowSet, _pRowid *int64) (r0 int32) {
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46669), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*TRowSetEntry)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46670), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RowSetNextØ00__func__Ø000))), unsafe.Pointer(str(89894)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_p.X7) & i32(2)) != i32(0) {
goto _4
}
if (int32(_p.X7) & i32(1)) == i32(0) {
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _rowSetEntrySort(tls, (*TRowSetEntry)(_p.X2))
}
{
p := (*uint16)(unsafe.Pointer(&(_p.X7)))
*p = uint16(int32(*p) | i32(3))
sink14 = *p
}
_4:
if (*TRowSetEntry)(_p.X2) == nil {
goto _6
}
*_pRowid = (*TRowSetEntry)(_p.X2).X0
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*TRowSetEntry)((*TRowSetEntry)(_p.X2).X1)
if (*TRowSetEntry)(_p.X2) == nil {
_sqlite3RowSetClear(tls, _p)
}
return i32(1)
_6:
return i32(0)
}
var _sqlite3RowSetNextØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RowSetNextØ00__func__Ø000[0], str(89908), 18)
}
func _rowSetEntrySort(tls *crt.TLS, _pIn *TRowSetEntry) (r0 *TRowSetEntry) {
var _i uint32
var _pNext *TRowSetEntry
var _aBucket [40]*TRowSetEntry
crt.Xmemset(tls, (unsafe.Pointer)(&_aBucket), i32(0), u32(160))
_0:
if _pIn == nil {
goto _1
}
_pNext = (*TRowSetEntry)(_pIn.X1)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X1))))) = nil
_i = uint32(i32(0))
_2:
if (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i)))) == nil {
goto _5
}
_pIn = _rowSetEntryMerge(tls, *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i))), _pIn)
*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i))) = nil
_i += 1
goto _2
_5:
*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i))) = _pIn
_pIn = _pNext
goto _0
_1:
_pIn = *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(i32(0))))
_i = uint32(i32(1))
_6:
if _i >= u32(40) {
goto _9
}
if (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i)))) == nil {
goto _7
}
_pIn = func() *TRowSetEntry {
if _pIn != nil {
return _rowSetEntryMerge(tls, _pIn, *(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i))))
}
return (*(**TRowSetEntry)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aBucket)) + 4*uintptr(_i))))
}()
_7:
_i += 1
goto _6
_9:
return _pIn
_ = _aBucket
panic(0)
}
// Merge two lists of RowSetEntry objects. Remove duplicates.
//
// The input lists are connected via pRight pointers and are
// assumed to each already be in sorted order.
func _rowSetEntryMerge(tls *crt.TLS, _pA *TRowSetEntry, _pB *TRowSetEntry) (r0 *TRowSetEntry) {
var _head TRowSetEntry
var _pTail *TRowSetEntry
_pTail = &_head
func() {
if _pA == nil || _pB == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46509), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000))), unsafe.Pointer(str(16619)))
crt.X__builtin_abort(tls)
}
}()
_3:
func() {
if (*TRowSetEntry)(_pA.X1) != nil && (_pA.X0) > ((*TRowSetEntry)(_pA.X1).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46511), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000))), unsafe.Pointer(str(89926)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*TRowSetEntry)(_pB.X1) != nil && (_pB.X0) > ((*TRowSetEntry)(_pB.X1).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46512), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetEntryMergeØ00__func__Ø000))), unsafe.Pointer(str(89964)))
crt.X__builtin_abort(tls)
}
}()
if (_pA.X0) > (_pB.X0) {
goto _12
}
if (_pA.X0) < (_pB.X0) {
_pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))), _pA)
}
_pA = (*TRowSetEntry)(_pA.X1)
if _pA == nil {
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))) = _pB
goto _5
}
goto _15
_12:
_pTail = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))), _pB)
_pB = (*TRowSetEntry)(_pB.X1)
if _pB == nil {
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTail.X1))))) = _pA
goto _5
}
_15:
goto _3
_5:
return (*TRowSetEntry)(_head.X1)
_ = _head
panic(0)
}
var _rowSetEntryMergeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_rowSetEntryMergeØ00__func__Ø000[0], str(90002), 17)
}
// Check to see if element iRowid was inserted into the rowset as
// part of any insert batch prior to iBatch. Return 1 or 0.
//
// If this is the first test of a new batch and if there exist entries
// on pRowSet->pEntry, then sort those entries into the forest at
// pRowSet->pForest so that they can be tested.
func _sqlite3RowSetTest(tls *crt.TLS, _pRowSet *XRowSet, _iBatch int32, _iRowid int64) (r0 int32) {
var _p, _pTree, _6_pAux, _6_pTail *TRowSetEntry
var _2_ppPrevTree **TRowSetEntry
func() {
if _pRowSet == nil || (int32(_pRowSet.X7)&i32(2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46706), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RowSetTestØ00__func__Ø000))), unsafe.Pointer(str(90019)))
crt.X__builtin_abort(tls)
}
}()
if _iBatch == (_pRowSet.X8) {
goto _3
}
_p = (*TRowSetEntry)(_pRowSet.X2)
if _p == nil {
goto _4
}
_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X5)))))
if (int32(_pRowSet.X7) & i32(1)) == i32(0) {
_p = _rowSetEntrySort(tls, _p)
}
_pTree = (*TRowSetEntry)(_pRowSet.X5)
_6:
if _pTree == nil {
goto _9
}
_2_ppPrevTree = (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X1)))))
if (*TRowSetEntry)(_pTree.X2) == nil {
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = _rowSetListToTree(tls, _p)
goto _9
}
_rowSetTreeToList(tls, (*TRowSetEntry)(_pTree.X2), &_6_pAux, &_6_pTail)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = nil
_p = _rowSetEntryMerge(tls, _6_pAux, _p)
_pTree = (*TRowSetEntry)(_pTree.X1)
goto _6
_9:
if _pTree != nil {
goto _12
}
*_2_ppPrevTree = store57(&_pTree, _rowSetEntryAlloc(tls, _pRowSet))
if _pTree != nil {
*(*int64)(unsafe.Pointer(&(_pTree.X0))) = int64(i32(0))
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X1))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTree.X2))))) = _rowSetListToTree(tls, _p)
}
_12:
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X2))))) = nil
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRowSet.X3))))) = nil
{
p := (*uint16)(unsafe.Pointer(&(_pRowSet.X7)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
_4:
*(*int32)(unsafe.Pointer(&(_pRowSet.X8))) = _iBatch
_3:
_pTree = (*TRowSetEntry)(_pRowSet.X5)
_14:
if _pTree == nil {
goto _17
}
_p = (*TRowSetEntry)(_pTree.X2)
_18:
if _p == nil {
goto _19
}
if (_p.X0) < _iRowid {
_p = (*TRowSetEntry)(_p.X1)
goto _23
}
if (_p.X0) > _iRowid {
_p = (*TRowSetEntry)(_p.X2)
goto _23
}
return i32(1)
_23:
goto _18
_19:
_pTree = (*TRowSetEntry)(_pTree.X1)
goto _14
_17:
return i32(0)
_ = _6_pTail
panic(0)
}
var _sqlite3RowSetTestØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RowSetTestØ00__func__Ø000[0], str(90069), 18)
}
// Convert a sorted list of elements into a binary tree. Make the tree
// as deep as it needs to be in order to contain the entire list.
func _rowSetListToTree(tls *crt.TLS, _pList *TRowSetEntry) (r0 *TRowSetEntry) {
var _iDepth int32
var _p, _pLeft *TRowSetEntry
func() {
if _pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46641), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetListToTreeØ00__func__Ø000))), unsafe.Pointer(str(90087)))
crt.X__builtin_abort(tls)
}
}()
_p = _pList
_pList = (*TRowSetEntry)(_p.X1)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))), nil)
_iDepth = i32(1)
_2:
if _pList == nil {
goto _5
}
_pLeft = _p
_p = _pList
_pList = (*TRowSetEntry)(_p.X1)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pLeft
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _rowSetNDeepTree(tls, &_pList, _iDepth)
_iDepth += 1
goto _2
_5:
return _p
}
var _rowSetListToTreeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_rowSetListToTreeØ00__func__Ø000[0], str(90096), 17)
}
// Convert a sorted list of elements (connected by pRight) into a binary
// tree with depth of iDepth. A depth of 1 means the tree contains a single
// node taken from the head of *ppList. A depth of 2 means a tree with
// three nodes. And so forth.
//
// Use as many entries from the input list as required and update the
// *ppList to point to the unused elements of the list. If the input
// list contains too few elements, then construct an incomplete tree
// and leave *ppList set to NULL.
//
// Return a pointer to the root of the constructed binary tree.
func _rowSetNDeepTree(tls *crt.TLS, _ppList **TRowSetEntry, _iDepth int32) (r0 *TRowSetEntry) {
var _p, _pLeft *TRowSetEntry
if (*_ppList) == nil {
return nil
}
if _iDepth <= i32(1) {
goto _1
}
_pLeft = _rowSetNDeepTree(tls, _ppList, _iDepth-i32(1))
_p = *_ppList
if _p == nil {
return _pLeft
}
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = _pLeft
*_ppList = (*TRowSetEntry)(_p.X1)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _rowSetNDeepTree(tls, _ppList, _iDepth-i32(1))
goto _3
_1:
_p = *_ppList
*_ppList = (*TRowSetEntry)(_p.X1)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = store57((**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))), nil)
_3:
return _p
}
// The input, pIn, is a binary tree (or subtree) of RowSetEntry objects.
// Convert this tree into a linked list connected by the pRight pointers
// and return pointers to the first and last elements of the new list.
func _rowSetTreeToList(tls *crt.TLS, _pIn *TRowSetEntry, _ppFirst **TRowSetEntry, _ppLast **TRowSetEntry) {
var _1_p *TRowSetEntry
func() {
if _pIn == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46570), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000))), unsafe.Pointer(str(90113)))
crt.X__builtin_abort(tls)
}
}()
if (*TRowSetEntry)(_pIn.X2) != nil {
_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.X2), _ppFirst, &_1_p)
*(**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X1))))) = _pIn
goto _3
}
*_ppFirst = _pIn
_3:
if (*TRowSetEntry)(_pIn.X1) != nil {
_rowSetTreeToList(tls, (*TRowSetEntry)(_pIn.X1), (**TRowSetEntry)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIn.X1))))), _ppLast)
goto _5
}
*_ppLast = _pIn
_5:
func() {
if (*TRowSetEntry)((*_ppLast).X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(46583), unsafe.Pointer((*int8)(unsafe.Pointer(&_rowSetTreeToListØ00__func__Ø000))), unsafe.Pointer(str(90120)))
crt.X__builtin_abort(tls)
}
}()
}
var _rowSetTreeToListØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_rowSetTreeToListØ00__func__Ø000[0], str(90141), 17)
}
// 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 or RESTART.
func _sqlite3Checkpoint(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
var _rc, _i, _bBusy int32
_rc = i32(0)
_bBusy = i32(0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142642), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pnLog != nil && (*_pnLog) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000))), unsafe.Pointer(str(90158)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pnCkpt != nil && (*_pnCkpt) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142644), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CheckpointØ00__func__Ø000))), unsafe.Pointer(str(90179)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_8:
if _i >= (_db.X5) || _rc != i32(0) {
goto _12
}
if _i != _iDb && _iDb != i32(10) {
goto _14
}
_rc = _sqlite3BtreeCheckpoint(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X1), _eMode, _pnLog, _pnCkpt)
_pnLog = nil
_pnCkpt = nil
if _rc == i32(5) {
_bBusy = i32(1)
_rc = i32(0)
}
_14:
_i += 1
goto _8
_12:
return func() int32 {
if (_rc == i32(0)) && _bBusy != 0 {
return i32(5)
}
return _rc
}()
}
var _sqlite3CheckpointØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CheckpointØ00__func__Ø000[0], str(90202), 18)
}
// 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 _sqlite3BtreeCheckpoint(tls *crt.TLS, _p *XBtree, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
var _rc int32
var _1_pBt *XBtShared
_rc = i32(0)
if _p == nil {
goto _0
}
_1_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
if int32(_1_pBt.X8) != i32(0) {
_rc = i32(6)
goto _2
}
_rc = _sqlite3PagerCheckpoint(tls, (*XPager)(_1_pBt.X0), (*Xsqlite3)(_p.X0), _eMode, _pnLog, _pnCkpt)
_2:
_sqlite3BtreeLeave(tls, _p)
_0:
return _rc
}
// This function is called when the user invokes "PRAGMA wal_checkpoint",
// "PRAGMA wal_blocking_checkpoint" or calls the sqlite3_wal_checkpoint()
// or wal_blocking_checkpoint() API functions.
//
// Parameter eMode is one of SQLITE_CHECKPOINT_PASSIVE, FULL or RESTART.
func _sqlite3PagerCheckpoint(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
var _rc int32
_rc = i32(0)
if (*XWal)(_pPager.X60) != nil {
_rc = _sqlite3WalCheckpoint(tls, (*XWal)(_pPager.X60), _db, _eMode, func() func(*crt.TLS, unsafe.Pointer) int32 {
if _eMode == i32(0) {
return nil
}
return (_pPager.X53)
}(), _pPager.X54, int32(_pPager.X7), _pPager.X48, (*uint8)(unsafe.Pointer(_pPager.X58)), _pnLog, _pnCkpt)
}
return _rc
}
// Return TRUE if the pager is in a state where it is OK to change the
// journalmode. Journalmode changes can only happen when the database
// is unmodified.
func _sqlite3PagerOkToChangeJournalMode(tls *crt.TLS, _pPager *XPager) (r0 int32) {
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54187), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X14) >= i32(3) {
return i32(0)
}
if func() int32 {
if ((*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X32).X0) != nil) && ((_pPager.X34) > int64(i32(0))) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54189), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return i32(0)
}
return i32(1)
}
var _sqlite3PagerOkToChangeJournalModeØ00__func__Ø000 [34]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerOkToChangeJournalModeØ00__func__Ø000[0], str(90220), 34)
}
// This function is called to close the connection to the log file prior
// to switching from WAL to rollback mode.
//
// Before closing the log file, this function attempts to take an
// EXCLUSIVE lock on the database file. If this cannot be obtained, an
// error (SQLITE_BUSY) is returned and the log connection is not closed.
// If successful, the EXCLUSIVE lock is not released before returning.
func _sqlite3PagerCloseWal(tls *crt.TLS, _pPager *XPager, _db *Xsqlite3) (r0 int32) {
var _rc, _1_logexists int32
_rc = i32(0)
func() {
if int32(_pPager.X2) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54380), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCloseWalØ00__func__Ø000))), unsafe.Pointer(str(90254)))
crt.X__builtin_abort(tls)
}
}()
if (*XWal)(_pPager.X60) != nil {
goto _2
}
_1_logexists = i32(0)
_rc = _pagerLockDb(tls, _pPager, i32(1))
if _rc == i32(0) {
_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X61, i32(0), &_1_logexists)
}
if (_rc == i32(0)) && _1_logexists != 0 {
_rc = _pagerOpenWal(tls, _pPager)
}
_2:
if _rc != i32(0) || (*XWal)(_pPager.X60) == nil {
goto _7
}
_rc = _pagerExclusiveLock(tls, _pPager)
if _rc != i32(0) {
goto _8
}
_rc = _sqlite3WalClose(tls, (*XWal)(_pPager.X60), _db, int32(_pPager.X7), _pPager.X48, (*uint8)(unsafe.Pointer(_pPager.X58)))
*(**XWal)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X60))))) = nil
_pagerFixMaplimit(tls, _pPager)
if _rc != 0 && ((_pPager.X1) == 0) {
_pagerUnlockDb(tls, _pPager, i32(1))
}
_8:
_7:
return _rc
}
var _sqlite3PagerCloseWalØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerCloseWalØ00__func__Ø000[0], str(90297), 21)
}
// Set the journal-mode for this pager. Parameter eMode must be one of:
//
// PAGER_JOURNALMODE_DELETE
// PAGER_JOURNALMODE_TRUNCATE
// PAGER_JOURNALMODE_PERSIST
// PAGER_JOURNALMODE_OFF
// PAGER_JOURNALMODE_MEMORY
// PAGER_JOURNALMODE_WAL
//
// The journalmode is set to the value specified if the change is allowed.
// The change may be disallowed for the following reasons:
//
// * An in-memory database can only have its journal_mode set to _OFF
// or _MEMORY.
//
// * Temporary databases cannot have _WAL journalmode.
//
// The returned indicate the current (possibly updated) journal-mode.
func _sqlite3PagerSetJournalMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
var _6_rc, _6_state int32
var _eOld uint8
_eOld = _pPager.X2
_print_pager_state(tls, _pPager)
func() {
if _eMode != i32(0) && _eMode != i32(3) && _eMode != i32(1) && _eMode != i32(2) && _eMode != i32(5) && _eMode != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54090), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90318)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pPager.X10) != i32(0) && _eMode == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54101), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90522)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X13) == 0 {
goto _10
}
func() {
if int32(_eOld) != i32(4) && int32(_eOld) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54107), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90574)))
crt.X__builtin_abort(tls)
}
}()
if (_eMode != i32(4)) && (_eMode != i32(2)) {
_eMode = int32(_eOld)
}
_10:
if _eMode == int32(_eOld) {
goto _16
}
func() {
if int32(_pPager.X14) == i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(15064)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pPager.X2))) = uint8(_eMode)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
func() {
if (*Xsqlite3_io_methods)((*Xsqlite3_file)(_pPager.X31).X0) == nil && (_pPager.X1) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54130), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90636)))
crt.X__builtin_abort(tls)
}
}()
if (_pPager.X1) != 0 || (int32(_eOld)&i32(5)) != i32(1) || (_eMode&i32(1)) != i32(0) {
goto _24
}
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
if int32(_pPager.X15) >= i32(2) {
_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X52, i32(0))
goto _26
}
_6_rc = i32(0)
_6_state = int32(_pPager.X14)
func() {
if _6_state != i32(0) && _6_state != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54147), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90680)))
crt.X__builtin_abort(tls)
}
}()
if _6_state == i32(0) {
_6_rc = _sqlite3PagerSharedLock(tls, _pPager)
}
if int32(_pPager.X14) == i32(1) {
func() {
if _6_rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54152), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_6_rc = _pagerLockDb(tls, _pPager, i32(2))
}
if _6_rc == i32(0) {
_sqlite3OsDelete(tls, (*Xsqlite3_vfs)(_pPager.X0), _pPager.X52, i32(0))
}
if (_6_rc == i32(0)) && (_6_state == i32(1)) {
_pagerUnlockDb(tls, _pPager, i32(1))
goto _38
}
if _6_state == i32(0) {
_pager_unlock(tls, _pPager)
}
_38:
func() {
if _6_state != int32(_pPager.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54163), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerSetJournalModeØ00__func__Ø000))), unsafe.Pointer(str(90721)))
crt.X__builtin_abort(tls)
}
}()
_26:
goto _42
_24:
if _eMode == i32(2) {
_sqlite3OsClose(tls, (*Xsqlite3_file)(_pPager.X32))
}
_42:
_16:
return int32(_pPager.X2)
}
// Return a pointer to a human readable string in a static buffer
// containing the state of the Pager object passed as an argument. This
// is intended to be used within debuggers. For example, as an alternative
// to "print *pPager" in gdb:
//
// (gdb) printf "%s", print_pager_state(pPager)
func _print_pager_state(tls *crt.TLS, _p *XPager) (r0 *int8) {
Xsqlite3_snprintf(tls, i32(1024), (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001)), str(90743), unsafe.Pointer(_p.X51), unsafe.Pointer(func() *int8 {
if int32(_p.X14) == i32(0) {
return str(91021)
}
return func() *int8 {
if int32(_p.X14) == i32(1) {
return str(91026)
}
return func() *int8 {
if int32(_p.X14) == i32(2) {
return str(91033)
}
return func() *int8 {
if int32(_p.X14) == i32(3) {
return str(91047)
}
return func() *int8 {
if int32(_p.X14) == i32(4) {
return str(91063)
}
return func() *int8 {
if int32(_p.X14) == i32(5) {
return str(91076)
}
return func() *int8 {
if int32(_p.X14) == i32(6) {
return str(91092)
}
return str(91098)
}()
}()
}()
}()
}()
}()
}()), _p.X26, unsafe.Pointer(func() *int8 {
if int32(_p.X15) == i32(0) {
return str(91106)
}
return func() *int8 {
if int32(_p.X15) == i32(2) {
return str(91114)
}
return func() *int8 {
if int32(_p.X15) == i32(4) {
return str(25020)
}
return func() *int8 {
if int32(_p.X15) == i32(1) {
return str(91123)
}
return func() *int8 {
if int32(_p.X15) == i32(5) {
return str(91130)
}
return str(91098)
}()
}()
}()
}()
}()), unsafe.Pointer(func() *int8 {
if (_p.X1) != 0 {
return str(91138)
}
return str(91148)
}()), unsafe.Pointer(func() *int8 {
if int32(_p.X2) == i32(4) {
return str(91155)
}
return func() *int8 {
if int32(_p.X2) == i32(2) {
return str(91162)
}
return func() *int8 {
if int32(_p.X2) == i32(0) {
return str(91166)
}
return func() *int8 {
if int32(_p.X2) == i32(1) {
return str(91173)
}
return func() *int8 {
if int32(_p.X2) == i32(3) {
return str(91181)
}
return func() *int8 {
if int32(_p.X2) == i32(5) {
return str(91190)
}
return str(91098)
}()
}()
}()
}()
}()
}()), int32(_p.X10), int32(_p.X13), int32(_p.X3), _p.X34, _p.X35, int32(_p.X22), int32(_p.X23), int32(_p.X24))
return (*int8)(unsafe.Pointer(&_print_pager_stateØ00zRetØ001))
}
var _print_pager_stateØ00zRetØ001 [1024]int8
var _sqlite3PagerSetJournalModeØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerSetJournalModeØ00__func__Ø000[0], str(91194), 27)
}
// 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 _sqlite3BtreeSetVersion(tls *crt.TLS, _pBtree *XBtree, _iVersion int32) (r0 int32) {
var _rc int32
var _1_aData *uint8
var _pBt *XBtShared
_pBt = (*XBtShared)(_pBtree.X1)
func() {
if _iVersion != i32(1) && _iVersion != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68831), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetVersionØ00__func__Ø000))), unsafe.Pointer(str(91221)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-17))
sink14 = *p
}
if _iVersion == i32(1) {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
}
_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, i32(0))
if _rc != i32(0) {
goto _4
}
_1_aData = (*XMemPage)(_pBt.X3).X19
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(18))))) == int32(uint8(_iVersion)) && int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(19))))) == int32(uint8(_iVersion)) {
goto _6
}
_rc = _sqlite3BtreeBeginTrans(tls, _pBtree, i32(2))
if _rc != i32(0) {
goto _7
}
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23))
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(18)))) = uint8(_iVersion)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aData)) + 1*uintptr(i32(19)))) = uint8(_iVersion)
}
_7:
_6:
_4:
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) & i32(-17))
sink14 = *p
}
return _rc
}
var _sqlite3BtreeSetVersionØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetVersionØ00__func__Ø000[0], str(91248), 23)
}
// 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 _sqlite3JournalModename(tls *crt.TLS, _eMode int32) (r0 *int8) {
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
func() {
if _eMode < i32(0) || _eMode > i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3JournalModenameØ00__func__Ø000))), unsafe.Pointer(str(91271)))
crt.X__builtin_abort(tls)
}
}()
if _eMode == i32(6) {
return nil
}
return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JournalModenameØ00azModeNameØ001)) + 4*uintptr(_eMode)))
}
var _sqlite3JournalModenameØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3JournalModenameØ00__func__Ø000[0], str(91312), 23)
}
var _sqlite3JournalModenameØ00azModeNameØ001 [6]*int8
func init() {
_sqlite3JournalModenameØ00azModeNameØ001 = [6]*int8{str(91166), str(91173), str(91162), str(91181), str(91155), str(91190)}
}
// This routine implements the OP_Vacuum opcode of the VDBE.
func _sqlite3RunVacuum(tls *crt.TLS, _pzErrMsg **int8, _db *Xsqlite3, _iDb int32) (r0 int32) {
var _rc, _saved_flags, _saved_nChange, _saved_nTotalChange, _isMemDb, _nRes, _nDb, _5_i int32
var _5_meta uint32
var _zDbMain *int8
var _saved_mTrace uint8
var _pMain, _pTemp *XBtree
var _pDb *XDb
_rc = i32(0)
_pDb = nil
if (_db.X15) == 0 {
_sqlite3SetString(tls, _pzErrMsg, _db, str(91335))
return i32(1)
}
if (_db.X34) > i32(1) {
_sqlite3SetString(tls, _pzErrMsg, _db, str(91375))
return i32(1)
}
_saved_flags = _db.X6
_saved_nChange = _db.X29
_saved_nTotalChange = _db.X30
_saved_mTrace = _db.X24
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(270542848)
sink1 = *p
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-655489)
sink1 = *p
}
*(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(i32(0))
_zDbMain = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_pMain = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X1)
_isMemDb = _sqlite3PagerIsMemdb(tls, _sqlite3BtreePager(tls, _pMain))
_nDb = _db.X5
_rc = _execSql(tls, _db, _pzErrMsg, str(91418))
if _rc != i32(0) {
goto _end_of_vacuum
}
func() {
if ((_db.X5) - i32(1)) != _nDb {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91439)))
crt.X__builtin_abort(tls)
}
}()
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_nDb)))
func() {
if crt.Xstrcmp(tls, _pDb.X0, str(91456)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91466)))
crt.X__builtin_abort(tls)
}
}()
_pTemp = (*XBtree)(_pDb.X1)
_sqlite3BtreeCommit(tls, _pTemp)
_nRes = _sqlite3BtreeGetOptimalReserve(tls, _pMain)
_sqlite3BtreeSetCacheSize(tls, _pTemp, (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X4).X10)
_sqlite3BtreeSetSpillSize(tls, _pTemp, _sqlite3BtreeSetSpillSize(tls, _pMain, i32(0)))
_sqlite3BtreeSetPagerFlags(tls, _pTemp, uint32(i32(33)))
_rc = _execSql(tls, _db, _pzErrMsg, str(24983))
if _rc != i32(0) {
goto _end_of_vacuum
}
_rc = _sqlite3BtreeBeginTrans(tls, _pMain, i32(2))
if _rc != i32(0) {
goto _end_of_vacuum
}
if _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, _pMain)) == i32(5) {
*(*int32)(unsafe.Pointer(&(_db.X27))) = i32(0)
}
if (_sqlite3BtreeSetPageSize(tls, _pTemp, _sqlite3BtreeGetPageSize(tls, _pMain), _nRes, i32(0)) != 0 || ((_isMemDb == 0) && _sqlite3BtreeSetPageSize(tls, _pTemp, _db.X27, _nRes, i32(0)) != 0)) || func() int32 {
if (_db.X17) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124846), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
_rc = _sqlite3NomemError(tls, i32(124848))
goto _end_of_vacuum
}
_sqlite3BtreeSetAutoVacuum(tls, _pTemp, func() int32 {
if int32(_db.X20) >= i32(0) {
return int32(_db.X20)
}
return _sqlite3BtreeGetAutoVacuum(tls, _pMain)
}())
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(_nDb)
_rc = _execSqlF(tls, _db, _pzErrMsg, str(91503), unsafe.Pointer(_zDbMain))
if _rc != i32(0) {
goto _end_of_vacuum
}
_rc = _execSqlF(tls, _db, _pzErrMsg, str(91611), unsafe.Pointer(_zDbMain))
if _rc != i32(0) {
goto _end_of_vacuum
}
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(i32(0))
_rc = _execSqlF(tls, _db, _pzErrMsg, str(91684), unsafe.Pointer(_zDbMain))
func() {
if ((_db.X6) & i32(268435456)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91835)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-268435457)
sink1 = *p
}
if _rc != i32(0) {
goto _end_of_vacuum
}
_rc = _execSqlF(tls, _db, _pzErrMsg, str(91866), unsafe.Pointer(_zDbMain))
if _rc != 0 {
goto _end_of_vacuum
}
func() {
if i32(1) != _sqlite3BtreeIsInTrans(tls, _pTemp) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124929), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(91996)))
crt.X__builtin_abort(tls)
}
}()
func() {
if i32(1) != _sqlite3BtreeIsInTrans(tls, _pMain) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(92028)))
crt.X__builtin_abort(tls)
}
}()
_5_i = i32(0)
_28:
if _5_i >= i32(10) {
goto _31
}
_sqlite3BtreeGetMeta(tls, _pMain, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), &_5_meta)
_rc = _sqlite3BtreeUpdateMeta(tls, _pTemp, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i)))), _5_meta+uint32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3RunVacuumØ00aCopyØ001)) + 1*uintptr(_5_i+i32(1))))))
if func() int32 {
if _rc != i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124938), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _end_of_vacuum
}
{
p := &_5_i
*p = (*p) + i32(2)
sink1 = *p
}
goto _28
_31:
_rc = _sqlite3BtreeCopyFile(tls, _pMain, _pTemp)
if _rc != i32(0) {
goto _end_of_vacuum
}
_rc = _sqlite3BtreeCommit(tls, _pTemp)
if _rc != i32(0) {
goto _end_of_vacuum
}
_sqlite3BtreeSetAutoVacuum(tls, _pMain, _sqlite3BtreeGetAutoVacuum(tls, _pTemp))
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124950), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RunVacuumØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3BtreeSetPageSize(tls, _pMain, _sqlite3BtreeGetPageSize(tls, _pTemp), _nRes, i32(1))
_end_of_vacuum:
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X1))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_db.X6))) = _saved_flags
*(*int32)(unsafe.Pointer(&(_db.X29))) = _saved_nChange
*(*int32)(unsafe.Pointer(&(_db.X30))) = _saved_nTotalChange
*(*uint8)(unsafe.Pointer(&(_db.X24))) = _saved_mTrace
_sqlite3BtreeSetPageSize(tls, _pMain, i32(-1), i32(-1), i32(1))
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
if _pDb != nil {
_sqlite3BtreeClose(tls, (*XBtree)(_pDb.X1))
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X1))))) = nil
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X4))))) = nil
}
_sqlite3ResetAllSchemasOfConnection(tls, _db)
return _rc
}
// Execute zSql on database db.
//
// If zSql returns rows, then each row will have exactly one
// column. (This will only happen if zSql begins with "SELECT".)
// Take each row of result and call execSql() again recursively.
//
// The execSqlF() routine does the same thing, except it accepts
// a format string as its third argument
func _execSql(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8) (r0 int32) {
var _rc int32
var _1_zSubSql *int8
var _pStmt unsafe.Pointer
_rc = Xsqlite3_prepare_v2(tls, _db, _zSql, i32(-1), &_pStmt, nil)
if _rc != i32(0) {
return _rc
}
_0:
if i32(100) != store1(&_rc, Xsqlite3_step(tls, _pStmt)) {
goto _2
}
_1_zSubSql = (*int8)(unsafe.Pointer(Xsqlite3_column_text(tls, _pStmt, i32(0))))
func() {
if Xsqlite3_strnicmp(tls, _zSql, str(25702), i32(6)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124657), unsafe.Pointer((*int8)(unsafe.Pointer(&_execSqlØ00__func__Ø000))), unsafe.Pointer(str(92060)))
crt.X__builtin_abort(tls)
}
}()
if _1_zSubSql == nil {
goto _5
}
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zSubSql)) + 1*uintptr(i32(0))))) == i32(83) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124659), unsafe.Pointer((*int8)(unsafe.Pointer(&_execSqlØ00__func__Ø000))), unsafe.Pointer(str(92097)))
crt.X__builtin_abort(tls)
}
}()
_rc = _execSql(tls, _db, _pzErrMsg, _1_zSubSql)
if _rc != i32(0) {
goto _2
}
_5:
goto _0
_2:
func() {
if _rc == i32(100) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124664), unsafe.Pointer((*int8)(unsafe.Pointer(&_execSqlØ00__func__Ø000))), unsafe.Pointer(str(92113)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(101) {
_rc = i32(0)
}
if _rc != 0 {
_sqlite3SetString(tls, _pzErrMsg, _db, Xsqlite3_errmsg(tls, _db))
}
Xsqlite3_finalize(tls, _pStmt)
return _rc
}
var _execSqlØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_execSqlØ00__func__Ø000[0], str(92128), 8)
}
var _sqlite3RunVacuumØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RunVacuumØ00__func__Ø000[0], str(92136), 17)
}
// 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.
//
// If SQLITE_HAS_MUTEX is defined then the number returned is the
// greater of the current reserved space and the maximum requested
// reserve space.
func _sqlite3BtreeGetOptimalReserve(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _n int32
_sqlite3BtreeEnter(tls, _p)
_n = _sqlite3BtreeGetReserveNoMutex(tls, _p)
_sqlite3BtreeLeave(tls, _p)
return _n
}
// 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 _sqlite3BtreeSetSpillSize(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
var _res int32
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61682), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetSpillSizeØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_res = _sqlite3PagerSetSpillsize(tls, (*XPager)(_pBt.X0), _mxPage)
_sqlite3BtreeLeave(tls, _p)
return _res
}
var _sqlite3BtreeSetSpillSizeØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetSpillSizeØ00__func__Ø000[0], str(92153), 25)
}
// Change the maximum number of in-memory pages that are allowed
// before attempting to spill pages to journal.
func _sqlite3PagerSetSpillsize(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
return _sqlite3PcacheSetSpillsize(tls, (*XPCache)(_pPager.X59), _mxPage)
}
// Set the suggested cache-spill value. Make no changes if if the
// argument is zero. Return the effective cache-spill size, which will
// be the larger of the szSpill and szCache.
func _sqlite3PcacheSetSpillsize(tls *crt.TLS, _p *XPCache, _mxPage int32) (r0 int32) {
var _res int32
func() {
if (_p.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44952), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheSetSpillsizeØ00__func__Ø000))), unsafe.Pointer(str(92178)))
crt.X__builtin_abort(tls)
}
}()
if _mxPage == 0 {
goto _2
}
if _mxPage < i32(0) {
_mxPage = int32((int64(i32(-1024)) * int64(_mxPage)) / int64((_p.X6)+(_p.X7)))
}
*(*int32)(unsafe.Pointer(&(_p.X5))) = _mxPage
_2:
_res = _numberOfCachePages(tls, _p)
if _res < (_p.X5) {
_res = _p.X5
}
return _res
}
var _sqlite3PcacheSetSpillsizeØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheSetSpillsizeØ00__func__Ø000[0], str(92191), 26)
}
func _sqlite3BtreeSetPagerFlags(tls *crt.TLS, _p *XBtree, _pgFlags uint32) (r0 int32) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61718), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPagerFlagsØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_sqlite3PagerSetFlags(tls, (*XPager)(_pBt.X0), _pgFlags)
_sqlite3BtreeLeave(tls, _p)
return i32(0)
}
var _sqlite3BtreeSetPagerFlagsØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetPagerFlagsØ00__func__Ø000[0], str(92217), 26)
}
func _sqlite3PagerSetFlags(tls *crt.TLS, _pPager *XPager, _pgFlags uint32) {
var _level uint32
_level = _pgFlags & uint32(i32(7))
if (_pPager.X10) != 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X4))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(i32(0))
goto _1
}
*(*uint8)(unsafe.Pointer(&(_pPager.X4))) = uint8(func() int32 {
if _level == uint32(i32(1)) {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pPager.X5))) = uint8(func() int32 {
if _level >= uint32(i32(3)) {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pPager.X6))) = uint8(func() int32 {
if _level == uint32(i32(4)) {
return i32(1)
}
return i32(0)
}())
_1:
if (_pPager.X4) != 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(0))
goto _13
}
if (_pgFlags & uint32(i32(8))) != 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(3))
*(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(3))
goto _13
}
if (_pgFlags & uint32(i32(16))) != 0 {
*(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2))
*(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(3))
goto _13
}
*(*uint8)(unsafe.Pointer(&(_pPager.X9))) = uint8(i32(2))
*(*uint8)(unsafe.Pointer(&(_pPager.X7))) = uint8(i32(2))
_13:
*(*uint8)(unsafe.Pointer(&(_pPager.X8))) = _pPager.X9
if (_pPager.X5) != 0 {
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X8)))
*p = uint8(int32(*p) | i32(32))
sink2 = *p
}
}
if (_pgFlags & uint32(i32(32))) != 0 {
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) & i32(-2))
sink2 = *p
}
goto _16
}
{
p := (*uint8)(unsafe.Pointer(&(_pPager.X18)))
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
_16:
}
// 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 _sqlite3BtreeSetPageSize(tls *crt.TLS, _p *XBtree, _pageSize int32, _nReserve int32, _iFix int32) (r0 int32) {
var _rc int32
var _pBt *XBtShared
_rc = i32(0)
_pBt = (*XBtShared)(_p.X1)
func() {
if _nReserve < i32(-1) || _nReserve > i32(255) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61749), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(92243)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
if (int32(_pBt.X10) & i32(2)) != 0 {
_sqlite3BtreeLeave(tls, _p)
return i32(8)
}
if _nReserve < i32(0) {
_nReserve = int32((_pBt.X15) - (_pBt.X16))
}
func() {
if _nReserve < i32(0) || _nReserve > i32(255) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61761), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(92273)))
crt.X__builtin_abort(tls)
}
}()
if ((_pageSize >= i32(512)) && (_pageSize <= i32(65536))) && (((_pageSize - i32(1)) & _pageSize) == i32(0)) {
func() {
if (_pageSize & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61764), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(51388)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtCursor)(_pBt.X2) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61765), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetPageSizeØ00__func__Ø000))), unsafe.Pointer(str(22109)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pBt.X15))) = uint32(_pageSize)
_freeTempSpace(tls, _pBt)
}
_rc = _sqlite3PagerSetPagesize(tls, (*XPager)(_pBt.X0), (*uint32)(unsafe.Pointer(&(_pBt.X15))), _nReserve)
*(*uint32)(unsafe.Pointer(&(_pBt.X16))) = (_pBt.X15) - uint32(uint16(_nReserve))
if _iFix != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pBt.X10)))
*p = uint16(int32(*p) | i32(2))
sink14 = *p
}
}
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeSetPageSizeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetPageSizeØ00__func__Ø000[0], str(92302), 24)
}
// 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 _sqlite3BtreeSetAutoVacuum(tls *crt.TLS, _p *XBtree, _autoVacuum int32) (r0 int32) {
var _rc int32
var _av uint8
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_rc = i32(0)
_av = uint8(_autoVacuum)
_sqlite3BtreeEnter(tls, _p)
if ((int32(_pBt.X10) & i32(2)) != i32(0)) && (func() int32 {
if _av != 0 {
return i32(1)
}
return i32(0)
}() != int32(_pBt.X5)) {
_rc = i32(8)
goto _4
}
*(*uint8)(unsafe.Pointer(&(_pBt.X5))) = uint8(func() int32 {
if _av != 0 {
return i32(1)
}
return i32(0)
}())
*(*uint8)(unsafe.Pointer(&(_pBt.X6))) = uint8(func() int32 {
if int32(_av) == i32(2) {
return i32(1)
}
return i32(0)
}())
_4:
_sqlite3BtreeLeave(tls, _p)
return _rc
}
// Return the value of the 'auto-vacuum' property. If auto-vacuum is
// enabled 1 is returned. Otherwise 0.
func _sqlite3BtreeGetAutoVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _rc int32
_sqlite3BtreeEnter(tls, _p)
_rc = func() int32 {
if ((*XBtShared)(_p.X1).X5) == 0 {
return i32(0)
}
return func() int32 {
if ((*XBtShared)(_p.X1).X6) == 0 {
return i32(1)
}
return i32(2)
}()
}()
_sqlite3BtreeLeave(tls, _p)
return _rc
}
func _execSqlF(tls *crt.TLS, _db *Xsqlite3, _pzErrMsg **int8, _zSql *int8, args ...interface{}) (r0 int32) {
var _rc int32
var _z *int8
var _ap []interface{}
_ap = args
_z = _sqlite3VMPrintf(tls, _db, _zSql, _ap)
_ap = nil
if _z == nil {
return i32(7)
}
_rc = _execSql(tls, _db, _pzErrMsg, _z)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
return _rc
}
var _sqlite3RunVacuumØ00aCopyØ001 [10]uint8
func init() {
_sqlite3RunVacuumØ00aCopyØ001 = [10]uint8{1, 1, 3, 0, 5, 0, 6, 0, 8, 0}
}
// 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 _sqlite3BtreeCopyFile(tls *crt.TLS, _pTo *XBtree, _pFrom *XBtree) (r0 int32) {
var _rc int32
var _1_nByte int64
var _pFd *Xsqlite3_file
var _b Xsqlite3_backup
_sqlite3BtreeEnter(tls, _pTo)
_sqlite3BtreeEnter(tls, _pFrom)
func() {
if _sqlite3BtreeIsInTrans(tls, _pTo) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69652), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000))), unsafe.Pointer(str(92326)))
crt.X__builtin_abort(tls)
}
}()
_pFd = _sqlite3PagerFile(tls, _sqlite3BtreePager(tls, _pTo))
if (*Xsqlite3_io_methods)(_pFd.X0) == nil {
goto _2
}
_1_nByte = int64(_sqlite3BtreeGetPageSize(tls, _pFrom)) * int64(_sqlite3BtreeLastPage(tls, _pFrom))
_rc = _sqlite3OsFileControl(tls, _pFd, i32(11), (unsafe.Pointer)(&_1_nByte))
if _rc == i32(12) {
_rc = i32(0)
}
if _rc != 0 {
goto _copy_finished
}
_2:
crt.Xmemset(tls, (unsafe.Pointer)(&_b), i32(0), u32(48))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X5))))) = (*Xsqlite3)(_pFrom.X0)
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X6))))) = _pFrom
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_b.X1))))) = _pTo
*(*uint32)(unsafe.Pointer(&(_b.X4))) = uint32(i32(1))
Xsqlite3_backup_step(tls, &_b, i32(2147483647))
func() {
if (_b.X7) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000))), unsafe.Pointer(str(92353)))
crt.X__builtin_abort(tls)
}
}()
_rc = Xsqlite3_backup_finish(tls, &_b)
if _rc == i32(0) {
{
p := (*uint16)(unsafe.Pointer(&((*XBtShared)(_pTo.X1).X10)))
*p = uint16(int32(*p) & i32(-3))
sink14 = *p
}
goto _8
}
_sqlite3PagerClearCache(tls, _sqlite3BtreePager(tls, (*XBtree)(_b.X1)))
_8:
func() {
if _sqlite3BtreeIsInTrans(tls, _pTo) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69692), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeCopyFileØ00__func__Ø000))), unsafe.Pointer(str(92369)))
crt.X__builtin_abort(tls)
}
}()
_copy_finished:
_sqlite3BtreeLeave(tls, _pFrom)
_sqlite3BtreeLeave(tls, _pTo)
return _rc
_ = _b
_ = _1_nByte
panic(0)
}
var _sqlite3BtreeCopyFileØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeCopyFileØ00__func__Ø000[0], str(92399), 21)
}
// Copy nPage pages from the source b-tree to the destination.
func Xsqlite3_backup_step(tls *crt.TLS, _p *Xsqlite3_backup, _nPage int32) (r0 int32) {
var _rc, _destMode, _pgszSrc, _pgszDest, _2_ii, _2_nSrcPage, _2_bCloseTrans, _21_nDestTruncate, _22_ratio, _25_nDstPage, _36_rc2 int32
var _25_iSize, _25_iOff, _25_iEnd int64
var _9_iSrcPg, _25_iPg, _30_iSrcPg uint32
var _31_zData *uint8
var _2_pSrcPager, _2_pDestPager *XPager
var _25_pFile *Xsqlite3_file
var _10_pSrcPg, _27_pPg, _30_pSrcPg *XPgHdr
_pgszSrc = i32(0)
_pgszDest = i32(0)
if _p == nil {
return _sqlite3MisuseError(tls, i32(69253))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X5).X3))
_sqlite3BtreeEnter(tls, (*XBtree)(_p.X6))
if (*Xsqlite3)(_p.X0) != nil {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
_rc = _p.X7
if _isFatalError(tls, _rc) != 0 {
goto _2
}
_2_pSrcPager = _sqlite3BtreePager(tls, (*XBtree)(_p.X6))
_2_pDestPager = _sqlite3BtreePager(tls, (*XBtree)(_p.X1))
_2_nSrcPage = i32(-1)
_2_bCloseTrans = i32(0)
if ((*Xsqlite3)(_p.X0) != nil) && (int32((*XBtShared)((*XBtree)(_p.X6).X1).X8) == i32(2)) {
_rc = i32(5)
goto _5
}
_rc = i32(0)
_5:
if (_rc == i32(0)) && (i32(0) == _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_p.X6))) {
_rc = _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.X6), i32(0))
_2_bCloseTrans = i32(1)
}
if (((_p.X3) == i32(0)) && (_rc == i32(0))) && (_setDestPgsz(tls, _p) == i32(7)) {
_rc = i32(7)
}
if ((i32(0) == _rc) && ((_p.X3) == i32(0))) && (i32(0) == store1(&_rc, _sqlite3BtreeBeginTrans(tls, (*XBtree)(_p.X1), i32(2)))) {
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(1)
_sqlite3BtreeGetMeta(tls, (*XBtree)(_p.X1), i32(1), (*uint32)(unsafe.Pointer(&(_p.X2))))
}
_pgszSrc = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6))
_pgszDest = _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X1))
_destMode = _sqlite3PagerGetJournalMode(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.X1)))
if ((i32(0) == _rc) && (_destMode == i32(5))) && (_pgszSrc != _pgszDest) {
_rc = i32(8)
}
_2_nSrcPage = int32(_sqlite3BtreeLastPage(tls, (*XBtree)(_p.X6)))
func() {
if _2_nSrcPage < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69318), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(92420)))
crt.X__builtin_abort(tls)
}
}()
_2_ii = i32(0)
_19:
if _nPage >= i32(0) && _2_ii >= _nPage || (_p.X4) > uint32(_2_nSrcPage) || _rc != 0 {
goto _25
}
_9_iSrcPg = _p.X4
if _9_iSrcPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.X6).X1).X15)) + uint32(i32(1))) {
goto _26
}
_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _9_iSrcPg, &_10_pSrcPg, i32(2))
if _rc == i32(0) {
_rc = _backupOnePage(tls, _p, _9_iSrcPg, (*uint8)(_sqlite3PagerGetData(tls, _10_pSrcPg)), i32(0))
_sqlite3PagerUnref(tls, _10_pSrcPg)
}
_26:
*(*uint32)(unsafe.Pointer(&(_p.X4))) += 1
_2_ii += 1
goto _19
_25:
if _rc != i32(0) {
goto _28
}
*(*uint32)(unsafe.Pointer(&(_p.X9))) = uint32(_2_nSrcPage)
*(*uint32)(unsafe.Pointer(&(_p.X8))) = uint32(_2_nSrcPage+i32(1)) - (_p.X4)
if (_p.X4) > uint32(_2_nSrcPage) {
_rc = i32(101)
goto _31
}
if (_p.X10) == 0 {
_attachBackupObject(tls, _p)
}
_31:
_28:
if _rc != i32(101) {
goto _32
}
if _2_nSrcPage == i32(0) {
_rc = _sqlite3BtreeNewDb(tls, (*XBtree)(_p.X1))
_2_nSrcPage = i32(1)
}
if (_rc == i32(0)) || (_rc == i32(101)) {
_rc = _sqlite3BtreeUpdateMeta(tls, (*XBtree)(_p.X1), i32(1), (_p.X2)+uint32(i32(1)))
}
if _rc != i32(0) {
goto _36
}
if (*Xsqlite3)(_p.X0) != nil {
_sqlite3ResetAllSchemasOfConnection(tls, (*Xsqlite3)(_p.X0))
}
if _destMode == i32(5) {
_rc = _sqlite3BtreeSetVersion(tls, (*XBtree)(_p.X1), i32(2))
}
_36:
if _rc != i32(0) {
goto _39
}
func() {
if _pgszSrc != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69376), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(92432)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pgszDest != _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69377), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(92474)))
crt.X__builtin_abort(tls)
}
}()
if _pgszSrc >= _pgszDest {
goto _44
}
_22_ratio = _pgszDest / _pgszSrc
_21_nDestTruncate = ((_2_nSrcPage + _22_ratio) - i32(1)) / _22_ratio
if _21_nDestTruncate == int32((uint32(_sqlite3PendingByte)/((*XBtShared)((*XBtree)(_p.X1).X1).X15))+uint32(i32(1))) {
_21_nDestTruncate -= 1
}
goto _46
_44:
_21_nDestTruncate = _2_nSrcPage * (_pgszSrc / _pgszDest)
_46:
func() {
if _21_nDestTruncate <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69387), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(92518)))
crt.X__builtin_abort(tls)
}
}()
if _pgszSrc >= _pgszDest {
goto _49
}
_25_iSize = int64(_pgszSrc) * int64(_2_nSrcPage)
_25_pFile = _sqlite3PagerFile(tls, _2_pDestPager)
func() {
if _25_pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69406), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _21_nDestTruncate != i32(0) && (int64(_21_nDestTruncate)*int64(_pgszDest)) < _25_iSize && (_21_nDestTruncate != int32(((uint32(_sqlite3PendingByte)/((*XBtShared)((*XBtree)(_p.X1).X1).X15))+uint32(i32(1)))-uint32(i32(1))) || _25_iSize < int64(_sqlite3PendingByte) || _25_iSize > int64(_sqlite3PendingByte+_pgszDest)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69407), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(92534)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3PagerPagecount(tls, _2_pDestPager, &_25_nDstPage)
_25_iPg = uint32(_21_nDestTruncate)
_58:
if _rc != i32(0) || _25_iPg > uint32(_25_nDstPage) {
goto _62
}
if _25_iPg == ((uint32(_sqlite3PendingByte) / ((*XBtShared)((*XBtree)(_p.X1).X1).X15)) + uint32(i32(1))) {
goto _63
}
_rc = _sqlite3PagerGet(tls, _2_pDestPager, _25_iPg, &_27_pPg, i32(0))
if _rc == i32(0) {
_rc = _sqlite3PagerWrite(tls, _27_pPg)
_sqlite3PagerUnref(tls, _27_pPg)
}
_63:
_25_iPg += 1
goto _58
_62:
if _rc == i32(0) {
_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, i32(1))
}
_25_iEnd = func() int64 {
if int64(_sqlite3PendingByte+_pgszDest) < _25_iSize {
return int64(_sqlite3PendingByte + _pgszDest)
}
return _25_iSize
}()
_25_iOff = int64(_sqlite3PendingByte + _pgszSrc)
_68:
if _rc != i32(0) || _25_iOff >= _25_iEnd {
goto _72
}
_30_pSrcPg = nil
_30_iSrcPg = uint32((_25_iOff / int64(_pgszSrc)) + int64(i32(1)))
_rc = _sqlite3PagerGet(tls, _2_pSrcPager, _30_iSrcPg, &_30_pSrcPg, i32(0))
if _rc == i32(0) {
_31_zData = (*uint8)(_sqlite3PagerGetData(tls, _30_pSrcPg))
_rc = _sqlite3OsWrite(tls, _25_pFile, (unsafe.Pointer)(_31_zData), _pgszSrc, _25_iOff)
}
_sqlite3PagerUnref(tls, _30_pSrcPg)
{
p := &_25_iOff
*p = (*p) + int64(_pgszSrc)
sink6 = *p
}
goto _68
_72:
if _rc == i32(0) {
_rc = _backupTruncateFile(tls, _25_pFile, _25_iSize)
}
if _rc == i32(0) {
_rc = _sqlite3PagerSync(tls, _2_pDestPager, nil)
}
goto _76
_49:
_sqlite3PagerTruncateImage(tls, _2_pDestPager, uint32(_21_nDestTruncate))
_rc = _sqlite3PagerCommitPhaseOne(tls, _2_pDestPager, nil, i32(0))
_76:
if (i32(0) == _rc) && (i32(0) == store1(&_rc, _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.X1), i32(0)))) {
_rc = i32(101)
}
_39:
_32:
if _2_bCloseTrans != 0 {
_36_rc2 = _sqlite3BtreeCommitPhaseOne(tls, (*XBtree)(_p.X6), nil)
{
p := &_36_rc2
*p = (*p) | _sqlite3BtreeCommitPhaseTwo(tls, (*XBtree)(_p.X6), i32(0))
sink1 = *p
}
func() {
if _36_rc2 != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69481), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_backup_stepØ00__func__Ø000))), unsafe.Pointer(str(18873)))
crt.X__builtin_abort(tls)
}
}()
}
if _rc == i32(3082) {
_rc = _sqlite3NomemError(tls, i32(69485))
}
*(*int32)(unsafe.Pointer(&(_p.X7))) = _rc
_2:
if (*Xsqlite3)(_p.X0) != nil {
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
_sqlite3BtreeLeave(tls, (*XBtree)(_p.X6))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X5).X3))
return _rc
}
// Attempt to set the page size of the destination to match the page size
// of the source.
func _setDestPgsz(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
var _rc int32
_rc = _sqlite3BtreeSetPageSize(tls, (*XBtree)(_p.X1), _sqlite3BtreeGetPageSize(tls, (*XBtree)(_p.X6)), i32(-1), i32(0))
return _rc
}
var _sqlite3_backup_stepØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_backup_stepØ00__func__Ø000[0], str(92715), 20)
}
// Register this backup object with the associated source pager for
// callbacks when pages are changed or the cache invalidated.
func _attachBackupObject(tls *crt.TLS, _p *Xsqlite3_backup) {
var _pp **Xsqlite3_backup
func() {
if _sqlite3BtreeHoldsMutex(tls, (*XBtree)(_p.X6)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(69236), unsafe.Pointer((*int8)(unsafe.Pointer(&_attachBackupObjectØ00__func__Ø000))), unsafe.Pointer(str(92735)))
crt.X__builtin_abort(tls)
}
}()
_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.X6)))
*(**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = *_pp
*_pp = _p
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(1)
}
var _attachBackupObjectØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_attachBackupObjectØ00__func__Ø000[0], str(92767), 19)
}
// Return a pointer to the pPager->pBackup variable. The backup module
// in backup.c maintains the content of this variable. This module
// uses it opaquely as an argument to sqlite3BackupRestart() and
// sqlite3BackupUpdate() only.
func _sqlite3PagerBackupPtr(tls *crt.TLS, _pPager *XPager) (r0 **Xsqlite3_backup) {
return (**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPager.X36)))))
}
// 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 _sqlite3BtreeNewDb(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _rc int32
_sqlite3BtreeEnter(tls, _p)
*(*uint32)(unsafe.Pointer(&((*XBtShared)(_p.X1).X18))) = uint32(i32(0))
_rc = _newDatabase(tls, (*XBtShared)(_p.X1))
_sqlite3BtreeLeave(tls, _p)
return _rc
}
// If pFile is currently larger than iSize bytes, then truncate it to
// exactly iSize bytes. If pFile is not larger than iSize bytes, then
// this function is a no-op.
//
// Return SQLITE_OK if everything is successful, or an SQLite error
// code if an error occurs.
func _backupTruncateFile(tls *crt.TLS, _pFile *Xsqlite3_file, _iSize int64) (r0 int32) {
var _rc int32
var _iCurrent int64
_rc = _sqlite3OsFileSize(tls, _pFile, &_iCurrent)
if (_rc == i32(0)) && (_iCurrent > _iSize) {
_rc = _sqlite3OsTruncate(tls, _pFile, _iSize)
}
return _rc
}
// Release all resources associated with an sqlite3_backup* handle.
func Xsqlite3_backup_finish(tls *crt.TLS, _p *Xsqlite3_backup) (r0 int32) {
var _rc int32
var _pSrcDb *Xsqlite3
var _pp **Xsqlite3_backup
if _p == nil {
return i32(0)
}
_pSrcDb = (*Xsqlite3)(_p.X5)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pSrcDb.X3))
_sqlite3BtreeEnter(tls, (*XBtree)(_p.X6))
if (*Xsqlite3)(_p.X0) != nil {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
}
if (*Xsqlite3)(_p.X0) != nil {
*(*int32)(unsafe.Pointer(&((*XBtree)(_p.X6).X7))) -= 1
}
if (_p.X10) == 0 {
goto _3
}
_pp = _sqlite3PagerBackupPtr(tls, _sqlite3BtreePager(tls, (*XBtree)(_p.X6)))
_4:
if (*_pp) != _p {
_pp = (**Xsqlite3_backup)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_pp).X11)))))
goto _4
}
*_pp = (*Xsqlite3_backup)(_p.X11)
_3:
_sqlite3BtreeRollback(tls, (*XBtree)(_p.X1), i32(0), i32(0))
_rc = func() int32 {
if (_p.X7) == i32(101) {
return i32(0)
}
return (_p.X7)
}()
if (*Xsqlite3)(_p.X0) != nil {
_sqlite3Error(tls, (*Xsqlite3)(_p.X0), _rc)
_sqlite3LeaveMutexAndCloseZombie(tls, (*Xsqlite3)(_p.X0))
}
_sqlite3BtreeLeave(tls, (*XBtree)(_p.X6))
if (*Xsqlite3)(_p.X0) != nil {
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
}
_sqlite3LeaveMutexAndCloseZombie(tls, _pSrcDb)
return _rc
}
// Unless this is an in-memory or temporary database, clear the pager cache.
func _sqlite3PagerClearCache(tls *crt.TLS, _pPager *XPager) {
func() {
if int32(_pPager.X13) != i32(0) && (_pPager.X10) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerClearCacheØ00__func__Ø000))), unsafe.Pointer(str(55898)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pPager.X10) == i32(0) {
_pager_reset(tls, _pPager)
}
}
var _sqlite3PagerClearCacheØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerClearCacheØ00__func__Ø000[0], str(92786), 23)
}
// 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 _sqlite3BtreeIncrVacuum(tls *crt.TLS, _p *XBtree) (r0 int32) {
var _rc int32
var _2_nOrig, _2_nFree, _2_nFin uint32
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
_sqlite3BtreeEnter(tls, _p)
func() {
if int32(_pBt.X8) != i32(2) || int32(_p.X2) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(62715), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeIncrVacuumØ00__func__Ø000))), unsafe.Pointer(str(92809)))
crt.X__builtin_abort(tls)
}
}()
if (_pBt.X5) == 0 {
_rc = i32(101)
goto _4
}
_2_nOrig = _btreePagecount(tls, _pBt)
_2_nFree = _sqlite3Get4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(36)))))
_2_nFin = _finalDbSize(tls, _pBt, _2_nOrig, _2_nFree)
if _2_nOrig < _2_nFin {
_rc = _sqlite3CorruptError(tls, i32(62724))
goto _10
}
if _2_nFree <= uint32(i32(0)) {
goto _7
}
_rc = _saveAllCursors(tls, _pBt, uint32(i32(0)), nil)
if _rc == i32(0) {
_invalidateAllOverflowCache(tls, _pBt)
_rc = _incrVacuumStep(tls, _pBt, _2_nFin, _2_nOrig, i32(0))
}
if _rc == i32(0) {
_rc = _sqlite3PagerWrite(tls, (*XPgHdr)((*XMemPage)(_pBt.X3).X23))
_sqlite3Put4byte(tls, (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XMemPage)(_pBt.X3).X19))+1*uintptr(i32(28)))), _pBt.X18)
}
goto _10
_7:
_rc = i32(101)
_10:
_4:
_sqlite3BtreeLeave(tls, _p)
return _rc
}
var _sqlite3BtreeIncrVacuumØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeIncrVacuumØ00__func__Ø000[0], str(92868), 23)
}
// 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 _sqlite3BtreeLockTable(tls *crt.TLS, _p *XBtree, _iTab int32, _isWriteLock uint8) (r0 int32) {
var _rc int32
var _1_lockType uint8
_rc = i32(0)
func() {
if int32(_p.X2) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68740), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000))), unsafe.Pointer(str(92891)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X3) == 0 {
goto _2
}
_1_lockType = uint8(i32(1) + int32(_isWriteLock))
i32(0)
func() {
if int32(_isWriteLock) != i32(0) && int32(_isWriteLock) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68744), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeLockTableØ00__func__Ø000))), unsafe.Pointer(str(71791)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_rc = _querySharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
if _rc == i32(0) {
_rc = _setSharedCacheTableLock(tls, _p, uint32(_iTab), _1_lockType)
}
_sqlite3BtreeLeave(tls, _p)
_2:
return _rc
}
var _sqlite3BtreeLockTableØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeLockTableØ00__func__Ø000[0], str(92914), 22)
}
// Add a lock on the table with root-page iTable to the shared-btree used
// by Btree handle p. Parameter eLock must be either READ_LOCK or
// WRITE_LOCK.
//
// This function assumes the following:
//
// (a) The specified Btree object p is connected to a sharable
// database (one with the BtShared.sharable flag set), and
//
// (b) No other Btree objects hold a lock that conflicts
// with the requested lock (i.e. querySharedCacheTableLock() has
// already been called and returned SQLITE_OK).
//
// SQLITE_OK is returned if the lock is added successfully. SQLITE_NOMEM
// is returned if a malloc attempt fails.
func _setSharedCacheTableLock(tls *crt.TLS, _p *XBtree, _iTable uint32, _eLock uint8) (r0 int32) {
var _pBt *XBtShared
var _pLock, _pIter *XBtLock
_pBt = (*XBtShared)(_p.X1)
_pLock = nil
func() {
if _sqlite3BtreeHoldsMutex(tls, _p) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59358), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(17487)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_eLock) != i32(1) && int32(_eLock) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59359), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(50750)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59360), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(23676)))
crt.X__builtin_abort(tls)
}
}()
func() {
if i32(0) != (((*Xsqlite3)(_p.X0).X6)&i32(16384)) && int32(_eLock) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59366), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(92936)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X3) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59370), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(92998)))
crt.X__builtin_abort(tls)
}
}()
func() {
if i32(0) != _querySharedCacheTableLock(tls, _p, _iTable, _eLock) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(59371), unsafe.Pointer((*int8)(unsafe.Pointer(&_setSharedCacheTableLockØ00__func__Ø000))), unsafe.Pointer(str(93010)))
crt.X__builtin_abort(tls)
}
}()
_pIter = (*XBtLock)(_pBt.X25)
_14:
if _pIter == nil {
goto _17
}
if ((_pIter.X1) == _iTable) && ((*XBtree)(_pIter.X0) == _p) {
_pLock = _pIter
goto _17
}
_pIter = (*XBtLock)(_pIter.X3)
goto _14
_17:
if _pLock != nil {
goto _20
}
_pLock = (*XBtLock)(_sqlite3MallocZero(tls, uint64(u32(16))))
if _pLock == nil {
return _sqlite3NomemError(tls, i32(59387))
}
*(*uint32)(unsafe.Pointer(&(_pLock.X1))) = _iTable
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLock.X0))))) = _p
*(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLock.X3))))) = (*XBtLock)(_pBt.X25)
*(**XBtLock)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBt.X25))))) = _pLock
_20:
i32(0)
if int32(_eLock) > int32(_pLock.X2) {
*(*uint8)(unsafe.Pointer(&(_pLock.X2))) = _eLock
}
return i32(0)
}
var _setSharedCacheTableLockØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_setSharedCacheTableLockØ00__func__Ø000[0], str(93065), 24)
}
// If the virtual table pVtab supports the transaction interface
// (xBegin/xRollback/xCommit and optionally xSync) and a transaction is
// not currently open, invoke the xBegin method now.
//
// If the xBegin call is successful, place the sqlite3_vtab pointer
// in the sqlite3.aVTrans array.
func _sqlite3VtabBegin(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) (r0 int32) {
var _rc, _3_i, _7_iSvpt int32
var _pModule *Xsqlite3_module
_rc = i32(0)
if ((_db.X64) > i32(0)) && ((**XVTable)(unsafe.Pointer(_db.X67)) == nil) {
return i32(6)
}
if _pVTab == nil {
return i32(0)
}
_pModule = (*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.X2).X0)
if (*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_pModule.X14)}))) == nil {
goto _3
}
_3_i = i32(0)
_4:
if _3_i >= (_db.X64) {
goto _7
}
if (*(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 4*uintptr(_3_i)))) == _pVTab {
return i32(0)
}
_3_i += 1
goto _4
_7:
_rc = _growVTrans(tls, _db)
if _rc != i32(0) {
goto _9
}
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{(_pModule.X14)})))(tls, (*Xsqlite3_vtab)(_pVTab.X2))
if _rc != i32(0) {
goto _10
}
_7_iSvpt = (_db.X76) + (_db.X75)
_addToVTrans(tls, _db, _pVTab)
if _7_iSvpt != 0 && ((*(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_pModule.X20)}))) != nil) {
*(*int32)(unsafe.Pointer(&(_pVTab.X5))) = _7_iSvpt
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32) int32
}{(_pModule.X20)})))(tls, (*Xsqlite3_vtab)(_pVTab.X2), _7_iSvpt-i32(1))
}
_10:
_9:
_3:
return _rc
}
// Grow the db->aVTrans[] array so that there is room for at least one
// more v-table. Return SQLITE_NOMEM if a malloc fails, or SQLITE_OK otherwise.
func _growVTrans(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _ARRAY_INCR, _1_nBytes int32
var _1_aVTrans **XVTable
_ARRAY_INCR = i32(5)
if ((_db.X64) % _ARRAY_INCR) != i32(0) {
goto _0
}
_1_nBytes = int32(u32(4) * uint32((_db.X64)+_ARRAY_INCR))
_1_aVTrans = (**XVTable)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_db.X67), uint64(_1_nBytes)))
if _1_aVTrans == nil {
return _sqlite3NomemError(tls, i32(125653))
}
crt.Xmemset(tls, (unsafe.Pointer)((**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aVTrans))+4*uintptr(_db.X64)))), i32(0), u32(4)*uint32(_ARRAY_INCR))
*(***XVTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_db.X67))))) = _1_aVTrans
_0:
return i32(0)
}
// Add the virtual table pVTab to the array sqlite3.aVTrans[]. Space should
// have already been reserved using growVTrans().
func _addToVTrans(tls *crt.TLS, _db *Xsqlite3, _pVTab *XVTable) {
*(**XVTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_db.X67)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_db.X64))), int32(1))))) = _pVTab
_sqlite3VtabLock(tls, _pVTab)
}
// Make a full copy of pFrom into pTo. Prior contents of pTo are
// freed before the copy is made.
func _sqlite3VdbeMemCopy(tls *crt.TLS, _pTo *XMem, _pFrom *XMem) (r0 int32) {
var _rc int32
_rc = i32(0)
func() {
if (int32(_pFrom.X1) & i32(32)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(70514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMemCopyØ00__func__Ø000))), unsafe.Pointer(str(72987)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pTo.X1) & i32(9312)) != i32(0) {
_vdbeMemClearExternAndSetNull(tls, _pTo)
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u32(20))
{
p := (*uint16)(unsafe.Pointer(&(_pTo.X1)))
*p = uint16(int32(*p) & i32(-1025))
sink14 = *p
}
if (int32(_pTo.X1) & i32(18)) == 0 {
goto _3
}
if i32(0) == (int32(_pFrom.X1) & i32(2048)) {
{
p := (*uint16)(unsafe.Pointer(&(_pTo.X1)))
*p = uint16(int32(*p) | i32(4096))
sink14 = *p
}
_rc = _sqlite3VdbeMemMakeWriteable(tls, _pTo)
}
_3:
return _rc
}
var _sqlite3VdbeMemCopyØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMemCopyØ00__func__Ø000[0], str(93089), 19)
}
// This function is invoked by the vdbe to call the xCreate method
// of the virtual table named zTab in database iDb.
//
// If an error occurs, *pzErr is set to point to an English language
// description of the error and an SQLITE_XXX error code is returned.
// In this case the caller must call sqlite3DbFree(db, ) on *pzErr.
func _sqlite3VtabCallCreate(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8, _pzErr **int8) (r0 int32) {
var _rc int32
var _zMod *int8
var _pTab *XTable
var _pMod *XModule
_rc = i32(0)
_pTab = _sqlite3FindTable(tls, _db, _zTab, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
func() {
if _pTab == nil || (_pTab.X16) == 0 || (*XVTable)(_pTab.X18) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125687), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000))), unsafe.Pointer(str(93108)))
crt.X__builtin_abort(tls)
}
}()
_zMod = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 4*uintptr(i32(0))))
_pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zMod))
if ((_pMod == nil) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{((*Xsqlite3_module)(_pMod.X0).X1)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{nil})))) || (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{(*(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_module)(_pMod.X0).X5)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{nil}))) {
*_pzErr = _sqlite3MPrintf(tls, _db, str(93150), unsafe.Pointer(_zMod))
_rc = i32(1)
goto _7
}
_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{((*Xsqlite3_module)(_pMod.X0).X1)})), _pzErr)
_7:
if _rc != i32(0) || func() int32 {
if _sqlite3GetVTable(tls, _db, _pTab) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125706), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallCreateØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _11
}
_rc = _growVTrans(tls, _db)
if _rc == i32(0) {
_addToVTrans(tls, _db, _sqlite3GetVTable(tls, _db, _pTab))
}
_11:
return _rc
}
var _sqlite3VtabCallCreateØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabCallCreateØ00__func__Ø000[0], str(93169), 22)
}
// Invoke a virtual table constructor (either xCreate or xConnect). The
// pointer to the function to invoke is passed as the fourth parameter
// to this procedure.
func _vtabCallConstructor(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _pMod *XModule, _xConstruct func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32, _pzErr **int8) (r0 int32) {
var _rc, _nArg, _iDb, _10_iCol, _11_nType, _11_i, _14_j, _14_nDel int32
var _zErr, _zModuleName, _9_zFormat, _11_zType *int8
var _10_oooHidden uint8
var _azArg **int8
var _pVTable *XVTable
var _sCtx XVtabCtx
var _pCtx *XVtabCtx
_azArg = _pTab.X17
_nArg = _pTab.X16
_zErr = nil
_pCtx = (*XVtabCtx)(_db.X66)
_0:
if _pCtx == nil {
goto _3
}
if (*XTable)(_pCtx.X1) == _pTab {
*_pzErr = _sqlite3MPrintf(tls, _db, str(93191), unsafe.Pointer(_pTab.X0))
return i32(6)
}
_pCtx = (*XVtabCtx)(_pCtx.X2)
goto _0
_3:
_zModuleName = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_pTab.X0))
if _zModuleName == nil {
return _sqlite3NomemError(tls, i32(125510))
}
_pVTable = (*XVTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(28))))
if _pVTable == nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zModuleName))
return _sqlite3NomemError(tls, i32(125516))
}
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X0))))) = _db
*(**XModule)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X1))))) = _pMod
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 4*uintptr(i32(1)))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
func() {
if (**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125525), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93233)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _xConstruct == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125526), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93247)))
crt.X__builtin_abort(tls)
}
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X1))))) = _pTab
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X0))))) = _pVTable
*(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X2))))) = (*XVtabCtx)(_db.X66)
*(*int32)(unsafe.Pointer(&(_sCtx.X3))) = i32(0)
*(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) = &_sCtx
_rc = _xConstruct(tls, _db, _pMod.X2, _nArg, _azArg, (**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X2))))), &_zErr)
*(**XVtabCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X66))))) = (*XVtabCtx)(_sCtx.X2)
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
func() {
if (*XTable)(_sCtx.X1) != _pTab {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125535), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93258)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) == _rc {
goto _14
}
if _zErr == nil {
*_pzErr = _sqlite3MPrintf(tls, _db, str(93274), unsafe.Pointer(_zModuleName))
goto _16
}
*_pzErr = _sqlite3MPrintf(tls, _db, str(24576), unsafe.Pointer(_zErr))
Xsqlite3_free(tls, (unsafe.Pointer)(_zErr))
_16:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pVTable))
goto _20
_14:
if func() int32 {
if (*Xsqlite3_vtab)(_pVTable.X2) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125545), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _20
}
crt.Xmemset(tls, _pVTable.X2, i32(0), u32(12))
*(**Xsqlite3_module)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*Xsqlite3_vtab)(_pVTable.X2).X0))))) = (*Xsqlite3_module)(_pMod.X0)
*(*int32)(unsafe.Pointer(&(_pVTable.X3))) = i32(1)
if (_sCtx.X3) == i32(0) {
_9_zFormat = str(93304)
*_pzErr = _sqlite3MPrintf(tls, _db, _9_zFormat, unsafe.Pointer(_pTab.X0))
_sqlite3VtabUnlock(tls, _pVTable)
_rc = i32(1)
goto _22
}
_10_oooHidden = u8(0)
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVTable.X6))))) = (*XVTable)(_pTab.X18)
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X18))))) = _pVTable
_10_iCol = i32(0)
_23:
if _10_iCol >= int32(_pTab.X11) {
goto _26
}
_11_zType = _sqlite3ColumnType(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_10_iCol))), str(0))
_11_i = i32(0)
_11_nType = _sqlite3Strlen30(tls, _11_zType)
_11_i = i32(0)
_27:
if _11_i >= _11_nType {
goto _30
}
if ((i32(0) == Xsqlite3_strnicmp(tls, str(93350), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType))+1*uintptr(_11_i))), i32(6))) && ((_11_i == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1))))) == i32(32)))) && ((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) == i32(32))) {
goto _30
}
_11_i += 1
goto _27
_30:
if _11_i >= _11_nType {
goto _36
}
_14_nDel = i32(6) + func() int32 {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i+i32(6))))) != 0 {
return i32(1)
}
return i32(0)
}()
_14_j = _11_i
_39:
if (_14_j + _14_nDel) > _11_nType {
goto _42
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_14_j))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_14_j+_14_nDel)))
_14_j += 1
goto _39
_42:
if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i)))) == i32(0)) && (_11_i > i32(0)) {
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1))))) != i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125587), unsafe.Pointer((*int8)(unsafe.Pointer(&_vtabCallConstructorØ00__func__Ø000))), unsafe.Pointer(str(93357)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_zType)) + 1*uintptr(_11_i-i32(1)))) = int8(i32(0))
}
{
p := (*uint8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_10_iCol))).X6)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
_10_oooHidden = uint8(i32(128))
goto _47
_36:
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | uint32(_10_oooHidden)
sink5 = *p
}
_47:
_10_iCol += 1
goto _23
_26:
_22:
_20:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zModuleName))
return _rc
_ = _sCtx
panic(0)
}
var _vtabCallConstructorØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_vtabCallConstructorØ00__func__Ø000[0], str(93373), 20)
}
// 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 _sqlite3ColumnType(tls *crt.TLS, _pCol *XColumn, _zDflt *int8) (r0 *int8) {
if (int32(_pCol.X6) & i32(4)) == i32(0) {
return _zDflt
}
return (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_pCol.X0))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(crt.Xstrlen(tls, _pCol.X0)))))))))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(1))))))))
}
// This function is invoked by the vdbe to call the xDestroy method
// of the virtual table named zTab in database iDb. This occurs
// when a DROP TABLE is mentioned.
//
// This call is a no-op if zTab is not a virtual table.
func _sqlite3VtabCallDestroy(tls *crt.TLS, _db *Xsqlite3, _iDb int32, _zTab *int8) (r0 int32) {
var _rc int32
var _pTab *XTable
var _1_p *XVTable
var _1_xDestroy func(*crt.TLS, *Xsqlite3_vtab) int32
_rc = i32(0)
_pTab = _sqlite3FindTable(tls, _db, _zTab, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
if _pTab == nil || func() int32 {
if (*XVTable)(_pTab.X18) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125811), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _3
}
_1_p = (*XVTable)(_pTab.X18)
_4:
if _1_p == nil {
goto _7
}
func() {
if (*Xsqlite3_vtab)(_1_p.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000))), unsafe.Pointer(str(93393)))
crt.X__builtin_abort(tls)
}
}()
if ((*Xsqlite3_vtab)(_1_p.X2).X1) > i32(0) {
return i32(6)
}
_1_p = (*XVTable)(_1_p.X6)
goto _4
_7:
_1_p = _vtabDisconnectAll(tls, _db, _pTab)
_1_xDestroy = *(*func(*crt.TLS, *Xsqlite3_vtab) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_module)((*XModule)(_1_p.X1).X0).X5)}))
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{_1_xDestroy})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab) int32
}{nil})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000))), unsafe.Pointer(str(93402)))
crt.X__builtin_abort(tls)
}
}()
_rc = _1_xDestroy(tls, (*Xsqlite3_vtab)(_1_p.X2))
if _rc == i32(0) {
func() {
if (*XVTable)(_pTab.X18) != _1_p || (*XVTable)(_1_p.X6) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125826), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallDestroyØ00__func__Ø000))), unsafe.Pointer(str(93414)))
crt.X__builtin_abort(tls)
}
}()
*(**Xsqlite3_vtab)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X2))))) = nil
*(**XVTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X18))))) = nil
_sqlite3VtabUnlock(tls, _1_p)
}
_3:
return _rc
}
var _sqlite3VtabCallDestroyØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabCallDestroyØ00__func__Ø000[0], str(93446), 23)
}
// Set the maximum page count for a database if mxPage is positive.
// No changes are made if mxPage is 0 or negative.
// Regardless of the value of mxPage, return the maximum page count.
func _sqlite3BtreeMaxPageCount(tls *crt.TLS, _p *XBtree, _mxPage int32) (r0 int32) {
var _n int32
_sqlite3BtreeEnter(tls, _p)
_n = _sqlite3PagerMaxPageCount(tls, (*XPager)((*XBtShared)(_p.X1).X0), _mxPage)
_sqlite3BtreeLeave(tls, _p)
return _n
}
// Attempt to set the maximum database page count if mxPage is positive.
// Make no changes if mxPage is zero or negative. And never reduce the
// maximum page count below the current size of the database.
//
// Regardless of mxPage, return the current maximum page count.
func _sqlite3PagerMaxPageCount(tls *crt.TLS, _pPager *XPager, _mxPage int32) (r0 int32) {
if _mxPage > i32(0) {
*(*uint32)(unsafe.Pointer(&(_pPager.X49))) = uint32(_mxPage)
}
func() {
if int32(_pPager.X14) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50719), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000))), unsafe.Pointer(str(93469)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pPager.X49) < (_pPager.X22) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(50720), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerMaxPageCountØ00__func__Ø000))), unsafe.Pointer(str(93496)))
crt.X__builtin_abort(tls)
}
}()
return int32(_pPager.X49)
}
var _sqlite3PagerMaxPageCountØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerMaxPageCountØ00__func__Ø000[0], str(93527), 25)
}
// This function returns a pointer to a nul-terminated string in memory
// obtained from sqlite3DbMalloc(). If sqlite3.nVdbeExec is 1, then the
// string contains a copy of zRawSql but with host parameters expanded to
// their current bindings. Or, if sqlite3.nVdbeExec is greater than 1,
// then the returned string holds a copy of zRawSql with "-- " prepended
// to each line of text.
//
// If the SQLITE_TRACE_SIZE_LIMIT macro is defined to an integer, then
// then long strings and blobs are truncated to that many bytes. This
// can be used to prevent unreasonably large trace strings when dealing
// with large (multi-megabyte) strings and blobs.
//
// The calling function is responsible for making sure the memory returned
// is eventually freed.
//
// ALGORITHM: Scan the input string looking for host parameters in any of
// these forms: ?, ?N, $A, @A, :A. Take care to avoid text within
// string literals, quoted identifier names, and comments. For text forms,
// the host parameter index is found by scanning the prepared
// statement for the corresponding OP_Variable opcode. Once the host
// parameter index is known, locate the value in p->aVar[]. Then render
// the value as a literal in place of the host parameter name.
func _sqlite3VdbeExpandSql(tls *crt.TLS, _p *TVdbe, _zRawSql *int8) (r0 *int8) {
var _idx, _nextIndex, _n, _nToken, _i, _13_nOut, _17_nOut int32
var _2_zStart *int8
var _13_enc uint8
var _db *Xsqlite3
var _utf8 XMem
var _pVar *XMem
var _zBase [100]int8
var _out XStrAccum
_idx = i32(0)
_nextIndex = i32(1)
_db = (*Xsqlite3)(_p.X0)
_sqlite3StrAccumInit(tls, &_out, nil, (*int8)(unsafe.Pointer(&_zBase)), int32(u32(100)), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0)))))
if (_db.X37) <= i32(1) {
goto _0
}
_1:
if (*_zRawSql) == 0 {
goto _2
}
_2_zStart = _zRawSql
_3:
if (int32(*postInc0(&_zRawSql, 1)) != i32(10)) && ((*_zRawSql) != 0) {
goto _3
}
_sqlite3StrAccumAppend(tls, &_out, str(72354), i32(3))
func() {
if int32((uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart)))/1) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78101), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93552)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StrAccumAppend(tls, &_out, _2_zStart, int32((uintptr(unsafe.Pointer(_zRawSql))-uintptr(unsafe.Pointer(_2_zStart)))/1))
goto _1
_2:
goto _10
_0:
if int32(_p.X4) == i32(0) {
_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _sqlite3Strlen30(tls, _zRawSql))
goto _10
}
_11:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) == 0 {
goto _12
}
_n = _findNextHostParameter(tls, _zRawSql, &_nToken)
func() {
if _n <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(1358)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StrAccumAppend(tls, &_out, _zRawSql, _n)
{
p := &_zRawSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink0 = *p
}
func() {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) == 0 && _nToken != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78112), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93575)))
crt.X__builtin_abort(tls)
}
}()
if _nToken == i32(0) {
goto _12
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(63) {
goto _19
}
if _nToken > i32(1) {
func() {
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(1))))))))) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78116), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93599)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3GetInt32(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql))+1*uintptr(i32(1)))), &_idx)
goto _23
}
_idx = _nextIndex
_23:
goto _24
_19:
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(58) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(36) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(64) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRawSql)) + 1*uintptr(i32(0))))) != i32(35) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93626)))
crt.X__builtin_abort(tls)
}
}()
_idx = _sqlite3VdbeParameterIndex(tls, _p, _zRawSql, _nToken)
func() {
if _idx <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78129), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93699)))
crt.X__builtin_abort(tls)
}
}()
_24:
{
p := &_zRawSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nToken)))
sink0 = *p
}
_nextIndex = _idx + i32(1)
func() {
if _idx <= i32(0) || _idx > int32(_p.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78133), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93705)))
crt.X__builtin_abort(tls)
}
}()
_pVar = (*XMem)(unsafe.Pointer(uintptr(_p.X24) + 48*uintptr(_idx-i32(1))))
if (int32(_pVar.X1) & i32(1)) != 0 {
_sqlite3StrAccumAppend(tls, &_out, str(155), i32(4))
goto _47
}
if (int32(_pVar.X1) & i32(4)) != 0 {
_sqlite3XPrintf(tls, &_out, str(6348), *(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0))))))
goto _47
}
if (int32(_pVar.X1) & i32(8)) != 0 {
_sqlite3XPrintf(tls, &_out, str(6367), *(*float64)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0))))))
goto _47
}
if (int32(_pVar.X1) & i32(2)) == 0 {
goto _41
}
_13_enc = _db.X14
if int32(_13_enc) == i32(1) {
goto _42
}
crt.Xmemset(tls, (unsafe.Pointer)(&_utf8), i32(0), u32(48))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_utf8.X9))))) = _db
_sqlite3VdbeMemSetStr(tls, &_utf8, _pVar.X5, _pVar.X4, _13_enc, nil)
if i32(7) == _sqlite3VdbeChangeEncoding(tls, &_utf8, i32(1)) {
*(*uint8)(unsafe.Pointer(&(_out.X6))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&(_out.X4))) = uint32(i32(0))
}
_pVar = &_utf8
_42:
_13_nOut = _pVar.X4
_sqlite3XPrintf(tls, &_out, str(93727), _13_nOut, unsafe.Pointer(_pVar.X5))
if int32(_13_enc) != i32(1) {
_sqlite3VdbeMemRelease(tls, &_utf8)
}
goto _47
_41:
if (int32(_pVar.X1) & i32(16384)) != 0 {
_sqlite3XPrintf(tls, &_out, str(93734), *(*int32)(unsafe.Pointer((*t15)(unsafe.Pointer(&(_pVar.X0))))))
goto _47
}
func() {
if (int32(_pVar.X1) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78176), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeExpandSqlØ00__func__Ø000))), unsafe.Pointer(str(93747)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StrAccumAppend(tls, &_out, str(93770), i32(2))
_17_nOut = _pVar.X4
_i = i32(0)
_50:
if _i >= _17_nOut {
goto _53
}
_sqlite3XPrintf(tls, &_out, str(93773), int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pVar.X5)) + 1*uintptr(_i))))&i32(255))
_i += 1
goto _50
_53:
_sqlite3StrAccumAppend(tls, &_out, str(93778), i32(1))
_47:
goto _11
_12:
_10:
if (_out.X6) != 0 {
_sqlite3StrAccumReset(tls, &_out)
}
return _sqlite3StrAccumFinish(tls, &_out)
_ = _out
_ = _utf8
_ = _zBase
panic(0)
}
var _sqlite3VdbeExpandSqlØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeExpandSqlØ00__func__Ø000[0], str(93780), 21)
}
// zSql is a zero-terminated string of UTF-8 SQL text. Return the number of
// bytes in this text up to but excluding the first character in
// a host parameter. If the text contains no host parameters, return
// the total number of bytes in the text.
func _findNextHostParameter(tls *crt.TLS, _zSql *int8, _pnToken *int32) (r0 int32) {
var _tokenType, _nTotal, _n int32
_nTotal = i32(0)
*_pnToken = i32(0)
_0:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSql)) + 1*uintptr(i32(0))))) == 0 {
goto _1
}
_n = _sqlite3GetToken(tls, (*uint8)(unsafe.Pointer(_zSql)), &_tokenType)
func() {
if _n <= i32(0) || _tokenType == i32(164) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(78041), unsafe.Pointer((*int8)(unsafe.Pointer(&_findNextHostParameterØ00__func__Ø000))), unsafe.Pointer(str(93801)))
crt.X__builtin_abort(tls)
}
}()
if _tokenType == i32(135) {
*_pnToken = _n
goto _1
}
{
p := &_nTotal
*p = (*p) + _n
sink1 = *p
}
{
p := &_zSql
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n)))
sink0 = *p
}
goto _0
_1:
return _nTotal
}
var _findNextHostParameterØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_findNextHostParameterØ00__func__Ø000[0], str(93830), 22)
}
// The sqlite3_strlike() interface. Return 0 on a match and non-zero for
// a miss - like strcmp().
func Xsqlite3_strlike(tls *crt.TLS, _zPattern *int8, _zStr *int8, _esc uint32) (r0 int32) {
return _patternCompare(tls, (*uint8)(unsafe.Pointer(_zPattern)), (*uint8)(unsafe.Pointer(_zStr)), &_likeInfoNorm, _esc)
}
var _likeInfoNorm TcompareInfo
func init() {
_likeInfoNorm = TcompareInfo{X0: u8(37), X1: u8(95), X2: u8(0), X3: u8(1)}
}
// This function is called after a transaction has been committed. It
// invokes callbacks registered with sqlite3_wal_hook() as required.
func _doWalCallbacks(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _rc, _i, _2_nEntry int32
var _1_pBt *XBtree
_rc = i32(0)
_i = i32(0)
_0:
if _i >= (_db.X5) {
goto _3
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_pBt == nil {
goto _4
}
_sqlite3BtreeEnter(tls, _1_pBt)
_2_nEntry = _sqlite3PagerWalCallback(tls, _sqlite3BtreePager(tls, _1_pBt))
_sqlite3BtreeLeave(tls, _1_pBt)
if (((*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
}{(_db.X51)}))) != nil) && (_2_nEntry > i32(0))) && (_rc == i32(0)) {
_rc = (*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
}{(_db.X51)})))(tls, _db.X52, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X0, _2_nEntry)
}
_4:
_i += 1
goto _0
_3:
return _rc
}
func _sqlite3PagerWalCallback(tls *crt.TLS, _pPager *XPager) (r0 int32) {
return _sqlite3WalCallback(tls, (*XWal)(_pPager.X60))
}
// Return the value to pass to a sqlite3_wal_hook callback, the
// number of frames in the WAL at the point of the last commit since
// sqlite3WalCallback() was called. If no commits have occurred since
// the last call, then return 0.
func _sqlite3WalCallback(tls *crt.TLS, _pWal *XWal) (r0 int32) {
var _ret uint32
_ret = u32(0)
if _pWal != nil {
_ret = _pWal.X3
*(*uint32)(unsafe.Pointer(&(_pWal.X3))) = uint32(i32(0))
}
return int32(_ret)
}
// Rerun the compilation of a statement after a schema change.
//
// If the statement is successfully recompiled, return SQLITE_OK. Otherwise,
// if the statement cannot be recompiled because another connection has
// locked the sqlite3_master table, return SQLITE_LOCKED. If any other error
// occurs, return SQLITE_SCHEMA.
func _sqlite3Reprepare(tls *crt.TLS, _p *TVdbe) (r0 int32) {
var _rc int32
var _zSql *int8
var _pNew unsafe.Pointer
var _db *Xsqlite3
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_sqlite3VdbeDb(tls, _p).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116374), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(93852)))
crt.X__builtin_abort(tls)
}
}()
_zSql = Xsqlite3_sql(tls, (unsafe.Pointer)(_p))
func() {
if _zSql == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116376), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(24614)))
crt.X__builtin_abort(tls)
}
}()
_db = _sqlite3VdbeDb(tls, _p)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_db.X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116378), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(863)))
crt.X__builtin_abort(tls)
}
}()
_rc = _sqlite3LockAndPrepare(tls, _db, _zSql, i32(-1), i32(0), _p, &_pNew, nil)
if _rc == 0 {
goto _6
}
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
func() {
if _pNew != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116384), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(93896)))
crt.X__builtin_abort(tls)
}
}()
return _rc
_6:
func() {
if _pNew == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116387), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReprepareØ00__func__Ø000))), unsafe.Pointer(str(21146)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeSwap(tls, (*TVdbe)(_pNew), _p)
_sqlite3TransferBindings(tls, _pNew, (unsafe.Pointer)(_p))
_sqlite3VdbeResetStepResult(tls, (*TVdbe)(_pNew))
_sqlite3VdbeFinalize(tls, (*TVdbe)(_pNew))
return i32(0)
}
var _sqlite3ReprepareØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ReprepareØ00__func__Ø000[0], str(93904), 17)
}
// Return the SQL associated with a prepared statement
func Xsqlite3_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
return func() *int8 {
if _p != nil {
return (_p.X36)
}
return nil
}()
}
// Swap all content between two VDBE structures.
func _sqlite3VdbeSwap(tls *crt.TLS, _pA *TVdbe, _pB *TVdbe) {
var _zTmp *int8
var _pTmp *TVdbe
var _tmp TVdbe
func() {
if (*Xsqlite3)(_pA.X0) != (*Xsqlite3)(_pB.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSwapØ00__func__Ø000))), unsafe.Pointer(str(93921)))
crt.X__builtin_abort(tls)
}
}()
_tmp = *_pA
*_pA = *_pB
*_pB = _tmp
_pTmp = (*TVdbe)(_pA.X2)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X2))))) = (*TVdbe)(_pB.X2)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pB.X2))))) = _pTmp
_pTmp = (*TVdbe)(_pA.X1)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X1))))) = (*TVdbe)(_pB.X1)
*(**TVdbe)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pB.X1))))) = _pTmp
_zTmp = _pA.X36
*(**int8)(unsafe.Pointer(&(_pA.X36))) = _pB.X36
*(**int8)(unsafe.Pointer(&(_pB.X36))) = _zTmp
storebits18((*int16)(unsafe.Pointer(&(_pB.X32))), int16((uint32((_pA.X32)>>uint(i32(9)))<>uint(i32(31))), 512, 9)
*(*uint32)(unsafe.Pointer(&(_pB.X41))) = _pA.X41
}
var _sqlite3VdbeSwapØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSwapØ00__func__Ø000[0], str(93936), 16)
}
// Transfer all bindings from the first statement over to the second.
func _sqlite3TransferBindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
var _i int32
var _pFrom, _pTo *TVdbe
_pFrom = (*TVdbe)(_pFromStmt)
_pTo = (*TVdbe)(_pToStmt)
func() {
if (*Xsqlite3)(_pTo.X0) != (*Xsqlite3)(_pFrom.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77607), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000))), unsafe.Pointer(str(73018)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pTo.X4) != int32(_pFrom.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77608), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TransferBindingsØ00__func__Ø000))), unsafe.Pointer(str(93952)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.X0).X3))
_i = i32(0)
_4:
if _i >= int32(_pFrom.X4) {
goto _7
}
_sqlite3VdbeMemMove(tls, (*XMem)(unsafe.Pointer(uintptr(_pTo.X24)+48*uintptr(_i))), (*XMem)(unsafe.Pointer(uintptr(_pFrom.X24)+48*uintptr(_i))))
_i += 1
goto _4
_7:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pTo.X0).X3))
return i32(0)
}
var _sqlite3TransferBindingsØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TransferBindingsØ00__func__Ø000[0], str(93975), 24)
}
// Each VDBE holds the result of the most recent sqlite3_step() call
// in p->rc. This routine sets that result back to SQLITE_OK.
func _sqlite3VdbeResetStepResult(tls *crt.TLS, _p *TVdbe) {
*(*int32)(unsafe.Pointer(&(_p.X10))) = i32(0)
}
var _sqlite3_stepØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_stepØ00__func__Ø000[0], str(93999), 13)
}
// Pragma virtual table module xEof method.
func _pragmaVtabEof(tls *crt.TLS, _pVtabCursor *Xsqlite3_file) (r0 int32) {
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
return bool2int(_pCsr.X1 == nil)
}
// The xColumn method simply returns the corresponding column from
// the PRAGMA.
func _pragmaVtabColumn(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _ctx *Xsqlite3_context, _i int32) (r0 int32) {
var _pTab *XPragmaVtab
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
_pTab = (*XPragmaVtab)(unsafe.Pointer((*Xsqlite3_vtab)(_pVtabCursor.X0)))
if _i < int32(_pTab.X4) {
Xsqlite3_result_value(tls, _ctx, Xsqlite3_column_value(tls, _pCsr.X1, _i))
goto _1
}
Xsqlite3_result_text(tls, _ctx, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]*int8)(unsafe.Pointer(&(_pCsr.X3))))) + 4*uintptr(_i-int32(_pTab.X4)))), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_1:
return i32(0)
}
// SQLITE_OMIT_UTF16
func Xsqlite3_result_value(tls *crt.TLS, _pCtx *Xsqlite3_context, _pValue *XMem) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76537), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_valueØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemCopy(tls, (*XMem)(_pCtx.X0), _pValue)
}
var _sqlite3_result_valueØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_valueØ00__func__Ø000[0], str(94012), 21)
}
// Pragma virtual table module xRowid method.
func _pragmaVtabRowid(tls *crt.TLS, _pVtabCursor *Xsqlite3_file, _p *int64) (r0 int32) {
var _pCsr *XPragmaVtabCursor
_pCsr = (*XPragmaVtabCursor)(unsafe.Pointer(_pVtabCursor))
*_p = _pCsr.X2
return i32(0)
}
// Check to see if virtual table module pMod can be have an eponymous
// virtual table instance. If it can, create one if one does not already
// exist. Return non-zero if the eponymous virtual table instance exists
// when this routine returns, and return zero if it does not exist.
//
// An eponymous virtual table instance is one that is named after its
// module, and more importantly, does not require a CREATE VIRTUAL TABLE
// statement in order to come into existance. Eponymous virtual table
// instances always exist. They cannot be DROP-ed.
//
// Any virtual table module for which xConnect and xCreate are the same
// method can have an eponymous virtual table instance.
func _sqlite3VtabEponymousTableInit(tls *crt.TLS, _pParse *XParse, _pMod *XModule) (r0 int32) {
var _rc int32
var _zErr *int8
var _db *Xsqlite3
var _pTab *XTable
var _pModule *Xsqlite3_module
_pModule = (*Xsqlite3_module)(_pMod.X0)
_zErr = nil
_db = (*Xsqlite3)(_pParse.X0)
if (*XTable)(_pMod.X4) != nil {
return i32(1)
}
if (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{(_pModule.X1)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{nil}))) && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{(_pModule.X1)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32
}{(*(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{(_pModule.X2)})))}))) {
return i32(0)
}
_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80))))
if _pTab == nil {
return i32(0)
}
*(**int8)(unsafe.Pointer(&(_pTab.X0))) = _sqlite3DbStrDup(tls, _db, _pMod.X1)
if (_pTab.X0) == nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pTab))
return i32(0)
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pMod.X4))))) = _pTab
*(*uint32)(unsafe.Pointer(&(_pTab.X8))) = uint32(i32(1))
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4)
func() {
if (_pTab.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126139), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabEponymousTableInitØ00__func__Ø000))), unsafe.Pointer(str(94033)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1))
_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.X0))
_addModuleArgument(tls, _db, _pTab, nil)
_addModuleArgument(tls, _db, _pTab, _sqlite3DbStrDup(tls, _db, _pTab.X0))
_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{(_pModule.X2)})), &_zErr)
if _rc != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_zErr))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_sqlite3VtabEponymousTableClear(tls, _db, _pMod)
return i32(0)
}
return i32(1)
}
var _sqlite3VtabEponymousTableInitØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabEponymousTableInitØ00__func__Ø000[0], str(94053), 30)
}
// Add a new module argument to pTable->azModuleArg[].
// The string is not copied - the pointer is stored. The
// string will be freed automatically when the table is
// deleted.
func _addModuleArgument(tls *crt.TLS, _db *Xsqlite3, _pTable *XTable, _zArg *int8) {
var _nBytes, _2_i int32
var _azModuleArg **int8
_nBytes = int32(u32(4) * uint32(i32(2)+(_pTable.X16)))
_azModuleArg = (**int8)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pTable.X17), uint64(_nBytes)))
if _azModuleArg == nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zArg))
goto _1
}
_2_i = postInc1((*int32)(unsafe.Pointer(&(_pTable.X16))), int32(1))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azModuleArg)) + 4*uintptr(_2_i))) = _zArg
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azModuleArg)) + 4*uintptr(_2_i+i32(1)))) = nil
*(***int8)(unsafe.Pointer(&(_pTable.X17))) = _azModuleArg
_1:
}
// The Table structure pTable is really a VIEW. Fill in the names of
// the columns of the view in the pTable structure. Return the number
// of errors. If an error is seen leave an error message in pParse->zErrMsg.
func _sqlite3ViewGetColumnNames(tls *crt.TLS, _pParse *XParse, _pTable *XTable) (r0 int32) {
var _nErr, _n int32
var _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
var _db *Xsqlite3
var _pSelTab *XTable
var _pSel *XSelect
_nErr = i32(0)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pTable == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94083)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3VtabCallConnect(tls, _pParse, _pTable) != 0 {
return i32(1)
}
if (_pTable.X16) != 0 {
return i32(0)
}
if int32(_pTable.X11) > i32(0) {
return i32(0)
}
if int32(_pTable.X11) < i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(94090), unsafe.Pointer(_pTable.X0))
return i32(1)
}
func() {
if int32(_pTable.X11) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94120)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_pTable.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101896), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94136)))
crt.X__builtin_abort(tls)
}
}()
_pSel = _sqlite3SelectDup(tls, _db, (*XSelect)(_pTable.X3), i32(0))
if _pSel == nil {
goto _10
}
_n = _pParse.X17
_sqlite3SrcListAssignCursors(tls, _pParse, (*XSrcList)(_pSel.X8))
*(*int16)(unsafe.Pointer(&(_pTable.X11))) = int16(i32(-1))
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1
_xAuth = _db.X59
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = nil
_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSel)
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _xAuth
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = _n
if (*XExprList)(_pTable.X6) == nil {
goto _11
}
_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pTable.X6), (*int16)(unsafe.Pointer(&(_pTable.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X1))))))
if ((int32(_db.X17) == i32(0)) && ((_pParse.X16) == i32(0))) && (int32(_pTable.X11) == ((*XExprList)(_pSel.X0).X0)) {
_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTable, _pSel)
}
goto _21
_11:
if _pSelTab != nil {
func() {
if (*XColumn)(_pTable.X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101931), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94152)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_pTable.X11))) = _pSelTab.X11
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X1))))) = (*XColumn)(_pSelTab.X1)
*(*int16)(unsafe.Pointer(&(_pSelTab.X11))) = int16(i32(0))
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelTab.X1))))) = nil
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pTable.X20)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101936), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ViewGetColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94168)))
crt.X__builtin_abort(tls)
}
}()
goto _21
}
*(*int16)(unsafe.Pointer(&(_pTable.X11))) = int16(i32(0))
_nErr += 1
_21:
_sqlite3DeleteTable(tls, _db, _pSelTab)
_sqlite3SelectDelete(tls, _db, _pSel)
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1
goto _22
_10:
_nErr += 1
_22:
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)(_pTable.X20).X9)))
*p = uint16(int32(*p) | i32(2))
sink14 = *p
}
return _nErr
}
var _sqlite3ViewGetColumnNamesØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ViewGetColumnNamesØ00__func__Ø000[0], str(94215), 26)
}
// This function is invoked by the parser to call the xConnect() method
// of the virtual table pTab. If an error occurs, an error code is returned
// and an error left in pParse.
//
// This call is a no-op if table pTab is not a virtual table.
func _sqlite3VtabCallConnect(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 int32) {
var _rc int32
var _zMod, _2_zModule, _3_zErr *int8
var _db *Xsqlite3
var _pMod *XModule
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabCallConnectØ00__func__Ø000))), unsafe.Pointer(str(94241)))
crt.X__builtin_abort(tls)
}
}()
if ((_pTab.X16) == 0) || (_sqlite3GetVTable(tls, _db, _pTab) != nil) {
return i32(0)
}
_zMod = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 4*uintptr(i32(0))))
_pMod = (*XModule)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&(_db.X65))), _zMod))
if _pMod == nil {
_2_zModule = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X17)) + 4*uintptr(i32(0))))
_sqlite3ErrorMsg(tls, _pParse, str(93150), unsafe.Pointer(_2_zModule))
_rc = i32(1)
goto _5
}
_3_zErr = nil
_rc = _vtabCallConstructor(tls, _db, _pTab, _pMod, *(*func(*crt.TLS, *Xsqlite3, unsafe.Pointer, int32, **int8, **Xsqlite3_vtab, **int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
}{((*Xsqlite3_module)(_pMod.X0).X2)})), &_3_zErr)
if _rc != i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_3_zErr))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zErr))
_5:
return _rc
}
var _sqlite3VtabCallConnectØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabCallConnectØ00__func__Ø000[0], str(94246), 23)
}
// Given a SELECT statement, generate a Table structure that describes
// the result set of that SELECT.
func _sqlite3ResultSetOfSelect(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 *XTable) {
var _savedFlags int32
var _db *Xsqlite3
var _pTab *XTable
_db = (*Xsqlite3)(_pParse.X0)
_savedFlags = _db.X6
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-5)
sink1 = *p
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(64)
sink1 = *p
}
_sqlite3SelectPrep(tls, _pParse, _pSelect, nil)
if (_pParse.X16) != 0 {
return nil
}
_0:
if (*XSelect)(_pSelect.X13) != nil {
_pSelect = (*XSelect)(_pSelect.X13)
goto _0
}
*(*int32)(unsafe.Pointer(&(_db.X6))) = _savedFlags
_pTab = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80))))
if _pTab == nil {
return nil
}
func() {
if ((*t7)(unsafe.Pointer(&(_db.X58))).X0) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118340), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000))), unsafe.Pointer(str(94269)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pTab.X8))) = uint32(i32(1))
*(**int8)(unsafe.Pointer(&(_pTab.X0))) = nil
*(*int16)(unsafe.Pointer(&(_pTab.X12))) = int16(i32(200))
func() {
if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118343), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResultSetOfSelectØ00__func__Ø000))), unsafe.Pointer(str(48127)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ColumnsFromExprList(tls, _pParse, (*XExprList)(_pSelect.X0), (*int16)(unsafe.Pointer(&(_pTab.X11))), (**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X1))))))
_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _pTab, _pSelect)
*(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1))
if (_db.X17) != 0 {
_sqlite3DeleteTable(tls, _db, _pTab)
return nil
}
return _pTab
}
var _sqlite3ResultSetOfSelectØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ResultSetOfSelectØ00__func__Ø000[0], str(94292), 25)
}
// Add type and collation information to a column list based on
// a SELECT statement.
//
// The column list presumably came from selectColumnNamesFromExprList().
// The column list has only names, not types or collations. This
// routine goes through and adds the types and collations.
//
// This routine requires that all identifiers in the SELECT
// statement be resolved.
func _sqlite3SelectAddColumnTypeAndCollation(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pSelect *XSelect) {
var _i, _1_n, _1_m int32
var _szAll uint64
var _1_zType *int8
var _db *Xsqlite3
var _a *TExprList_item
var _p *XExpr
var _pCol *XColumn
var _pColl *XCollSeq
var _sNC XNameContext
_db = (*Xsqlite3)(_pParse.X0)
_szAll = u64(0)
func() {
if _pSelect == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118287), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000))), unsafe.Pointer(str(94317)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pSelect.X3) & uint32(i32(4))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118288), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000))), unsafe.Pointer(str(94328)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pTab.X11) != ((*XExprList)(_pSelect.X0).X0) && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118289), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000))), unsafe.Pointer(str(94365)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) != 0 {
return
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = (*XSrcList)(_pSelect.X8)
_a = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))
*func() **XColumn { _i = i32(0); return &_pCol }() = (*XColumn)(_pTab.X1)
_8:
if _i >= int32(_pTab.X11) {
goto _11
}
_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_a)) + 20*uintptr(_i))).X0)
_1_zType = _columnTypeImpl(tls, &_sNC, _p, (*uint8)(unsafe.Pointer(&(_pCol.X5))))
{
p := &_szAll
*p = (*p) + uint64(_pCol.X5)
sink17 = *p
}
*(*int8)(unsafe.Pointer(&(_pCol.X4))) = _sqlite3ExprAffinity(tls, _p)
if _1_zType == nil || store1(&_1_m, _sqlite3Strlen30(tls, _1_zType)) <= i32(0) {
goto _13
}
_1_n = _sqlite3Strlen30(tls, _pCol.X0)
*(**int8)(unsafe.Pointer(&(_pCol.X0))) = (*int8)(_sqlite3DbReallocOrFree(tls, _db, (unsafe.Pointer)(_pCol.X0), uint64((_1_n+_1_m)+i32(2))))
if (_pCol.X0) != nil {
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pCol.X0))+1*uintptr(_1_n+i32(1))))), (unsafe.Pointer)(_1_zType), uint32(_1_m+i32(1)))
{
p := (*uint8)(unsafe.Pointer(&(_pCol.X6)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
}
_13:
if int32(_pCol.X4) == i32(0) {
*(*int8)(unsafe.Pointer(&(_pCol.X4))) = int8(i32(65))
}
_pColl = _sqlite3ExprCollSeq(tls, _pParse, _p)
if (_pColl != nil) && ((_pCol.X2) == nil) {
*(**int8)(unsafe.Pointer(&(_pCol.X2))) = _sqlite3DbStrDup(tls, _db, _pColl.X0)
}
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
goto _8
_11:
*(*int16)(unsafe.Pointer(&(_pTab.X13))) = _sqlite3LogEst(tls, _szAll*uint64(i32(4)))
_ = _sNC
}
var _sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000 [39]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SelectAddColumnTypeAndCollationØ00__func__Ø000[0], str(94420), 39)
}
func _columnTypeImpl(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr, _pEstWidth *uint8) (r0 *int8) {
var _j, _2_iCol int32
var _zType *int8
var _estWidth uint8
var _2_pTab *XTable
var _3_pTabList *XSrcList
var _2_pS, _12_pS *XSelect
var _8_p, _12_p *XExpr
var _8_sNC, _12_sNC XNameContext
_zType = nil
_estWidth = u8(1)
func() {
if _pExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117910), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(43636)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSrcList)(_pNC.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117911), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(94459)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_pExpr.X0) {
case i32(119):
goto _7
case i32(152):
goto _5
case i32(154):
goto _5
default:
goto _8
}
_5:
_2_pTab = nil
_2_pS = nil
_2_iCol = int32(_pExpr.X9)
_9:
if _pNC == nil || _2_pTab != nil {
goto _10
}
_3_pTabList = (*XSrcList)(_pNC.X1)
_j = i32(0)
_12:
if _j >= (_3_pTabList.X0) || ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2)))))+68*uintptr(_j))).X11) == (_pExpr.X8) {
goto _16
}
_j += 1
goto _12
_16:
if _j < (_3_pTabList.X0) {
_2_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2))))) + 68*uintptr(_j))).X4)
_2_pS = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_3_pTabList.X2))))) + 68*uintptr(_j))).X5)
goto _18
}
_pNC = (*XNameContext)(_pNC.X4)
_18:
goto _9
_10:
if _2_pTab == nil {
goto _8
}
func() {
if _2_pTab == nil || (*XTable)(_pExpr.X14) != _2_pTab {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117956), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(94476)))
crt.X__builtin_abort(tls)
}
}()
if _2_pS == nil {
goto _23
}
if (_2_iCol >= i32(0)) && func() int32 {
if _2_iCol < ((*XExprList)(_2_pS.X0).X0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117962), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_8_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_2_pS.X0).X2))))) + 20*uintptr(_2_iCol))).X0)
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X1))))) = (*XSrcList)(_2_pS.X8)
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X4))))) = _pNC
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_8_sNC.X0))))) = (*XParse)(_pNC.X0)
_zType = _columnTypeImpl(tls, &_8_sNC, _8_p, &_estWidth)
}
goto _29
_23:
if (*XSchema)(_2_pTab.X20) == nil {
goto _29
}
func() {
if _2_pS != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117979), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(94502)))
crt.X__builtin_abort(tls)
}
}()
if _2_iCol < i32(0) {
_2_iCol = int32(_2_pTab.X10)
}
func() {
if _2_iCol != i32(-1) && (_2_iCol < i32(0) || _2_iCol >= int32(_2_pTab.X11)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117981), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(94506)))
crt.X__builtin_abort(tls)
}
}()
if _2_iCol < i32(0) {
_zType = str(25792)
goto _38
}
_zType = _sqlite3ColumnType(tls, (*XColumn)(unsafe.Pointer(uintptr(_2_pTab.X1)+16*uintptr(_2_iCol))), nil)
_estWidth = (*XColumn)(unsafe.Pointer(uintptr(_2_pTab.X1) + 16*uintptr(_2_iCol))).X5
_38:
_29:
goto _8
_7:
_12_pS = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_12_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_12_pS.X0).X2))))) + 20*uintptr(i32(0)))).X0)
func() {
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118016), unsafe.Pointer((*int8)(unsafe.Pointer(&_columnTypeImplØ00__func__Ø000))), unsafe.Pointer(str(45159)))
crt.X__builtin_abort(tls)
}
}()
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X1))))) = (*XSrcList)(_12_pS.X8)
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X4))))) = _pNC
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_sNC.X0))))) = (*XParse)(_pNC.X0)
_zType = _columnTypeImpl(tls, &_12_sNC, _12_p, &_estWidth)
goto _8
_8:
if _pEstWidth != nil {
*_pEstWidth = _estWidth
}
return _zType
_ = _8_sNC
_ = _12_sNC
panic(0)
}
var _columnTypeImplØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_columnTypeImplØ00__func__Ø000[0], str(94547), 15)
}
// Return the collation sequence for the expression pExpr. If
// there is no defined collating sequence, return NULL.
//
// 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 _sqlite3ExprCollSeq(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 *XCollSeq) {
var _1_op, _4_j, _9_i int32
var _5_zColl *int8
var _db *Xsqlite3
var _p, _8_pNext *XExpr
var _pColl *XCollSeq
_db = (*Xsqlite3)(_pParse.X0)
_pColl = nil
_p = _pExpr
_0:
if _p == nil {
goto _1
}
_1_op = int32(_p.X0)
if ((_p.X2) & uint32(i32(512))) != 0 {
goto _1
}
if (_1_op == i32(37)) || (_1_op == i32(156)) {
_p = (*XExpr)(_p.X4)
goto _0
}
if (_1_op == i32(94)) || ((_1_op == i32(157)) && (int32(_p.X12) == i32(94))) {
_pColl = _sqlite3GetCollSeq(tls, _pParse, _db.X14, nil, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))
goto _1
}
if _1_op != i32(154) && _1_op != i32(152) && _1_op != i32(157) && _1_op != i32(61) || (*XTable)(_p.X14) == nil {
goto _12
}
_4_j = int32(_p.X9)
if _4_j >= i32(0) {
_5_zColl = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_p.X14).X1) + 16*uintptr(_4_j))).X2
_pColl = _sqlite3FindCollSeq(tls, _db, _db.X14, _5_zColl, i32(0))
}
goto _1
_12:
if ((_p.X2) & uint32(i32(256))) == 0 {
goto _14
}
if ((*XExpr)(_p.X4) != nil) && ((((*XExpr)(_p.X4).X2) & uint32(i32(256))) != uint32(i32(0))) {
_p = (*XExpr)(_p.X4)
goto _17
}
_8_pNext = (*XExpr)(_p.X5)
func() {
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil && (*XExpr)(_p.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91064), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000))), unsafe.Pointer(str(21285)))
crt.X__builtin_abort(tls)
}
}()
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) == nil || func() int32 {
if ((_p.X2) & uint32(i32(2048))) == uint32(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91068), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _24
}
_9_i = i32(0)
_25:
if func() int32 {
if _9_i < ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91070), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCollSeqØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _30
}
if (((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2))))) + 20*uintptr(_9_i))).X0).X2) & uint32(i32(256))) != uint32(i32(0)) {
_8_pNext = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2))))) + 20*uintptr(_9_i))).X0)
goto _30
}
_9_i += 1
goto _25
_30:
_24:
_p = _8_pNext
_17:
goto _32
_14:
goto _1
_32:
goto _0
_1:
if _sqlite3CheckCollSeq(tls, _pParse, _pColl) != 0 {
_pColl = nil
}
return _pColl
}
var _sqlite3ExprCollSeqØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCollSeqØ00__func__Ø000[0], str(94562), 19)
}
// 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 _sqlite3CheckCollSeq(tls *crt.TLS, _pParse *XParse, _pColl *XCollSeq) (r0 int32) {
var _1_zName *int8
var _1_db *Xsqlite3
var _1_p *XCollSeq
if _pColl == nil {
goto _0
}
_1_zName = _pColl.X0
_1_db = (*Xsqlite3)(_pParse.X0)
_1_p = _sqlite3GetCollSeq(tls, _pParse, _1_db.X14, _pColl, _1_zName)
if _1_p == nil {
return i32(1)
}
func() {
if _1_p != _pColl {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104276), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CheckCollSeqØ00__func__Ø000))), unsafe.Pointer(str(94581)))
crt.X__builtin_abort(tls)
}
}()
_0:
return i32(0)
}
var _sqlite3CheckCollSeqØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CheckCollSeqØ00__func__Ø000[0], str(94590), 20)
}
// 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 _sqlite3IndexedByLookup(tls *crt.TLS, _pParse *XParse, _pFrom *TSrcList_item) (r0 int32) {
var _1_zIndexedBy *int8
var _1_pTab *XTable
var _1_pIdx *XIndex
if (*XTable)(_pFrom.X4) == nil || ((uint32(((*t28)(unsafe.Pointer(&(_pFrom.X9))).X1)>>uint(i32(1)))<>uint(i32(31))) == 0 {
goto _1
}
_1_pTab = (*XTable)(_pFrom.X4)
_1_zIndexedBy = *(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pFrom.X15)))))
_1_pIdx = (*XIndex)(_1_pTab.X2)
_2:
if _1_pIdx == nil || _sqlite3StrICmp(tls, _1_pIdx.X0, _1_zIndexedBy) == 0 {
goto _6
}
_1_pIdx = (*XIndex)(_1_pIdx.X5)
goto _2
_6:
if _1_pIdx == nil {
_sqlite3ErrorMsg(tls, _pParse, str(94610), unsafe.Pointer(_1_zIndexedBy), i32(0))
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
return i32(1)
}
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X16))))) = _1_pIdx
_1:
return i32(0)
}
// This routine processes the join information for a SELECT statement.
// ON and USING clauses are converted into extra terms of the WHERE clause.
// NATURAL joins also create extra WHERE clause terms.
//
// The terms of a FROM clause are contained in the Select.pSrc structure.
// The left most table is the first entry in Select.pSrc. The right-most
// table is the last entry. The join operator is held in the entry to
// the left. Thus entry 0 contains the join operator for the join between
// entries 0 and 1. Any ON or USING clauses associated with the join are
// also attached to the left entry.
//
// This routine returns the number of errors encountered.
func _sqliteProcessJoin(tls *crt.TLS, _pParse *XParse, _p *XSelect) (r0 int32) {
var _i, _j, _1_isOuter, _4_iLeft, _4_iLeftCol, _9_iLeft, _9_iLeftCol, _9_iRightCol int32
var _4_zName, _9_zName *int8
var _1_pLeftTab, _1_pRightTab *XTable
var _pSrc *XSrcList
var _pLeft, _pRight *TSrcList_item
var _8_pList *XIdList
_pSrc = (*XSrcList)(_p.X8)
_pLeft = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(i32(0))))
_pRight = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLeft)) + 68*uintptr(i32(1))))
_i = i32(0)
_0:
if _i >= ((_pSrc.X0) - i32(1)) {
goto _3
}
_1_pLeftTab = (*XTable)(_pLeft.X4)
_1_pRightTab = (*XTable)(_pRight.X4)
if func() int32 {
if (_1_pLeftTab == nil) || (_1_pRightTab == nil) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116938), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqliteProcessJoinØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _1
}
_1_isOuter = bool2int((int32((*t28)(unsafe.Pointer(&(_pRight.X9))).X0) & i32(32)) != i32(0))
if (int32((*t28)(unsafe.Pointer(&(_pRight.X9))).X0) & i32(4)) == 0 {
goto _8
}
if ((*XExpr)(_pRight.X12) != nil) || ((*XIdList)(_pRight.X13) != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(94628), i32(0))
return i32(1)
}
_j = i32(0)
_11:
if _j >= int32(_1_pRightTab.X11) {
goto _14
}
_4_zName = (*XColumn)(unsafe.Pointer(uintptr(_1_pRightTab.X1) + 16*uintptr(_j))).X0
if _tableAndColumnIndex(tls, _pSrc, _i+i32(1), _4_zName, &_4_iLeft, &_4_iLeftCol) != 0 {
_addWhereTerm(tls, _pParse, _pSrc, _4_iLeft, _4_iLeftCol, _i+i32(1), _j, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))))
}
_j += 1
goto _11
_14:
_8:
if ((*XExpr)(_pRight.X12) != nil) && ((*XIdList)(_pRight.X13) != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(94678))
return i32(1)
}
if (*XExpr)(_pRight.X12) == nil {
goto _18
}
if _1_isOuter != 0 {
_setJoinExpr(tls, (*XExpr)(_pRight.X12), _pRight.X11)
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_p.X9), (*XExpr)(_pRight.X12))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRight.X12))))) = nil
_18:
if (*XIdList)(_pRight.X13) == nil {
goto _20
}
_8_pList = (*XIdList)(_pRight.X13)
_j = i32(0)
_21:
if _j >= (_8_pList.X1) {
goto _24
}
_9_zName = (*TIdList_item)(unsafe.Pointer(uintptr(_8_pList.X0) + 8*uintptr(_j))).X0
_9_iRightCol = _columnIndex(tls, _1_pRightTab, _9_zName)
if (_9_iRightCol < i32(0)) || (_tableAndColumnIndex(tls, _pSrc, _i+i32(1), _9_zName, &_9_iLeft, &_9_iLeftCol) == 0) {
_sqlite3ErrorMsg(tls, _pParse, str(94733), unsafe.Pointer(_9_zName))
return i32(1)
}
_addWhereTerm(tls, _pParse, _pSrc, _9_iLeft, _9_iLeftCol, _i+i32(1), _9_iRightCol, _1_isOuter, (**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))))
_j += 1
goto _21
_24:
_20:
_1:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item {
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pRight }())) += uintptr(68)
return &_pLeft
}())) += uintptr(68)
goto _0
_3:
return i32(0)
}
var _sqliteProcessJoinØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqliteProcessJoinØ00__func__Ø000[0], str(94797), 18)
}
// Search the first N tables in pSrc, from left to right, looking for a
// table that has a column named zCol.
//
// When found, set *piTab and *piCol to the table index and column index
// of the matching column and return TRUE.
//
// If not found, return FALSE.
func _tableAndColumnIndex(tls *crt.TLS, _pSrc *XSrcList, _N int32, _zCol *int8, _piTab *int32, _piCol *int32) (r0 int32) {
var _i, _iCol int32
func() {
if (_piTab == nil) != (_piCol == nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116809), unsafe.Pointer((*int8)(unsafe.Pointer(&_tableAndColumnIndexØ00__func__Ø000))), unsafe.Pointer(str(94815)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= _N {
goto _5
}
_iCol = _columnIndex(tls, (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_i))).X4), _zCol)
if _iCol < i32(0) {
goto _6
}
if _piTab != nil {
*_piTab = _i
*_piCol = _iCol
}
return i32(1)
_6:
_i += 1
goto _2
_5:
return i32(0)
}
var _tableAndColumnIndexØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_tableAndColumnIndexØ00__func__Ø000[0], str(94838), 20)
}
// Return the index of a column in a table. Return -1 if the column
// is not contained in the table.
func _columnIndex(tls *crt.TLS, _pTab *XTable, _zCol *int8) (r0 int32) {
var _i int32
_i = i32(0)
_0:
if _i >= int32(_pTab.X11) {
goto _3
}
if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X0, _zCol) == i32(0) {
return _i
}
_i += 1
goto _0
_3:
return i32(-1)
}
// This function is used to add terms implied by JOIN syntax to the
// WHERE clause expression of a SELECT statement. The new term, which
// is ANDed with the existing WHERE clause, is of the form:
//
// (tab1.col1 = tab2.col2)
//
// where tab1 is the iSrc'th table in SrcList pSrc and tab2 is the
// (iSrc+1)'th. Column col1 is column iColLeft of tab1, and col2 is
// column iColRight of tab2.
func _addWhereTerm(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _iLeft int32, _iColLeft int32, _iRight int32, _iColRight int32, _isOuterJoin int32, _ppWhere **XExpr) {
var _db *Xsqlite3
var _pE1, _pE2, _pEq *XExpr
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _iLeft >= _iRight {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116849), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94858)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pSrc.X0) <= _iRight {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116850), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94871)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_iLeft))).X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116851), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94889)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_iRight))).X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116852), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94909)))
crt.X__builtin_abort(tls)
}
}()
_pE1 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iLeft, _iColLeft)
_pE2 = _sqlite3CreateColumnExpr(tls, _db, _pSrc, _iRight, _iColRight)
_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _pE1, _pE2)
if (_pEq != nil) && _isOuterJoin != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_pEq.X2)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
func() {
if ((_pEq.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116860), unsafe.Pointer((*int8)(unsafe.Pointer(&_addWhereTermØ00__func__Ø000))), unsafe.Pointer(str(94930)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pEq.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
*(*int16)(unsafe.Pointer(&(_pEq.X11))) = int16(_pE2.X8)
}
*_ppWhere = _sqlite3ExprAnd(tls, _db, *_ppWhere, _pEq)
}
var _addWhereTermØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_addWhereTermØ00__func__Ø000[0], str(94977), 13)
}
// Allocate and return a pointer to an expression to load the column iCol
// from datasource iSrc in SrcList pSrc.
func _sqlite3CreateColumnExpr(tls *crt.TLS, _db *Xsqlite3, _pSrc *XSrcList, _iSrc int32, _iCol int32) (r0 *XExpr) {
var _1_pItem *TSrcList_item
var _p *XExpr
_p = _sqlite3ExprAlloc(tls, _db, i32(152), nil, i32(0))
if _p == nil {
goto _0
}
_1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_iSrc)))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = (*XTable)(_1_pItem.X4)
*(*int32)(unsafe.Pointer(&(_p.X8))) = _1_pItem.X11
if int32((*XTable)(_p.X14).X10) == _iCol {
*(*int16)(unsafe.Pointer(&(_p.X9))) = int16(i32(-1))
goto _2
}
*(*int16)(unsafe.Pointer(&(_p.X9))) = int16(_iCol)
{
p := (*uint64)(unsafe.Pointer(&(_1_pItem.X14)))
*p = (*p) | (u64(1) << uint(func() int32 {
if _iCol >= i32(64) {
return i32(63)
}
return _iCol
}()))
sink17 = *p
}
_2:
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) | uint32(i32(4))
sink5 = *p
}
_0:
return _p
}
// Allocate an Expr node which joins as many as two subtrees.
//
// One or both of the subtrees can be NULL. Return a pointer to the new
// Expr node. Or, if an OOM error occurs, set pParse->db->mallocFailed,
// free the subtrees and return NULL.
func _sqlite3PExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
var _p *XExpr
if (_op == i32(71)) && ((_pParse.X16) == i32(0)) {
_p = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), _pLeft, _pRight)
goto _2
}
_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(48))))
if _p != nil {
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(_op & i32(255))
*(*int16)(unsafe.Pointer(&(_p.X10))) = int16(i32(-1))
}
_sqlite3ExprAttachSubtrees(tls, (*Xsqlite3)(_pParse.X0), _p, _pLeft, _pRight)
_2:
if _p != nil {
_sqlite3ExprCheckHeight(tls, _pParse, _p.X7)
}
return _p
}
// 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 _sqlite3ExprAnd(tls *crt.TLS, _db *Xsqlite3, _pLeft *XExpr, _pRight *XExpr) (r0 *XExpr) {
var _4_pNew *XExpr
if _pLeft == nil {
return _pRight
}
if _pRight == nil {
return _pLeft
}
if _exprAlwaysFalse(tls, _pLeft) != 0 || _exprAlwaysFalse(tls, _pRight) != 0 {
_sqlite3ExprDelete(tls, _db, _pLeft)
_sqlite3ExprDelete(tls, _db, _pRight)
return _sqlite3ExprAlloc(tls, _db, i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+8*uintptr(i32(0)))), i32(0))
}
_4_pNew = _sqlite3ExprAlloc(tls, _db, i32(71), nil, i32(0))
_sqlite3ExprAttachSubtrees(tls, _db, _4_pNew, _pLeft, _pRight)
return _4_pNew
}
func _exprAlwaysFalse(tls *crt.TLS, _p *XExpr) (r0 int32) {
var _v int32
_v = i32(0)
if ((_p.X2) & uint32(i32(1))) != uint32(i32(0)) {
return i32(0)
}
if _sqlite3ExprIsInteger(tls, _p, &_v) == 0 {
return i32(0)
}
return bool2int(_v == i32(0))
}
// 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 _sqlite3ExprIsInteger(tls *crt.TLS, _p *XExpr, _pValue *int32) (r0 int32) {
var _rc, _4_v int32
_rc = i32(0)
if _p == nil {
return i32(0)
}
func() {
if int32(_p.X0) == i32(134) && ((_p.X2)&uint32(i32(1024))) == uint32(i32(0)) && _sqlite3GetInt32(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))), &_rc) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000))), unsafe.Pointer(str(94990)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X2) & uint32(i32(1024))) != 0 {
*_pValue = *(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))
return i32(1)
}
switch int32(_p.X0) {
case i32(155):
goto _8
case i32(156):
goto _7
default:
goto _9
}
_7:
_rc = _sqlite3ExprIsInteger(tls, (*XExpr)(_p.X4), _pValue)
goto _10
_8:
if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.X4), &_4_v) != 0 {
func() {
if _4_v == i32(-2147483648) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92830), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIsIntegerØ00__func__Ø000))), unsafe.Pointer(str(95079)))
crt.X__builtin_abort(tls)
}
}()
*_pValue = -_4_v
_rc = i32(1)
}
goto _10
_9:
goto _10
_10:
return _rc
}
var _sqlite3ExprIsIntegerØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprIsIntegerØ00__func__Ø000[0], str(95098), 21)
}
var _sqlite3IntTokens [2]XToken
func init() {
_sqlite3IntTokens = [2]XToken{XToken{X0: str(4908), X1: u32(1)}, XToken{X0: str(50040), X1: u32(1)}}
}
// 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 _sqlite3ExprAttachSubtrees(tls *crt.TLS, _db *Xsqlite3, _pRoot *XExpr, _pLeft *XExpr, _pRight *XExpr) {
if _pRoot == nil {
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91693), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAttachSubtreesØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprDelete(tls, _db, _pLeft)
_sqlite3ExprDelete(tls, _db, _pRight)
goto _3
}
if _pRight != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRoot.X5))))) = _pRight
{
p := (*uint32)(unsafe.Pointer(&(_pRoot.X2)))
*p = (*p) | (uint32(i32(2097408)) & (_pRight.X2))
sink5 = *p
}
}
if _pLeft != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRoot.X4))))) = _pLeft
{
p := (*uint32)(unsafe.Pointer(&(_pRoot.X2)))
*p = (*p) | (uint32(i32(2097408)) & (_pLeft.X2))
sink5 = *p
}
}
_exprSetHeight(tls, _pRoot)
_3:
}
var _sqlite3ExprAttachSubtreesØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAttachSubtreesØ00__func__Ø000[0], str(95119), 26)
}
// Set the Expr.nHeight variable in the structure passed as an
// argument. An expression with no children, Expr.pList or
// Expr.pSelect member has a height of 1. Any other expression
// has a height equal to the maximum height of any other
// referenced Expr plus one.
//
// Also propagate EP_Propagate flags up from Expr.x.pList to Expr.flags,
// if appropriate.
func _exprSetHeight(tls *crt.TLS, _p *XExpr) {
var _nHeight int32
_nHeight = i32(0)
_heightOfExpr(tls, (*XExpr)(_p.X4), &_nHeight)
_heightOfExpr(tls, (*XExpr)(_p.X5), &_nHeight)
if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) {
_heightOfSelect(tls, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), &_nHeight)
goto _2
}
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil {
_heightOfExprList(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))), &_nHeight)
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) | (uint32(i32(2097408)) & _sqlite3ExprListFlags(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))))
sink5 = *p
}
}
_2:
*(*int32)(unsafe.Pointer(&(_p.X7))) = _nHeight + i32(1)
}
// The following three functions, heightOfExpr(), heightOfExprList()
// and heightOfSelect(), are used to determine the maximum height
// of any expression tree referenced by the structure passed as the
// first argument.
//
// If this maximum height is greater than the current value pointed
// to by pnHeight, the second parameter, then set *pnHeight to that
// value.
func _heightOfExpr(tls *crt.TLS, _p *XExpr, _pnHeight *int32) {
if _p == nil {
goto _0
}
if (_p.X7) > (*_pnHeight) {
*_pnHeight = _p.X7
}
_0:
}
func _heightOfSelect(tls *crt.TLS, _p *XSelect, _pnHeight *int32) {
if _p != nil {
_heightOfExpr(tls, (*XExpr)(_p.X9), _pnHeight)
_heightOfExpr(tls, (*XExpr)(_p.X11), _pnHeight)
_heightOfExpr(tls, (*XExpr)(_p.X15), _pnHeight)
_heightOfExpr(tls, (*XExpr)(_p.X16), _pnHeight)
_heightOfExprList(tls, (*XExprList)(_p.X0), _pnHeight)
_heightOfExprList(tls, (*XExprList)(_p.X10), _pnHeight)
_heightOfExprList(tls, (*XExprList)(_p.X12), _pnHeight)
_heightOfSelect(tls, (*XSelect)(_p.X13), _pnHeight)
}
}
func _heightOfExprList(tls *crt.TLS, _p *XExprList, _pnHeight *int32) {
var _1_i int32
if _p == nil {
goto _0
}
_1_i = i32(0)
_1:
if _1_i >= (_p.X0) {
goto _4
}
_heightOfExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))+20*uintptr(_1_i))).X0), _pnHeight)
_1_i += 1
goto _1
_4:
_0:
}
// Return the bitwise-OR of all Expr.flags fields in the given
// ExprList.
func _sqlite3ExprListFlags(tls *crt.TLS, _pList *XExprList) (r0 uint32) {
var _i int32
var _m uint32
var _2_pExpr *XExpr
_m = u32(0)
if _pList == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
_2_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_i))).X0)
func() {
if _2_pExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92578), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListFlagsØ00__func__Ø000))), unsafe.Pointer(str(43636)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_m
*p = (*p) | (_2_pExpr.X2)
sink5 = *p
}
_i += 1
goto _1
_4:
_0:
return _m
}
var _sqlite3ExprListFlagsØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListFlagsØ00__func__Ø000[0], str(95145), 21)
}
// 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 _sqlite3ExprCheckHeight(tls *crt.TLS, _pParse *XParse, _nHeight int32) (r0 int32) {
var _rc, _mxHeight int32
_rc = i32(0)
_mxHeight = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(3))))
if _nHeight > _mxHeight {
_sqlite3ErrorMsg(tls, _pParse, str(95166), _mxHeight)
_rc = i32(1)
}
return _rc
}
// Set the EP_FromJoin property on all terms of the given expression.
// And set the Expr.iRightJoinTable to iTable for every term in the
// expression.
//
// The EP_FromJoin property is used on terms of an expression to tell
// the LEFT OUTER JOIN processing logic that this term is part of the
// join restriction specified in the ON or USING clause and not a part
// of the more general WHERE clause. These terms are moved over to the
// WHERE clause during join processing but we need to remember that they
// originated in the ON or USING clause.
//
// The Expr.iRightJoinTable tells the WHERE clause processing that the
// expression depends on table iRightJoinTable even if that table is not
// explicitly mentioned in the expression. That information is needed
// for cases like this:
//
// SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.b AND t1.x=5
//
// The where clause needs to defer the handling of the t1.x=5
// term until after the t2 loop of the join. In that way, a
// NULL t2 row will be inserted whenever t1.x!=5. If we do not
// defer the handling of t1.x=5, it will be processed immediately
// after the t1 loop and rows with t1.x!=5 will never appear in
// the output, which is incorrect.
func _setJoinExpr(tls *crt.TLS, _p *XExpr, _iTable int32) {
var _2_i int32
_0:
if _p == nil {
goto _1
}
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
func() {
if ((_p.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116896), unsafe.Pointer((*int8)(unsafe.Pointer(&_setJoinExprØ00__func__Ø000))), unsafe.Pointer(str(49429)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
*(*int16)(unsafe.Pointer(&(_p.X11))) = int16(_iTable)
if int32(_p.X0) != i32(151) || (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) == nil {
goto _5
}
_2_i = i32(0)
_6:
if _2_i >= ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X0) {
goto _9
}
_setJoinExpr(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2)))))+20*uintptr(_2_i))).X0), _iTable)
_2_i += 1
goto _6
_9:
_5:
_setJoinExpr(tls, (*XExpr)(_p.X4), _iTable)
_p = (*XExpr)(_p.X5)
goto _0
_1:
}
var _setJoinExprØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_setJoinExprØ00__func__Ø000[0], str(95214), 12)
}
// 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 _sqlite3MatchSpanName(tls *crt.TLS, _zSpan *int8, _zCol *int8, _zTab *int8, _zDb *int8) (r0 int32) {
var _n int32
_n = i32(0)
_0:
if func() int32 {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89484), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) == i32(46) {
goto _6
}
_n += 1
goto _0
_6:
if (_zDb != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zDb, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDb)) + 1*uintptr(_n)))) != i32(0))) {
return i32(0)
}
{
p := &_zSpan
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n+i32(1))))
sink0 = *p
}
_n = i32(0)
_10:
if func() int32 {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89489), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MatchSpanNameØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zSpan)) + 1*uintptr(_n)))) == i32(46) {
goto _16
}
_n += 1
goto _10
_16:
if (_zTab != nil) && ((Xsqlite3_strnicmp(tls, _zSpan, _zTab, _n) != i32(0)) || (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTab)) + 1*uintptr(_n)))) != i32(0))) {
return i32(0)
}
{
p := &_zSpan
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_n+i32(1))))
sink0 = *p
}
if (_zCol != nil) && (_sqlite3StrICmp(tls, _zSpan, _zCol) != i32(0)) {
return i32(0)
}
return i32(1)
}
var _sqlite3MatchSpanNameØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MatchSpanNameØ00__func__Ø000[0], str(95226), 21)
}
// Return the index in pList of the identifier named zId. Return -1
// if not found.
func _sqlite3IdListIndex(tls *crt.TLS, _pList *XIdList, _zName *int8) (r0 int32) {
var _i int32
if _pList == nil {
return i32(-1)
}
_i = i32(0)
_1:
if _i >= (_pList.X1) {
goto _4
}
if _sqlite3StrICmp(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0)+8*uintptr(_i))).X0, _zName) == i32(0) {
return _i
}
_i += 1
goto _1
_4:
return i32(-1)
}
// Generate a Token object from a string
func _sqlite3TokenInit(tls *crt.TLS, _p *XToken, _z *int8) {
*(**int8)(unsafe.Pointer(&(_p.X0))) = _z
*(*uint32)(unsafe.Pointer(&(_p.X1))) = uint32(_sqlite3Strlen30(tls, _z))
}
// Set the ExprList.a[].zName 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 _sqlite3ExprListSetName(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pName *XToken, _dequote int32) {
var _1_pItem *TExprList_item
func() {
if _pList == nil && int32((*Xsqlite3)(_pParse.X0).X17) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92496), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000))), unsafe.Pointer(str(95247)))
crt.X__builtin_abort(tls)
}
}()
if _pList == nil {
goto _3
}
func() {
if (_pList.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000))), unsafe.Pointer(str(21335)))
crt.X__builtin_abort(tls)
}
}()
_1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr((_pList.X0)-i32(1))))
func() {
if (_1_pItem.X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92501), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetNameØ00__func__Ø000))), unsafe.Pointer(str(95287)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_1_pItem.X1))) = _sqlite3DbStrNDup(tls, (*Xsqlite3)(_pParse.X0), _pName.X0, uint64(_pName.X1))
if _dequote != 0 {
_sqlite3Dequote(tls, _1_pItem.X1)
}
_3:
}
var _sqlite3ExprListSetNameØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListSetNameØ00__func__Ø000[0], str(95303), 23)
}
// If the SELECT passed as the second argument has an associated WITH
// clause, pop it from the stack stored as part of the Parse object.
//
// This function is used as the xSelectCallback2() callback by
// sqlite3SelectExpand() when walking a SELECT tree to resolve table
// names and other FROM clause elements.
func _selectPopWith(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
var _1_pWith *XWith
var _pParse *XParse
_pParse = (*XParse)(_pWalker.X0)
if (*XWith)(_pParse.X70) == nil || (*XSelect)(_p.X13) != nil {
goto _1
}
_1_pWith = (*XWith)(_findRightmost(tls, _p).X17)
if _1_pWith != nil {
func() {
if (*XWith)(_pParse.X70) != _1_pWith {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120817), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectPopWithØ00__func__Ø000))), unsafe.Pointer(str(95326)))
crt.X__builtin_abort(tls)
}
}()
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X70))))) = (*XWith)(_1_pWith.X1)
}
_1:
}
// Return a pointer to the right-most SELECT statement in a compound.
func _findRightmost(tls *crt.TLS, _p *XSelect) (r0 *XSelect) {
_0:
if (*XSelect)(_p.X14) != nil {
_p = (*XSelect)(_p.X14)
goto _0
}
return _p
}
var _selectPopWithØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_selectPopWithØ00__func__Ø000[0], str(95347), 14)
}
// Resolve all names in all expressions of a SELECT and in all
// decendents of the SELECT, including compounds off of p->pPrior,
// subqueries in expressions, and subqueries used as FROM clause
// terms.
//
// See sqlite3ResolveExprNames() for a description of the kinds of
// transformations that occur.
//
// All SELECT statements should have been expanded using
// sqlite3SelectExpand() prior to invoking this routine.
func _sqlite3ResolveSelectNames(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pOuterNC *XNameContext) {
var _w XWalker
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResolveSelectNamesØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _resolveExprStep
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _resolveSelectStep
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pOuterNC
_sqlite3WalkSelect(tls, &_w, _p)
_ = _w
}
var _sqlite3ResolveSelectNamesØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ResolveSelectNamesØ00__func__Ø000[0], str(95361), 26)
}
// This routine is callback for sqlite3WalkExpr().
//
// Resolve symbolic names into TK_COLUMN operators for the current
// node in the expression tree. Return 0 to continue the search down
// the tree or 2 to abort the tree walk.
//
// This routine also does error checking and name resolution for
// function names. The operator for aggregate functions is changed
// to TK_AGG_FUNCTION.
func _resolveExprStep(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _1_i, _9_n, _9_no_such_func, _9_wrong_num_args, _9_is_agg, _9_nId, _18_auth, _30_nRef, _33_nLeft, _33_nRight int32
var _4_zColumn, _4_zTable, _4_zDb, _9_zId *int8
var _9_enc uint8
var _9_pDef *XFuncDef
var _1_pSrcList *XSrcList
var _9_pList *XExprList
var _4_pRight *XExpr
var _pParse *XParse
var _pNC, _26_pNC2 *XNameContext
_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
func() {
if _pNC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89925), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95387)))
crt.X__builtin_abort(tls)
}
}()
_pParse = (*XParse)(_pNC.X0)
func() {
if _pParse != (*XParse)(_pWalker.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89927), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95394)))
crt.X__builtin_abort(tls)
}
}()
if ((_pExpr.X2) & uint32(i32(4))) != uint32(i32(0)) {
return i32(1)
}
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(4))
sink5 = *p
}
if (*XSrcList)(_pNC.X1) == nil || ((*XSrcList)(_pNC.X1).X1) <= uint32(i32(0)) {
goto _6
}
_1_pSrcList = (*XSrcList)(_pNC.X1)
_1_i = i32(0)
_7:
if _1_i >= ((*XSrcList)(_pNC.X1).X0) {
goto _10
}
func() {
if ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrcList.X2)))))+68*uintptr(_1_i))).X11) < i32(0) || ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrcList.X2)))))+68*uintptr(_1_i))).X11) >= (_pParse.X17) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89936), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95418)))
crt.X__builtin_abort(tls)
}
}()
_1_i += 1
goto _7
_10:
_6:
switch int32(_pExpr.X0) {
case i32(20):
goto _18
case i32(27):
goto _15
case i32(72):
goto _22
case i32(73):
goto _22
case i32(74):
goto _18
case i32(77):
goto _22
case i32(78):
goto _22
case i32(79):
goto _22
case i32(80):
goto _22
case i32(81):
goto _22
case i32(82):
goto _22
case i32(119):
goto _18
case i32(122):
goto _15
case i32(135):
goto _21
case i32(148):
goto _22
case i32(151):
goto _17
default:
goto _31
}
_15:
if int32(_pExpr.X0) == i32(27) {
_4_zDb = nil
_4_zTable = nil
_4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
goto _33
}
_notValid(tls, _pParse, _pNC, str(95483), i32(32))
_4_pRight = (*XExpr)(_pExpr.X5)
if int32(_4_pRight.X0) == i32(27) {
_4_zDb = nil
_4_zTable = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X3)))))
_4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pRight.X3)))))
goto _35
}
func() {
if int32(_4_pRight.X0) != i32(122) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89989), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95500)))
crt.X__builtin_abort(tls)
}
}()
_4_zDb = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X3)))))
_4_zTable = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_4_pRight.X4).X3)))))
_4_zColumn = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_4_pRight.X5).X3)))))
_35:
_33:
return _lookupName(tls, _pParse, _4_zDb, _4_zTable, _4_zColumn, _pNC, _pExpr)
_17:
_9_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_9_n = func() int32 {
if _9_pList != nil {
return (_9_pList.X0)
}
return i32(0)
}()
_9_no_such_func = i32(0)
_9_wrong_num_args = i32(0)
_9_is_agg = i32(0)
_9_enc = (*Xsqlite3)(_pParse.X0).X14
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90011), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
_9_zId = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
_9_nId = _sqlite3Strlen30(tls, _9_zId)
_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), _9_zId, _9_n, _9_enc, uint8(i32(0)))
if _9_pDef != nil {
goto _42
}
_9_pDef = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), _9_zId, i32(-2), _9_enc, uint8(i32(0)))
if _9_pDef == nil {
_9_no_such_func = i32(1)
goto _44
}
_9_wrong_num_args = i32(1)
_44:
goto _45
_42:
_9_is_agg = bool2int(*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{(*(*func(*crt.TLS, *Xsqlite3_context))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(_9_pDef.X5)})))})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context)
}{nil})))
if (int32(_9_pDef.X1) & i32(1024)) == 0 {
goto _46
}
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(266240))
sink5 = *p
}
if _9_n != i32(2) {
goto _47
}
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _exprProbability(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pList.X2)))))+20*uintptr(i32(1)))).X0))
if (_pExpr.X8) < i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(95519))
*(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1
}
goto _49
_47:
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = func() int32 {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_9_pDef.X6)) + 1*uintptr(i32(0))))) == i32(117) {
return i32(8388608)
}
return i32(125829120)
}()
_49:
_46:
_18_auth = _sqlite3AuthCheck(tls, _pParse, i32(31), nil, _9_pDef.X6, nil)
if _18_auth == i32(0) {
goto _52
}
if _18_auth == i32(1) {
_sqlite3ErrorMsg(tls, _pParse, str(95590), unsafe.Pointer(_9_pDef.X6))
*(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1
}
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101))
return i32(1)
_52:
if (int32(_9_pDef.X1) & i32(10240)) != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(524288))
sink5 = *p
}
}
if (int32(_9_pDef.X1) & i32(2048)) == i32(0) {
_notValid(tls, _pParse, _pNC, str(95625), i32(34))
}
_45:
if _9_is_agg != 0 && ((int32(_pNC.X7) & i32(1)) == i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(95653), _9_nId, unsafe.Pointer(_9_zId))
*(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1
_9_is_agg = i32(0)
goto _62
}
if _9_no_such_func != 0 && (int32((*t21)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X33))).X2) == i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(95689), _9_nId, unsafe.Pointer(_9_zId))
*(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1
goto _62
}
if _9_wrong_num_args != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(95712), _9_nId, unsafe.Pointer(_9_zId))
*(*int32)(unsafe.Pointer(&(_pNC.X6))) += 1
}
_62:
if _9_is_agg != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pNC.X7)))
*p = uint16(int32(*p) & i32(-2))
sink14 = *p
}
}
_sqlite3WalkExprList(tls, _pWalker, _9_pList)
if _9_is_agg == 0 {
goto _64
}
_26_pNC2 = _pNC
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(153))
*(*uint8)(unsafe.Pointer(&(_pExpr.X12))) = uint8(i32(0))
_65:
if (_26_pNC2 != nil) && (_sqlite3FunctionUsesThisSrc(tls, _pExpr, (*XSrcList)(_26_pNC2.X1)) == 0) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X12))) += 1
_26_pNC2 = (*XNameContext)(_26_pNC2.X4)
goto _65
}
func() {
if _9_pDef == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90101), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95757)))
crt.X__builtin_abort(tls)
}
}()
if _26_pNC2 != nil {
i32(0)
{
p := (*uint16)(unsafe.Pointer(&(_26_pNC2.X7)))
*p = uint16(int32(*p) | (i32(16) | (int32(_9_pDef.X1) & i32(4096))))
sink14 = *p
}
}
{
p := (*uint16)(unsafe.Pointer(&(_pNC.X7)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
_64:
return i32(1)
_18:
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
goto _71
}
_30_nRef = _pNC.X5
_notValid(tls, _pParse, _pNC, str(95765), i32(38))
_sqlite3WalkSelect(tls, _pWalker, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))))
func() {
if (_pNC.X5) < _30_nRef {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90125), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95776)))
crt.X__builtin_abort(tls)
}
}()
if _30_nRef != (_pNC.X5) {
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(32))
sink5 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_pNC.X7)))
*p = uint16(int32(*p) | i32(64))
sink14 = *p
}
}
_71:
goto _31
_21:
_notValid(tls, _pParse, _pNC, str(95792), i32(38))
goto _31
_22:
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
goto _31
}
func() {
if (*XExpr)(_pExpr.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90148), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95803)))
crt.X__builtin_abort(tls)
}
}()
_33_nLeft = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4))
if int32(_pExpr.X0) != i32(73) {
goto _78
}
_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2)))))+20*uintptr(i32(0)))).X0))
if _33_nRight == _33_nLeft {
_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2)))))+20*uintptr(i32(1)))).X0))
}
goto _80
_78:
func() {
if (*XExpr)(_pExpr.X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90156), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveExprStepØ00__func__Ø000))), unsafe.Pointer(str(95819)))
crt.X__builtin_abort(tls)
}
}()
_33_nRight = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X5))
_80:
if _33_nLeft != _33_nRight {
_sqlite3ErrorMsg(tls, _pParse, str(43181))
}
goto _31
_31:
return func() int32 {
if (_pParse.X16) != 0 || (((*Xsqlite3)(_pParse.X0).X17) != 0) {
return i32(2)
}
return i32(0)
}()
}
var _resolveExprStepØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_resolveExprStepØ00__func__Ø000[0], str(95836), 16)
}
// Report an error that an expression is not valid for some set of
// pNC->ncFlags values determined by validMask.
func _notValid(tls *crt.TLS, _pParse *XParse, _pNC *XNameContext, _zMsg *int8, _validMask int32) {
var _1_zIn *int8
func() {
if (_validMask & i32(-39)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89884), unsafe.Pointer((*int8)(unsafe.Pointer(&_notValidØ00__func__Ø000))), unsafe.Pointer(str(95852)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pNC.X7) & _validMask) == i32(0) {
goto _2
}
_1_zIn = str(95903)
if (int32(_pNC.X7) & i32(32)) != 0 {
_1_zIn = str(95931)
goto _5
}
if (int32(_pNC.X7) & i32(4)) != 0 {
_1_zIn = str(95949)
}
_5:
_sqlite3ErrorMsg(tls, _pParse, str(95967), unsafe.Pointer(_zMsg), unsafe.Pointer(_1_zIn))
_2:
}
var _notValidØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_notValidØ00__func__Ø000[0], str(95987), 9)
}
// Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
// that name in the set of source tables in pSrcList and make the pExpr
// expression node refer back to that source column. The following changes
// are made to pExpr:
//
// pExpr->iDb Set the index in db->aDb[] of the database X
// (even if X is implied).
// pExpr->iTable Set to the cursor number for the table obtained
// from pSrcList.
// pExpr->pTab Points to the Table structure of X.Y (even if
// X and/or Y are implied.)
// pExpr->iColumn Set to the column number within the table.
// pExpr->op Set to TK_COLUMN.
// pExpr->pLeft Any expression this points to is deleted
// pExpr->pRight Any expression this points to is deleted.
//
// The zDb variable is the name of the database (the "X"). This value may be
// NULL meaning that name is of the form Y.Z or Z. Any available database
// can be used. The zTable variable is the name of the table (the "Y"). This
// value can be NULL if zDb is also NULL. If zTable is NULL it
// means that the form of the name is Z and that columns from any table
// can be used.
//
// If the name cannot be resolved unambiguously, leave an error message
// in pParse and return WRC_Abort. Return WRC_Prune on success.
func _lookupName(tls *crt.TLS, _pParse *XParse, _zDb *int8, _zTab *int8, _zCol *int8, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
var _i, _j, _cnt, _cntTab, _nSubquery, _isTrigger, _9_hit, _21_op, _25_iCol, _45_n int32
var _13_zTabName, _36_zAs, _41_zErr *int8
var _db *Xsqlite3
var _pSchema *XSchema
var _pTab *XTable
var _6_pSrcList *XSrcList
var _pItem, _pMatch *TSrcList_item
var _6_pEList *XExprList
var _37_pOrig *XExpr
var _pCol *XColumn
var _pTopNC *XNameContext
_cnt = i32(0)
_cntTab = i32(0)
_nSubquery = i32(0)
_db = (*Xsqlite3)(_pParse.X0)
_pMatch = nil
_pTopNC = _pNC
_pSchema = nil
_isTrigger = i32(0)
_pTab = nil
func() {
if _pNC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89548), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(95996)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _zCol == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89549), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96000)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89550), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96005)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(-1)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
if _zDb == nil {
goto _6
}
if (int32(_pNC.X7) & i32(6)) != i32(0) {
_zDb = nil
goto _8
}
_i = i32(0)
_9:
if _i >= (_db.X5) {
goto _12
}
func() {
if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89572), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96054)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3StrICmp(tls, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_i))).X0, _zDb) == i32(0) {
_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X4)
goto _12
}
_i += 1
goto _9
_12:
_8:
_6:
func() {
if _pNC == nil || _cnt != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89582), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96074)))
crt.X__builtin_abort(tls)
}
}()
_19:
_6_pSrcList = (*XSrcList)(_pNC.X1)
if _6_pSrcList == nil {
goto _20
}
*func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_6_pSrcList.X2)))))
_21:
if _i >= (_6_pSrcList.X0) {
goto _24
}
_pTab = (*XTable)(_pItem.X4)
func() {
if _pTab == nil || (_pTab.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89590), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96088)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pTab.X11) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89591), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96114)))
crt.X__builtin_abort(tls)
}
}()
if (*XSelect)(_pItem.X5) == nil || (((*XSelect)(_pItem.X5).X3)&uint32(i32(2048))) == uint32(i32(0)) {
goto _31
}
_9_hit = i32(0)
_6_pEList = (*XExprList)((*XSelect)(_pItem.X5).X0)
_j = i32(0)
_32:
if _j >= (_6_pEList.X0) {
goto _35
}
if _sqlite3MatchSpanName(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2)))))+20*uintptr(_j))).X2, _zCol, _zTab, _zDb) != 0 {
_cnt += 1
_cntTab = i32(2)
_pMatch = _pItem
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_j)
_9_hit = i32(1)
}
_j += 1
goto _32
_35:
if _9_hit != 0 || (_zTab == nil) {
goto _22
}
_31:
if (_zDb != nil) && ((*XSchema)(_pTab.X20) != _pSchema) {
goto _22
}
if _zTab == nil {
goto _41
}
_13_zTabName = func() *int8 {
if (_pItem.X3) != nil {
return (_pItem.X3)
}
return (_pTab.X0)
}()
func() {
if _13_zTabName == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89611), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96127)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3StrICmp(tls, _13_zTabName, _zTab) != i32(0) {
goto _22
}
_41:
if i32(0) == postInc1(&_cntTab, int32(1)) {
_pMatch = _pItem
}
*func() **XColumn { _j = i32(0); return &_pCol }() = (*XColumn)(_pTab.X1)
_48:
if _j >= int32(_pTab.X11) {
goto _51
}
if _sqlite3StrICmp(tls, _pCol.X0, _zCol) != i32(0) {
goto _52
}
if _cnt != i32(1) {
goto _53
}
if (int32((*t28)(unsafe.Pointer(&(_pItem.X9))).X0) & i32(4)) != 0 {
goto _49
}
if _nameInUsingClause(tls, (*XIdList)(_pItem.X13), _zCol) != 0 {
goto _49
}
_53:
_cnt += 1
_pMatch = _pItem
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(func() int32 {
if _j == int32(_pTab.X10) {
return i32(-1)
}
return int32(int16(_j))
}())
goto _51
_52:
_49:
*(*uintptr)(unsafe.Pointer(func() **XColumn { _j += 1; return &_pCol }())) += uintptr(16)
goto _48
_51:
_22:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
goto _21
_24:
if _pMatch == nil {
goto _58
}
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pMatch.X11
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = (*XTable)(_pMatch.X4)
func() {
if (int32((*t28)(unsafe.Pointer(&(_pMatch.X9))).X0) & i32(16)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89641), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96139)))
crt.X__builtin_abort(tls)
}
}()
if (int32((*t28)(unsafe.Pointer(&(_pMatch.X9))).X0) & i32(8)) != i32(0) {
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(1048576))
sink5 = *p
}
}
_pSchema = (*XSchema)((*XTable)(_pExpr.X14).X20)
_58:
_20:
if _zDb != nil || _zTab == nil || _cntTab != i32(0) || (*XTable)(_pParse.X40) == nil {
goto _65
}
_21_op = int32(_pParse.X45)
func() {
if _21_op != i32(109) && _21_op != i32(110) && _21_op != i32(108) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89655), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96175)))
crt.X__builtin_abort(tls)
}
}()
if (_21_op != i32(109)) && (_sqlite3StrICmp(tls, str(43173), _zTab) == i32(0)) {
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(1)
_pTab = (*XTable)(_pParse.X40)
goto _75
}
if (_21_op != i32(108)) && (_sqlite3StrICmp(tls, str(43177), _zTab) == i32(0)) {
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = i32(0)
_pTab = (*XTable)(_pParse.X40)
goto _75
}
_pTab = nil
_75:
if _pTab == nil {
goto _76
}
_pSchema = (*XSchema)(_pTab.X20)
_cntTab += 1
*func() **XColumn { _25_iCol = i32(0); return &_pCol }() = (*XColumn)(_pTab.X1)
_77:
if _25_iCol >= int32(_pTab.X11) {
goto _80
}
if _sqlite3StrICmp(tls, _pCol.X0, _zCol) != i32(0) {
goto _81
}
if _25_iCol == int32(_pTab.X10) {
_25_iCol = i32(-1)
}
goto _80
_81:
*(*uintptr)(unsafe.Pointer(func() **XColumn { _25_iCol += 1; return &_pCol }())) += uintptr(16)
goto _77
_80:
if ((_25_iCol >= int32(_pTab.X11)) && _sqlite3IsRowid(tls, _zCol) != 0) && (((_pTab.X9) & uint32(i32(64))) == uint32(i32(0))) {
_25_iCol = i32(-1)
}
if _25_iCol >= int32(_pTab.X11) {
goto _86
}
_cnt += 1
if _25_iCol < i32(0) {
*(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68))
goto _92
}
if (_pExpr.X8) == i32(0) {
{
p := (*uint32)(unsafe.Pointer(&(_pParse.X43)))
*p = (*p) | func() uint32 {
if _25_iCol >= i32(32) {
return u32(4294967295)
}
return (u32(1) << uint(_25_iCol))
}()
sink5 = *p
}
goto _92
}
{
p := (*uint32)(unsafe.Pointer(&(_pParse.X44)))
*p = (*p) | func() uint32 {
if _25_iCol >= i32(32) {
return u32(4294967295)
}
return (u32(1) << uint(_25_iCol))
}()
sink5 = *p
}
_92:
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_25_iCol)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = _pTab
_isTrigger = i32(1)
_86:
_76:
_65:
if (((((_cnt == i32(0)) && (_cntTab == i32(1))) && (_pMatch != nil)) && ((int32(_pNC.X7) & i32(32)) == i32(0))) && _sqlite3IsRowid(tls, _zCol) != 0) && ((((*XTable)(_pMatch.X4).X9) & uint32(i32(64))) == uint32(i32(0))) {
_cnt = i32(1)
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(i32(-1))
*(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68))
}
if store42(&_6_pEList, (*XExprList)(_pNC.X2)) == nil || _zTab != nil || _cnt != i32(0) {
goto _103
}
_j = i32(0)
_104:
if _j >= (_6_pEList.X0) {
goto _107
}
_36_zAs = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2))))) + 20*uintptr(_j))).X1
if _36_zAs == nil || _sqlite3StrICmp(tls, _36_zAs, _zCol) != i32(0) {
goto _109
}
func() {
if (*XExpr)(_pExpr.X4) != nil || (*XExpr)(_pExpr.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89744), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96223)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89745), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96259)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89746), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96277)))
crt.X__builtin_abort(tls)
}
}()
_37_pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pEList.X2))))) + 20*uintptr(_j))).X0)
if ((int32(_pNC.X7) & i32(1)) == i32(0)) && (((_37_pOrig.X2) & uint32(i32(2))) != uint32(i32(0))) {
_sqlite3ErrorMsg(tls, _pParse, str(96297), unsafe.Pointer(_36_zAs))
return i32(2)
}
if _sqlite3ExprVectorSize(tls, _37_pOrig) != i32(1) {
_sqlite3ErrorMsg(tls, _pParse, str(43181))
return i32(2)
}
_resolveAlias(tls, _pParse, _6_pEList, _j, _pExpr, str(0), _nSubquery)
_cnt = i32(1)
_pMatch = nil
func() {
if _zTab != nil || _zDb != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89759), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96328)))
crt.X__builtin_abort(tls)
}
}()
goto _lookupname_end
_109:
_j += 1
goto _104
_107:
_103:
if _cnt != 0 {
goto _124
}
_pNC = (*XNameContext)(_pNC.X4)
_nSubquery += 1
if _pNC != nil {
goto _19
}
_124:
if ((_cnt == i32(0)) && (_zTab == nil)) && (((_pExpr.X2) & uint32(i32(64))) != uint32(i32(0))) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(97))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil
return i32(1)
}
if _cnt == i32(1) {
goto _128
}
_41_zErr = func() *int8 {
if _cnt == i32(0) {
return str(96346)
}
return str(96361)
}()
if _zDb != nil {
_sqlite3ErrorMsg(tls, _pParse, str(96383), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
goto _134
}
if _zTab != nil {
_sqlite3ErrorMsg(tls, _pParse, str(49822), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
goto _134
}
_sqlite3ErrorMsg(tls, _pParse, str(49832), unsafe.Pointer(_41_zErr), unsafe.Pointer(_zCol))
_134:
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_pTopNC.X6))) += 1
_128:
if int32(_pExpr.X9) < i32(0) || _pMatch == nil {
goto _136
}
_45_n = int32(_pExpr.X9)
if _45_n >= i32(64) {
_45_n = i32(63)
}
func() {
if (_pMatch.X11) != (_pExpr.X8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89820), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96396)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint64)(unsafe.Pointer(&(_pMatch.X14)))
*p = (*p) | (u64(1) << uint(_45_n))
sink17 = *p
}
_136:
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.X4))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = nil
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pExpr.X5))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = nil
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(func() int32 {
if _isTrigger != 0 {
return i32(61)
}
return i32(152)
}())
_lookupname_end:
if _cnt != i32(1) {
goto _142
}
func() {
if _pNC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89833), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(95387)))
crt.X__builtin_abort(tls)
}
}()
if ((_pExpr.X2) & uint32(i32(4194304))) == uint32(i32(0)) {
_sqlite3AuthRead(tls, _pParse, _pExpr, _pSchema, (*XSrcList)(_pNC.X1))
}
_145:
func() {
if _pTopNC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89840), unsafe.Pointer((*int8)(unsafe.Pointer(&_lookupNameØ00__func__Ø000))), unsafe.Pointer(str(96427)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pTopNC.X5))) += 1
if _pTopNC == _pNC {
goto _148
}
_pTopNC = (*XNameContext)(_pTopNC.X4)
goto _145
_148:
return i32(1)
_142:
return i32(2)
}
var _lookupNameØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_lookupNameØ00__func__Ø000[0], str(96437), 11)
}
// Return TRUE if the name zCol occurs anywhere in the USING clause.
//
// Return FALSE if the USING clause is NULL or if it does not contain
// zCol.
func _nameInUsingClause(tls *crt.TLS, _pUsing *XIdList, _zCol *int8) (r0 int32) {
var _1_k int32
if _pUsing == nil {
goto _0
}
_1_k = i32(0)
_1:
if _1_k >= (_pUsing.X1) {
goto _4
}
if _sqlite3StrICmp(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pUsing.X0)+8*uintptr(_1_k))).X0, _zCol) == i32(0) {
return i32(1)
}
_1_k += 1
goto _1
_4:
_0:
return i32(0)
}
// Return TRUE if the given string is a row-id column name.
func _sqlite3IsRowid(tls *crt.TLS, _z *int8) (r0 int32) {
if _sqlite3StrICmp(tls, _z, str(96448)) == i32(0) {
return i32(1)
}
if _sqlite3StrICmp(tls, _z, str(96456)) == i32(0) {
return i32(1)
}
if _sqlite3StrICmp(tls, _z, str(96462)) == i32(0) {
return i32(1)
}
return i32(0)
}
// Turn the pExpr expression into an alias for the iCol-th column of the
// result set in pEList.
//
// If the reference is followed by a COLLATE operator, then make sure
// the COLLATE operator is preserved. For example:
//
// SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase;
//
// Should be transformed into:
//
// SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
//
// The nSubquery parameter specifies how many levels of subquery the
// alias is removed from the original expression. The usual value is
// zero but it might be more if the alias is contained within a subquery
// of the original expression. The Expr.op2 field of TK_AGG_FUNCTION
// structures must be increased by the nSubquery amount.
func _resolveAlias(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _iCol int32, _pExpr *XExpr, _zType *int8, _nSubquery int32) {
var _db *Xsqlite3
var _pOrig, _pDup *XExpr
func() {
if _iCol < i32(0) || _iCol >= (_pEList.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89423), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96466)))
crt.X__builtin_abort(tls)
}
}()
_pOrig = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_iCol))).X0)
func() {
if _pOrig == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89425), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96496)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
_pDup = _sqlite3ExprDup(tls, _db, _pOrig, i32(0))
if _pDup == nil {
return
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(i32(0))))) != i32(71) {
_incrAggFunctionDepth(tls, _pDup, _nSubquery)
}
if int32(_pExpr.X0) == i32(94) {
_pDup = _sqlite3ExprAddCollateString(tls, _pParse, _pDup, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))
}
{
p := (*uint32)(unsafe.Pointer(&(_pDup.X2)))
*p = (*p) | uint32(i32(4194304))
sink5 = *p
}
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(32768))
sink5 = *p
}
_sqlite3ExprDelete(tls, _db, _pExpr)
crt.Xmemcpy(tls, (unsafe.Pointer)(_pExpr), (unsafe.Pointer)(_pDup), u32(48))
if (((_pExpr.X2) & uint32(i32(1024))) == uint32(i32(0))) && ((*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))) != nil) {
func() {
if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89446), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveAliasØ00__func__Ø000))), unsafe.Pointer(str(96505)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))) = _sqlite3DbStrDup(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))))
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(65536))
sink5 = *p
}
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pDup))
}
var _resolveAliasØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_resolveAliasØ00__func__Ø000[0], str(96551), 13)
}
func _incrAggFunctionDepth(tls *crt.TLS, _pExpr *XExpr, _N int32) {
var _1_w XWalker
if _N > i32(0) {
crt.Xmemset(tls, (unsafe.Pointer)(&_1_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_1_w.X1))))) = _incrAggDepth
*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_1_w.X6))))) = _N
_sqlite3WalkExpr(tls, &_1_w, _pExpr)
}
_ = _1_w
}
// Walk the expression tree pExpr and increase the aggregate function
// depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node.
// This needs to occur when copying a TK_AGG_FUNCTION node from an
// outer query into an inner subquery.
//
// incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..)
// is a helper function - a callback for the tree walker.
func _incrAggDepth(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
if int32(_pExpr.X0) == i32(153) {
{
p := (*uint8)(unsafe.Pointer(&(_pExpr.X12)))
*p = uint8(int32(*p) + (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))))
sink2 = *p
}
}
return i32(0)
}
func _sqlite3ExprAddCollateString(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _zC *int8) (r0 *XExpr) {
var _s XToken
func() {
if _zC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90997), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAddCollateStringØ00__func__Ø000))), unsafe.Pointer(str(96564)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3TokenInit(tls, &_s, _zC)
return _sqlite3ExprAddCollateToken(tls, _pParse, _pExpr, &_s, i32(0))
_ = _s
panic(0)
}
var _sqlite3ExprAddCollateStringØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAddCollateStringØ00__func__Ø000[0], str(96570), 28)
}
// 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 _sqlite3ExprAddCollateToken(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pCollName *XToken, _dequote int32) (r0 *XExpr) {
var _1_pNew *XExpr
if (_pCollName.X1) <= uint32(i32(0)) {
goto _0
}
_1_pNew = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(94), _pCollName, _dequote)
if _1_pNew != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pNew.X4))))) = _pExpr
{
p := (*uint32)(unsafe.Pointer(&(_1_pNew.X2)))
*p = (*p) | uint32(i32(4352))
sink5 = *p
}
_pExpr = _1_pNew
}
_0:
return _pExpr
}
// 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 _sqlite3AuthRead(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSchema *XSchema, _pTabList *XSrcList) {
var _iSrc, _iDb, _iCol int32
var _zCol *int8
var _db *Xsqlite3
var _pTab *XTable
_db = (*Xsqlite3)(_pParse.X0)
_pTab = nil
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
}{(_db.X59)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
}{nil})) {
return
}
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), _pSchema)
if _iDb < i32(0) {
return
}
func() {
if int32(_pExpr.X0) != i32(152) && int32(_pExpr.X0) != i32(61) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99583), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(96598)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pExpr.X0) == i32(61) {
_pTab = (*XTable)(_pParse.X40)
goto _6
}
func() {
if _pTabList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(96644)))
crt.X__builtin_abort(tls)
}
}()
_iSrc = i32(0)
_9:
if func() int32 {
if _iSrc < (_pTabList.X0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99588), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _14
}
if (_pExpr.X8) == ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_iSrc))).X11) {
_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_iSrc))).X4)
goto _14
}
_iSrc += 1
goto _9
_14:
_6:
_iCol = int32(_pExpr.X9)
if func() int32 {
if _pTab == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99596), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
if _iCol >= i32(0) {
func() {
if _iCol >= int32(_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99599), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(45575)))
crt.X__builtin_abort(tls)
}
}()
_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol))).X0
goto _26
}
if int32(_pTab.X10) >= i32(0) {
func() {
if int32(_pTab.X10) >= int32(_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99602), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(96653)))
crt.X__builtin_abort(tls)
}
}()
_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_pTab.X10))).X0
goto _26
}
_zCol = str(96456)
_26:
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99607), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthReadØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
if i32(2) == _sqlite3AuthReadCol(tls, _pParse, _pTab.X0, _zCol, _iDb) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101))
}
}
var _sqlite3AuthReadØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AuthReadØ00__func__Ø000[0], str(96676), 16)
}
// 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 _sqlite3AuthReadCol(tls *crt.TLS, _pParse *XParse, _zTab *int8, _zCol *int8, _iDb int32) (r0 int32) {
var _rc int32
var _zDb *int8
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
return i32(0)
}
_rc = (_db.X59)(tls, _db.X60, i32(20), _zTab, _zCol, _zDb, _pParse.X65)
if _rc != i32(1) {
goto _1
}
if ((_db.X5) > i32(2)) || (_iDb != i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(96692), unsafe.Pointer(_zDb), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
goto _4
}
_sqlite3ErrorMsg(tls, _pParse, str(96725), unsafe.Pointer(_zTab), unsafe.Pointer(_zCol))
_4:
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = i32(23)
goto _7
_1:
if (_rc != i32(2)) && (_rc != i32(0)) {
_sqliteAuthBadReturnCode(tls, _pParse)
}
_7:
return _rc
}
// Expression p should encode a floating point value between 1.0 and 0.0.
// Return 1024 times this value. Or return -1 if p is not a floating point
// value between 1.0 and 0.0.
func _exprProbability(tls *crt.TLS, _p *XExpr) (r0 int32) {
var _r float64
_r = -1
if int32(_p.X0) != i32(132) {
return i32(-1)
}
_sqlite3AtoF(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))), &_r, _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), uint8(i32(1)))
func() {
if _r < float64(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(89904), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprProbabilityØ00__func__Ø000))), unsafe.Pointer(str(96755)))
crt.X__builtin_abort(tls)
}
}()
if _r > float64(1) {
return i32(-1)
}
return int32(_r * (1.34217728e+08))
}
var _exprProbabilityØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_exprProbabilityØ00__func__Ø000[0], str(96762), 16)
}
// 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 _sqlite3FunctionUsesThisSrc(tls *crt.TLS, _pExpr *XExpr, _pSrcList *XSrcList) (r0 int32) {
var _w XWalker
var _cnt TSrcCount
func() {
if int32(_pExpr.X0) != i32(153) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95801), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FunctionUsesThisSrcØ00__func__Ø000))), unsafe.Pointer(str(96778)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprSrcCount
*(**TSrcCount)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_cnt
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_cnt.X0))))) = _pSrcList
*(*int32)(unsafe.Pointer(&(_cnt.X1))) = i32(0)
*(*int32)(unsafe.Pointer(&(_cnt.X2))) = i32(0)
_sqlite3WalkExprList(tls, &_w, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))))
return bool2int(((_cnt.X1) > i32(0)) || ((_cnt.X2) == i32(0)))
_ = _w
_ = _cnt
panic(0)
}
var _sqlite3FunctionUsesThisSrcØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FunctionUsesThisSrcØ00__func__Ø000[0], str(96805), 27)
}
// Count the number of references to columns.
func _exprSrcCount(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _1_i, _1_nSrc int32
var _1_pSrc *XSrcList
var _1_p *TSrcCount
if int32(_pExpr.X0) != i32(152) && func() int32 {
if int32(_pExpr.X0) == i32(154) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95775), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprSrcCountØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() == 0 {
goto _3
}
_1_p = (*TSrcCount)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
_1_pSrc = (*XSrcList)(_1_p.X0)
_1_nSrc = func() int32 {
if _1_pSrc != nil {
return (_1_pSrc.X0)
}
return i32(0)
}()
_1_i = i32(0)
_6:
if _1_i >= _1_nSrc {
goto _9
}
if (_pExpr.X8) == ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2))))) + 68*uintptr(_1_i))).X11) {
goto _9
}
_1_i += 1
goto _6
_9:
if _1_i < _1_nSrc {
*(*int32)(unsafe.Pointer(&(_1_p.X1))) += 1
goto _12
}
*(*int32)(unsafe.Pointer(&(_1_p.X2))) += 1
_12:
_3:
return i32(0)
}
var _exprSrcCountØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_exprSrcCountØ00__func__Ø000[0], str(96832), 13)
}
// Resolve names in the SELECT statement p and all of its descendants.
func _resolveSelectStep(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) (r0 int32) {
var _isCompound, _nCompound, _i, _7_nRef int32
var _7_zSavedContext *int8
var _db *Xsqlite3
var _6_pItem, _11_pItem *TSrcList_item
var _pGroupBy *XExprList
var _16_pItem *TExprList_item
var _pLeftmost, _5_pSub, _13_pSub *XSelect
var _pParse *XParse
var _sNC XNameContext
var _pOuterNC, _7_pNC *XNameContext
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90520), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X3) & uint32(i32(4))) != 0 {
return i32(1)
}
_pOuterNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
_pParse = (*XParse)(_pWalker.X0)
_db = (*Xsqlite3)(_pParse.X0)
if ((_p.X3) & uint32(i32(64))) == uint32(i32(0)) {
_sqlite3SelectPrep(tls, _pParse, _p, _pOuterNC)
return func() int32 {
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
return i32(2)
}
return i32(1)
}()
}
_isCompound = bool2int((*XSelect)(_p.X13) != nil)
_nCompound = i32(0)
_pLeftmost = _p
_7:
if _p == nil {
goto _8
}
func() {
if ((_p.X3) & uint32(i32(64))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90545), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96845)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X3) & uint32(i32(4))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90546), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96876)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(4))
sink5 = *p
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse
if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X15)) != 0 || _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X16)) != 0 {
return i32(2)
}
if ((_p.X3) & uint32(i32(65536))) != 0 {
_5_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(i32(0)))).X5)
func() {
if ((*XSrcList)(_p.X8).X0) != i32(1) || (*XExprList)(_p.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90567), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96907)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_5_pSub.X13) == nil || (*XExprList)(_5_pSub.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90568), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96939)))
crt.X__builtin_abort(tls)
}
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pSub.X12))))) = (*XExprList)(_p.X12)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil
}
_i = i32(0)
_22:
if _i >= ((*XSrcList)(_p.X8).X0) {
goto _25
}
_6_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(_i)))
if (*XSelect)(_6_pItem.X5) == nil {
goto _26
}
_7_nRef = i32(0)
_7_zSavedContext = _pParse.X65
_7_pNC = _pOuterNC
_27:
if _7_pNC == nil {
goto _30
}
{
p := &_7_nRef
*p = (*p) + (_7_pNC.X5)
sink1 = *p
}
_7_pNC = (*XNameContext)(_7_pNC.X4)
goto _27
_30:
if (_6_pItem.X2) != nil {
*(**int8)(unsafe.Pointer(&(_pParse.X65))) = _6_pItem.X2
}
_sqlite3ResolveSelectNames(tls, _pParse, (*XSelect)(_6_pItem.X5), _pOuterNC)
*(**int8)(unsafe.Pointer(&(_pParse.X65))) = _7_zSavedContext
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
return i32(2)
}
_7_pNC = _pOuterNC
_34:
if _7_pNC == nil {
goto _37
}
{
p := &_7_nRef
*p = (*p) - (_7_pNC.X5)
sink1 = *p
}
_7_pNC = (*XNameContext)(_7_pNC.X4)
goto _34
_37:
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_6_pItem.X9))).X1)>>uint(i32(3)))<>uint(i32(31))) != i32(0) || _7_nRef > i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90595), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(96973)))
crt.X__builtin_abort(tls)
}
}()
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_6_pItem.X9))).X1))), int8(bool2int(_7_nRef != i32(0))), 8, 3)
_26:
_i += 1
goto _22
_25:
*(*uint16)(unsafe.Pointer(&(_sNC.X7))) = uint16(i32(1))
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = (*XSrcList)(_p.X8)
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = _pOuterNC
if _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(_p.X0)) != 0 {
return i32(2)
}
func() {
if ((_p.X3) & uint32(i32(8))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90613), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveSelectStepØ00__func__Ø000))), unsafe.Pointer(str(97010)))
crt.X__builtin_abort(tls)
}
}()
_pGroupBy = (*XExprList)(_p.X10)
if (_pGroupBy != nil) || ((int32(_sNC.X7) & i32(16)) != i32(0)) {
i32(0)
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(8)|(int32(_sNC.X7)&i32(4096)))
sink5 = *p
}
goto _46
}
{
p := (*uint16)(unsafe.Pointer(&(_sNC.X7)))
*p = uint16(int32(*p) & i32(-2))
sink14 = *p
}
_46:
if ((*XExpr)(_p.X11) != nil) && (_pGroupBy == nil) {
_sqlite3ErrorMsg(tls, _pParse, str(97042))
return i32(2)
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X2))))) = (*XExprList)(_p.X0)
if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X11)) != 0 {
return i32(2)
}
if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)(_p.X9)) != 0 {
return i32(2)
}
_i = i32(0)
_51:
if _i >= ((*XSrcList)(_p.X8).X0) {
goto _54
}
_11_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(_i)))
if (((uint32(((*t28)(unsafe.Pointer(&(_11_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && _sqlite3ResolveExprListNames(tls, &_sNC, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_11_pItem.X15))))))) != 0 {
return i32(2)
}
_i += 1
goto _51
_54:
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = nil
{
p := (*uint16)(unsafe.Pointer(&(_sNC.X7)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
if ((_p.X3) & uint32(i32(65536))) != 0 {
_13_pSub = (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(i32(0)))).X5)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = (*XExprList)(_13_pSub.X12)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_13_pSub.X12))))) = nil
}
if (_isCompound <= _nCompound) && _resolveOrderGroupBy(tls, &_sNC, _p, (*XExprList)(_p.X12), str(25745)) != 0 {
return i32(2)
}
if (_db.X17) != 0 {
return i32(2)
}
if _pGroupBy == nil {
goto _61
}
if _resolveOrderGroupBy(tls, &_sNC, _p, _pGroupBy, str(25751)) != 0 || ((_db.X17) != 0) {
return i32(2)
}
*func() **TExprList_item { _i = i32(0); return &_16_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2)))))
_64:
if _i >= (_pGroupBy.X0) {
goto _67
}
if (((*XExpr)(_16_pItem.X0).X2) & uint32(i32(2))) != uint32(i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(97086))
return i32(2)
}
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_16_pItem }())) += uintptr(20)
goto _64
_67:
_61:
if ((*XSelect)(_p.X14) != nil) && (((*XExprList)(_p.X0).X0) != ((*XExprList)((*XSelect)(_p.X14).X0).X0)) {
_sqlite3SelectWrongNumTermsError(tls, _pParse, (*XSelect)(_p.X14))
return i32(2)
}
_p = (*XSelect)(_p.X13)
_nCompound += 1
goto _7
_8:
if _isCompound != 0 && _resolveCompoundOrderBy(tls, _pParse, _pLeftmost) != 0 {
return i32(2)
}
return i32(1)
_ = _sNC
panic(0)
}
var _resolveSelectStepØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_resolveSelectStepØ00__func__Ø000[0], str(97145), 18)
}
// This routine walks an expression tree and resolves references to
// table columns and result-set columns. At the same time, do error
// checking on function usage and set a flag if any aggregate functions
// are seen.
//
// To resolve table columns references we look for nodes (or subtrees) of the
// form X.Y.Z or Y.Z or just Z where
//
// X: The name of a database. Ex: "main" or "temp" or
// the symbolic name assigned to an ATTACH-ed database.
//
// Y: The name of a table in a FROM clause. Or in a trigger
// one of the special names "old" or "new".
//
// Z: The name of a column in table Y.
//
// The node at the root of the subtree is modified as follows:
//
// Expr.op Changed to TK_COLUMN
// Expr.pTab Points to the Table object for X.Y
// Expr.iColumn The column index in X.Y. -1 for the rowid.
// Expr.iTable The VDBE cursor number for X.Y
//
//
// To resolve result-set references, look for expression nodes of the
// form Z (with no X and Y prefix) where the Z matches the right-hand
// size of an AS clause in the result-set of a SELECT. The Z expression
// is replaced by a copy of the left-hand side of the result-set expression.
// Table-name and function resolution occurs on the substituted expression
// tree. For example, in:
//
// SELECT a+b AS x, c+d AS y FROM t1 ORDER BY x;
//
// The "x" term of the order by is replaced by "a+b" to render:
//
// SELECT a+b AS x, c+d AS y FROM t1 ORDER BY a+b;
//
// Function calls are checked to make sure that the function is
// defined and that the correct number of arguments are specified.
// If the function is an aggregate function, then the NC_HasAgg flag is
// set and the opcode is changed from TK_FUNCTION to TK_AGG_FUNCTION.
// If an expression contains aggregate functions then the EP_Agg
// property on the expression is set.
//
// An error message is left in pParse if anything is amiss. The number
// if errors is returned.
func _sqlite3ResolveExprNames(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) (r0 int32) {
var _savedHasAgg uint16
var _1_pParse *XParse
var _w XWalker
if _pExpr == nil {
return i32(0)
}
_1_pParse = (*XParse)(_pNC.X0)
if _sqlite3ExprCheckHeight(tls, _1_pParse, (_pExpr.X7)+((*XParse)(_pNC.X0).X57)) != 0 {
return i32(1)
}
{
p := (*int32)(unsafe.Pointer(&(_1_pParse.X57)))
*p = (*p) + (_pExpr.X7)
sink1 = *p
}
_savedHasAgg = uint16(int32(_pNC.X7) & i32(4112))
{
p := (*uint16)(unsafe.Pointer(&(_pNC.X7)))
*p = uint16(int32(*p) & i32(-4113))
sink14 = *p
}
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = (*XParse)(_pNC.X0)
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _resolveExprStep
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _resolveSelectStep
*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = nil
*(*int32)(unsafe.Pointer(&(_w.X4))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(0))
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pNC
_sqlite3WalkExpr(tls, &_w, _pExpr)
{
p := (*int32)(unsafe.Pointer(&((*XParse)(_pNC.X0).X57)))
*p = (*p) - (_pExpr.X7)
sink1 = *p
}
if ((_pNC.X6) > i32(0)) || (((*XParse)(_w.X0).X16) > i32(0)) {
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(8))
sink5 = *p
}
}
if (int32(_pNC.X7) & i32(16)) != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(2))
sink5 = *p
}
}
{
p := (*uint16)(unsafe.Pointer(&(_pNC.X7)))
*p = uint16(int32(*p) | int32(_savedHasAgg))
sink14 = *p
}
return bool2int(((_pExpr.X2) & uint32(i32(8))) != uint32(i32(0)))
_ = _w
panic(0)
}
// Resolve all names for all expression in an expression list. This is
// just like sqlite3ResolveExprNames() except that it works for an expression
// list rather than a single expression.
func _sqlite3ResolveExprListNames(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) (r0 int32) {
var _i int32
if _pList == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
if _sqlite3ResolveExprNames(tls, _pNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0)) != 0 {
return i32(2)
}
_i += 1
goto _1
_4:
_0:
return i32(0)
}
// pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
// The Name context of the SELECT statement is pNC. zType is either
// "ORDER" or "GROUP" depending on which type of clause pOrderBy is.
//
// This routine resolves each term of the clause into an expression.
// If the order-by term is an integer I between 1 and N (where N is the
// number of columns in the result set of the SELECT) then the expression
// in the resolution is a copy of the I-th result-set expression. If
// the order-by term is an identifier that corresponds to the AS-name of
// a result-set expression, then the term resolves to a copy of the
// result-set expression. Otherwise, the expression is resolved in
// the usual way - using sqlite3ResolveExprNames().
//
// This routine returns the number of errors. If errors occur, then
// an appropriate error message might be left in pParse. (OOM errors
// excepted.)
func _resolveOrderGroupBy(tls *crt.TLS, _pNC *XNameContext, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
var _i, _j, _iCol, _nResult int32
var _pItem *TExprList_item
var _1_pE, _1_pE2 *XExpr
var _pParse *XParse
if _pOrderBy == nil {
return i32(0)
}
_nResult = (*XExprList)(_pSelect.X0).X0
_pParse = (*XParse)(_pNC.X0)
*func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))
_1:
if _i >= (_pOrderBy.X0) {
goto _4
}
_1_pE = (*XExpr)(_pItem.X0)
_1_pE2 = _sqlite3ExprSkipCollate(tls, _1_pE)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(i32(0))))) == i32(71) {
goto _5
}
_iCol = _resolveAsName(tls, _pParse, (*XExprList)(_pSelect.X0), _1_pE2)
if _iCol > i32(0) {
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_iCol)
goto _2
}
_5:
if _sqlite3ExprIsInteger(tls, _1_pE2, &_iCol) == 0 {
goto _7
}
if (_iCol < i32(1)) || (_iCol > i32(65535)) {
_resolveOutOfRangeError(tls, _pParse, _zType, _i+i32(1), _nResult)
return i32(1)
}
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_iCol)
goto _2
_7:
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(i32(0))
if _sqlite3ResolveExprNames(tls, _pNC, _1_pE) != 0 {
return i32(1)
}
_j = i32(0)
_11:
if _j >= ((*XExprList)(_pSelect.X0).X0) {
goto _14
}
if _sqlite3ExprCompare(tls, _1_pE, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSelect.X0).X2)))))+20*uintptr(_j))).X0), i32(-1)) == i32(0) {
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0))) = uint16(_j + i32(1))
}
_j += 1
goto _11
_14:
_2:
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _1
_4:
return _sqlite3ResolveOrderGroupBy(tls, _pParse, _pSelect, _pOrderBy, _zType)
}
// pEList is a list of expressions which are really the result set of the
// a SELECT statement. pE is a term in an ORDER BY or GROUP BY clause.
// This routine checks to see if pE is a simple identifier which corresponds
// to the AS-name of one of the terms of the expression list. If it is,
// this routine return an integer between 1 and N where N is the number of
// elements in pEList, corresponding to the matching entry. If there is
// no match, or if pE is not a simple identifier, then this routine
// return 0.
//
// pEList has been resolved. pE has not.
func _resolveAsName(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pE *XExpr) (r0 int32) {
var _i int32
var _1_zCol, _2_zAs *int8
if int32(_pE.X0) != i32(27) {
goto _0
}
_1_zCol = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pE.X3)))))
_i = i32(0)
_1:
if _i >= (_pEList.X0) {
goto _4
}
_2_zAs = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X1
if (_2_zAs != nil) && (_sqlite3StrICmp(tls, _2_zAs, _1_zCol) == i32(0)) {
return _i + i32(1)
}
_i += 1
goto _1
_4:
_0:
return i32(0)
}
// Generate an ORDER BY or GROUP BY term out-of-range error.
func _resolveOutOfRangeError(tls *crt.TLS, _pParse *XParse, _zType *int8, _i int32, _mx int32) {
_sqlite3ErrorMsg(tls, _pParse, str(97163), _i, unsafe.Pointer(_zType), _mx)
}
// 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.
func _sqlite3ExprCompare(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
var _combinedFlags uint32
if (_pA == nil) || (_pB == nil) {
return func() int32 {
if _pB == _pA {
return i32(0)
}
return i32(2)
}()
}
_combinedFlags = (_pA.X2) | (_pB.X2)
if (_combinedFlags & uint32(i32(1024))) == 0 {
goto _4
}
if ((((_pA.X2) & (_pB.X2)) & uint32(i32(1024))) != uint32(i32(0))) && ((*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3)))))) == (*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3))))))) {
return i32(0)
}
return i32(2)
_4:
if int32(_pA.X0) == int32(_pB.X0) {
goto _7
}
if (int32(_pA.X0) == i32(94)) && (_sqlite3ExprCompare(tls, (*XExpr)(_pA.X4), _pB, _iTab) < i32(2)) {
return i32(1)
}
if (int32(_pB.X0) == i32(94)) && (_sqlite3ExprCompare(tls, _pA, (*XExpr)(_pB.X4), _iTab) < i32(2)) {
return i32(1)
}
return i32(2)
_7:
if int32(_pA.X0) == i32(152) || int32(_pA.X0) == i32(154) || (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3)))))) == nil {
goto _14
}
if int32(_pA.X0) != i32(151) {
goto _15
}
if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3)))))) != i32(0) {
return i32(2)
}
goto _18
_15:
if crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pA.X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pB.X3)))))) != i32(0) {
return func() int32 {
if int32(_pA.X0) == i32(94) {
return i32(1)
}
return i32(2)
}()
}
_18:
_14:
if ((_pA.X2) & uint32(i32(16))) != ((_pB.X2) & uint32(i32(16))) {
return i32(2)
}
if func() int32 {
if (_combinedFlags & uint32(i32(16384))) == uint32(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95607), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _24
}
if (_combinedFlags & uint32(i32(2048))) != 0 {
return i32(2)
}
if _sqlite3ExprCompare(tls, (*XExpr)(_pA.X4), (*XExpr)(_pB.X4), _iTab) != 0 {
return i32(2)
}
if _sqlite3ExprCompare(tls, (*XExpr)(_pA.X5), (*XExpr)(_pB.X5), _iTab) != 0 {
return i32(2)
}
if _sqlite3ExprListCompare(tls, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pA.X6)))))), (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pB.X6)))))), _iTab) != 0 {
return i32(2)
}
if func() int32 {
if (_combinedFlags & uint32(i32(8192))) == uint32(i32(0)) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95612), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || int32(_pA.X0) == i32(97) {
goto _32
}
if int32(_pA.X9) != int32(_pB.X9) {
return i32(2)
}
if ((_pA.X8) != (_pB.X8)) && (((_pA.X8) != _iTab) || func() int32 {
if (_pB.X8) >= i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95615), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCompareØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0) {
return i32(2)
}
_32:
_24:
return i32(0)
}
var _sqlite3ExprCompareØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCompareØ00__func__Ø000[0], str(97219), 19)
}
// Compare two ExprList objects. Return 0 if they are identical and
// non-zero if they differ in any way.
//
// 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 _sqlite3ExprListCompare(tls *crt.TLS, _pA *XExprList, _pB *XExprList, _iTab int32) (r0 int32) {
var _i int32
var _1_pExprA, _1_pExprB *XExpr
if (_pA == nil) && (_pB == nil) {
return i32(0)
}
if (_pA == nil) || (_pB == nil) {
return i32(1)
}
if (_pA.X0) != (_pB.X0) {
return i32(1)
}
_i = i32(0)
_5:
if _i >= (_pA.X0) {
goto _8
}
_1_pExprA = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pA.X2))))) + 20*uintptr(_i))).X0)
_1_pExprB = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pB.X2))))) + 20*uintptr(_i))).X0)
if int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pA.X2)))))+20*uintptr(_i))).X3) != int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pB.X2)))))+20*uintptr(_i))).X3) {
return i32(1)
}
if _sqlite3ExprCompare(tls, _1_pExprA, _1_pExprB, _iTab) != 0 {
return i32(1)
}
_i += 1
goto _5
_8:
return i32(0)
}
// Check every term in the ORDER BY or GROUP BY clause pOrderBy of
// the SELECT statement pSelect. If any term is reference to a
// result set expression (as determined by the ExprList.a.u.x.iOrderByCol
// field) then convert that term into a copy of the corresponding result set
// column.
//
// If any errors are detected, add an error message to pParse and
// return non-zero. Return zero if no errors are seen.
func _sqlite3ResolveOrderGroupBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pOrderBy *XExprList, _zType *int8) (r0 int32) {
var _i int32
var _db *Xsqlite3
var _pEList *XExprList
var _pItem *TExprList_item
_db = (*Xsqlite3)(_pParse.X0)
if (_pOrderBy == nil) || (((*Xsqlite3)(_pParse.X0).X17) != 0) {
return i32(0)
}
if (_pOrderBy.X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) {
_sqlite3ErrorMsg(tls, _pParse, str(97238), unsafe.Pointer(_zType))
return i32(1)
}
_pEList = (*XExprList)(_pSelect.X0)
func() {
if _pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90418), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResolveOrderGroupByØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
*func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))
_5:
if _i >= (_pOrderBy.X0) {
goto _8
}
if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0) == 0 {
goto _9
}
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0) > (_pEList.X0) {
_resolveOutOfRangeError(tls, _pParse, _zType, _i+i32(1), _pEList.X0)
return i32(1)
}
_resolveAlias(tls, _pParse, _pEList, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0)-i32(1), (*XExpr)(_pItem.X0), _zType, i32(0))
_9:
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _5
_8:
return i32(0)
}
var _sqlite3ResolveOrderGroupByØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ResolveOrderGroupByØ00__func__Ø000[0], str(97269), 27)
}
// Error message for when two or more terms of a compound select have different
// size result sets.
func _sqlite3SelectWrongNumTermsError(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
if ((_p.X3) & uint32(i32(512))) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(97296))
goto _1
}
_sqlite3ErrorMsg(tls, _pParse, str(97342), unsafe.Pointer(_selectOpName(tls, int32(_p.X1))))
_1:
}
// Name of the connection operator, used for error messages.
func _selectOpName(tls *crt.TLS, _id int32) (r0 *int8) {
var _z *int8
switch _id {
case i32(116):
goto _1
case i32(117):
goto _3
case i32(118):
goto _2
default:
goto _4
}
_1:
_z = str(47100)
goto _5
_2:
_z = str(25692)
goto _5
_3:
_z = str(25685)
goto _5
_4:
_z = str(25675)
goto _5
_5:
return _z
}
// Analyze the ORDER BY clause in a compound SELECT statement. Modify
// each term of the ORDER BY clause is a constant integer between 1
// and N where N is the number of columns in the compound SELECT.
//
// ORDER BY terms that are already an integer between 1 and N are
// unmodified. ORDER BY terms that are integers outside the range of
// 1 through N generate an error. ORDER BY terms that are expressions
// are matched against result set expressions of compound SELECT
// beginning with the left-most SELECT and working toward the right.
// At the first match, the ORDER BY expression is transformed into
// the integer column number.
//
// Return the number of errors seen.
func _resolveCompoundOrderBy(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) (r0 int32) {
var _i, _moreToDo, _5_iCol int32
var _db *Xsqlite3
var _pOrderBy, _pEList *XExprList
var _4_pItem *TExprList_item
var _5_pE, _5_pDup, _11_pNew, _13_pParent *XExpr
_moreToDo = i32(1)
_pOrderBy = (*XExprList)(_pSelect.X12)
if _pOrderBy == nil {
return i32(0)
}
_db = (*Xsqlite3)(_pParse.X0)
if (_pOrderBy.X0) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) {
_sqlite3ErrorMsg(tls, _pParse, str(97424))
return i32(1)
}
_i = i32(0)
_2:
if _i >= (_pOrderBy.X0) {
goto _5
}
storebits3((*int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_i))).X4))), int8(i32(0)), 1, 0)
_i += 1
goto _2
_5:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelect.X14))))) = nil
_6:
if (*XSelect)(_pSelect.X13) != nil {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSelect)(_pSelect.X13).X14))))) = _pSelect
_pSelect = (*XSelect)(_pSelect.X13)
goto _6
}
_7:
if _pSelect == nil || _moreToDo == 0 {
goto _9
}
_moreToDo = i32(0)
_pEList = (*XExprList)(_pSelect.X0)
func() {
if _pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90332), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
*func() **TExprList_item { _i = i32(0); return &_4_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))
_13:
if _i >= (_pOrderBy.X0) {
goto _16
}
_5_iCol = i32(-1)
if ((uint32(_4_pItem.X4) << uint(i32(31))) >> uint(i32(31))) != 0 {
goto _14
}
_5_pE = _sqlite3ExprSkipCollate(tls, (*XExpr)(_4_pItem.X0))
if _sqlite3ExprIsInteger(tls, _5_pE, &_5_iCol) == 0 {
goto _18
}
if (_5_iCol <= i32(0)) || (_5_iCol > (_pEList.X0)) {
_resolveOutOfRangeError(tls, _pParse, str(25745), _i+i32(1), _pEList.X0)
return i32(1)
}
goto _21
_18:
_5_iCol = _resolveAsName(tls, _pParse, _pEList, _5_pE)
if _5_iCol != i32(0) {
goto _22
}
_5_pDup = _sqlite3ExprDup(tls, _db, _5_pE, i32(0))
if (_db.X17) == 0 {
func() {
if _5_pDup == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90348), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000))), unsafe.Pointer(str(97458)))
crt.X__builtin_abort(tls)
}
}()
_5_iCol = _resolveOrderByTermToExprList(tls, _pParse, _pSelect, _5_pDup)
}
_sqlite3ExprDelete(tls, _db, _5_pDup)
_22:
_21:
if _5_iCol <= i32(0) {
goto _26
}
_11_pNew = _sqlite3Expr(tls, _db, i32(134), nil)
if _11_pNew == nil {
return i32(1)
}
{
p := (*uint32)(unsafe.Pointer(&(_11_pNew.X2)))
*p = (*p) | uint32(i32(1024))
sink5 = *p
}
*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_11_pNew.X3))))) = _5_iCol
if (*XExpr)(_4_pItem.X0) == _5_pE {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pItem.X0))))) = _11_pNew
goto _29
}
_13_pParent = (*XExpr)(_4_pItem.X0)
func() {
if int32(_13_pParent.X0) != i32(94) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90365), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000))), unsafe.Pointer(str(97463)))
crt.X__builtin_abort(tls)
}
}()
_32:
if int32((*XExpr)(_13_pParent.X4).X0) == i32(94) {
_13_pParent = (*XExpr)(_13_pParent.X4)
goto _32
}
func() {
if (*XExpr)(_13_pParent.X4) != _5_pE {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90367), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveCompoundOrderByØ00__func__Ø000))), unsafe.Pointer(str(97487)))
crt.X__builtin_abort(tls)
}
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_13_pParent.X4))))) = _11_pNew
_29:
_sqlite3ExprDelete(tls, _db, _5_pE)
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_4_pItem.X5))))).X0))) = uint16(_5_iCol)
storebits3((*int8)(unsafe.Pointer(&(_4_pItem.X4))), int8(i32(1)), 1, 0)
goto _36
_26:
_moreToDo = i32(1)
_36:
_14:
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_4_pItem }())) += uintptr(20)
goto _13
_16:
_pSelect = (*XSelect)(_pSelect.X14)
goto _7
_9:
_i = i32(0)
_37:
if _i >= (_pOrderBy.X0) {
goto _40
}
if int32((uint32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X4)<>uint(i32(31))) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(97506), _i+i32(1))
return i32(1)
}
_i += 1
goto _37
_40:
return i32(0)
}
var _resolveCompoundOrderByØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_resolveCompoundOrderByØ00__func__Ø000[0], str(97567), 23)
}
// pE is a pointer to an expression which is a single term in the
// ORDER BY of a compound SELECT. The expression has not been
// name resolved.
//
// At the point this routine is called, we already know that the
// ORDER BY term is not an integer index into the result set. That
// case is handled by the calling routine.
//
// Attempt to match pE against result set columns in the left-most
// SELECT statement. Return the index i of the matching column,
// as an indication to the caller that it should sort by the i-th column.
// The left-most column is 1. In other words, the value returned is the
// same integer value that would be used in the SQL statement to indicate
// the column.
//
// If there is no match, return 0. Return -1 if an error occurs.
func _resolveOrderByTermToExprList(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect, _pE *XExpr) (r0 int32) {
var _i, _rc int32
var _savedSuppErr uint8
var _db *Xsqlite3
var _pEList *XExprList
var _nc XNameContext
func() {
if _sqlite3ExprIsInteger(tls, _pE, &_i) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90240), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveOrderByTermToExprListØ00__func__Ø000))), unsafe.Pointer(str(97590)))
crt.X__builtin_abort(tls)
}
}()
_pEList = (*XExprList)(_pSelect.X0)
crt.Xmemset(tls, (unsafe.Pointer)(&_nc), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X1))))) = (*XSrcList)(_pSelect.X8)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_nc.X2))))) = _pEList
*(*uint16)(unsafe.Pointer(&(_nc.X7))) = uint16(i32(1))
*(*int32)(unsafe.Pointer(&(_nc.X6))) = i32(0)
_db = (*Xsqlite3)(_pParse.X0)
_savedSuppErr = _db.X21
*(*uint8)(unsafe.Pointer(&(_db.X21))) = uint8(i32(1))
_rc = _sqlite3ResolveExprNames(tls, &_nc, _pE)
*(*uint8)(unsafe.Pointer(&(_db.X21))) = _savedSuppErr
if _rc != 0 {
return i32(0)
}
_i = i32(0)
_3:
if _i >= (_pEList.X0) {
goto _6
}
if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X0), _pE, i32(-1)) < i32(2) {
return _i + i32(1)
}
_i += 1
goto _3
_6:
return i32(0)
_ = _nc
panic(0)
}
var _resolveOrderByTermToExprListØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_resolveOrderByTermToExprListØ00__func__Ø000[0], str(97622), 29)
}
// This routine adds datatype and collating sequence information to
// the Table structures of all FROM-clause subqueries in a
// SELECT statement.
//
// Use this routine after name resolution.
func _sqlite3SelectAddTypeInfo(tls *crt.TLS, _pParse *XParse, _pSelect *XSelect) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XSelect))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&(_w.X3))))) = _selectAddSubqueryTypeInfo
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _sqlite3ExprWalkNoop
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse
_sqlite3WalkSelect(tls, &_w, _pSelect)
_ = _w
}
// This is a Walker.xSelectCallback callback for the sqlite3SelectTypeInfo()
// interface.
//
// For each FROM-clause subquery, add Column.zType and Column.zColl
// information to the Table structure that represents the result set
// of that subquery.
//
// The Table structure that represents the result set was constructed
// by selectExpander() but the type and collation information was omitted
// at that point because identifiers had not yet been resolved. This
// routine is called after identifier resolution.
func _selectAddSubqueryTypeInfo(tls *crt.TLS, _pWalker *XWalker, _p *XSelect) {
var _i int32
var _1_pTab *XTable
var _pTabList *XSrcList
var _pFrom *TSrcList_item
var _2_pSel *XSelect
var _pParse *XParse
func() {
if ((_p.X3) & uint32(i32(4))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121182), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000))), unsafe.Pointer(str(97651)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X3) & uint32(i32(128))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121183), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000))), unsafe.Pointer(str(97677)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(128))
sink5 = *p
}
_pParse = (*XParse)(_pWalker.X0)
_pTabList = (*XSrcList)(_p.X8)
*func() **TSrcList_item { _i = i32(0); return &_pFrom }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))
_4:
if _i >= (_pTabList.X0) {
goto _7
}
_1_pTab = (*XTable)(_pFrom.X4)
func() {
if _1_pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121189), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectAddSubqueryTypeInfoØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
if ((_1_pTab.X9) & uint32(i32(2))) == uint32(i32(0)) {
goto _10
}
_2_pSel = (*XSelect)(_pFrom.X5)
if _2_pSel == nil {
goto _11
}
_12:
if (*XSelect)(_2_pSel.X13) != nil {
_2_pSel = (*XSelect)(_2_pSel.X13)
goto _12
}
_sqlite3SelectAddColumnTypeAndCollation(tls, _pParse, _1_pTab, _2_pSel)
_11:
_10:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pFrom }())) += uintptr(68)
goto _4
_7:
}
var _selectAddSubqueryTypeInfoØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_selectAddSubqueryTypeInfoØ00__func__Ø000[0], str(97711), 26)
}
// This routine attempts to flatten subqueries as a performance optimization.
// This routine returns 1 if it makes changes and 0 if no flattening occurs.
//
// To understand the concept of flattening, consider the following
// query:
//
// SELECT a FROM (SELECT x+y AS a FROM t1 WHERE z<100) WHERE a>5
//
// The default way of implementing this query is to execute the
// subquery first and store the results in a temporary table, then
// run the outer query on that temporary table. This requires two
// passes over the data. Furthermore, because the temporary table
// has no indices, the WHERE clause on the outer query cannot be
// optimized.
//
// This routine attempts to rewrite queries such as the above into
// a single flat select, like this:
//
// SELECT x+y AS a FROM t1 WHERE z<100 AND a>5
//
// The code generated for this simplification gives the same result
// but only has to scan the data once. And because indices might
// exist on the table t1, a complete scan of the data might be
// avoided.
//
// Flattening is only attempted if all of the following are true:
//
// (1) The subquery and the outer query do not both use aggregates.
//
// (2) The subquery is not an aggregate or (2a) the outer query is not a join
// and (2b) the outer query does not use subqueries other than the one
// FROM-clause subquery that is a candidate for flattening. (2b is
// due to ticket [2f7170d73bf9abf80] from 2015-02-09.)
//
// (3) The subquery is not the right operand of a LEFT JOIN
// or the subquery is not itself a join and the outer query is not
// an aggregate.
//
// (4) The subquery is not DISTINCT.
//
// (**) At one point restrictions (4) and (5) defined a subset of DISTINCT
// sub-queries that were excluded from this optimization. Restriction
// (4) has since been expanded to exclude all DISTINCT subqueries.
//
// (6) The subquery does not use aggregates or the outer query is not
// DISTINCT.
//
// (7) The subquery has a FROM clause. TODO: For subqueries without
// A FROM clause, consider adding a FROM clause with the special
// table sqlite_once that consists of a single row containing a
// single NULL.
//
// (8) The subquery does not use LIMIT or the outer query is not a join.
//
// (9) The subquery does not use LIMIT or the outer query does not use
// aggregates.
//
// (**) Restriction (10) was removed from the code on 2005-02-05 but we
// accidently carried the comment forward until 2014-09-15. Original
// text: "The subquery does not use aggregates or the outer query
// does not use LIMIT."
//
// (11) The subquery and the outer query do not both have ORDER BY clauses.
//
// (**) Not implemented. Subsumed into restriction (3). Was previously
// a separate restriction deriving from ticket #350.
//
// (13) The subquery and outer query do not both use LIMIT.
//
// (14) The subquery does not use OFFSET.
//
// (15) The outer query is not part of a compound select or the
// subquery does not have a LIMIT clause.
// (See ticket #2339 and ticket [02a8e81d44]).
//
// (16) The outer query is not an aggregate or the subquery does
// not contain ORDER BY. (Ticket #2942) This used to not matter
// until we introduced the group_concat() function.
//
// (17) The sub-query is not a compound select, or it is a UNION ALL
// compound clause made up entirely of non-aggregate queries, and
// the parent query:
//
// * is not itself part of a compound select,
// * is not an aggregate or DISTINCT query, and
// * is not a join
//
// The parent and sub-query may contain WHERE clauses. Subject to
// rules (11), (13) and (14), they may also contain ORDER BY,
// LIMIT and OFFSET clauses. The subquery cannot use any compound
// operator other than UNION ALL because all the other compound
// operators have an implied DISTINCT which is disallowed by
// restriction (4).
//
// Also, each component of the sub-query must return the same number
// of result columns. This is actually a requirement for any compound
// SELECT statement, but all the code here does is make sure that no
// such (illegal) sub-query is flattened. The caller will detect the
// syntax error and return a detailed message.
//
// (18) If the sub-query is a compound select, then all terms of the
// ORDER by clause of the parent must be simple references to
// columns of the sub-query.
//
// (19) The subquery does not use LIMIT or the outer query does not
// have a WHERE clause.
//
// (20) If the sub-query is a compound select, then it must not use
// an ORDER BY clause. Ticket #3773. We could relax this constraint
// somewhat by saying that the terms of the ORDER BY clause must
// appear as unmodified result columns in the outer query. But we
// have other optimizations in mind to deal with that case.
//
// (21) The subquery does not use LIMIT or the outer query is not
// DISTINCT. (See ticket [752e1646fc]).
//
// (22) The subquery is not a recursive CTE.
//
// (23) The parent is not a recursive CTE, or the sub-query is not a
// compound query. This restriction is because transforming the
// parent to a compound query confuses the code that handles
// recursive queries in multiSelect().
//
// (24) The subquery is not an aggregate that uses the built-in min() or
// or max() functions. (Without this restriction, a query like:
// "SELECT x FROM (SELECT max(y), x FROM t1)" would not necessarily
// return the value X for which Y was maximal.)
//
//
// In this routine, the "p" parameter is a pointer to the outer query.
// The subquery is p->pSrc->a[iFrom]. isAgg is true if the outer query
// uses aggregates and subqueryIsAgg is true if the subquery uses aggregates.
//
// If flattening is not attempted, this routine is a no-op and returns 0.
// If flattening is attempted this routine returns 1.
//
// All of the expression analysis must occur on both the outer query and
// the subquery before this routine runs.
func _flattenSubquery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iFrom int32, _isAgg int32, _subqueryIsAgg int32) (r0 int32) {
var _iParent, _iNewParent, _isLeftJoin, _i, _17_ii, _25_nSubSrc int32
var _zSavedAuthContext, _33_zName *int8
var _25_jointype uint8
var _db *Xsqlite3
var _22_pTabToDel *XTable
var _pSrc, _pSubSrc *XSrcList
var _pSubitem *TSrcList_item
var _pList, _19_pOrderBy, _34_pOrderBy *XExprList
var _pParent, _pSub, _pSub1, _19_pNew, _19_pPrior *XSelect
var _pWhere, _19_pLimit, _19_pOffset *XExpr
var _23_pToplevel *XParse
var _39_x XSubstContext
_zSavedAuthContext = _pParse.X65
_iNewParent = i32(-1)
_isLeftJoin = i32(0)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119953), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_p.X13) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119954), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97737)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_db.X13) & i32(1)) != i32(0) {
return i32(0)
}
_pSrc = (*XSrcList)(_p.X8)
func() {
if _pSrc == nil || _iFrom < i32(0) || _iFrom >= (_pSrc.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119957), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97750)))
crt.X__builtin_abort(tls)
}
}()
_pSubitem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_iFrom)))
_iParent = _pSubitem.X11
_pSub = (*XSelect)(_pSubitem.X5)
func() {
if _pSub == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119961), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97787)))
crt.X__builtin_abort(tls)
}
}()
if _subqueryIsAgg == 0 {
goto _11
}
if _isAgg != 0 {
return i32(0)
}
if (_pSrc.X0) > i32(1) {
return i32(0)
}
if ((((*XExpr)(_p.X9) != nil) && ((((*XExpr)(_p.X9).X2) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X0)) & uint32(i32(2097152))) != uint32(i32(0)))) || ((_sqlite3ExprListFlags(tls, (*XExprList)(_p.X12)) & uint32(i32(2097152))) != uint32(i32(0))) {
return i32(0)
}
_11:
_pSubSrc = (*XSrcList)(_pSub.X8)
func() {
if _pSubSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119974), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97795)))
crt.X__builtin_abort(tls)
}
}()
if ((*XExpr)(_pSub.X15) != nil) && ((*XExpr)(_p.X15) != nil) {
return i32(0)
}
if (*XExpr)(_pSub.X16) != nil {
return i32(0)
}
if (((_p.X3) & uint32(i32(256))) != uint32(i32(0))) && ((*XExpr)(_pSub.X15) != nil) {
return i32(0)
}
if (_pSubSrc.X0) == i32(0) {
return i32(0)
}
if ((_pSub.X3) & uint32(i32(1))) != 0 {
return i32(0)
}
if ((*XExpr)(_pSub.X15) != nil) && (((_pSrc.X0) > i32(1)) || _isAgg != 0) {
return i32(0)
}
if (((_p.X3) & uint32(i32(1))) != uint32(i32(0))) && _subqueryIsAgg != 0 {
return i32(0)
}
if ((*XExprList)(_p.X12) != nil) && ((*XExprList)(_pSub.X12) != nil) {
return i32(0)
}
if _isAgg != 0 && ((*XExprList)(_pSub.X12) != nil) {
return i32(0)
}
if ((*XExpr)(_pSub.X15) != nil) && ((*XExpr)(_p.X9) != nil) {
return i32(0)
}
if ((*XExpr)(_pSub.X15) != nil) && (((_p.X3) & uint32(i32(1))) != uint32(i32(0))) {
return i32(0)
}
if ((_pSub.X3) & uint32(i32(12288))) != 0 {
return i32(0)
}
if (((_p.X3) & uint32(i32(8192))) != 0) && ((*XSelect)(_pSub.X13) != nil) {
return i32(0)
}
if (int32((*t28)(unsafe.Pointer(&(_pSubitem.X9))).X0) & i32(32)) == i32(0) {
goto _43
}
_isLeftJoin = i32(1)
if ((_pSubSrc.X0) > i32(1)) || _isAgg != 0 {
return i32(0)
}
_43:
if (*XSelect)(_pSub.X13) == nil {
goto _46
}
if (*XExprList)(_pSub.X12) != nil {
return i32(0)
}
if (_isAgg != 0 || (((_p.X3) & uint32(i32(1))) != uint32(i32(0)))) || ((_pSrc.X0) != i32(1)) {
return i32(0)
}
_pSub1 = _pSub
_51:
if _pSub1 == nil {
goto _54
}
func() {
if (*XSrcList)(_pSub.X8) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120059), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97803)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XExprList)(_pSub.X0).X0) != ((*XExprList)(_pSub1.X0).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120060), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97817)))
crt.X__builtin_abort(tls)
}
}()
if ((((_pSub1.X3) & uint32(i32(9))) != uint32(i32(0))) || (((*XSelect)(_pSub1.X13) != nil) && (int32(_pSub1.X1) != i32(116)))) || (((*XSrcList)(_pSub1.X8).X0) < i32(1)) {
return i32(0)
}
_pSub1 = (*XSelect)(_pSub1.X13)
goto _51
_54:
if (*XExprList)(_p.X12) == nil {
goto _63
}
_17_ii = i32(0)
_64:
if _17_ii >= ((*XExprList)(_p.X12).X0) {
goto _67
}
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X12).X2))))) + 20*uintptr(_17_ii))).X5))))).X0) == i32(0) {
return i32(0)
}
_17_ii += 1
goto _64
_67:
_63:
_46:
if (Xsqlite3SelectTrace & i32(1)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(97859)
}(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_pSub.X6)))))), unsafe.Pointer(_pSub), _iFrom)
}
*(**int8)(unsafe.Pointer(&(_pParse.X65))) = _pSubitem.X2
_i = _sqlite3AuthCheck(tls, _pParse, i32(21), nil, nil, nil)
*(**int8)(unsafe.Pointer(&(_pParse.X65))) = _zSavedAuthContext
_pSub = (*XSelect)(_pSub.X13)
_70:
if _pSub == nil {
goto _73
}
_19_pOrderBy = (*XExprList)(_p.X12)
_19_pLimit = (*XExpr)(_p.X15)
_19_pOffset = (*XExpr)(_p.X16)
_19_pPrior = (*XSelect)(_p.X13)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil
_19_pNew = _sqlite3SelectDup(tls, _db, _p, i32(0))
_sqlite3SelectSetName(tls, _19_pNew, (*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_pSub.X6))))))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _19_pOffset
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _19_pLimit
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _19_pOrderBy
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _pSrc
*(*uint8)(unsafe.Pointer(&(_p.X1))) = uint8(i32(116))
if _19_pNew == nil {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _19_pPrior
goto _75
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pNew.X13))))) = _19_pPrior
if _19_pPrior != nil {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pPrior.X14))))) = _19_pNew
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pNew.X14))))) = _p
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _19_pNew
if (Xsqlite3SelectTrace & i32(2)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(97887)
}(), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_19_pNew.X6)))))), unsafe.Pointer(_19_pNew))
}
_75:
if (_db.X17) != 0 {
return i32(1)
}
_pSub = (*XSelect)(_pSub.X13)
goto _70
_73:
_pSub = store59(&_pSub1, (*XSelect)(_pSubitem.X5))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X2))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubitem.X3))
*(**int8)(unsafe.Pointer(&(_pSubitem.X1))) = nil
*(**int8)(unsafe.Pointer(&(_pSubitem.X2))) = nil
*(**int8)(unsafe.Pointer(&(_pSubitem.X3))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubitem.X5))))) = nil
if func() int32 {
if (*XTable)(_pSubitem.X4) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120177), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _81
}
_22_pTabToDel = (*XTable)(_pSubitem.X4)
if (_22_pTabToDel.X8) == uint32(i32(1)) {
_23_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_22_pTabToDel.X21))))) = (*XTable)(_23_pToplevel.X68)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_23_pToplevel.X68))))) = _22_pTabToDel
goto _85
}
*(*uint32)(unsafe.Pointer(&(_22_pTabToDel.X8))) -= 1
_85:
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubitem.X4))))) = nil
_81:
_pParent = _p
_86:
if _pParent == nil {
goto _89
}
_25_jointype = uint8(i32(0))
_pSubSrc = (*XSrcList)(_pSub.X8)
_25_nSubSrc = _pSubSrc.X0
_pSrc = (*XSrcList)(_pParent.X8)
if _pSrc != nil {
func() {
if _pParent != _p {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120210), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97938)))
crt.X__builtin_abort(tls)
}
}()
_25_jointype = (*t28)(unsafe.Pointer(&(_pSubitem.X9))).X0
goto _93
}
func() {
if _pParent == _p {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120213), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97949)))
crt.X__builtin_abort(tls)
}
}()
_pSrc = store60((**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X8))))), _sqlite3SrcListAppend(tls, _db, nil, nil, nil))
if _pSrc == nil {
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120216), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
goto _89
}
_93:
if _25_nSubSrc <= i32(1) {
goto _99
}
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X8))))) = store60(&_pSrc, _sqlite3SrcListEnlarge(tls, _db, _pSrc, _25_nSubSrc-i32(1), _iFrom+i32(1)))
if (_db.X17) != 0 {
goto _89
}
_99:
_i = i32(0)
_101:
if _i >= _25_nSubSrc {
goto _104
}
_sqlite3IdListDelete(tls, _db, (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_i+_iFrom))).X13))
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(_i+_iFrom))).X9))).X1)>>uint(i32(2)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120248), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97960)))
crt.X__builtin_abort(tls)
}
}()
*(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i+_iFrom))) = *(*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2))))) + 68*uintptr(_i)))
_iNewParent = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2))))) + 68*uintptr(_i))).X11
crt.Xmemset(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSubSrc.X2)))))+68*uintptr(_i)))), i32(0), u32(68))
_i += 1
goto _101
_104:
*(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_iFrom))).X9))).X0))) = _25_jointype
_pList = (*XExprList)(_pParent.X0)
_i = i32(0)
_107:
if _i >= (_pList.X0) {
goto _110
}
if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_i))).X1) == nil {
_33_zName = _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X2)
_sqlite3Dequote(tls, _33_zName)
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_i))).X1))) = _33_zName
}
_i += 1
goto _107
_110:
if (*XExprList)(_pSub.X12) == nil {
goto _112
}
_34_pOrderBy = (*XExprList)(_pSub.X12)
_i = i32(0)
_113:
if _i >= (_34_pOrderBy.X0) {
goto _116
}
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_34_pOrderBy.X2))))) + 20*uintptr(_i))).X5))))).X0))) = uint16(i32(0))
_i += 1
goto _113
_116:
func() {
if (*XExprList)(_pParent.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120290), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(97993)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_pSub.X13) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120291), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(98014)))
crt.X__builtin_abort(tls)
}
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X12))))) = _34_pOrderBy
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSub.X12))))) = nil
_112:
_pWhere = _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.X9), i32(0))
if _isLeftJoin > i32(0) {
_setJoinExpr(tls, _pWhere, _iNewParent)
}
if _subqueryIsAgg != 0 {
func() {
if (*XExpr)(_pParent.X11) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120300), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(98030)))
crt.X__builtin_abort(tls)
}
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X11))))) = (*XExpr)(_pParent.X9)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X9))))) = _pWhere
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X11))))) = _sqlite3ExprAnd(tls, _db, _sqlite3ExprDup(tls, _db, (*XExpr)(_pSub.X11), i32(0)), (*XExpr)(_pParent.X11))
func() {
if (*XExprList)(_pParent.X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120306), unsafe.Pointer((*int8)(unsafe.Pointer(&_flattenSubqueryØ00__func__Ø000))), unsafe.Pointer(str(98050)))
crt.X__builtin_abort(tls)
}
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X10))))) = _sqlite3ExprListDup(tls, _db, (*XExprList)(_pSub.X10), i32(0))
goto _127
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X9))))) = _sqlite3ExprAnd(tls, _db, _pWhere, (*XExpr)(_pParent.X9))
_127:
if int32(_db.X17) == i32(0) {
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_39_x.X0))))) = _pParse
*(*int32)(unsafe.Pointer(&(_39_x.X1))) = _iParent
*(*int32)(unsafe.Pointer(&(_39_x.X2))) = _iNewParent
*(*int32)(unsafe.Pointer(&(_39_x.X3))) = _isLeftJoin
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_39_x.X4))))) = (*XExprList)(_pSub.X0)
_substSelect(tls, &_39_x, _pParent, i32(0))
}
{
p := (*uint32)(unsafe.Pointer(&(_pParent.X3)))
*p = (*p) | ((_pSub.X3) & uint32(i32(1)))
sink5 = *p
}
if (*XExpr)(_pSub.X15) != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParent.X15))))) = (*XExpr)(_pSub.X15)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSub.X15))))) = nil
}
*func() **XSelect { _pParent = (*XSelect)(_pParent.X13); return &_pSub }() = (*XSelect)(_pSub.X13)
goto _86
_89:
_sqlite3SelectDelete(tls, _db, _pSub1)
if (Xsqlite3SelectTrace & i32(256)) == 0 {
goto _130
}
if (Xsqlite3SelectTrace & i32(256)) != 0 {
_sqlite3DebugPrintf(tls, func() *int8 {
_sqlite3DebugPrintf(tls, str(45660), ((_pParse.X35)*i32(2))-i32(2), unsafe.Pointer(str(0)), unsafe.Pointer((*int8)(unsafe.Pointer((*[12]int8)(unsafe.Pointer(&(_p.X6)))))), unsafe.Pointer(_p))
return str(98071)
}())
}
_sqlite3TreeViewSelect(tls, nil, _p, uint8(i32(0)))
_130:
return i32(1)
_ = _39_x
panic(0)
}
var _flattenSubqueryØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_flattenSubqueryØ00__func__Ø000[0], str(98090), 16)
}
func _substSelect(tls *crt.TLS, _pSubst *XSubstContext, _p *XSelect, _doPrior int32) {
var _i int32
var _pSrc *XSrcList
var _pItem *TSrcList_item
if _p == nil {
return
}
_0:
_substExprList(tls, _pSubst, (*XExprList)(_p.X0))
_substExprList(tls, _pSubst, (*XExprList)(_p.X10))
_substExprList(tls, _pSubst, (*XExprList)(_p.X12))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X11))))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X11))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X9))))) = _substExpr(tls, _pSubst, (*XExpr)(_p.X9))
_pSrc = (*XSrcList)(_p.X8)
func() {
if _pSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119777), unsafe.Pointer((*int8)(unsafe.Pointer(&_substSelectØ00__func__Ø000))), unsafe.Pointer(str(47821)))
crt.X__builtin_abort(tls)
}
}()
*func() **TSrcList_item { _i = _pSrc.X0; return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))
_4:
if _i <= i32(0) {
goto _7
}
_substSelect(tls, _pSubst, (*XSelect)(_pItem.X5), i32(1))
if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15)))))))
}
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i -= 1; return &_pItem }())) += uintptr(68)
goto _4
_7:
if _doPrior != 0 && (store59(&_p, (*XSelect)(_p.X13)) != nil) {
goto _0
}
}
func _substExprList(tls *crt.TLS, _pSubst *XSubstContext, _pList *XExprList) {
var _i int32
if _pList == nil {
return
}
_i = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_i))).X0))))) = _substExpr(tls, _pSubst, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0))
_i += 1
goto _1
_4:
}
// Scan through the expression pExpr. Replace every reference to
// a column in table number iTable with a copy of the iColumn-th
// entry in pEList. (But leave references to the ROWID column
// unchanged.)
//
// This routine is part of the flattening procedure. A subquery
// whose result set is defined by pEList appears as entry in the
// FROM clause of a SELECT such that the VDBE cursor assigned to that
// FORM clause entry is iTable. This routine makes the necessary
// changes to pExpr so that it refers directly to the source table
// of the subquery rather the result set of the subquery.
func _substExpr(tls *crt.TLS, _pSubst *XSubstContext, _pExpr *XExpr) (r0 *XExpr) {
var _6_db *Xsqlite3
var _4_pNew, _4_pCopy *XExpr
var _4_ifNullRow XExpr
if _pExpr == nil {
return nil
}
if (((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0))) && (int32(_pExpr.X11) == (_pSubst.X1)) {
*(*int16)(unsafe.Pointer(&(_pExpr.X11))) = int16(_pSubst.X2)
}
if int32(_pExpr.X0) != i32(152) || (_pExpr.X8) != (_pSubst.X1) {
goto _4
}
if int32(_pExpr.X9) < i32(0) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101))
goto _6
}
_4_pCopy = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSubst.X4).X2))))) + 20*uintptr(_pExpr.X9))).X0)
func() {
if (*XExprList)(_pSubst.X4) == nil || int32(_pExpr.X9) >= ((*XExprList)(_pSubst.X4).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119715), unsafe.Pointer((*int8)(unsafe.Pointer(&_substExprØ00__func__Ø000))), unsafe.Pointer(str(98106)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_pExpr.X4) != nil || (*XExpr)(_pExpr.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119716), unsafe.Pointer((*int8)(unsafe.Pointer(&_substExprØ00__func__Ø000))), unsafe.Pointer(str(96223)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprIsVector(tls, _4_pCopy) != 0 {
_sqlite3VectorErrorMsg(tls, (*XParse)(_pSubst.X0), _4_pCopy)
goto _14
}
_6_db = (*Xsqlite3)((*XParse)(_pSubst.X0).X0)
if (_pSubst.X3) != 0 && (int32(_4_pCopy.X0) != i32(152)) {
crt.Xmemset(tls, (unsafe.Pointer)(&_4_ifNullRow), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_4_ifNullRow.X0))) = uint8(i32(160))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_ifNullRow.X4))))) = _4_pCopy
*(*int32)(unsafe.Pointer(&(_4_ifNullRow.X8))) = _pSubst.X2
_4_pCopy = &_4_ifNullRow
}
_4_pNew = _sqlite3ExprDup(tls, _6_db, _4_pCopy, i32(0))
if (_4_pNew != nil) && (((_pExpr.X2) & uint32(i32(1))) != 0) {
*(*int16)(unsafe.Pointer(&(_4_pNew.X11))) = _pExpr.X11
{
p := (*uint32)(unsafe.Pointer(&(_4_pNew.X2)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
}
_sqlite3ExprDelete(tls, _6_db, _pExpr)
_pExpr = _4_pNew
_14:
_6:
goto _19
_4:
if (int32(_pExpr.X0) == i32(160)) && ((_pExpr.X8) == (_pSubst.X1)) {
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pSubst.X2
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X4))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = _substExpr(tls, _pSubst, (*XExpr)(_pExpr.X5))
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
_substSelect(tls, _pSubst, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))), i32(1))
goto _23
}
_substExprList(tls, _pSubst, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))))
_23:
_19:
return _pExpr
_ = _4_ifNullRow
panic(0)
}
var _substExprØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_substExprØ00__func__Ø000[0], str(98164), 10)
}
func _sqlite3VectorErrorMsg(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
if ((_pExpr.X2) & uint32(i32(2048))) != 0 {
_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X0, i32(1))
goto _1
}
_sqlite3ErrorMsg(tls, _pParse, str(43181))
_1:
}
func _sqlite3SubselectError(tls *crt.TLS, _pParse *XParse, _nActual int32, _nExpect int32) {
var _zFmt *int8
_zFmt = str(98174)
_sqlite3ErrorMsg(tls, _pParse, _zFmt, _nActual, _nExpect)
}
var _substSelectØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_substSelectØ00__func__Ø000[0], str(98218), 12)
}
// This routine is called to process a compound query form from
// two or more separate queries using UNION, UNION ALL, EXCEPT, or
// INTERSECT
//
// "p" points to the right-most of the two queries. the query on the
// left is p->pPrior. The left query could also be a compound query
// in which case this routine will be called recursively.
//
// The results of the total query are to be written into a destination
// of type eDest with parameter iParm.
//
// Example 1: Consider a three-way compound SQL statement.
//
// SELECT a FROM t1 UNION SELECT b FROM t2 UNION SELECT c FROM t3
//
// This statement is parsed up as follows:
//
// SELECT c FROM t3
// |
// `-----> SELECT b FROM t2
// |
// `------> SELECT a FROM t1
//
// The arrows in the diagram above represent the Select.pPrior pointer.
// So if this routine is called with p equal to the t3 query, then
// pPrior will be the t2 query. p->op will be TK_UNION in this case.
//
// Notice that because of the way SQLite parses compound SELECTs, the
// individual selects always group from left to right.
func _multiSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
var _rc, _iSub1, _iSub2, _8_addr, _8_nLimit, _14_unionTab, _14_priorOp, _14_addr, _21_iCont, _21_iBreak, _21_iStart, _23_tab1, _23_tab2, _23_iCont, _23_iBreak, _23_iStart, _23_addr, _23_r1, _26_i, _26_nCol, _31_addr int32
var _14_op uint8
var _db *Xsqlite3
var _v *TVdbe
var _pPrior, _pDelete, _22_pFirst, _25_pFirst, _26_pLoop *XSelect
var _14_pLimit, _14_pOffset, _23_pLimit, _23_pOffset *XExpr
var _26_pKeyInfo *XKeyInfo
var _26_apColl **XCollSeq
var _dest, _14_uniondest, _23_intersectdest XSelectDest
_rc = i32(0)
_pDelete = nil
_iSub1 = i32(0)
_iSub2 = i32(0)
func() {
if _p == nil || (*XSelect)(_p.X13) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118776), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98230)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_p.X3)&uint32(i32(8192))) != uint32(i32(0)) && int32(_p.X1) != i32(116) && int32(_p.X1) != i32(115) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118777), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98245)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
_pPrior = (*XSelect)(_p.X13)
_dest = *_pDest
if (*XExprList)(_pPrior.X12) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(98313), unsafe.Pointer(_selectOpName(tls, int32(_p.X1))))
_rc = i32(1)
goto _multi_select_end
}
if (*XExpr)(_pPrior.X15) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(98361), unsafe.Pointer(_selectOpName(tls, int32(_p.X1))))
_rc = i32(1)
goto _multi_select_end
}
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118795), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
if int32(_dest.X0) == i32(12) {
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118800), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(110), _dest.X2, (*XExprList)(_p.X0).X0)
*(*uint8)(unsafe.Pointer(&(_dest.X0))) = uint8(i32(14))
}
if ((_p.X3) & uint32(i32(1024))) != 0 {
_rc = _multiSelectValues(tls, _pParse, _p, &_dest)
goto _multi_select_end
}
func() {
if (*XExprList)(_p.X0) == nil || (*XExprList)(_pPrior.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118815), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98416)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XExprList)(_p.X0).X0) != ((*XExprList)(_pPrior.X0).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118816), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98444)))
crt.X__builtin_abort(tls)
}
}()
if ((_p.X3) & uint32(i32(8192))) != 0 {
_generateWithRecursiveQuery(tls, _pParse, _p, &_dest)
goto _39
}
if (*XExprList)(_p.X12) != nil {
return _multiSelectOrderBy(tls, _pParse, _p, _pDest)
}
switch int32(_p.X1) {
case i32(115):
goto _26
case i32(116):
goto _25
case i32(117):
goto _26
default:
goto _28
}
_25:
_8_addr = i32(0)
func() {
if (*XExpr)(_pPrior.X15) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118836), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98484)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pPrior.X4))) = _p.X4
*(*int32)(unsafe.Pointer(&(_pPrior.X5))) = _p.X5
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X15))))) = (*XExpr)(_p.X15)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X16))))) = (*XExpr)(_p.X16)
_iSub1 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _pPrior, &_dest)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil
if _rc != 0 {
goto _multi_select_end
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
*(*int32)(unsafe.Pointer(&(_p.X4))) = _pPrior.X4
*(*int32)(unsafe.Pointer(&(_p.X5))) = _pPrior.X5
if (_p.X4) == 0 {
goto _32
}
_8_addr = _sqlite3VdbeAddOp1(tls, _v, i32(22), _p.X4)
_sqlite3VdbeComment(tls, _v, str(98500))
if (_p.X5) != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(149), _p.X4, (_p.X5)+i32(1), _p.X5)
}
_32:
_iSub2 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _p, &_dest)
_pDelete = (*XSelect)(_p.X13)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2)
if ((((*XExpr)(_pPrior.X15) != nil) && _sqlite3ExprIsInteger(tls, (*XExpr)(_pPrior.X15), &_8_nLimit) != 0) && (_8_nLimit > i32(0))) && (int32(_p.X2) > int32(_sqlite3LogEst(tls, uint64(_8_nLimit)))) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEst(tls, uint64(_8_nLimit))
}
if _8_addr != 0 {
_sqlite3VdbeJumpHere(tls, _v, _8_addr)
}
goto _39
_26:
_14_op = u8(0)
_14_priorOp = i32(1)
if int32(_dest.X0) == _14_priorOp {
func() {
if (*XExpr)(_p.X15) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118892), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98528)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_p.X16) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118893), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98541)))
crt.X__builtin_abort(tls)
}
}()
_14_unionTab = _dest.X2
goto _45
}
_14_unionTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
func() {
if (*XExprList)(_p.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118900), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98555)))
crt.X__builtin_abort(tls)
}
}()
_14_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _14_unionTab, i32(0))
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0))))) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118902), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98570)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _14_addr
{
p := (*uint32)(unsafe.Pointer(&(_findRightmost(tls, _p).X3)))
*p = (*p) | uint32(i32(32))
sink5 = *p
}
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118905), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406)))
crt.X__builtin_abort(tls)
}
}()
_45:
func() {
if (*XExprList)(_pPrior.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118910), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98595)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3SelectDestInit(tls, &_14_uniondest, _14_priorOp, _14_unionTab)
_iSub1 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _pPrior, &_14_uniondest)
if _rc != 0 {
goto _multi_select_end
}
if int32(_p.X1) == i32(117) {
_14_op = uint8(i32(2))
goto _56
}
func() {
if int32(_p.X1) != i32(115) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118923), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98613)))
crt.X__builtin_abort(tls)
}
}()
_14_op = uint8(i32(1))
_56:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
_14_pLimit = (*XExpr)(_p.X15)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil
_14_pOffset = (*XExpr)(_p.X16)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil
*(*uint8)(unsafe.Pointer(&(_14_uniondest.X0))) = _14_op
_iSub2 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _p, &_14_uniondest)
_sqlite3ExprListDelete(tls, _db, (*XExprList)(_p.X12))
_pDelete = (*XSelect)(_p.X13)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil
if int32(_p.X1) == i32(115) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2)
}
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _14_pLimit
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _14_pOffset
*(*int32)(unsafe.Pointer(&(_p.X4))) = i32(0)
*(*int32)(unsafe.Pointer(&(_p.X5))) = i32(0)
func() {
if _14_unionTab != (_dest.X2) && int32(_dest.X0) == _14_priorOp {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118953), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98629)))
crt.X__builtin_abort(tls)
}
}()
if int32(_dest.X0) == _14_priorOp {
goto _63
}
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118956), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406)))
crt.X__builtin_abort(tls)
}
}()
if int32(_dest.X0) != i32(9) {
goto _66
}
_22_pFirst = _p
_67:
if (*XSelect)(_22_pFirst.X13) != nil {
_22_pFirst = (*XSelect)(_22_pFirst.X13)
goto _67
}
_generateColumnNames(tls, _pParse, (*XSrcList)(_22_pFirst.X8), (*XExprList)(_22_pFirst.X0))
_66:
_21_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
_21_iCont = _sqlite3VdbeMakeLabel(tls, _v)
_computeLimitRegisters(tls, _pParse, _p, _21_iBreak)
_sqlite3VdbeAddOp2(tls, _v, i32(37), _14_unionTab, _21_iBreak)
_21_iStart = _sqlite3VdbeCurrentAddr(tls, _v)
_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), _14_unionTab, nil, nil, &_dest, _21_iCont, _21_iBreak)
_sqlite3VdbeResolveLabel(tls, _v, _21_iCont)
_sqlite3VdbeAddOp2(tls, _v, i32(7), _14_unionTab, _21_iStart)
_sqlite3VdbeResolveLabel(tls, _v, _21_iBreak)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _14_unionTab, i32(0))
_63:
goto _39
_28:
func() {
if int32(_p.X1) != i32(118) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118976), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98675)))
crt.X__builtin_abort(tls)
}
}()
_23_tab1 = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_23_tab2 = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
func() {
if (*XExprList)(_p.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118990), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98555)))
crt.X__builtin_abort(tls)
}
}()
_23_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _23_tab1, i32(0))
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0))))) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118993), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98570)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _23_addr
{
p := (*uint32)(unsafe.Pointer(&(_findRightmost(tls, _p).X3)))
*p = (*p) | uint32(i32(32))
sink5 = *p
}
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118996), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3SelectDestInit(tls, &_23_intersectdest, i32(1), _23_tab1)
_iSub1 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _pPrior, &_23_intersectdest)
if _rc != 0 {
goto _multi_select_end
}
_23_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _23_tab2, i32(0))
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(1))))) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119010), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98695)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(1)))) = _23_addr
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
_23_pLimit = (*XExpr)(_p.X15)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil
_23_pOffset = (*XExpr)(_p.X16)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil
*(*int32)(unsafe.Pointer(&(_23_intersectdest.X2))) = _23_tab2
_iSub2 = _pParse.X59
_rc = _sqlite3Select(tls, _pParse, _p, &_23_intersectdest)
_pDelete = (*XSelect)(_p.X13)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior
if int32(_p.X2) > int32(_pPrior.X2) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _pPrior.X2
}
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _23_pLimit
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _23_pOffset
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119031), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98406)))
crt.X__builtin_abort(tls)
}
}()
if int32(_dest.X0) != i32(9) {
goto _83
}
_25_pFirst = _p
_84:
if (*XSelect)(_25_pFirst.X13) != nil {
_25_pFirst = (*XSelect)(_25_pFirst.X13)
goto _84
}
_generateColumnNames(tls, _pParse, (*XSrcList)(_25_pFirst.X8), (*XExprList)(_25_pFirst.X0))
_83:
_23_iBreak = _sqlite3VdbeMakeLabel(tls, _v)
_23_iCont = _sqlite3VdbeMakeLabel(tls, _v)
_computeLimitRegisters(tls, _pParse, _p, _23_iBreak)
_sqlite3VdbeAddOp2(tls, _v, i32(37), _23_tab1, _23_iBreak)
_23_r1 = _sqlite3GetTempReg(tls, _pParse)
_23_iStart = _sqlite3VdbeAddOp2(tls, _v, i32(124), _23_tab1, _23_r1)
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _23_tab2, _23_iCont, _23_r1, i32(0))
_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), _23_tab1, nil, nil, &_dest, _23_iCont, _23_iBreak)
_sqlite3VdbeResolveLabel(tls, _v, _23_iCont)
_sqlite3VdbeAddOp2(tls, _v, i32(7), _23_tab1, _23_iStart)
_sqlite3VdbeResolveLabel(tls, _v, _23_iBreak)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _23_tab2, i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(114), _23_tab1, i32(0))
goto _39
_39:
_explainComposite(tls, _pParse, int32(_p.X1), _iSub1, _iSub2, bool2int(int32(_p.X1) != i32(116)))
if ((_p.X3) & uint32(i32(32))) == 0 {
goto _multi_select_end
}
func() {
if (*XSelect)(_p.X14) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119074), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98720)))
crt.X__builtin_abort(tls)
}
}()
_26_nCol = (*XExprList)(_p.X0).X0
_26_pKeyInfo = _sqlite3KeyInfoAlloc(tls, _db, _26_nCol, i32(1))
if _26_pKeyInfo == nil {
_rc = _sqlite3NomemError(tls, i32(119078))
goto _multi_select_end
}
*func() ***XCollSeq { _26_i = i32(0); return &_26_apColl }() = (**XCollSeq)(unsafe.Pointer((*[1]unsafe.Pointer)(unsafe.Pointer(&(_26_pKeyInfo.X6)))))
_90:
if _26_i >= _26_nCol {
goto _93
}
*_26_apColl = _multiSelectCollSeq(tls, _pParse, _p, _26_i)
if nil == (*_26_apColl) {
*_26_apColl = (*XCollSeq)(_db.X2)
}
*(*uintptr)(unsafe.Pointer(func() ***XCollSeq { _26_i += 1; return &_26_apColl }())) += uintptr(4)
goto _90
_93:
_26_pLoop = _p
_95:
if _26_pLoop == nil {
goto _98
}
_26_i = i32(0)
_99:
if _26_i >= i32(2) {
goto _102
}
_31_addr = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(_26_i)))
if _31_addr < i32(0) {
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(i32(1))))) >= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119094), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectØ00__func__Ø000))), unsafe.Pointer(str(98732)))
crt.X__builtin_abort(tls)
}
}()
goto _102
}
_sqlite3VdbeChangeP2(tls, _v, uint32(_31_addr), _26_nCol)
_sqlite3VdbeChangeP4(tls, _v, _31_addr, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _26_pKeyInfo))), i32(-5))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_26_pLoop.X7))))) + 4*uintptr(_26_i))) = i32(-1)
_26_i += 1
goto _99
_102:
_26_pLoop = (*XSelect)(_26_pLoop.X13)
goto _95
_98:
_sqlite3KeyInfoUnref(tls, _26_pKeyInfo)
_multi_select_end:
*(*int32)(unsafe.Pointer(&(_pDest.X3))) = _dest.X3
*(*int32)(unsafe.Pointer(&(_pDest.X4))) = _dest.X4
_sqlite3SelectDelete(tls, _db, _pDelete)
return _rc
_ = _dest
_ = _14_uniondest
_ = _23_intersectdest
panic(0)
}
var _multiSelectØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_multiSelectØ00__func__Ø000[0], str(98757), 12)
}
// Handle the special case of a compound-select that originates from a
// VALUES clause. By handling this as a special case, we avoid deep
// recursion, and thus do not need to enforce the SQLITE_LIMIT_COMPOUND_SELECT
// on a VALUES clause.
//
// Because the Select object originates from a VALUES clause:
// (1) It has no LIMIT or OFFSET
// (2) All terms are UNION ALL
// (3) There is no ORDER BY clause
func _multiSelectValues(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
var _nRow, _rc int32
var _pPrior *XSelect
_nRow = i32(1)
_rc = i32(0)
func() {
if ((_p.X3) & uint32(i32(1024))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118702), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98769)))
crt.X__builtin_abort(tls)
}
}()
_2:
func() {
if ((_p.X3) & uint32(i32(512))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118704), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98797)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X1) != i32(116) && (int32(_p.X1) != i32(119) || (*XSelect)(_p.X13) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118705), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98821)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_p.X15) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118706), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98528)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_p.X16) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118707), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98541)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_p.X14) != nil && ((*XExprList)(_p.X0).X0) != ((*XExprList)((*XSelect)(_p.X14).X0).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118708), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98873)))
crt.X__builtin_abort(tls)
}
}()
if (*XSelect)(_p.X13) == nil {
goto _17
}
func() {
if (*XSelect)((*XSelect)(_p.X13).X14) != _p {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118710), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectValuesØ00__func__Ø000))), unsafe.Pointer(str(98930)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XSelect)(_p.X13)
_nRow += 1
goto _2
_17:
if _p == nil {
goto _21
}
_pPrior = (*XSelect)(_p.X13)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
_rc = _sqlite3Select(tls, _pParse, _p, _pDest)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior
if _rc != 0 {
goto _21
}
*(*int16)(unsafe.Pointer(&(_p.X2))) = int16(_nRow)
_p = (*XSelect)(_p.X14)
goto _17
_21:
return _rc
}
var _multiSelectValuesØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_multiSelectValuesØ00__func__Ø000[0], str(98950), 18)
}
// This routine generates VDBE code to compute the content of a WITH RECURSIVE
// query of the form:
//
// AS ( UNION [ALL] )
// \___________/ \_______________/
// p->pPrior p
//
//
// There is exactly one reference to the recursive-table in the FROM clause
// of recursive-query, marked with the SrcList->a[].fg.isRecursive flag.
//
// The setup-query runs once to generate an initial set of rows that go
// into a Queue table. Rows are extracted from the Queue table one by
// one. Each row extracted from Queue is output to pDest. Then the single
// extracted row (now in the iCurrent table) becomes the content of the
// recursive-table for a recursive-query run. The output of the recursive-query
// is added back into the Queue table. Then another row is extracted from Queue
// and the iteration continues until the Queue table is empty.
//
// If the compound query operator is UNION then no duplicate rows are ever
// inserted into the Queue table. The iDistinct table keeps a copy of all rows
// that have ever been inserted into Queue and causes duplicates to be
// discarded. If the operator is UNION ALL, then duplicates are allowed.
//
// If the query has an ORDER BY, then entries in the Queue table are kept in
// ORDER BY order and the first entry is extracted for each cycle. Without
// an ORDER BY, the Queue table is just a FIFO.
//
// If a LIMIT clause is provided, then the iteration stops after LIMIT rows
// have been output to pDest. A LIMIT of zero means to output no rows and a
// negative LIMIT means to output all rows. If there is also an OFFSET clause
// with a positive value, then the first OFFSET outputs are discarded rather
// than being sent to pDest. The LIMIT count does not begin until after OFFSET
// rows have been skipped.
func _generateWithRecursiveQuery(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) {
var _nCol, _addrTop, _addrCont, _addrBreak, _iCurrent, _regCurrent, _iQueue, _iDistinct, _eDest, _i, _rc, _regLimit, _regOffset int32
var _v *TVdbe
var _pSrc *XSrcList
var _pOrderBy *XExprList
var _pSetup *XSelect
var _pLimit, _pOffset *XExpr
var _5_pKeyInfo *XKeyInfo
var _destQueue XSelectDest
_pSrc = (*XSrcList)(_p.X8)
_nCol = (*XExprList)(_p.X0).X0
_v = (*TVdbe)(_pParse.X2)
_pSetup = (*XSelect)(_p.X13)
_iCurrent = i32(0)
_iDistinct = i32(0)
_eDest = i32(5)
if _sqlite3AuthCheck(tls, _pParse, i32(33), nil, nil, nil) != 0 {
return
}
_addrBreak = _sqlite3VdbeMakeLabel(tls, _v)
*(*int16)(unsafe.Pointer(&(_p.X2))) = int16(i32(320))
_computeLimitRegisters(tls, _pParse, _p, _addrBreak)
_pLimit = (*XExpr)(_p.X15)
_pOffset = (*XExpr)(_p.X16)
_regLimit = _p.X4
_regOffset = _p.X5
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = store36((**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))), nil)
*(*int32)(unsafe.Pointer(&(_p.X4))) = store1((*int32)(unsafe.Pointer(&(_p.X5))), i32(0))
_pOrderBy = (*XExprList)(_p.X12)
_i = i32(0)
_1:
if func() int32 {
if _i < (_pSrc.X0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118583), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _6
}
if ((uint32(((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i))).X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_iCurrent = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(_i))).X11
goto _6
}
_i += 1
goto _1
_6:
_iQueue = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
if int32(_p.X1) == i32(115) {
_eDest = func() int32 {
if _pOrderBy != nil {
return i32(8)
}
return i32(6)
}()
_iDistinct = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
goto _11
}
_eDest = func() int32 {
if _pOrderBy != nil {
return i32(7)
}
return i32(5)
}()
_11:
_sqlite3SelectDestInit(tls, &_destQueue, _eDest, _iQueue)
_regCurrent = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp3(tls, _v, i32(113), _iCurrent, _regCurrent, _nCol)
if _pOrderBy != nil {
_5_pKeyInfo = _multiSelectOrderByKeyInfo(tls, _pParse, _p, i32(1))
_sqlite3VdbeAddOp4(tls, _v, i32(110), _iQueue, (_pOrderBy.X0)+i32(2), i32(0), (*int8)(unsafe.Pointer(_5_pKeyInfo)), i32(-5))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_destQueue.X5))))) = _pOrderBy
goto _15
}
_sqlite3VdbeAddOp2(tls, _v, i32(110), _iQueue, _nCol)
_15:
_sqlite3VdbeComment(tls, _v, str(98968))
if _iDistinct != 0 {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_p.X7))))) + 4*uintptr(i32(0)))) = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iDistinct, i32(0))
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(32))
sink5 = *p
}
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSetup.X14))))) = nil
_rc = _sqlite3Select(tls, _pParse, _pSetup, &_destQueue)
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSetup.X14))))) = _p
if _rc != 0 {
goto _end_of_recursive_query
}
_addrTop = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iQueue, _addrBreak)
_sqlite3VdbeAddOp1(tls, _v, i32(126), _iCurrent)
if _pOrderBy != nil {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _iQueue, (_pOrderBy.X0)+i32(1), _regCurrent)
goto _19
}
_sqlite3VdbeAddOp2(tls, _v, i32(124), _iQueue, _regCurrent)
_19:
_sqlite3VdbeAddOp1(tls, _v, i32(120), _iQueue)
_addrCont = _sqlite3VdbeMakeLabel(tls, _v)
_codeOffset(tls, _v, _regOffset, _addrCont)
_selectInnerLoop(tls, _pParse, _p, (*XExprList)(_p.X0), _iCurrent, nil, nil, _pDest, _addrCont, _addrBreak)
if _regLimit != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(48), _regLimit, _addrBreak)
}
_sqlite3VdbeResolveLabel(tls, _v, _addrCont)
if ((_p.X3) & uint32(i32(8))) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(98980))
goto _22
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
_sqlite3Select(tls, _pParse, _p, &_destQueue)
func() {
if (*XSelect)(_p.X13) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118659), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateWithRecursiveQueryØ00__func__Ø000))), unsafe.Pointer(str(97737)))
crt.X__builtin_abort(tls)
}
}()
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pSetup
_22:
_sqlite3VdbeGoto(tls, _v, _addrTop)
_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
_end_of_recursive_query:
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), (*XExprList)(_p.X12))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _pOrderBy
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = _pLimit
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = _pOffset
_ = _destQueue
}
// Compute the iLimit and iOffset fields of the SELECT based on the
// pLimit and pOffset expressions. pLimit and pOffset hold the expressions
// that appear in the original SQL statement after the LIMIT and OFFSET
// keywords. Or NULL if those keywords are omitted. iLimit and iOffset
// are the integer memory register numbers for counters used to compute
// the limit and offset. If there is no limit and/or offset, then
// iLimit and iOffset are negative.
//
// This routine changes the values of iLimit and iOffset only if
// a limit or offset is defined by pLimit and pOffset. iLimit and
// iOffset should have been preset to appropriate default values (zero)
// prior to calling this routine.
//
// The iOffset register (if it exists) is initialized to the value
// of the OFFSET. The iLimit register is initialized to LIMIT. Register
// iOffset+1 is initialized to LIMIT+OFFSET.
//
// Only if pLimit!=0 or pOffset!=0 do the limit registers get
// redefined. The UNION ALL operator uses this property to force
// the reuse of the same limit and offset registers across multiple
// SELECT statements.
func _computeLimitRegisters(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iBreak int32) {
var _iLimit, _iOffset, _n int32
var _v *TVdbe
_v = nil
_iLimit = i32(0)
if (_p.X4) != 0 {
return
}
_sqlite3ExprCacheClear(tls, _pParse)
func() {
if (*XExpr)(_p.X16) != nil && (*XExpr)(_p.X15) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118411), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000))), unsafe.Pointer(str(99022)))
crt.X__builtin_abort(tls)
}
}()
if (*XExpr)(_p.X15) == nil {
goto _4
}
*(*int32)(unsafe.Pointer(&(_p.X4))) = store1(&_iLimit, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118415), unsafe.Pointer((*int8)(unsafe.Pointer(&_computeLimitRegistersØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprIsInteger(tls, (*XExpr)(_p.X15), &_n) == 0 {
goto _7
}
_sqlite3VdbeAddOp2(tls, _v, i32(56), _n, _iLimit)
_sqlite3VdbeComment(tls, _v, str(99052))
if _n == i32(0) {
_sqlite3VdbeGoto(tls, _v, _iBreak)
goto _11
}
if (_n >= i32(0)) && (int32(_p.X2) > int32(_sqlite3LogEst(tls, uint64(_n)))) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEst(tls, uint64(_n))
{
p := (*uint32)(unsafe.Pointer(&(_p.X3)))
*p = (*p) | uint32(i32(16384))
sink5 = *p
}
}
_11:
goto _12
_7:
_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.X15), _iLimit)
_sqlite3VdbeAddOp1(tls, _v, i32(17), _iLimit)
_sqlite3VdbeComment(tls, _v, str(99052))
_sqlite3VdbeAddOp2(tls, _v, i32(22), _iLimit, _iBreak)
_12:
if (*XExpr)(_p.X16) != nil {
*(*int32)(unsafe.Pointer(&(_p.X5))) = store1(&_iOffset, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
*(*int32)(unsafe.Pointer(&(_pParse.X18))) += 1
_sqlite3ExprCode(tls, _pParse, (*XExpr)(_p.X16), _iOffset)
_sqlite3VdbeAddOp1(tls, _v, i32(17), _iOffset)
_sqlite3VdbeComment(tls, _v, str(99066))
_sqlite3VdbeAddOp3(tls, _v, i32(149), _iLimit, _iOffset+i32(1), _iOffset)
_sqlite3VdbeComment(tls, _v, str(99081))
}
_4:
}
// Clear all column cache entries.
func _sqlite3ExprCacheClear(tls *crt.TLS, _pParse *XParse) {
var _i int32
if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 {
crt.Xprintf(tls, str(99094))
}
_i = i32(0)
_1:
if _i >= int32(_pParse.X13) {
goto _4
}
if (((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X2) != 0) && (int32(_pParse.X7) < i32(8)) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = (*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X4
}
_i += 1
goto _1
_4:
*(*uint8)(unsafe.Pointer(&(_pParse.X13))) = uint8(i32(0))
}
var _computeLimitRegistersØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_computeLimitRegistersØ00__func__Ø000[0], str(99101), 22)
}
// Generate code for an unconditional jump to instruction iDest
func _sqlite3VdbeGoto(tls *crt.TLS, _p *TVdbe, _iDest int32) (r0 int32) {
return _sqlite3VdbeAddOp3(tls, _p, i32(13), i32(0), _iDest, i32(0))
}
var _generateWithRecursiveQueryØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_generateWithRecursiveQueryØ00__func__Ø000[0], str(99123), 27)
}
// The select statement passed as the second parameter is a compound SELECT
// with an ORDER BY clause. This function allocates and returns a KeyInfo
// structure suitable for implementing the ORDER BY.
//
// Space to hold the KeyInfo structure is obtained from malloc. The calling
// function is responsible for ensuring that this structure is eventually
// freed.
func _multiSelectOrderByKeyInfo(tls *crt.TLS, _pParse *XParse, _p *XSelect, _nExtra int32) (r0 *XKeyInfo) {
var _nOrderBy, _1_i int32
var _db *Xsqlite3
var _pOrderBy *XExprList
var _2_pItem *TExprList_item
var _2_pTerm *XExpr
var _pRet *XKeyInfo
var _2_pColl *XCollSeq
_pOrderBy = (*XExprList)(_p.X12)
_nOrderBy = (*XExprList)(_p.X12).X0
_db = (*Xsqlite3)(_pParse.X0)
_pRet = _sqlite3KeyInfoAlloc(tls, _db, _nOrderBy+_nExtra, i32(1))
if _pRet == nil {
goto _0
}
_1_i = i32(0)
_1:
if _1_i >= _nOrderBy {
goto _4
}
_2_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_1_i)))
_2_pTerm = (*XExpr)(_2_pItem.X0)
if ((_2_pTerm.X2) & uint32(i32(256))) != 0 {
_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, _2_pTerm)
goto _6
}
_2_pColl = _multiSelectCollSeq(tls, _pParse, _p, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0)-i32(1))
if _2_pColl == nil {
_2_pColl = (*XCollSeq)(_db.X2)
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_1_i))).X0))))) = _sqlite3ExprAddCollateString(tls, _pParse, _2_pTerm, _2_pColl.X0)
_6:
func() {
if _sqlite3KeyInfoIsWriteable(tls, _pRet) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118498), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByKeyInfoØ00__func__Ø000))), unsafe.Pointer(str(99150)))
crt.X__builtin_abort(tls)
}
}()
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pRet.X6))))) + 4*uintptr(_1_i))) = _2_pColl
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pRet.X5)) + 1*uintptr(_1_i))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_1_i))).X3
_1_i += 1
goto _1
_4:
_0:
return _pRet
}
// Return the appropriate collating sequence for the iCol-th column of
// the result set for the compound-select statement "p". Return NULL if
// the column has no default collating sequence.
//
// The collating sequence for the compound select is taken from the
// left-most term of the select that has a collating sequence.
func _multiSelectCollSeq(tls *crt.TLS, _pParse *XParse, _p *XSelect, _iCol int32) (r0 *XCollSeq) {
var _pRet *XCollSeq
if (*XSelect)(_p.X13) != nil {
_pRet = _multiSelectCollSeq(tls, _pParse, (*XSelect)(_p.X13), _iCol)
goto _1
}
_pRet = nil
_1:
func() {
if _iCol < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118459), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000))), unsafe.Pointer(str(99182)))
crt.X__builtin_abort(tls)
}
}()
if (_pRet == nil) && func() int32 {
if _iCol < ((*XExprList)(_p.X0).X0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118463), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectCollSeqØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_pRet = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+20*uintptr(_iCol))).X0))
}
return _pRet
}
var _multiSelectCollSeqØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_multiSelectCollSeqØ00__func__Ø000[0], str(99190), 19)
}
var _multiSelectOrderByKeyInfoØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_multiSelectOrderByKeyInfoØ00__func__Ø000[0], str(99209), 26)
}
// Add code to implement the OFFSET
func _codeOffset(tls *crt.TLS, _v *TVdbe, _iOffset int32, _iContinue int32) {
if _iOffset > i32(0) {
_sqlite3VdbeAddOp3(tls, _v, i32(46), _iOffset, _iContinue, i32(1))
_sqlite3VdbeComment(tls, _v, str(25292))
}
}
// This routine generates the code for the inside of the inner loop
// of a SELECT.
//
// If srcTab is negative, then the pEList expressions
// are evaluated in order to get the data for this row. If srcTab is
// zero or more, then data is pulled from srcTab and pEList is used only
// to get the number of columns and the collation sequence for each column.
func _selectInnerLoop(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pEList *XExprList, _srcTab int32, _pSort *XSortCtx, _pDistinct *XDistinctCtx, _pDest *XSelectDest, _iContinue int32, _iBreak int32) {
var _i, _hasDistinct, _eDest, _iParm, _nResultCol, _nPrefixReg, _regResult, _regOrig, _11_j, _15_iJump, _15_regPrev, _23_r1, _25_r1, _26_addr, _28_r2, _31_r1, _40_nKey, _40_r1, _40_r2, _40_r3, _40_addrTest int32
var _7_ecelFlags uint8
var _v *TVdbe
var _40_pSO *XExprList
var _15_pOp *XVdbeOp
var _16_pColl *XCollSeq
_v = (*TVdbe)(_pParse.X2)
_eDest = int32(_pDest.X0)
_iParm = _pDest.X2
_nPrefixReg = i32(0)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117220), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117221), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
_hasDistinct = func() int32 {
if _pDistinct != nil {
return int32(_pDistinct.X1)
}
return i32(0)
}()
if (_pSort != nil) && ((*XExprList)(_pSort.X0) == nil) {
_pSort = nil
}
if (_pSort == nil) && (_hasDistinct == 0) {
func() {
if _iContinue == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117225), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99235)))
crt.X__builtin_abort(tls)
}
}()
_codeOffset(tls, _v, _p.X5, _iContinue)
}
_nResultCol = _pEList.X0
if (_pDest.X3) != i32(0) {
goto _12
}
if _pSort == nil {
goto _13
}
_nPrefixReg = (*XExprList)(_pSort.X0).X0
if (int32(_pSort.X7) & i32(1)) == 0 {
_nPrefixReg += 1
}
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nPrefixReg
sink1 = *p
}
_13:
*(*int32)(unsafe.Pointer(&(_pDest.X3))) = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nResultCol
sink1 = *p
}
goto _16
_12:
if ((_pDest.X3) + _nResultCol) > (_pParse.X18) {
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nResultCol
sink1 = *p
}
}
_16:
*(*int32)(unsafe.Pointer(&(_pDest.X4))) = _nResultCol
_regOrig = store1(&_regResult, _pDest.X3)
if _srcTab < i32(0) {
goto _17
}
_i = i32(0)
_18:
if _i >= _nResultCol {
goto _21
}
_sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _i, _regResult+_i)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X1))
_i += 1
goto _18
_21:
goto _23
_17:
if _eDest == i32(3) {
goto _23
}
if ((_eDest == i32(10)) || (_eDest == i32(9))) || (_eDest == i32(13)) {
_7_ecelFlags = uint8(i32(1))
goto _27
}
_7_ecelFlags = uint8(i32(0))
_27:
if _pSort == nil || _hasDistinct != i32(0) || _eDest == i32(12) || _eDest == i32(14) {
goto _31
}
{
p := &_7_ecelFlags
*p = uint8(int32(*p) | i32(12))
sink2 = *p
}
_i = _pSort.X1
_32:
if _i >= ((*XExprList)(_pSort.X0).X0) {
goto _35
}
if store1(&_11_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSort.X0).X2)))))+20*uintptr(_i))).X5))))).X0)) > i32(0) {
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_11_j-i32(1)))).X5))))).X0))) = uint16((_i + i32(1)) - (_pSort.X1))
}
_i += 1
goto _32
_35:
_regOrig = i32(0)
func() {
if _eDest != i32(11) && _eDest != i32(10) && _eDest != i32(13) && _eDest != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117281), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99248)))
crt.X__builtin_abort(tls)
}
}()
_31:
_nResultCol = _sqlite3ExprCodeExprList(tls, _pParse, _pEList, _regResult, i32(0), _7_ecelFlags)
_23:
if _hasDistinct == 0 {
goto _42
}
switch int32(_pDistinct.X1) {
case i32(1):
goto _45
case i32(2):
goto _44
default:
goto _46
}
_44:
_15_regPrev = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nResultCol
sink1 = *p
}
_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.X3)
_15_pOp = _sqlite3VdbeGetOp(tls, _v, _pDistinct.X3)
*(*uint8)(unsafe.Pointer(&(_15_pOp.X0))) = uint8(i32(59))
*(*int32)(unsafe.Pointer(&(_15_pOp.X3))) = i32(1)
*(*int32)(unsafe.Pointer(&(_15_pOp.X4))) = _15_regPrev
_15_iJump = _sqlite3VdbeCurrentAddr(tls, _v) + _nResultCol
_i = i32(0)
_47:
if _i >= _nResultCol {
goto _50
}
_16_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X0))
if _i < (_nResultCol - i32(1)) {
_sqlite3VdbeAddOp3(tls, _v, i32(77), _regResult+_i, _15_iJump, _15_regPrev+_i)
goto _52
}
_sqlite3VdbeAddOp3(tls, _v, i32(78), _regResult+_i, _iContinue, _15_regPrev+_i)
_52:
_sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(_16_pColl)), i32(-3))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(128)))
_i += 1
goto _47
_50:
func() {
if _sqlite3VdbeCurrentAddr(tls, _v) != _15_iJump && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117327), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99326)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(64), _regResult, _15_regPrev, _nResultCol-i32(1))
goto _56
_45:
_sqlite3VdbeChangeToNoop(tls, _v, _pDistinct.X3)
goto _56
_46:
func() {
if int32(_pDistinct.X1) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117338), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99387)))
crt.X__builtin_abort(tls)
}
}()
_codeDistinct(tls, _pParse, _pDistinct.X2, _iContinue, _nResultCol, _regResult)
goto _56
_56:
if _pSort == nil {
_codeOffset(tls, _v, _p.X5, _iContinue)
}
_42:
switch _eDest {
case i32(1):
goto _61
case i32(2):
goto _62
case i32(3):
goto _68
case i32(5):
goto _63
case i32(6):
goto _63
case i32(7):
goto _72
case i32(8):
goto _72
case i32(9):
goto _70
case i32(10):
goto _69
case i32(11):
goto _67
case i32(12):
goto _63
case i32(13):
goto _70
case i32(14):
goto _63
default:
goto _74
}
_61:
_23_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regResult, _nResultCol, _23_r1)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iParm, _23_r1, _regResult, _nResultCol)
_sqlite3ReleaseTempReg(tls, _pParse, _23_r1)
goto _75
_62:
_sqlite3VdbeAddOp3(tls, _v, i32(129), _iParm, _regResult, _nResultCol)
goto _75
_63:
_25_r1 = _sqlite3GetTempRange(tls, _pParse, _nPrefixReg+i32(1))
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regResult, _nResultCol, _25_r1+_nPrefixReg)
if _eDest == i32(6) {
_26_addr = _sqlite3VdbeCurrentAddr(tls, _v) + i32(4)
_sqlite3VdbeAddOp4Int(tls, _v, i32(30), _iParm+i32(1), _26_addr, _25_r1, i32(0))
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iParm+i32(1), _25_r1, _regResult, _nResultCol)
func() {
if _pSort != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117396), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99434)))
crt.X__builtin_abort(tls)
}
}()
}
if _pSort != nil {
_pushOntoSorter(tls, _pParse, _pSort, _p, _25_r1+_nPrefixReg, _regResult, i32(1), _nPrefixReg)
goto _80
}
_28_r2 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp2(tls, _v, i32(117), _iParm, _28_r2)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _iParm, _25_r1, _28_r2)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
_sqlite3ReleaseTempReg(tls, _pParse, _28_r2)
_80:
_sqlite3ReleaseTempRange(tls, _pParse, _25_r1, _nPrefixReg+i32(1))
goto _75
_67:
if _pSort != nil {
_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
goto _82
}
_31_r1 = _sqlite3GetTempReg(tls, _pParse)
func() {
if _sqlite3Strlen30(tls, _pDest.X1) != _nResultCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117427), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99443)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(101), _regResult, _nResultCol, _31_r1, _pDest.X1, _nResultCol)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iParm, _31_r1, _regResult, _nResultCol)
_sqlite3ReleaseTempReg(tls, _pParse, _31_r1)
_82:
goto _75
_68:
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _iParm)
goto _75
_69:
if _pSort != nil {
func() {
if _nResultCol > (_pDest.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117451), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99488)))
crt.X__builtin_abort(tls)
}
}()
_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
goto _88
}
func() {
if _nResultCol != (_pDest.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117455), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99513)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _regResult != _iParm {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117456), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99538)))
crt.X__builtin_abort(tls)
}
}()
_88:
goto _75
_70:
if _pSort != nil {
_pushOntoSorter(tls, _pParse, _pSort, _p, _regResult, _regOrig, _nResultCol, _nPrefixReg)
goto _96
}
if _eDest == i32(13) {
_sqlite3VdbeAddOp1(tls, _v, i32(16), _pDest.X2)
goto _96
}
_sqlite3VdbeAddOp2(tls, _v, i32(67), _regResult, _nResultCol)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _regResult, _nResultCol)
_96:
goto _75
_72:
_40_addrTest = i32(0)
_40_pSO = (*XExprList)(_pDest.X5)
func() {
if _40_pSO == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117493), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99555)))
crt.X__builtin_abort(tls)
}
}()
_40_nKey = _40_pSO.X0
_40_r1 = _sqlite3GetTempReg(tls, _pParse)
_40_r2 = _sqlite3GetTempRange(tls, _pParse, _40_nKey+i32(2))
_40_r3 = (_40_r2 + _40_nKey) + i32(1)
if _eDest == i32(8) {
_40_addrTest = _sqlite3VdbeAddOp4Int(tls, _v, i32(30), _iParm+i32(1), i32(0), _regResult, _nResultCol)
}
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regResult, _nResultCol, _40_r3)
if _eDest == i32(8) {
_sqlite3VdbeAddOp2(tls, _v, i32(128), _iParm+i32(1), _40_r3)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
}
_i = i32(0)
_101:
if _i >= _40_nKey {
goto _104
}
_sqlite3VdbeAddOp2(tls, _v, i32(65), (_regResult+int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_40_pSO.X2)))))+20*uintptr(_i))).X5))))).X0))-i32(1), _40_r2+_i)
_i += 1
goto _101
_104:
_sqlite3VdbeAddOp2(tls, _v, i32(116), _iParm, _40_r2+_40_nKey)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _40_r2, _40_nKey+i32(2), _40_r1)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iParm, _40_r1, _40_r2, _40_nKey+i32(2))
if _40_addrTest != 0 {
_sqlite3VdbeJumpHere(tls, _v, _40_addrTest)
}
_sqlite3ReleaseTempReg(tls, _pParse, _40_r1)
_sqlite3ReleaseTempRange(tls, _pParse, _40_r2, _40_nKey+i32(2))
goto _75
_74:
func() {
if _eDest != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117535), unsafe.Pointer((*int8)(unsafe.Pointer(&_selectInnerLoopØ00__func__Ø000))), unsafe.Pointer(str(99559)))
crt.X__builtin_abort(tls)
}
}()
goto _75
_75:
if (_pSort == nil) && (_p.X4) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(48), _p.X4, _iBreak)
}
}
var _selectInnerLoopØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_selectInnerLoopØ00__func__Ø000[0], str(99578), 16)
}
// 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 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.
func _sqlite3ExprCodeExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _target int32, _srcReg int32, _flags uint8) (r0 int32) {
var _i, _j, _n, _6_inReg int32
var _copyOp uint8
var _v *TVdbe
var _pItem *TExprList_item
var _1_pExpr *XExpr
var _7_pOp *XVdbeOp
_copyOp = uint8(func() int32 {
if (int32(_flags) & i32(1)) != 0 {
return i32(64)
}
return i32(65)
}())
_v = (*TVdbe)(_pParse.X2)
func() {
if _pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95149), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000))), unsafe.Pointer(str(90087)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _target <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95150), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000))), unsafe.Pointer(str(99594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*TVdbe)(_pParse.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95151), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeExprListØ00__func__Ø000))), unsafe.Pointer(str(99603)))
crt.X__builtin_abort(tls)
}
}()
_n = _pList.X0
if (_pParse.X11) == 0 {
{
p := &_flags
*p = uint8(int32(*p) & i32(-3))
sink2 = *p
}
}
*func() *int32 {
_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))
return &_i
}() = i32(0)
_9:
if _i >= _n {
goto _12
}
_1_pExpr = (*XExpr)(_pItem.X0)
if (int32(_flags)&i32(4)) == i32(0) || store1(&_j, int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_pItem.X5))))).X0)) <= i32(0) {
goto _14
}
if (int32(_flags) & i32(8)) != 0 {
_i -= 1
_n -= 1
goto _16
}
_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), (_j+_srcReg)-i32(1), _target+_i)
_16:
goto _20
_14:
if ((int32(_flags) & i32(2)) != i32(0)) && _sqlite3ExprIsConstant(tls, _1_pExpr) != 0 {
_sqlite3ExprCodeAtInit(tls, _pParse, _1_pExpr, _target+_i)
goto _20
}
_6_inReg = _sqlite3ExprCodeTarget(tls, _pParse, _1_pExpr, _target+_i)
if _6_inReg == (_target + _i) {
goto _21
}
if (((int32(_copyOp) == i32(64)) && (int32(store40(&_7_pOp, _sqlite3VdbeGetOp(tls, _v, i32(-1))).X0) == i32(64))) && ((((_7_pOp.X3) + (_7_pOp.X5)) + i32(1)) == _6_inReg)) && ((((_7_pOp.X4) + (_7_pOp.X5)) + i32(1)) == (_target + _i)) {
*(*int32)(unsafe.Pointer(&(_7_pOp.X5))) += 1
goto _26
}
_sqlite3VdbeAddOp2(tls, _v, int32(_copyOp), _6_inReg, _target+_i)
_26:
_21:
_20:
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _9
_12:
return _n
}
var _sqlite3ExprCodeExprListØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeExprListØ00__func__Ø000[0], str(99620), 24)
}
// 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 _sqlite3ExprIsConstant(tls *crt.TLS, _p *XExpr) (r0 int32) {
return _exprIsConst(tls, _p, i32(1), i32(0))
}
func _exprIsConst(tls *crt.TLS, _p *XExpr, _initFlag int32, _iCur int32) (r0 int32) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(_initFlag)
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprNodeIsConstant
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _selectNodeIsConstant
*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))) = _iCur
_sqlite3WalkExpr(tls, &_w, _p)
return int32(_w.X5)
_ = _w
panic(0)
}
// These routines are Walker callbacks used to check expressions to
// see if they are "constant" for some definition of constant. The
// Walker.eCode value determines the type of "constant" we are looking
// for.
//
// These callback routines are used to implement the following:
//
// sqlite3ExprIsConstant() pWalker->eCode==1
// sqlite3ExprIsConstantNotJoin() pWalker->eCode==2
// sqlite3ExprIsTableConstant() pWalker->eCode==3
// sqlite3ExprIsConstantOrFunction() pWalker->eCode==4 or 5
//
// In all cases, the callbacks set Walker.eCode=0 and abort if the expression
// is found to not be a constant.
//
// The sqlite3ExprIsConstantOrFunction() is used for evaluating expressions
// in a CREATE TABLE statement. The Walker.eCode value is 5 when parsing
// an existing schema and 4 when processing a new statement. A bound
// parameter raises an error for new statements, but is silently converted
// to NULL for existing schemas. This allows sqlite_master tables that
// contain a bound parameter because they were generated by older versions
// of SQLite to be parsed by newer versions of SQLite without raising a
// malformed schema error.
func _exprNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
if (int32(_pWalker.X5) == i32(2)) && (((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0))) {
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
}
switch int32(_pExpr.X0) {
case i32(27):
goto _4
case i32(135):
goto _9
case i32(151):
goto _3
case i32(152):
goto _4
case i32(153):
goto _4
case i32(154):
goto _4
case i32(160):
goto _15
default:
goto _18
}
_3:
if (int32(_pWalker.X5) >= i32(4)) || (((_pExpr.X2) & uint32(i32(524288))) != uint32(i32(0))) {
return i32(0)
}
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
_4:
if (int32(_pWalker.X5) == i32(3)) && ((_pExpr.X8) == (*(*int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))) {
return i32(0)
}
_15:
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
_9:
if int32(_pWalker.X5) == i32(5) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101))
goto _18
}
if int32(_pWalker.X5) == i32(4) {
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
}
_18:
return i32(0)
}
func _selectNodeIsConstant(tls *crt.TLS, _pWalker *XWalker, _NotUsed *XSelect) (r0 int32) {
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
}
// Factor out the code of the given expression to initialization time.
//
// 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 will
// code to the same register.
func _sqlite3ExprCodeAtInit(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _regDest int32) (r0 int32) {
var _1_i int32
var _p *XExprList
var _1_pItem, _4_pItem *TExprList_item
func() {
if (_pParse.X11) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeAtInitØ00__func__Ø000))), unsafe.Pointer(str(99644)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XExprList)(_pParse.X27)
if _regDest >= i32(0) || _p == nil {
goto _3
}
*func() *int32 {
_1_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))
return &_1_i
}() = _p.X0
_4:
if _1_i <= i32(0) {
goto _7
}
if (((uint32((_1_pItem.X4)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) && (_sqlite3ExprCompare(tls, (*XExpr)(_1_pItem.X0), _pExpr, i32(-1)) == i32(0)) {
return *(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_1_pItem.X5)))))
}
*func() *int32 { *(*uintptr)(unsafe.Pointer(&_1_pItem)) += uintptr(20); return &_1_i }() -= 1
goto _4
_7:
_3:
_pExpr = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _pExpr, i32(0))
_p = _sqlite3ExprListAppend(tls, _pParse, _p, _pExpr)
if _p == nil {
goto _10
}
_4_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr((_p.X0)-i32(1))))
storebits3((*int8)(unsafe.Pointer(&(_4_pItem.X4))), int8(bool2int(_regDest < i32(0))), 4, 2)
if _regDest < i32(0) {
_regDest = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
}
*(*int32)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_4_pItem.X5))))) = _regDest
_10:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X27))))) = _p
return _regDest
}
var _sqlite3ExprCodeAtInitØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeAtInitØ00__func__Ø000[0], str(99666), 22)
}
// Change the opcode at addr into OP_Noop
func _sqlite3VdbeChangeToNoop(tls *crt.TLS, _p *TVdbe, _addr int32) (r0 int32) {
var _pOp *XVdbeOp
if ((*Xsqlite3)(_p.X0).X17) != 0 {
return i32(0)
}
func() {
if _addr < i32(0) || _addr >= (_p.X27) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72328), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeChangeToNoopØ00__func__Ø000))), unsafe.Pointer(str(99688)))
crt.X__builtin_abort(tls)
}
}()
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr(_addr)))
_freeP4(tls, (*Xsqlite3)(_p.X0), int32(_pOp.X1), *(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(0))
*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))) = nil
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(164))
return i32(1)
}
var _sqlite3VdbeChangeToNoopØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeChangeToNoopØ00__func__Ø000[0], str(99711), 24)
}
// Return the address of the next instruction to be inserted.
func _sqlite3VdbeCurrentAddr(tls *crt.TLS, _p *TVdbe) (r0 int32) {
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72061), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeCurrentAddrØ00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
return _p.X27
}
var _sqlite3VdbeCurrentAddrØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeCurrentAddrØ00__func__Ø000[0], str(99735), 23)
}
// Add code that will check to make sure the N registers starting at iMem
// form a distinct entry. iTab is a sorting index that holds previously
// seen combinations of the N values. A new entry is made in iTab
// if the current N values are new.
//
// A jump to addrRepeat is made and the N+1 values are popped from the
// stack if the top N elements are not distinct.
func _codeDistinct(tls *crt.TLS, _pParse *XParse, _iTab int32, _addrRepeat int32, _N int32, _iMem int32) {
var _r1 int32
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp4Int(tls, _v, i32(30), _iTab, _addrRepeat, _iMem, _N)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _iMem, _N, _r1)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iTab, _r1, _iMem, _N)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
_sqlite3ReleaseTempReg(tls, _pParse, _r1)
}
// Allocate a single new register for use to hold some intermediate result.
func _sqlite3GetTempReg(tls *crt.TLS, _pParse *XParse) (r0 int32) {
if int32(_pParse.X7) == i32(0) {
return preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
}
return *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(preInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), byte(255)))))
}
// Deallocate a register, making available for reuse for some other
// purpose.
//
// If a register is currently being used by the column cache, then
// the deallocation is deferred until the column cache line that uses
// the register becomes stale.
func _sqlite3ReleaseTempReg(tls *crt.TLS, _pParse *XParse, _iReg int32) {
var _1_i int32
var _1_p *TyColCache
if _iReg == 0 || int32(_pParse.X7) >= i32(8) {
goto _1
}
*func() **TyColCache { _1_i = i32(0); return &_1_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_2:
if _1_i >= int32(_pParse.X13) {
goto _5
}
if (_1_p.X4) == _iReg {
*(*uint8)(unsafe.Pointer(&(_1_p.X2))) = uint8(i32(1))
return
}
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _1_i += 1; return &_1_p }())) += uintptr(20)
goto _2
_5:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(postInc2((*uint8)(unsafe.Pointer(&(_pParse.X7))), uint8(1))))) = _iReg
_1:
}
// Allocate or deallocate a block of nReg consecutive registers.
func _sqlite3GetTempRange(tls *crt.TLS, _pParse *XParse, _nReg int32) (r0 int32) {
var _i, _n int32
if _nReg == i32(1) {
return _sqlite3GetTempReg(tls, _pParse)
}
_i = _pParse.X15
_n = _pParse.X14
if _nReg <= _n {
func() {
if _usedAsColumnCache(tls, _pParse, _i, (_i+_n)-i32(1)) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96056), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetTempRangeØ00__func__Ø000))), unsafe.Pointer(str(99758)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*int32)(unsafe.Pointer(&(_pParse.X15)))
*p = (*p) + _nReg
sink1 = *p
}
{
p := (*int32)(unsafe.Pointer(&(_pParse.X14)))
*p = (*p) - _nReg
sink1 = *p
}
goto _4
}
_i = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nReg
sink1 = *p
}
_4:
return _i
}
// Return true if any register in the range iFrom..iTo (inclusive)
// is used as part of the column cache.
//
// This routine is used within assert() and testcase() macros only
// and does not appear in a normal build.
func _usedAsColumnCache(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32) (r0 int32) {
var _i, _1_r int32
var _p *TyColCache
*func() **TyColCache { _i = i32(0); return &_p }() = (*TyColCache)(unsafe.Pointer((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48)))))
_0:
if _i >= int32(_pParse.X13) {
goto _3
}
_1_r = _p.X4
if (_1_r >= _iFrom) && (_1_r <= _iTo) {
return i32(1)
}
*(*uintptr)(unsafe.Pointer(func() **TyColCache { _i += 1; return &_p }())) += uintptr(20)
goto _0
_3:
return i32(0)
}
var _sqlite3GetTempRangeØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GetTempRangeØ00__func__Ø000[0], str(99795), 20)
}
// Generate code that will push the record in registers regData
// through regData+nData-1 onto the sorter.
func _pushOntoSorter(tls *crt.TLS, _pParse *XParse, _pSort *XSortCtx, _pSelect *XSelect, _regData int32, _regOrigData int32, _nData int32, _nPrefixReg int32) {
var _bSeq, _nExpr, _nBase, _regBase, _regRecord, _nOBSat, _op, _iLimit, _5_regPrevKey, _5_addrFirst, _5_addrJmp, _5_nKey, _11_addr, _11_r1, _13_iBrk int32
var _v *TVdbe
var _5_pKI *XKeyInfo
var _5_pOp *XVdbeOp
_v = (*TVdbe)(_pParse.X2)
_bSeq = bool2int((int32(_pSort.X7) & i32(1)) == i32(0))
_nExpr = (*XExprList)(_pSort.X0).X0
_nBase = (_nExpr + _bSeq) + _nData
_regRecord = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_nOBSat = _pSort.X1
func() {
if _bSeq != i32(0) && _bSeq != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117043), unsafe.Pointer((*int8)(unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000))), unsafe.Pointer(str(99815)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nData != i32(1) && _regData != _regOrigData && _regOrigData != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117044), unsafe.Pointer((*int8)(unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000))), unsafe.Pointer(str(99834)))
crt.X__builtin_abort(tls)
}
}()
if _nPrefixReg != 0 {
func() {
if _nPrefixReg != (_nExpr + _bSeq) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117046), unsafe.Pointer((*int8)(unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000))), unsafe.Pointer(str(99885)))
crt.X__builtin_abort(tls)
}
}()
_regBase = (_regData - _nExpr) - _bSeq
goto _10
}
_regBase = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nBase
sink1 = *p
}
_10:
func() {
if (_pSelect.X5) != i32(0) && (_pSelect.X4) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117052), unsafe.Pointer((*int8)(unsafe.Pointer(&_pushOntoSorterØ00__func__Ø000))), unsafe.Pointer(str(99908)))
crt.X__builtin_abort(tls)
}
}()
_iLimit = func() int32 {
if (_pSelect.X5) != 0 {
return ((_pSelect.X5) + i32(1))
}
return (_pSelect.X4)
}()
*(*int32)(unsafe.Pointer(&(_pSort.X6))) = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprCodeExprList(tls, _pParse, (*XExprList)(_pSort.X0), _regBase, _regOrigData, uint8(i32(1)|func() int32 {
if _regOrigData != 0 {
return i32(4)
}
return i32(0)
}()))
if _bSeq != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(116), _pSort.X2, _regBase+_nExpr)
}
if (_nPrefixReg == i32(0)) && (_nData > i32(0)) {
_sqlite3ExprCodeMove(tls, _pParse, _regData, (_regBase+_nExpr)+_bSeq, _nData)
}
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regBase+_nOBSat, _nBase-_nOBSat, _regRecord)
if _nOBSat <= i32(0) {
goto _21
}
_5_regPrevKey = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (_pSort.X1)
sink1 = *p
}
_5_nKey = (_nExpr - (_pSort.X1)) + _bSeq
if _bSeq != 0 {
_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, i32(22), _regBase+_nExpr)
goto _23
}
_5_addrFirst = _sqlite3VdbeAddOp1(tls, _v, i32(112), _pSort.X2)
_23:
_sqlite3VdbeAddOp3(tls, _v, i32(98), _5_regPrevKey, _regBase, _pSort.X1)
_5_pOp = _sqlite3VdbeGetOp(tls, _v, _pSort.X5)
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
return
}
*(*int32)(unsafe.Pointer(&(_5_pOp.X4))) = _5_nKey + _nData
_5_pKI = (*XKeyInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_5_pOp.X6))))))
crt.Xmemset(tls, (unsafe.Pointer)(_5_pKI.X5), i32(0), uint32(_5_pKI.X2))
_sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(_5_pKI)), i32(-5))
*(**XKeyInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_5_pOp.X6))))))) = _keyInfoFromExprList(tls, _pParse, (*XExprList)(_pSort.X0), _nOBSat, int32(_5_pKI.X3)-i32(1))
_5_addrJmp = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp3(tls, _v, i32(18), _5_addrJmp+i32(1), i32(0), _5_addrJmp+i32(1))
*(*int32)(unsafe.Pointer(&(_pSort.X4))) = _sqlite3VdbeMakeLabel(tls, _v)
*(*int32)(unsafe.Pointer(&(_pSort.X3))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(14), _pSort.X3, _pSort.X4)
_sqlite3VdbeAddOp1(tls, _v, i32(135), _pSort.X2)
if _iLimit != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(22), _iLimit, _pSort.X6)
}
_sqlite3VdbeJumpHere(tls, _v, _5_addrFirst)
_sqlite3ExprCodeMove(tls, _pParse, _regBase, _5_regPrevKey, _pSort.X1)
_sqlite3VdbeJumpHere(tls, _v, _5_addrJmp)
_21:
if (int32(_pSort.X7) & i32(1)) != 0 {
_op = i32(127)
goto _27
}
_op = i32(128)
_27:
_sqlite3VdbeAddOp4Int(tls, _v, _op, _pSort.X2, _regRecord, _regBase+_nOBSat, _nBase-_nOBSat)
if _iLimit == 0 {
goto _28
}
_11_r1 = i32(0)
_11_addr = _sqlite3VdbeAddOp1(tls, _v, i32(47), _iLimit)
_sqlite3VdbeAddOp1(tls, _v, i32(33), _pSort.X2)
if (_pSort.X8) != 0 {
_11_r1 = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp3(tls, _v, i32(99), _pSort.X2, _nExpr, _11_r1)
_sqlite3VdbeComment(tls, _v, str(61696))
}
_sqlite3VdbeAddOp1(tls, _v, i32(120), _pSort.X2)
if (_pSort.X8) != 0 {
_13_iBrk = _sqlite3VdbeCurrentAddr(tls, _v) + i32(2)
_sqlite3VdbeAddOp3(tls, _v, i32(78), _regBase+_nExpr, _13_iBrk, _11_r1)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(128)))
}
_sqlite3VdbeJumpHere(tls, _v, _11_addr)
_28:
}
var _pushOntoSorterØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_pushOntoSorterØ00__func__Ø000[0], str(99950), 15)
}
// Generate code to move content from registers iFrom...iFrom+nReg-1
// over to iTo..iTo+nReg-1. Keep the column cache up-to-date.
func _sqlite3ExprCodeMove(tls *crt.TLS, _pParse *XParse, _iFrom int32, _iTo int32, _nReg int32) {
func() {
if _iFrom < (_iTo+_nReg) && (_iFrom+_nReg) > _iTo {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94255), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeMoveØ00__func__Ø000))), unsafe.Pointer(str(99965)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, (*TVdbe)(_pParse.X2), i32(63), _iFrom, _iTo, _nReg)
_sqlite3ExprCacheRemove(tls, _pParse, _iFrom, _nReg)
}
var _sqlite3ExprCodeMoveØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeMoveØ00__func__Ø000[0], str(100000), 20)
}
// 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 _keyInfoFromExprList(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iStart int32, _nExtra int32) (r0 *XKeyInfo) {
var _nExpr, _i int32
var _db *Xsqlite3
var _pItem *TExprList_item
var _pInfo *XKeyInfo
var _2_pColl *XCollSeq
_db = (*Xsqlite3)(_pParse.X0)
_nExpr = _pList.X0
_pInfo = _sqlite3KeyInfoAlloc(tls, _db, _nExpr-_iStart, _nExtra+i32(1))
if _pInfo == nil {
goto _0
}
func() {
if _sqlite3KeyInfoIsWriteable(tls, _pInfo) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117632), unsafe.Pointer((*int8)(unsafe.Pointer(&_keyInfoFromExprListØ00__func__Ø000))), unsafe.Pointer(str(100020)))
crt.X__builtin_abort(tls)
}
}()
*func() **TExprList_item { _i = _iStart; return &_pItem }() = (*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))))) + uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(_iStart)))))*uintptr(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr(20)))))))))))
_3:
if _i >= _nExpr {
goto _6
}
_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pItem.X0))
if _2_pColl == nil {
_2_pColl = (*XCollSeq)(_db.X2)
}
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X6))))) + 4*uintptr(_i-_iStart))) = _2_pColl
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pInfo.X5)) + 1*uintptr(_i-_iStart))) = _pItem.X3
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _3
_6:
_0:
return _pInfo
}
var _keyInfoFromExprListØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_keyInfoFromExprListØ00__func__Ø000[0], str(100053), 20)
}
func _sqlite3ReleaseTempRange(tls *crt.TLS, _pParse *XParse, _iReg int32, _nReg int32) {
if _nReg == i32(1) {
_sqlite3ReleaseTempReg(tls, _pParse, _iReg)
return
}
_sqlite3ExprCacheRemove(tls, _pParse, _iReg, _nReg)
if _nReg > (_pParse.X14) {
*(*int32)(unsafe.Pointer(&(_pParse.X14))) = _nReg
*(*int32)(unsafe.Pointer(&(_pParse.X15))) = _iReg
}
}
// Resolve label "x" to be the address of the next instruction to
// be inserted. The parameter "x" must have been obtained from
// a prior call to sqlite3VdbeMakeLabel().
func _sqlite3VdbeResolveLabel(tls *crt.TLS, _v *TVdbe, _x int32) {
var _j int32
var _p *XParse
_p = (*XParse)(_v.X3)
_j = i32(-1) - _x
func() {
if (_v.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71803), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000))), unsafe.Pointer(str(44897)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _j >= (_p.X25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71804), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000))), unsafe.Pointer(str(100073)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _j < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71805), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeResolveLabelØ00__func__Ø000))), unsafe.Pointer(str(100085)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X26) != nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X26)) + 4*uintptr(_j))) = _v.X27
}
}
var _sqlite3VdbeResolveLabelØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeResolveLabelØ00__func__Ø000[0], str(100090), 24)
}
func _multiSelectOrderBy(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pDest *XSelectDest) (r0 int32) {
var _i, _j, _regAddrA, _regAddrB, _addrSelectA, _addrSelectB, _regOutA, _regOutB, _addrOutA, _addrOutB, _addrEofA, _addrEofA_noB, _addrEofB, _addrAltB, _addrAeqB, _addrAgtB, _regLimitA, _regLimitB, _regPrev, _savedLimit, _savedOffset, _labelCmpr, _labelEnd, _addr1, _op, _nOrderBy, _iSub1, _iSub2, _9_nExpr int32
var _aPermute *int32
var _db *Xsqlite3
var _v *TVdbe
var _pOrderBy *XExprList
var _2_pItem, _5_pItem *TExprList_item
var _pPrior, _24_pFirst *XSelect
var _4_pNew *XExpr
var _pKeyDup, _pKeyMerge *XKeyInfo
var _destA, _destB XSelectDest
_addrOutB = i32(0)
_pKeyDup = nil
func() {
if (*XExprList)(_p.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119400), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100114)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pKeyDup != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119401), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100129)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
_v = (*TVdbe)(_pParse.X2)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119404), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_labelEnd = _sqlite3VdbeMakeLabel(tls, _v)
_labelCmpr = _sqlite3VdbeMakeLabel(tls, _v)
_op = int32(_p.X1)
_pPrior = (*XSelect)(_p.X13)
func() {
if (*XExprList)(_pPrior.X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119413), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100140)))
crt.X__builtin_abort(tls)
}
}()
_pOrderBy = (*XExprList)(_p.X12)
func() {
if _pOrderBy == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119415), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100160)))
crt.X__builtin_abort(tls)
}
}()
_nOrderBy = _pOrderBy.X0
if _op == i32(116) {
goto _10
}
_i = i32(1)
_11:
if int32(_db.X17) != i32(0) || _i > ((*XExprList)(_p.X0).X0) {
goto _15
}
*func() **TExprList_item { _j = i32(0); return &_2_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))
_16:
if _j >= _nOrderBy {
goto _19
}
func() {
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119426), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100169)))
crt.X__builtin_abort(tls)
}
}()
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_2_pItem.X5))))).X0) == _i {
goto _19
}
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _j += 1; return &_2_pItem }())) += uintptr(20)
goto _16
_19:
if _j != _nOrderBy {
goto _23
}
_4_pNew = _sqlite3Expr(tls, _db, i32(134), nil)
if _4_pNew == nil {
return _sqlite3NomemError(tls, i32(119431))
}
{
p := (*uint32)(unsafe.Pointer(&(_4_pNew.X2)))
*p = (*p) | uint32(i32(1024))
sink5 = *p
}
*(*int32)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pNew.X3))))) = _i
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = store42(&_pOrderBy, _sqlite3ExprListAppend(tls, _pParse, _pOrderBy, _4_pNew))
if _pOrderBy != nil {
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(postInc1(&_nOrderBy, int32(1))))).X5))))).X0))) = uint16(_i)
}
_23:
_i += 1
goto _11
_15:
_10:
_aPermute = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(4)*uint32(_nOrderBy+i32(1)))))
if _aPermute == nil {
goto _26
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPermute)) + 4*uintptr(i32(0)))) = _nOrderBy
*func() **TExprList_item { _i = i32(1); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))
_27:
if _i > _nOrderBy {
goto _30
}
func() {
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119452), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100169)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) > ((*XExprList)(_p.X0).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119453), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100194)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aPermute)) + 4*uintptr(_i))) = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&(_5_pItem.X5))))).X0) - i32(1)
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_5_pItem }())) += uintptr(20)
goto _27
_30:
_pKeyMerge = _multiSelectOrderByKeyInfo(tls, _pParse, _p, i32(1))
goto _35
_26:
_pKeyMerge = nil
_35:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X12))))) = _pOrderBy
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X12))))) = _sqlite3ExprListDup(tls, (*Xsqlite3)(_pParse.X0), _pOrderBy, i32(0))
if _op == i32(116) {
_regPrev = i32(0)
goto _37
}
_9_nExpr = (*XExprList)(_p.X0).X0
func() {
if _nOrderBy < _9_nExpr && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119474), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100235)))
crt.X__builtin_abort(tls)
}
}()
_regPrev = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (_9_nExpr + i32(1))
sink1 = *p
}
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regPrev)
_pKeyDup = _sqlite3KeyInfoAlloc(tls, _db, _9_nExpr, i32(1))
if _pKeyDup == nil {
goto _41
}
func() {
if _sqlite3KeyInfoIsWriteable(tls, _pKeyDup) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119480), unsafe.Pointer((*int8)(unsafe.Pointer(&_multiSelectOrderByØ00__func__Ø000))), unsafe.Pointer(str(100271)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_44:
if _i >= _9_nExpr {
goto _47
}
*(**XCollSeq)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]unsafe.Pointer)(unsafe.Pointer(&(_pKeyDup.X6))))) + 4*uintptr(_i))) = _multiSelectCollSeq(tls, _pParse, _p, _i)
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pKeyDup.X5)) + 1*uintptr(_i))) = uint8(i32(0))
_i += 1
goto _44
_47:
_41:
_37:
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X14))))) = nil
_sqlite3ResolveOrderGroupBy(tls, _pParse, _p, (*XExprList)(_p.X12), str(25745))
if (*XSelect)(_pPrior.X13) == nil {
_sqlite3ResolveOrderGroupBy(tls, _pParse, _pPrior, (*XExprList)(_pPrior.X12), str(25745))
}
_computeLimitRegisters(tls, _pParse, _p, _labelEnd)
if (_p.X4) != 0 && (_op == i32(116)) {
_regLimitA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regLimitB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(64), func() int32 {
if (_p.X5) != 0 {
return ((_p.X5) + i32(1))
}
return (_p.X4)
}(), _regLimitA)
_sqlite3VdbeAddOp2(tls, _v, i32(64), _regLimitA, _regLimitB)
goto _53
}
_regLimitA = store1(&_regLimitB, i32(0))
_53:
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X15))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) = nil
_sqlite3ExprDelete(tls, _db, (*XExpr)(_p.X16))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X16))))) = nil
_regAddrA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regAddrB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regOutA = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regOutB = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3SelectDestInit(tls, &_destA, i32(13), _regAddrA)
_sqlite3SelectDestInit(tls, &_destB, i32(13), _regAddrB)
_addrSelectA = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1)
_addr1 = _sqlite3VdbeAddOp3(tls, _v, i32(15), _regAddrA, i32(0), _addrSelectA)
_sqlite3VdbeComment(tls, _v, str(100306))
*(*int32)(unsafe.Pointer(&(_pPrior.X4))) = _regLimitA
_iSub1 = _pParse.X59
_sqlite3Select(tls, _pParse, _pPrior, &_destA)
_sqlite3VdbeEndCoroutine(tls, _v, _regAddrA)
_sqlite3VdbeJumpHere(tls, _v, _addr1)
_addrSelectB = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1)
_addr1 = _sqlite3VdbeAddOp3(tls, _v, i32(15), _regAddrB, i32(0), _addrSelectB)
_sqlite3VdbeComment(tls, _v, str(100318))
_savedLimit = _p.X4
_savedOffset = _p.X5
*(*int32)(unsafe.Pointer(&(_p.X4))) = _regLimitB
*(*int32)(unsafe.Pointer(&(_p.X5))) = i32(0)
_iSub2 = _pParse.X59
_sqlite3Select(tls, _pParse, _p, &_destB)
*(*int32)(unsafe.Pointer(&(_p.X4))) = _savedLimit
*(*int32)(unsafe.Pointer(&(_p.X5))) = _savedOffset
_sqlite3VdbeEndCoroutine(tls, _v, _regAddrB)
_sqlite3VdbeNoopComment(tls, _v, str(100331))
_addrOutA = _generateOutputSubroutine(tls, _pParse, _p, &_destA, _pDest, _regOutA, _regPrev, _pKeyDup, _labelEnd)
if (_op == i32(116)) || (_op == i32(115)) {
_sqlite3VdbeNoopComment(tls, _v, str(100352))
_addrOutB = _generateOutputSubroutine(tls, _pParse, _p, &_destB, _pDest, _regOutB, _regPrev, _pKeyDup, _labelEnd)
}
_sqlite3KeyInfoUnref(tls, _pKeyDup)
if (_op == i32(117)) || (_op == i32(118)) {
_addrEofA_noB = store1(&_addrEofA, _labelEnd)
goto _58
}
_sqlite3VdbeNoopComment(tls, _v, str(100373))
_addrEofA = _sqlite3VdbeAddOp2(tls, _v, i32(14), _regOutB, _addrOutB)
_addrEofA_noB = _sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrB, _labelEnd)
_sqlite3VdbeGoto(tls, _v, _addrEofA)
*(*int16)(unsafe.Pointer(&(_p.X2))) = _sqlite3LogEstAdd(tls, _p.X2, _pPrior.X2)
_58:
if _op != i32(118) {
goto _59
}
_addrEofB = _addrEofA
if int32(_p.X2) > int32(_pPrior.X2) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _pPrior.X2
}
goto _61
_59:
_sqlite3VdbeNoopComment(tls, _v, str(100390))
_addrEofB = _sqlite3VdbeAddOp2(tls, _v, i32(14), _regOutA, _addrOutA)
_sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrA, _labelEnd)
_sqlite3VdbeGoto(tls, _v, _addrEofB)
_61:
_sqlite3VdbeNoopComment(tls, _v, str(100407))
_addrAltB = _sqlite3VdbeAddOp2(tls, _v, i32(14), _regOutA, _addrOutA)
_sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrA, _addrEofA)
_sqlite3VdbeGoto(tls, _v, _labelCmpr)
if _op == i32(116) {
_addrAeqB = _addrAltB
goto _65
}
if _op == i32(118) {
_addrAeqB = _addrAltB
_addrAltB += 1
goto _65
}
_sqlite3VdbeNoopComment(tls, _v, str(100425))
_addrAeqB = _sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrA, _addrEofA)
_sqlite3VdbeGoto(tls, _v, _labelCmpr)
_65:
_sqlite3VdbeNoopComment(tls, _v, str(100443))
_addrAgtB = _sqlite3VdbeCurrentAddr(tls, _v)
if (_op == i32(116)) || (_op == i32(115)) {
_sqlite3VdbeAddOp2(tls, _v, i32(14), _regOutB, _addrOutB)
}
_sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrB, _addrEofB)
_sqlite3VdbeGoto(tls, _v, _labelCmpr)
_sqlite3VdbeJumpHere(tls, _v, _addr1)
_sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrA, _addrEofA_noB)
_sqlite3VdbeAddOp2(tls, _v, i32(16), _regAddrB, _addrEofB)
_sqlite3VdbeResolveLabel(tls, _v, _labelCmpr)
_sqlite3VdbeAddOp4(tls, _v, i32(96), i32(0), i32(0), i32(0), (*int8)(unsafe.Pointer(_aPermute)), i32(-12))
_sqlite3VdbeAddOp4(tls, _v, i32(98), _destA.X3, _destB.X3, _nOrderBy, (*int8)(unsafe.Pointer(_pKeyMerge)), i32(-5))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(1)))
_sqlite3VdbeAddOp3(tls, _v, i32(18), _addrAltB, _addrAeqB, _addrAgtB)
_sqlite3VdbeResolveLabel(tls, _v, _labelEnd)
if int32(_pDest.X0) != i32(9) {
goto _68
}
_24_pFirst = _pPrior
_69:
if (*XSelect)(_24_pFirst.X13) != nil {
_24_pFirst = (*XSelect)(_24_pFirst.X13)
goto _69
}
_generateColumnNames(tls, _pParse, (*XSrcList)(_24_pFirst.X8), (*XExprList)(_24_pFirst.X0))
_68:
if (*XSelect)(_p.X13) != nil {
_sqlite3SelectDelete(tls, _db, (*XSelect)(_p.X13))
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _pPrior
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrior.X14))))) = _p
_explainComposite(tls, _pParse, int32(_p.X1), _iSub1, _iSub2, i32(0))
return bool2int((_pParse.X16) != i32(0))
_ = _destA
_ = _destB
panic(0)
}
var _multiSelectOrderByØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_multiSelectOrderByØ00__func__Ø000[0], str(100461), 19)
}
// Insert the end of a co-routine
func _sqlite3VdbeEndCoroutine(tls *crt.TLS, _v *TVdbe, _regYield int32) {
_sqlite3VdbeAddOp1(tls, _v, i32(53), _regYield)
*(*uint8)(unsafe.Pointer(&((*XParse)(_v.X3).X7))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&((*XParse)(_v.X3).X14))) = i32(0)
}
func _sqlite3VdbeNoopComment(tls *crt.TLS, _p *TVdbe, _zFormat *int8, args ...interface{}) {
var _ap []interface{}
if _p != nil {
_sqlite3VdbeAddOp0(tls, _p, i32(164))
_ap = args
_vdbeVComment(tls, _p, _zFormat, _ap)
_ap = nil
}
}
// Code an output subroutine for a coroutine implementation of a
// SELECT statment.
//
// The data to be output is contained in pIn->iSdst. There are
// pIn->nSdst columns to be output. pDest is where the output should
// be sent.
//
// regReturn is the number of the register holding the subroutine
// return address.
//
// If regPrev>0 then it is the first register in a vector that
// records the previous output. mem[regPrev] is a flag that is false
// if there has been no previous output. If regPrev>0 then code is
// generated to suppress duplicates. pKeyInfo is used for comparing
// keys.
//
// If the LIMIT found in p->iLimit is reached, jump immediately to
// iBreak.
func _generateOutputSubroutine(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pIn *XSelectDest, _pDest *XSelectDest, _regReturn int32, _regPrev int32, _pKeyInfo *XKeyInfo, _iBreak int32) (r0 int32) {
var _iContinue, _addr, _1_addr1, _1_addr2, _3_r1, _3_r2, _4_r1 int32
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
_addr = _sqlite3VdbeCurrentAddr(tls, _v)
_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
if _regPrev != 0 {
_1_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(22), _regPrev)
_1_addr2 = _sqlite3VdbeAddOp4(tls, _v, i32(98), _pIn.X3, _regPrev+i32(1), _pIn.X4, (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKeyInfo))), i32(-5))
_sqlite3VdbeAddOp3(tls, _v, i32(18), _1_addr2+i32(2), _iContinue, _1_addr2+i32(2))
_sqlite3VdbeJumpHere(tls, _v, _1_addr1)
_sqlite3VdbeAddOp3(tls, _v, i32(64), _pIn.X3, _regPrev+i32(1), (_pIn.X4)-i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _regPrev)
}
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
return i32(0)
}
_codeOffset(tls, _v, _p.X5, _iContinue)
func() {
if int32(_pDest.X0) == i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119182), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000))), unsafe.Pointer(str(100480)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pDest.X0) == i32(14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119183), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000))), unsafe.Pointer(str(100505)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_pDest.X0) {
case i32(10):
goto _9
case i32(11):
goto _8
case i32(12):
goto _7
case i32(13):
goto _10
default:
goto _11
}
_7:
_3_r1 = _sqlite3GetTempReg(tls, _pParse)
_3_r2 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _pIn.X3, _pIn.X4, _3_r1)
_sqlite3VdbeAddOp2(tls, _v, i32(117), _pDest.X2, _3_r2)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _pDest.X2, _3_r1, _3_r2)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
_sqlite3ReleaseTempReg(tls, _pParse, _3_r2)
_sqlite3ReleaseTempReg(tls, _pParse, _3_r1)
goto _12
_8:
_4_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp4(tls, _v, i32(101), _pIn.X3, _pIn.X4, _4_r1, _pDest.X1, _pIn.X4)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.X3, _pIn.X4)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _pDest.X2, _4_r1, _pIn.X3, _pIn.X4)
_sqlite3ReleaseTempReg(tls, _pParse, _4_r1)
goto _12
_9:
func() {
if (_pIn.X4) != i32(1) && (_pParse.X16) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119220), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000))), unsafe.Pointer(str(100529)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCodeMove(tls, _pParse, _pIn.X3, _pDest.X2, i32(1))
goto _12
_10:
if (_pDest.X3) == i32(0) {
*(*int32)(unsafe.Pointer(&(_pDest.X3))) = _sqlite3GetTempRange(tls, _pParse, _pIn.X4)
*(*int32)(unsafe.Pointer(&(_pDest.X4))) = _pIn.X4
}
_sqlite3ExprCodeMove(tls, _pParse, _pIn.X3, _pDest.X3, _pIn.X4)
_sqlite3VdbeAddOp1(tls, _v, i32(16), _pDest.X2)
goto _12
_11:
func() {
if int32(_pDest.X0) != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(119249), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateOutputSubroutineØ00__func__Ø000))), unsafe.Pointer(str(100561)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(67), _pIn.X3, _pIn.X4)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _pIn.X3, _pIn.X4)
goto _12
_12:
if (_p.X4) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(48), _p.X4, _iBreak)
}
_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
_sqlite3VdbeAddOp1(tls, _v, i32(52), _regReturn)
return _addr
}
// Make a new pointer to a KeyInfo object
func _sqlite3KeyInfoRef(tls *crt.TLS, _p *XKeyInfo) (r0 *XKeyInfo) {
if _p != nil {
func() {
if (_p.X0) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117587), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3KeyInfoRefØ00__func__Ø000))), unsafe.Pointer(str(13857)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_p.X0))) += 1
}
return _p
}
var _sqlite3KeyInfoRefØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3KeyInfoRefØ00__func__Ø000[0], str(100586), 18)
}
var _generateOutputSubroutineØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_generateOutputSubroutineØ00__func__Ø000[0], str(100604), 25)
}
// Find (an approximate) sum of two LogEst values. This computation is
// not a simple "+" operator because LogEst is stored as a logarithmic
// value.
//
func _sqlite3LogEstAdd(tls *crt.TLS, _a int16, _b int16) (r0 int16) {
if int32(_a) < int32(_b) {
goto _0
}
if int32(_a) > (int32(_b) + i32(49)) {
return _a
}
if int32(_a) > (int32(_b) + i32(31)) {
return int16(int32(_a) + i32(1))
}
return int16(int32(_a) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_a)-int32(_b))))))
_0:
if int32(_b) > (int32(_a) + i32(49)) {
return _b
}
if int32(_b) > (int32(_a) + i32(31)) {
return int16(int32(_b) + i32(1))
}
return int16(int32(_b) + int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3LogEstAddØ00xØ001)) + 1*uintptr(int32(_b)-int32(_a))))))
}
var _sqlite3LogEstAddØ00xØ001 [32]uint8
func init() {
_sqlite3LogEstAddØ00xØ001 = [32]uint8{10, 10, 9, 9, 8, 8, 7, 7, 7, 6, 6, 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2}
}
// Generate code that will tell the VDBE the names of columns
// in the result set. This information is used to provide the
// azCol[] values in the callback.
func _generateColumnNames(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
var _i, _fullNames, _shortNames, _4_iCol int32
var _3_zName, _4_zCol, _8_zName, _10_z *int8
var _db *Xsqlite3
var _pTab *XTable
var _v *TVdbe
var _2_p *XExpr
_v = (*TVdbe)(_pParse.X2)
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X54) != 0 {
return
}
if ((_pParse.X4) != 0) || ((_db.X17) != 0) {
return
}
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118115), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pTabList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118116), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(100629)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pParse.X4))) = uint8(i32(1))
_fullNames = bool2int(((_db.X6) & i32(4)) != i32(0))
_shortNames = bool2int(((_db.X6) & i32(64)) != i32(0))
_sqlite3VdbeSetNumCols(tls, _v, _pEList.X0)
_i = i32(0)
_7:
if _i >= (_pEList.X0) {
goto _10
}
_2_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X0)
if func() int32 {
if _2_p == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118124), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _8
}
if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X1) != nil {
_3_zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X1
_sqlite3VdbeSetColName(tls, _v, _i, i32(0), _3_zName, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
goto _31
}
if int32(_2_p.X0) != i32(152) && int32(_2_p.X0) != i32(154) || store44(&_pTab, _tableWithCursor(tls, _pTabList, _2_p.X8)) == nil {
goto _18
}
_4_iCol = int32(_2_p.X9)
if _4_iCol < i32(0) {
_4_iCol = int32(_pTab.X10)
}
func() {
if _4_iCol != i32(-1) && (_4_iCol < i32(0) || _4_iCol >= int32(_pTab.X11)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(118134), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateColumnNamesØ00__func__Ø000))), unsafe.Pointer(str(94506)))
crt.X__builtin_abort(tls)
}
}()
if _4_iCol < i32(0) {
_4_zCol = str(27227)
goto _25
}
_4_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_4_iCol))).X0
_25:
if (_shortNames == 0) && (_fullNames == 0) {
_sqlite3VdbeSetColName(tls, _v, _i, i32(0), _sqlite3DbStrDup(tls, _db, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_i))).X2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
goto _30
}
if _fullNames != 0 {
_8_zName = nil
_8_zName = _sqlite3MPrintf(tls, _db, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_4_zCol))
_sqlite3VdbeSetColName(tls, _v, _i, i32(0), _8_zName, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
goto _30
}
_sqlite3VdbeSetColName(tls, _v, _i, i32(0), _4_zCol, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_30:
goto _31
_18:
_10_z = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X2
_10_z = func() *int8 {
if _10_z == nil {
return _sqlite3MPrintf(tls, _db, str(100641), _i+i32(1))
}
return _sqlite3DbStrDup(tls, _db, _10_z)
}()
_sqlite3VdbeSetColName(tls, _v, _i, i32(0), _10_z, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
_31:
_8:
_i += 1
goto _7
_10:
_generateColumnTypes(tls, _pParse, _pTabList, _pEList)
}
var _generateColumnNamesØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_generateColumnNamesØ00__func__Ø000[0], str(100650), 20)
}
// Return the Table objecct in the SrcList that has cursor iCursor.
// Or return NULL if no such Table object exists in the SrcList.
func _tableWithCursor(tls *crt.TLS, _pList *XSrcList, _iCursor int32) (r0 *XTable) {
var _j int32
_j = i32(0)
_0:
if _j >= (_pList.X0) {
goto _3
}
if ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 68*uintptr(_j))).X11) == _iCursor {
return (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2))))) + 68*uintptr(_j))).X4)
}
_j += 1
goto _0
_3:
return nil
}
// Generate code that will tell the VDBE the declaration types of columns
// in the result set.
func _generateColumnTypes(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pEList *XExprList) {
var _i int32
var _1_zType *int8
var _v *TVdbe
var _1_p *XExpr
var _sNC XNameContext
_v = (*TVdbe)(_pParse.X2)
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X4))))) = nil
_i = i32(0)
_0:
if _i >= (_pEList.X0) {
goto _3
}
_1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X0)
_1_zType = _columnTypeImpl(tls, &_sNC, _1_p, nil)
_sqlite3VdbeSetColName(tls, _v, _i, i32(1), _1_zType, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_i += 1
goto _0
_3:
_ = _sNC
}
// Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
// is a no-op. Otherwise, it adds a single row of output to the EQP result,
// where the caption is of one of the two forms:
//
// "COMPOSITE SUBQUERIES iSub1 and iSub2 (op)"
// "COMPOSITE SUBQUERIES iSub1 and iSub2 USING TEMP B-TREE (op)"
//
// where iSub1 and iSub2 are the integers passed as the corresponding
// function parameters, and op is the text representation of the parameter
// of the same name. The parameter "op" must be one of TK_UNION, TK_EXCEPT,
// TK_INTERSECT or TK_ALL. The first form is used if argument bUseTmp is
// false, or the second form if it is true.
func _explainComposite(tls *crt.TLS, _pParse *XParse, _op int32, _iSub1 int32, _iSub2 int32, _bUseTmp int32) {
var _1_zMsg *int8
var _1_v *TVdbe
func() {
if _op != i32(115) && _op != i32(117) && _op != i32(118) && _op != i32(116) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117714), unsafe.Pointer((*int8)(unsafe.Pointer(&_explainCompositeØ00__func__Ø000))), unsafe.Pointer(str(100670)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pParse.X54) == i32(2) {
_1_v = (*TVdbe)(_pParse.X2)
_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(100734), _iSub1, _iSub2, unsafe.Pointer(func() *int8 {
if _bUseTmp != 0 {
return str(100771)
}
return str(0)
}()), unsafe.Pointer(_selectOpName(tls, _op)))
_sqlite3VdbeAddOp4(tls, _1_v, i32(165), _pParse.X58, i32(0), i32(0), _1_zMsg, i32(-1))
}
}
var _explainCompositeØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_explainCompositeØ00__func__Ø000[0], str(100790), 17)
}
// Return the maximum height of any expression tree referenced
// by the select statement passed as an argument.
func _sqlite3SelectExprHeight(tls *crt.TLS, _p *XSelect) (r0 int32) {
var _nHeight int32
_nHeight = i32(0)
_heightOfSelect(tls, _p, &_nHeight)
return _nHeight
}
// Make copies of relevant WHERE clause terms of the outer query into
// the WHERE clause of subquery. Example:
//
// SELECT * FROM (SELECT a AS x, c-d AS y FROM t1) WHERE x=5 AND y=10;
//
// Transformed into:
//
// SELECT * FROM (SELECT a AS x, c-d AS y FROM t1 WHERE a=5 AND c-d=10)
// WHERE x=5 AND y=10;
//
// The hope is that the terms added to the inner query will make it more
// efficient.
//
// Do not attempt this optimization if:
//
// (1) The inner query is an aggregate. (In that case, we'd really want
// to copy the outer WHERE-clause terms onto the HAVING clause of the
// inner query. But they probably won't help there so do not bother.)
//
// (2) The inner query is the recursive part of a common table expression.
//
// (3) The inner query has a LIMIT clause (since the changes to the WHERE
// close would change the meaning of the LIMIT).
//
// (4) The inner query is the right operand of a LEFT JOIN. (The caller
// enforces this restriction since this routine does not have enough
// information to know.)
//
// (5) The WHERE clause expression originates in the ON or USING clause
// of a LEFT JOIN.
//
// Return 0 if no changes are made and non-zero if one or more WHERE clause
// terms are duplicated into the subquery.
func _pushDownWhereTerms(tls *crt.TLS, _pParse *XParse, _pSubq *XSelect, _pWhere *XExpr, _iCursor int32) (r0 int32) {
var _nChng int32
var _pX *XSelect
var _pNew *XExpr
var _6_x XSubstContext
_nChng = i32(0)
if _pWhere == nil {
return i32(0)
}
_pX = _pSubq
_1:
if _pX == nil {
goto _4
}
if ((_pX.X3) & uint32(i32(8200))) != uint32(i32(0)) {
return i32(0)
}
_pX = (*XSelect)(_pX.X13)
goto _1
_4:
if (*XExpr)(_pSubq.X15) != nil {
return i32(0)
}
_6:
if int32(_pWhere.X0) == i32(71) {
{
p := &_nChng
*p = (*p) + _pushDownWhereTerms(tls, _pParse, _pSubq, (*XExpr)(_pWhere.X5), _iCursor)
sink1 = *p
}
_pWhere = (*XExpr)(_pWhere.X4)
goto _6
}
if ((_pWhere.X2) & uint32(i32(1))) != uint32(i32(0)) {
return i32(0)
}
if _sqlite3ExprIsTableConstant(tls, _pWhere, _iCursor) == 0 {
goto _10
}
_nChng += 1
_11:
if _pSubq != nil {
_pNew = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _pWhere, i32(0))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_x.X0))))) = _pParse
*(*int32)(unsafe.Pointer(&(_6_x.X1))) = _iCursor
*(*int32)(unsafe.Pointer(&(_6_x.X2))) = _iCursor
*(*int32)(unsafe.Pointer(&(_6_x.X3))) = i32(0)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_x.X4))))) = (*XExprList)(_pSubq.X0)
_pNew = _substExpr(tls, &_6_x, _pNew)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubq.X9))))) = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)(_pSubq.X9), _pNew)
_pSubq = (*XSelect)(_pSubq.X13)
goto _11
}
_10:
return _nChng
_ = _6_x
panic(0)
}
// 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 _sqlite3ExprIsTableConstant(tls *crt.TLS, _p *XExpr, _iCur int32) (r0 int32) {
return _exprIsConst(tls, _p, i32(3), _iCur)
}
// Mark all temporary registers as being unavailable for reuse.
func _sqlite3ClearTempRegCache(tls *crt.TLS, _pParse *XParse) {
*(*uint8)(unsafe.Pointer(&(_pParse.X7))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_pParse.X14))) = i32(0)
}
// Check to see if the pThis entry of pTabList is a self-join of a prior view.
// If it is, then return the SrcList_item for the prior view. If it is not,
// then return 0.
func _isSelfJoinView(tls *crt.TLS, _pTabList *XSrcList, _pThis *TSrcList_item) (r0 *TSrcList_item) {
var _pItem *TSrcList_item
_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))
_0:
if uintptr(unsafe.Pointer(_pItem)) >= uintptr(unsafe.Pointer(_pThis)) {
goto _3
}
if (*XSelect)(_pItem.X5) == nil {
goto _1
}
if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
goto _1
}
if (_pItem.X2) == nil {
goto _1
}
if Xsqlite3_stricmp(tls, _pItem.X1, _pThis.X1) != i32(0) {
goto _1
}
if Xsqlite3_stricmp(tls, _pItem.X2, _pThis.X2) != i32(0) {
goto _1
}
if _sqlite3ExprCompare(tls, (*XExpr)((*XSelect)(_pThis.X5).X9), (*XExpr)((*XSelect)(_pItem.X5).X9), i32(-1)) != 0 {
goto _1
}
return _pItem
_1:
*(*uintptr)(unsafe.Pointer(&_pItem)) += uintptr(68)
goto _0
_3:
return nil
}
func _sqlite3VdbeChangeP1(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
*(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X3))) = _val
}
// Change the value of the opcode, or P1, P2, P3, or P5 operands
// for a specific instruction.
func _sqlite3VdbeChangeOpcode(tls *crt.TLS, _p *TVdbe, _addr uint32, _iNewOpcode uint8) {
*(*uint8)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X0))) = _iNewOpcode
}
// Generate the beginning of the loop used for WHERE clause processing.
// The return value is a pointer to an opaque structure that contains
// information needed to terminate the loop. Later, the calling routine
// should invoke sqlite3WhereEnd() with the return value of this function
// in order to complete the WHERE clause processing.
//
// If an error occurs, this routine returns NULL.
//
// The basic idea is to do a nested loop, one loop for each table in
// the FROM clause of a select. (INSERT and UPDATE statements are the
// same as a SELECT with only a single table in the FROM clause.) For
// example, if the SQL is this:
//
// SELECT * FROM t1, t2, t3 WHERE ...;
//
// Then the code generated is conceptually like the following:
//
// foreach row1 in t1 do \ Code generated
// foreach row2 in t2 do |-- by sqlite3WhereBegin()
// foreach row3 in t3 do /
// ...
// end \ Code generated
// end |-- by sqlite3WhereEnd()
// end /
//
// Note that the loops might not be nested in the order in which they
// appear in the FROM clause if a different order is better able to make
// use of indices. Note also that when the IN operator appears in
// the WHERE clause, it might result in additional nested loops for
// scanning through all values on the right-hand side of the IN.
//
// There are Btree cursors associated with each table. t1 uses cursor
// number pTabList->a[0].iCursor. t2 uses the cursor pTabList->a[1].iCursor.
// And so forth. This routine generates code to open those VDBE cursors
// and sqlite3WhereEnd() generates the code to close them.
//
// The code that sqlite3WhereBegin() generates leaves the cursors named
// in pTabList pointing at their appropriate entries. The [...] code
// can use OP_Column and OP_Rowid opcodes on these cursors to extract
// data from the various tables of the loop.
//
// If the WHERE clause is empty, the foreach loops must each scan their
// entire tables. Thus a three-way join is an O(N^3) operation. But if
// the tables have indices and there are terms in the WHERE clause that
// refer to those indices, a complete table scan can be avoided and the
// code will run much faster. Most of the work of this routine is checking
// to see if there are indices that can be used to speed up the loop.
//
// Terms of the WHERE clause are also used to limit which rows actually
// make it to the "..." in the middle of the loop. After each "foreach",
// terms of the WHERE clause that use only terms in that loop and outer
// loops are evaluated and if false a jump is made around all subsequent
// inner loops (or around the "..." if the test occurs within the inner-
// most loop)
//
// OUTER JOINS
//
// An outer join of tables t1 and t2 is conceptally coded as follows:
//
// foreach row1 in t1 do
// flag = 0
// foreach row2 in t2 do
// start:
// ...
// flag = 1
// end
// if flag==0 then
// move the row2 cursor to a null row
// goto start
// fi
// end
//
// ORDER BY CLAUSE PROCESSING
//
// pOrderBy is a pointer to the ORDER BY clause (or the GROUP BY clause
// if the WHERE_GROUPBY flag is set in wctrlFlags) of a SELECT statement
// if there is one. If there is no ORDER BY clause or if this routine
// is called from an UPDATE or DELETE statement, then pOrderBy is NULL.
//
// The iIdxCur parameter is the cursor number of an index. If
// WHERE_OR_SUBCLAUSE is set, iIdxCur is the cursor number of an index
// to use for OR clause processing. The WHERE clause should use this
// specific cursor. If WHERE_ONEPASS_DESIRED is set, then iIdxCur is
// the first cursor in an array of cursors for all indices. iIdxCur should
// be used to compute the appropriate cursor depending on which index is
// used.
func _sqlite3WhereBegin(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr, _pOrderBy *XExprList, _pResultSet *XExprList, _wctrlFlags uint16, _iAuxArg int32) (r0 *XWhereInfo) {
var _nByteWInfo, _nTabList, _ii, _rc, _23_wsFlags, _23_bOnerow, _27_iDb, _29_iCur, _31_op, _33_n, _37_iIndexCur, _37_op, _45_addrExplain, _45_wsFlags int32
var _notReady, _9_m, _17_tabUsed, _33_b uint64
var _29_pVTab *int8
var _bFordelete uint8
var _db *Xsqlite3
var _27_pTab *XTable
var _v *TVdbe
var _27_pTabItem *TSrcList_item
var _37_pIx, _39_pJ *XIndex
var _pWInfo *XWhereInfo
var _pLoop *XWhereLoop
var _pLevel *XWhereLevel
var _19_pTerm, _19_pEnd *XWhereTerm
var _pMaskSet *XWhereMaskSet
var _sWLB XWhereLoopBuilder
_v = (*TVdbe)(_pParse.X2)
_bFordelete = u8(0)
func() {
if (int32(_wctrlFlags)&i32(8)) != i32(0) && ((int32(_wctrlFlags)&i32(4)) == i32(0) || (int32(_wctrlFlags)&i32(32)) != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134785), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(100807)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_wctrlFlags)&i32(32)) != i32(0) && (int32(_wctrlFlags)&i32(16384)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134791), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(100935)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
crt.Xmemset(tls, (unsafe.Pointer)(&_sWLB), i32(0), u32(24))
if (_pOrderBy != nil) && ((_pOrderBy.X0) >= i32(64)) {
_pOrderBy = nil
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X2))))) = _pOrderBy
if (int32(_db.X13) & i32(32)) != i32(0) {
{
p := &_wctrlFlags
*p = uint16(int32(*p) & i32(-257))
sink14 = *p
}
}
if (_pTabList.X0) > i32(64) {
_sqlite3ErrorMsg(tls, _pParse, str(101009), i32(64))
return nil
}
_nTabList = func() int32 {
if (int32(_wctrlFlags) & i32(32)) != 0 {
return i32(1)
}
return (_pTabList.X0)
}()
_nByteWInfo = int32(((u32(820) + (uint32(_nTabList-i32(1)) * u32(76))) + uint32(i32(7))) & uint32(i32(-8)))
_pWInfo = (*XWhereInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(uint32(_nByteWInfo)+u32(72))))
if (_db.X17) != 0 {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pWInfo))
_pWInfo = nil
goto _whereBeginError
}
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X1))))) = _pTabList
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X2))))) = _pOrderBy
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X4))))) = _pWhere
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X3))))) = _pResultSet
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(0)))) = store1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6)))))+4*uintptr(i32(1)))), i32(-1))
*(*uint8)(unsafe.Pointer(&(_pWInfo.X11))) = uint8(_nTabList)
*(*int32)(unsafe.Pointer(&(_pWInfo.X8))) = store1((*int32)(unsafe.Pointer(&(_pWInfo.X7))), _sqlite3VdbeMakeLabel(tls, _v))
*(*uint16)(unsafe.Pointer(&(_pWInfo.X10))) = _wctrlFlags
*(*int16)(unsafe.Pointer(&(_pWInfo.X5))) = int16(_iAuxArg)
*(*int32)(unsafe.Pointer(&(_pWInfo.X9))) = int32(_pParse.X42)
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(&(_pWInfo.X12)))), i32(0), u32(29))
crt.Xmemset(tls, (unsafe.Pointer)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))+76*uintptr(i32(0))))), i32(0), u32(72)+(uint32(_nTabList)*u32(76)))
func() {
if int32(_pWInfo.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101037)))
crt.X__builtin_abort(tls)
}
}()
_pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23)))
*(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X0))))) = _pWInfo
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X1))))) = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))
*(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWLB.X3))))) = (*XWhereLoop)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pWInfo)))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_nByteWInfo)))))))))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*XWhereLoop)(_sWLB.X3)))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134858), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101067)))
crt.X__builtin_abort(tls)
}
}()
_whereLoopInit(tls, (*XWhereLoop)(_sWLB.X3))
*(*int8)(unsafe.Pointer(&((*XWhereLoop)(_sWLB.X3).X2))) = int8(i32(42))
*(*int32)(unsafe.Pointer(&(_pMaskSet.X0))) = i32(0)
_sqlite3WhereClauseInit(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pWInfo)
_sqlite3WhereSplit(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pWhere, uint8(i32(71)))
_ii = i32(0)
_18:
if _ii >= ((*XWhereClause)(_sWLB.X1).X3) {
goto _21
}
if (_nTabList == i32(0)) || _sqlite3ExprIsConstantNotJoin(tls, (*XExpr)((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.X1).X5)+48*uintptr(_ii))).X0)) != 0 {
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.X1).X5)+48*uintptr(_ii))).X0), _pWInfo.X8, i32(16))
{
p := (*uint16)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.X1).X5) + 48*uintptr(_ii))).X3)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
}
_ii += 1
goto _18
_21:
if _nTabList != i32(0) {
goto _24
}
if _pOrderBy != nil {
*(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8(_pOrderBy.X0)
}
if (int32(_wctrlFlags) & i32(256)) != 0 {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1))
}
_24:
_ii = i32(0)
_27:
if _ii >= (_pTabList.X0) {
goto _30
}
_createMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(_ii))).X11)
_sqlite3WhereTabFuncArgs(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(_ii))), (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))))
_ii += 1
goto _27
_30:
_ii = i32(0)
_31:
if _ii >= (_pTabList.X0) {
goto _34
}
_9_m = _sqlite3WhereGetMask(tls, _pMaskSet, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(_ii))).X11)
func() {
if _9_m != (u64(1) << uint(_ii)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134912), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101099)))
crt.X__builtin_abort(tls)
}
}()
_ii += 1
goto _31
_34:
_sqlite3WhereExprAnalyze(tls, _pTabList, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))))
if (_db.X17) != 0 {
goto _whereBeginError
}
if (int32(_wctrlFlags) & i32(256)) == 0 {
goto _38
}
if _isDistinctRedundant(tls, _pParse, _pTabList, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _pResultSet) != 0 {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1))
goto _41
}
if _pOrderBy == nil {
{
p := (*uint16)(unsafe.Pointer(&(_pWInfo.X10)))
*p = uint16(int32(*p) | i32(128))
sink14 = *p
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X2))))) = _pResultSet
}
_41:
_38:
if _nTabList == i32(1) && _whereShortCut(tls, &_sWLB) != i32(0) {
goto _43
}
_rc = _whereLoopAddAll(tls, &_sWLB)
if _rc != 0 {
goto _whereBeginError
}
_wherePathSolver(tls, _pWInfo, int16(i32(0)))
if (_db.X17) != 0 {
goto _whereBeginError
}
if (*XExprList)(_pWInfo.X2) == nil {
goto _46
}
_wherePathSolver(tls, _pWInfo, int16(int32(_pWInfo.X21)+i32(1)))
if (_db.X17) != 0 {
goto _whereBeginError
}
_46:
_43:
if ((*XExprList)(_pWInfo.X2) == nil) && (((_db.X6) & i32(131072)) != i32(0)) {
*(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = u64(18446744073709551615)
}
if (_pParse.X16) != 0 || func() int32 {
if (_db.X17) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134972), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _whereBeginError
}
if int32(_pWInfo.X11) < i32(2) || _pResultSet == nil || (int32(_db.X13)&i32(1024)) != i32(0) {
goto _56
}
_17_tabUsed = _sqlite3WhereExprListUsage(tls, _pMaskSet, _pResultSet)
if (*XExprList)(_sWLB.X2) != nil {
{
p := &_17_tabUsed
*p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_sWLB.X2))
sink17 = *p
}
}
_57:
if int32(_pWInfo.X11) < i32(2) {
goto _59
}
_pLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(int32(_pWInfo.X11)-i32(1)))).X18)
if (int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 68*uintptr(_pLoop.X3))).X9))).X0) & i32(8)) == i32(0) {
goto _59
}
if ((int32(_wctrlFlags) & i32(256)) == i32(0)) && (((_pLoop.X9) & uint32(i32(4096))) == uint32(i32(0))) {
goto _59
}
if (_17_tabUsed & (_pLoop.X1)) != uint64(i32(0)) {
goto _59
}
_19_pEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)((*XWhereClause)(_sWLB.X1).X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_sWLB.X1).X3)))))*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
_19_pTerm = (*XWhereTerm)((*XWhereClause)(_sWLB.X1).X5)
_64:
if uintptr(unsafe.Pointer(_19_pTerm)) >= uintptr(unsafe.Pointer(_19_pEnd)) {
goto _67
}
if (((_19_pTerm.X12) & (_pLoop.X1)) != uint64(i32(0))) && ((((*XExpr)(_19_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0))) {
goto _67
}
*(*uintptr)(unsafe.Pointer(&_19_pTerm)) += uintptr(48)
goto _64
_67:
if uintptr(unsafe.Pointer(_19_pTerm)) < uintptr(unsafe.Pointer(_19_pEnd)) {
goto _59
}
*(*uint8)(unsafe.Pointer(&(_pWInfo.X11))) -= 1
_nTabList -= 1
goto _57
_59:
_56:
{
p := (*uint32)(unsafe.Pointer(&((*XParse)(_pWInfo.X0).X42)))
*p = (*p) + uint32(_pWInfo.X21)
sink5 = *p
}
func() {
if (int32(_wctrlFlags)&i32(4)) != i32(0) && int32(_pWInfo.X11) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135040), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101114)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_wctrlFlags) & i32(4)) == i32(0) {
goto _74
}
_23_wsFlags = int32((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(i32(0)))).X18).X9)
_23_bOnerow = bool2int((_23_wsFlags & i32(4096)) != i32(0))
if _23_bOnerow == 0 && ((int32(_wctrlFlags)&i32(8)) == i32(0) || i32(0) != (_23_wsFlags&i32(1024))) {
goto _77
}
*(*uint8)(unsafe.Pointer(&(_pWInfo.X14))) = uint8(func() int32 {
if _23_bOnerow != 0 {
return i32(1)
}
return i32(2)
}())
if (((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(i32(0)))).X4).X9)&uint32(i32(32))) != uint32(i32(0)) || (_23_wsFlags&i32(64)) == 0 {
goto _81
}
if (int32(_wctrlFlags) & i32(8)) != 0 {
_bFordelete = uint8(i32(8))
}
*(*uint32)(unsafe.Pointer(&((*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(i32(0)))).X18).X9))) = uint32(_23_wsFlags & i32(-65))
_81:
_77:
_74:
*func() **XWhereLevel { _ii = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))
_83:
if _ii >= _nTabList {
goto _86
}
_27_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_pLevel.X11)))
_27_pTab = (*XTable)(_27_pTabItem.X4)
_27_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_27_pTab.X20))
_pLoop = (*XWhereLoop)(_pLevel.X18)
if (((_27_pTab.X9) & uint32(i32(2))) != uint32(i32(0))) || ((*XSelect)(_27_pTab.X3) != nil) {
goto _108
}
if ((_pLoop.X9) & uint32(i32(1024))) != uint32(i32(0)) {
_29_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _27_pTab)))
_29_iCur = _27_pTabItem.X11
_sqlite3VdbeAddOp4(tls, _v, i32(158), _29_iCur, i32(0), i32(0), _29_pVTab, i32(-8))
goto _108
}
if (_27_pTab.X16) != 0 {
goto _108
}
if ((_pLoop.X9)&uint32(i32(64))) != uint32(i32(0)) || (int32(_wctrlFlags)&i32(32)) != i32(0) {
goto _95
}
_31_op = i32(106)
if int32(_pWInfo.X14) != i32(0) {
_31_op = i32(107)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(0)))) = _27_pTabItem.X11
}
_sqlite3OpenTable(tls, _pParse, _27_pTabItem.X11, _27_iDb, _27_pTab, _31_op)
func() {
if (_27_pTabItem.X11) != (_pLevel.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135090), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101175)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pWInfo.X14) != i32(0) || int32(_27_pTab.X11) >= i32(64) || ((_27_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) {
goto _101
}
_33_b = _27_pTabItem.X14
_33_n = i32(0)
_102:
if _33_b == 0 {
goto _105
}
*func() *int32 { _33_b = _33_b >> uint(i32(1)); return &_33_n }() += 1
goto _102
_105:
_sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)((unsafe.Pointer)(uintptr(_33_n))), i32(-11))
func() {
if _33_n > int32(_27_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135098), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101210)))
crt.X__builtin_abort(tls)
}
}()
_101:
_sqlite3VdbeChangeP5(tls, _v, uint16(_bFordelete))
goto _108
_95:
_sqlite3TableLock(tls, _pParse, _27_iDb, _27_pTab.X7, uint8(i32(0)), _27_pTab.X0)
_108:
if ((_pLoop.X9) & uint32(i32(512))) == 0 {
goto _109
}
_37_pIx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)
_37_op = i32(106)
func() {
if _iAuxArg == i32(0) && (int32(_pWInfo.X10)&i32(4)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135120), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101224)))
crt.X__builtin_abort(tls)
}
}()
if ((((_27_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_37_pIx.X16)<>uint(i32(30))) == i32(2))) && ((int32(_wctrlFlags) & i32(32)) != i32(0)) {
_37_iIndexCur = _pLevel.X1
_37_op = i32(0)
goto _128
}
if int32(_pWInfo.X14) == i32(0) {
goto _117
}
_39_pJ = (*XIndex)((*XTable)(_27_pTabItem.X4).X2)
_37_iIndexCur = _iAuxArg
func() {
if (int32(_wctrlFlags) & i32(4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135131), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101286)))
crt.X__builtin_abort(tls)
}
}()
_120:
if func() int32 {
if _39_pJ != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135132), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && (_39_pJ != _37_pIx) {
_37_iIndexCur += 1
_39_pJ = (*XIndex)(_39_pJ.X5)
goto _120
}
_37_op = i32(107)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6))))) + 4*uintptr(i32(1)))) = _37_iIndexCur
goto _128
_117:
if _iAuxArg != 0 && ((int32(_wctrlFlags) & i32(32)) != i32(0)) {
_37_iIndexCur = _iAuxArg
_37_op = i32(105)
goto _128
}
_37_iIndexCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_128:
*(*int32)(unsafe.Pointer(&(_pLevel.X2))) = _37_iIndexCur
func() {
if (*XSchema)(_37_pIx.X6) != (*XSchema)(_27_pTab.X20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _37_iIndexCur < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135146), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereBeginØ00__func__Ø000))), unsafe.Pointer(str(101349)))
crt.X__builtin_abort(tls)
}
}()
if _37_op == 0 {
goto _133
}
_sqlite3VdbeAddOp3(tls, _v, _37_op, _37_iIndexCur, _37_pIx.X11, _27_iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _37_pIx)
if (((((_pLoop.X9) & uint32(i32(15))) != uint32(i32(0))) && (((_pLoop.X9) & uint32(i32(32770))) == uint32(i32(0)))) && ((int32(_pWInfo.X10) & i32(1)) == i32(0))) && (int32(_pWInfo.X16) != i32(2)) {
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(2)))
}
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_37_pIx.X0))
_133:
_109:
if _27_iDb >= i32(0) {
_sqlite3CodeVerifySchema(tls, _pParse, _27_iDb)
}
*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _ii += 1; return &_pLevel }())) += uintptr(76)
goto _83
_86:
*(*int32)(unsafe.Pointer(&(_pWInfo.X18))) = _sqlite3VdbeCurrentAddr(tls, _v)
if (_db.X17) != 0 {
goto _whereBeginError
}
_notReady = u64(18446744073709551615)
_ii = i32(0)
_140:
if _ii >= _nTabList {
goto _143
}
_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(_ii)))
_45_wsFlags = int32((*XWhereLoop)(_pLevel.X18).X9)
if (((*XWhereLoop)(_pLevel.X18).X9) & uint32(i32(16384))) == uint32(i32(0)) {
goto _144
}
_constructAutomaticIndex(tls, _pParse, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(_pLevel.X11))), _notReady, _pLevel)
if (_db.X17) != 0 {
goto _whereBeginError
}
_144:
_45_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _pTabList, _pLevel, _ii, int32(_pLevel.X11), _wctrlFlags)
*(*int32)(unsafe.Pointer(&(_pLevel.X8))) = _sqlite3VdbeCurrentAddr(tls, _v)
_notReady = _sqlite3WhereCodeOneLoopStart(tls, _pWInfo, _ii, _notReady)
*(*int32)(unsafe.Pointer(&(_pWInfo.X7))) = _pLevel.X6
if ((_45_wsFlags & i32(8192)) == i32(0)) && ((int32(_wctrlFlags) & i32(32)) == i32(0)) {
}
_ii += 1
goto _140
_143:
return _pWInfo
_whereBeginError:
if _pWInfo != nil {
*(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(_pWInfo.X9)
_whereInfoFree(tls, _db, _pWInfo)
}
return nil
_ = _sWLB
_ = _45_addrExplain
panic(0)
}
var _sqlite3WhereBeginØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereBeginØ00__func__Ø000[0], str(101362), 18)
}
// Convert bulk memory into a valid WhereLoop that can be passed
// to whereLoopClear harmlessly.
func _whereLoopInit(tls *crt.TLS, _p *XWhereLoop) {
*(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15)))))
*(*uint16)(unsafe.Pointer(&(_p.X10))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&(_p.X12))) = uint16(i32(3))
*(*uint32)(unsafe.Pointer(&(_p.X9))) = uint32(i32(0))
}
// Initialize a preallocated WhereClause structure.
func _sqlite3WhereClauseInit(tls *crt.TLS, _pWC *XWhereClause, _pWInfo *XWhereInfo) {
*(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X0))))) = _pWInfo
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X1))))) = nil
*(*int32)(unsafe.Pointer(&(_pWC.X3))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pWC.X4))) = i32(8)
*(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6)))))
}
// This routine identifies subexpressions in the WHERE clause where
// each subexpression is separated by the AND operator or some other
// operator specified in the op parameter. The WhereClause structure
// is filled with pointers to subexpressions. For example:
//
// WHERE a=='hello' AND coalesce(b,11)<10 AND (c+12!=d OR c==22)
// \________/ \_______________/ \________________/
// slot[0] slot[1] slot[2]
//
// The original WHERE clause in pExpr is unaltered. All this routine
// does is make slot[] entries point to substructure within pExpr.
//
// In the previous sentence and in the diagram, "slot[]" refers to
// the WhereClause.a[] array. The slot[] array grows as needed to contain
// all terms of the WHERE clause.
func _sqlite3WhereSplit(tls *crt.TLS, _pWC *XWhereClause, _pExpr *XExpr, _op uint8) {
var _pE2 *XExpr
_pE2 = _sqlite3ExprSkipCollate(tls, _pExpr)
*(*uint8)(unsafe.Pointer(&(_pWC.X2))) = _op
if _pE2 == nil {
return
}
if int32(_pE2.X0) != int32(_op) {
_whereClauseInsert(tls, _pWC, _pExpr, uint16(i32(0)))
goto _2
}
_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.X4), _op)
_sqlite3WhereSplit(tls, _pWC, (*XExpr)(_pE2.X5), _op)
_2:
}
// Add a single new WhereTerm entry to the WhereClause object pWC.
// The new WhereTerm object is constructed from Expr p and with wtFlags.
// The index in pWC->a[] of the new WhereTerm is returned on success.
// 0 is returned if the new WhereTerm could not be added due to a memory
// allocation error. The memory allocation failure will be recorded in
// the db->mallocFailed flag so that higher-level functions can detect it.
//
// This routine will increase the size of the pWC->a[] array as necessary.
//
// If the wtFlags argument includes TERM_DYNAMIC, then responsibility
// for freeing the expression p is assumed by the WhereClause object pWC.
// This is true even if this routine fails to allocate a new WhereTerm.
//
// WARNING: This routine might reallocate the space used to store
// WhereTerms. All pointers to WhereTerms should be invalidated after
// calling this routine. Such pointers may be reinitialized by referencing
// the pWC->a[] array.
func _whereClauseInsert(tls *crt.TLS, _pWC *XWhereClause, _p *XExpr, _wtFlags uint16) (r0 int32) {
var _idx int32
var _1_db *Xsqlite3
var _pTerm, _1_pOld *XWhereTerm
if (_pWC.X3) < (_pWC.X4) {
goto _0
}
_1_pOld = (*XWhereTerm)(_pWC.X5)
_1_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.X0).X0).X0)
*(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = (*XWhereTerm)(_sqlite3DbMallocRawNN(tls, _1_db, uint64((u32(48)*uint32(_pWC.X4))*uint32(i32(2)))))
if (*XWhereTerm)(_pWC.X5) != nil {
goto _1
}
if (int32(_wtFlags) & i32(1)) != 0 {
_sqlite3ExprDelete(tls, _1_db, _p)
}
*(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWC.X5))))) = _1_pOld
return i32(0)
_1:
crt.Xmemcpy(tls, _pWC.X5, (unsafe.Pointer)(_1_pOld), u32(48)*uint32(_pWC.X3))
if _1_pOld != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6))))) {
_sqlite3DbFree(tls, _1_db, (unsafe.Pointer)(_1_pOld))
}
*(*int32)(unsafe.Pointer(&(_pWC.X4))) = int32(uint32(_sqlite3DbMallocSize(tls, _1_db, _pWC.X5)) / u32(48))
_0:
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(store1(&_idx, postInc1((*int32)(unsafe.Pointer(&(_pWC.X3))), int32(1))))))
if (_p != nil) && (((_p.X2) & uint32(i32(262144))) != uint32(i32(0))) {
*(*int16)(unsafe.Pointer(&(_pTerm.X2))) = int16(int32(_sqlite3LogEst(tls, uint64(_p.X8))) - i32(270))
goto _6
}
*(*int16)(unsafe.Pointer(&(_pTerm.X2))) = int16(i32(1))
_6:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTerm.X0))))) = _sqlite3ExprSkipCollate(tls, _p)
*(*uint16)(unsafe.Pointer(&(_pTerm.X3))) = _wtFlags
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTerm.X1))))) = _pWC
*(*int32)(unsafe.Pointer(&(_pTerm.X7))) = i32(-1)
crt.Xmemset(tls, (unsafe.Pointer)((*uint16)(unsafe.Pointer(&(_pTerm.X4)))), i32(0), u32(36))
return _idx
}
// Walk an expression tree. Return non-zero if the expression is constant
// that does no originate from the ON or USING clauses of a join.
// Return 0 if it involves variables or function calls or terms from
// an ON or USING clause.
func _sqlite3ExprIsConstantNotJoin(tls *crt.TLS, _p *XExpr) (r0 int32) {
return _exprIsConst(tls, _p, i32(2), i32(0))
}
// 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 _sqlite3ExprIfFalse(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
var _op, _regFree1, _regFree2, _r1, _r2, _3_d2, _10_destIfNull int32
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
_op = i32(0)
_regFree1 = i32(0)
_regFree2 = i32(0)
func() {
if _jumpIfNull != i32(16) && _jumpIfNull != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95403), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101380)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if _v == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
if _pExpr == nil {
return
}
_op = ((int32(_pExpr.X0) + i32(1)) ^ i32(1)) - i32(1)
func() {
if int32(_pExpr.X0) == i32(75) && _op != i32(76) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95429), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101427)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(76) && _op != i32(75) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95430), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101466)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(77) && _op != i32(78) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101505)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(78) && _op != i32(77) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95432), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101535)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(81) && _op != i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95433), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101565)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(80) && _op != i32(79) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95434), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(79) && _op != i32(80) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95435), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101625)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(82) && _op != i32(81) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95436), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfFalseØ00__func__Ø000))), unsafe.Pointer(str(101655)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_pExpr.X0) {
case i32(19):
goto _34
case i32(70):
goto _33
case i32(71):
goto _32
case i32(72):
goto _35
case i32(73):
goto _45
case i32(74):
goto _46
case i32(75):
goto _43
case i32(76):
goto _43
case i32(77):
goto _37
case i32(78):
goto _37
case i32(79):
goto _37
case i32(80):
goto _37
case i32(81):
goto _37
case i32(82):
goto _37
case i32(148):
goto _35
default:
goto _47
}
_32:
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.X4), _dest, _jumpIfNull)
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.X5), _dest, _jumpIfNull)
_sqlite3ExprCachePop(tls, _pParse)
goto _48
_33:
_3_d2 = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.X4), _3_d2, _jumpIfNull^i32(16))
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.X5), _dest, _jumpIfNull)
_sqlite3VdbeResolveLabel(tls, _v, _3_d2)
_sqlite3ExprCachePop(tls, _pParse)
goto _48
_34:
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.X4), _dest, _jumpIfNull)
goto _48
_35:
_op = func() int32 {
if int32(_pExpr.X0) == i32(72) {
return i32(77)
}
return i32(78)
}()
_jumpIfNull = i32(128)
_37:
if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.X4)) != 0 {
goto _default_expr
}
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X5), &_regFree2)
_codeCompare(tls, _pParse, (*XExpr)(_pExpr.X4), (*XExpr)(_pExpr.X5), _op, _r1, _r2, _dest, _jumpIfNull)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
goto _48
_43:
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
goto _48
_45:
_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfFalse, _jumpIfNull)
goto _48
_46:
if _jumpIfNull != 0 {
_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _dest)
goto _53
}
_10_destIfNull = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _dest, _10_destIfNull)
_sqlite3VdbeResolveLabel(tls, _v, _10_destIfNull)
_53:
goto _48
_47:
_default_expr:
if _exprAlwaysFalse(tls, _pExpr) != 0 {
_sqlite3VdbeGoto(tls, _v, _dest)
goto _57
}
if _exprAlwaysTrue(tls, _pExpr) != 0 {
goto _57
}
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
_sqlite3VdbeAddOp3(tls, _v, i32(22), _r1, _dest, bool2int(_jumpIfNull != i32(0)))
_57:
goto _48
_48:
_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
}
var _sqlite3ExprIfFalseØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprIfFalseØ00__func__Ø000[0], str(101685), 19)
}
// Remove from the column cache any entries that were added since the
// the previous sqlite3ExprCachePush operation. In other words, restore
// the cache to the state it was in prior the most recent Push.
func _sqlite3ExprCachePop(tls *crt.TLS, _pParse *XParse) {
var _i int32
_i = i32(0)
func() {
if (_pParse.X23) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94086), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCachePopØ00__func__Ø000))), unsafe.Pointer(str(101704)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pParse.X23))) -= 1
if (((*Xsqlite3)(_pParse.X0).X6) & i32(4096)) != 0 {
crt.Xprintf(tls, str(101727), _pParse.X23)
}
_2:
if _i >= int32(_pParse.X13) {
goto _4
}
if ((*TyColCache)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]TyColCache)(unsafe.Pointer(&(_pParse.X48))))) + 20*uintptr(_i))).X3) > (_pParse.X23) {
_cacheEntryClear(tls, _pParse, _i)
goto _6
}
_i += 1
_6:
goto _2
_4:
}
var _sqlite3ExprCachePopØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCachePopØ00__func__Ø000[0], str(101739), 20)
}
// 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 _sqlite3ExprIfTrue(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
var _op, _regFree1, _regFree2, _r1, _r2, _2_d2, _8_destIfFalse, _8_destIfNull int32
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
_op = i32(0)
_regFree1 = i32(0)
_regFree2 = i32(0)
func() {
if _jumpIfNull != i32(16) && _jumpIfNull != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95280), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000))), unsafe.Pointer(str(101380)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if _v == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95281), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
if func() int32 {
if _pExpr == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95282), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIfTrueØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
_op = int32(_pExpr.X0)
switch _op {
case i32(19):
goto _12
case i32(70):
goto _11
case i32(71):
goto _10
case i32(72):
goto _13
case i32(73):
goto _23
case i32(74):
goto _24
case i32(75):
goto _21
case i32(76):
goto _21
case i32(77):
goto _15
case i32(78):
goto _15
case i32(79):
goto _15
case i32(80):
goto _15
case i32(81):
goto _15
case i32(82):
goto _15
case i32(148):
goto _13
default:
goto _25
}
_10:
_2_d2 = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.X4), _2_d2, _jumpIfNull^i32(16))
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.X5), _dest, _jumpIfNull)
_sqlite3VdbeResolveLabel(tls, _v, _2_d2)
_sqlite3ExprCachePop(tls, _pParse)
goto _26
_11:
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.X4), _dest, _jumpIfNull)
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)(_pExpr.X5), _dest, _jumpIfNull)
_sqlite3ExprCachePop(tls, _pParse)
goto _26
_12:
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pExpr.X4), _dest, _jumpIfNull)
goto _26
_13:
_op = func() int32 {
if _op == i32(72) {
return i32(78)
}
return i32(77)
}()
_jumpIfNull = i32(128)
_15:
if _sqlite3ExprIsVector(tls, (*XExpr)(_pExpr.X4)) != 0 {
goto _default_expr
}
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X5), &_regFree2)
_codeCompare(tls, _pParse, (*XExpr)(_pExpr.X4), (*XExpr)(_pExpr.X5), _op, _r1, _r2, _dest, _jumpIfNull)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
goto _26
_21:
i32(0)
i32(0)
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_pExpr.X4), &_regFree1)
_sqlite3VdbeAddOp2(tls, _v, _op, _r1, _dest)
goto _26
_23:
_exprCodeBetween(tls, _pParse, _pExpr, _dest, _sqlite3ExprIfTrue, _jumpIfNull)
goto _26
_24:
_8_destIfFalse = _sqlite3VdbeMakeLabel(tls, _v)
_8_destIfNull = func() int32 {
if _jumpIfNull != 0 {
return _dest
}
return _8_destIfFalse
}()
_sqlite3ExprCodeIN(tls, _pParse, _pExpr, _8_destIfFalse, _8_destIfNull)
_sqlite3VdbeGoto(tls, _v, _dest)
_sqlite3VdbeResolveLabel(tls, _v, _8_destIfFalse)
goto _26
_25:
_default_expr:
if _exprAlwaysTrue(tls, _pExpr) != 0 {
_sqlite3VdbeGoto(tls, _v, _dest)
goto _35
}
if _exprAlwaysFalse(tls, _pExpr) != 0 {
goto _35
}
_r1 = _sqlite3ExprCodeTemp(tls, _pParse, _pExpr, &_regFree1)
_sqlite3VdbeAddOp3(tls, _v, i32(21), _r1, _dest, bool2int(_jumpIfNull != i32(0)))
_35:
goto _26
_26:
_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
_sqlite3ReleaseTempReg(tls, _pParse, _regFree2)
}
var _sqlite3ExprIfTrueØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprIfTrueØ00__func__Ø000[0], str(101759), 18)
}
// 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 _sqlite3ExprCodeTemp(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pReg *int32) (r0 int32) {
var _r2, _2_r1 int32
_pExpr = _sqlite3ExprSkipCollate(tls, _pExpr)
if (((_pParse.X11) != 0) && (int32(_pExpr.X0) != i32(157))) && _sqlite3ExprIsConstantNotJoin(tls, _pExpr) != 0 {
*_pReg = i32(0)
_r2 = _sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, i32(-1))
goto _3
}
_2_r1 = _sqlite3GetTempReg(tls, _pParse)
_r2 = _sqlite3ExprCodeTarget(tls, _pParse, _pExpr, _2_r1)
if _r2 == _2_r1 {
*_pReg = _2_r1
goto _5
}
_sqlite3ReleaseTempReg(tls, _pParse, _2_r1)
*_pReg = i32(0)
_5:
_3:
return _r2
}
// Generate code for a comparison operator.
func _codeCompare(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr, _opcode int32, _in1 int32, _in2 int32, _dest int32, _jumpIfNull int32) (r0 int32) {
var _p5, _addr int32
var _p4 *XCollSeq
_p4 = _sqlite3BinaryCompareCollSeq(tls, _pParse, _pLeft, _pRight)
_p5 = int32(_binaryCompareP5(tls, _pLeft, _pRight, _jumpIfNull))
_addr = _sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.X2), _opcode, _in2, _dest, _in1, (*int8)((unsafe.Pointer)(_p4)), i32(-3))
_sqlite3VdbeChangeP5(tls, (*TVdbe)(_pParse.X2), uint16(uint8(_p5)))
return _addr
}
// 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 _sqlite3BinaryCompareCollSeq(tls *crt.TLS, _pParse *XParse, _pLeft *XExpr, _pRight *XExpr) (r0 *XCollSeq) {
var _pColl *XCollSeq
func() {
if _pLeft == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91184), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BinaryCompareCollSeqØ00__func__Ø000))), unsafe.Pointer(str(42746)))
crt.X__builtin_abort(tls)
}
}()
if ((_pLeft.X2) & uint32(i32(256))) != 0 {
_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
goto _6
}
if (_pRight != nil) && (((_pRight.X2) & uint32(i32(256))) != uint32(i32(0))) {
_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
goto _6
}
_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pLeft)
if _pColl == nil {
_pColl = _sqlite3ExprCollSeq(tls, _pParse, _pRight)
}
_6:
return _pColl
}
var _sqlite3BinaryCompareCollSeqØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BinaryCompareCollSeqØ00__func__Ø000[0], str(101777), 28)
}
// Return the P5 value that should be used for a binary comparison
// opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2.
func _binaryCompareP5(tls *crt.TLS, _pExpr1 *XExpr, _pExpr2 *XExpr, _jumpIfNull int32) (r0 uint8) {
var _aff uint8
_aff = uint8(_sqlite3ExprAffinity(tls, _pExpr2))
_aff = uint8(int32(uint8(_sqlite3CompareAffinity(tls, _pExpr1, int8(_aff)))) | int32(uint8(_jumpIfNull)))
return _aff
}
// Generate code for a BETWEEN operator.
//
// x BETWEEN y AND z
//
// The above is equivalent to
//
// x>=y AND x<=z
//
// Code it as such, taking care to do the common subexpression
// elimination of x.
//
// The xJumpIf parameter determines details:
//
// NULL: Store the boolean result in reg[dest]
// sqlite3ExprIfTrue: Jump to dest if true
// sqlite3ExprIfFalse: Jump to dest if false
//
// The jumpIfNull parameter is ignored if xJumpIf is NULL.
func _exprCodeBetween(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _xJump func(*crt.TLS, *XParse, *XExpr, int32, int32), _jumpIfNull int32) {
var _regFree1 int32
var _exprAnd, _compLeft, _compRight, _exprX XExpr
_regFree1 = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_compLeft), i32(0), u32(48))
crt.Xmemset(tls, (unsafe.Pointer)(&_compRight), i32(0), u32(48))
crt.Xmemset(tls, (unsafe.Pointer)(&_exprAnd), i32(0), u32(48))
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95222), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprCodeBetweenØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
_exprX = *(*XExpr)(_pExpr.X4)
*(*uint8)(unsafe.Pointer(&(_exprAnd.X0))) = uint8(i32(71))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_exprAnd.X4))))) = &_compLeft
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_exprAnd.X5))))) = &_compRight
*(*uint8)(unsafe.Pointer(&(_compLeft.X0))) = uint8(i32(82))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compLeft.X4))))) = &_exprX
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compLeft.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(0)))).X0)
*(*uint8)(unsafe.Pointer(&(_compRight.X0))) = uint8(i32(80))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compRight.X4))))) = &_exprX
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_compRight.X5))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(1)))).X0)
_exprToRegister(tls, &_exprX, _exprCodeVector(tls, _pParse, &_exprX, &_regFree1))
if _xJump != nil {
_xJump(tls, _pParse, &_exprAnd, _dest, _jumpIfNull)
goto _3
}
{
p := (*uint32)(unsafe.Pointer(&(_exprX.X2)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
_sqlite3ExprCodeTarget(tls, _pParse, &_exprAnd, _dest)
_3:
_sqlite3ReleaseTempReg(tls, _pParse, _regFree1)
_ = _exprAnd
_ = _compLeft
_ = _compRight
_ = _exprX
}
var _exprCodeBetweenØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_exprCodeBetweenØ00__func__Ø000[0], str(101805), 16)
}
// Convert a scalar expression node to a TK_REGISTER referencing
// register iReg. The caller must ensure that iReg already contains
// the correct value for the expression.
func _exprToRegister(tls *crt.TLS, _p *XExpr, _iReg int32) {
*(*uint8)(unsafe.Pointer(&(_p.X12))) = _p.X0
*(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(i32(157))
*(*int32)(unsafe.Pointer(&(_p.X8))) = _iReg
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) & uint32(i32(-4097))
sink5 = *p
}
}
// Evaluate an expression (either a vector or a scalar expression) and store
// the result in continguous temporary registers. Return the index of
// the first register used to store the result.
//
// If the returned result register is a temporary scalar, then also write
// that register number into *piFreeable. If the returned result register
// is not a temporary or if the expression is a vector set *piFreeable
// to 0.
func _exprCodeVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _piFreeable *int32) (r0 int32) {
var _iResult, _nResult, _4_i int32
_nResult = _sqlite3ExprVectorSize(tls, _p)
if _nResult == i32(1) {
_iResult = _sqlite3ExprCodeTemp(tls, _pParse, _p, _piFreeable)
goto _1
}
*_piFreeable = i32(0)
if int32(_p.X0) == i32(119) {
_iResult = _sqlite3CodeSubselect(tls, _pParse, _p, i32(0), i32(0))
goto _3
}
_iResult = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nResult
sink1 = *p
}
_4_i = i32(0)
_4:
if _4_i >= _nResult {
goto _7
}
_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))).X2)))))+20*uintptr(_4_i))).X0), _4_i+_iResult)
_4_i += 1
goto _4
_7:
_3:
_1:
return _iResult
}
// 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 _sqlite3ExprCodeFactorable(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
if ((_pParse.X11) != 0) && _sqlite3ExprIsConstant(tls, _pExpr) != 0 {
_sqlite3ExprCodeAtInit(tls, _pParse, _pExpr, _target)
goto _2
}
_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
_2:
}
// Generate code for an IN expression.
//
// x IN (SELECT ...)
// x IN (value, value, ...)
//
// The left-hand side (LHS) is a scalar or vector expression. The
// right-hand side (RHS) is an array of zero or more scalar values, or a
// subquery. If the RHS is a subquery, the number of result columns must
// match the number of columns in the vector on the LHS. If the RHS is
// a list of values, the LHS must be a scalar.
//
// The IN operator is true if the LHS value is contained within the RHS.
// The result is false if the LHS is definitely not in the RHS. The
// result is NULL if the presence of the LHS in the RHS cannot be
// determined due to NULLs.
//
// This routine generates code that jumps to destIfFalse if the LHS is not
// contained within the RHS. If due to NULLs we cannot determine if the LHS
// is contained in the RHS then jump to destIfNull. If the LHS is contained
// within the RHS then fall through.
//
// See the separate in-operator.md documentation file in the canonical
// SQLite source tree for additional information.
func _sqlite3ExprCodeIN(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _destIfFalse int32, _destIfNull int32) {
var _rRhsHasNull, _eType, _rLhs, _rLhsOrig, _nVector, _iDummy, _i, _destStep2, _destStep6, _addrTruthOp, _destNotNull, _addrTop, _1_j, _1_cnt, _6_labelOk, _6_r2, _6_regToFree, _6_regCkNull, _6_ii, _23_r3 int32
var _aiMap *int32
var _zAff *int8
var _v *TVdbe
var _6_pList *XExprList
var _pLeft, _15_p, _23_p *XExpr
var _6_pColl, _23_pColl *XCollSeq
_rRhsHasNull = i32(0)
_aiMap = nil
_zAff = nil
_destStep6 = i32(0)
_pLeft = (*XExpr)(_pExpr.X4)
if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
return
}
_zAff = _exprINAffinity(tls, _pParse, _pExpr)
_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4))
_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64((uint32(_nVector)*u32(5))+uint32(i32(1)))))
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
goto _sqlite3ExprCodeIN_oom_error
}
_v = (*TVdbe)(_pParse.X2)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93723), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeNoopComment(tls, _v, str(101821))
_eType = _sqlite3FindInIndex(tls, _pParse, _pExpr, uint32(i32(3)), func() *int32 {
if _destIfFalse == _destIfNull {
return nil
}
return &_rRhsHasNull
}(), _aiMap)
func() {
if (_pParse.X16) == 0 && _nVector != i32(1) && _eType != i32(2) && _eType != i32(3) && _eType != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93729), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(101835)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_12:
if _i >= _nVector {
goto _15
}
_1_cnt = store1(&_1_j, i32(0))
_16:
if _1_j >= _nVector {
goto _19
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_1_j)))) == _i {
_1_cnt += 1
}
_1_j += 1
goto _16
_19:
func() {
if _1_cnt != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93738), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(101944)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _12
_15:
_sqlite3ExprCachePush(tls, _pParse)
_rLhsOrig = _exprCodeVector(tls, _pParse, _pLeft, &_iDummy)
_i = i32(0)
_23:
if _i >= _nVector || (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_i)))) != _i {
goto _27
}
_i += 1
goto _23
_27:
if _i == _nVector {
_rLhs = _rLhsOrig
goto _29
}
_rLhs = _sqlite3GetTempRange(tls, _pParse, _nVector)
_i = i32(0)
_30:
if _i >= _nVector {
goto _33
}
_sqlite3VdbeAddOp3(tls, _v, i32(64), _rLhsOrig+_i, _rLhs+(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_i)))), i32(0))
_i += 1
goto _30
_33:
_29:
if _eType != i32(5) {
goto _34
}
_6_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_6_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4))
_6_labelOk = _sqlite3VdbeMakeLabel(tls, _v)
_6_regCkNull = i32(0)
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
if _destIfNull != _destIfFalse {
_6_regCkNull = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(84), _rLhs, _rLhs, _6_regCkNull)
}
_6_ii = i32(0)
_38:
if _6_ii >= (_6_pList.X0) {
goto _41
}
_6_r2 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pList.X2)))))+20*uintptr(_6_ii))).X0), &_6_regToFree)
if _6_regCkNull != 0 && _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_6_pList.X2)))))+20*uintptr(_6_ii))).X0)) != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(84), _6_regCkNull, _6_r2, _6_regCkNull)
}
if (_6_ii < ((_6_pList.X0) - i32(1))) || (_destIfNull != _destIfFalse) {
_sqlite3VdbeAddOp4(tls, _v, i32(78), _rLhs, _6_labelOk, _6_r2, (*int8)((unsafe.Pointer)(_6_pColl)), i32(-3))
_sqlite3VdbeChangeP5(tls, _v, uint16(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0))))))
goto _46
}
func() {
if _destIfNull != _destIfFalse {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93795), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeINØ00__func__Ø000))), unsafe.Pointer(str(101951)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs, _destIfFalse, _6_r2, (*int8)((unsafe.Pointer)(_6_pColl)), i32(-3))
_sqlite3VdbeChangeP5(tls, _v, uint16(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0)))))|i32(16)))
_46:
_sqlite3ReleaseTempReg(tls, _pParse, _6_regToFree)
_6_ii += 1
goto _38
_41:
if _6_regCkNull != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(75), _6_regCkNull, _destIfNull)
_sqlite3VdbeGoto(tls, _v, _destIfFalse)
}
_sqlite3VdbeResolveLabel(tls, _v, _6_labelOk)
_sqlite3ReleaseTempReg(tls, _pParse, _6_regCkNull)
goto _sqlite3ExprCodeIN_finished
_34:
if _destIfNull == _destIfFalse {
_destStep2 = _destIfFalse
goto _51
}
_destStep2 = store1(&_destStep6, _sqlite3VdbeMakeLabel(tls, _v))
_51:
_i = i32(0)
_52:
if _i >= _nVector {
goto _55
}
_15_p = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pExpr.X4), _i)
if _sqlite3ExprCanBeNull(tls, _15_p) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(75), _rLhs+_i, _destStep2)
}
_i += 1
goto _52
_55:
if _eType == i32(1) {
_sqlite3VdbeAddOp3(tls, _v, i32(31), _pExpr.X8, _destIfFalse, _rLhs)
_addrTruthOp = _sqlite3VdbeAddOp0(tls, _v, i32(13))
goto _58
}
_sqlite3VdbeAddOp4(tls, _v, i32(100), _rLhs, _nVector, i32(0), _zAff, _nVector)
if _destIfFalse == _destIfNull {
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _pExpr.X8, _destIfFalse, _rLhs, _nVector)
goto _sqlite3ExprCodeIN_finished
}
_addrTruthOp = _sqlite3VdbeAddOp4Int(tls, _v, i32(30), _pExpr.X8, i32(0), _rLhs, _nVector)
_58:
if _rRhsHasNull != 0 && (_nVector == i32(1)) {
_sqlite3VdbeAddOp2(tls, _v, i32(76), _rRhsHasNull, _destIfFalse)
}
if _destIfFalse == _destIfNull {
_sqlite3VdbeGoto(tls, _v, _destIfFalse)
}
if _destStep6 != 0 {
_sqlite3VdbeResolveLabel(tls, _v, _destStep6)
}
_addrTop = _sqlite3VdbeAddOp2(tls, _v, i32(37), _pExpr.X8, _destIfFalse)
if _nVector > i32(1) {
_destNotNull = _sqlite3VdbeMakeLabel(tls, _v)
goto _65
}
_destNotNull = _destIfFalse
_65:
_i = i32(0)
_66:
if _i >= _nVector {
goto _69
}
_23_r3 = _sqlite3GetTempReg(tls, _pParse)
_23_p = _sqlite3VectorFieldSubexpr(tls, _pLeft, _i)
_23_pColl = _sqlite3ExprCollSeq(tls, _pParse, _23_p)
_sqlite3VdbeAddOp3(tls, _v, i32(99), _pExpr.X8, _i, _23_r3)
_sqlite3VdbeAddOp4(tls, _v, i32(77), _rLhs+_i, _destNotNull, _23_r3, (*int8)((unsafe.Pointer)(_23_pColl)), i32(-3))
_sqlite3ReleaseTempReg(tls, _pParse, _23_r3)
_i += 1
goto _66
_69:
_sqlite3VdbeAddOp2(tls, _v, i32(13), i32(0), _destIfNull)
if _nVector > i32(1) {
_sqlite3VdbeResolveLabel(tls, _v, _destNotNull)
_sqlite3VdbeAddOp2(tls, _v, i32(7), _pExpr.X8, _addrTop+i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(13), i32(0), _destIfFalse)
}
_sqlite3VdbeJumpHere(tls, _v, _addrTruthOp)
_sqlite3ExprCodeIN_finished:
if _rLhs != _rLhsOrig {
_sqlite3ReleaseTempReg(tls, _pParse, _rLhs)
}
_sqlite3ExprCachePop(tls, _pParse)
_sqlite3VdbeComment(tls, _v, str(101975))
_sqlite3ExprCodeIN_oom_error:
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_aiMap))
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zAff))
_ = _iDummy
}
// 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 _sqlite3ExprCheckIN(tls *crt.TLS, _pParse *XParse, _pIn *XExpr) (r0 int32) {
var _nVector int32
_nVector = _sqlite3ExprVectorSize(tls, (*XExpr)(_pIn.X4))
if ((_pIn.X2) & uint32(i32(2048))) == 0 {
goto _0
}
if _nVector != ((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pIn.X6)))))).X0).X0) {
_sqlite3SubselectError(tls, _pParse, (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pIn.X6)))))).X0).X0, _nVector)
return i32(1)
}
goto _3
_0:
if _nVector != i32(1) {
_sqlite3VectorErrorMsg(tls, _pParse, (*XExpr)(_pIn.X4))
return i32(1)
}
_3:
return i32(0)
}
var _sqlite3ExprCodeINØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeINØ00__func__Ø000[0], str(101987), 18)
}
func _sqlite3FindInIndex(tls *crt.TLS, _pParse *XParse, _pX *XExpr, _inFlags uint32, _prRhsHasNull *int32, _aiMap *int32) (r0 int32) {
var _4_iDb int16
var _eType, _iTab, _mustBeUnique, _1_i, _4_nExpr, _5_iAddr, _6_affinity_ok, _6_i, _7_iCol, _13_j, _16_iAddr, _20_rMayHaveNull, _25_i, _25_n int32
var _7_idxaff, _7_cmpaff int8
var _20_savedNQueryLoop uint32
var _10_colUsed, _10_mCol uint64
var _4_db *Xsqlite3
var _4_pTab *XTable
var _v *TVdbe
var _1_pEList, _4_pEList *XExprList
var _p *XSelect
var _7_pLhs, _13_pLhs, _13_pRhs *XExpr
var _6_pIdx *XIndex
var _13_pReq *XCollSeq
_eType = i32(0)
_iTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if int32(_pX.X0) != i32(74) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93103), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102005)))
crt.X__builtin_abort(tls)
}
}()
_mustBeUnique = bool2int((_inFlags & uint32(i32(4))) != uint32(i32(0)))
if _prRhsHasNull == nil || ((_pX.X2)&uint32(i32(2048))) == 0 {
goto _3
}
_1_pEList = (*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))).X0)
_1_i = i32(0)
_4:
if _1_i >= (_1_pEList.X0) {
goto _7
}
if _sqlite3ExprCanBeNull(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_1_pEList.X2)))))+20*uintptr(_1_i))).X0)) != 0 {
goto _7
}
_1_i += 1
goto _4
_7:
if _1_i == (_1_pEList.X0) {
_prRhsHasNull = nil
}
_3:
if (_pParse.X16) != i32(0) || store59(&_p, _isCandidateForInOpt(tls, _pX)) == nil {
goto _11
}
_4_db = (*Xsqlite3)(_pParse.X0)
_4_pEList = (*XExprList)(_p.X0)
_4_nExpr = _4_pEList.X0
func() {
if (*XExprList)(_p.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93132), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(46087)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))+20*uintptr(i32(0)))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93133), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102019)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSrcList)(_p.X8) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93134), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102044)))
crt.X__builtin_abort(tls)
}
}()
_4_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(i32(0)))).X4)
_4_iDb = int16(_sqlite3SchemaToIndex(tls, _4_db, (*XSchema)(_4_pTab.X20)))
_sqlite3CodeVerifySchema(tls, _pParse, int32(_4_iDb))
_sqlite3TableLock(tls, _pParse, int32(_4_iDb), _4_pTab.X7, uint8(i32(0)), _4_pTab.X0)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93142), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
if (_4_nExpr == i32(1)) && (int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2)))))+20*uintptr(i32(0)))).X0).X9) < i32(0)) {
_5_iAddr = _sqlite3VdbeAddOp0(tls, _v, i32(20))
_sqlite3OpenTable(tls, _pParse, _iTab, int32(_4_iDb), _4_pTab, i32(106))
_eType = i32(1)
_sqlite3VdbeJumpHere(tls, _v, _5_iAddr)
goto _22
}
_6_affinity_ok = i32(1)
_6_i = i32(0)
_23:
if _6_i >= _4_nExpr || _6_affinity_ok == 0 {
goto _27
}
_7_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.X4), _6_i)
_7_iCol = int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2))))) + 20*uintptr(_6_i))).X0).X9)
_7_idxaff = _sqlite3TableColumnAffinity(tls, _4_pTab, _7_iCol)
_7_cmpaff = _sqlite3CompareAffinity(tls, _7_pLhs, _7_idxaff)
switch int32(_7_cmpaff) {
case i32(65):
goto _29
case i32(66):
goto _30
default:
goto _31
}
_29:
goto _32
_30:
func() {
if int32(_7_idxaff) != i32(66) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93176), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102055)))
crt.X__builtin_abort(tls)
}
}()
goto _32
_31:
_6_affinity_ok = bool2int(int32(_7_idxaff) >= i32(67))
_32:
_6_i += 1
goto _23
_27:
if _6_affinity_ok == 0 {
goto _35
}
_6_pIdx = (*XIndex)(_4_pTab.X2)
_36:
if _6_pIdx == nil || _eType != i32(0) {
goto _40
}
if int32(_6_pIdx.X14) < _4_nExpr {
goto _37
}
if int32(_6_pIdx.X14) >= i32(63) {
goto _37
}
if _mustBeUnique == 0 {
goto _43
}
if (int32(_6_pIdx.X13) > _4_nExpr) || ((int32(_6_pIdx.X14) > _4_nExpr) && (int32(_6_pIdx.X15) == i32(0))) {
goto _37
}
_43:
_10_colUsed = uint64(i32(0))
_6_i = i32(0)
_47:
if _6_i >= _4_nExpr {
goto _50
}
_13_pLhs = _sqlite3VectorFieldSubexpr(tls, (*XExpr)(_pX.X4), _6_i)
_13_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_4_pEList.X2))))) + 20*uintptr(_6_i))).X0)
_13_pReq = _sqlite3BinaryCompareCollSeq(tls, _pParse, _13_pLhs, _13_pRhs)
func() {
if _13_pReq == nil && int32(_13_pRhs.X9) != i32(-1) && (_pParse.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93209), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102079)))
crt.X__builtin_abort(tls)
}
}()
_13_j = i32(0)
_55:
if _13_j >= _4_nExpr {
goto _58
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X1)) + 2*uintptr(_13_j)))) != int32(_13_pRhs.X9) {
goto _56
}
func() {
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X8)) + 4*uintptr(_13_j)))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(93212), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FindInIndexØ00__func__Ø000))), unsafe.Pointer(str(102130)))
crt.X__builtin_abort(tls)
}
}()
if (_13_pReq != nil) && (_sqlite3StrICmp(tls, _13_pReq.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_pIdx.X8)) + 4*uintptr(_13_j)))) != i32(0)) {
goto _56
}
goto _58
_56:
_13_j += 1
goto _55
_58:
if _13_j == _4_nExpr {
goto _50
}
_10_mCol = u64(1) << uint(_13_j)
if (_10_mCol & _10_colUsed) != 0 {
goto _50
}
{
p := &_10_colUsed
*p = (*p) | _10_mCol
sink17 = *p
}
if _aiMap != nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_6_i))) = _13_j
}
_6_i += 1
goto _47
_50:
func() {
if _6_i != _4_nExpr && _10_colUsed == ((u64(1)<= _25_n {
goto _91
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiMap)) + 4*uintptr(_25_i))) = _25_i
_25_i += 1
goto _88
_91:
_87:
return _eType
}
var _sqlite3FindInIndexØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FindInIndexØ00__func__Ø000[0], str(102217), 19)
}
// 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 _sqlite3ExprCanBeNull(tls *crt.TLS, _p *XExpr) (r0 int32) {
var _op uint8
_0:
if (int32(_p.X0) == i32(156)) || (int32(_p.X0) == i32(155)) {
_p = (*XExpr)(_p.X4)
goto _0
}
_op = _p.X0
if int32(_op) == i32(157) {
_op = _p.X12
}
switch int32(_op) {
case i32(97):
goto _5
case i32(132):
goto _5
case i32(133):
goto _5
case i32(134):
goto _5
case i32(152):
goto _9
default:
goto _10
}
_5:
return i32(0)
_9:
func() {
if (*XTable)(_p.X14) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92867), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCanBeNullØ00__func__Ø000))), unsafe.Pointer(str(102236)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((((_p.X2) & uint32(i32(1048576))) != uint32(i32(0))) || ((int32(_p.X9) >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_p.X14).X1)+16*uintptr(_p.X9))).X3) == i32(0))))
_10:
return i32(1)
}
var _sqlite3ExprCanBeNullØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCanBeNullØ00__func__Ø000[0], str(102247), 21)
}
func _isCandidateForInOpt(tls *crt.TLS, _pX *XExpr) (r0 *XSelect) {
var _i int32
var _pTab *XTable
var _pSrc *XSrcList
var _pEList *XExprList
var _p *XSelect
var _2_pRes *XExpr
if ((_pX.X2) & uint32(i32(2048))) == uint32(i32(0)) {
return nil
}
if ((_pX.X2) & uint32(i32(32))) != uint32(i32(0)) {
return nil
}
_p = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6))))))
if (*XSelect)(_p.X13) != nil {
return nil
}
if ((_p.X3) & uint32(i32(9))) != 0 {
return nil
}
func() {
if (*XExprList)(_p.X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92948), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(46719)))
crt.X__builtin_abort(tls)
}
}()
if (*XExpr)(_p.X15) != nil {
return nil
}
func() {
if (*XExpr)(_p.X16) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92950), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(98541)))
crt.X__builtin_abort(tls)
}
}()
if (*XExpr)(_p.X9) != nil {
return nil
}
_pSrc = (*XSrcList)(_p.X8)
func() {
if _pSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92953), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(47821)))
crt.X__builtin_abort(tls)
}
}()
if (_pSrc.X0) != i32(1) {
return nil
}
if (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(i32(0)))).X5) != nil {
return nil
}
_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(i32(0)))).X4)
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92957), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_pTab.X3) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92958), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(102268)))
crt.X__builtin_abort(tls)
}
}()
if (_pTab.X16) != 0 {
return nil
}
_pEList = (*XExprList)(_p.X0)
func() {
if _pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92961), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_21:
if _i >= (_pEList.X0) {
goto _24
}
_2_pRes = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2))))) + 20*uintptr(_i))).X0)
if int32(_2_pRes.X0) != i32(152) {
return nil
}
func() {
if (_2_pRes.X8) != ((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(i32(0)))).X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92966), unsafe.Pointer((*int8)(unsafe.Pointer(&_isCandidateForInOptØ00__func__Ø000))), unsafe.Pointer(str(102285)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _21
_24:
return _p
}
var _isCandidateForInOptØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_isCandidateForInOptØ00__func__Ø000[0], str(102318), 20)
}
// 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 _sqlite3CodeVerifySchema(tls *crt.TLS, _pParse *XParse, _iDb int32) {
var _pToplevel *XParse
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
func() {
if _iDb < i32(0) || _iDb >= ((*Xsqlite3)(_pParse.X0).X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103756), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000))), unsafe.Pointer(str(102338)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+16*uintptr(_iDb))).X1) == nil && _iDb != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103757), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000))), unsafe.Pointer(str(102368)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iDb >= i32(12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103758), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000))), unsafe.Pointer(str(102406)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.X0), _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103759), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeVerifySchemaØ00__func__Ø000))), unsafe.Pointer(str(102432)))
crt.X__builtin_abort(tls)
}
}()
if bool2int(((_pToplevel.X30)&(u32(1)<ix[]
// array will never overflow.
func _createMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) {
func() {
if (_pMaskSet.X0) >= i32(64) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130573), unsafe.Pointer((*int8)(unsafe.Pointer(&_createMaskØ00__func__Ø000))), unsafe.Pointer(str(102690)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&(_pMaskSet.X1))))) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pMaskSet.X0))), int32(1))))) = _iCursor
}
var _createMaskØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_createMaskØ00__func__Ø000[0], str(102728), 11)
}
// For table-valued-functions, transform the function arguments into
// new WHERE clause terms.
//
// Each function argument translates into an equality constraint against
// a HIDDEN column in the table.
func _sqlite3WhereTabFuncArgs(tls *crt.TLS, _pParse *XParse, _pItem *TSrcList_item, _pWC *XWhereClause) {
var _j, _k int32
var _pTab *XTable
var _pArgs *XExprList
var _pColRef, _pTerm *XExpr
if int32((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(2)))<>uint(i32(31))) == i32(0) {
return
}
_pTab = (*XTable)(_pItem.X4)
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130367), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereTabFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
_pArgs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_pItem.X15))))))
if _pArgs == nil {
return
}
_j = store1(&_k, i32(0))
_4:
if _j >= (_pArgs.X0) {
goto _7
}
_8:
if (_k < int32(_pTab.X11)) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_k))).X6) & i32(2)) == i32(0)) {
_k += 1
goto _8
}
if _k >= int32(_pTab.X11) {
_sqlite3ErrorMsg(tls, _pParse, str(102739), unsafe.Pointer(_pTab.X0), _j)
return
}
_pColRef = _sqlite3ExprAlloc(tls, (*Xsqlite3)(_pParse.X0), i32(152), nil, i32(0))
if _pColRef == nil {
return
}
*(*int32)(unsafe.Pointer(&(_pColRef.X8))) = _pItem.X11
*(*int16)(unsafe.Pointer(&(_pColRef.X9))) = int16(postInc1(&_k, int32(1)))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pColRef.X14))))) = _pTab
_pTerm = _sqlite3PExpr(tls, _pParse, i32(78), _pColRef, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pArgs.X2)))))+20*uintptr(_j))).X0), i32(0)))
_whereClauseInsert(tls, _pWC, _pTerm, uint16(i32(1)))
_j += 1
goto _4
_7:
}
var _sqlite3WhereTabFuncArgsØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereTabFuncArgsØ00__func__Ø000[0], str(102775), 24)
}
// Return the bitmask for the given cursor number. Return 0 if
// iCursor is not in the set.
func _sqlite3WhereGetMask(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _iCursor int32) (r0 uint64) {
var _i int32
func() {
if (_pMaskSet.X0) > i32(64) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130555), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereGetMaskØ00__func__Ø000))), unsafe.Pointer(str(102799)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= (_pMaskSet.X0) {
goto _5
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&(_pMaskSet.X1))))) + 4*uintptr(_i)))) == _iCursor {
return u64(1) << uint(_i)
}
_i += 1
goto _2
_5:
return uint64(i32(0))
}
var _sqlite3WhereGetMaskØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereGetMaskØ00__func__Ø000[0], str(102835), 20)
}
// Call exprAnalyze on all terms in a WHERE clause.
//
// Note that exprAnalyze() might add new virtual terms onto the
// end of the WHERE clause. We do not want to analyze these new
// virtual terms, so start analyzing at the end and work forward
// so that the added virtual terms are never processed.
func _sqlite3WhereExprAnalyze(tls *crt.TLS, _pTabList *XSrcList, _pWC *XWhereClause) {
var _i int32
_i = (_pWC.X3) - i32(1)
_0:
if _i < i32(0) {
goto _3
}
_exprAnalyze(tls, _pTabList, _pWC, _i)
_i -= 1
goto _0
_3:
}
// The input to this routine is an WhereTerm structure with only the
// "pExpr" field filled in. The job of this routine is to analyze the
// subexpression and populate all the other fields of the WhereTerm
// structure.
//
// If the expression is of the form " X" it gets commuted
// to the standard form of "X ".
//
// If the expression is of the form "X Y" where both X and Y are
// columns, then the original expression is unchanged and a new virtual
// term of the form "Y X" is added to the WHERE clause and
// analyzed separately. The original term is marked with TERM_COPIED
// and the new term is marked with TERM_DYNAMIC (because it's pExpr
// needs to be freed with the WhereClause) and TERM_VIRTUAL (because it
// is a commuted copy of a prior term.) The original term has nChild=1
// and the copy has idxParent set to the index of the original term.
func _exprAnalyze(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
var _isComplete, _noCase, _op, _nLeft, _13_idxNew, _17_i, _18_idxNew, _20_idxNew1, _20_idxNew2, _21_i, _26_idxNew, _28_i, _29_idxNew, _30_i, _31_idxNew int32
var _21_c int8
var _prereqLeft, _prereqAll, _extraRight, _7_x, _26_prereqColumn, _26_prereqExpr uint64
var _20_zCollSeqName *int8
var _9_opMask, _12_eExtraOp, _20_wtFlags uint16
var _eOp2, _23_c uint8
var _23_pC *uint8
var _db *Xsqlite3
var _17_pList *XExprList
var _9_aiCurCol [2]int32
var _pExpr, _pStr1, _9_pLeft, _9_pRight, _12_pDup, _18_pNewExpr, _20_pLeft, _20_pStr2, _20_pNewExpr1, _20_pNewExpr2, _26_pRight, _26_pLeft, _27_pNewExpr, _29_pNew, _29_pLeft, _29_pRight *XExpr
var _pParse *XParse
var _pWInfo *XWhereInfo
var _pTerm, _12_pNew, _26_pNewTerm *XWhereTerm
var _pMaskSet *XWhereMaskSet
_pWInfo = (*XWhereInfo)(_pWC.X0)
_extraRight = u64(0)
_pStr1 = nil
_isComplete = i32(0)
_noCase = i32(0)
_pParse = (*XParse)(_pWInfo.X0)
_db = (*Xsqlite3)(_pParse.X0)
if (_db.X17) != 0 {
return
}
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
_pMaskSet = (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23)))
_pExpr = (*XExpr)(_pTerm.X0)
func() {
if int32(_pExpr.X0) == i32(24) || int32(_pExpr.X0) == i32(94) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129865), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102855)))
crt.X__builtin_abort(tls)
}
}()
_prereqLeft = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.X4))
_op = int32(_pExpr.X0)
if _op != i32(74) {
goto _4
}
func() {
if (*XExpr)(_pExpr.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129869), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102897)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprCheckIN(tls, _pParse, _pExpr) != 0 {
return
}
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
*(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))))
goto _9
}
*(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))))
_9:
goto _12
_4:
if _op == i32(75) {
*(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = uint64(i32(0))
goto _12
}
*(*uint64)(unsafe.Pointer(&(_pTerm.X11))) = _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pExpr.X5))
_12:
_prereqAll = _sqlite3WhereExprUsage(tls, _pMaskSet, _pExpr)
if ((_pExpr.X2) & uint32(i32(1))) == uint32(i32(0)) {
goto _13
}
_7_x = _sqlite3WhereGetMask(tls, _pMaskSet, int32(_pExpr.X11))
{
p := &_prereqAll
*p = (*p) | _7_x
sink17 = *p
}
_extraRight = _7_x - uint64(i32(1))
if (_prereqAll >> uint(i32(1))) >= _7_x {
_sqlite3ErrorMsg(tls, _pParse, str(102914))
return
}
_13:
*(*uint64)(unsafe.Pointer(&(_pTerm.X12))) = _prereqAll
*(*int32)(unsafe.Pointer(&(_pTerm.X8))) = i32(-1)
*(*int32)(unsafe.Pointer(&(_pTerm.X7))) = i32(-1)
*(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(0))
if _allowedOp(tls, _op) == 0 {
goto _15
}
_9_pLeft = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.X4))
_9_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pExpr.X5))
_9_opMask = uint16(func() int32 {
if ((_pTerm.X11) & _prereqLeft) == uint64(i32(0)) {
return i32(8191)
}
return i32(2048)
}())
if (_pTerm.X9) > i32(0) {
func() {
if _op != i32(74) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129903), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102955)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_9_pLeft.X0) != i32(158) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129904), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102965)))
crt.X__builtin_abort(tls)
}
}()
_9_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_9_pLeft.X6)))))).X2))))) + 20*uintptr((_pTerm.X9)-i32(1)))).X0)
}
if _exprMightBeIndexed(tls, _pSrc, _prereqLeft, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pLeft, _op) != 0 {
*(*int32)(unsafe.Pointer(&(_pTerm.X8))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(0))))
*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(1))))
*(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(int32(_operatorMask(tls, _op)) & int32(_9_opMask))
}
if _op == i32(72) {
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(2048))
sink14 = *p
}
}
if _9_pRight == nil || _exprMightBeIndexed(tls, _pSrc, _pTerm.X11, (*int32)(unsafe.Pointer(&_9_aiCurCol)), _9_pRight, _op) == 0 {
goto _26
}
_12_eExtraOp = u16(0)
func() {
if (_pTerm.X9) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129920), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(102986)))
crt.X__builtin_abort(tls)
}
}()
if (_pTerm.X8) < i32(0) {
goto _29
}
_12_pDup = _sqlite3ExprDup(tls, _db, _pExpr, i32(0))
if (_db.X17) != 0 {
_sqlite3ExprDelete(tls, _db, _12_pDup)
return
}
_13_idxNew = _whereClauseInsert(tls, _pWC, _12_pDup, uint16(i32(3)))
if _13_idxNew == i32(0) {
return
}
_12_pNew = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_13_idxNew)))
_markTermAsChild(tls, _pWC, _13_idxNew, _idxTerm)
if _op == i32(72) {
{
p := (*uint16)(unsafe.Pointer(&(_12_pNew.X3)))
*p = uint16(int32(*p) | i32(2048))
sink14 = *p
}
}
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
if _termIsEquivalence(tls, _pParse, _12_pDup) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X4)))
*p = uint16(int32(*p) | i32(2048))
sink14 = *p
}
_12_eExtraOp = uint16(i32(2048))
}
goto _34
_29:
_12_pDup = _pExpr
_12_pNew = _pTerm
_34:
_exprCommute(tls, _pParse, _12_pDup)
*(*int32)(unsafe.Pointer(&(_12_pNew.X8))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(0))))
*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_12_pNew.X10))))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_9_aiCurCol)) + 4*uintptr(i32(1))))
*(*uint64)(unsafe.Pointer(&(_12_pNew.X11))) = _prereqLeft | _extraRight
*(*uint64)(unsafe.Pointer(&(_12_pNew.X12))) = _prereqAll
*(*uint16)(unsafe.Pointer(&(_12_pNew.X4))) = uint16((int32(_operatorMask(tls, int32(_12_pDup.X0))) + int32(_12_eExtraOp)) & int32(_9_opMask))
_26:
goto _47
_15:
if int32(_pExpr.X0) != i32(73) || int32(_pWC.X2) != i32(71) {
goto _37
}
_17_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
func() {
if _17_pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129974), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(90087)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_17_pList.X0) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129975), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(103003)))
crt.X__builtin_abort(tls)
}
}()
_17_i = i32(0)
_42:
if _17_i >= i32(2) {
goto _45
}
_18_pNewExpr = _sqlite3PExpr(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_exprAnalyzeØ00opsØ001)) + 1*uintptr(_17_i)))), _sqlite3ExprDup(tls, _db, (*XExpr)(_pExpr.X4), i32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_17_pList.X2)))))+20*uintptr(_17_i))).X0), i32(0)))
_transferJoinMarkings(tls, _18_pNewExpr, _pExpr)
_18_idxNew = _whereClauseInsert(tls, _pWC, _18_pNewExpr, uint16(i32(3)))
_exprAnalyze(tls, _pSrc, _pWC, _18_idxNew)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
_markTermAsChild(tls, _pWC, _18_idxNew, _idxTerm)
_17_i += 1
goto _42
_45:
goto _47
_37:
if int32(_pExpr.X0) == i32(70) {
func() {
if int32(_pWC.X2) != i32(71) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129997), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeØ00__func__Ø000))), unsafe.Pointer(str(103019)))
crt.X__builtin_abort(tls)
}
}()
_exprAnalyzeOrTerm(tls, _pSrc, _pWC, _idxTerm)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
}
_47:
if int32(_pWC.X2) != i32(71) || _isLikeOrGlob(tls, _pParse, _pExpr, &_pStr1, &_isComplete, &_noCase) == 0 {
goto _51
}
_20_wtFlags = u16(259)
_20_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(1)))).X0)
_20_pStr2 = _sqlite3ExprDup(tls, _db, _pStr1, i32(0))
if _noCase == 0 || ((*Xsqlite3)(_pParse.X0).X17) != 0 {
goto _53
}
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(1024))
sink14 = *p
}
_21_i = i32(0)
_54:
if int32(store3(&_21_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pStr1.X3))))))) + 1*uintptr(_21_i))))) == i32(0) {
goto _57
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pStr1.X3))))))) + 1*uintptr(_21_i))) = int8(int32(_21_c) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(_21_c))))) & i32(32))))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))) + 1*uintptr(_21_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(_21_c)))))
_21_i += 1
goto _54
_57:
_53:
if (_db.X17) != 0 {
goto _58
}
_23_pC = (*uint8)(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))) + 1*uintptr(_sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_20_pStr2.X3))))))-i32(1))))))
_23_c = *_23_pC
if _noCase == 0 {
goto _59
}
if int32(_23_c) == i32(64) {
_isComplete = i32(0)
}
_23_c = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(_23_c)))
_59:
*_23_pC = uint8(int32(_23_c) + i32(1))
_58:
_20_zCollSeqName = func() *int8 {
if _noCase != 0 {
return str(103035)
}
return str(37881)
}()
_20_pNewExpr1 = _sqlite3ExprDup(tls, _db, _20_pLeft, i32(0))
_20_pNewExpr1 = _sqlite3PExpr(tls, _pParse, i32(82), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr1, _20_zCollSeqName), _pStr1)
_transferJoinMarkings(tls, _20_pNewExpr1, _pExpr)
_20_idxNew1 = _whereClauseInsert(tls, _pWC, _20_pNewExpr1, _20_wtFlags)
_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew1)
_20_pNewExpr2 = _sqlite3ExprDup(tls, _db, _20_pLeft, i32(0))
_20_pNewExpr2 = _sqlite3PExpr(tls, _pParse, i32(81), _sqlite3ExprAddCollateString(tls, _pParse, _20_pNewExpr2, _20_zCollSeqName), _20_pStr2)
_transferJoinMarkings(tls, _20_pNewExpr2, _pExpr)
_20_idxNew2 = _whereClauseInsert(tls, _pWC, _20_pNewExpr2, _20_wtFlags)
_exprAnalyze(tls, _pSrc, _pWC, _20_idxNew2)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
if _isComplete != 0 {
_markTermAsChild(tls, _pWC, _20_idxNew1, _idxTerm)
_markTermAsChild(tls, _pWC, _20_idxNew2, _idxTerm)
}
_51:
if int32(_pWC.X2) != i32(71) || _isMatchOfColumn(tls, _pExpr, &_eOp2) == 0 {
goto _65
}
_26_pRight = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(0)))).X0)
_26_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(1)))).X0)
_26_prereqExpr = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pRight)
_26_prereqColumn = _sqlite3WhereExprUsage(tls, _pMaskSet, _26_pLeft)
if (_26_prereqExpr & _26_prereqColumn) == uint64(i32(0)) {
_27_pNewExpr = _sqlite3PExpr(tls, _pParse, i32(50), nil, _sqlite3ExprDup(tls, _db, _26_pRight, i32(0)))
_26_idxNew = _whereClauseInsert(tls, _pWC, _27_pNewExpr, uint16(i32(3)))
_26_pNewTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_26_idxNew)))
*(*uint64)(unsafe.Pointer(&(_26_pNewTerm.X11))) = _26_prereqExpr
*(*int32)(unsafe.Pointer(&(_26_pNewTerm.X8))) = _26_pLeft.X8
*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_26_pNewTerm.X10))))) = int32(_26_pLeft.X9)
*(*uint16)(unsafe.Pointer(&(_26_pNewTerm.X4))) = uint16(i32(64))
*(*uint8)(unsafe.Pointer(&(_26_pNewTerm.X6))) = _eOp2
_markTermAsChild(tls, _pWC, _26_idxNew, _idxTerm)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(8))
sink14 = *p
}
*(*uint64)(unsafe.Pointer(&(_26_pNewTerm.X12))) = _pTerm.X12
}
_65:
if int32(_pWC.X2) != i32(71) || int32(_pExpr.X0) != i32(78) && int32(_pExpr.X0) != i32(72) || store1(&_nLeft, _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4))) <= i32(1) || _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X5)) != _nLeft || (((*XExpr)(_pExpr.X4).X2)&uint32(i32(2048))) != uint32(i32(0)) && (((*XExpr)(_pExpr.X5).X2)&uint32(i32(2048))) != uint32(i32(0)) {
goto _73
}
_28_i = i32(0)
_74:
if _28_i >= _nLeft {
goto _77
}
_29_pLeft = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.X4), _28_i)
_29_pRight = _sqlite3ExprForVectorField(tls, _pParse, (*XExpr)(_pExpr.X5), _28_i)
_29_pNew = _sqlite3PExpr(tls, _pParse, int32(_pExpr.X0), _29_pLeft, _29_pRight)
_transferJoinMarkings(tls, _29_pNew, _pExpr)
_29_idxNew = _whereClauseInsert(tls, _pWC, _29_pNew, uint16(i32(1)))
_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
_28_i += 1
goto _74
_77:
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
*(*uint16)(unsafe.Pointer(&(_pTerm.X3))) = uint16(i32(6))
*(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(0))
_73:
if int32(_pWC.X2) != i32(71) || int32(_pExpr.X0) != i32(74) || (_pTerm.X9) != i32(0) || int32((*XExpr)(_pExpr.X4).X0) != i32(158) || (*XSelect)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X13) != nil {
goto _82
}
_30_i = i32(0)
_83:
if _30_i >= _sqlite3ExprVectorSize(tls, (*XExpr)(_pExpr.X4)) {
goto _86
}
_31_idxNew = _whereClauseInsert(tls, _pWC, _pExpr, uint16(i32(2)))
*(*int32)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_31_idxNew))).X9))) = _30_i + i32(1)
_exprAnalyze(tls, _pSrc, _pWC, _31_idxNew)
_markTermAsChild(tls, _pWC, _31_idxNew, _idxTerm)
_30_i += 1
goto _83
_86:
_82:
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
{
p := (*uint64)(unsafe.Pointer(&(_pTerm.X11)))
*p = (*p) | _extraRight
sink17 = *p
}
_ = _9_aiCurCol
}
var _exprAnalyzeØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_exprAnalyzeØ00__func__Ø000[0], str(103042), 12)
}
// These routines walk (recursively) an expression tree and generate
// a bitmask indicating which tables are used in that expression
// tree.
func _sqlite3WhereExprUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _p *XExpr) (r0 uint64) {
var _mask uint64
if _p == nil {
return uint64(i32(0))
}
if int32(_p.X0) == i32(152) {
return _sqlite3WhereGetMask(tls, _pMaskSet, _p.X8)
}
_mask = func() uint64 {
if int32(_p.X0) == i32(160) {
return _sqlite3WhereGetMask(tls, _pMaskSet, _p.X8)
}
return uint64(i32(0))
}()
func() {
if ((_p.X2) & uint32(i32(16384))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExprUsageØ00__func__Ø000))), unsafe.Pointer(str(103054)))
crt.X__builtin_abort(tls)
}
}()
if (*XExpr)(_p.X5) != nil {
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.X5))
sink17 = *p
}
}
if (*XExpr)(_p.X4) != nil {
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_p.X4))
sink17 = *p
}
}
if ((_p.X2) & uint32(i32(2048))) != uint32(i32(0)) {
{
p := &_mask
*p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))))
sink17 = *p
}
goto _10
}
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))) != nil {
{
p := &_mask
*p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6)))))))
sink17 = *p
}
}
_10:
return _mask
}
var _sqlite3WhereExprUsageØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereExprUsageØ00__func__Ø000[0], str(103088), 22)
}
// Recursively walk the expressions of a SELECT statement and generate
// a bitmask indicating which tables are used in that expression
// tree.
func _exprSelectUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pS *XSelect) (r0 uint64) {
var _2_i int32
var _mask uint64
var _1_pSrc *XSrcList
_mask = u64(0)
_0:
if _pS == nil {
goto _1
}
_1_pSrc = (*XSrcList)(_pS.X8)
{
p := &_mask
*p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.X0))
sink17 = *p
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.X10))
sink17 = *p
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprListUsage(tls, _pMaskSet, (*XExprList)(_pS.X12))
sink17 = *p
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.X9))
sink17 = *p
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)(_pS.X11))
sink17 = *p
}
if func() int32 {
if _1_pSrc != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129744), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprSelectUsageØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _4
}
_2_i = i32(0)
_5:
if _2_i >= (_1_pSrc.X0) {
goto _8
}
{
p := &_mask
*p = (*p) | _exprSelectUsage(tls, _pMaskSet, (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2)))))+68*uintptr(_2_i))).X5))
sink17 = *p
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_1_pSrc.X2)))))+68*uintptr(_2_i))).X12))
sink17 = *p
}
_2_i += 1
goto _5
_8:
_4:
_pS = (*XSelect)(_pS.X13)
goto _0
_1:
return _mask
}
func _sqlite3WhereExprListUsage(tls *crt.TLS, _pMaskSet *XWhereMaskSet, _pList *XExprList) (r0 uint64) {
var _i int32
var _mask uint64
_mask = u64(0)
if _pList == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
{
p := &_mask
*p = (*p) | _sqlite3WhereExprUsage(tls, _pMaskSet, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0))
sink17 = *p
}
_i += 1
goto _1
_4:
_0:
return _mask
}
var _exprSelectUsageØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_exprSelectUsageØ00__func__Ø000[0], str(103110), 16)
}
// Return TRUE if the given operator is one of the operators that is
// allowed for an indexable WHERE clause term. The allowed operators are
// "=", "<", ">", "<=", ">=", "IN", "IS", and "IS NULL"
func _allowedOp(tls *crt.TLS, _op int32) (r0 int32) {
i32(0)
i32(0)
i32(0)
i32(0)
return bool2int((((_op == i32(74)) || ((_op >= i32(78)) && (_op <= i32(82)))) || (_op == i32(75))) || (_op == i32(72)))
}
func _exprMightBeIndexed(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr, _op int32) (r0 int32) {
i32(0)
i32(0)
func() {
if _op > i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129805), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000))), unsafe.Pointer(str(103126)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pExpr.X0) == i32(158)) && ((_op >= i32(79)) && func() int32 {
if _op <= i32(82) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129806), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprMightBeIndexedØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0) {
_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X2))))) + 20*uintptr(i32(0)))).X0)
}
if int32(_pExpr.X0) == i32(152) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(0)))) = _pExpr.X8
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(1)))) = int32(_pExpr.X9)
return i32(1)
}
if _mPrereq == uint64(i32(0)) {
return i32(0)
}
if (_mPrereq & (_mPrereq - uint64(i32(1)))) != uint64(i32(0)) {
return i32(0)
}
return _exprMightBeIndexed2(tls, _pFrom, _mPrereq, _aiCurCol, _pExpr)
}
var _exprMightBeIndexedØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_exprMightBeIndexedØ00__func__Ø000[0], str(103136), 19)
}
// Expression pExpr is one operand of a comparison operator that might
// be useful for indexing. This routine checks to see if pExpr appears
// in any index. Return TRUE (1) if pExpr is an indexed term and return
// FALSE (0) if not. If TRUE is returned, also set aiCurCol[0] to the cursor
// number of the table that is indexed and aiCurCol[1] to the column number
// of the column that is indexed, or XN_EXPR (-2) if an expression is being
// indexed.
//
// If pExpr is a TK_COLUMN column reference, then this routine always returns
// true even if that particular column is not indexed, because the column
// might be added to an automatic index later.
func _exprMightBeIndexed2(tls *crt.TLS, _pFrom *XSrcList, _mPrereq uint64, _aiCurCol *int32, _pExpr *XExpr) (r0 int32) {
var _i, _iCur int32
var _pIdx *XIndex
_i = i32(0)
_0:
if _mPrereq <= uint64(i32(1)) {
goto _3
}
{
p := func() *uint64 { _i += 1; return &_mPrereq }()
*p = (*p) >> uint(i32(1))
sink17 = *p
}
goto _0
_3:
_iCur = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 68*uintptr(_i))).X11
_pIdx = (*XIndex)((*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 68*uintptr(_i))).X4).X2)
_4:
if _pIdx == nil {
goto _7
}
if (*XExprList)(_pIdx.X10) == nil {
goto _5
}
_i = i32(0)
_9:
if _i >= int32(_pIdx.X13) {
goto _12
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) != i32(-2) {
goto _10
}
if _sqlite3ExprCompareSkip(tls, _pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+20*uintptr(_i))).X0), _iCur) == i32(0) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(0)))) = _iCur
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCurCol)) + 4*uintptr(i32(1)))) = i32(-2)
return i32(1)
}
_10:
_i += 1
goto _9
_12:
_5:
_pIdx = (*XIndex)(_pIdx.X5)
goto _4
_7:
return i32(0)
}
// Like sqlite3ExprCompare() except COLLATE operators at the top-level
// are ignored.
func _sqlite3ExprCompareSkip(tls *crt.TLS, _pA *XExpr, _pB *XExpr, _iTab int32) (r0 int32) {
return _sqlite3ExprCompare(tls, _sqlite3ExprSkipCollate(tls, _pA), _sqlite3ExprSkipCollate(tls, _pB), _iTab)
}
// Translate from TK_xx operator to WO_xx bitmask.
func _operatorMask(tls *crt.TLS, _op int32) (r0 uint16) {
var _c uint16
func() {
if _allowedOp(tls, _op) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129081), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103155)))
crt.X__builtin_abort(tls)
}
}()
if _op == i32(74) {
_c = uint16(i32(1))
goto _7
}
if _op == i32(75) {
_c = uint16(i32(256))
goto _7
}
if _op == i32(72) {
_c = uint16(i32(128))
goto _7
}
func() {
if (i32(2) << uint(_op-i32(78))) >= i32(32767) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129089), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103169)))
crt.X__builtin_abort(tls)
}
}()
_c = uint16(i32(2) << uint(_op-i32(78)))
_7:
func() {
if _op == i32(75) && int32(_c) != i32(256) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129092), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103198)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(74) && int32(_c) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129093), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103228)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(78) && int32(_c) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129094), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103250)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(81) && int32(_c) != i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129095), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103272)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(80) && int32(_c) != i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129096), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103294)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(79) && int32(_c) != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129097), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103316)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(82) && int32(_c) != i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129098), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103338)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op == i32(72) && int32(_c) != i32(128) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129099), unsafe.Pointer((*int8)(unsafe.Pointer(&_operatorMaskØ00__func__Ø000))), unsafe.Pointer(str(103360)))
crt.X__builtin_abort(tls)
}
}()
return _c
}
var _operatorMaskØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_operatorMaskØ00__func__Ø000[0], str(103382), 13)
}
// Mark term iChild as being a child of term iParent
func _markTermAsChild(tls *crt.TLS, _pWC *XWhereClause, _iChild int32, _iParent int32) {
*(*int32)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_iChild))).X7))) = _iParent
*(*int16)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_iChild))).X2))) = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_iParent))).X2
*(*uint8)(unsafe.Pointer(&((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_iParent))).X5))) += 1
}
// We already know that pExpr is a binary operator where both operands are
// column references. This routine checks to see if pExpr is an equivalence
// relation:
// 1. The SQLITE_Transitive optimization must be enabled
// 2. Must be either an == or an IS operator
// 3. Not originating in the ON clause of an OUTER JOIN
// 4. The affinities of A and B must be compatible
// 5a. Both operands use the same collating sequence OR
// 5b. The overall collating sequence is BINARY
// If this routine returns TRUE, that means that the RHS can be substituted
// for the LHS anyplace else in the WHERE clause where the LHS column occurs.
// This is an optimization. No harm comes from returning 0. But if 1 is
// returned when it should not be, then incorrect answers might result.
func _termIsEquivalence(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) (r0 int32) {
var _aff1, _aff2 int8
var _zColl1, _zColl2 *int8
var _pColl *XCollSeq
if (int32((*Xsqlite3)(_pParse.X0).X13) & i32(512)) != i32(0) {
return i32(0)
}
if (int32(_pExpr.X0) != i32(78)) && (int32(_pExpr.X0) != i32(72)) {
return i32(0)
}
if ((_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) {
return i32(0)
}
_aff1 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.X4))
_aff2 = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.X5))
if (int32(_aff1) != int32(_aff2)) && ((int32(_aff1) < i32(67)) || (int32(_aff2) < i32(67))) {
return i32(0)
}
_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4), (*XExpr)(_pExpr.X5))
if (_pColl == nil) || (_sqlite3StrICmp(tls, _pColl.X0, str(37881)) == i32(0)) {
return i32(1)
}
_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4))
_zColl1 = func() *int8 {
if _pColl != nil {
return (_pColl.X0)
}
return nil
}()
_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X5))
_zColl2 = func() *int8 {
if _pColl != nil {
return (_pColl.X0)
}
return nil
}()
return bool2int(Xsqlite3_stricmp(tls, _zColl1, _zColl2) == i32(0))
}
// Commute a comparison operator. Expressions of the form "X op Y"
// are converted into "Y op X".
//
// If left/right precedence rules come into play when determining the
// collating sequence, then COLLATE operators are adjusted to ensure
// that the collating sequence does not change. For example:
// "Y collate NOCASE op X" becomes "X op Y" because any collation sequence on
// the left hand side of a comparison overrides any collation sequence
// attached to the right. For the same reason the EP_Collate flag
// is not commuted.
func _exprCommute(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr) {
var _expRight, _expLeft uint16
var _4_t *XExpr
_expRight = uint16(((*XExpr)(_pExpr.X5).X2) & uint32(i32(256)))
_expLeft = uint16(((*XExpr)(_pExpr.X4).X2) & uint32(i32(256)))
func() {
if _allowedOp(tls, int32(_pExpr.X0)) == 0 || int32(_pExpr.X0) == i32(74) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129051), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprCommuteØ00__func__Ø000))), unsafe.Pointer(str(103395)))
crt.X__builtin_abort(tls)
}
}()
if int32(_expRight) != int32(_expLeft) {
goto _3
}
if _expRight != 0 {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)(_pExpr.X5).X2)))
*p = (*p) & uint32(i32(-257))
sink5 = *p
}
goto _6
}
if _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_pExpr.X4)) != nil {
{
p := (*uint32)(unsafe.Pointer(&((*XExpr)(_pExpr.X4).X2)))
*p = (*p) | uint32(i32(256))
sink5 = *p
}
}
_6:
_3:
_4_t = (*XExpr)(_pExpr.X5)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X5))))) = (*XExpr)(_pExpr.X4)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X4))))) = _4_t
if int32(_pExpr.X0) >= i32(79) {
i32(0)
i32(0)
i32(0)
i32(0)
func() {
if int32(_pExpr.X0) < i32(79) || int32(_pExpr.X0) > i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129071), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprCommuteØ00__func__Ø000))), unsafe.Pointer(str(103436)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(((int32(_pExpr.X0) - i32(79)) ^ i32(2)) + i32(79))
}
}
var _exprCommuteØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_exprCommuteØ00__func__Ø000[0], str(103473), 12)
}
var _exprAnalyzeØ00opsØ001 [2]uint8
func init() {
_exprAnalyzeØ00opsØ001 = [2]uint8{82, 80}
}
// If the pBase expression originated in the ON or USING clause of
// a join, then transfer the appropriate markings over to derived.
func _transferJoinMarkings(tls *crt.TLS, _pDerived *XExpr, _pBase *XExpr) {
if _pDerived != nil {
{
p := (*uint32)(unsafe.Pointer(&(_pDerived.X2)))
*p = (*p) | ((_pBase.X2) & uint32(i32(1)))
sink5 = *p
}
*(*int16)(unsafe.Pointer(&(_pDerived.X11))) = _pBase.X11
}
}
// Analyze a term that consists of two or more OR-connected
// subterms. So in:
//
// ... WHERE (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13)
// ^^^^^^^^^^^^^^^^^^^^
//
// This routine analyzes terms such as the middle term in the above example.
// A WhereOrTerm object is computed and attached to the term under
// analysis, regardless of the outcome of the analysis. Hence:
//
// WhereTerm.wtFlags |= TERM_ORINFO
// WhereTerm.u.pOrInfo = a dynamically allocated WhereOrTerm object
//
// The term being analyzed must have two or more of OR-connected subterms.
// A single subterm might be a set of AND-connected sub-subterms.
// Examples of terms under analysis:
//
// (A) t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5
// (B) x=expr1 OR expr2=x OR x=expr3
// (C) t1.x=t2.y OR (t1.x=t2.z AND t1.y=15)
// (D) x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*')
// (E) (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6)
// (F) x>A OR (x=A AND y>=B)
//
// CASE 1:
//
// If all subterms are of the form T.C=expr for some single column of C and
// a single table T (as shown in example B above) then create a new virtual
// term that is an equivalent IN expression. In other words, if the term
// being analyzed is:
//
// x = expr1 OR expr2 = x OR x = expr3
//
// then create a new virtual term like this:
//
// x IN (expr1,expr2,expr3)
//
// CASE 2:
//
// If there are exactly two disjuncts and one side has x>A and the other side
// has x=A (for the same x and A) then add a new virtual conjunct term to the
// WHERE clause of the form "x>=A". Example:
//
// x>A OR (x=A AND y>B) adds: x>=A
//
// The added conjunct can sometimes be helpful in query planning.
//
// CASE 3:
//
// If all subterms are indexable by a single table T, then set
//
// WhereTerm.eOperator = WO_OR
// WhereTerm.u.pOrInfo->indexable |= the cursor number for table T
//
// A subterm is "indexable" if it is of the form
// "T.C " where C is any column of table T and
// is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN".
// A subterm is also indexable if it is an AND of two or more
// subsubterms at least one of which is indexable. Indexable AND
// subterms have their eOperator set to WO_AND and they have
// u.pAndInfo set to a dynamically allocated WhereAndTerm object.
//
// From another point of view, "indexable" means that the subterm could
// potentially be used with an index if an appropriate index exists.
// This analysis does not consider whether or not the index exists; that
// is decided elsewhere. This analysis only looks at whether subterms
// appropriate for indexing exist.
//
// All examples A through E above satisfy case 3. But if a term
// also satisfies case 1 (such as B) we know that the optimizer will
// always prefer case 1, so in that case we pretend that case 3 is not
// satisfied.
//
// It might be the case that multiple tables are indexable. For example,
// (E) above is indexable on tables P, Q, and R.
//
// Terms that satisfy case 3 are candidates for lookup by using
// separate indices to find rowids for each subterm and composing
// the union of all rowids using a RowSet object. This is similar
// to "bitmap indices" in other database engines.
//
// OTHERWISE:
//
// If none of cases 1, 2, or 3 apply, then leave the eOperator set to
// zero. This term is not useful for search.
func _exprAnalyzeOrTerm(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _idxTerm int32) {
var _i, _3_j, _12_iOne, _13_iTwo, _15_okToChngToIN, _15_iColumn, _15_iCursor, _15_j, _24_affLeft, _24_affRight, _29_idxNew int32
var _chngToIN, _indexable, _3_b, _8_b uint64
var _db *Xsqlite3
var _27_pList *XExprList
var _pExpr, _27_pDup, _27_pLeft, _27_pNew *XExpr
var _pParse *XParse
var _pWInfo *XWhereInfo
var _pTerm, _pOrTerm, _3_pAndTerm, _9_pOther, _12_pOne, _13_pTwo *XWhereTerm
var _pOrWc, _3_pAndWC *XWhereClause
var _pOrInfo *XWhereOrInfo
var _2_pAndInfo *XWhereAndInfo
_pWInfo = (*XWhereInfo)(_pWC.X0)
_pParse = (*XParse)(_pWInfo.X0)
_db = (*Xsqlite3)(_pParse.X0)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
_pExpr = (*XExpr)(_pTerm.X0)
func() {
if (int32(_pTerm.X3) & i32(49)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129466), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103485)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) != i32(70) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129467), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103547)))
crt.X__builtin_abort(tls)
}
}()
*(**XWhereOrInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))))) = store64(&_pOrInfo, (*XWhereOrInfo)(_sqlite3DbMallocZero(tls, _db, uint64(u32(416)))))
if _pOrInfo == nil {
return
}
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
_pOrWc = (*XWhereClause)(unsafe.Pointer(&(_pOrInfo.X0)))
crt.Xmemset(tls, (unsafe.Pointer)((*[8]XWhereTerm)(unsafe.Pointer(&(_pOrWc.X6)))), i32(0), u32(384))
_sqlite3WhereClauseInit(tls, _pOrWc, _pWInfo)
_sqlite3WhereSplit(tls, _pOrWc, _pExpr, uint8(i32(70)))
_sqlite3WhereExprAnalyze(tls, _pSrc, _pOrWc)
if (_db.X17) != 0 {
return
}
func() {
if (_pOrWc.X3) < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129477), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103564)))
crt.X__builtin_abort(tls)
}
}()
_indexable = u64(18446744073709551615)
_chngToIN = u64(18446744073709551615)
*func() **XWhereTerm { _i = (_pOrWc.X3) - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5)
_8:
if _i < i32(0) || _indexable == 0 {
goto _12
}
if (int32(_pOrTerm.X4) & i32(511)) != i32(0) {
goto _13
}
func() {
if (int32(_pOrTerm.X3) & i32(48)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129487), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103580)))
crt.X__builtin_abort(tls)
}
}()
_chngToIN = uint64(i32(0))
_2_pAndInfo = (*XWhereAndInfo)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(408))))
if _2_pAndInfo == nil {
goto _16
}
_3_b = uint64(i32(0))
*(**XWhereAndInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10))))))) = _2_pAndInfo
{
p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3)))
*p = uint16(int32(*p) | i32(32))
sink14 = *p
}
*(*uint16)(unsafe.Pointer(&(_pOrTerm.X4))) = uint16(i32(1024))
_3_pAndWC = (*XWhereClause)(unsafe.Pointer(&(_2_pAndInfo.X0)))
crt.Xmemset(tls, (unsafe.Pointer)((*[8]XWhereTerm)(unsafe.Pointer(&(_3_pAndWC.X6)))), i32(0), u32(384))
_sqlite3WhereClauseInit(tls, _3_pAndWC, (*XWhereInfo)(_pWC.X0))
_sqlite3WhereSplit(tls, _3_pAndWC, (*XExpr)(_pOrTerm.X0), uint8(i32(71)))
_sqlite3WhereExprAnalyze(tls, _pSrc, _3_pAndWC)
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pAndWC.X1))))) = _pWC
if (_db.X17) != 0 {
goto _17
}
*func() **XWhereTerm { _3_j = i32(0); return &_3_pAndTerm }() = (*XWhereTerm)(_3_pAndWC.X5)
_18:
if _3_j >= (_3_pAndWC.X3) {
goto _21
}
func() {
if (*XExpr)(_3_pAndTerm.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129506), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103631)))
crt.X__builtin_abort(tls)
}
}()
if _allowedOp(tls, int32((*XExpr)(_3_pAndTerm.X0).X0)) != 0 || (int32(_3_pAndTerm.X4) == i32(64)) {
{
p := &_3_b
*p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _3_pAndTerm.X8)
sink17 = *p
}
}
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _3_j += 1; return &_3_pAndTerm }())) += uintptr(48)
goto _18
_21:
_17:
{
p := &_indexable
*p = (*p) & _3_b
sink17 = *p
}
_16:
goto _28
_13:
if (int32(_pOrTerm.X3) & i32(8)) != 0 {
goto _28
}
_8_b = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pOrTerm.X8)
if (int32(_pOrTerm.X3) & i32(2)) != 0 {
_9_pOther = (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5) + 48*uintptr(_pOrTerm.X7)))
{
p := &_8_b
*p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _9_pOther.X8)
sink17 = *p
}
}
{
p := &_indexable
*p = (*p) & _8_b
sink17 = *p
}
if (int32(_pOrTerm.X4) & i32(2)) == i32(0) {
_chngToIN = uint64(i32(0))
goto _31
}
{
p := &_chngToIN
*p = (*p) & _8_b
sink17 = *p
}
_31:
_28:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
goto _8
_12:
*(*uint64)(unsafe.Pointer(&(_pOrInfo.X1))) = _indexable
*(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(func() int32 {
if _indexable == uint64(i32(0)) {
return i32(0)
}
return i32(512)
}())
if _indexable == 0 || (_pOrWc.X3) != i32(2) {
goto _35
}
_12_iOne = i32(0)
_36:
if store65(&_12_pOne, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+48*uintptr(i32(0)))), postInc1(&_12_iOne, int32(1)))) == nil {
goto _37
}
_13_iTwo = i32(0)
_38:
if store65(&_13_pTwo, _whereNthSubterm(tls, (*XWhereTerm)(unsafe.Pointer(uintptr(_pOrWc.X5)+48*uintptr(i32(1)))), postInc1(&_13_iTwo, int32(1)))) != nil {
_whereCombineDisjuncts(tls, _pSrc, _pWC, _12_pOne, _13_pTwo)
goto _38
}
goto _36
_37:
_35:
if _chngToIN == 0 {
goto _40
}
_15_okToChngToIN = i32(0)
_15_iColumn = i32(-1)
_15_iCursor = i32(-1)
_15_j = i32(0)
_15_j = i32(0)
_41:
if _15_j >= i32(2) || _15_okToChngToIN != 0 {
goto _45
}
_pOrTerm = (*XWhereTerm)(_pOrWc.X5)
_i = (_pOrWc.X3) - i32(1)
_46:
if _i < i32(0) {
goto _49
}
func() {
if (int32(_pOrTerm.X4) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129592), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103647)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3)))
*p = uint16(int32(*p) & i32(-65))
sink14 = *p
}
if (_pOrTerm.X8) == _15_iCursor {
func() {
if _15_j != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129597), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103674)))
crt.X__builtin_abort(tls)
}
}()
goto _47
}
if (_chngToIN & _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pOrTerm.X8)) == uint64(i32(0)) {
func() {
if (int32(_pOrTerm.X3) & i32(10)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129608), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103679)))
crt.X__builtin_abort(tls)
}
}()
goto _47
}
_15_iColumn = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10)))))
_15_iCursor = _pOrTerm.X8
goto _49
_47:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
goto _46
_49:
if _i < i32(0) {
func() {
if _15_j != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129618), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103674)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_chngToIN & (_chngToIN - uint64(i32(1)))) != uint64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129619), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103725)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _chngToIN != _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _15_iCursor) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129620), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103748)))
crt.X__builtin_abort(tls)
}
}()
goto _45
}
_15_okToChngToIN = i32(1)
_65:
if _i < i32(0) || _15_okToChngToIN == 0 {
goto _69
}
func() {
if (int32(_pOrTerm.X4) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129629), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103647)))
crt.X__builtin_abort(tls)
}
}()
if (_pOrTerm.X8) != _15_iCursor {
{
p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3)))
*p = uint16(int32(*p) & i32(-65))
sink14 = *p
}
goto _75
}
if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10)))))) != _15_iColumn {
_15_okToChngToIN = i32(0)
goto _75
}
_24_affRight = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.X0).X5)))
_24_affLeft = int32(_sqlite3ExprAffinity(tls, (*XExpr)((*XExpr)(_pOrTerm.X0).X4)))
if (_24_affRight != i32(0)) && (_24_affRight != _24_affLeft) {
_15_okToChngToIN = i32(0)
goto _78
}
{
p := (*uint16)(unsafe.Pointer(&(_pOrTerm.X3)))
*p = uint16(int32(*p) | i32(64))
sink14 = *p
}
_78:
_75:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
goto _65
_69:
_15_j += 1
goto _41
_45:
if _15_okToChngToIN == 0 {
goto _79
}
_27_pList = nil
_27_pLeft = nil
*func() **XWhereTerm { _i = (_pOrWc.X3) - i32(1); return &_pOrTerm }() = (*XWhereTerm)(_pOrWc.X5)
_80:
if _i < i32(0) {
goto _83
}
if (int32(_pOrTerm.X3) & i32(64)) == i32(0) {
goto _81
}
func() {
if (int32(_pOrTerm.X4) & i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129663), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103647)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pOrTerm.X8) != _15_iCursor {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129664), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103806)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pOrTerm.X10)))))) != _15_iColumn {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129665), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103835)))
crt.X__builtin_abort(tls)
}
}()
_27_pDup = _sqlite3ExprDup(tls, _db, (*XExpr)((*XExpr)(_pOrTerm.X0).X5), i32(0))
_27_pList = _sqlite3ExprListAppend(tls, (*XParse)(_pWInfo.X0), _27_pList, _27_pDup)
_27_pLeft = (*XExpr)((*XExpr)(_pOrTerm.X0).X4)
_81:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pOrTerm }())) += uintptr(48)
goto _80
_83:
func() {
if _27_pLeft == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129670), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103866)))
crt.X__builtin_abort(tls)
}
}()
_27_pDup = _sqlite3ExprDup(tls, _db, _27_pLeft, i32(0))
_27_pNew = _sqlite3PExpr(tls, _pParse, i32(74), _27_pDup, nil)
if _27_pNew != nil {
_transferJoinMarkings(tls, _27_pNew, _pExpr)
func() {
if ((_27_pNew.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129676), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprAnalyzeOrTermØ00__func__Ø000))), unsafe.Pointer(str(103875)))
crt.X__builtin_abort(tls)
}
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_27_pNew.X6))))))) = _27_pList
_29_idxNew = _whereClauseInsert(tls, _pWC, _27_pNew, uint16(i32(3)))
_exprAnalyze(tls, _pSrc, _pWC, _29_idxNew)
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_idxTerm)))
_markTermAsChild(tls, _pWC, _29_idxNew, _idxTerm)
goto _96
}
_sqlite3ExprListDelete(tls, _db, _27_pList)
_96:
*(*uint16)(unsafe.Pointer(&(_pTerm.X4))) = uint16(i32(4096))
_79:
_40:
_ = _12_iOne
_ = _13_iTwo
}
var _exprAnalyzeOrTermØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_exprAnalyzeOrTermØ00__func__Ø000[0], str(103912), 18)
}
// Return the N-th AND-connected subterm of pTerm. Or if pTerm is not
// a conjunction, then return just pTerm when N==0. If N is exceeds
// the number of available subterms, return NULL.
func _whereNthSubterm(tls *crt.TLS, _pTerm *XWhereTerm, _N int32) (r0 *XWhereTerm) {
if int32(_pTerm.X4) != i32(1024) {
return func() *XWhereTerm {
if _N == i32(0) {
return _pTerm
}
return nil
}()
}
if _N < ((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))).X3) {
return (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0))).X5) + 48*uintptr(_N)))
}
return nil
}
// Subterms pOne and pTwo are contained within WHERE clause pWC. The
// two subterms are in disjunction - they are OR-ed together.
//
// If these two terms are both of the form: "A op B" with the same
// A and B values but different operators and if the operators are
// compatible (if one is = and the other is <, for example) then
// add a new virtual AND term to pWC that is the combination of the
// two.
//
// Some examples:
//
// x x<=y
// x=y OR x=y --> x=y
// x<=y OR x x<=y
//
// The following is NOT generated:
//
// xy --> x!=y
func _whereCombineDisjuncts(tls *crt.TLS, _pSrc *XSrcList, _pWC *XWhereClause, _pOne *XWhereTerm, _pTwo *XWhereTerm) {
var _op, _idxNew int32
var _eOp uint16
var _db *Xsqlite3
var _pNew *XExpr
_eOp = uint16(int32(_pOne.X4) | int32(_pTwo.X4))
if (int32(_pOne.X4) & i32(62)) == i32(0) {
return
}
if (int32(_pTwo.X4) & i32(62)) == i32(0) {
return
}
if ((int32(_eOp) & i32(26)) != int32(_eOp)) && ((int32(_eOp) & i32(38)) != int32(_eOp)) {
return
}
func() {
if (*XExpr)((*XExpr)(_pOne.X0).X4) == nil || (*XExpr)((*XExpr)(_pOne.X0).X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129334), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000))), unsafe.Pointer(str(103930)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)((*XExpr)(_pTwo.X0).X4) == nil || (*XExpr)((*XExpr)(_pTwo.X0).X5) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129335), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000))), unsafe.Pointer(str(103978)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.X0).X4), (*XExpr)((*XExpr)(_pTwo.X0).X4), i32(-1)) != 0 {
return
}
if _sqlite3ExprCompare(tls, (*XExpr)((*XExpr)(_pOne.X0).X5), (*XExpr)((*XExpr)(_pTwo.X0).X5), i32(-1)) != 0 {
return
}
if (int32(_eOp) & (int32(_eOp) - i32(1))) == i32(0) {
goto _12
}
if (int32(_eOp) & i32(24)) != 0 {
_eOp = uint16(i32(8))
goto _14
}
func() {
if (int32(_eOp) & i32(36)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129343), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000))), unsafe.Pointer(str(104026)))
crt.X__builtin_abort(tls)
}
}()
_eOp = uint16(i32(32))
_14:
_12:
_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.X0).X0).X0)
_pNew = _sqlite3ExprDup(tls, _db, (*XExpr)(_pOne.X0), i32(0))
if _pNew == nil {
return
}
_op = i32(78)
_18:
if int32(_eOp) == (i32(2) << uint(_op-i32(78))) {
goto _21
}
func() {
if _op >= i32(82) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129350), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereCombineDisjunctsØ00__func__Ø000))), unsafe.Pointer(str(104046)))
crt.X__builtin_abort(tls)
}
}()
_op += 1
goto _18
_21:
*(*uint8)(unsafe.Pointer(&(_pNew.X0))) = uint8(_op)
_idxNew = _whereClauseInsert(tls, _pWC, _pNew, uint16(i32(3)))
_exprAnalyze(tls, _pSrc, _pWC, _idxNew)
}
var _whereCombineDisjunctsØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_whereCombineDisjunctsØ00__func__Ø000[0], str(104055), 22)
}
// Check to see if the given expression is a LIKE or GLOB operator that
// can be optimized using inequality constraints. Return TRUE if it is
// so and false if not.
//
// In order for the operator to be optimizible, the RHS must be a string
// literal that does not begin with a wildcard. The LHS must be a column
// that may only be NULL, a string, or a BLOB, never a number. (This means
// that virtual tables cannot participate in the LIKE optimization.) The
// collating sequence for the column on the LHS must be appropriate for
// the operator.
func _isLikeOrGlob(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _ppPrefix **XExpr, _pisComplete *int32, _pnoCase *int32) (r0 int32) {
var _c, _cnt, _op, _rc, _2_iCol, _11_r1 int32
var _z *int8
var _db *Xsqlite3
var _2_pReprepare, _10_v *TVdbe
var _pVal *XMem
var _pList *XExprList
var _pRight, _pLeft, _9_pPrefix *XExpr
var _wc [3]int8
_z = nil
_db = (*Xsqlite3)(_pParse.X0)
_pVal = nil
if _sqlite3IsLikeFunction(tls, _db, _pExpr, _pnoCase, (*int8)(unsafe.Pointer(&_wc))) == 0 {
return i32(0)
}
_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
_pLeft = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(i32(1)))).X0)
_pRight = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(i32(0)))).X0))
_op = int32(_pRight.X0)
if _op != i32(135) {
goto _1
}
_2_pReprepare = (*TVdbe)(_pParse.X61)
_2_iCol = int32(_pRight.X9)
_pVal = _sqlite3VdbeGetBoundValue(tls, _2_pReprepare, _2_iCol, uint8(i32(65)))
if (_pVal != nil) && (Xsqlite3_value_type(tls, _pVal) == i32(3)) {
_z = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, _pVal)))
}
_sqlite3VdbeSetVarmask(tls, (*TVdbe)(_pParse.X2), _2_iCol)
func() {
if int32(_pRight.X0) != i32(135) && int32(_pRight.X0) != i32(157) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(129154), unsafe.Pointer((*int8)(unsafe.Pointer(&_isLikeOrGlobØ00__func__Ø000))), unsafe.Pointer(str(104077)))
crt.X__builtin_abort(tls)
}
}()
goto _8
_1:
if _op == i32(97) {
_z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pRight.X3)))))
}
_8:
if _z == nil {
goto _9
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0)))))))))&i32(4)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(45) {
goto _11
}
if ((int32(_pLeft.X0) != i32(152)) || (int32(_sqlite3ExprAffinity(tls, _pLeft)) != i32(66))) || ((*XTable)(_pLeft.X14).X16) != 0 {
_sqlite3ValueFree(tls, _pVal)
return i32(0)
}
_11:
_cnt = i32(0)
_15:
if (((store1(&_c, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt))))) != i32(0)) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(0))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(1))))))) && (_c != int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(2)))))) {
_cnt += 1
goto _15
}
if _cnt == i32(0) || i32(255) == int32(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt-i32(1)))))) {
goto _21
}
*_pisComplete = bool2int((_c == int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_wc)) + 1*uintptr(i32(0)))))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_cnt+i32(1))))) == i32(0)))
_9_pPrefix = _sqlite3Expr(tls, _db, i32(97), _z)
if _9_pPrefix != nil {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_9_pPrefix.X3))))))) + 1*uintptr(_cnt))) = int8(i32(0))
}
*_ppPrefix = _9_pPrefix
if _op != i32(135) {
goto _24
}
_10_v = (*TVdbe)(_pParse.X2)
_sqlite3VdbeSetVarmask(tls, _10_v, int32(_pRight.X9))
if (*_pisComplete) != 0 && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pRight.X3))))))) + 1*uintptr(i32(1))))) != 0) {
_11_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3ExprCodeTarget(tls, _pParse, _pRight, _11_r1)
_sqlite3VdbeChangeP3(tls, _10_v, uint32(_sqlite3VdbeCurrentAddr(tls, _10_v)-i32(1)), i32(0))
_sqlite3ReleaseTempReg(tls, _pParse, _11_r1)
}
_24:
goto _27
_21:
_z = nil
_27:
_9:
_rc = bool2int(_z != nil)
_sqlite3ValueFree(tls, _pVal)
return _rc
_ = _wc
panic(0)
}
// 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
// return TRUE. If the function is not a LIKE-style function then
// return FALSE.
//
// *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 _sqlite3IsLikeFunction(tls *crt.TLS, _db *Xsqlite3, _pExpr *XExpr, _pIsNocase *int32, _aWc *int8) (r0 int32) {
var _pDef *XFuncDef
if ((int32(_pExpr.X0) != i32(151)) || ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) == nil)) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0) != i32(2)) {
return i32(0)
}
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107262), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
_pDef = _sqlite3FindFunction(tls, _db, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), i32(2), uint8(i32(1)), uint8(i32(0)))
if func() int32 {
if _pDef == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107264), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 || ((int32(_pDef.X1) & i32(4)) == i32(0)) {
return i32(0)
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_aWc), _pDef.X2, uint32(i32(3)))
func() {
if (*int8)(unsafe.Pointer(&_likeInfoAlt)) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107273), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104128)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_likeInfoAlt))+1*uintptr(i32(1)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X1))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107274), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104180)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_likeInfoAlt))+1*uintptr(i32(2)))) != (*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(&(_likeInfoAlt.X2))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107275), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IsLikeFunctionØ00__func__Ø000))), unsafe.Pointer(str(104238)))
crt.X__builtin_abort(tls)
}
}()
*_pIsNocase = bool2int((int32(_pDef.X1) & i32(8)) == i32(0))
return i32(1)
}
var _sqlite3IsLikeFunctionØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3IsLikeFunctionØ00__func__Ø000[0], str(104296), 22)
}
var _likeInfoAlt TcompareInfo
func init() {
_likeInfoAlt = TcompareInfo{X0: u8(37), X1: u8(95), X2: u8(0), X3: u8(0)}
}
// Return a pointer to an sqlite3_value structure containing the value bound
// parameter iVar of VM v. Except, if the value is an SQL NULL, return
// 0 instead. Unless it is NULL, apply affinity aff (one of the SQLITE_AFF_*
// constants) to the value before returning it.
//
// The returned value must be freed by the caller using sqlite3ValueFree().
func _sqlite3VdbeGetBoundValue(tls *crt.TLS, _v *TVdbe, _iVar int32, _aff uint8) (r0 *XMem) {
var _1_pMem, _2_pRet *XMem
func() {
if _iVar <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75960), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeGetBoundValueØ00__func__Ø000))), unsafe.Pointer(str(104318)))
crt.X__builtin_abort(tls)
}
}()
if _v == nil {
goto _2
}
_1_pMem = (*XMem)(unsafe.Pointer(uintptr(_v.X24) + 48*uintptr(_iVar-i32(1))))
if i32(0) != (int32(_1_pMem.X1) & i32(1)) {
goto _3
}
_2_pRet = _sqlite3ValueNew(tls, (*Xsqlite3)(_v.X0))
if _2_pRet != nil {
_sqlite3VdbeMemCopy(tls, _2_pRet, _1_pMem)
_sqlite3ValueApplyAffinity(tls, _2_pRet, _aff, uint8(i32(1)))
}
return _2_pRet
_3:
_2:
return nil
}
var _sqlite3VdbeGetBoundValueØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeGetBoundValueØ00__func__Ø000[0], str(104325), 25)
}
// Configure SQL variable iVar so that binding a new value to it signals
// to sqlite3_reoptimize() that re-preparing the statement may result
// in a better query plan.
func _sqlite3VdbeSetVarmask(tls *crt.TLS, _v *TVdbe, _iVar int32) {
func() {
if _iVar <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(75981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeSetVarmaskØ00__func__Ø000))), unsafe.Pointer(str(104318)))
crt.X__builtin_abort(tls)
}
}()
if _iVar >= i32(32) {
{
p := (*uint32)(unsafe.Pointer(&(_v.X41)))
*p = (*p) | u32(2147483648)
sink5 = *p
}
goto _3
}
{
p := (*uint32)(unsafe.Pointer(&(_v.X41)))
*p = (*p) | (u32(1) << uint(_iVar-i32(1)))
sink5 = *p
}
_3:
}
var _sqlite3VdbeSetVarmaskØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeSetVarmaskØ00__func__Ø000[0], str(104350), 22)
}
var _isLikeOrGlobØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_isLikeOrGlobØ00__func__Ø000[0], str(104372), 13)
}
func _sqlite3VdbeChangeP3(tls *crt.TLS, _p *TVdbe, _addr uint32, _val int32) {
*(*int32)(unsafe.Pointer(&(_sqlite3VdbeGetOp(tls, _p, int32(_addr)).X5))) = _val
}
// Check to see if the given expression is of the form
//
// column OP expr
//
// where OP is one of MATCH, GLOB, LIKE or REGEXP and "column" is a
// column of a virtual table.
//
// If it is then return TRUE. If not, return FALSE.
func _isMatchOfColumn(tls *crt.TLS, _pExpr *XExpr, _peOp2 *uint8) (r0 int32) {
var _i int32
var _pList *XExprList
var _pCol *XExpr
if int32(_pExpr.X0) != i32(151) {
return i32(0)
}
_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))
if (_pList == nil) || ((_pList.X0) != i32(2)) {
return i32(0)
}
_pCol = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(i32(1)))).X0)
if (int32(_pCol.X0) != i32(152)) || (((*XTable)(_pCol.X14).X16) == 0) {
return i32(0)
}
_i = i32(0)
_5:
if _i >= i32(4) {
goto _8
}
if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_isMatchOfColumnØ00aOpØ001))+8*uintptr(_i))).X0) == i32(0) {
*_peOp2 = (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_isMatchOfColumnØ00aOpØ001)) + 8*uintptr(_i))).X1
return i32(1)
}
_i += 1
goto _5
_8:
return i32(0)
}
var _isMatchOfColumnØ00aOpØ001 [4]TEncName
func init() {
_isMatchOfColumnØ00aOpØ001 = [4]TEncName{TEncName{X0: str(61759), X1: u8(64)}, TEncName{X0: str(7961), X1: u8(66)}, TEncName{X0: str(7966), X1: u8(65)}, TEncName{X0: str(104385), X1: u8(67)}}
}
// 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 _sqlite3ExprForVectorField(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32) (r0 *XExpr) {
var _pRet *XExpr
if int32(_pVector.X0) != i32(119) {
goto _0
}
func() {
if ((_pVector.X2) & uint32(i32(2048))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91309), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000))), unsafe.Pointer(str(104392)))
crt.X__builtin_abort(tls)
}
}()
_pRet = _sqlite3PExpr(tls, _pParse, i32(159), nil, nil)
if _pRet != nil {
*(*int16)(unsafe.Pointer(&(_pRet.X9))) = int16(_iField)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pRet.X4))))) = _pVector
}
func() {
if _pRet != nil && (_pRet.X8) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91331), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprForVectorFieldØ00__func__Ø000))), unsafe.Pointer(str(104422)))
crt.X__builtin_abort(tls)
}
}()
goto _7
_0:
if int32(_pVector.X0) == i32(158) {
_pVector = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 20*uintptr(_iField))).X0)
}
_pRet = _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _pVector, i32(0))
_7:
return _pRet
}
var _sqlite3ExprForVectorFieldØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprForVectorFieldØ00__func__Ø000[0], str(104449), 26)
}
// Return true if the DISTINCT expression-list passed as the third argument
// is redundant.
//
// A DISTINCT list is redundant if any subset of the columns in the
// DISTINCT list are collectively unique and individually non-null.
func _isDistinctRedundant(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWC *XWhereClause, _pDistinct *XExprList) (r0 int32) {
var _i, _iBase int32
var _pTab *XTable
var _1_p *XExpr
var _pIdx *XIndex
if (_pTabList.X0) != i32(1) {
return i32(0)
}
_iBase = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X11
_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X4)
_i = i32(0)
_1:
if _i >= (_pDistinct.X0) {
goto _4
}
_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pDistinct.X2)))))+20*uintptr(_i))).X0))
if ((int32(_1_p.X0) == i32(152)) && ((_1_p.X8) == _iBase)) && (int32(_1_p.X9) < i32(0)) {
return i32(1)
}
_i += 1
goto _1
_4:
_pIdx = (*XIndex)(_pTab.X2)
_8:
if _pIdx == nil {
goto _11
}
if int32(_pIdx.X15) == i32(0) {
goto _9
}
_i = i32(0)
_13:
if _i >= int32(_pIdx.X13) {
goto _16
}
if nil != _sqlite3WhereFindTerm(tls, _pWC, _iBase, _i, u64(18446744073709551615), uint32(i32(2)), _pIdx) {
goto _17
}
if _findIndexCol(tls, _pParse, _pDistinct, _iBase, _pIdx, _i) < i32(0) {
goto _16
}
if _indexColumnNotNull(tls, _pIdx, _i) == i32(0) {
goto _16
}
_17:
_i += 1
goto _13
_16:
if _i == int32(_pIdx.X13) {
return i32(1)
}
_9:
_pIdx = (*XIndex)(_pIdx.X5)
goto _8
_11:
return i32(0)
}
// Search for a term in the WHERE clause that is of the form "X "
// where X is a reference to the iColumn of table iCur or of index pIdx
// if pIdx!=0 and is one of the WO_xx operator codes specified by
// the op parameter. Return a pointer to the term. Return 0 if not found.
//
// If pIdx!=0 then it must be one of the indexes of table iCur.
// Search for terms matching the iColumn-th column of pIdx
// rather than the iColumn-th column of table iCur.
//
// The term returned might by Y= if there is another constraint in
// the WHERE clause that specifies that X=Y. Any such constraints will be
// identified by the WO_EQUIV bit in the pTerm->eOperator field. The
// aiCur[]/iaColumn[] arrays hold X and all its equivalents. There are 11
// slots in aiCur[]/aiColumn[] so that means we can look for X plus up to 10
// other equivalent values. Hence a search for X will return if X=A1
// and A1=A2 and A2=A3 and ... and A9=A10 and A10=.
//
// If there are multiple terms in the WHERE clause of the form "X "
// then try for the one with no dependencies on - in other words where
// is a constant expression of some kind. Only return entries of
// the form "X Y" where Y is a column in another table if no terms of
// the form "X " exist. If no terms with a constant RHS
// exist, try to return a term that does not use WO_EQUIV.
func _sqlite3WhereFindTerm(tls *crt.TLS, _pWC *XWhereClause, _iCur int32, _iColumn int32, _notReady uint64, _op uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
var _pResult, _p *XWhereTerm
var _scan XWhereScan
_pResult = nil
_p = _whereScanInit(tls, &_scan, _pWC, _iCur, _iColumn, _op, _pIdx)
{
p := &_op
*p = (*p) & uint32(i32(130))
sink5 = *p
}
_0:
if _p == nil {
goto _1
}
if ((_p.X11) & _notReady) != uint64(i32(0)) {
goto _2
}
if ((_p.X11) == uint64(i32(0))) && ((uint32(_p.X4) & _op) != uint32(i32(0))) {
return _p
}
if _pResult == nil {
_pResult = _p
}
_2:
_p = _whereScanNext(tls, &_scan)
goto _0
_1:
return _pResult
_ = _scan
panic(0)
}
// Initialize a WHERE clause scanner object. Return a pointer to the
// first match. Return NULL if there are no matches.
//
// The scanner will be searching the WHERE clause pWC. It will look
// for terms of the form "X " where X is column iColumn of table
// iCur. Or if pIdx!=0 then X is column iColumn of index pIdx. pIdx
// must be one of the indexes of table iCur.
//
// The must be one of the operators described by opMask.
//
// If the search is for X and the WHERE clause contains terms of the
// form X=Y then this routine might also return terms of the form
// "Y ". The number of levels of transitivity is limited,
// but is enough to handle most commonly occurring SQL statements.
//
// If X is not the INTEGER PRIMARY KEY then X must be compatible with
// index pIdx.
func _whereScanInit(tls *crt.TLS, _pScan *XWhereScan, _pWC *XWhereClause, _iCur int32, _iColumn int32, _opMask uint32, _pIdx *XIndex) (r0 *XWhereTerm) {
var _1_j int32
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X0))))) = _pWC
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X1))))) = _pWC
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X3))))) = nil
*(*int8)(unsafe.Pointer(&(_pScan.X4))) = int8(i32(0))
*(**int8)(unsafe.Pointer(&(_pScan.X2))) = nil
if _pIdx == nil {
goto _0
}
_1_j = _iColumn
_iColumn = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_j))))
if _iColumn == i32(-2) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X3))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2))))) + 20*uintptr(_1_j))).X0)
*(**int8)(unsafe.Pointer(&(_pScan.X2))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_1_j)))
goto _5
}
if _iColumn == int32((*XTable)(_pIdx.X3).X10) {
_iColumn = i32(-1)
goto _5
}
if _iColumn >= i32(0) {
*(*int8)(unsafe.Pointer(&(_pScan.X4))) = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 16*uintptr(_iColumn))).X4
*(**int8)(unsafe.Pointer(&(_pScan.X2))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_1_j)))
}
_5:
goto _7
_0:
if _iColumn == i32(-2) {
return nil
}
_7:
*(*uint32)(unsafe.Pointer(&(_pScan.X7))) = _opMask
*(*int32)(unsafe.Pointer(&(_pScan.X8))) = i32(0)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(i32(0)))) = _iCur
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(i32(0)))) = int16(_iColumn)
*(*uint8)(unsafe.Pointer(&(_pScan.X5))) = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_pScan.X6))) = uint8(i32(1))
return _whereScanNext(tls, _pScan)
}
// Advance to the next WhereTerm that matches according to the criteria
// established when the pScan object was initialized by whereScanInit().
// Return NULL if there are no more matching WhereTerms.
func _whereScanNext(tls *crt.TLS, _pScan *XWhereScan) (r0 *XWhereTerm) {
var _iColumn int16
var _iCur, _k, _5_j int32
var _pX *XExpr
var _10_pParse *XParse
var _10_pColl *XCollSeq
var _pTerm *XWhereTerm
var _pWC *XWhereClause
_k = _pScan.X8
func() {
if int32(_pScan.X6) > int32(_pScan.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130590), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereScanNextØ00__func__Ø000))), unsafe.Pointer(str(104475)))
crt.X__builtin_abort(tls)
}
}()
_pWC = (*XWhereClause)(_pScan.X1)
_2:
_iColumn = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(int32(_pScan.X6)-i32(1))))
_iCur = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(int32(_pScan.X6)-i32(1))))
func() {
if _pWC == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130595), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereScanNextØ00__func__Ø000))), unsafe.Pointer(str(104504)))
crt.X__builtin_abort(tls)
}
}()
_6:
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_k)))))*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
_7:
if _k >= (_pWC.X3) {
goto _10
}
if (_pTerm.X8) != _iCur || (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) != int32(_iColumn) || int32(_iColumn) == i32(-2) && _sqlite3ExprCompareSkip(tls, (*XExpr)((*XExpr)(_pTerm.X0).X4), (*XExpr)(_pScan.X3), _iCur) != i32(0) || int32(_pScan.X6) > i32(1) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) != uint32(i32(0)) {
goto _16
}
if (int32(_pTerm.X4)&i32(2048)) == i32(0) || int32(_pScan.X5) >= i32(11) || int32(store36(&_pX, _sqlite3ExprSkipCollate(tls, (*XExpr)((*XExpr)(_pTerm.X0).X5))).X0) != i32(152) {
goto _19
}
_5_j = i32(0)
_20:
if _5_j >= int32(_pScan.X5) {
goto _23
}
if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(_5_j)))) == (_pX.X8)) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(_5_j)))) == int32(_pX.X9)) {
goto _23
}
_5_j += 1
goto _20
_23:
if _5_j == int32(_pScan.X5) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(_5_j))) = _pX.X8
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(_5_j))) = _pX.X9
*(*uint8)(unsafe.Pointer(&(_pScan.X5))) += 1
}
_19:
if (uint32(_pTerm.X4) & (_pScan.X7)) == uint32(i32(0)) {
goto _27
}
if (_pScan.X2) == nil || (int32(_pTerm.X4)&i32(256)) != i32(0) {
goto _29
}
_10_pParse = (*XParse)((*XWhereInfo)(_pWC.X0).X0)
_pX = (*XExpr)(_pTerm.X0)
if _sqlite3IndexAffinityOk(tls, _pX, _pScan.X4) == 0 {
goto _8
}
func() {
if (*XExpr)(_pX.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130631), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereScanNextØ00__func__Ø000))), unsafe.Pointer(str(104511)))
crt.X__builtin_abort(tls)
}
}()
_10_pColl = _sqlite3BinaryCompareCollSeq(tls, _10_pParse, (*XExpr)(_pX.X4), (*XExpr)(_pX.X5))
if _10_pColl == nil {
_10_pColl = (*XCollSeq)((*Xsqlite3)(_10_pParse.X0).X2)
}
if _sqlite3StrICmp(tls, _10_pColl.X0, _pScan.X2) != 0 {
goto _8
}
_29:
if ((((int32(_pTerm.X4) & i32(130)) != i32(0)) && (int32(store36(&_pX, (*XExpr)((*XExpr)(_pTerm.X0).X5)).X0) == i32(152))) && ((_pX.X8) == (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int32)(unsafe.Pointer(&(_pScan.X9))))) + 4*uintptr(i32(0))))))) && (int32(_pX.X9) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[11]int16)(unsafe.Pointer(&(_pScan.X10))))) + 2*uintptr(i32(0)))))) {
goto _8
}
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pScan.X1))))) = _pWC
*(*int32)(unsafe.Pointer(&(_pScan.X8))) = _k + i32(1)
return _pTerm
_27:
_16:
_8:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _k += 1; return &_pTerm }())) += uintptr(48)
goto _7
_10:
_pWC = (*XWhereClause)(_pWC.X1)
_k = i32(0)
if _pWC != nil {
goto _6
}
if int32(_pScan.X6) >= int32(_pScan.X5) {
goto _3
}
_pWC = (*XWhereClause)(_pScan.X0)
_k = i32(0)
*(*uint8)(unsafe.Pointer(&(_pScan.X6))) += 1
goto _2
_3:
return nil
}
var _whereScanNextØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_whereScanNextØ00__func__Ø000[0], str(104521), 14)
}
// 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 _sqlite3IndexAffinityOk(tls *crt.TLS, _pExpr *XExpr, _idx_affinity int8) (r0 int32) {
var _aff int8
_aff = _comparisonAffinity(tls, _pExpr)
switch int32(_aff) {
case i32(65):
goto _1
case i32(66):
goto _2
default:
goto _3
}
_1:
return i32(1)
_2:
return bool2int(int32(_idx_affinity) == i32(66))
_3:
return bool2int(int32(_idx_affinity) >= i32(67))
}
// pExpr is a comparison operator. Return the type affinity that should
// be applied to both operands prior to doing the comparison.
func _comparisonAffinity(tls *crt.TLS, _pExpr *XExpr) (r0 int8) {
var _aff int8
func() {
if int32(_pExpr.X0) != i32(78) && int32(_pExpr.X0) != i32(74) && int32(_pExpr.X0) != i32(81) && int32(_pExpr.X0) != i32(79) && int32(_pExpr.X0) != i32(82) && int32(_pExpr.X0) != i32(80) && int32(_pExpr.X0) != i32(77) && int32(_pExpr.X0) != i32(72) && int32(_pExpr.X0) != i32(148) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91123), unsafe.Pointer((*int8)(unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000))), unsafe.Pointer(str(104535)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_pExpr.X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91126), unsafe.Pointer((*int8)(unsafe.Pointer(&_comparisonAffinityØ00__func__Ø000))), unsafe.Pointer(str(104715)))
crt.X__builtin_abort(tls)
}
}()
_aff = _sqlite3ExprAffinity(tls, (*XExpr)(_pExpr.X4))
if (*XExpr)(_pExpr.X5) != nil {
_aff = _sqlite3CompareAffinity(tls, (*XExpr)(_pExpr.X5), _aff)
goto _16
}
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
_aff = _sqlite3CompareAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0).X2)))))+20*uintptr(i32(0)))).X0), _aff)
goto _16
}
if int32(_aff) == i32(0) {
_aff = int8(i32(65))
}
_16:
return _aff
}
var _comparisonAffinityØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_comparisonAffinityØ00__func__Ø000[0], str(104728), 19)
}
// This function searches pList for an entry that matches the iCol-th column
// of index pIdx.
//
// If such an expression is found, its index in pList->a[] is returned. If
// no expression is found, -1 is returned.
func _findIndexCol(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _iBase int32, _pIdx *XIndex, _iCol int32) (r0 int32) {
var _i int32
var _zColl *int8
var _1_p *XExpr
var _2_pColl *XCollSeq
_zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_iCol)))
_i = i32(0)
_0:
if _i >= (_pList.X0) {
goto _3
}
_1_p = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0))
if int32(_1_p.X0) != i32(152) || int32(_1_p.X9) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iCol)))) || (_1_p.X8) != _iBase {
goto _6
}
_2_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0))
if (_2_pColl != nil) && (i32(0) == _sqlite3StrICmp(tls, _2_pColl.X0, _zColl)) {
return _i
}
_6:
_i += 1
goto _0
_3:
return i32(-1)
}
// Return TRUE if the iCol-th column of index pIdx is NOT NULL
func _indexColumnNotNull(tls *crt.TLS, _pIdx *XIndex, _iCol int32) (r0 int32) {
var _j int32
func() {
if _pIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130810), unsafe.Pointer((*int8)(unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000))), unsafe.Pointer(str(42069)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iCol < i32(0) || _iCol >= int32(_pIdx.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130811), unsafe.Pointer((*int8)(unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000))), unsafe.Pointer(str(104747)))
crt.X__builtin_abort(tls)
}
}()
_j = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iCol))))
if _j >= i32(0) {
return int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 16*uintptr(_j))).X3)
}
if _j == i32(-1) {
return i32(1)
}
func() {
if _j != i32(-2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130818), unsafe.Pointer((*int8)(unsafe.Pointer(&_indexColumnNotNullØ00__func__Ø000))), unsafe.Pointer(str(104777)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
var _indexColumnNotNullØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_indexColumnNotNullØ00__func__Ø000[0], str(104785), 19)
}
// Most queries use only a single table (they are not joins) and have
// simple == constraints against indexed fields. This routine attempts
// to plan those simple cases using much less ceremony than the
// general-purpose query planner, and thereby yield faster sqlite3_prepare()
// times for the common case.
//
// Return non-zero on success, if this query can be handled by this
// no-frills query planner. Return zero if this query needs the
// general-purpose query planner.
func _whereShortCut(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
var _iCur, _j, _3_opMask int32
var _pTab *XTable
var _pItem *TSrcList_item
var _pIdx *XIndex
var _pWInfo *XWhereInfo
var _pLoop *XWhereLoop
var _pTerm *XWhereTerm
var _pWC *XWhereClause
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
if (int32(_pWInfo.X10) & i32(32)) != 0 {
return i32(0)
}
func() {
if ((*XSrcList)(_pWInfo.X1).X0) < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134607), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereShortCutØ00__func__Ø000))), unsafe.Pointer(str(104804)))
crt.X__builtin_abort(tls)
}
}()
_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2)))))
_pTab = (*XTable)(_pItem.X4)
if (_pTab.X16) != 0 {
return i32(0)
}
if ((uint32(((*t28)(unsafe.Pointer(&(_pItem.X9))).X1)>>uint(i32(1))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return i32(0)
}
_iCur = _pItem.X11
_pWC = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))
_pLoop = (*XWhereLoop)(_pBuilder.X3)
*(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(0))
*(*uint16)(unsafe.Pointer(&(_pLoop.X11))) = uint16(i32(0))
_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, i32(-1), uint64(i32(0)), uint32(i32(130)), nil)
if _pTerm != nil {
*(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(4353))
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(i32(0)))) = _pTerm
*(*uint16)(unsafe.Pointer(&(_pLoop.X10))) = uint16(i32(1))
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = uint16(i32(1))
*(*int16)(unsafe.Pointer(&(_pLoop.X6))) = int16(i32(33))
goto _6
}
_pIdx = (*XIndex)(_pTab.X2)
_7:
if _pIdx == nil {
goto _10
}
func() {
if (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_pLoop.X15))))) != (**XWhereTerm)(unsafe.Pointer(_pLoop.X13)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134629), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereShortCutØ00__func__Ø000))), unsafe.Pointer(str(104830)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_pIdx.X15) == i32(0)) || ((*XExpr)(_pIdx.X9) != nil)) || (int32(_pIdx.X13) > i32(3)) {
goto _8
}
_3_opMask = func() int32 {
if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return i32(130)
}
return i32(2)
}()
_j = i32(0)
_18:
if _j >= int32(_pIdx.X13) {
goto _21
}
_pTerm = _sqlite3WhereFindTerm(tls, _pWC, _iCur, _j, uint64(i32(0)), uint32(_3_opMask), _pIdx)
if _pTerm == nil {
goto _21
}
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j))) = _pTerm
_j += 1
goto _18
_21:
if _j != int32(_pIdx.X13) {
goto _8
}
*(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(4609))
if (((uint32((_pIdx.X16)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0) || (((_pItem.X14) & (^_columnsInIndex(tls, _pIdx))) == uint64(i32(0))) {
{
p := (*uint32)(unsafe.Pointer(&(_pLoop.X9)))
*p = (*p) | uint32(i32(64))
sink5 = *p
}
}
*(*uint16)(unsafe.Pointer(&(_pLoop.X10))) = uint16(_j)
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = uint16(_j)
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4))))) = _pIdx
*(*int16)(unsafe.Pointer(&(_pLoop.X6))) = int16(i32(39))
goto _10
_8:
_pIdx = (*XIndex)(_pIdx.X5)
goto _7
_10:
_6:
if (_pLoop.X9) == 0 {
goto _26
}
*(*int16)(unsafe.Pointer(&(_pLoop.X7))) = i16(1)
*(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(i32(0)))).X18))))) = _pLoop
func() {
if ((*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))).X0) != i32(1) || _iCur != (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[64]int32)(unsafe.Pointer(&((*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))).X1))))) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134657), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereShortCutØ00__func__Ø000))), unsafe.Pointer(str(104864)))
crt.X__builtin_abort(tls)
}
}()
*(*uint64)(unsafe.Pointer(&(_pLoop.X1))) = uint64(i32(1))
*(*int32)(unsafe.Pointer(&((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(i32(0)))).X1))) = _iCur
*(*int16)(unsafe.Pointer(&(_pWInfo.X21))) = int16(i32(1))
if (*XExprList)(_pWInfo.X2) != nil {
*(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8((*XExprList)(_pWInfo.X2).X0)
}
if (int32(_pWInfo.X10) & i32(256)) != 0 {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(1))
}
*(*int8)(unsafe.Pointer(&(_pLoop.X2))) = int8(i32(48))
return i32(1)
_26:
return i32(0)
}
var _whereShortCutØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_whereShortCutØ00__func__Ø000[0], str(104918), 14)
}
// Return a bitmask where 1s indicate that the corresponding column of
// the table is used by an index. Only the first 63 columns are considered.
func _columnsInIndex(tls *crt.TLS, _pIdx *XIndex) (r0 uint64) {
var _j, _1_x int32
var _m uint64
_m = u64(0)
_j = int32(_pIdx.X14) - i32(1)
_0:
if _j < i32(0) {
goto _3
}
_1_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j))))
if _1_x < i32(0) {
goto _4
}
if _1_x < i32(63) {
{
p := &_m
*p = (*p) | (u64(1) << uint(_1_x))
sink17 = *p
}
}
_4:
_j -= 1
goto _0
_3:
return _m
}
// Add all WhereLoop objects for all tables
func _whereLoopAddAll(tls *crt.TLS, _pBuilder *XWhereLoopBuilder) (r0 int32) {
var _iTab, _rc int32
var _mPrereq, _mPrior, _1_mUnusable uint64
var _priorJointype uint8
var _db *Xsqlite3
var _pTabList *XSrcList
var _pItem, _pEnd, _3_p *TSrcList_item
var _pWInfo *XWhereInfo
var _pNew *XWhereLoop
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_mPrereq = u64(0)
_mPrior = u64(0)
_pTabList = (*XSrcList)(_pWInfo.X1)
_pEnd = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_pWInfo.X11)))
_db = (*Xsqlite3)((*XParse)(_pWInfo.X0).X0)
_rc = i32(0)
_priorJointype = u8(0)
_pNew = (*XWhereLoop)(_pBuilder.X3)
_whereLoopInit(tls, _pNew)
*func() **TSrcList_item { _iTab = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))
_0:
if uintptr(unsafe.Pointer(_pItem)) >= uintptr(unsafe.Pointer(_pEnd)) {
goto _3
}
_1_mUnusable = uint64(i32(0))
*(*uint8)(unsafe.Pointer(&(_pNew.X3))) = uint8(_iTab)
*(*uint64)(unsafe.Pointer(&(_pNew.X1))) = _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _pItem.X11)
if ((int32((*t28)(unsafe.Pointer(&(_pItem.X9))).X0) | int32(_priorJointype)) & i32(10)) != i32(0) {
_mPrereq = _mPrior
}
_priorJointype = (*t28)(unsafe.Pointer(&(_pItem.X9))).X0
if ((*XTable)(_pItem.X4).X16) == 0 {
goto _5
}
_3_p = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pItem)) + 68*uintptr(i32(1))))
_6:
if uintptr(unsafe.Pointer(_3_p)) >= uintptr(unsafe.Pointer(_pEnd)) {
goto _9
}
if (_1_mUnusable != 0) || (int32((*t28)(unsafe.Pointer(&(_3_p.X9))).X0)&i32(10)) != 0 {
{
p := &_1_mUnusable
*p = (*p) | _sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _3_p.X11)
sink17 = *p
}
}
*(*uintptr)(unsafe.Pointer(&_3_p)) += uintptr(68)
goto _6
_9:
_rc = _whereLoopAddVirtual(tls, _pBuilder, _mPrereq, _1_mUnusable)
goto _12
_5:
_rc = _whereLoopAddBtree(tls, _pBuilder, _mPrereq)
_12:
if _rc == i32(0) {
_rc = _whereLoopAddOr(tls, _pBuilder, _mPrereq, _1_mUnusable)
}
{
p := &_mPrior
*p = (*p) | (_pNew.X1)
sink17 = *p
}
if _rc != 0 || ((_db.X17) != 0) {
goto _3
}
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _iTab += 1; return &_pItem }())) += uintptr(68)
goto _0
_3:
_whereLoopClear(tls, _db, _pNew)
return _rc
}
// Add all WhereLoop objects for a table of the join identified by
// pBuilder->pNew->iTab. That table is guaranteed to be a virtual table.
//
// If there are no LEFT or CROSS JOIN joins in the query, both mPrereq and
// mUnusable are set to 0. Otherwise, mPrereq is a mask of all FROM clause
// entries that occur before the virtual table in the FROM clause and are
// separated from it by at least one LEFT or CROSS JOIN. Similarly, the
// mUnusable mask contains all FROM clause entries that occur after the
// virtual table and are separated from it by at least one LEFT or
// CROSS JOIN.
//
// For example, if the query were:
//
// ... FROM t1, t2 LEFT JOIN t3, t4, vt CROSS JOIN t5, t6;
//
// then mPrereq corresponds to (t1, t2) and mUnusable to (t5, t6).
//
// All the tables in mPrereq must be scanned before the current virtual
// table. So any terms for which all prerequisites are satisfied by
// mPrereq may be specified as "usable" in all calls to xBestIndex.
// Conversely, all tables in mUnusable must be scanned after the current
// virtual table, so any terms for which the prerequisites overlap with
// mUnusable should always be configured as "not-usable" for xBestIndex.
func _whereLoopAddVirtual(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
var _rc, _nConstraint, _bIn, _2_seenZero, _2_seenZeroNoIN, _5_i int32
var _mBest, _2_mPrev, _2_mBestNoIn, _5_mNext, _6_mThis uint64
var _mNoOmit uint16
var _pSrc *TSrcList_item
var _pParse *XParse
var _pWInfo *XWhereInfo
var _p *Xsqlite3_index_info
var _pNew *XWhereLoop
var _pWC *XWhereClause
_rc = i32(0)
func() {
if (_mPrereq & _mUnusable) != uint64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133550), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000))), unsafe.Pointer(str(104932)))
crt.X__builtin_abort(tls)
}
}()
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_pParse = (*XParse)(_pWInfo.X0)
_pWC = (*XWhereClause)(_pBuilder.X1)
_pNew = (*XWhereLoop)(_pBuilder.X3)
_pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 68*uintptr(_pNew.X3)))
func() {
if ((*XTable)(_pSrc.X4).X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133556), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000))), unsafe.Pointer(str(104957)))
crt.X__builtin_abort(tls)
}
}()
_p = _allocateIndexInfo(tls, _pParse, _pWC, _mUnusable, _pSrc, (*XExprList)(_pBuilder.X2), &_mNoOmit)
if _p == nil {
return _sqlite3NomemError(tls, i32(133559))
}
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(1024))
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(0))
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(i32(0))
_nConstraint = _p.X0
if _whereLoopResize(tls, (*Xsqlite3)(_pParse.X0), _pNew, _nConstraint) != 0 {
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_p))
return _sqlite3NomemError(tls, i32(133567))
}
_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, u64(18446744073709551615), uint16(i32(0)), _p, _mNoOmit, &_bIn)
if _rc != i32(0) || store17(&_mBest, (_pNew.X0)&(^_mPrereq)) == uint64(i32(0)) {
goto _7
}
_2_seenZero = i32(0)
_2_seenZeroNoIN = i32(0)
_2_mPrev = u64(0)
_2_mBestNoIn = u64(0)
if _bIn == 0 {
goto _8
}
_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, u64(18446744073709551615), uint16(i32(1)), _p, _mNoOmit, &_bIn)
func() {
if _bIn != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133591), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000))), unsafe.Pointer(str(104979)))
crt.X__builtin_abort(tls)
}
}()
_2_mBestNoIn = (_pNew.X0) & (^_mPrereq)
if _2_mBestNoIn == uint64(i32(0)) {
_2_seenZero = i32(1)
_2_seenZeroNoIN = i32(1)
}
_8:
if _rc != i32(0) {
goto _13
}
_5_mNext = u64(18446744073709551615)
func() {
if _5_mNext <= uint64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133604), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualØ00__func__Ø000))), unsafe.Pointer(str(104986)))
crt.X__builtin_abort(tls)
}
}()
_5_i = i32(0)
_16:
if _5_i >= _nConstraint {
goto _19
}
_6_mThis = ((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr(_p.X1)+12*uintptr(_5_i))).X3))).X11) & (^_mPrereq)
if (_6_mThis > _2_mPrev) && (_6_mThis < _5_mNext) {
_5_mNext = _6_mThis
}
_5_i += 1
goto _16
_19:
_2_mPrev = _5_mNext
if _5_mNext == u64(18446744073709551615) {
goto _13
}
if (_5_mNext == _mBest) || (_5_mNext == _2_mBestNoIn) {
goto _8
}
_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _5_mNext|_mPrereq, uint16(i32(0)), _p, _mNoOmit, &_bIn)
if (_pNew.X0) != _mPrereq {
goto _25
}
_2_seenZero = i32(1)
if _bIn == i32(0) {
_2_seenZeroNoIN = i32(1)
}
_25:
goto _8
_13:
if _rc != i32(0) || _2_seenZero != i32(0) {
goto _28
}
_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, uint16(i32(0)), _p, _mNoOmit, &_bIn)
if _bIn == i32(0) {
_2_seenZeroNoIN = i32(1)
}
_28:
if (_rc == i32(0)) && (_2_seenZeroNoIN == i32(0)) {
_rc = _whereLoopAddVirtualOne(tls, _pBuilder, _mPrereq, _mPrereq, uint16(i32(1)), _p, _mNoOmit, &_bIn)
}
_7:
if (_p.X7) != 0 {
Xsqlite3_free(tls, (unsafe.Pointer)(_p.X6))
}
_sqlite3DbFreeNN(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_p))
return _rc
}
var _whereLoopAddVirtualØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopAddVirtualØ00__func__Ø000[0], str(104994), 20)
}
// Allocate and populate an sqlite3_index_info structure. It is the
// responsibility of the caller to eventually release the structure
// by passing the pointer returned by this function to sqlite3_free().
func _allocateIndexInfo(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _mUnusable uint64, _pSrc *TSrcList_item, _pOrderBy *XExprList, _pmNoOmit *uint16) (r0 *Xsqlite3_index_info) {
var _i, _j, _nTerm, _nOrderBy, _2_n int32
var _mNoOmit uint16
var _6_op uint8
var _3_pExpr, _9_pExpr *XExpr
var _pIdxInfo *Xsqlite3_index_info
var _pIdxCons *Tsqlite3_index_constraint
var _pIdxOrderBy, _pUsage *Tsqlite3_index_orderby
var _pTerm *XWhereTerm
_mNoOmit = u16(0)
*func() **XWhereTerm { _i = store1(&_nTerm, i32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.X5)
_0:
if _i >= (_pWC.X3) {
goto _3
}
if (_pTerm.X8) != (_pSrc.X11) {
goto _1
}
if ((_pTerm.X11) & _mUnusable) != 0 {
goto _1
}
func() {
if ((int32(_pTerm.X4) & i32(-2049)) & ((int32(_pTerm.X4) & i32(-2049)) - i32(1))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131246), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105014)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pTerm.X4) & i32(-2433)) == i32(0) {
goto _1
}
if (int32(_pTerm.X3) & i32(0)) != 0 {
goto _1
}
func() {
if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131253), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105057)))
crt.X__builtin_abort(tls)
}
}()
_nTerm += 1
_1:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
goto _0
_3:
_nOrderBy = i32(0)
if _pOrderBy == nil {
goto _12
}
_2_n = _pOrderBy.X0
_i = i32(0)
_13:
if _i >= _2_n {
goto _16
}
_3_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_i))).X0)
if (int32(_3_pExpr.X0) != i32(152)) || ((_3_pExpr.X8) != (_pSrc.X11)) {
goto _16
}
_i += 1
goto _13
_16:
if _i == _2_n {
_nOrderBy = _2_n
}
_12:
_pIdxInfo = (*Xsqlite3_index_info)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64((u32(64)+(u32(20)*uint32(_nTerm)))+(u32(8)*uint32(_nOrderBy)))))
if _pIdxInfo == nil {
_sqlite3ErrorMsg(tls, _pParse, str(59419))
return nil
}
_pIdxCons = (*Tsqlite3_index_constraint)(unsafe.Pointer((*Xsqlite3_index_info)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxInfo)) + 64*uintptr(i32(1))))))
_pIdxOrderBy = (*Tsqlite3_index_orderby)(unsafe.Pointer((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_nTerm)))))
_pUsage = (*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_nOrderBy)))
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X0))) = _nTerm
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X2))) = _nOrderBy
*(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1))))) = _pIdxCons
*(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X3))))) = _pIdxOrderBy
*(**Tsqlite3_index_orderby)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X4))))) = _pUsage
*func() **XWhereTerm { _i = store1(&_j, i32(0)); return &_pTerm }() = (*XWhereTerm)(_pWC.X5)
_21:
if _i >= (_pWC.X3) {
goto _24
}
if (_pTerm.X8) != (_pSrc.X11) {
goto _22
}
if ((_pTerm.X11) & _mUnusable) != 0 {
goto _22
}
func() {
if ((int32(_pTerm.X4) & i32(-2049)) & ((int32(_pTerm.X4) & i32(-2049)) - i32(1))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131302), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105014)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pTerm.X4) & i32(-2433)) == i32(0) {
goto _22
}
if (int32(_pTerm.X3) & i32(0)) != 0 {
goto _22
}
func() {
if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131309), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105057)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X0))) = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))
*(*int32)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X3))) = _i
_6_op = uint8(int32(uint8(_pTerm.X4)) & i32(8191))
if int32(_6_op) == i32(1) {
_6_op = uint8(i32(2))
}
if int32(_6_op) == i32(64) {
_6_op = _pTerm.X6
}
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = _6_op
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
i32(0)
func() {
if (int32(_pTerm.X4) & i32(127)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131327), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocateIndexInfoØ00__func__Ø000))), unsafe.Pointer(str(105083)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_6_op)&i32(60)) == 0 || _sqlite3ExprIsVector(tls, (*XExpr)((*XExpr)(_pTerm.X0).X5)) == 0 {
goto _38
}
if _i < i32(16) {
{
p := &_mNoOmit
*p = uint16(int32(*p) | (i32(1) << uint(_i)))
sink14 = *p
}
}
if int32(_6_op) == i32(16) {
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(8))
}
if int32(_6_op) == i32(4) {
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_constraint)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxCons)) + 12*uintptr(_j))).X1))) = uint8(i32(32))
}
_38:
_j += 1
_22:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
goto _21
_24:
_i = i32(0)
_42:
if _i >= _nOrderBy {
goto _45
}
_9_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_i))).X0)
*(*int32)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_i))).X0))) = int32(_9_pExpr.X9)
*(*uint8)(unsafe.Pointer(&((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdxOrderBy)) + 8*uintptr(_i))).X1))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_i))).X3
_i += 1
goto _42
_45:
*_pmNoOmit = _mNoOmit
return _pIdxInfo
}
var _allocateIndexInfoØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_allocateIndexInfoØ00__func__Ø000[0], str(105149), 18)
}
// Increase the memory allocation for pLoop->aLTerm[] to be at least n.
func _whereLoopResize(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop, _n int32) (r0 int32) {
var _paNew **XWhereTerm
if int32(_p.X12) >= _n {
return i32(0)
}
_n = (_n + i32(7)) & i32(-8)
_paNew = (**XWhereTerm)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(4)*uint32(_n))))
if _paNew == nil {
return _sqlite3NomemError(tls, i32(132201))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_paNew), (unsafe.Pointer)(_p.X13), u32(4)*uint32(_p.X12))
if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p.X13))
}
*(***XWhereTerm)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _paNew
*(*uint16)(unsafe.Pointer(&(_p.X12))) = uint16(_n)
return i32(0)
}
// Argument pIdxInfo is already populated with all constraints that may
// be used by the virtual table identified by pBuilder->pNew->iTab. This
// function marks a subset of those constraints usable, invokes the
// xBestIndex method and adds the returned plan to pBuilder.
//
// A constraint is marked usable if:
//
// * Argument mUsable indicates that its prerequisites are available, and
//
// * It is not one of the operators specified in the mExclude mask passed
// as the fourth argument (which in practice is either WO_IN or 0).
//
// Argument mPrereq is a mask of tables that must be scanned before the
// virtual table in question. These are added to the plans prerequisites
// before it is added to pBuilder.
//
// Output parameter *pbIn is set to true if the plan added to pBuilder
// uses one or more WO_IN terms, or false otherwise.
func _whereLoopAddVirtualOne(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUsable uint64, _mExclude uint16, _pIdxInfo *Xsqlite3_index_info, _mNoOmit uint16, _pbIn *int32) (r0 int32) {
var _i, _mxTerm, _rc, _nConstraint, _3_iTerm, _4_j int32
var _pSrc *TSrcList_item
var _pParse *XParse
var _pIdxCons *Tsqlite3_index_constraint
var _pUsage *Tsqlite3_index_orderby
var _pNew *XWhereLoop
var _1_pTerm, _4_pTerm *XWhereTerm
var _pWC *XWhereClause
_pWC = (*XWhereClause)(_pBuilder.X1)
_pUsage = (*Tsqlite3_index_orderby)(_pIdxInfo.X4)
_rc = i32(0)
_pNew = (*XWhereLoop)(_pBuilder.X3)
_pParse = (*XParse)((*XWhereInfo)(_pBuilder.X0).X0)
_pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pBuilder.X0).X1).X2))))) + 68*uintptr(_pNew.X3)))
_nConstraint = _pIdxInfo.X0
func() {
if (_mUsable & _mPrereq) != _mPrereq {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133399), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105167)))
crt.X__builtin_abort(tls)
}
}()
*_pbIn = i32(0)
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq
_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1)))))
_i = i32(0)
_2:
if _i >= _nConstraint {
goto _5
}
_1_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_pIdxCons.X3)))
*(*uint8)(unsafe.Pointer(&(_pIdxCons.X2))) = uint8(i32(0))
if (((_1_pTerm.X11) & _mUsable) == (_1_pTerm.X11)) && ((int32(_1_pTerm.X4) & int32(_mExclude)) == i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pIdxCons.X2))) = uint8(i32(1))
}
*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
goto _2
_5:
crt.Xmemset(tls, (unsafe.Pointer)(_pUsage), i32(0), u32(8)*uint32(_nConstraint))
func() {
if (_pIdxInfo.X7) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133418), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105196)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pIdxInfo.X6))) = nil
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X5))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X8))) = i32(0)
*(*float64)(unsafe.Pointer(&(_pIdxInfo.X9))) = float64(5e+98)
*(*int64)(unsafe.Pointer(&(_pIdxInfo.X10))) = int64(i32(25))
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X11))) = i32(0)
*(*uint64)(unsafe.Pointer(&(_pIdxInfo.X12))) = uint64(int64(_pSrc.X14))
_rc = _vtabBestIndex(tls, _pParse, (*XTable)(_pSrc.X4), _pIdxInfo)
if _rc != 0 {
return _rc
}
_mxTerm = i32(-1)
func() {
if int32(_pNew.X12) < _nConstraint {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133432), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105226)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_13:
if _i >= _nConstraint {
goto _16
}
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(_i))) = nil
_i += 1
goto _13
_16:
*(*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3))) = uint16(i32(0))
_pIdxCons = *(**Tsqlite3_index_constraint)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdxInfo.X1)))))
_i = i32(0)
_17:
if _i >= _nConstraint {
goto _20
}
if store1(&_3_iTerm, ((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pUsage))+8*uintptr(_i))).X0)-i32(1)) < i32(0) {
goto _21
}
_4_j = _pIdxCons.X3
if ((((_3_iTerm >= _nConstraint) || (_4_j < i32(0))) || (_4_j >= (_pWC.X3))) || ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(_3_iTerm)))) != nil)) || (int32(_pIdxCons.X2) == i32(0)) {
_rc = i32(1)
_sqlite3ErrorMsg(tls, _pParse, str(105252), unsafe.Pointer((*XTable)(_pSrc.X4).X0))
return _rc
}
_4_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_4_j)))
{
p := (*uint64)(unsafe.Pointer(&(_pNew.X0)))
*p = (*p) | (_4_pTerm.X11)
sink17 = *p
}
func() {
if _3_iTerm >= int32(_pNew.X12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133456), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105278)))
crt.X__builtin_abort(tls)
}
}()
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(_3_iTerm))) = _4_pTerm
if _3_iTerm > _mxTerm {
_mxTerm = _3_iTerm
}
if (_3_iTerm < i32(16)) && (((*Tsqlite3_index_orderby)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pUsage)) + 8*uintptr(_i))).X1) != 0) {
{
p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3)))
*p = uint16(int32(*p) | (i32(1) << uint(_3_iTerm)))
sink14 = *p
}
}
if (int32(_4_pTerm.X4) & i32(1)) != i32(0) {
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X8))) = i32(0)
{
p := (*int32)(unsafe.Pointer(&(_pIdxInfo.X11)))
*p = (*p) & i32(-2)
sink1 = *p
}
*_pbIn = i32(1)
func() {
if (int32(_mExclude) & i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133470), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105297)))
crt.X__builtin_abort(tls)
}
}()
}
_21:
*(*uintptr)(unsafe.Pointer(func() **Tsqlite3_index_constraint { _i += 1; return &_pIdxCons }())) += uintptr(12)
goto _17
_20:
{
p := (*uint16)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X3)))
*p = uint16(int32(*p) & (^int32(_mNoOmit)))
sink14 = *p
}
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(_mxTerm + i32(1))
func() {
if int32(_pNew.X10) > int32(_pNew.X12) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133477), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddVirtualOneØ00__func__Ø000))), unsafe.Pointer(str(105319)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _pIdxInfo.X5
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(_pIdxInfo.X7)
*(*int32)(unsafe.Pointer(&(_pIdxInfo.X7))) = i32(0)
*(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))) = _pIdxInfo.X6
*(*int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = int8(func() int32 {
if (_pIdxInfo.X8) != 0 {
return (_pIdxInfo.X2)
}
return i32(0)
}())
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstFromDouble(tls, _pIdxInfo.X9)
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _sqlite3LogEst(tls, uint64(_pIdxInfo.X10))
if ((_pIdxInfo.X11) & i32(1)) != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(4096))
sink5 = *p
}
goto _40
}
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) & uint32(i32(-4097))
sink5 = *p
}
_40:
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1) != 0 {
Xsqlite3_free(tls, (unsafe.Pointer)((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint8(i32(0))
}
return _rc
}
var _whereLoopAddVirtualOneØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopAddVirtualOneØ00__func__Ø000[0], str(105346), 23)
}
// The table object reference passed as the second argument to this function
// must represent a virtual table. This function invokes the xBestIndex()
// method of the virtual table with the sqlite3_index_info object that
// comes in as the 3rd argument to this function.
//
// If an error occurs, pParse is populated with an error message and a
// non-zero value is returned. Otherwise, 0 is returned and the output
// part of the sqlite3_index_info structure is left populated.
//
// Whether or not an error is returned, it is the responsibility of the
// caller to eventually free p->idxStr if p->needToFreeIdxStr indicates
// that this is required.
func _vtabBestIndex(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _p *Xsqlite3_index_info) (r0 int32) {
var _rc int32
var _pVtab *Xsqlite3_vtab
_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.X0), _pTab).X2)
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, *Xsqlite3_index_info) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
}{((*Xsqlite3_module)(_pVtab.X0).X3)})))(tls, _pVtab, _p)
if _rc == i32(0) {
goto _0
}
if _rc == i32(7) {
_sqlite3OomFault(tls, (*Xsqlite3)(_pParse.X0))
goto _4
}
if (_pVtab.X2) == nil {
_sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_sqlite3ErrStr(tls, _rc)))
goto _4
}
_sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(_pVtab.X2))
_4:
_0:
Xsqlite3_free(tls, (unsafe.Pointer)(_pVtab.X2))
*(**int8)(unsafe.Pointer(&(_pVtab.X2))) = nil
return _pParse.X16
}
// Convert a double into a LogEst
// In other words, compute an approximation for 10*log2(x).
func _sqlite3LogEstFromDouble(tls *crt.TLS, _x float64) (r0 int16) {
var _e int16
var _a uint64
i32(0)
if _x <= float64(i32(1)) {
return int16(i32(0))
}
if _x <= float64(i32(2000000000)) {
return _sqlite3LogEst(tls, uint64(_x))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(&_a), (unsafe.Pointer)(&_x), uint32(i32(8)))
_e = int16((_a >> uint(i32(52))) - uint64(i32(1022)))
return int16(int32(_e) * i32(10))
}
// Insert or replace a WhereLoop entry using the template supplied.
//
// An existing WhereLoop entry might be overwritten if the new template
// is better and has fewer dependencies. Or the template will be ignored
// and no insert will occur if an existing WhereLoop is faster and has
// fewer dependencies than the template. Otherwise a new WhereLoop is
// added based on the template.
//
// If pBuilder->pOrSet is not NULL then we care about only the
// prerequisites and rRun and nOut costs of the N best loops. That
// information is gathered in the pBuilder->pOrSet object. This special
// processing mode is used only for OR clause processing.
//
// When accumulating multiple loops (when pBuilder->pOrSet is NULL) we
// still might overwrite similar loops with the new template if the
// new template is better. Loops may be overwritten if the following
// conditions are met:
//
// (1) They have the same iTab.
// (2) They have the same iSortIdx.
// (3) The template has same or fewer dependencies than the current loop
// (4) The template has the same or lower cost than the current loop
func _whereLoopInsert(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pTemplate *XWhereLoop) (r0 int32) {
var _rc int32
var _db *Xsqlite3
var _8_pIndex *XIndex
var _pWInfo *XWhereInfo
var _p, _6_pToDel *XWhereLoop
var _ppPrev, _6_ppTail **XWhereLoop
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_db = (*Xsqlite3)((*XParse)(_pWInfo.X0).X0)
if (*XWhereOrSet)(_pBuilder.X4) == nil {
goto _0
}
if (_pTemplate.X10) != 0 {
_whereOrInsert(tls, (*XWhereOrSet)(_pBuilder.X4), _pTemplate.X0, _pTemplate.X6, _pTemplate.X7)
}
return i32(0)
_0:
_whereLoopAdjustCost(tls, (*XWhereLoop)(_pWInfo.X19), _pTemplate)
_ppPrev = _whereLoopFindLesser(tls, (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X19))))), _pTemplate)
if _ppPrev == nil {
return i32(0)
}
_p = *_ppPrev
if _p != nil {
goto _4
}
*_ppPrev = store67(&_p, (*XWhereLoop)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(72)))))
if _p == nil {
return _sqlite3NomemError(tls, i32(132499))
}
_whereLoopInit(tls, _p)
*(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14))))) = nil
goto _6
_4:
_6_ppTail = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14)))))
_7:
if (*_6_ppTail) == nil {
goto _8
}
_6_ppTail = _whereLoopFindLesser(tls, _6_ppTail, _pTemplate)
if _6_ppTail == nil {
goto _8
}
_6_pToDel = *_6_ppTail
if _6_pToDel == nil {
goto _8
}
*_6_ppTail = (*XWhereLoop)(_6_pToDel.X14)
_whereLoopDelete(tls, _db, _6_pToDel)
goto _7
_8:
_6:
_rc = _whereLoopXfer(tls, _db, _p, _pTemplate)
if ((_p.X9) & uint32(i32(1024))) != uint32(i32(0)) {
goto _11
}
_8_pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4)
if (_8_pIndex != nil) && ((_8_pIndex.X11) == i32(0)) {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))))) = nil
}
_11:
return _rc
}
// Try to insert a new prerequisite/cost entry into the WhereOrSet pSet.
//
// The new entry might overwrite an existing entry, or it might be
// appended, or it might be discarded. Do whatever is the right thing
// so that pSet keeps the N_OR_COST best entries seen so far.
func _whereOrInsert(tls *crt.TLS, _pSet *XWhereOrSet, _prereq uint64, _rRun int16, _nOut int16) (r0 int32) {
var _i uint16
var _p *XWhereOrCost
*func() **XWhereOrCost { _i = _pSet.X0; return &_p }() = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1)))))
_0:
if int32(_i) <= i32(0) {
goto _3
}
if (int32(_rRun) <= int32(_p.X1)) && ((_prereq & (_p.X0)) == _prereq) {
goto _whereOrInsert_done
}
if (int32(_p.X1) <= int32(_rRun)) && (((_p.X0) & _prereq) == (_p.X0)) {
return i32(0)
}
*(*uintptr)(unsafe.Pointer(func() **XWhereOrCost { _i -= 1; return &_p }())) += uintptr(12)
goto _0
_3:
if int32(_pSet.X0) < i32(3) {
_p = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))) + 12*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pSet.X0))), uint16(1)))))
*(*int16)(unsafe.Pointer(&(_p.X2))) = _nOut
goto _whereOrInsert_done
}
_p = (*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1)))))
_i = uint16(i32(1))
_10:
if int32(_i) >= int32(_pSet.X0) {
goto _13
}
if int32(_p.X1) > int32((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1)))))+12*uintptr(_i))).X1) {
_p = (*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSet.X1))))))) + uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(_i)))))*uintptr(unsafe.Pointer((*XWhereOrCost)(unsafe.Pointer(uintptr(12)))))))))))
}
_i += 1
goto _10
_13:
if int32(_p.X1) <= int32(_rRun) {
return i32(0)
}
_whereOrInsert_done:
*(*uint64)(unsafe.Pointer(&(_p.X0))) = _prereq
*(*int16)(unsafe.Pointer(&(_p.X1))) = _rRun
if int32(_p.X2) > int32(_nOut) {
*(*int16)(unsafe.Pointer(&(_p.X2))) = _nOut
}
return i32(1)
}
// Try to adjust the cost of WhereLoop pTemplate upwards or downwards so
// that:
//
// (1) pTemplate costs less than any other WhereLoops that are a proper
// subset of pTemplate
//
// (2) pTemplate costs more than any other WhereLoops for which pTemplate
// is a proper subset.
//
// To say "WhereLoop X is a proper subset of Y" means that X uses fewer
// WHERE clause terms than Y and that every WHERE clause term used by X is
// also used by Y.
func _whereLoopAdjustCost(tls *crt.TLS, _p *XWhereLoop, _pTemplate *XWhereLoop) {
if ((_pTemplate.X9) & uint32(i32(512))) == uint32(i32(0)) {
return
}
_0:
if _p == nil {
goto _4
}
if int32(_p.X3) != int32(_pTemplate.X3) {
goto _2
}
if ((_p.X9) & uint32(i32(512))) == uint32(i32(0)) {
goto _2
}
if _whereLoopCheaperProperSubset(tls, _p, _pTemplate) != 0 {
*(*int16)(unsafe.Pointer(&(_pTemplate.X6))) = _p.X6
*(*int16)(unsafe.Pointer(&(_pTemplate.X7))) = int16(int32(_p.X7) - i32(1))
goto _9
}
if _whereLoopCheaperProperSubset(tls, _pTemplate, _p) != 0 {
*(*int16)(unsafe.Pointer(&(_pTemplate.X6))) = _p.X6
*(*int16)(unsafe.Pointer(&(_pTemplate.X7))) = int16(int32(_p.X7) + i32(1))
}
_9:
_2:
_p = (*XWhereLoop)(_p.X14)
goto _0
_4:
}
// Return TRUE if all of the following are true:
//
// (1) X has the same or lower cost that Y
// (2) X is a proper subset of Y
// (3) X skips at least as many columns as Y
//
// By "proper subset" we mean that X uses fewer WHERE clause terms
// than Y and that every WHERE clause term used by X is also used
// by Y.
//
// If X is a proper subset of Y then Y is a better choice and ought
// to have a lower cost. This routine returns TRUE when that cost
// relationship is inverted and needs to be adjusted. The third rule
// was added because if X uses skip-scan less than Y it still might
// deserve a lower cost even if it is a proper subset of Y.
func _whereLoopCheaperProperSubset(tls *crt.TLS, _pX *XWhereLoop, _pY *XWhereLoop) (r0 int32) {
var _i, _j int32
if (int32(_pX.X10) - int32(_pX.X11)) >= (int32(_pY.X10) - int32(_pY.X11)) {
return i32(0)
}
if int32(_pY.X11) > int32(_pX.X11) {
return i32(0)
}
if int32(_pX.X6) < int32(_pY.X6) {
goto _2
}
if int32(_pX.X6) > int32(_pY.X6) {
return i32(0)
}
if int32(_pX.X7) > int32(_pY.X7) {
return i32(0)
}
_2:
_i = int32(_pX.X10) - i32(1)
_5:
if _i < i32(0) {
goto _8
}
if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pX.X13)) + 4*uintptr(_i)))) == nil {
goto _6
}
_j = int32(_pY.X10) - i32(1)
_10:
if _j < i32(0) {
goto _13
}
if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pY.X13)) + 4*uintptr(_j)))) == (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pX.X13)) + 4*uintptr(_i)))) {
goto _13
}
_j -= 1
goto _10
_13:
if _j < i32(0) {
return i32(0)
}
_6:
_i -= 1
goto _5
_8:
return i32(1)
}
// Search the list of WhereLoops in *ppPrev looking for one that can be
// supplanted by pTemplate.
//
// Return NULL if the WhereLoop list contains an entry that can supplant
// pTemplate, in other words if pTemplate does not belong on the list.
//
// If pX is a WhereLoop that pTemplate can supplant, then return the
// link that points to pX.
//
// If pTemplate cannot supplant any existing element of the list but needs
// to be added to the list, then return a pointer to the tail of the list.
func _whereLoopFindLesser(tls *crt.TLS, _ppPrev **XWhereLoop, _pTemplate *XWhereLoop) (r0 **XWhereLoop) {
var _p *XWhereLoop
_p = *_ppPrev
_0:
if _p == nil {
goto _3
}
if (int32(_p.X3) != int32(_pTemplate.X3)) || (int32(_p.X4) != int32(_pTemplate.X4)) {
goto _1
}
func() {
if int32(_p.X5) != i32(0) && int32(_pTemplate.X5) != i32(0) && int32(_p.X5) != int32(_pTemplate.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132363), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000))), unsafe.Pointer(str(105369)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_p.X5) < int32(_pTemplate.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132369), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000))), unsafe.Pointer(str(105438)))
crt.X__builtin_abort(tls)
}
}()
if ((((((_p.X9) & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pTemplate.X11) == i32(0))) && (((_pTemplate.X9) & uint32(i32(512))) != uint32(i32(0)))) && (((_pTemplate.X9) & uint32(i32(1))) != uint32(i32(0)))) && (((_p.X0) & (_pTemplate.X0)) == (_pTemplate.X0)) {
goto _3
}
if (((((_p.X0) & (_pTemplate.X0)) == (_p.X0)) && (int32(_p.X5) <= int32(_pTemplate.X5))) && (int32(_p.X6) <= int32(_pTemplate.X6))) && (int32(_p.X7) <= int32(_pTemplate.X7)) {
return nil
}
if ((((_p.X0) & (_pTemplate.X0)) == (_pTemplate.X0)) && (int32(_p.X6) >= int32(_pTemplate.X6))) && (int32(_p.X7) >= int32(_pTemplate.X7)) {
func() {
if int32(_p.X5) < int32(_pTemplate.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132405), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopFindLesserØ00__func__Ø000))), unsafe.Pointer(str(105438)))
crt.X__builtin_abort(tls)
}
}()
goto _3
}
_1:
*func() **XWhereLoop {
_ppPrev = (**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X14)))))
return &_p
}() = *_ppPrev
goto _0
_3:
return _ppPrev
}
var _whereLoopFindLesserØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopFindLesserØ00__func__Ø000[0], str(105467), 20)
}
// Delete a WhereLoop object
func _whereLoopDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
_whereLoopClear(tls, _db, _p)
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p))
}
// Deallocate internal memory used by a WhereLoop object
func _whereLoopClear(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
if (**XWhereTerm)(unsafe.Pointer(_p.X13)) != (**XWhereTerm)(unsafe.Pointer((*[3]unsafe.Pointer)(unsafe.Pointer(&(_p.X15))))) {
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_p.X13))
}
_whereLoopClearUnion(tls, _db, _p)
_whereLoopInit(tls, _p)
}
// Clear the WhereLoop.u union. Leave WhereLoop.pLTerm intact.
func _whereLoopClearUnion(tls *crt.TLS, _db *Xsqlite3, _p *XWhereLoop) {
if ((_p.X9) & uint32(i32(17408))) == 0 {
goto _0
}
if (((_p.X9) & uint32(i32(1024))) != uint32(i32(0))) && (((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X1) != 0) {
Xsqlite3_free(tls, (unsafe.Pointer)((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X1))) = uint8(i32(0))
*(**int8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))) = nil
goto _5
}
if (((_p.X9) & uint32(i32(16384))) != uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4) != nil) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4).X4))
_sqlite3DbFreeNN(tls, _db, (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4)
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_p.X8))))).X4))))) = nil
}
_5:
_0:
}
// Transfer content from the second pLoop into the first.
func _whereLoopXfer(tls *crt.TLS, _db *Xsqlite3, _pTo *XWhereLoop, _pFrom *XWhereLoop) (r0 int32) {
_whereLoopClearUnion(tls, _db, _pTo)
if _whereLoopResize(tls, _db, _pTo, int32(_pFrom.X10)) != 0 {
crt.Xmemset(tls, (unsafe.Pointer)((*t62)(unsafe.Pointer(&(_pTo.X8)))), i32(0), u32(12))
return _sqlite3NomemError(tls, i32(132216))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo), (unsafe.Pointer)(_pFrom), u32(48))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo.X13), (unsafe.Pointer)(_pFrom.X13), uint32(_pTo.X10)*u32(4))
if ((_pFrom.X9) & uint32(i32(1024))) != 0 {
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pFrom.X8))))).X1))) = uint8(i32(0))
goto _3
}
if ((_pFrom.X9) & uint32(i32(16384))) != uint32(i32(0)) {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pFrom.X8))))).X4))))) = nil
}
_3:
return i32(0)
}
// Add all WhereLoop objects for a single table of the join where the table
// is identified by pBuilder->pNew->iTab. That table is guaranteed to be
// a b-tree table, not a virtual table.
//
// The costs (WhereLoop.rRun) of the b-tree loops added by this function
// are calculated as follows:
//
// For a full scan, assuming the table (or index) contains nRow rows:
//
// cost = nRow * 3.0 // full-table scan
// cost = nRow * K // scan of covering index
// cost = nRow * (K+3.0) // scan of non-covering index
//
// where K is a value between 1.1 and 3.0 set based on the relative
// estimated average size of the index and table records.
//
// For an index scan, where nVisit is the number of index rows visited
// by the scan, and nSeek is the number of seek operations required on
// the index b-tree:
//
// cost = nSeek * (log(nRow) + K * nVisit) // covering index
// cost = nSeek * (log(nRow) + (K+3.0) * nVisit) // non-covering index
//
// Normally, nSeek is 1. nSeek values greater than 1 come about if the
// WHERE clause includes "x IN (....)" terms used in place of "x=?". Or when
// implicit "x IN (SELECT x FROM tbl)" terms are added for skip-scans.
//
// The estimated values (nRow, nVisit, nSeek) often contain a large amount
// of uncertainty. For this reason, scoring is designed to pick plans that
// "do the least harm" if the estimates are inaccurate. For example, a
// log(nRow) factor is omitted from a non-covering index scan in order to
// bias the scoring in favor of using an index, since the worst-case
// performance of using an index is far better than the worst-case performance
// of a full table scan.
func _whereLoopAddBtree(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64) (r0 int32) {
var _aiColumnPk, _rSize, _rLogSize, _16_nLookup int16
var _rc, _iSortIdx, _b, _16_ii, _16_iCur int32
var _12_m uint64
var _pTab *XTable
var _pTabList *XSrcList
var _pSrc *TSrcList_item
var _pProbe, _3_pFirst *XIndex
var _sPk XIndex
var _pWInfo *XWhereInfo
var _pNew *XWhereLoop
var _5_pTerm, _5_pWCEnd, _17_pTerm *XWhereTerm
var _pWC, _16_pWC2 *XWhereClause
var _aiRowEstPk [2]int16
_aiColumnPk = i16(-1)
_rc = i32(0)
_iSortIdx = i32(1)
_pNew = (*XWhereLoop)(_pBuilder.X3)
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_pTabList = (*XSrcList)(_pWInfo.X1)
_pSrc = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.X3)))))*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(68)))))))))))
_pTab = (*XTable)(_pSrc.X4)
_pWC = (*XWhereClause)(_pBuilder.X1)
func() {
if ((*XTable)(_pSrc.X4).X16) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133153), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000))), unsafe.Pointer(str(105487)))
crt.X__builtin_abort(tls)
}
}()
if (*XIndex)(_pSrc.X16) != nil {
_pProbe = (*XIndex)(_pSrc.X16)
goto _5
}
if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
_pProbe = (*XIndex)(_pTab.X2)
goto _5
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sPk), i32(0), u32(56))
*(*uint16)(unsafe.Pointer(&(_sPk.X13))) = uint16(i32(1))
*(*uint16)(unsafe.Pointer(&(_sPk.X14))) = uint16(i32(1))
*(**int16)(unsafe.Pointer(&(_sPk.X1))) = &_aiColumnPk
*(**int16)(unsafe.Pointer(&(_sPk.X2))) = (*int16)(unsafe.Pointer(&_aiRowEstPk))
*(*uint8)(unsafe.Pointer(&(_sPk.X15))) = uint8(i32(5))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sPk.X3))))) = _pTab
*(*int16)(unsafe.Pointer(&(_sPk.X12))) = _pTab.X13
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiRowEstPk)) + 2*uintptr(i32(0)))) = _pTab.X12
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiRowEstPk)) + 2*uintptr(i32(1)))) = int16(i32(0))
_3_pFirst = (*XIndex)((*XTable)(_pSrc.X4).X2)
if int32((uint32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)<>uint(i32(31))) == i32(0) {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sPk.X5))))) = _3_pFirst
}
_pProbe = &_sPk
_5:
_rSize = _pTab.X12
_rLogSize = _estLog(tls, _rSize)
if (*XWhereOrSet)(_pBuilder.X4) != nil || (int32(_pWInfo.X10)&i32(32)) != i32(0) || (((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X6)&i32(1048576)) == i32(0) || (*XIndex)(_pSrc.X16) != nil || ((uint32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)<>uint(i32(31))) != 0 || ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) || ((uint32(((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)>>uint(i32(3)))<>uint(i32(31))) != 0 || ((uint32(((*t28)(unsafe.Pointer(&(_pSrc.X9))).X1)>>uint(i32(5)))<>uint(i32(31))) != 0 {
goto _14
}
_5_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X3)))))*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
_5_pTerm = (*XWhereTerm)(_pWC.X5)
_15:
if _rc != i32(0) || uintptr(unsafe.Pointer(_5_pTerm)) >= uintptr(unsafe.Pointer(_5_pWCEnd)) {
goto _19
}
if ((_5_pTerm.X11) & (_pNew.X1)) != 0 {
goto _16
}
if _termCanDriveIndex(tls, _5_pTerm, _pSrc, uint64(i32(0))) == 0 {
goto _21
}
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = uint16(i32(1))
*(*uint16)(unsafe.Pointer(&(_pNew.X11))) = uint16(i32(0))
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))))) = nil
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(1))
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(i32(0)))) = _5_pTerm
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16((int32(_rLogSize) + int32(_rSize)) + i32(4))
if ((*XSelect)(_pTab.X3) == nil) && (((_pTab.X9) & uint32(i32(2))) == uint32(i32(0))) {
{
p := (*int16)(unsafe.Pointer(&(_pNew.X5)))
*p = int16(int32(*p) + i32(24))
sink18 = *p
}
}
if int32(_pNew.X5) < i32(0) {
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
}
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = int16(i32(43))
func() {
if i32(43) != int32(_sqlite3LogEst(tls, uint64(i32(20)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133227), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000))), unsafe.Pointer(str(105510)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _rLogSize, _pNew.X7)
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(16384))
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq | (_5_pTerm.X11)
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
_21:
_16:
*(*uintptr)(unsafe.Pointer(&_5_pTerm)) += uintptr(48)
goto _15
_19:
_14:
if _rc != i32(0) || _pProbe == nil {
goto _31
}
if ((*XExpr)(_pProbe.X9) != nil) && (_whereUsablePartialIndex(tls, _pSrc.X11, _pWC, (*XExpr)(_pProbe.X9)) == 0) {
goto _28
}
_rSize = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(i32(0))))
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&(_pNew.X11))) = uint16(i32(0))
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(0))
*(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(i32(0))
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _mPrereq
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X4))))) = _pProbe
_b = _indexMightHelpWithOrderBy(tls, _pBuilder, _pProbe, _pSrc.X11)
func() {
if (int32(_pWInfo.X10)&i32(4)) != i32(0) && _b != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133258), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeØ00__func__Ø000))), unsafe.Pointer(str(105532)))
crt.X__builtin_abort(tls)
}
}()
if (_pProbe.X11) > i32(0) {
goto _37
}
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(256))
*(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(func() int32 {
if _b != 0 {
return _iSortIdx
}
return i32(0)
}())
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16(int32(_rSize) + i32(16))
_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize
if _rc != 0 {
goto _31
}
goto _41
_37:
if ((uint32((_pProbe.X16)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(576))
_12_m = uint64(i32(0))
goto _43
}
_12_m = (_pSrc.X14) & (^_columnsInIndex(tls, _pProbe))
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(func() int32 {
if _12_m == uint64(i32(0)) {
return i32(576)
}
return i32(512)
}())
_43:
if _b == 0 && ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) && (*XExpr)(_pProbe.X9) == nil && (_12_m != uint64(i32(0)) || int32((uint32((_pProbe.X16)>>uint(i32(2)))<>uint(i32(31))) != i32(0) || int32(_pProbe.X12) >= int32(_pTab.X13) || (int32(_pWInfo.X10)&i32(4)) != i32(0) || (_sqlite3Config.X4) == 0 || (int32((*Xsqlite3)((*XParse)(_pWInfo.X0).X0).X13)&i32(64)) != i32(0)) {
goto _54
}
*(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(func() int32 {
if _b != 0 {
return _iSortIdx
}
return i32(0)
}())
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16((int32(_rSize) + i32(1)) + ((i32(15) * int32(_pProbe.X12)) / int32(_pTab.X13)))
if _12_m == uint64(i32(0)) {
goto _57
}
_16_nLookup = int16(int32(_rSize) + i32(16))
_16_iCur = _pSrc.X11
_16_pWC2 = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))
_16_ii = i32(0)
_58:
if _16_ii >= (_16_pWC2.X3) {
goto _61
}
_17_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_16_pWC2.X5) + 48*uintptr(_16_ii)))
if _sqlite3ExprCoveredByIndex(tls, (*XExpr)(_17_pTerm.X0), _16_iCur, _pProbe) == 0 {
goto _61
}
if int32(_17_pTerm.X2) <= i32(0) {
{
p := &_16_nLookup
*p = int16(int32(*p) + int32(_17_pTerm.X2))
sink18 = *p
}
goto _64
}
_16_nLookup -= 1
if (int32(_17_pTerm.X4) & i32(130)) != 0 {
{
p := &_16_nLookup
*p = int16(int32(*p) - i32(19))
sink18 = *p
}
}
_64:
_16_ii += 1
goto _58
_61:
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _pNew.X6, _16_nLookup)
_57:
_whereLoopOutputAdjust(tls, _pWC, _pNew, _rSize)
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _rSize
if _rc != 0 {
goto _31
}
_54:
_41:
*(*uint32)(unsafe.Pointer(&(_pBuilder.X5))) = uint32(i32(0))
_rc = _whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(i32(0)))
if (_pBuilder.X5) == uint32(i32(1)) {
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | uint32(i32(256))
sink5 = *p
}
}
if (*XIndex)(_pSrc.X16) != nil {
goto _31
}
_28:
*func() *int32 { _pProbe = (*XIndex)(_pProbe.X5); return &_iSortIdx }() += 1
goto _14
_31:
return _rc
_ = _sPk
_ = _aiRowEstPk
_ = _aiColumnPk
panic(0)
}
var _whereLoopAddBtreeØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopAddBtreeØ00__func__Ø000[0], str(105588), 18)
}
// Estimate the logarithm of the input value to base 2.
func _estLog(tls *crt.TLS, _N int16) (r0 int16) {
return int16(func() int32 {
if int32(_N) <= i32(10) {
return i32(0)
}
return (int32(_sqlite3LogEst(tls, uint64(_N))) - i32(33))
}())
}
// Return TRUE if the WHERE clause term pTerm is of a form where it
// could be used with an index to access pSrc, assuming an appropriate
// index existed.
func _termCanDriveIndex(tls *crt.TLS, _pTerm *XWhereTerm, _pSrc *TSrcList_item, _notReady uint64) (r0 int32) {
var _aff int8
if (_pTerm.X8) != (_pSrc.X11) {
return i32(0)
}
if (int32(_pTerm.X4) & i32(130)) == i32(0) {
return i32(0)
}
if ((_pTerm.X11) & _notReady) != uint64(i32(0)) {
return i32(0)
}
if (*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))) < i32(0) {
return i32(0)
}
_aff = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pSrc.X4).X1) + 16*uintptr(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))))).X4
if _sqlite3IndexAffinityOk(tls, (*XExpr)(_pTerm.X0), _aff) == 0 {
return i32(0)
}
return i32(1)
}
// Check to see if a partial index with pPartIndexWhere can be used
// in the current query. Return true if it can be and false if not.
func _whereUsablePartialIndex(tls *crt.TLS, _iTab int32, _pWC *XWhereClause, _pWhere *XExpr) (r0 int32) {
var _i int32
var _2_pExpr *XExpr
var _pTerm *XWhereTerm
_0:
if int32(_pWhere.X0) != i32(71) {
goto _1
}
if _whereUsablePartialIndex(tls, _iTab, _pWC, (*XExpr)(_pWhere.X4)) == 0 {
return i32(0)
}
_pWhere = (*XExpr)(_pWhere.X5)
goto _0
_1:
*func() **XWhereTerm { _i = i32(0); return &_pTerm }() = (*XWhereTerm)(_pWC.X5)
_3:
if _i >= (_pWC.X3) {
goto _6
}
_2_pExpr = (*XExpr)(_pTerm.X0)
if _sqlite3ExprImpliesExpr(tls, _2_pExpr, _pWhere, _iTab) != 0 && ((((_2_pExpr.X2) & uint32(i32(1))) == uint32(i32(0))) || (int32(_2_pExpr.X11) == _iTab)) {
return i32(1)
}
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i += 1; return &_pTerm }())) += uintptr(48)
goto _3
_6:
return i32(0)
}
// 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.
//
// 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 _sqlite3ExprImpliesExpr(tls *crt.TLS, _pE1 *XExpr, _pE2 *XExpr, _iTab int32) (r0 int32) {
var _3_pX *XExpr
if _sqlite3ExprCompare(tls, _pE1, _pE2, _iTab) == i32(0) {
return i32(1)
}
if (int32(_pE2.X0) == i32(70)) && (_sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.X4), _iTab) != 0 || _sqlite3ExprImpliesExpr(tls, _pE1, (*XExpr)(_pE2.X5), _iTab) != 0) {
return i32(1)
}
if int32(_pE2.X0) != i32(76) || int32(_pE1.X0) == i32(75) || int32(_pE1.X0) == i32(72) {
goto _6
}
_3_pX = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pE1.X4))
if _sqlite3ExprCompare(tls, _3_pX, (*XExpr)(_pE2.X4), _iTab) == i32(0) {
return i32(1)
}
_6:
return i32(0)
}
// Return True if it is possible that pIndex might be useful in
// implementing the ORDER BY clause in pBuilder.
//
// Return False if pBuilder does not contain an ORDER BY clause or
// if there is no way for pIndex to be useful in implementing that
// ORDER BY clause.
func _indexMightHelpWithOrderBy(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pIndex *XIndex, _iCursor int32) (r0 int32) {
var _ii, _jj int32
var _pOB, _aColExpr *XExprList
var _1_pExpr *XExpr
if ((uint32((_pIndex.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return i32(0)
}
if store42(&_pOB, (*XExprList)((*XWhereInfo)(_pBuilder.X0).X2)) == nil {
return i32(0)
}
_ii = i32(0)
_2:
if _ii >= (_pOB.X0) {
goto _5
}
_1_pExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOB.X2)))))+20*uintptr(_ii))).X0))
if int32(_1_pExpr.X0) != i32(152) || (_1_pExpr.X8) != _iCursor {
goto _7
}
if int32(_1_pExpr.X9) < i32(0) {
return i32(1)
}
_jj = i32(0)
_9:
if _jj >= int32(_pIndex.X13) {
goto _12
}
if int32(_1_pExpr.X9) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_jj)))) {
return i32(1)
}
_jj += 1
goto _9
_12:
goto _15
_7:
if store42(&_aColExpr, (*XExprList)(_pIndex.X10)) == nil {
goto _15
}
_jj = i32(0)
_16:
if _jj >= int32(_pIndex.X13) {
goto _19
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_jj)))) != i32(-2) {
goto _17
}
if _sqlite3ExprCompare(tls, _1_pExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2)))))+20*uintptr(_jj))).X0), _iCursor) == i32(0) {
return i32(1)
}
_17:
_jj += 1
goto _16
_19:
_15:
_ii += 1
goto _2
_5:
return i32(0)
}
// Adjust the WhereLoop.nOut value downward to account for terms of the
// WHERE clause that reference the loop but which are not used by an
// index.
// *
// For every WHERE clause term that is not used by the index
// and which has a truth probability assigned by one of the likelihood(),
// likely(), or unlikely() SQL functions, reduce the estimated number
// of output rows by the probability specified.
//
// TUNING: For every WHERE clause term that is not used by the index
// and which does not have an assigned truth probability, heuristics
// described below are used to try to estimate the truth probability.
// TODO --> Perhaps this is something that could be improved by better
// table statistics.
//
// Heuristic 1: Estimate the truth probability as 93.75%. The 93.75%
// value corresponds to -1 in LogEst notation, so this means decrement
// the WhereLoop.nOut field for every such WHERE clause term.
//
// Heuristic 2: If there exists one or more WHERE clause terms of the
// form "x==EXPR" and EXPR is not a constant 0 or 1, then make sure the
// final output row estimate is no greater than 1/4 of the total number
// of rows in the table. In other words, assume that x==EXPR will filter
// out at least 3 out of 4 rows. If EXPR is -1 or 0 or 1, then maybe the
// "x" column is boolean or else -1 or 0 or 1 is a common default value
// on the "x" column and so in that case only cap the output row estimate
// at 1/2 instead of 1/4.
func _whereLoopOutputAdjust(tls *crt.TLS, _pWC *XWhereClause, _pLoop *XWhereLoop, _nRow int16) {
var _iReduce int16
var _i, _j, _k int32
var _notAllowed uint64
var _6_pRight *XExpr
var _pTerm, _pX *XWhereTerm
_notAllowed = ^((_pLoop.X0) | (_pLoop.X1))
_iReduce = i16(0)
func() {
if ((_pLoop.X9) & uint32(i32(16384))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132572), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopOutputAdjustØ00__func__Ø000))), unsafe.Pointer(str(105606)))
crt.X__builtin_abort(tls)
}
}()
*func() **XWhereTerm { _i = _pWC.X3; return &_pTerm }() = (*XWhereTerm)(_pWC.X5)
_2:
if _i <= i32(0) {
goto _5
}
if (int32(_pTerm.X3) & i32(2)) != i32(0) {
goto _5
}
if ((_pTerm.X12) & (_pLoop.X1)) == uint64(i32(0)) {
goto _3
}
if ((_pTerm.X12) & _notAllowed) != uint64(i32(0)) {
goto _3
}
_j = int32(_pLoop.X10) - i32(1)
_9:
if _j < i32(0) {
goto _12
}
_pX = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))
if _pX == nil {
goto _10
}
if _pX == _pTerm {
goto _12
}
if ((_pX.X7) >= i32(0)) && ((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+48*uintptr(_pX.X7))) == _pTerm) {
goto _12
}
_10:
_j -= 1
goto _9
_12:
if _j >= i32(0) {
goto _17
}
if int32(_pTerm.X2) <= i32(0) {
{
p := (*int16)(unsafe.Pointer(&(_pLoop.X7)))
*p = int16(int32(*p) + int32(_pTerm.X2))
sink18 = *p
}
goto _19
}
*(*int16)(unsafe.Pointer(&(_pLoop.X7))) -= 1
if (int32(_pTerm.X4) & i32(130)) == 0 {
goto _20
}
_6_pRight = (*XExpr)((*XExpr)(_pTerm.X0).X5)
if (_sqlite3ExprIsInteger(tls, _6_pRight, &_k) != 0 && (_k >= i32(-1))) && (_k <= i32(1)) {
_k = i32(10)
goto _24
}
_k = i32(20)
_24:
if int32(_iReduce) < _k {
_iReduce = int16(_k)
}
_20:
_19:
_17:
_3:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_pTerm }())) += uintptr(48)
goto _2
_5:
if int32(_pLoop.X7) > (int32(_nRow) - int32(_iReduce)) {
*(*int16)(unsafe.Pointer(&(_pLoop.X7))) = int16(int32(_nRow) - int32(_iReduce))
}
}
var _whereLoopOutputAdjustØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopOutputAdjustØ00__func__Ø000[0], str(105645), 22)
}
// 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 _sqlite3ExprCoveredByIndex(tls *crt.TLS, _pExpr *XExpr, _iCur int32, _pIdx *XIndex) (r0 int32) {
var _w XWalker
var _xcov XIdList
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*int32)(unsafe.Pointer(&(_xcov.X1))) = _iCur
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_xcov.X0))))) = _pIdx
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprIdxCover
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_xcov
_sqlite3WalkExpr(tls, &_w, _pExpr)
return bool2int((_w.X5) == 0)
_ = _w
_ = _xcov
panic(0)
}
// Check to see if there are references to columns in table
// pWalker->u.pIdxCover->iCur can be satisfied using the index
// pWalker->u.pIdxCover->pIdx.
func _exprIdxCover(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
if ((int32(_pExpr.X0) == i32(152)) && ((_pExpr.X8) == ((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))).X1))) && (int32(_sqlite3ColumnOfIndex(tls, (*XIndex)((*XIdList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6)))))).X0), _pExpr.X9)) < i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(1))
return i32(2)
}
return i32(0)
}
// We have so far matched pBuilder->pNew->u.btree.nEq terms of the
// index pIndex. Try to match one more.
//
// When this function is called, pBuilder->pNew->nOut contains the
// number of rows expected to be visited by filtering using the nEq
// terms only. If it is modified, this value is restored before this
// function returns.
//
// If pProbe->tnum==0, that means pIndex is a fake index used for the
// INTEGER PRIMARY KEY.
func _whereLoopAddBtreeIndex(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _pSrc *TSrcList_item, _pProbe *XIndex, _nInMul int16) (r0 int32) {
var _saved_nOut, _rSize, _rLogSize, _3_rCostIdx, _3_nOutUnadjusted, _30_nIter int16
var _opMask, _rc, _3_nIn, _9_i, _12_iCol, _21_nEq int32
var _saved_wsFlags uint32
var _saved_prereq uint64
var _saved_nLTerm, _saved_nEq, _saved_nBtm, _saved_nTop, _saved_nSkip, _3_eOp uint16
var _db *Xsqlite3
var _8_pExpr *XExpr
var _pParse *XParse
var _pWInfo *XWhereInfo
var _pNew *XWhereLoop
var _pTerm, _pTop, _pBtm *XWhereTerm
var _scan XWhereScan
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_pParse = (*XParse)(_pWInfo.X0)
_db = (*Xsqlite3)(_pParse.X0)
_rc = i32(0)
_pTop = nil
_pBtm = nil
_pNew = (*XWhereLoop)(_pBuilder.X3)
if (_db.X17) != 0 {
return _sqlite3NomemError(tls, i32(132723))
}
func() {
if ((_pNew.X9) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132727), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105667)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pNew.X9) & uint32(i32(16))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132728), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105707)))
crt.X__builtin_abort(tls)
}
}()
if ((_pNew.X9) & uint32(i32(32))) != 0 {
_opMask = i32(24)
goto _6
}
func() {
if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132732), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105744)))
crt.X__builtin_abort(tls)
}
}()
_opMask = i32(447)
_6:
if ((uint32((_pProbe.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0 {
{
p := &_opMask
*p = (*p) & i32(-61)
sink1 = *p
}
}
func() {
if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) >= int32(_pProbe.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132737), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105766)))
crt.X__builtin_abort(tls)
}
}()
_saved_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0
_saved_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1
_saved_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2
_saved_nSkip = _pNew.X11
_saved_nLTerm = _pNew.X10
_saved_wsFlags = _pNew.X9
_saved_prereq = _pNew.X0
_saved_nOut = _pNew.X7
_pTerm = _whereScanInit(tls, &_scan, (*XWhereClause)(_pBuilder.X1), _pSrc.X11, int32(_saved_nEq), uint32(_opMask), _pProbe)
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
_rSize = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(i32(0))))
_rLogSize = _estLog(tls, _rSize)
_12:
if _rc != i32(0) || _pTerm == nil {
goto _16
}
_3_eOp = _pTerm.X4
_3_nIn = i32(0)
if ((int32(_3_eOp) == i32(256)) || ((int32(_pTerm.X3) & i32(0)) != i32(0))) && _indexColumnNotNull(tls, _pProbe, int32(_saved_nEq)) != 0 {
goto _13
}
if ((_pTerm.X11) & (_pNew.X1)) != 0 {
goto _13
}
if (int32(_pTerm.X3)&i32(256)) != 0 && (int32(_pTerm.X4) == i32(16)) {
goto _13
}
if (((int32((*t28)(unsafe.Pointer(&(_pSrc.X9))).X0) & i32(8)) != i32(0)) && ((((*XExpr)(_pTerm.X0).X2) & uint32(i32(1))) == uint32(i32(0)))) && ((int32(_3_eOp) & i32(384)) != i32(0)) {
goto _13
}
if (int32(_pProbe.X15) != i32(0)) && (int32(_saved_nEq) == (int32(_pProbe.X13) - i32(1))) {
{
p := (*uint32)(unsafe.Pointer(&(_pBuilder.X5)))
*p = (*p) | uint32(i32(2))
sink5 = *p
}
goto _28
}
{
p := (*uint32)(unsafe.Pointer(&(_pBuilder.X5)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
_28:
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = _saved_nBtm
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = _saved_nTop
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = _saved_nLTerm
if _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1)) != 0 {
goto _16
}
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = _pTerm
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = (_saved_prereq | (_pTerm.X11)) & (^(_pNew.X1))
func() {
if int32(_nInMul) != i32(0) && ((_pNew.X9)&uint32(i32(8))) == uint32(i32(0)) && ((_pNew.X9)&uint32(i32(4))) == uint32(i32(0)) && ((_pNew.X9)&uint32(i32(32768))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132797), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105800)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_3_eOp) & i32(1)) == 0 {
goto _35
}
_8_pExpr = (*XExpr)(_pTerm.X0)
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(4))
sink5 = *p
}
if ((_8_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
goto _36
}
_3_nIn = i32(46)
func() {
if i32(46) != int32(_sqlite3LogEst(tls, uint64(i32(25)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132809), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105931)))
crt.X__builtin_abort(tls)
}
}()
_9_i = i32(0)
_39:
if _9_i >= (int32(_pNew.X10) - i32(1)) {
goto _42
}
if ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(_9_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(_9_i)))).X0) == _8_pExpr) {
_3_nIn = i32(0)
}
_9_i += 1
goto _39
_42:
goto _49
_36:
if func() int32 {
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))) != nil) && ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))).X0) != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132819), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_3_nIn = int32(_sqlite3LogEst(tls, uint64((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_8_pExpr.X6)))))).X0)))
func() {
if _3_nIn <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132822), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105953)))
crt.X__builtin_abort(tls)
}
}()
}
_49:
goto _75
_35:
if (int32(_3_eOp) & i32(130)) == 0 {
goto _53
}
_12_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X1)) + 2*uintptr(_saved_nEq))))
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
func() {
if int32(_saved_nEq) != int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132828), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105959)))
crt.X__builtin_abort(tls)
}
}()
if _12_iCol != i32(-1) && (_12_iCol <= i32(0) || int32(_nInMul) != i32(0) || int32(_saved_nEq) != (int32(_pProbe.X13)-i32(1))) {
goto _59
}
if (_12_iCol >= i32(0)) && (int32((uint32((_pProbe.X16)>>uint(i32(3)))<>uint(i32(31))) == i32(0)) {
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(65536))
sink5 = *p
}
goto _62
}
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(4096))
sink5 = *p
}
_62:
_59:
goto _75
_53:
if (int32(_3_eOp) & i32(256)) != 0 {
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(8))
sink5 = *p
}
goto _75
}
if (int32(_3_eOp) & i32(36)) == 0 {
goto _66
}
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(34))
sink5 = *p
}
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm))
_pBtm = _pTerm
_pTop = nil
if (int32(_pTerm.X3) & i32(256)) == 0 {
goto _67
}
_pTop = (*XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTerm)) + 48*uintptr(i32(1))))
func() {
if int32((uintptr(unsafe.Pointer(_pTop))-uintptr(unsafe.Pointer((*XWhereTerm)((*XWhereClause)(_pTerm.X1).X5))))/48) >= ((*XWhereClause)(_pTerm.X1).X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132853), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(105988)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pTop.X3) & i32(256)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132854), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106029)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pTop.X4) != i32(16) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132855), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106058)))
crt.X__builtin_abort(tls)
}
}()
if _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1)) != 0 {
goto _16
}
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = _pTop
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(16))
sink5 = *p
}
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(i32(1))
_67:
goto _75
_66:
func() {
if (int32(_3_eOp) & i32(24)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132862), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106081)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(18))
sink5 = *p
}
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = uint16(_whereRangeVectorLen(tls, _pParse, _pSrc.X11, _pProbe, int32(_saved_nEq), _pTerm))
_pTop = _pTerm
_pBtm = func() *XWhereTerm {
if ((_pNew.X9) & uint32(i32(32))) != uint32(i32(0)) {
return (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(int32(_pNew.X10)-i32(2)))))
}
return nil
}()
_75:
func() {
if int32(_pNew.X7) != int32(_saved_nOut) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132879), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106101)))
crt.X__builtin_abort(tls)
}
}()
if ((_pNew.X9) & uint32(i32(2))) != 0 {
_whereRangeScanEst(tls, _pParse, _pBuilder, _pBtm, _pTop, _pNew)
goto _83
}
_21_nEq = int32(preInc14((*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))), uint16(1)))
func() {
if (int32(_3_eOp) & i32(387)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132886), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106124)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pNew.X7) != int32(_saved_nOut) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132888), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106101)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pTerm.X2) <= i32(0)) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X1)) + 2*uintptr(_saved_nEq)))) >= i32(0)) {
func() {
if (int32(_3_eOp)&i32(1)) == 0 && _3_nIn != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132890), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106160)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) + int32(_pTerm.X2))
sink18 = *p
}
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) - _3_nIn)
sink18 = *p
}
goto _93
}
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) + (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_21_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_21_nEq-i32(1)))))))
sink18 = *p
}
if (int32(_3_eOp) & i32(256)) != 0 {
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) + i32(10))
sink18 = *p
}
}
_93:
_83:
_3_rCostIdx = int16((int32(_pNew.X7) + i32(1)) + ((i32(15) * int32(_pProbe.X12)) / int32((*XTable)(_pSrc.X4).X13)))
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _rLogSize, _3_rCostIdx)
if ((_pNew.X9) & uint32(i32(320))) == uint32(i32(0)) {
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = _sqlite3LogEstAdd(tls, _pNew.X6, int16(int32(_pNew.X7)+i32(16)))
}
_3_nOutUnadjusted = _pNew.X7
{
p := (*int16)(unsafe.Pointer(&(_pNew.X6)))
*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
sink18 = *p
}
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) + (int32(_nInMul) + _3_nIn))
sink18 = *p
}
_whereLoopOutputAdjust(tls, (*XWhereClause)(_pBuilder.X1), _pNew, _rSize)
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
if ((_pNew.X9) & uint32(i32(2))) != 0 {
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut
goto _97
}
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _3_nOutUnadjusted
_97:
if (((_pNew.X9) & uint32(i32(16))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0) < int32(_pProbe.X14)) {
_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_nInMul)+_3_nIn))
}
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut
_13:
_pTerm = _whereScanNext(tls, &_scan)
goto _12
_16:
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = _saved_prereq
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X1))) = _saved_nBtm
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X2))) = _saved_nTop
*(*uint16)(unsafe.Pointer(&(_pNew.X11))) = _saved_nSkip
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = _saved_nLTerm
func() {
if i32(42) != int32(_sqlite3LogEst(tls, uint64(i32(18)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132985), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddBtreeIndexØ00__func__Ø000))), unsafe.Pointer(str(106184)))
crt.X__builtin_abort(tls)
}
}()
if ((((int32(_saved_nEq) == int32(_saved_nSkip)) && ((int32(_saved_nEq) + i32(1)) < int32(_pProbe.X13))) && (int32((uint32((_pProbe.X16)>>uint(i32(6)))<>uint(i32(31))) == i32(0))) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1))))) >= i32(42))) && (store1(&_rc, _whereLoopResize(tls, _db, _pNew, int32(_pNew.X10)+i32(1))) == i32(0)) {
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) += 1
*(*uint16)(unsafe.Pointer(&(_pNew.X11))) += 1
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(postInc14((*uint16)(unsafe.Pointer(&(_pNew.X10))), uint16(1))))) = nil
{
p := (*uint32)(unsafe.Pointer(&(_pNew.X9)))
*p = (*p) | uint32(i32(32768))
sink5 = *p
}
_30_nIter = int16(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(_saved_nEq)))) - int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pProbe.X2)) + 2*uintptr(int32(_saved_nEq)+i32(1))))))
{
p := (*int16)(unsafe.Pointer(&(_pNew.X7)))
*p = int16(int32(*p) - int32(_30_nIter))
sink18 = *p
}
{
p := &_30_nIter
*p = int16(int32(*p) + i32(5))
sink18 = *p
}
_whereLoopAddBtreeIndex(tls, _pBuilder, _pSrc, _pProbe, int16(int32(_30_nIter)+int32(_nInMul)))
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = _saved_nOut
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pNew.X8))))).X0))) = _saved_nEq
*(*uint16)(unsafe.Pointer(&(_pNew.X11))) = _saved_nSkip
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = _saved_wsFlags
}
return _rc
_ = _scan
panic(0)
}
var _whereLoopAddBtreeIndexØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopAddBtreeIndexØ00__func__Ø000[0], str(106206), 23)
}
// Term pTerm is a vector range comparison operation. The first comparison
// in the vector can be optimized using column nEq of the index. This
// function returns the total number of vector elements that can be used
// as part of the range comparison.
//
// For example, if the query is:
//
// WHERE a = ? AND (b, c, d) > (?, ?, ?)
//
// and the index:
//
// CREATE INDEX ... ON (a, b, c, d, e)
//
// then this function would be invoked with nEq=1. The value returned in
// this case is 3.
func _whereRangeVectorLen(tls *crt.TLS, _pParse *XParse, _iCur int32, _pIdx *XIndex, _nEq int32, _pTerm *XWhereTerm) (r0 int32) {
var _nCmp, _i int32
var _1_aff, _1_idxaff int8
var _1_pLhs, _1_pRhs *XExpr
var _1_pColl *XCollSeq
_nCmp = _sqlite3ExprVectorSize(tls, (*XExpr)((*XExpr)(_pTerm.X0).X4))
_nCmp = func() int32 {
if _nCmp < (int32(_pIdx.X14) - _nEq) {
return _nCmp
}
return (int32(_pIdx.X14) - _nEq)
}()
_i = i32(1)
_2:
if _i >= _nCmp {
goto _5
}
_1_idxaff = int8(i32(0))
_1_pLhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)((*XExpr)(_pTerm.X0).X4).X6)))))).X2))))) + 20*uintptr(_i))).X0)
_1_pRhs = (*XExpr)((*XExpr)(_pTerm.X0).X5)
if ((_1_pRhs.X2) & uint32(i32(2048))) != 0 {
_1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pRhs.X6)))))).X0).X2))))) + 20*uintptr(_i))).X0)
goto _7
}
_1_pRhs = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pRhs.X6)))))).X2))))) + 20*uintptr(_i))).X0)
_7:
if (((int32(_1_pLhs.X0) != i32(152)) || ((_1_pLhs.X8) != _iCur)) || (int32(_1_pLhs.X9) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i+_nEq)))))) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_i+_nEq)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_nEq))))) {
goto _5
}
_1_aff = _sqlite3CompareAffinity(tls, _1_pRhs, _sqlite3ExprAffinity(tls, _1_pLhs))
_1_idxaff = _sqlite3TableColumnAffinity(tls, (*XTable)(_pIdx.X3), int32(_1_pLhs.X9))
if int32(_1_aff) != int32(_1_idxaff) {
goto _5
}
_1_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, _1_pLhs, _1_pRhs)
if _1_pColl == nil {
goto _5
}
if _sqlite3StrICmp(tls, _1_pColl.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_i+_nEq)))) != 0 {
goto _5
}
_i += 1
goto _2
_5:
return _i
}
// This function is used to estimate the number of rows that will be visited
// by scanning an index for a range of values. The range may have an upper
// bound, a lower bound, or both. The WHERE clause terms that set the upper
// and lower bounds are represented by pLower and pUpper respectively. For
// example, assuming that index p is on t1(a):
//
// ... FROM t1 WHERE a > ? AND a < ? ...
// |_____| |_____|
// | |
// pLower pUpper
//
// If either of the upper or lower bound is not present, then NULL is passed in
// place of the corresponding WhereTerm.
//
// The value in (pBuilder->pNew->u.btree.nEq) is the number of the index
// column subject to the range constraint. Or, equivalently, the number of
// equality constraints optimized by the proposed index scan. For example,
// assuming index p is on t1(a, b), and the SQL query is:
//
// ... FROM t1 WHERE a = ? AND b > ? AND b < ? ...
//
// then nEq is set to 1 (as the range restricted column, b, is the second
// left-most column of the index). Or, if the query is:
//
// ... FROM t1 WHERE a > ? AND a < ? ...
//
// then nEq is set to 0.
//
// When this function is called, *pnOut is set to the sqlite3LogEst() of the
// number of rows that the index scan is expected to visit without
// considering the range constraints. If nEq is 0, then *pnOut is the number of
// rows in the index. Assuming no error occurs, *pnOut is adjusted (reduced)
// to account for the range constraints pLower and pUpper.
//
// In the absence of sqlite_stat4 ANALYZE data, or if such data cannot be
// used, a single range inequality reduces the search space by a factor of 4.
// and a pair of constraints (x>? AND x) reduces the expected number of
// rows visited by a factor of 64.
func _whereRangeScanEst(tls *crt.TLS, _pParse *XParse, _pBuilder *XWhereLoopBuilder, _pLower *XWhereTerm, _pUpper *XWhereTerm, _pLoop *XWhereLoop) (r0 int32) {
var _nNew int16
var _rc, _nOut int32
_rc = i32(0)
_nOut = int32(_pLoop.X7)
func() {
if _pLower == nil && _pUpper == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131911), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000))), unsafe.Pointer(str(106229)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pUpper != nil && (int32(_pUpper.X3)&i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131913), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereRangeScanEstØ00__func__Ø000))), unsafe.Pointer(str(106246)))
crt.X__builtin_abort(tls)
}
}()
_nNew = _whereRangeAdjust(tls, _pLower, int16(_nOut))
_nNew = _whereRangeAdjust(tls, _pUpper, _nNew)
if (((_pLower != nil) && (int32(_pLower.X2) > i32(0))) && (_pUpper != nil)) && (int32(_pUpper.X2) > i32(0)) {
{
p := &_nNew
*p = int16(int32(*p) - i32(20))
sink18 = *p
}
}
{
p := &_nOut
*p = (*p) - (bool2int(_pLower != nil) + bool2int(_pUpper != nil))
sink1 = *p
}
if int32(_nNew) < i32(10) {
_nNew = int16(i32(10))
}
if int32(_nNew) < _nOut {
_nOut = int32(_nNew)
}
*(*int16)(unsafe.Pointer(&(_pLoop.X7))) = int16(_nOut)
return _rc
}
var _whereRangeScanEstØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_whereRangeScanEstØ00__func__Ø000[0], str(106293), 18)
}
// If it is not NULL, pTerm is a term that provides an upper or lower
// bound on a range scan. Without considering pTerm, it is estimated
// that the scan will visit nNew rows. This function returns the number
// estimated to be visited after taking pTerm into account.
//
// If the user explicitly specified a likelihood() value for this term,
// then the return value is the likelihood multiplied by the number of
// input rows. Otherwise, this function assumes that an "IS NOT NULL" term
// has a likelihood of 0.50, and any other term a likelihood of 0.25.
func _whereRangeAdjust(tls *crt.TLS, _pTerm *XWhereTerm, _nNew int16) (r0 int16) {
var _nRet int16
_nRet = _nNew
if _pTerm == nil {
goto _0
}
if int32(_pTerm.X2) <= i32(0) {
{
p := &_nRet
*p = int16(int32(*p) + int32(_pTerm.X2))
sink18 = *p
}
goto _3
}
if (int32(_pTerm.X3) & i32(0)) == i32(0) {
{
p := &_nRet
*p = int16(int32(*p) - i32(20))
sink18 = *p
}
func() {
if i32(20) != int32(_sqlite3LogEst(tls, uint64(i32(4)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131610), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereRangeAdjustØ00__func__Ø000))), unsafe.Pointer(str(106311)))
crt.X__builtin_abort(tls)
}
}()
}
_3:
_0:
return _nRet
}
var _whereRangeAdjustØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_whereRangeAdjustØ00__func__Ø000[0], str(106332), 17)
}
// Add WhereLoop entries to handle OR terms. This works for either
// btrees or virtual tables.
func _whereLoopAddOr(tls *crt.TLS, _pBuilder *XWhereLoopBuilder, _mPrereq uint64, _mUnusable uint64) (r0 int32) {
var _rc, _iCur, _2_once, _2_i, _2_j int32
var _pItem *TSrcList_item
var _pWInfo *XWhereInfo
var _tempWC XWhereClause
var _pNew *XWhereLoop
var _pTerm, _pWCEnd, _2_pOrWCEnd, _2_pOrTerm *XWhereTerm
var _pWC, _2_pOrWC *XWhereClause
var _sSum, _sCur, _12_sPrev XWhereOrSet
var _sSubBuild XWhereLoopBuilder
_pWInfo = (*XWhereInfo)(_pBuilder.X0)
_rc = i32(0)
_pWC = (*XWhereClause)(_pBuilder.X1)
_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(_pWC.X5))) + uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X3)))))*uintptr(unsafe.Pointer((*XWhereTerm)(unsafe.Pointer(uintptr(48)))))))))))
_pNew = (*XWhereLoop)(_pBuilder.X3)
crt.Xmemset(tls, (unsafe.Pointer)(&_sSum), i32(0), u32(40))
_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))))) + uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(_pNew.X3)))))*uintptr(unsafe.Pointer((*TSrcList_item)(unsafe.Pointer(uintptr(68)))))))))))
_iCur = _pItem.X11
_pTerm = (*XWhereTerm)(_pWC.X5)
_0:
if uintptr(unsafe.Pointer(_pTerm)) >= uintptr(unsafe.Pointer(_pWCEnd)) || _rc != i32(0) {
goto _4
}
if (int32(_pTerm.X4)&i32(512)) == i32(0) || (((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X1)&(_pNew.X1)) == uint64(i32(0)) {
goto _6
}
_2_pOrWC = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0)))
_2_pOrWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_2_pOrWC.X5) + 48*uintptr(_2_pOrWC.X3)))
_2_once = i32(1)
_sSubBuild = *_pBuilder
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X2))))) = nil
*(**XWhereOrSet)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X4))))) = &_sCur
_2_pOrTerm = (*XWhereTerm)(_2_pOrWC.X5)
_7:
if uintptr(unsafe.Pointer(_2_pOrTerm)) >= uintptr(unsafe.Pointer(_2_pOrWCEnd)) {
goto _10
}
if (int32(_2_pOrTerm.X4) & i32(1024)) != i32(0) {
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X1))))) = (*XWhereClause)(unsafe.Pointer(&((*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_2_pOrTerm.X10)))))).X0)))
goto _14
}
if (_2_pOrTerm.X8) == _iCur {
*(**XWhereInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X0))))) = (*XWhereInfo)(_pWC.X0)
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X1))))) = _pWC
*(*uint8)(unsafe.Pointer(&(_tempWC.X2))) = uint8(i32(71))
*(*int32)(unsafe.Pointer(&(_tempWC.X3))) = i32(1)
*(**XWhereTerm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_tempWC.X5))))) = _2_pOrTerm
*(**XWhereClause)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sSubBuild.X1))))) = &_tempWC
goto _14
}
goto _8
_14:
*(*uint16)(unsafe.Pointer(&(_sCur.X0))) = uint16(i32(0))
if ((*XTable)(_pItem.X4).X16) != 0 {
_rc = _whereLoopAddVirtual(tls, &_sSubBuild, _mPrereq, _mUnusable)
goto _16
}
_rc = _whereLoopAddBtree(tls, &_sSubBuild, _mPrereq)
_16:
if _rc == i32(0) {
_rc = _whereLoopAddOr(tls, &_sSubBuild, _mPrereq, _mUnusable)
}
func() {
if _rc != i32(0) && int32(_sCur.X0) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133724), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLoopAddOrØ00__func__Ø000))), unsafe.Pointer(str(106349)))
crt.X__builtin_abort(tls)
}
}()
if int32(_sCur.X0) == i32(0) {
*(*uint16)(unsafe.Pointer(&(_sSum.X0))) = uint16(i32(0))
goto _10
}
if _2_once != 0 {
_whereOrMove(tls, &_sSum, &_sCur)
_2_once = i32(0)
goto _24
}
_whereOrMove(tls, &_12_sPrev, &_sSum)
*(*uint16)(unsafe.Pointer(&(_sSum.X0))) = uint16(i32(0))
_2_i = i32(0)
_25:
if _2_i >= int32(_12_sPrev.X0) {
goto _28
}
_2_j = i32(0)
_29:
if _2_j >= int32(_sCur.X0) {
goto _32
}
_whereOrInsert(tls, &_sSum, ((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+12*uintptr(_2_i))).X0)|((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+12*uintptr(_2_j))).X0), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+12*uintptr(_2_i))).X1, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+12*uintptr(_2_j))).X1), _sqlite3LogEstAdd(tls, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_12_sPrev.X1)))))+12*uintptr(_2_i))).X2, (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sCur.X1)))))+12*uintptr(_2_j))).X2))
_2_j += 1
goto _29
_32:
_2_i += 1
goto _25
_28:
_24:
_8:
*(*uintptr)(unsafe.Pointer(&_2_pOrTerm)) += uintptr(48)
goto _7
_10:
*(*uint16)(unsafe.Pointer(&(_pNew.X10))) = uint16(i32(1))
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X13)) + 4*uintptr(i32(0)))) = _pTerm
*(*uint32)(unsafe.Pointer(&(_pNew.X9))) = uint32(i32(8192))
*(*int16)(unsafe.Pointer(&(_pNew.X5))) = int16(i32(0))
*(*uint8)(unsafe.Pointer(&(_pNew.X4))) = uint8(i32(0))
crt.Xmemset(tls, (unsafe.Pointer)((*t62)(unsafe.Pointer(&(_pNew.X8)))), i32(0), u32(12))
_2_i = i32(0)
_33:
if _rc != i32(0) || _2_i >= int32(_sSum.X0) {
goto _37
}
*(*int16)(unsafe.Pointer(&(_pNew.X6))) = int16(int32((*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1)))))+12*uintptr(_2_i))).X1) + i32(1))
*(*int16)(unsafe.Pointer(&(_pNew.X7))) = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1))))) + 12*uintptr(_2_i))).X2
*(*uint64)(unsafe.Pointer(&(_pNew.X0))) = (*XWhereOrCost)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_sSum.X1))))) + 12*uintptr(_2_i))).X0
_rc = _whereLoopInsert(tls, _pBuilder, _pNew)
_2_i += 1
goto _33
_37:
_6:
*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
goto _0
_4:
return _rc
_ = _tempWC
_ = _sSubBuild
_ = _sSum
_ = _sCur
_ = _12_sPrev
panic(0)
}
var _whereLoopAddOrØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_whereLoopAddOrØ00__func__Ø000[0], str(106376), 15)
}
// Move the content of pSrc into pDest
func _whereOrMove(tls *crt.TLS, _pDest *XWhereOrSet, _pSrc *XWhereOrSet) {
*(*uint16)(unsafe.Pointer(&(_pDest.X0))) = _pSrc.X0
crt.Xmemcpy(tls, (unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pDest.X1)))), (unsafe.Pointer)((*[3]XWhereOrCost)(unsafe.Pointer(&(_pSrc.X1)))), uint32(_pDest.X0)*u32(12))
}
// Given the list of WhereLoop objects at pWInfo->pLoops, this routine
// attempts to find the lowest cost path that visits each WhereLoop
// once. This path is then loaded into the pWInfo->a[].pWLoop fields.
//
// Assume that the total number of output rows that will need to be sorted
// will be nRowEst (in the 10*log2 representation). Or, ignore sorting
// costs if nRowEst==0.
//
// Return SQLITE_OK on success or SQLITE_NOMEM of a memory allocation
// error occurs.
func _wherePathSolver(tls *crt.TLS, _pWInfo *XWhereInfo, _nRowEst int16) (r0 int32) {
var _mxCost, _mxUnsorted, _8_nOut, _8_rCost, _8_rUnsorted int16
var _mxChoice, _nLoop, _iLoop, _ii, _jj, _mxI, _nOrderBy, _nTo, _nFrom, _nSpace, _29_rc, _37_rc, _39_nOrder int32
var _8_isOrdered int8
var _36_wsFlags uint32
var _8_maskNew, _8_revMask, _29_notUsed, _37_m, _39_revMask uint64
var _pSpace *int8
var _db *Xsqlite3
var _pParse *XParse
var _aSortCost *int16
var _pWLoop *XWhereLoop
var _28_pLevel *XWhereLevel
var _pX **XWhereLoop
var _aFrom, _aTo, _pFrom, _pTo *XWherePath
_mxI = i32(0)
_mxCost = i16(0)
_mxUnsorted = i16(0)
_aSortCost = nil
_pParse = (*XParse)(_pWInfo.X0)
_db = (*Xsqlite3)(_pParse.X0)
_nLoop = int32(_pWInfo.X11)
_mxChoice = func() int32 {
if _nLoop <= i32(1) {
return i32(1)
}
return func() int32 {
if _nLoop == i32(2) {
return i32(5)
}
return i32(10)
}()
}()
func() {
if _nLoop > ((*XSrcList)(_pWInfo.X1).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134255), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106391)))
crt.X__builtin_abort(tls)
}
}()
if ((*XExprList)(_pWInfo.X2) == nil) || (int32(_nRowEst) == i32(0)) {
_nOrderBy = i32(0)
goto _8
}
_nOrderBy = (*XExprList)(_pWInfo.X2).X0
_8:
_nSpace = int32(((u32(28) + (u32(4) * uint32(_nLoop))) * uint32(_mxChoice)) * uint32(i32(2)))
{
p := &_nSpace
*p = int32(uint32(*p) + (u32(2) * uint32(_nOrderBy)))
sink1 = *p
}
_pSpace = (*int8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nSpace)))
if _pSpace == nil {
return _sqlite3NomemError(tls, i32(134273))
}
_aTo = (*XWherePath)(unsafe.Pointer(_pSpace))
_aFrom = (*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aTo)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)))))*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(28)))))))))))
crt.Xmemset(tls, (unsafe.Pointer)(_aFrom), i32(0), u32(28))
_pX = (**XWhereLoop)(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer(_aFrom)) + uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(_mxChoice)))))*uintptr(unsafe.Pointer((*XWherePath)(unsafe.Pointer(uintptr(28)))))))))))))
*func() **XWherePath { _ii = _mxChoice * i32(2); return &_pFrom }() = _aTo
_10:
if _ii <= i32(0) {
goto _13
}
*(***XWhereLoop)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_pFrom.X6))))) = _pX
{
p := func() ***XWhereLoop {
*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii -= 1; return &_pFrom }())) += uintptr(28)
return &_pX
}()
*p = (**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 4*uintptr(_nLoop)))
sink68 = *p
}
goto _10
_13:
if _nOrderBy != 0 {
_aSortCost = (*int16)(unsafe.Pointer(_pX))
crt.Xmemset(tls, (unsafe.Pointer)(_aSortCost), i32(0), u32(2)*uint32(_nOrderBy))
}
func() {
if _aSortCost != nil && (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer((*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost))+2*uintptr(_nOrderBy))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134291), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _aSortCost == nil && (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSpace))+1*uintptr(_nSpace))) != (*int8)(unsafe.Pointer(_pX)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134292), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106482)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 28*uintptr(i32(0)))).X2))) = int16(func() uint32 {
if (_pParse.X42) < uint32(i32(48)) {
return (_pParse.X42)
}
return uint32(i32(48))
}())
func() {
if i32(48) != int32(_sqlite3LogEst(tls, uint64(i32(28)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134299), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106525)))
crt.X__builtin_abort(tls)
}
}()
_nFrom = i32(1)
func() {
if int32((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom))+28*uintptr(i32(0)))).X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134301), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106547)))
crt.X__builtin_abort(tls)
}
}()
if _nOrderBy != 0 {
*(*int8)(unsafe.Pointer(&((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 28*uintptr(i32(0)))).X5))) = int8(func() int32 {
if _nLoop > i32(0) {
return i32(-1)
}
return _nOrderBy
}())
}
_iLoop = i32(0)
_30:
if _iLoop >= _nLoop {
goto _33
}
_nTo = i32(0)
*func() **XWherePath { _ii = i32(0); return &_pFrom }() = _aFrom
_34:
if _ii >= _nFrom {
goto _37
}
_pWLoop = (*XWhereLoop)(_pWInfo.X19)
_38:
if _pWLoop == nil {
goto _41
}
_8_isOrdered = _pFrom.X5
_8_revMask = uint64(i32(0))
if ((_pWLoop.X0) & (^(_pFrom.X0))) != uint64(i32(0)) {
goto _39
}
if ((_pWLoop.X1) & (_pFrom.X0)) != uint64(i32(0)) {
goto _39
}
if (((_pWLoop.X9) & uint32(i32(16384))) != uint32(i32(0))) && (int32(_pFrom.X2) < i32(10)) {
func() {
if i32(10) != int32(_sqlite3LogEst(tls, uint64(i32(2)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134331), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(60363)))
crt.X__builtin_abort(tls)
}
}()
goto _39
}
_8_rUnsorted = _sqlite3LogEstAdd(tls, _pWLoop.X5, int16(int32(_pWLoop.X6)+int32(_pFrom.X2)))
_8_rUnsorted = _sqlite3LogEstAdd(tls, _8_rUnsorted, _pFrom.X4)
_8_nOut = int16(int32(_pFrom.X2) + int32(_pWLoop.X7))
_8_maskNew = (_pFrom.X0) | (_pWLoop.X1)
if int32(_8_isOrdered) < i32(0) {
_8_isOrdered = _wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, _pWInfo.X10, uint16(_iLoop), _pWLoop, &_8_revMask)
goto _49
}
_8_revMask = _pFrom.X1
_49:
if int32(_8_isOrdered) < i32(0) || int32(_8_isOrdered) >= _nOrderBy {
goto _51
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered)))) == i32(0) {
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered))) = _whereSortingCost(tls, _pWInfo, _nRowEst, _nOrderBy, int32(_8_isOrdered))
}
_8_rCost = _sqlite3LogEstAdd(tls, _8_rUnsorted, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aSortCost)) + 2*uintptr(_8_isOrdered))))
goto _53
_51:
_8_rCost = _8_rUnsorted
_53:
*func() **XWherePath { _jj = i32(0); return &_pTo }() = _aTo
_54:
if _jj >= _nTo {
goto _57
}
if ((_pTo.X0) == _8_maskNew) && (((int32(_pTo.X5) ^ int32(_8_isOrdered)) & i32(128)) == i32(0)) {
goto _57
}
*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(28)
goto _54
_57:
if _jj < _nTo {
goto _60
}
if (_nTo >= _mxChoice) && ((int32(_8_rCost) > int32(_mxCost)) || ((int32(_8_rCost) == int32(_mxCost)) && (int32(_8_rUnsorted) >= int32(_mxUnsorted)))) {
goto _39
}
if _nTo < _mxChoice {
_jj = postInc1(&_nTo, int32(1))
goto _66
}
_jj = _mxI
_66:
_pTo = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 28*uintptr(_jj)))
goto _67
_60:
if (int32(_pTo.X3) < int32(_8_rCost)) || ((int32(_pTo.X3) == int32(_8_rCost)) && (int32(_pTo.X2) <= int32(_8_nOut))) {
goto _39
}
_67:
*(*uint64)(unsafe.Pointer(&(_pTo.X0))) = (_pFrom.X0) | (_pWLoop.X1)
*(*uint64)(unsafe.Pointer(&(_pTo.X1))) = _8_revMask
*(*int16)(unsafe.Pointer(&(_pTo.X2))) = _8_nOut
*(*int16)(unsafe.Pointer(&(_pTo.X3))) = _8_rCost
*(*int16)(unsafe.Pointer(&(_pTo.X4))) = _8_rUnsorted
*(*int8)(unsafe.Pointer(&(_pTo.X5))) = _8_isOrdered
crt.Xmemcpy(tls, (unsafe.Pointer)(_pTo.X6), (unsafe.Pointer)(_pFrom.X6), u32(4)*uint32(_iLoop))
*(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTo.X6)) + 4*uintptr(_iLoop))) = _pWLoop
if _nTo < _mxChoice {
goto _71
}
_mxI = i32(0)
_mxCost = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 28*uintptr(i32(0)))).X3
_mxUnsorted = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 28*uintptr(i32(0)))).X2
*func() **XWherePath { _jj = i32(1); return &_pTo }() = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aTo)) + 28*uintptr(i32(1))))
_72:
if _jj >= _mxChoice {
goto _75
}
if (int32(_pTo.X3) > int32(_mxCost)) || ((int32(_pTo.X3) == int32(_mxCost)) && (int32(_pTo.X4) > int32(_mxUnsorted))) {
_mxCost = _pTo.X3
_mxUnsorted = _pTo.X4
_mxI = _jj
}
*(*uintptr)(unsafe.Pointer(func() **XWherePath { _jj += 1; return &_pTo }())) += uintptr(28)
goto _72
_75:
_71:
_39:
_pWLoop = (*XWhereLoop)(_pWLoop.X14)
goto _38
_41:
*(*uintptr)(unsafe.Pointer(func() **XWherePath { _ii += 1; return &_pFrom }())) += uintptr(28)
goto _34
_37:
_pFrom = _aTo
_aTo = _aFrom
_aFrom = _pFrom
_nFrom = _nTo
_iLoop += 1
goto _30
_33:
if _nFrom == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(106569))
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pSpace))
return i32(1)
}
_pFrom = _aFrom
_ii = i32(1)
_80:
if _ii >= _nFrom {
goto _83
}
if int32(_pFrom.X3) > int32((*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom))+28*uintptr(_ii))).X3) {
_pFrom = (*XWherePath)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aFrom)) + 28*uintptr(_ii)))
}
_ii += 1
goto _80
_83:
func() {
if int32(_pWInfo.X11) != _nLoop {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134512), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106587)))
crt.X__builtin_abort(tls)
}
}()
_iLoop = i32(0)
_87:
if _iLoop >= _nLoop {
goto _90
}
_28_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))))) + uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(_iLoop)))))*uintptr(unsafe.Pointer((*XWhereLevel)(unsafe.Pointer(uintptr(76)))))))))))
*(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_28_pLevel.X18))))) = store67(&_pWLoop, *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 4*uintptr(_iLoop))))
*(*uint8)(unsafe.Pointer(&(_28_pLevel.X11))) = _pWLoop.X3
*(*int32)(unsafe.Pointer(&(_28_pLevel.X1))) = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 68*uintptr(_28_pLevel.X11))).X11
_iLoop += 1
goto _87
_90:
if (int32(_pWInfo.X10)&i32(256)) == i32(0) || (int32(_pWInfo.X10)&i32(128)) != i32(0) || int32(_pWInfo.X16) != i32(0) || _nRowEst == 0 {
goto _94
}
_29_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X3), _pFrom, uint16(i32(128)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 4*uintptr(_nLoop-i32(1)))), &_29_notUsed))
if _29_rc == ((*XExprList)(_pWInfo.X3).X0) {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(2))
}
_94:
if (*XExprList)(_pWInfo.X2) == nil {
goto _96
}
if (int32(_pWInfo.X10) & i32(128)) == 0 {
goto _97
}
if int32(_pFrom.X5) == ((*XExprList)(_pWInfo.X2).X0) {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X16))) = uint8(i32(2))
}
goto _99
_97:
*(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = _pFrom.X5
*(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _pFrom.X1
if int32(_pWInfo.X12) > i32(0) {
goto _100
}
*(*int8)(unsafe.Pointer(&(_pWInfo.X12))) = int8(i32(0))
if _nLoop <= i32(0) {
goto _101
}
_36_wsFlags = (*(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 4*uintptr(_nLoop-i32(1))))).X9
if (_36_wsFlags&uint32(i32(4096))) != uint32(i32(0)) || (_36_wsFlags&uint32(i32(260))) == uint32(i32(260)) {
goto _103
}
_37_m = u64(0)
_37_rc = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(2048)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 4*uintptr(_nLoop-i32(1)))), &_37_m))
if _37_rc == ((*XExprList)(_pWInfo.X2).X0) {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X17))) = uint8(i32(1))
*(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _37_m
}
_103:
_101:
_100:
_99:
if (int32(_pWInfo.X10)&i32(512)) == 0 || int32(_pWInfo.X12) != ((*XExprList)(_pWInfo.X2).X0) || _nLoop <= i32(0) {
goto _107
}
_39_revMask = u64(0)
_39_nOrder = int32(_wherePathSatisfiesOrderBy(tls, _pWInfo, (*XExprList)(_pWInfo.X2), _pFrom, uint16(i32(0)), uint16(_nLoop-i32(1)), *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pFrom.X6)) + 4*uintptr(_nLoop-i32(1)))), &_39_revMask))
func() {
if int32(_pWInfo.X13) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134567), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSolverØ00__func__Ø000))), unsafe.Pointer(str(106609)))
crt.X__builtin_abort(tls)
}
}()
if _39_nOrder == ((*XExprList)(_pWInfo.X2).X0) {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X13))) = uint8(i32(1))
*(*uint64)(unsafe.Pointer(&(_pWInfo.X20))) = _39_revMask
}
_107:
_96:
*(*int16)(unsafe.Pointer(&(_pWInfo.X21))) = _pFrom.X2
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pSpace))
return i32(0)
_ = _29_notUsed
panic(0)
}
var _wherePathSolverØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_wherePathSolverØ00__func__Ø000[0], str(106627), 16)
}
// Examine a WherePath (with the addition of the extra WhereLoop of the 6th
// parameters) to see if it outputs rows in the requested ORDER BY
// (or GROUP BY) without requiring a separate sort operation. Return N:
//
// N>0: N terms of the ORDER BY clause are satisfied
// N==0: No terms of the ORDER BY clause are satisfied
// N<0: Unknown yet how many terms of ORDER BY might be satisfied.
//
// Note that processing for WHERE_GROUPBY and WHERE_DISTINCTBY is not as
// strict. With GROUP BY and DISTINCT the only requirement is that
// equivalent rows appear immediately adjacent to one another. GROUP BY
// and DISTINCT do not require rows to appear in any particular order as long
// as equivalent rows are grouped together. Thus for GROUP BY and DISTINCT
// the pOrderBy terms can be matched in any order. With ORDER BY, the
// pOrderBy terms must be matched in strict left-to-right order.
func _wherePathSatisfiesOrderBy(tls *crt.TLS, _pWInfo *XWhereInfo, _pOrderBy *XExprList, _pPath *XWherePath, _wctrlFlags uint16, _nLoop uint16, _pLast *XWhereLoop, _pRevMask *uint64) (r0 int8) {
var _iLoop, _i, _j, _iCur, _iColumn int32
var _obSat, _obDone, _orderDistinctMask, _ready, _38_mTerm, _41_m uint64
var _9_z1, _9_z2 *int8
var _eqOpMask, _nKeyCol, _nColumn, _nOrderBy, _15_eOp uint16
var _revSet, _rev, _revIdx, _isOrderDistinct, _distinctColumns, _isMatch, _14_bOnce uint8
var _db *Xsqlite3
var _pOBExpr, _18_pX, _38_p *XExpr
var _pIndex *XIndex
var _pColl *XCollSeq
var _pLoop *XWhereLoop
var _pTerm *XWhereTerm
_pLoop = nil
_db = (*Xsqlite3)((*XParse)(_pWInfo.X0).X0)
_obSat = u64(0)
func() {
if _pOrderBy == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133901), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106643)))
crt.X__builtin_abort(tls)
}
}()
if (_nLoop != 0) && ((int32(_db.X13) & i32(128)) != i32(0)) {
return int8(i32(0))
}
_nOrderBy = uint16(_pOrderBy.X0)
if int32(_nOrderBy) > i32(63) {
return int8(i32(0))
}
_isOrderDistinct = uint8(i32(1))
_obDone = (u64(1) << uint(int32(_nOrderBy))) - uint64(i32(1))
_orderDistinctMask = uint64(i32(0))
_ready = uint64(i32(0))
_eqOpMask = uint16(i32(386))
if (int32(_wctrlFlags) & i32(2048)) != 0 {
{
p := &_eqOpMask
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
}
_iLoop = i32(0)
_6:
if _isOrderDistinct == 0 || _obSat >= _obDone || _iLoop > int32(_nLoop) {
goto _11
}
if _iLoop > i32(0) {
{
p := &_ready
*p = (*p) | (_pLoop.X1)
sink17 = *p
}
}
if _iLoop >= int32(_nLoop) {
goto _13
}
_pLoop = *(**XWhereLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPath.X6)) + 4*uintptr(_iLoop)))
if (int32(_wctrlFlags) & i32(2048)) != 0 {
goto _7
}
goto _15
_13:
_pLoop = _pLast
_15:
if ((_pLoop.X9) & uint32(i32(1024))) == 0 {
goto _16
}
if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2) != 0 {
_obSat = _obDone
}
goto _11
_16:
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3))) = uint16(i32(0))
_iCur = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 68*uintptr(_pLoop.X3))).X11
_i = i32(0)
_19:
if _i >= int32(_nOrderBy) {
goto _22
}
if ((u64(1) << uint(_i)) & _obSat) != 0 {
goto _20
}
_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X0))
if int32(_pOBExpr.X0) != i32(152) {
goto _20
}
if (_pOBExpr.X8) != _iCur {
goto _20
}
_pTerm = _sqlite3WhereFindTerm(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))), _iCur, int32(_pOBExpr.X9), ^_ready, uint32(_eqOpMask), nil)
if _pTerm == nil {
goto _20
}
if int32(_pTerm.X4) != i32(1) {
goto _27
}
func() {
if (int32(_wctrlFlags) & i32(2048)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133946), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106655)))
crt.X__builtin_abort(tls)
}
}()
_j = i32(0)
_30:
if _j >= int32(_pLoop.X10) || _pTerm == (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))) {
goto _34
}
_j += 1
goto _30
_34:
if _j >= int32(_pLoop.X10) {
goto _20
}
_27:
if (int32(_pTerm.X4)&i32(130)) == i32(0) || int32(_pOBExpr.X9) < i32(0) {
goto _37
}
_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X0))
if _pColl == nil {
_pColl = (*XCollSeq)(_db.X2)
}
_9_z1 = _pColl.X0
_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)(_pTerm.X0))
if _pColl == nil {
_pColl = (*XCollSeq)(_db.X2)
}
_9_z2 = _pColl.X0
if _sqlite3StrICmp(tls, _9_z1, _9_z2) != i32(0) {
goto _20
}
_37:
{
p := &_obSat
*p = (*p) | (u64(1) << uint(_i))
sink17 = *p
}
_20:
_i += 1
goto _19
_22:
if ((_pLoop.X9) & uint32(i32(4096))) != uint32(i32(0)) {
goto _41
}
if ((_pLoop.X9) & uint32(i32(256))) != 0 {
_pIndex = nil
_nKeyCol = uint16(i32(0))
_nColumn = uint16(i32(1))
goto _46
}
if (store69(&_pIndex, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)) == nil) || (((uint32((_pIndex.X16)>>uint(i32(2))) << uint(i32(31))) >> uint(i32(31))) != 0) {
return int8(i32(0))
}
_nKeyCol = _pIndex.X13
_nColumn = _pIndex.X14
func() {
if int32(_nColumn) != (int32(_nKeyCol)+i32(1)) && (((*XTable)(_pIndex.X3).X9)&uint32(i32(32))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133974), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106688)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(int32(_nColumn)-i32(1))))) != i32(-1) && (((*XTable)(_pIndex.X3).X9)&uint32(i32(32))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133975), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106736)))
crt.X__builtin_abort(tls)
}
}()
_isOrderDistinct = uint8(bool2int(int32(_pIndex.X15) != i32(0)))
_46:
_rev = store2(&_revSet, uint8(i32(0)))
_distinctColumns = uint8(i32(0))
_j = i32(0)
_53:
if _j >= int32(_nColumn) {
goto _56
}
_14_bOnce = uint8(i32(1))
func() {
if _j < int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) && ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))) == nil) != (_j < int32(_pLoop.X11)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(133988), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106803)))
crt.X__builtin_abort(tls)
}
}()
if _j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) || _j < int32(_pLoop.X11) {
goto _61
}
_15_eOp = (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))).X4
if (int32(_15_eOp) & int32(_eqOpMask)) == i32(0) {
goto _62
}
if (int32(_15_eOp) & i32(256)) != 0 {
_isOrderDistinct = uint8(i32(0))
}
goto _54
_62:
if func() int32 {
if (int32(_15_eOp) & i32(1)) != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134008), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _67
}
_18_pX = (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))).X0)
_i = _j + i32(1)
_68:
if _i >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) {
goto _71
}
if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_i)))).X0) == _18_pX {
func() {
if (int32((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_i)))).X4) & i32(1)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134016), unsafe.Pointer((*int8)(unsafe.Pointer(&_wherePathSatisfiesOrderByØ00__func__Ø000))), unsafe.Pointer(str(106868)))
crt.X__builtin_abort(tls)
}
}()
_14_bOnce = uint8(i32(0))
goto _71
}
_i += 1
goto _68
_71:
_67:
_61:
if _pIndex == nil {
goto _75
}
_iColumn = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_j))))
_revIdx = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_j)))
if _iColumn == int32((*XTable)(_pIndex.X3).X10) {
_iColumn = i32(-1)
}
goto _77
_75:
_iColumn = i32(-1)
_revIdx = uint8(i32(0))
_77:
if (((_isOrderDistinct != 0) && (_iColumn >= i32(0))) && (_j >= int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIndex.X3).X1)+16*uintptr(_iColumn))).X3) == i32(0)) {
_isOrderDistinct = uint8(i32(0))
}
_isMatch = uint8(i32(0))
_i = i32(0)
_82:
if _14_bOnce == 0 || _i >= int32(_nOrderBy) {
goto _86
}
if ((u64(1) << uint(_i)) & _obSat) != 0 {
goto _83
}
_pOBExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X0))
if (int32(_wctrlFlags) & i32(192)) == i32(0) {
_14_bOnce = uint8(i32(0))
}
if _iColumn < i32(-1) {
goto _89
}
if int32(_pOBExpr.X0) != i32(152) {
goto _83
}
if (_pOBExpr.X8) != _iCur {
goto _83
}
if int32(_pOBExpr.X9) != _iColumn {
goto _83
}
goto _93
_89:
if _sqlite3ExprCompare(tls, _pOBExpr, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIndex.X10).X2)))))+20*uintptr(_j))).X0), _iCur) != 0 {
goto _83
}
_93:
if _iColumn < i32(0) {
goto _95
}
_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWInfo.X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X0))
if _pColl == nil {
_pColl = (*XCollSeq)(_db.X2)
}
if _sqlite3StrICmp(tls, _pColl.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_j)))) != i32(0) {
goto _83
}
_95:
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3))) = uint16(_j + i32(1))
_isMatch = uint8(i32(1))
goto _86
_83:
_i += 1
goto _82
_86:
if _isMatch == 0 || (int32(_wctrlFlags)&i32(64)) != i32(0) {
goto _99
}
if _revSet == 0 {
goto _100
}
if (int32(_rev) ^ int32(_revIdx)) != int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X3) {
_isMatch = uint8(i32(0))
}
goto _102
_100:
_rev = uint8(int32(_revIdx) ^ int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2)))))+20*uintptr(_i))).X3))
if _rev != 0 {
{
p := _pRevMask
*p = (*p) | (u64(1) << uint(_iLoop))
sink17 = *p
}
}
_revSet = uint8(i32(1))
_102:
_99:
if _isMatch == 0 {
goto _104
}
if _iColumn == i32(-1) {
_distinctColumns = uint8(i32(1))
}
{
p := &_obSat
*p = (*p) | (u64(1) << uint(_i))
sink17 = *p
}
goto _106
_104:
if (_j == i32(0)) || (_j < int32(_nKeyCol)) {
_isOrderDistinct = uint8(i32(0))
}
goto _56
_106:
_54:
_j += 1
goto _53
_56:
if _distinctColumns != 0 {
_isOrderDistinct = uint8(i32(1))
}
_41:
if _isOrderDistinct == 0 {
goto _110
}
{
p := &_orderDistinctMask
*p = (*p) | (_pLoop.X1)
sink17 = *p
}
_i = i32(0)
_111:
if _i >= int32(_nOrderBy) {
goto _114
}
if ((u64(1) << uint(_i)) & _obSat) != 0 {
goto _112
}
_38_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pOrderBy.X2))))) + 20*uintptr(_i))).X0)
_38_mTerm = _sqlite3WhereExprUsage(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _38_p)
if (_38_mTerm == uint64(i32(0))) && (_sqlite3ExprIsConstant(tls, _38_p) == 0) {
goto _112
}
if (_38_mTerm & (^_orderDistinctMask)) == uint64(i32(0)) {
{
p := &_obSat
*p = (*p) | (u64(1) << uint(_i))
sink17 = *p
}
}
_112:
_i += 1
goto _111
_114:
_110:
_7:
_iLoop += 1
goto _6
_11:
if _obSat == _obDone {
return int8(_nOrderBy)
}
if _isOrderDistinct != 0 {
goto _120
}
_i = int32(_nOrderBy) - i32(1)
_121:
if _i <= i32(0) {
goto _124
}
_41_m = (u64(1) << uint(_i)) - uint64(i32(1))
if (_obSat & _41_m) == _41_m {
return int8(_i)
}
_i -= 1
goto _121
_124:
return int8(i32(0))
_120:
return int8(i32(-1))
}
var _wherePathSatisfiesOrderByØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_wherePathSatisfiesOrderByØ00__func__Ø000[0], str(106906), 26)
}
// Return the cost of sorting nRow rows, assuming that the keys have
// nOrderby columns and that the first nSorted columns are already in
// order.
func _whereSortingCost(tls *crt.TLS, _pWInfo *XWhereInfo, _nRow int16, _nOrderBy int32, _nSorted int32) (r0 int16) {
var _rScale, _rSortCost int16
func() {
if _nOrderBy <= i32(0) || i32(66) != int32(_sqlite3LogEst(tls, uint64(i32(100)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134201), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereSortingCostØ00__func__Ø000))), unsafe.Pointer(str(106932)))
crt.X__builtin_abort(tls)
}
}()
_rScale = int16(int32(_sqlite3LogEst(tls, uint64(((_nOrderBy-_nSorted)*i32(100))/_nOrderBy))) - i32(66))
_rSortCost = int16((int32(_nRow) + int32(_rScale)) + i32(16))
if ((int32(_pWInfo.X10) & i32(16384)) != i32(0)) && (int32(_pWInfo.X5) < int32(_nRow)) {
_nRow = _pWInfo.X5
}
{
p := &_rSortCost
*p = int16(int32(*p) + int32(_estLog(tls, _nRow)))
sink18 = *p
}
return _rSortCost
}
var _whereSortingCostØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_whereSortingCostØ00__func__Ø000[0], str(106969), 17)
}
// Generate code to construct the Index object for an automatic index
// and to set up the WhereLevel object pLevel so that the code generator
// makes use of the automatic index.
func _constructAutomaticIndex(tls *crt.TLS, _pParse *XParse, _pWC *XWhereClause, _pSrc *TSrcList_item, _notReady uint64, _pLevel *XWhereLevel) {
var _nKeyCol, _addrInit, _addrTop, _regRecord, _n, _i, _mxBitCol, _iContinue, _addrCounter, _regBase, _3_iCol, _10_iCol, _16_regYield int32
var _idxCols, _extraCols, _3_cMask, _10_cMask uint64
var _zNotUsed *int8
var _sentWarning uint8
var _pTable *XTable
var _v *TVdbe
var _pTabItem *TSrcList_item
var _pPartial, _1_pExpr, _11_pX *XExpr
var _pIdx *XIndex
var _pColl *XCollSeq
var _pLoop *XWhereLoop
var _pTerm, _pWCEnd *XWhereTerm
_sentWarning = u8(0)
_pPartial = nil
_iContinue = i32(0)
_addrCounter = i32(0)
_v = (*TVdbe)(_pParse.X2)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131050), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_addrInit = _sqlite3VdbeAddOp0(tls, _v, i32(20))
_nKeyCol = i32(0)
_pTable = (*XTable)(_pSrc.X4)
_pWCEnd = (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_pWC.X3)))
_pLoop = (*XWhereLoop)(_pLevel.X18)
_idxCols = uint64(i32(0))
_pTerm = (*XWhereTerm)(_pWC.X5)
_2:
if uintptr(unsafe.Pointer(_pTerm)) >= uintptr(unsafe.Pointer(_pWCEnd)) {
goto _5
}
_1_pExpr = (*XExpr)(_pTerm.X0)
func() {
if ((_1_pExpr.X2)&uint32(i32(1))) != uint32(i32(0)) && int32(_1_pExpr.X11) == (_pSrc.X11) && (_pLoop.X0) == uint64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131062), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(106986)))
crt.X__builtin_abort(tls)
}
}()
if ((((_pLoop.X0) == uint64(i32(0))) && ((int32(_pTerm.X3) & i32(2)) == i32(0))) && (((_1_pExpr.X2) & uint32(i32(1))) == uint32(i32(0)))) && _sqlite3ExprIsTableConstant(tls, _1_pExpr, _pSrc.X11) != 0 {
_pPartial = _sqlite3ExprAnd(tls, (*Xsqlite3)(_pParse.X0), _pPartial, _sqlite3ExprDup(tls, (*Xsqlite3)(_pParse.X0), _1_pExpr, i32(0)))
}
if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
goto _14
}
_3_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))
_3_cMask = func() uint64 {
if _3_iCol >= i32(64) {
return u64(9223372036854775808)
}
return (u64(1) << uint(_3_iCol))
}()
if _sentWarning == 0 {
Xsqlite3_log(tls, i32(284), str(107084), unsafe.Pointer(_pTable.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTable.X1)+16*uintptr(_3_iCol))).X0))
_sentWarning = uint8(i32(1))
}
if (_idxCols & _3_cMask) != uint64(i32(0)) {
goto _18
}
if _whereLoopResize(tls, (*Xsqlite3)(_pParse.X0), _pLoop, _nKeyCol+i32(1)) != 0 {
goto _end_auto_index_create
}
*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(postInc1(&_nKeyCol, int32(1))))) = _pTerm
{
p := &_idxCols
*p = (*p) | _3_cMask
sink17 = *p
}
_18:
_14:
*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
goto _2
_5:
func() {
if _nKeyCol <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131092), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107110)))
crt.X__builtin_abort(tls)
}
}()
*(*uint16)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0))) = store14((*uint16)(unsafe.Pointer(&(_pLoop.X10))), uint16(_nKeyCol))
*(*uint32)(unsafe.Pointer(&(_pLoop.X9))) = uint32(i32(16961))
_extraCols = (_pSrc.X14) & ((^_idxCols) | u64(9223372036854775808))
_mxBitCol = func() int32 {
if i32(63) < int32(_pTable.X11) {
return i32(63)
}
return int32(_pTable.X11)
}()
_i = i32(0)
_24:
if _i >= _mxBitCol {
goto _27
}
if (_extraCols & (u64(1) << uint(_i))) != 0 {
_nKeyCol += 1
}
_i += 1
goto _24
_27:
if ((_pSrc.X14) & u64(9223372036854775808)) != 0 {
{
p := &_nKeyCol
*p = (*p) + ((int32(_pTable.X11) - i32(64)) + i32(1))
sink1 = *p
}
}
_pIdx = _sqlite3AllocateIndexObject(tls, (*Xsqlite3)(_pParse.X0), int16(_nKeyCol+i32(1)), i32(0), &_zNotUsed)
if _pIdx == nil {
goto _end_auto_index_create
}
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4))))) = _pIdx
*(**int8)(unsafe.Pointer(&(_pIdx.X0))) = str(107120)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIdx.X3))))) = _pTable
_n = i32(0)
_idxCols = uint64(i32(0))
_pTerm = (*XWhereTerm)(_pWC.X5)
_31:
if uintptr(unsafe.Pointer(_pTerm)) >= uintptr(unsafe.Pointer(_pWCEnd)) {
goto _34
}
if _termCanDriveIndex(tls, _pTerm, _pSrc, _notReady) == 0 {
goto _35
}
_10_iCol = *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))
_10_cMask = func() uint64 {
if _10_iCol >= i32(64) {
return u64(9223372036854775808)
}
return (u64(1) << uint(_10_iCol))
}()
if (_idxCols & _10_cMask) == uint64(i32(0)) {
_11_pX = (*XExpr)(_pTerm.X0)
{
p := &_idxCols
*p = (*p) | _10_cMask
sink17 = *p
}
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(*(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))))
_pColl = _sqlite3BinaryCompareCollSeq(tls, _pParse, (*XExpr)(_11_pX.X4), (*XExpr)(_11_pX.X5))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_n))) = func() *int8 {
if _pColl != nil {
return (_pColl.X0)
}
return (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
}()
_n += 1
}
_35:
*(*uintptr)(unsafe.Pointer(&_pTerm)) += uintptr(48)
goto _31
_34:
func() {
if uint32(_n) != uint32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131140), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107131)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_43:
if _i >= _mxBitCol {
goto _46
}
if (_extraCols & (u64(1) << uint(_i))) != 0 {
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
_n += 1
}
_i += 1
goto _43
_46:
if ((_pSrc.X14) & u64(9223372036854775808)) == 0 {
goto _48
}
_i = i32(63)
_49:
if _i >= int32(_pTable.X11) {
goto _52
}
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(_i)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
_n += 1
_i += 1
goto _49
_52:
_48:
func() {
if _n != _nKeyCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131158), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107158)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_n))) = int16(i32(-1))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_n))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
func() {
if (_pLevel.X2) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(131163), unsafe.Pointer((*int8)(unsafe.Pointer(&_constructAutomaticIndexØ00__func__Ø000))), unsafe.Pointer(str(107169)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pLevel.X2))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(109), _pLevel.X2, _nKeyCol+i32(1))
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
_sqlite3VdbeComment(tls, _v, str(107188), unsafe.Pointer(_pTable.X0))
_sqlite3ExprCachePush(tls, _pParse)
_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)((*XWhereInfo)(_pWC.X0).X1).X2))))) + 68*uintptr(_pLevel.X11)))
if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_16_regYield = _pTabItem.X7
_addrCounter = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), i32(0))
_sqlite3VdbeAddOp3(tls, _v, i32(15), _16_regYield, i32(0), _pTabItem.X6)
_addrTop = _sqlite3VdbeAddOp1(tls, _v, i32(16), _16_regYield)
_sqlite3VdbeComment(tls, _v, str(107195), unsafe.Pointer((*XTable)(_pTabItem.X4).X0))
goto _58
}
_addrTop = _sqlite3VdbeAddOp1(tls, _v, i32(37), _pLevel.X1)
_58:
if _pPartial != nil {
_iContinue = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfFalse(tls, _pParse, _pPartial, _iContinue, i32(16))
{
p := (*uint32)(unsafe.Pointer(&(_pLoop.X9)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
}
_regRecord = _sqlite3GetTempReg(tls, _pParse)
_regBase = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _pLevel.X1, _regRecord, i32(0), nil, nil, i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(128), _pLevel.X2, _regRecord)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
if _pPartial != nil {
_sqlite3VdbeResolveLabel(tls, _v, _iContinue)
}
if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_sqlite3VdbeChangeP2(tls, _v, uint32(_addrCounter), _regBase+_n)
_translateColumnToCopy(tls, _pParse, _addrTop, _pLevel.X1, _pTabItem.X8, i32(1))
_sqlite3VdbeGoto(tls, _v, _addrTop)
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1))), int8(i32(0)), 16, 4)
goto _62
}
_sqlite3VdbeAddOp2(tls, _v, i32(7), _pLevel.X1, _addrTop+i32(1))
_62:
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(3)))
_sqlite3VdbeJumpHere(tls, _v, _addrTop)
_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
_sqlite3ExprCachePop(tls, _pParse)
_sqlite3VdbeJumpHere(tls, _v, _addrInit)
_end_auto_index_create:
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), _pPartial)
_ = _zNotUsed
}
var _constructAutomaticIndexØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_constructAutomaticIndexØ00__func__Ø000[0], str(107212), 24)
}
// 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 _sqlite3AllocateIndexObject(tls *crt.TLS, _db *Xsqlite3, _nCol int16, _nExtra int32, _ppExtra **int8) (r0 *XIndex) {
var _nByte int32
var _1_pExtra *int8
var _p *XIndex
_nByte = int32((u32(56) + (((u32(4) * uint32(_nCol)) + uint32(i32(7))) & uint32(i32(-8)))) + (((((u32(2) * uint32(int32(_nCol)+i32(1))) + (u32(2) * uint32(_nCol))) + (u32(1) * uint32(_nCol))) + uint32(i32(7))) & uint32(i32(-8))))
_p = (*XIndex)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte+_nExtra)))
if _p != nil {
_1_pExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(56))))))))
*(***int8)(unsafe.Pointer(&(_p.X8))) = (**int8)(unsafe.Pointer(_1_pExtra))
{
p := &_1_pExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(((u32(4)*uint32(_nCol))+uint32(i32(7)))&uint32(i32(-8)))))
sink0 = *p
}
*(**int16)(unsafe.Pointer(&(_p.X2))) = (*int16)(unsafe.Pointer(_1_pExtra))
{
p := &_1_pExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u32(2)*uint32(int32(_nCol)+i32(1)))))
sink0 = *p
}
*(**int16)(unsafe.Pointer(&(_p.X1))) = (*int16)(unsafe.Pointer(_1_pExtra))
{
p := &_1_pExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u32(2)*uint32(_nCol))))
sink0 = *p
}
*(**uint8)(unsafe.Pointer(&(_p.X7))) = (*uint8)(unsafe.Pointer(_1_pExtra))
*(*uint16)(unsafe.Pointer(&(_p.X14))) = uint16(_nCol)
*(*uint16)(unsafe.Pointer(&(_p.X13))) = uint16(int32(_nCol) - i32(1))
*_ppExtra = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p)))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_nByte)))))))
}
return _p
}
// 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 _sqlite3GenerateIndexKey(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iDataCur int32, _regOut int32, _prefixOnly int32, _piPartIdxLabel *int32, _pPrior *XIndex, _regPrior int32) (r0 int32) {
var _j, _regBase, _nCol int32
var _7_zAff *int8
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
if _piPartIdxLabel == nil {
goto _0
}
if (*XExpr)(_pIdx.X9) != nil {
*_piPartIdxLabel = _sqlite3VdbeMakeLabel(tls, _v)
*(*int32)(unsafe.Pointer(&(_pParse.X22))) = _iDataCur
_sqlite3ExprCachePush(tls, _pParse)
_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.X9), *_piPartIdxLabel, i32(16))
goto _2
}
*_piPartIdxLabel = i32(0)
_2:
_0:
_nCol = int32(func() uint16 {
if _prefixOnly != 0 && (((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0) {
return (_pIdx.X13)
}
return (_pIdx.X14)
}())
_regBase = _sqlite3GetTempRange(tls, _pParse, _nCol)
if (_pPrior != nil) && ((_regBase != _regPrior) || ((*XExpr)(_pPrior.X9) != nil)) {
_pPrior = nil
}
_j = i32(0)
_9:
if _j >= _nCol {
goto _12
}
if ((_pPrior != nil) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrior.X1)) + 2*uintptr(_j)))) == int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))))) && (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPrior.X1)) + 2*uintptr(_j)))) != i32(-2)) {
goto _10
}
_sqlite3ExprCodeLoadIndexColumn(tls, _pParse, _pIdx, _iDataCur, _j, _regBase+_j)
_sqlite3VdbeDeletePriorOpcode(tls, _v, uint8(i32(74)))
_10:
_j += 1
goto _9
_12:
if _regOut == 0 {
goto _16
}
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regBase, _nCol, _regOut)
if (*XSelect)((*XTable)(_pIdx.X3).X3) != nil {
_7_zAff = _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pIdx)
_sqlite3VdbeChangeP4(tls, _v, i32(-1), _7_zAff, i32(0))
}
_16:
_sqlite3ReleaseTempRange(tls, _pParse, _regBase, _nCol)
return _regBase
}
// 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 _sqlite3ExprIfFalseDup(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _dest int32, _jumpIfNull int32) {
var _db *Xsqlite3
var _pCopy *XExpr
_db = (*Xsqlite3)(_pParse.X0)
_pCopy = _sqlite3ExprDup(tls, _db, _pExpr, i32(0))
if int32(_db.X17) == i32(0) {
_sqlite3ExprIfFalse(tls, _pParse, _pCopy, _dest, _jumpIfNull)
}
_sqlite3ExprDelete(tls, _db, _pCopy)
}
// Generate code that will load into register regOut a value that is
// appropriate for the iIdxCol-th column of index pIdx.
func _sqlite3ExprCodeLoadIndexColumn(tls *crt.TLS, _pParse *XParse, _pIdx *XIndex, _iTabCur int32, _iIdxCol int32, _regOut int32) {
var _iTabCol int16
_iTabCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iIdxCol)))
if int32(_iTabCol) == i32(-2) {
func() {
if (*XExprList)(_pIdx.X10) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94130), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000))), unsafe.Pointer(str(107236)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*XExprList)(_pIdx.X10).X0) <= _iIdxCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(94131), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000))), unsafe.Pointer(str(107251)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pParse.X22))) = _iTabCur
_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+20*uintptr(_iIdxCol))).X0), _regOut)
goto _5
}
_sqlite3ExprCodeGetColumnOfTable(tls, (*TVdbe)(_pParse.X2), (*XTable)(_pIdx.X3), _iTabCur, int32(_iTabCol), _regOut)
_5:
}
var _sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000 [31]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeLoadIndexColumnØ00__func__Ø000[0], str(107281), 31)
}
// 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 _sqlite3ExprCodeCopy(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
_pExpr = _sqlite3ExprDup(tls, _db, _pExpr, i32(0))
if (_db.X17) == 0 {
_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
}
_sqlite3ExprDelete(tls, _db, _pExpr)
}
// If the last opcode is "op" and it is not a jump destination,
// then remove it. Return true if and only if an opcode was removed.
func _sqlite3VdbeDeletePriorOpcode(tls *crt.TLS, _p *TVdbe, _op uint8) (r0 int32) {
if ((_p.X27) > i32(0)) && (int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr((_p.X27)-i32(1)))).X0) == int32(_op)) {
return _sqlite3VdbeChangeToNoop(tls, _p, (_p.X27)-i32(1))
}
return i32(0)
}
// 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 _sqlite3IndexAffinityStr(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex) (r0 *int8) {
var _3_x int16
var _1_n int32
var _6_aff int8
var _1_pTab *XTable
if (_pIdx.X4) != nil {
goto _0
}
_1_pTab = (*XTable)(_pIdx.X3)
*(**int8)(unsafe.Pointer(&(_pIdx.X4))) = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pIdx.X14)+i32(1))))
if (_pIdx.X4) == nil {
_sqlite3OomFault(tls, _db)
return nil
}
_1_n = i32(0)
_2:
if _1_n >= int32(_pIdx.X14) {
goto _5
}
_3_x = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_n)))
if int32(_3_x) >= i32(0) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = (*XColumn)(unsafe.Pointer(uintptr(_1_pTab.X1) + 16*uintptr(_3_x))).X4
goto _9
}
if int32(_3_x) == i32(-1) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(68))
goto _9
}
func() {
if int32(_3_x) != i32(-2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108932), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000))), unsafe.Pointer(str(107312)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(_pIdx.X10) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108933), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3IndexAffinityStrØ00__func__Ø000))), unsafe.Pointer(str(107323)))
crt.X__builtin_abort(tls)
}
}()
_6_aff = _sqlite3ExprAffinity(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+20*uintptr(_1_n))).X0))
if int32(_6_aff) == i32(0) {
_6_aff = int8(i32(65))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = _6_aff
_9:
_1_n += 1
goto _2
_5:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X4)) + 1*uintptr(_1_n))) = int8(i32(0))
_0:
return _pIdx.X4
}
var _sqlite3IndexAffinityStrØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3IndexAffinityStrØ00__func__Ø000[0], str(107341), 24)
}
// Convert OP_Column opcodes to OP_Copy in previously generated code.
//
// This routine runs over generated VDBE code and translates OP_Column
// opcodes into OP_Copy when the table is being accessed via co-routine
// instead of via table lookup.
//
// If the bIncrRowid parameter is 0, then any OP_Rowid instructions on
// cursor iTabCur are transformed into OP_Null. Or, if bIncrRowid is non-zero,
// then each OP_Rowid is transformed into an instruction to increment the
// value stored in its output register.
func _translateColumnToCopy(tls *crt.TLS, _pParse *XParse, _iStart int32, _iTabCur int32, _iRegister int32, _bIncrRowid int32) {
var _iEnd int32
var _v *TVdbe
var _pOp *XVdbeOp
_v = (*TVdbe)(_pParse.X2)
_pOp = _sqlite3VdbeGetOp(tls, _v, _iStart)
_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
return
}
_0:
if _iStart >= _iEnd {
goto _4
}
if (_pOp.X3) != _iTabCur {
goto _2
}
if int32(_pOp.X0) == i32(99) {
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(64))
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = (_pOp.X4) + _iRegister
*(*int32)(unsafe.Pointer(&(_pOp.X4))) = _pOp.X5
*(*int32)(unsafe.Pointer(&(_pOp.X5))) = i32(0)
goto _8
}
if int32(_pOp.X0) != i32(125) {
goto _8
}
if _bIncrRowid != 0 {
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(73))
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = _pOp.X4
*(*int32)(unsafe.Pointer(&(_pOp.X4))) = i32(1)
goto _10
}
*(*uint8)(unsafe.Pointer(&(_pOp.X0))) = uint8(i32(59))
*(*int32)(unsafe.Pointer(&(_pOp.X3))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pOp.X5))) = i32(0)
_10:
_8:
_2:
*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _iStart += 1; return &_pOp }())) += uintptr(24)
goto _0
_4:
}
// This function is a no-op unless currently processing an EXPLAIN QUERY PLAN
// command, or if either SQLITE_DEBUG or SQLITE_ENABLE_STMT_SCANSTATUS was
// defined at compile-time. If it is not a no-op, a single OP_Explain opcode
// is added to the output to describe the table scan strategy in pLevel.
//
// If an OP_Explain opcode is added to the VM, its address is returned.
// Otherwise, if no OP_Explain is coded, zero is returned.
func _sqlite3WhereExplainOneScan(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pLevel *XWhereLevel, _iLevel int32, _iFrom int32, _wctrlFlags uint16) (r0 int32) {
var _ret, _1_iId, _1_isSearch int32
var _1_flags uint32
var _1_zMsg, _5_zFmt, _13_zRangeOp *int8
var _1_db *Xsqlite3
var _1_v *TVdbe
var _1_zBuf [100]int8
var _1_str XStrAccum
var _1_pItem *TSrcList_item
var _5_pIdx *XIndex
var _1_pLoop *XWhereLoop
_ret = i32(0)
_1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_pLevel.X11)))
_1_v = (*TVdbe)(_pParse.X2)
_1_db = (*Xsqlite3)(_pParse.X0)
_1_iId = _pParse.X58
_1_pLoop = (*XWhereLoop)(_pLevel.X18)
_1_flags = _1_pLoop.X9
if ((_1_flags & uint32(i32(8192))) != 0) || (int32(_wctrlFlags)&i32(32)) != 0 {
return i32(0)
}
_1_isSearch = bool2int((((_1_flags & uint32(i32(48))) != uint32(i32(0))) || (((_1_flags & uint32(i32(1024))) == uint32(i32(0))) && (int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X0) > i32(0)))) || (int32(_wctrlFlags)&i32(3)) != 0)
_sqlite3StrAccumInit(tls, &_1_str, _1_db, (*int8)(unsafe.Pointer(&_1_zBuf)), int32(u32(100)), i32(1000000000))
_sqlite3StrAccumAppendAll(tls, &_1_str, func() *int8 {
if _1_isSearch != 0 {
return str(107365)
}
return str(107372)
}())
if (*XSelect)(_1_pItem.X5) != nil {
_sqlite3XPrintf(tls, &_1_str, str(107377), int32(_1_pItem.X10))
goto _8
}
_sqlite3XPrintf(tls, &_1_str, str(107390), unsafe.Pointer(_1_pItem.X2))
_8:
if (_1_pItem.X3) != nil {
_sqlite3XPrintf(tls, &_1_str, str(107400), unsafe.Pointer(_1_pItem.X3))
}
if (_1_flags & uint32(i32(1280))) != uint32(i32(0)) {
goto _10
}
_5_zFmt = nil
func() {
if (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126959), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000))), unsafe.Pointer(str(107407)))
crt.X__builtin_abort(tls)
}
}()
_5_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4)
func() {
if (_1_flags&uint32(i32(16384))) != 0 && (_1_flags&uint32(i32(64))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126961), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000))), unsafe.Pointer(str(107432)))
crt.X__builtin_abort(tls)
}
}()
if (((*XTable)(_1_pItem.X4).X9)&uint32(i32(32))) == uint32(i32(0)) || int32((uint32(_5_pIdx.X16)<>uint(i32(30))) != i32(2) {
goto _17
}
if _1_isSearch != 0 {
_5_zFmt = str(107484)
}
goto _25
_17:
if (_1_flags & uint32(i32(131072))) != 0 {
_5_zFmt = str(107496)
goto _25
}
if (_1_flags & uint32(i32(16384))) != 0 {
_5_zFmt = str(107529)
goto _25
}
if (_1_flags & uint32(i32(64))) != 0 {
_5_zFmt = str(107554)
goto _25
}
_5_zFmt = str(107572)
_25:
if _5_zFmt != nil {
_sqlite3StrAccumAppend(tls, &_1_str, str(107581), i32(7))
_sqlite3XPrintf(tls, &_1_str, _5_zFmt, unsafe.Pointer(_5_pIdx.X0))
_explainIndexRange(tls, &_1_str, _1_pLoop)
}
goto _39
_10:
if (_1_flags&uint32(i32(256))) == uint32(i32(0)) || (_1_flags&uint32(i32(15))) == uint32(i32(0)) {
goto _29
}
if (_1_flags & uint32(i32(5))) != 0 {
_13_zRangeOp = str(107589)
goto _35
}
if (_1_flags & uint32(i32(48))) == uint32(i32(48)) {
_13_zRangeOp = str(107591)
goto _35
}
if (_1_flags & uint32(i32(32))) != 0 {
_13_zRangeOp = str(107605)
goto _35
}
func() {
if (_1_flags & uint32(i32(16))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126989), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereExplainOneScanØ00__func__Ø000))), unsafe.Pointer(str(107607)))
crt.X__builtin_abort(tls)
}
}()
_13_zRangeOp = str(107629)
_35:
_sqlite3XPrintf(tls, &_1_str, str(107631), unsafe.Pointer(_13_zRangeOp))
goto _39
_29:
if (_1_flags & uint32(i32(1024))) != uint32(i32(0)) {
_sqlite3XPrintf(tls, &_1_str, str(107669), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X0, unsafe.Pointer((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_1_pLoop.X8))))).X4))
}
_39:
_1_zMsg = _sqlite3StrAccumFinish(tls, &_1_str)
_ret = _sqlite3VdbeAddOp4(tls, _1_v, i32(165), _1_iId, _iLevel, _iFrom, _1_zMsg, i32(-1))
return _ret
_ = _1_str
_ = _1_zBuf
panic(0)
}
var _sqlite3WhereExplainOneScanØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereExplainOneScanØ00__func__Ø000[0], str(107696), 27)
}
// Argument pLevel describes a strategy for scanning table pTab. This
// function appends text to pStr that describes the subset of table
// rows scanned by the strategy in the form of an SQL expression.
//
// For example, if the query:
//
// SELECT * FROM t1 WHERE a=1 AND b>2;
//
// is run and there is an index on (a, b), then this function returns a
// string similar to:
//
// "a=? AND b>?"
func _explainIndexRange(tls *crt.TLS, _pStr *XStrAccum, _pLoop *XWhereLoop) {
var _i, _j int32
var _1_z *int8
var _nEq, _nSkip uint16
var _pIndex *XIndex
_pIndex = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)
_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0
_nSkip = _pLoop.X11
if (int32(_nEq) == i32(0)) && (((_pLoop.X9) & uint32(i32(48))) == uint32(i32(0))) {
return
}
_sqlite3StrAccumAppend(tls, _pStr, str(107723), i32(2))
_i = i32(0)
_2:
if _i >= int32(_nEq) {
goto _5
}
_1_z = _explainIndexColumnName(tls, _pIndex, _i)
if _i != 0 {
_sqlite3StrAccumAppend(tls, _pStr, str(107726), i32(5))
}
_sqlite3XPrintf(tls, _pStr, func() *int8 {
if _i >= int32(_nSkip) {
return str(107732)
}
return str(107737)
}(), unsafe.Pointer(_1_z))
_i += 1
goto _2
_5:
_j = _i
if ((_pLoop.X9) & uint32(i32(32))) != 0 {
_explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1), _j, _i, str(107605))
_i = i32(1)
}
if ((_pLoop.X9) & uint32(i32(16))) != 0 {
_explainAppendTerm(tls, _pStr, _pIndex, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2), _j, _i, str(107629))
}
_sqlite3StrAccumAppend(tls, _pStr, str(37898), i32(1))
}
// Return the name of the i-th column of the pIdx index.
func _explainIndexColumnName(tls *crt.TLS, _pIdx *XIndex, _i int32) (r0 *int8) {
_i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))))
if _i == i32(-2) {
return str(107745)
}
if _i == i32(-1) {
return str(27227)
}
return (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1) + 16*uintptr(_i))).X0
}
// This routine is a helper for explainIndexRange() below
//
// pStr holds the text of an expression that we are building up one term
// at a time. This routine adds a new term to the end of the expression.
// Terms are separated by AND so add the "AND" text for second and subsequent
// terms only.
func _explainAppendTerm(tls *crt.TLS, _pStr *XStrAccum, _pIdx *XIndex, _nTerm int32, _iTerm int32, _bAnd int32, _zOp *int8) {
var _i int32
func() {
if _nTerm < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126844), unsafe.Pointer((*int8)(unsafe.Pointer(&_explainAppendTermØ00__func__Ø000))), unsafe.Pointer(str(107752)))
crt.X__builtin_abort(tls)
}
}()
if _bAnd != 0 {
_sqlite3StrAccumAppend(tls, _pStr, str(107726), i32(5))
}
if _nTerm > i32(1) {
_sqlite3StrAccumAppend(tls, _pStr, str(107761), i32(1))
}
_i = i32(0)
_4:
if _i >= _nTerm {
goto _7
}
if _i != 0 {
_sqlite3StrAccumAppend(tls, _pStr, str(107763), i32(1))
}
_sqlite3StrAccumAppendAll(tls, _pStr, _explainIndexColumnName(tls, _pIdx, _iTerm+_i))
_i += 1
goto _4
_7:
if _nTerm > i32(1) {
_sqlite3StrAccumAppend(tls, _pStr, str(37898), i32(1))
}
_sqlite3StrAccumAppend(tls, _pStr, _zOp, i32(1))
if _nTerm > i32(1) {
_sqlite3StrAccumAppend(tls, _pStr, str(107761), i32(1))
}
_i = i32(0)
_11:
if _i >= _nTerm {
goto _14
}
if _i != 0 {
_sqlite3StrAccumAppend(tls, _pStr, str(107763), i32(1))
}
_sqlite3StrAccumAppend(tls, _pStr, str(50423), i32(1))
_i += 1
goto _11
_14:
if _nTerm > i32(1) {
_sqlite3StrAccumAppend(tls, _pStr, str(37898), i32(1))
}
}
var _explainAppendTermØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_explainAppendTermØ00__func__Ø000[0], str(107765), 18)
}
// Generate code for the start of the iLevel-th loop in the WHERE clause
// implementation described by pWInfo.
func _sqlite3WhereCodeOneLoopStart(tls *crt.TLS, _pWInfo *XWhereInfo, _iLevel int32, _notReady uint64) (r0 uint64) {
var _j, _k, _iCur, _addrNxt, _omitTable, _bRev, _addrBrk, _addrHalt, _addrCont, _iRowidReg, _iReleaseReg, _loopAgain, _3_regYield, _4_iReg, _4_addrNotFound, _4_nConstraint, _4_iIn, _5_iTarget, _15_testOp, _15_start, _15_memEndValue, _17_r1, _17_rTemp, _17_op, _26_regBase, _26_startEq, _26_endEq, _26_start_constraints, _26_nConstraint, _26_iIdxCur, _26_nExtraReg, _26_op, _65_iCovCur, _65_regReturn, _65_regRowset, _65_regRowid, _65_iLoopBody, _65_iRetInit, _65_untestedTerms, _65_ii, _66_nNotReady, _72_iTerm, _76_jmp1, _78_addrExplain, _79_r, _79_iSet, _81_nPk, _81_iPk, _82_iCol, _92_skipLikeAddr int32
var _96_x uint32
var _26_zStartAff, _26_zEndAff *int8
var _26_nEq, _26_nBtm, _26_nTop, _65_wctrlFlags uint16
var _26_bSeekPastNull, _26_bStopAtNull, _35_t, _36_t uint8
var _db *Xsqlite3
var _65_pTab *XTable
var _v *TVdbe
var _65_pOrTab *XSrcList
var _pTabItem, _66_origSrc *TSrcList_item
var _7_pRight, _10_pCompare, _10_pRight, _17_pX, _21_pX, _38_pRight, _46_pRight, _65_pAndExpr, _73_pExpr, _76_pOrExpr, _92_pE, _97_pE *XExpr
var _97_sEAlt XExpr
var _pParse *XParse
var _17_aMoveOp [4]uint8
var _pIdx, _58_pPk, _65_pCov, _71_pPk, _81_pPk *XIndex
var _10_pOp *XVdbeOp
var _76_pSubWInfo *XWhereInfo
var _pLoop, _78_pSubLoop *XWhereLoop
var _pLevel *XWhereLevel
var _pTerm, _15_pStart, _15_pEnd, _26_pRangeStart, _26_pRangeEnd, _34_t, _75_pOrTerm, _97_pAlt *XWhereTerm
var _pWC, _65_pOrWc *XWhereClause
_iRowidReg = i32(0)
_iReleaseReg = i32(0)
_pIdx = nil
_pParse = (*XParse)(_pWInfo.X0)
_v = (*TVdbe)(_pParse.X2)
_pWC = (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22)))
_db = (*Xsqlite3)(_pParse.X0)
_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(_iLevel)))
_pLoop = (*XWhereLoop)(_pLevel.X18)
_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2))))) + 68*uintptr(_pLevel.X11)))
_iCur = _pTabItem.X11
*(*uint64)(unsafe.Pointer(&(_pLevel.X19))) = _notReady & (^_sqlite3WhereGetMask(tls, (*XWhereMaskSet)(unsafe.Pointer(&(_pWInfo.X23))), _iCur))
_bRev = int32(((_pWInfo.X20) >> uint(_iLevel)) & uint64(i32(1)))
_omitTable = bool2int((((_pLoop.X9) & uint32(i32(64))) != uint32(i32(0))) && ((int32(_pWInfo.X10) & i32(32)) == i32(0)))
_addrBrk = store1((*int32)(unsafe.Pointer(&(_pLevel.X3))), store1((*int32)(unsafe.Pointer(&(_pLevel.X4))), _sqlite3VdbeMakeLabel(tls, _v)))
_addrCont = store1((*int32)(unsafe.Pointer(&(_pLevel.X6))), _sqlite3VdbeMakeLabel(tls, _v))
if (int32(_pLevel.X11) > i32(0)) && ((int32((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTabItem)) + 68*uintptr(i32(0)))).X9))).X0) & i32(8)) != i32(0)) {
*(*int32)(unsafe.Pointer(&(_pLevel.X0))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _pLevel.X0)
_sqlite3VdbeComment(tls, _v, str(107783))
}
_j = _iLevel
_3:
if _j <= i32(0) || ((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))+76*uintptr(_j))).X0) != i32(0) {
goto _7
}
_j -= 1
goto _3
_7:
_addrHalt = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(_j))).X3
if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_3_regYield = _pTabItem.X7
_sqlite3VdbeAddOp3(tls, _v, i32(15), _3_regYield, i32(0), _pTabItem.X6)
*(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _sqlite3VdbeAddOp2(tls, _v, i32(16), _3_regYield, _addrBrk)
_sqlite3VdbeComment(tls, _v, str(107195), unsafe.Pointer((*XTable)(_pTabItem.X4).X0))
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(13))
goto _270
}
if ((_pLoop.X9) & uint32(i32(1024))) == uint32(i32(0)) {
goto _10
}
_4_nConstraint = int32(_pLoop.X10)
_sqlite3ExprCachePush(tls, _pParse)
_4_iReg = _sqlite3GetTempRange(tls, _pParse, _4_nConstraint+i32(2))
_4_addrNotFound = _pLevel.X3
_j = i32(0)
_11:
if _j >= _4_nConstraint {
goto _14
}
_5_iTarget = (_4_iReg + _j) + i32(2)
_pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))
if func() int32 {
if _pTerm == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127994), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _12
}
if (int32(_pTerm.X4) & i32(1)) != 0 {
_codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _5_iTarget)
_4_addrNotFound = _pLevel.X4
goto _19
}
_7_pRight = (*XExpr)((*XExpr)(_pTerm.X0).X5)
_codeExprOrVector(tls, _pParse, _7_pRight, _5_iTarget, i32(1))
_19:
_12:
_j += 1
goto _11
_14:
_sqlite3VdbeAddOp2(tls, _v, i32(56), (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0, _4_iReg)
_sqlite3VdbeAddOp2(tls, _v, i32(56), _4_nConstraint, _4_iReg+i32(1))
_sqlite3VdbeAddOp4(tls, _v, i32(11), _iCur, _4_addrNotFound, _4_iReg, (*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4, func() int32 {
if ((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1) != 0 {
return i32(-1)
}
return i32(-2)
}())
*(*uint8)(unsafe.Pointer(&((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1))) = uint8(i32(0))
*(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(func() int32 {
if (_pWInfo.X14) != 0 {
return i32(164)
}
return i32(50)
}())
*(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _sqlite3VdbeCurrentAddr(tls, _v)
_4_iIn = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0
_j = _4_nConstraint - i32(1)
_24:
if _j < i32(0) {
goto _27
}
_pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))
if (_j < i32(16)) && ((int32((*t66)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3)>>uint(_j))&i32(1)) != 0 {
_disableTerm(tls, _pLevel, _pTerm)
goto _31
}
if (int32(_pTerm.X4) & i32(1)) == i32(0) {
goto _31
}
func() {
if (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1) == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128027), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107812)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) == 0 {
func() {
if _4_iIn <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128029), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107856)))
crt.X__builtin_abort(tls)
}
}()
_10_pOp = _sqlite3VdbeGetOp(tls, _v, (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1)+12*uintptr(preInc1(&_4_iIn, -1)))).X1)
func() {
if int32(_10_pOp.X0) != i32(99) && int32(_10_pOp.X0) != i32(125) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128031), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107862)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_10_pOp.X0) == i32(99) && (_10_pOp.X5) != ((_4_iReg+_j)+i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128032), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107910)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_10_pOp.X0) == i32(125) && (_10_pOp.X4) != ((_4_iReg+_j)+i32(2)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128033), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107954)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, int32(_10_pOp.X0), _10_pOp.X3, _10_pOp.X4, _10_pOp.X5)
}
_10_pCompare = _sqlite3PExpr(tls, _pParse, i32(78), nil, nil)
func() {
if _10_pCompare == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128041), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(107997)))
crt.X__builtin_abort(tls)
}
}()
if _10_pCompare == nil {
goto _50
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X4))))) = (*XExpr)((*XExpr)(_pTerm.X0).X4)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X5))))) = store36(&_10_pRight, _sqlite3Expr(tls, _db, i32(157), nil))
if _10_pRight != nil {
*(*int32)(unsafe.Pointer(&(_10_pRight.X8))) = (_4_iReg + _j) + i32(2)
_sqlite3ExprIfFalse(tls, _pParse, _10_pCompare, _pLevel.X6, i32(0))
}
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_10_pCompare.X4))))) = nil
_sqlite3ExprDelete(tls, _db, _10_pCompare)
_50:
_31:
_j -= 1
goto _24
_27:
_sqlite3ExprCachePop(tls, _pParse)
goto _270
_10:
if ((_pLoop.X9)&uint32(i32(256))) == uint32(i32(0)) || ((_pLoop.X9)&uint32(i32(5))) == uint32(i32(0)) {
goto _54
}
func() {
if int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128073), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108029)))
crt.X__builtin_abort(tls)
}
}()
_pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(i32(0))))
func() {
if _pTerm == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128075), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108051)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_pTerm.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128076), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108060)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _omitTable != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128077), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108076)))
crt.X__builtin_abort(tls)
}
}()
_iReleaseReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_iRowidReg = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, i32(0), _bRev, _iReleaseReg)
if _iRowidReg != _iReleaseReg {
_sqlite3ReleaseTempReg(tls, _pParse, _iReleaseReg)
}
_addrNxt = _pLevel.X4
_sqlite3VdbeAddOp3(tls, _v, i32(31), _iCur, _addrNxt, _iRowidReg)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _iRowidReg, i32(1))
_sqlite3ExprCacheStore(tls, _pParse, _iCur, i32(-1), _iRowidReg)
_sqlite3VdbeComment(tls, _v, str(61650))
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164))
goto _270
_54:
if ((_pLoop.X9)&uint32(i32(256))) == uint32(i32(0)) || ((_pLoop.X9)&uint32(i32(2))) == uint32(i32(0)) {
goto _66
}
_15_testOp = i32(164)
_15_memEndValue = i32(0)
func() {
if _omitTable != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128099), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108076)))
crt.X__builtin_abort(tls)
}
}()
_j = i32(0)
_15_pStart = store65(&_15_pEnd, nil)
if ((_pLoop.X9) & uint32(i32(32))) != 0 {
_15_pStart = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(postInc1(&_j, int32(1)))))
}
if ((_pLoop.X9) & uint32(i32(16))) != 0 {
_15_pEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(postInc1(&_j, int32(1)))))
}
func() {
if _15_pStart == nil && _15_pEnd == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128104), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108089)))
crt.X__builtin_abort(tls)
}
}()
if _bRev != 0 {
_pTerm = _15_pStart
_15_pStart = _15_pEnd
_15_pEnd = _pTerm
}
if _15_pStart == nil {
goto _75
}
_17_aMoveOp = [4]uint8{u8(27), u8(25), u8(24), u8(26)}
i32(0)
i32(0)
i32(0)
func() {
if (int32(_15_pStart.X3) & i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128129), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108110)))
crt.X__builtin_abort(tls)
}
}()
_17_pX = (*XExpr)(_15_pStart.X0)
func() {
if _17_pX == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128132), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(67534)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprIsVector(tls, (*XExpr)(_17_pX.X5)) != 0 {
_17_r1 = store1(&_17_rTemp, _sqlite3GetTempReg(tls, _pParse))
_codeExprOrVector(tls, _pParse, (*XExpr)(_17_pX.X5), _17_r1, i32(1))
_17_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_17_aMoveOp)) + 1*uintptr((int32(_17_pX.X0)-i32(79))|i32(1)))))
goto _81
}
_17_r1 = _sqlite3ExprCodeTemp(tls, _pParse, (*XExpr)(_17_pX.X5), &_17_rTemp)
_disableTerm(tls, _pLevel, _15_pStart)
_17_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_17_aMoveOp)) + 1*uintptr(int32(_17_pX.X0)-i32(79)))))
_81:
_sqlite3VdbeAddOp3(tls, _v, _17_op, _iCur, _addrBrk, _17_r1)
_sqlite3VdbeComment(tls, _v, str(61650))
_sqlite3ExprCacheAffinityChange(tls, _pParse, _17_r1, i32(1))
_sqlite3ReleaseTempReg(tls, _pParse, _17_rTemp)
goto _82
_75:
_sqlite3VdbeAddOp2(tls, _v, func() int32 {
if _bRev != 0 {
return i32(33)
}
return i32(37)
}(), _iCur, _addrHalt)
_82:
if _15_pEnd == nil {
goto _85
}
_21_pX = (*XExpr)(_15_pEnd.X0)
func() {
if _21_pX == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128159), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(67534)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_15_pEnd.X3) & i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108144)))
crt.X__builtin_abort(tls)
}
}()
_15_memEndValue = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_codeExprOrVector(tls, _pParse, (*XExpr)(_21_pX.X5), _15_memEndValue, i32(1))
if (i32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.X5))) && ((int32(_21_pX.X0) == i32(81)) || (int32(_21_pX.X0) == i32(79))) {
_15_testOp = func() int32 {
if _bRev != 0 {
return i32(80)
}
return i32(82)
}()
goto _95
}
_15_testOp = func() int32 {
if _bRev != 0 {
return i32(81)
}
return i32(79)
}()
_95:
if i32(0) == _sqlite3ExprIsVector(tls, (*XExpr)(_21_pX.X5)) {
_disableTerm(tls, _pLevel, _15_pEnd)
}
_85:
_15_start = _sqlite3VdbeCurrentAddr(tls, _v)
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(func() int32 {
if _bRev != 0 {
return i32(6)
}
return i32(7)
}())
*(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur
*(*int32)(unsafe.Pointer(&(_pLevel.X16))) = _15_start
func() {
if int32(_pLevel.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128180), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108176)))
crt.X__builtin_abort(tls)
}
}()
if _15_testOp != i32(164) {
_iRowidReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(125), _iCur, _iRowidReg)
_sqlite3ExprCacheStore(tls, _pParse, _iCur, i32(-1), _iRowidReg)
_sqlite3VdbeAddOp3(tls, _v, _15_testOp, _15_memEndValue, _addrBrk, _iRowidReg)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(83)))
}
goto _270
_66:
if ((_pLoop.X9) & uint32(i32(512))) == 0 {
goto _105
}
_26_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0
_26_nBtm = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1
_26_nTop = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2
_26_pRangeStart = nil
_26_pRangeEnd = nil
_26_nExtraReg = i32(0)
_26_zEndAff = nil
_26_bSeekPastNull = u8(0)
_26_bStopAtNull = u8(0)
_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)
_26_iIdxCur = _pLevel.X2
func() {
if int32(_26_nEq) < int32(_pLoop.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128260), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108190)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExprList)(_pWInfo.X2) != nil && ((*XExprList)(_pWInfo.X2).X0) != i32(1) && (int32(_pWInfo.X10)&i32(1)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108208)))
crt.X__builtin_abort(tls)
}
}()
if (((int32(_pWInfo.X10) & i32(1)) != i32(0)) && (int32(_pWInfo.X12) > i32(0))) && (int32(_pIdx.X13) > int32(_26_nEq)) {
func() {
if int32(_pLoop.X11) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128277), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108303)))
crt.X__builtin_abort(tls)
}
}()
_26_bSeekPastNull = uint8(i32(1))
_26_nExtraReg = i32(1)
}
_j = int32(_26_nEq)
if ((_pLoop.X9) & uint32(i32(32))) != 0 {
_26_pRangeStart = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(postInc1(&_j, int32(1)))))
_26_nExtraReg = func() int32 {
if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1) {
return _26_nExtraReg
}
return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X1)
}()
func() {
if (int32(_26_pRangeStart.X3)&i32(256)) != i32(0) && ((_pLoop.X9)&uint32(i32(16))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128290), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108319)))
crt.X__builtin_abort(tls)
}
}()
}
if ((_pLoop.X9) & uint32(i32(16))) == 0 {
goto _123
}
_26_pRangeEnd = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(postInc1(&_j, int32(1)))))
_26_nExtraReg = func() int32 {
if _26_nExtraReg > int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2) {
return _26_nExtraReg
}
return int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X2)
}()
if (int32(_26_pRangeEnd.X3) & i32(256)) != i32(0) {
func() {
if _26_pRangeStart == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128298), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108401)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_26_pRangeStart.X3) & i32(256)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128299), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108416)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pLevel.X9))) = uint32(preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), int32(_pLevel.X9))
_sqlite3VdbeComment(tls, _v, str(108452))
*(*int32)(unsafe.Pointer(&(_pLevel.X10))) = _sqlite3VdbeCurrentAddr(tls, _v)
func() {
if (_bRev & i32(-2)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128308), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108470)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pLevel.X9)))
*p = (*p) << uint(i32(1))
sink5 = *p
}
{
p := (*uint32)(unsafe.Pointer(&(_pLevel.X9)))
*p = (*p) | uint32(_bRev^bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(1)))
sink5 = *p
}
}
if _26_pRangeStart != nil {
goto _133
}
_j = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_26_nEq))))
if ((_j >= i32(0)) && (int32((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pIdx.X3).X1)+16*uintptr(_j))).X3) == i32(0))) || (_j == i32(-2)) {
_26_bSeekPastNull = uint8(i32(1))
}
_133:
_123:
func() {
if _26_pRangeEnd != nil && (int32(_26_pRangeEnd.X3)&i32(0)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128320), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108485)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_26_nEq) < int32(_pIdx.X13)) && (_bRev == bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X7)) + 1*uintptr(_26_nEq)))) == i32(0)))) || (_bRev != 0 && (int32(_pIdx.X13) == int32(_26_nEq))) {
_34_t = _26_pRangeEnd
_26_pRangeEnd = _26_pRangeStart
_26_pRangeStart = _34_t
_35_t = _26_bSeekPastNull
_26_bSeekPastNull = _26_bStopAtNull
_26_bStopAtNull = _35_t
_36_t = uint8(_26_nBtm)
_26_nBtm = _26_nTop
_26_nTop = uint16(_36_t)
}
_26_regBase = _codeAllEqualityTerms(tls, _pParse, _pLevel, _bRev, _26_nExtraReg, &_26_zStartAff)
func() {
if _26_zStartAff != nil && _sqlite3Strlen30(tls, _26_zStartAff) < int32(_26_nEq) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128340), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108538)))
crt.X__builtin_abort(tls)
}
}()
if (_26_zStartAff != nil) && (_26_nTop != 0) {
_26_zEndAff = _sqlite3DbStrDup(tls, _db, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_26_zStartAff))+1*uintptr(_26_nEq))))
}
_addrNxt = _pLevel.X4
_26_startEq = bool2int((_26_pRangeStart == nil) || (int32(_26_pRangeStart.X4)&i32(40)) != 0)
_26_endEq = bool2int((_26_pRangeEnd == nil) || (int32(_26_pRangeEnd.X4)&i32(40)) != 0)
_26_start_constraints = bool2int((_26_pRangeStart != nil) || (int32(_26_nEq) > i32(0)))
_26_nConstraint = int32(_26_nEq)
if _26_pRangeStart == nil {
goto _152
}
_38_pRight = (*XExpr)((*XExpr)(_26_pRangeStart.X0).X5)
_codeExprOrVector(tls, _pParse, _38_pRight, _26_regBase+int32(_26_nEq), int32(_26_nBtm))
_whereLikeOptimizationStringFixup(tls, _v, _pLevel, _26_pRangeStart)
if ((int32(_26_pRangeStart.X3) & i32(0)) == i32(0)) && _sqlite3ExprCanBeNull(tls, _38_pRight) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(75), _26_regBase+int32(_26_nEq), _addrNxt)
}
if _26_zStartAff != nil {
_updateRangeAffinityStr(tls, _38_pRight, int32(_26_nBtm), (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_26_zStartAff))+1*uintptr(_26_nEq))))
}
{
p := &_26_nConstraint
*p = (*p) + int32(_26_nBtm)
sink1 = *p
}
if _sqlite3ExprIsVector(tls, _38_pRight) == i32(0) {
_disableTerm(tls, _pLevel, _26_pRangeStart)
goto _157
}
_26_startEq = i32(1)
_157:
_26_bSeekPastNull = uint8(i32(0))
goto _159
_152:
if _26_bSeekPastNull != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _26_regBase+int32(_26_nEq))
_26_nConstraint += 1
_26_startEq = i32(0)
_26_start_constraints = i32(1)
}
_159:
_codeApplyAffinity(tls, _pParse, _26_regBase, _26_nConstraint-int32(_26_bSeekPastNull), _26_zStartAff)
if (int32(_pLoop.X11) > i32(0)) && (_26_nConstraint == int32(_pLoop.X11)) {
goto _162
}
_26_op = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001)) + 1*uintptr(((_26_start_constraints<= int32(_58_pPk.X13) {
goto _189
}
_k = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_58_pPk.X1)) + 2*uintptr(_j)))))
_sqlite3VdbeAddOp3(tls, _v, i32(99), _26_iIdxCur, _k, _iRowidReg+_j)
_j += 1
goto _186
_189:
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iCur, _addrCont, _iRowidReg, int32(_58_pPk.X13))
_185:
_whereIndexExprTrans(tls, _pIdx, _iCur, _26_iIdxCur, _pWInfo)
if ((_pLoop.X9) & uint32(i32(4096))) != 0 {
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164))
goto _193
}
if _bRev != 0 {
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(6))
goto _193
}
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(7))
_193:
*(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _26_iIdxCur
*(*uint8)(unsafe.Pointer(&(_pLevel.X13))) = uint8(func() int32 {
if ((_pLoop.X9) & uint32(i32(65536))) != uint32(i32(0)) {
return i32(1)
}
return i32(0)
}())
if ((_pLoop.X9) & uint32(i32(15))) == uint32(i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pLevel.X14))) = uint8(i32(1))
goto _197
}
func() {
if int32(_pLevel.X14) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128498), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108176)))
crt.X__builtin_abort(tls)
}
}()
_197:
if _omitTable != 0 {
_pIdx = nil
}
goto _270
_105:
if ((_pLoop.X9) & uint32(i32(8192))) == 0 {
goto _202
}
_65_pCov = nil
_65_iCovCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_65_regReturn = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_65_regRowset = i32(0)
_65_regRowid = i32(0)
_65_iLoopBody = _sqlite3VdbeMakeLabel(tls, _v)
_65_untestedTerms = i32(0)
_65_pAndExpr = nil
_65_pTab = (*XTable)(_pTabItem.X4)
_pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(i32(0))))
func() {
if _pTerm == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128565), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108051)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pTerm.X4) & i32(512)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128566), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108592)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pTerm.X3) & i32(16)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128567), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108617)))
crt.X__builtin_abort(tls)
}
}()
_65_pOrWc = (*XWhereClause)(unsafe.Pointer(&((*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10)))))).X0)))
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(52))
*(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _65_regReturn
if int32(_pWInfo.X11) <= i32(1) {
goto _209
}
_66_nNotReady = (int32(_pWInfo.X11) - _iLevel) - i32(1)
_65_pOrTab = (*XSrcList)(_sqlite3DbMallocRaw(tls, _db, uint64(u32(76)+(uint32(_66_nNotReady)*u32(68)))))
if _65_pOrTab == nil {
return _notReady
}
*(*uint32)(unsafe.Pointer(&(_65_pOrTab.X1))) = uint32(uint8(_66_nNotReady + i32(1)))
*(*int32)(unsafe.Pointer(&(_65_pOrTab.X0))) = int32(_65_pOrTab.X1)
crt.Xmemcpy(tls, (unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_65_pOrTab.X2)))), (unsafe.Pointer)(_pTabItem), u32(68))
_66_origSrc = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pWInfo.X1).X2)))))
_k = i32(1)
_211:
if _k > _66_nNotReady {
goto _214
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_65_pOrTab.X2)))))+68*uintptr(_k)))), (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_66_origSrc))+68*uintptr((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLevel))+76*uintptr(_k))).X11)))), u32(68))
_k += 1
goto _211
_214:
goto _215
_209:
_65_pOrTab = (*XSrcList)(_pWInfo.X1)
_215:
if (int32(_pWInfo.X10) & i32(16)) != i32(0) {
goto _216
}
if ((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_65_regRowset = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _65_regRowset)
goto _218
}
_71_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
_65_regRowset = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(110), _65_regRowset, int32(_71_pPk.X13))
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _71_pPk)
_218:
_65_regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_216:
_65_iRetInit = _sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _65_regReturn)
if (_pWC.X3) <= i32(1) {
goto _219
}
_72_iTerm = i32(0)
_220:
if _72_iTerm >= (_pWC.X3) {
goto _223
}
_73_pExpr = (*XExpr)((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5) + 48*uintptr(_72_iTerm))).X0)
if (*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+48*uintptr(_72_iTerm))) == _pTerm {
goto _221
}
if ((_73_pExpr.X2) & uint32(i32(1))) != uint32(i32(0)) {
goto _221
}
if (int32((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+48*uintptr(_72_iTerm))).X3) & i32(6)) != i32(0) {
goto _221
}
if (int32((*XWhereTerm)(unsafe.Pointer(uintptr(_pWC.X5)+48*uintptr(_72_iTerm))).X4) & i32(8191)) == i32(0) {
goto _221
}
_73_pExpr = _sqlite3ExprDup(tls, _db, _73_pExpr, i32(0))
_65_pAndExpr = _sqlite3ExprAnd(tls, _db, _65_pAndExpr, _73_pExpr)
_221:
_72_iTerm += 1
goto _220
_223:
if _65_pAndExpr != nil {
_65_pAndExpr = _sqlite3PExpr(tls, _pParse, i32(327), nil, _65_pAndExpr)
}
_219:
_65_wctrlFlags = uint16(i32(32) | (int32(_pWInfo.X10) & i32(1024)))
_65_ii = i32(0)
_229:
if _65_ii >= (_65_pOrWc.X3) {
goto _232
}
_75_pOrTerm = (*XWhereTerm)(unsafe.Pointer(uintptr(_65_pOrWc.X5) + 48*uintptr(_65_ii)))
if (_75_pOrTerm.X8) != _iCur && (int32(_75_pOrTerm.X4)&i32(1024)) == i32(0) {
goto _234
}
_76_pOrExpr = (*XExpr)(_75_pOrTerm.X0)
_76_jmp1 = i32(0)
if (_65_pAndExpr != nil) && (((_76_pOrExpr.X2) & uint32(i32(1))) == uint32(i32(0))) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_65_pAndExpr.X4))))) = _76_pOrExpr
_76_pOrExpr = _65_pAndExpr
}
_76_pSubWInfo = _sqlite3WhereBegin(tls, _pParse, _65_pOrTab, _76_pOrExpr, nil, nil, _65_wctrlFlags, _65_iCovCur)
func() {
if _76_pSubWInfo == nil && (_pParse.X16) == 0 && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128672), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108651)))
crt.X__builtin_abort(tls)
}
}()
if _76_pSubWInfo == nil {
goto _241
}
_78_addrExplain = _sqlite3WhereExplainOneScan(tls, _pParse, _65_pOrTab, (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24)))))+76*uintptr(i32(0)))), _iLevel, int32(_pLevel.X11), uint16(i32(0)))
if (int32(_pWInfo.X10) & i32(16)) != i32(0) {
goto _242
}
_79_iSet = func() int32 {
if _65_ii == ((_65_pOrWc.X3) - i32(1)) {
return i32(-1)
}
return _65_ii
}()
if ((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_79_r = _sqlite3ExprCodeGetColumn(tls, _pParse, _65_pTab, i32(-1), _iCur, _65_regRowid, uint8(i32(0)))
_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, i32(43), _65_regRowset, i32(0), _79_r, _79_iSet)
goto _246
}
_81_pPk = _sqlite3PrimaryKeyIndex(tls, _65_pTab)
_81_nPk = int32(_81_pPk.X13)
_79_r = _sqlite3GetTempRange(tls, _pParse, _81_nPk)
_81_iPk = i32(0)
_247:
if _81_iPk >= _81_nPk {
goto _250
}
_82_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_81_pPk.X1)) + 2*uintptr(_81_iPk))))
_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _65_pTab, _82_iCol, _iCur, _79_r+_81_iPk)
_81_iPk += 1
goto _247
_250:
if _79_iSet != 0 {
_76_jmp1 = _sqlite3VdbeAddOp4Int(tls, _v, i32(30), _65_regRowset, i32(0), _79_r, _81_nPk)
}
if _79_iSet < i32(0) {
goto _252
}
_sqlite3VdbeAddOp3(tls, _v, i32(101), _79_r, _81_nPk, _65_regRowid)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _65_regRowset, _65_regRowid, _79_r, _81_nPk)
if _79_iSet != 0 {
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
}
_252:
_sqlite3ReleaseTempRange(tls, _pParse, _79_r, _81_nPk)
_246:
_242:
_sqlite3VdbeAddOp2(tls, _v, i32(14), _65_regReturn, _65_iLoopBody)
if _76_jmp1 != 0 {
_sqlite3VdbeJumpHere(tls, _v, _76_jmp1)
}
if (_76_pSubWInfo.X15) != 0 {
_65_untestedTerms = i32(1)
}
_78_pSubLoop = (*XWhereLoop)((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24))))) + 76*uintptr(i32(0)))).X18)
func() {
if ((_78_pSubLoop.X9) & uint32(i32(16384))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128759), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108697)))
crt.X__builtin_abort(tls)
}
}()
if ((((_78_pSubLoop.X9) & uint32(i32(512))) != uint32(i32(0))) && ((_65_ii == i32(0)) || ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4) == _65_pCov))) && ((((_65_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4).X16)<>uint(i32(30))) != i32(2))) {
func() {
if ((*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_76_pSubWInfo.X24))))) + 76*uintptr(i32(0)))).X2) != _65_iCovCur {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128764), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108739)))
crt.X__builtin_abort(tls)
}
}()
_65_pCov = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_78_pSubLoop.X8))))).X4)
goto _265
}
_65_pCov = nil
_265:
_sqlite3WhereEnd(tls, _76_pSubWInfo)
_241:
_234:
_65_ii += 1
goto _229
_232:
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))))) = _65_pCov
if _65_pCov != nil {
*(*int32)(unsafe.Pointer(&(_pLevel.X2))) = _65_iCovCur
}
if _65_pAndExpr != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_65_pAndExpr.X4))))) = nil
_sqlite3ExprDelete(tls, _db, _65_pAndExpr)
}
_sqlite3VdbeChangeP1(tls, _v, uint32(_65_iRetInit), _sqlite3VdbeCurrentAddr(tls, _v))
_sqlite3VdbeGoto(tls, _v, _pLevel.X3)
_sqlite3VdbeResolveLabel(tls, _v, _65_iLoopBody)
if int32(_pWInfo.X11) > i32(1) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_65_pOrTab))
}
if _65_untestedTerms == 0 {
_disableTerm(tls, _pLevel, _pTerm)
}
goto _270
_202:
func() {
if _bRev != i32(0) && _bRev != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128796), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108772)))
crt.X__builtin_abort(tls)
}
}()
if ((uint32(((*t28)(unsafe.Pointer(&(_pTabItem.X9))).X1)>>uint(i32(5))) << uint(i32(31))) >> uint(i32(31))) != 0 {
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = uint8(i32(164))
goto _275
}
*(*uint8)(unsafe.Pointer(&(_pLevel.X12))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStepØ003)) + 1*uintptr(_bRev)))
*(*int32)(unsafe.Pointer(&(_pLevel.X15))) = _iCur
*(*int32)(unsafe.Pointer(&(_pLevel.X16))) = i32(1) + _sqlite3VdbeAddOp2(tls, _v, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3WhereCodeOneLoopStartØ00aStartØ004)) + 1*uintptr(_bRev)))), _iCur, _addrHalt)
*(*uint8)(unsafe.Pointer(&(_pLevel.X14))) = uint8(i32(1))
_275:
_270:
_loopAgain = i32(0)
*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.X5); return &_j }() = _pWC.X3
_277:
if _j <= i32(0) {
goto _280
}
_92_skipLikeAddr = i32(0)
if (int32(_pTerm.X3) & i32(6)) != 0 {
goto _278
}
if ((_pTerm.X12) & (_pLevel.X19)) != uint64(i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pWInfo.X15))) = uint8(i32(1))
goto _278
}
_92_pE = (*XExpr)(_pTerm.X0)
func() {
if _92_pE == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128839), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108791)))
crt.X__builtin_abort(tls)
}
}()
if (_pLevel.X0) != 0 && (((_92_pE.X2) & uint32(i32(1))) == uint32(i32(0))) {
goto _278
}
if (_pIdx != nil) && (_sqlite3ExprCoveredByIndex(tls, _92_pE, _pLevel.X1, _pIdx) == 0) {
_loopAgain = i32(1)
goto _278
}
if (int32(_pTerm.X3) & i32(512)) != 0 {
_96_x = _pLevel.X9
func() {
if _96_x <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128857), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108797)))
crt.X__builtin_abort(tls)
}
}()
_92_skipLikeAddr = _sqlite3VdbeAddOp1(tls, _v, func() int32 {
if (_96_x & uint32(i32(1))) != 0 {
return i32(22)
}
return i32(21)
}(), int32(_96_x>>uint(i32(1))))
}
_sqlite3ExprIfFalse(tls, _pParse, _92_pE, _addrCont, i32(16))
if _92_skipLikeAddr != 0 {
_sqlite3VdbeJumpHere(tls, _v, _92_skipLikeAddr)
}
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
_278:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(48)
goto _277
_280:
_pIdx = nil
if _loopAgain != 0 {
goto _270
}
*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.X5); return &_j }() = _pWC.X3
_295:
if _j <= i32(0) {
goto _298
}
if (int32(_pTerm.X3) & i32(6)) != 0 {
goto _296
}
if (int32(_pTerm.X4) & i32(130)) == i32(0) {
goto _296
}
if (int32(_pTerm.X4) & i32(2048)) == i32(0) {
goto _296
}
if (_pTerm.X8) != _iCur {
goto _296
}
if (_pLevel.X0) != 0 {
goto _296
}
_97_pE = (*XExpr)(_pTerm.X0)
func() {
if ((_97_pE.X2) & uint32(i32(1))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108801)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_pTerm.X11) & (_pLevel.X19)) == uint64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108835)))
crt.X__builtin_abort(tls)
}
}()
_97_pAlt = _sqlite3WhereFindTerm(tls, _pWC, _iCur, *(*int32)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_pTerm.X10))))), _notReady, uint32(i32(131)), nil)
if _97_pAlt == nil {
goto _296
}
if (int32(_97_pAlt.X3) & i32(4)) != 0 {
goto _296
}
_97_sEAlt = *(*XExpr)(_97_pAlt.X0)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_97_sEAlt.X4))))) = (*XExpr)(_97_pE.X4)
_sqlite3ExprIfFalse(tls, _pParse, &_97_sEAlt, _addrCont, i32(16))
_296:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j -= 1; return &_pTerm }())) += uintptr(48)
goto _295
_298:
if (_pLevel.X0) == 0 {
goto _310
}
*(*int32)(unsafe.Pointer(&(_pLevel.X7))) = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(1), _pLevel.X0)
_sqlite3VdbeComment(tls, _v, str(108878))
_sqlite3ExprCacheClear(tls, _pParse)
*func() *int32 { _pTerm = (*XWhereTerm)(_pWC.X5); return &_j }() = i32(0)
_311:
if _j >= (_pWC.X3) {
goto _314
}
if (int32(_pTerm.X3) & i32(6)) != 0 {
goto _312
}
if ((_pTerm.X12) & (_pLevel.X19)) != uint64(i32(0)) {
func() {
if (_pWInfo.X15) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108899)))
crt.X__builtin_abort(tls)
}
}()
goto _312
}
func() {
if (*XExpr)(_pTerm.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(128917), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereCodeOneLoopStartØ00__func__Ø000))), unsafe.Pointer(str(108921)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)(_pTerm.X0), _addrCont, i32(16))
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
_312:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _j += 1; return &_pTerm }())) += uintptr(48)
goto _311
_314:
_310:
return _pLevel.X19
_ = _17_aMoveOp
_ = _78_addrExplain
_ = _97_sEAlt
panic(0)
}
var _sqlite3WhereCodeOneLoopStartØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereCodeOneLoopStartØ00__func__Ø000[0], str(108934), 29)
}
// Generate code for a single equality term of the WHERE clause. An equality
// term can be either X=expr or X IN (...). pTerm is the term to be
// coded.
//
// The current value for the constraint is left in a register, the index
// of which is returned. An attempt is made store the result in iTarget but
// this is only guaranteed for TK_ISNULL and TK_IN constraints. If the
// constraint is a TK_EQ or TK_IS, then the current value might be left in
// some other register and it is the caller's responsibility to compensate.
//
// For a constraint of the form X=expr, the expression is evaluated in
// straight-line code. For constraints of the form X IN (...)
// this routine sets up a loop that will iterate over all values of X.
func _codeEqualityTerm(tls *crt.TLS, _pParse *XParse, _pTerm *XWhereTerm, _pLevel *XWhereLevel, _iEq int32, _bRev int32, _iTarget int32) (r0 int32) {
var _iReg, _3_eType, _3_iTab, _3_i, _3_nEq, _11_iField, _19_iMap, _21_iOut, _23_iCol int32
var _3_aiMap *int32
var _9_savedDbOptFlags uint16
var _9_db *Xsqlite3
var _v *TVdbe
var _9_pOrigRhs, _9_pOrigLhs, _9_pRhs, _9_pLhs, _13_pOrderBy *XExprList
var _9_pSelect *XSelect
var _pX, _11_pNewRhs, _11_pNewLhs, _12_pLeft *XExpr
var _3_pLoop *XWhereLoop
var _3_pIn *TInLoop
_pX = (*XExpr)(_pTerm.X0)
_v = (*TVdbe)(_pParse.X2)
func() {
if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XWhereLoop)(_pLevel.X18).X13)) + 4*uintptr(_iEq)))) != _pTerm {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127197), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(108963)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iTarget <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127198), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(108998)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pX.X0) == i32(78)) || (int32(_pX.X0) == i32(72)) {
_iReg = _sqlite3ExprCodeTarget(tls, _pParse, (*XExpr)(_pX.X5), _iTarget)
goto _8
}
if int32(_pX.X0) == i32(75) {
_iReg = _iTarget
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _iReg)
goto _8
}
_3_eType = i32(5)
_3_pLoop = (*XWhereLoop)(_pLevel.X18)
_3_nEq = i32(0)
_3_aiMap = nil
if ((((_3_pLoop.X9) & uint32(i32(1024))) == uint32(i32(0))) && ((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_3_pLoop.X8))))).X4) != nil)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_3_pLoop.X8))))).X4).X7)) + 1*uintptr(_iEq)))) != 0) {
_bRev = bool2int(_bRev == 0)
}
func() {
if int32(_pX.X0) != i32(74) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127222), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(102005)))
crt.X__builtin_abort(tls)
}
}()
_iReg = _iTarget
_3_i = i32(0)
_14:
if _3_i >= _iEq {
goto _17
}
if ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))) != nil) && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))).X0) == _pX) {
_disableTerm(tls, _pLevel, _pTerm)
return _iTarget
}
_3_i += 1
goto _14
_17:
_3_i = _iEq
_20:
if _3_i >= int32(_3_pLoop.X10) {
goto _23
}
if func() int32 {
if (*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127232), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && ((*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))).X0) == _pX) {
_3_nEq += 1
}
_3_i += 1
goto _20
_23:
if (((_pX.X2) & uint32(i32(2048))) == uint32(i32(0))) || (((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6)))))).X0).X0) == i32(1)) {
_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(i32(4)), nil, nil)
goto _30
}
_9_pSelect = (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pX.X6))))))
_9_db = (*Xsqlite3)(_pParse.X0)
_9_savedDbOptFlags = _9_db.X13
_9_pOrigRhs = (*XExprList)(_9_pSelect.X0)
_9_pOrigLhs = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pX.X4).X6))))))
_9_pRhs = nil
_9_pLhs = nil
_3_i = _iEq
_31:
if _3_i >= int32(_3_pLoop.X10) {
goto _34
}
if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))).X0) == _pX {
_11_iField = ((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))).X9) - i32(1)
_11_pNewRhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pOrigRhs.X2)))))+20*uintptr(_11_iField))).X0), i32(0))
_11_pNewLhs = _sqlite3ExprDup(tls, _9_db, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pOrigLhs.X2)))))+20*uintptr(_11_iField))).X0), i32(0))
_9_pRhs = _sqlite3ExprListAppend(tls, _pParse, _9_pRhs, _11_pNewRhs)
_9_pLhs = _sqlite3ExprListAppend(tls, _pParse, _9_pLhs, _11_pNewLhs)
}
_3_i += 1
goto _31
_34:
if (_9_db.X17) != 0 {
goto _36
}
_12_pLeft = (*XExpr)(_pX.X4)
if (*XExprList)(_9_pSelect.X12) == nil {
goto _37
}
_13_pOrderBy = (*XExprList)(_9_pSelect.X12)
_3_i = i32(0)
_38:
if _3_i >= (_13_pOrderBy.X0) {
goto _41
}
*(*uint16)(unsafe.Pointer(&((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pOrderBy.X2))))) + 20*uintptr(_3_i))).X5))))).X0))) = uint16(i32(0))
_3_i += 1
goto _38
_41:
_37:
if (_9_pLhs.X0) == i32(1) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X4))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_9_pLhs.X2))))) + 20*uintptr(i32(0)))).X0)
goto _43
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_12_pLeft.X6))))))) = _9_pLhs
_3_aiMap = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(4)*uint32(_3_nEq))))
_43:
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_9_pSelect.X0))))) = _9_pRhs
{
p := (*uint16)(unsafe.Pointer(&(_9_db.X13)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
_3_eType = _sqlite3FindInIndex(tls, _pParse, _pX, uint32(i32(4)), nil, _3_aiMap)
*(*uint16)(unsafe.Pointer(&(_9_db.X13))) = _9_savedDbOptFlags
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_9_pSelect.X0))))) = _9_pOrigRhs
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_12_pLeft.X6))))))) = _9_pOrigLhs
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pX.X4))))) = _12_pLeft
_36:
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _9_pLhs)
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _9_pRhs)
_30:
if _3_eType == i32(4) {
_bRev = bool2int(_bRev == 0)
}
_3_iTab = _pX.X8
_sqlite3VdbeAddOp2(tls, _v, func() int32 {
if _bRev != 0 {
return i32(33)
}
return i32(37)
}(), _3_iTab, i32(0))
func() {
if ((_3_pLoop.X9) & uint32(i32(8192))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127304), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeEqualityTermØ00__func__Ø000))), unsafe.Pointer(str(109008)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_3_pLoop.X9)))
*p = (*p) | uint32(i32(2048))
sink5 = *p
}
if ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0) == i32(0) {
*(*int32)(unsafe.Pointer(&(_pLevel.X4))) = _sqlite3VdbeMakeLabel(tls, _v)
}
_3_i = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0
{
p := (*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0)))
*p = (*p) + _3_nEq
sink1 = *p
}
*(**TInLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1))))) = (*TInLoop)(_sqlite3DbReallocOrFree(tls, (*Xsqlite3)(_pParse.X0), (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1, uint64(u32(12)*uint32((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0))))
_3_pIn = (*TInLoop)((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1)
if _3_pIn == nil {
goto _50
}
_19_iMap = i32(0)
{
p := &_3_pIn
*p = (*TInLoop)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 12*uintptr(_3_i)))
sink71 = *p
}
_3_i = _iEq
_51:
if _3_i >= int32(_3_pLoop.X10) {
goto _54
}
if (*XExpr)((*(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pLoop.X13)) + 4*uintptr(_3_i)))).X0) != _pX {
goto _55
}
_21_iOut = (_iReg + _3_i) - _iEq
if _3_eType == i32(1) {
*(*int32)(unsafe.Pointer(&(_3_pIn.X1))) = _sqlite3VdbeAddOp2(tls, _v, i32(125), _3_iTab, _21_iOut)
goto _57
}
_23_iCol = func() int32 {
if _3_aiMap != nil {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_aiMap)) + 4*uintptr(postInc1(&_19_iMap, int32(1))))))
}
return i32(0)
}()
*(*int32)(unsafe.Pointer(&(_3_pIn.X1))) = _sqlite3VdbeAddOp3(tls, _v, i32(99), _3_iTab, _23_iCol, _21_iOut)
_57:
_sqlite3VdbeAddOp1(tls, _v, i32(75), _21_iOut)
if _3_i == _iEq {
*(*int32)(unsafe.Pointer(&(_3_pIn.X0))) = _3_iTab
*(*uint8)(unsafe.Pointer(&(_3_pIn.X2))) = uint8(func() int32 {
if _bRev != 0 {
return i32(4)
}
return i32(5)
}())
goto _63
}
*(*uint8)(unsafe.Pointer(&(_3_pIn.X2))) = uint8(i32(164))
_63:
*(*uintptr)(unsafe.Pointer(&_3_pIn)) += uintptr(12)
_55:
_3_i += 1
goto _51
_54:
goto _64
_50:
*(*int32)(unsafe.Pointer(&((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0))) = i32(0)
_64:
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_3_aiMap))
_8:
_disableTerm(tls, _pLevel, _pTerm)
return _iReg
_ = _19_iMap
panic(0)
}
var _codeEqualityTermØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_codeEqualityTermØ00__func__Ø000[0], str(109045), 17)
}
// Disable a term in the WHERE clause. Except, do not disable the term
// if it controls a LEFT OUTER JOIN and it did not originate in the ON
// or USING clause of that join.
//
// Consider the term t2.z='ok' in the following queries:
//
// (1) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x WHERE t2.z='ok'
// (2) SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.x AND t2.z='ok'
// (3) SELECT * FROM t1, t2 WHERE t1.a=t2.x AND t2.z='ok'
//
// The t2.z='ok' is disabled in the in (2) because it originates
// in the ON clause. The term is disabled in (3) because it is not part
// of a LEFT OUTER JOIN. In (1), the term is not disabled.
//
// Disabling a term causes that term to not be tested in the inner loop
// of the join. Disabling is an optimization. When terms are satisfied
// by indices, we disable them to prevent redundant tests in the inner
// loop. We would get the correct results if nothing were ever disabled,
// but joins might run a little slower. The trick is to disable as much
// as we can without disabling too much. If we disabled in (1), we'd get
// the wrong answer. See ticket #813.
//
// If all the children of a term are disabled, then that term is also
// automatically disabled. In this way, terms get disabled if derived
// virtual terms are tested first. For example:
//
// x GLOB 'abc*' AND x>='abc' AND x<'acd'
// \___________/ \______/ \_____/
// parent child1 child2
//
// Only the parent term was in the original WHERE clause. The child1
// and child2 terms were added by the LIKE optimization. If both of
// the virtual child terms are valid, then testing of the parent can be
// skipped.
//
// Usually the parent term is marked as TERM_CODED. But if the parent
// term was originally TERM_LIKE, then the parent gets TERM_LIKECOND instead.
// The TERM_LIKECOND marking indicates that the term should be coded inside
// a conditional such that is only evaluated on the second pass of a
// LIKE-optimization loop, when scanning BLOBs instead of strings.
func _disableTerm(tls *crt.TLS, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
var _nLoop int32
_nLoop = i32(0)
_0:
if func() int32 {
if _pTerm != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127088), unsafe.Pointer((*int8)(unsafe.Pointer(&_disableTermØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 || (int32(_pTerm.X3)&i32(4)) != i32(0) || (_pLevel.X0) != i32(0) && (((*XExpr)(_pTerm.X0).X2)&uint32(i32(1))) == uint32(i32(0)) || ((_pLevel.X19)&(_pTerm.X12)) != uint64(i32(0)) {
goto _1
}
if _nLoop != 0 && ((int32(_pTerm.X3) & i32(1024)) != i32(0)) {
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(512))
sink14 = *p
}
goto _10
}
{
p := (*uint16)(unsafe.Pointer(&(_pTerm.X3)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
_10:
if (_pTerm.X7) < i32(0) {
goto _1
}
_pTerm = (*XWhereTerm)(unsafe.Pointer(uintptr((*XWhereClause)(_pTerm.X1).X5) + 48*uintptr(_pTerm.X7)))
*(*uint8)(unsafe.Pointer(&(_pTerm.X5))) -= 1
if int32(_pTerm.X5) != i32(0) {
goto _1
}
_nLoop += 1
goto _0
_1:
}
var _disableTermØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_disableTermØ00__func__Ø000[0], str(109062), 12)
}
// If the expression passed as the second argument is a vector, generate
// code to write the first nReg elements of the vector into an array
// of registers starting with iReg.
//
// If the expression is not a vector, then nReg must be passed 1. In
// this case, generate code to evaluate the expression and leave the
// result in register iReg.
func _codeExprOrVector(tls *crt.TLS, _pParse *XParse, _p *XExpr, _iReg int32, _nReg int32) {
var _2_iSelect, _3_i int32
var _2_v *TVdbe
var _3_pList *XExprList
func() {
if _nReg <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127810), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000))), unsafe.Pointer(str(109074)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprIsVector(tls, _p) == 0 {
goto _2
}
if ((_p.X2) & uint32(i32(2048))) != 0 {
_2_v = (*TVdbe)(_pParse.X2)
_2_iSelect = _sqlite3CodeSubselect(tls, _pParse, _p, i32(0), i32(0))
_sqlite3VdbeAddOp3(tls, _2_v, i32(64), _2_iSelect, _iReg, _nReg-i32(1))
goto _4
}
_3_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_p.X6))))))
func() {
if _nReg > (_3_pList.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127822), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000))), unsafe.Pointer(str(109081)))
crt.X__builtin_abort(tls)
}
}()
_3_i = i32(0)
_7:
if _3_i >= _nReg {
goto _10
}
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_3_pList.X2)))))+20*uintptr(_3_i))).X0), _iReg+_3_i)
_3_i += 1
goto _7
_10:
_4:
goto _11
_2:
func() {
if _nReg != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127828), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeExprOrVectorØ00__func__Ø000))), unsafe.Pointer(str(109100)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCode(tls, _pParse, _p, _iReg)
_11:
}
var _codeExprOrVectorØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_codeExprOrVectorØ00__func__Ø000[0], str(109108), 17)
}
// Generate code that will evaluate all == and IN constraints for an
// index scan.
//
// For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c).
// Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10
// The index has as many as three equality constraints, but in this
// example, the third "c" value is an inequality. So only two
// constraints are coded. This routine will generate code to evaluate
// a==5 and b IN (1,2,3). The current values for a and b will be stored
// in consecutive registers and the index of the first register is returned.
//
// In the example above nEq==2. But this subroutine works for any value
// of nEq including 0. If nEq==0, this routine is nearly a no-op.
// The only thing it does is allocate the pLevel->iMem memory cell and
// compute the affinity string.
//
// The nExtraReg parameter is 0 or 1. It is 0 if all WHERE clause constraints
// are == or IN and are covered by the nEq. nExtraReg is 1 if there is
// an inequality constraint (such as the "c>=5 AND c<10" in the example) that
// occurs after the nEq quality constraints.
//
// This routine allocates a range of nEq+nExtraReg memory cells and returns
// the index of the first memory cell in that range. The code that
// calls this routine will use that memory range to store keys for
// start and termination conditions of the loop.
// key value of the loop. If one or more IN operators appear, then
// this routine allocates an additional nEq memory cells for internal
// use.
//
// Before returning, *pzAff is set to point to a buffer containing a
// copy of the column affinity string of the index allocated using
// sqlite3DbMalloc(). Except, entries in the copy of the string associated
// with equality constraints that use BLOB or NONE affinity are set to
// SQLITE_AFF_BLOB. This is to deal with SQL such as the following:
//
// CREATE TABLE t1(a TEXT PRIMARY KEY, b);
// SELECT ... FROM t1 AS t2, t1 WHERE t1.a = t2.b;
//
// In the example above, the index on t1(a) has TEXT affinity. But since
// the right hand side of the equality constraint (t2.b) has BLOB/NONE affinity,
// no conversion should be attempted before using a t2.b value as part of
// a key to search the index. Hence the first byte in the returned affinity
// string in this example would be set to SQLITE_AFF_BLOB.
func _codeAllEqualityTerms(tls *crt.TLS, _pParse *XParse, _pLevel *XWhereLevel, _bRev int32, _nExtraReg int32, _pzAff **int8) (r0 int32) {
var _j, _regBase, _nReg, _1_iIdxCur, _3_r1 int32
var _zAff *int8
var _nEq, _nSkip uint16
var _v *TVdbe
var _9_pRight *XExpr
var _pIdx *XIndex
var _pLoop *XWhereLoop
var _pTerm *XWhereTerm
_v = (*TVdbe)(_pParse.X2)
_pLoop = (*XWhereLoop)(_pLevel.X18)
func() {
if ((_pLoop.X9) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127415), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(109125)))
crt.X__builtin_abort(tls)
}
}()
_nEq = (*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0
_nSkip = _pLoop.X11
_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)
func() {
if _pIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127419), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(42069)))
crt.X__builtin_abort(tls)
}
}()
_regBase = (_pParse.X18) + i32(1)
_nReg = int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X0) + _nExtraReg
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nReg
sink1 = *p
}
_zAff = _sqlite3DbStrDup(tls, (*Xsqlite3)(_pParse.X0), _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pIdx))
func() {
if _zAff == nil && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127428), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(109166)))
crt.X__builtin_abort(tls)
}
}()
if _nSkip == 0 {
goto _7
}
_1_iIdxCur = _pLevel.X2
_sqlite3VdbeAddOp1(tls, _v, func() int32 {
if _bRev != 0 {
return i32(33)
}
return i32(37)
}(), _1_iIdxCur)
_sqlite3VdbeComment(tls, _v, str(109202), unsafe.Pointer(_pIdx.X0))
_j = _sqlite3VdbeAddOp0(tls, _v, i32(13))
*(*int32)(unsafe.Pointer(&(_pLevel.X5))) = _sqlite3VdbeAddOp4Int(tls, _v, func() int32 {
if _bRev != 0 {
return i32(24)
}
return i32(27)
}(), _1_iIdxCur, i32(0), _regBase, int32(_nSkip))
_sqlite3VdbeJumpHere(tls, _v, _j)
_j = i32(0)
_12:
if _j >= int32(_nSkip) {
goto _15
}
_sqlite3VdbeAddOp3(tls, _v, i32(99), _1_iIdxCur, _j, _regBase+_j)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_explainIndexColumnName(tls, _pIdx, _j)))
_j += 1
goto _12
_15:
_7:
func() {
if _zAff != nil && int32(crt.Xstrlen(tls, _zAff)) < int32(_nEq) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127451), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(109224)))
crt.X__builtin_abort(tls)
}
}()
_j = int32(_nSkip)
_19:
if _j >= int32(_nEq) {
goto _22
}
_pTerm = *(**XWhereTerm)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pLoop.X13)) + 4*uintptr(_j)))
func() {
if _pTerm == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127455), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAllEqualityTermsØ00__func__Ø000))), unsafe.Pointer(str(108051)))
crt.X__builtin_abort(tls)
}
}()
_3_r1 = _codeEqualityTerm(tls, _pParse, _pTerm, _pLevel, _j, _bRev, _regBase+_j)
if _3_r1 == (_regBase + _j) {
goto _25
}
if _nReg == i32(1) {
_sqlite3ReleaseTempReg(tls, _pParse, _regBase)
_regBase = _3_r1
goto _27
}
_sqlite3VdbeAddOp2(tls, _v, i32(65), _3_r1, _regBase+_j)
_27:
_25:
if (int32(_pTerm.X4) & i32(1)) == 0 {
goto _28
}
if (((*XExpr)(_pTerm.X0).X2) & uint32(i32(2048))) == 0 {
goto _29
}
if _zAff != nil {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65))
}
_29:
goto _32
_28:
if (int32(_pTerm.X4) & i32(256)) != i32(0) {
goto _32
}
_9_pRight = (*XExpr)((*XExpr)(_pTerm.X0).X5)
if ((int32(_pTerm.X3) & i32(2048)) == i32(0)) && _sqlite3ExprCanBeNull(tls, _9_pRight) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(75), _regBase+_j, _pLevel.X3)
}
if _zAff == nil {
goto _35
}
if int32(_sqlite3CompareAffinity(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))))) == i32(65) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65))
}
if _sqlite3ExprNeedsNoAffinityChange(tls, _9_pRight, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j)))) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_j))) = int8(i32(65))
}
_35:
_32:
_j += 1
goto _19
_22:
*_pzAff = _zAff
return _regBase
}
var _codeAllEqualityTermsØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_codeAllEqualityTermsØ00__func__Ø000[0], str(109258), 21)
}
// 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 _sqlite3ExprNeedsNoAffinityChange(tls *crt.TLS, _p *XExpr, _aff int8) (r0 int32) {
var _op uint8
if int32(_aff) == i32(65) {
return i32(1)
}
_0:
if (int32(_p.X0) == i32(156)) || (int32(_p.X0) == i32(155)) {
_p = (*XExpr)(_p.X4)
goto _0
}
_op = _p.X0
if int32(_op) == i32(157) {
_op = _p.X12
}
switch int32(_op) {
case i32(97):
goto _8
case i32(132):
goto _7
case i32(133):
goto _9
case i32(134):
goto _6
case i32(152):
goto _10
default:
goto _11
}
_6:
return bool2int((int32(_aff) == i32(68)) || (int32(_aff) == i32(67)))
_7:
return bool2int((int32(_aff) == i32(69)) || (int32(_aff) == i32(67)))
_8:
return bool2int(int32(_aff) == i32(66))
_9:
return i32(1)
_10:
func() {
if (_p.X8) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92905), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000))), unsafe.Pointer(str(109279)))
crt.X__builtin_abort(tls)
}
}()
return bool2int((int32(_p.X9) < i32(0)) && ((int32(_aff) == i32(68)) || (int32(_aff) == i32(67))))
_11:
return i32(0)
}
var _sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000 [33]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprNeedsNoAffinityChangeØ00__func__Ø000[0], str(109292), 33)
}
// If the most recently coded instruction is a constant range constraint
// (a string literal) that originated from the LIKE optimization, then
// set P3 and P5 on the OP_String opcode so that the string will be cast
// to a BLOB at appropriate times.
//
// The LIKE optimization trys to evaluate "x LIKE 'abc%'" as a range
// expression: "x>='ABC' AND x<'abd'". But this requires that the range
// scan loop run twice, once for strings and a second time for BLOBs.
// The OP_String opcodes on the second pass convert the upper and lower
// bound string constants to blobs. This routine makes the necessary changes
// to the OP_String opcodes for that to happen.
//
// Except, of course, if SQLITE_LIKE_DOESNT_MATCH_BLOBS is defined, then
// only the one pass through the string space is required, so this routine
// becomes a no-op.
func _whereLikeOptimizationStringFixup(tls *crt.TLS, _v *TVdbe, _pLevel *XWhereLevel, _pTerm *XWhereTerm) {
var _1_pOp *XVdbeOp
if (int32(_pTerm.X3) & i32(256)) != 0 {
func() {
if (_pLevel.X9) <= uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127522), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000))), unsafe.Pointer(str(109325)))
crt.X__builtin_abort(tls)
}
}()
_1_pOp = _sqlite3VdbeGetOp(tls, _v, i32(-1))
func() {
if _1_pOp == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127524), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000))), unsafe.Pointer(str(109348)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_1_pOp.X0) != i32(97) && ((*Xsqlite3)((*XParse)((*XWhereInfo)((*XWhereClause)(_pTerm.X1).X0).X0).X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127525), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereLikeOptimizationStringFixupØ00__func__Ø000))), unsafe.Pointer(str(109355)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_1_pOp.X5))) = int32((_pLevel.X9) >> uint(i32(1)))
*(*uint16)(unsafe.Pointer(&(_1_pOp.X2))) = uint16(uint8((_pLevel.X9) & uint32(i32(1))))
}
}
var _whereLikeOptimizationStringFixupØ00__func__Ø000 [33]int8
func init() {
crt.Xstrncpy(nil, &_whereLikeOptimizationStringFixupØ00__func__Ø000[0], str(109427), 33)
}
// Expression pRight, which is the RHS of a comparison operation, is
// either a vector of n elements or, if n==1, a scalar expression.
// Before the comparison operation, affinity zAff is to be applied
// to the pRight values. This function modifies characters within the
// affinity string to SQLITE_AFF_BLOB if either:
//
// * the comparison will be performed with no affinity, or
// * the affinity change in zAff is guaranteed not to change the value.
func _updateRangeAffinityStr(tls *crt.TLS, _pRight *XExpr, _n int32, _zAff *int8) {
var _i int32
var _1_p *XExpr
_i = i32(0)
_0:
if _i >= _n {
goto _3
}
_1_p = _sqlite3VectorFieldSubexpr(tls, _pRight, _i)
if (int32(_sqlite3CompareAffinity(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i))))) == i32(65)) || _sqlite3ExprNeedsNoAffinityChange(tls, _1_p, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i)))) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_i))) = int8(i32(65))
}
_i += 1
goto _0
_3:
}
// Code an OP_Affinity opcode to apply the column affinity string zAff
// to the n registers starting at base.
//
// As an optimization, SQLITE_AFF_BLOB entries (which are no-ops) at the
// beginning and end of zAff are ignored. If all entries in zAff are
// SQLITE_AFF_BLOB, then no code gets generated.
//
// This routine makes its own copy of zAff so that the caller is free
// to modify zAff after this routine returns.
func _codeApplyAffinity(tls *crt.TLS, _pParse *XParse, _base int32, _n int32, _zAff *int8) {
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
if _zAff == nil {
func() {
if ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127120), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000))), unsafe.Pointer(str(42486)))
crt.X__builtin_abort(tls)
}
}()
return
}
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127123), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeApplyAffinityØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_5:
if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(i32(0))))) == i32(65)) {
_n -= 1
_base += 1
*(*uintptr)(unsafe.Pointer(&_zAff)) += uintptr(1)
goto _5
}
_6:
if (_n > i32(1)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zAff)) + 1*uintptr(_n-i32(1))))) == i32(65)) {
_n -= 1
goto _6
}
if _n > i32(0) {
_sqlite3VdbeAddOp4(tls, _v, i32(100), _base, _n, i32(0), _zAff, _n)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _base, _n)
}
}
var _codeApplyAffinityØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_codeApplyAffinityØ00__func__Ø000[0], str(109460), 18)
}
var _sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 [8]uint8
func init() {
_sqlite3WhereCodeOneLoopStartØ00aStartOpØ001 = [8]uint8{0, 0, 37, 33, 27, 24, 26, 25}
}
var _sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 [4]uint8
func init() {
_sqlite3WhereCodeOneLoopStartØ00aEndOpØ002 = [4]uint8{41, 39, 38, 40}
}
// Cursor iCur is open on an intkey b-tree (a table). Register iRowid contains
// a rowid value just read from cursor iIdxCur, open on index pIdx. This
// function generates code to do a deferred seek of cursor iCur to the
// rowid stored in register iRowid.
//
// Normally, this is just:
//
// OP_Seek $iCur $iRowid
//
// However, if the scan currently being coded is a branch of an OR-loop and
// the statement currently being coded is a SELECT, then P3 of the OP_Seek
// is set to iIdxCur and P4 is set to point to an array of integers
// containing one entry for each column of the table cursor iCur is open
// on. For each table column, if the column is the i'th column of the
// index, then the corresponding array entry is set to (i+1). If the column
// does not appear in the index at all, the array entry is set to 0.
func _codeDeferredSeek(tls *crt.TLS, _pWInfo *XWhereInfo, _pIdx *XIndex, _iCur int32, _iIdxCur int32) {
var _1_i int32
var _1_ai *int32
var _1_pTab *XTable
var _v *TVdbe
var _pParse *XParse
_pParse = (*XParse)(_pWInfo.X0)
_v = (*TVdbe)(_pParse.X2)
func() {
if _iIdxCur <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127779), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000))), unsafe.Pointer(str(109478)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(int32(_pIdx.X14)-i32(1))))) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127780), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000))), unsafe.Pointer(str(109488)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(130), _iIdxCur, i32(0), _iCur)
if (int32(_pWInfo.X10)&i32(32)) == 0 || (func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}().X29) != uint32(i32(0)) {
goto _7
}
_1_pTab = (*XTable)(_pIdx.X3)
_1_ai = (*int32)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(4)*uint32(int32(_1_pTab.X11)+i32(1)))))
if _1_ai == nil {
goto _8
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ai)) + 4*uintptr(i32(0)))) = int32(_1_pTab.X11)
_1_i = i32(0)
_9:
if _1_i >= (int32(_pIdx.X14) - i32(1)) {
goto _12
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i)))) >= int32(_1_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127792), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeDeferredSeekØ00__func__Ø000))), unsafe.Pointer(str(109524)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i)))) >= i32(0) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_ai)) + 4*uintptr(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_1_i))))+i32(1)))) = _1_i + i32(1)
}
_1_i += 1
goto _9
_12:
_sqlite3VdbeChangeP4(tls, _v, i32(-1), (*int8)(unsafe.Pointer(_1_ai)), i32(-12))
_8:
_7:
}
var _codeDeferredSeekØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_codeDeferredSeekØ00__func__Ø000[0], str(109553), 17)
}
// For an indexes on expression X, locate every instance of expression X in pExpr
// and change that subexpression into a reference to the appropriate column of
// the index.
func _whereIndexExprTrans(tls *crt.TLS, _pIdx *XIndex, _iTabCur int32, _iIdxCur int32, _pWInfo *XWhereInfo) {
var _iIdxCol int32
var _aColExpr *XExprList
var _w XWalker
var _x XIdxExprTrans
_aColExpr = (*XExprList)(_pIdx.X10)
if _aColExpr == nil {
return
}
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _whereIndexExprTransNode
*(**XIdxExprTrans)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = &_x
*(*int32)(unsafe.Pointer(&(_x.X1))) = _iTabCur
*(*int32)(unsafe.Pointer(&(_x.X2))) = _iIdxCur
_iIdxCol = i32(0)
_1:
if _iIdxCol >= (_aColExpr.X0) {
goto _4
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_iIdxCol)))) != i32(-2) {
goto _2
}
func() {
if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2)))))+20*uintptr(_iIdxCol))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(127887), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereIndexExprTransØ00__func__Ø000))), unsafe.Pointer(str(109570)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_x.X3))) = _iIdxCol
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_x.X0))))) = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_aColExpr.X2))))) + 20*uintptr(_iIdxCol))).X0)
_sqlite3WalkExpr(tls, &_w, (*XExpr)(_pWInfo.X4))
_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.X2))
_sqlite3WalkExprList(tls, &_w, (*XExprList)(_pWInfo.X3))
_2:
_iIdxCol += 1
goto _1
_4:
_ = _w
_ = _x
}
// The walker node callback used to transform matching expressions into
// a reference to an index column for an index on an expression.
//
// If pExpr matches, then transform it into a reference to the index column
// that contains the value of pExpr.
func _whereIndexExprTransNode(tls *crt.TLS, _p *XWalker, _pExpr *XExpr) (r0 int32) {
var _pX *XIdxExprTrans
_pX = (*XIdxExprTrans)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_p.X6))))))
if _sqlite3ExprCompare(tls, _pExpr, (*XExpr)(_pX.X0), _pX.X1) == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(152))
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _pX.X2
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = int16(_pX.X3)
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = nil
return i32(1)
}
return i32(0)
}
var _whereIndexExprTransØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_whereIndexExprTransØ00__func__Ø000[0], str(109600), 20)
}
func _sqlite3ExprCodeGetColumnToReg(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iColumn int32, _iTable int32, _iReg int32) {
var _r1 int32
_r1 = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, _iColumn, _iTable, _iReg, uint8(i32(0)))
if _r1 != _iReg {
_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(65), _r1, _iReg)
}
}
// Generate the end of the WHERE loop. See comments on
// sqlite3WhereBegin() for additional information.
func _sqlite3WhereEnd(tls *crt.TLS, _pWInfo *XWhereInfo) {
var _i, _1_addr, _2_addrSeek, _2_n, _3_r1, _3_j, _3_op, _6_j, _11_ws, _16_k, _16_last, _22_x int32
var _db *Xsqlite3
var _16_pTab *XTable
var _v *TVdbe
var _pTabList *XSrcList
var _16_pTabItem *TSrcList_item
var _pParse *XParse
var _2_pIdx, _16_pIdx, _23_pPk *XIndex
var _16_pOp *XVdbeOp
var _pLoop *XWhereLoop
var _pLevel *XWhereLevel
var _6_pIn *TInLoop
_pParse = (*XParse)(_pWInfo.X0)
_v = (*TVdbe)(_pParse.X2)
_pTabList = (*XSrcList)(_pWInfo.X1)
_db = (*Xsqlite3)(_pParse.X0)
_sqlite3ExprCacheClear(tls, _pParse)
_i = int32(_pWInfo.X11) - i32(1)
_0:
if _i < i32(0) {
goto _3
}
_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(_i)))
_pLoop = (*XWhereLoop)(_pLevel.X18)
if int32(_pLevel.X12) == i32(164) {
goto _4
}
_2_addrSeek = i32(0)
if int32(_pWInfo.X16) != i32(2) || ((_pLoop.X9)&uint32(i32(512))) == uint32(i32(0)) || ((uint32((store69(&_2_pIdx, (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)).X16)>>uint(i32(7)))<>uint(i32(31))) == 0 || store1(&_2_n, int32((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X3)) <= i32(0) || int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X2)) + 2*uintptr(_2_n)))) < i32(36) {
goto _9
}
_3_r1 = (_pParse.X18) + i32(1)
_3_j = i32(0)
_10:
if _3_j >= _2_n {
goto _13
}
_sqlite3VdbeAddOp3(tls, _v, i32(99), _pLevel.X2, _3_j, _3_r1+_3_j)
_3_j += 1
goto _10
_13:
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (_2_n + i32(1))
sink1 = *p
}
_3_op = func() int32 {
if int32(_pLevel.X12) == i32(6) {
return i32(24)
}
return i32(27)
}()
_2_addrSeek = _sqlite3VdbeAddOp4Int(tls, _v, _3_op, _pLevel.X2, i32(0), _3_r1, _2_n)
_sqlite3VdbeAddOp2(tls, _v, i32(13), i32(1), _pLevel.X16)
_9:
_sqlite3VdbeResolveLabel(tls, _v, _pLevel.X6)
_sqlite3VdbeAddOp3(tls, _v, int32(_pLevel.X12), _pLevel.X15, _pLevel.X16, int32(_pLevel.X13))
_sqlite3VdbeChangeP5(tls, _v, uint16(_pLevel.X14))
if _2_addrSeek != 0 {
_sqlite3VdbeJumpHere(tls, _v, _2_addrSeek)
}
goto _17
_4:
_sqlite3VdbeResolveLabel(tls, _v, _pLevel.X6)
_17:
if ((_pLoop.X9)&uint32(i32(2048))) == 0 || ((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0) <= i32(0) {
goto _19
}
_sqlite3VdbeResolveLabel(tls, _v, _pLevel.X4)
*func() **TInLoop {
_6_j = (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X0
return &_6_pIn
}() = (*TInLoop)(unsafe.Pointer(uintptr((*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))).X1) + 12*uintptr(_6_j-i32(1))))
_20:
if _6_j <= i32(0) {
goto _23
}
_sqlite3VdbeJumpHere(tls, _v, (_6_pIn.X1)+i32(1))
if int32(_6_pIn.X2) != i32(164) {
_sqlite3VdbeAddOp2(tls, _v, int32(_6_pIn.X2), _6_pIn.X0, _6_pIn.X1)
}
_sqlite3VdbeJumpHere(tls, _v, (_6_pIn.X1)-i32(1))
*(*uintptr)(unsafe.Pointer(func() **TInLoop { _6_j -= 1; return &_6_pIn }())) += uintptr(4294967284)
goto _20
_23:
_19:
_sqlite3VdbeResolveLabel(tls, _v, _pLevel.X3)
if (_pLevel.X5) != 0 {
_sqlite3VdbeGoto(tls, _v, _pLevel.X5)
_sqlite3VdbeComment(tls, _v, str(109620), unsafe.Pointer((*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4).X0))
_sqlite3VdbeJumpHere(tls, _v, _pLevel.X5)
_sqlite3VdbeJumpHere(tls, _v, (_pLevel.X5)-i32(2))
}
if (_pLevel.X10) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(48), int32((_pLevel.X9)>>uint(i32(1))), _pLevel.X10)
}
if (_pLevel.X0) == 0 {
goto _27
}
_11_ws = int32(_pLoop.X9)
_1_addr = _sqlite3VdbeAddOp1(tls, _v, i32(46), _pLevel.X0)
func() {
if (_11_ws&i32(64)) != i32(0) && (_11_ws&i32(512)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135312), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109641)))
crt.X__builtin_abort(tls)
}
}()
if (_11_ws & i32(64)) == i32(0) {
_sqlite3VdbeAddOp1(tls, _v, i32(126), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2)))))+68*uintptr(_i))).X11)
}
if (_11_ws&i32(512)) != 0 || ((_11_ws&i32(8192)) != 0 && ((*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17)))))) != nil)) {
_sqlite3VdbeAddOp1(tls, _v, i32(126), _pLevel.X2)
}
if int32(_pLevel.X12) == i32(52) {
_sqlite3VdbeAddOp2(tls, _v, i32(14), _pLevel.X15, _pLevel.X7)
goto _36
}
_sqlite3VdbeGoto(tls, _v, _pLevel.X7)
_36:
_sqlite3VdbeJumpHere(tls, _v, _1_addr)
_27:
_i -= 1
goto _0
_3:
_sqlite3VdbeResolveLabel(tls, _v, _pWInfo.X8)
func() {
if int32(_pWInfo.X11) > (_pTabList.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109693)))
crt.X__builtin_abort(tls)
}
}()
*func() **XWhereLevel { _i = i32(0); return &_pLevel }() = (*XWhereLevel)(unsafe.Pointer((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24)))))
_39:
if _i >= int32(_pWInfo.X11) {
goto _42
}
_16_pIdx = nil
_16_pTabItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(_pLevel.X11)))
_16_pTab = (*XTable)(_16_pTabItem.X4)
func() {
if _16_pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135344), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
_pLoop = (*XWhereLoop)(_pLevel.X18)
if ((uint32(((*t28)(unsafe.Pointer(&(_16_pTabItem.X9))).X1)>>uint(i32(4))) << uint(i32(31))) >> uint(i32(31))) != 0 {
_translateColumnToCopy(tls, _pParse, _pLevel.X8, _pLevel.X1, _16_pTabItem.X8, i32(0))
goto _40
}
if ((_pLoop.X9) & uint32(i32(576))) != 0 {
_16_pIdx = (*XIndex)((*t61)(unsafe.Pointer((*t62)(unsafe.Pointer(&(_pLoop.X8))))).X4)
goto _48
}
if ((_pLoop.X9) & uint32(i32(8192))) != 0 {
_16_pIdx = (*XIndex)(*(*unsafe.Pointer)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_pLevel.X17))))))
}
_48:
if _16_pIdx == nil || int32(_pWInfo.X14) != i32(0) && (((*XTable)(_16_pIdx.X3).X9)&uint32(i32(32))) == uint32(i32(0)) || (_db.X17) != 0 {
goto _52
}
_16_last = _sqlite3VdbeCurrentAddr(tls, _v)
_16_k = _pLevel.X8
_16_pOp = _sqlite3VdbeGetOp(tls, _v, _16_k)
_53:
if _16_k >= _16_last {
goto _56
}
if (_16_pOp.X3) != (_pLevel.X1) {
goto _54
}
if int32(_16_pOp.X0) != i32(99) {
goto _58
}
_22_x = _16_pOp.X4
func() {
if (*XTable)(_16_pIdx.X3) != _16_pTab {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109724)))
crt.X__builtin_abort(tls)
}
}()
if ((_16_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
_23_pPk = _sqlite3PrimaryKeyIndex(tls, _16_pTab)
_22_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_23_pPk.X1)) + 2*uintptr(_22_x))))
func() {
if _22_x < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109743)))
crt.X__builtin_abort(tls)
}
}()
}
_22_x = int32(_sqlite3ColumnOfIndex(tls, _16_pIdx, int16(_22_x)))
if _22_x >= i32(0) {
*(*int32)(unsafe.Pointer(&(_16_pOp.X4))) = _22_x
*(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2
}
func() {
if ((_pLoop.X9)&uint32(i32(64))) != uint32(i32(0)) && _22_x < i32(0) && (_pWInfo.X14) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(135396), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereEndØ00__func__Ø000))), unsafe.Pointer(str(109748)))
crt.X__builtin_abort(tls)
}
}()
goto _72
_58:
if int32(_16_pOp.X0) == i32(125) {
*(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2
*(*uint8)(unsafe.Pointer(&(_16_pOp.X0))) = uint8(i32(131))
goto _72
}
if int32(_16_pOp.X0) == i32(23) {
*(*int32)(unsafe.Pointer(&(_16_pOp.X3))) = _pLevel.X2
}
_72:
_54:
*(*uintptr)(unsafe.Pointer(func() **XVdbeOp { _16_k += 1; return &_16_pOp }())) += uintptr(24)
goto _53
_56:
_52:
_40:
*(*uintptr)(unsafe.Pointer(func() **XWhereLevel { _i += 1; return &_pLevel }())) += uintptr(76)
goto _39
_42:
*(*uint32)(unsafe.Pointer(&(_pParse.X42))) = uint32(_pWInfo.X9)
_whereInfoFree(tls, _db, _pWInfo)
}
var _sqlite3WhereEndØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereEndØ00__func__Ø000[0], str(109813), 16)
}
// Free a WhereInfo structure
func _whereInfoFree(tls *crt.TLS, _db *Xsqlite3, _pWInfo *XWhereInfo) {
var _1_i int32
var _4_p *XWhereLoop
var _2_pLevel *XWhereLevel
if func() int32 {
if _pWInfo != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(132240), unsafe.Pointer((*int8)(unsafe.Pointer(&_whereInfoFreeØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _2
}
_1_i = i32(0)
_3:
if _1_i >= int32(_pWInfo.X11) {
goto _6
}
_2_pLevel = (*XWhereLevel)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]XWhereLevel)(unsafe.Pointer(&(_pWInfo.X24))))) + 76*uintptr(_1_i)))
if ((*XWhereLoop)(_2_pLevel.X18) != nil) && ((((*XWhereLoop)(_2_pLevel.X18).X9) & uint32(i32(2048))) != 0) {
_sqlite3DbFree(tls, _db, (*T_ht)(unsafe.Pointer((*t70)(unsafe.Pointer(&(_2_pLevel.X17))))).X1)
}
_1_i += 1
goto _3
_6:
_sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_pWInfo.X22))))
_9:
if (*XWhereLoop)(_pWInfo.X19) != nil {
_4_p = (*XWhereLoop)(_pWInfo.X19)
*(**XWhereLoop)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pWInfo.X19))))) = (*XWhereLoop)(_4_p.X14)
_whereLoopDelete(tls, _db, _4_p)
goto _9
}
_sqlite3DbFreeNN(tls, _db, (unsafe.Pointer)(_pWInfo))
_2:
}
var _whereInfoFreeØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_whereInfoFreeØ00__func__Ø000[0], str(109829), 14)
}
// Deallocate a WhereClause structure. The WhereClause structure
// itself is not freed. This routine is the inverse of
// sqlite3WhereClauseInit().
func _sqlite3WhereClauseClear(tls *crt.TLS, _pWC *XWhereClause) {
var _i int32
var _db *Xsqlite3
var _a *XWhereTerm
_db = (*Xsqlite3)((*XParse)((*XWhereInfo)(_pWC.X0).X0).X0)
*func() **XWhereTerm { _i = (_pWC.X3) - i32(1); return &_a }() = (*XWhereTerm)(_pWC.X5)
_0:
if _i < i32(0) {
goto _3
}
if (int32(_a.X3) & i32(1)) != 0 {
_sqlite3ExprDelete(tls, _db, (*XExpr)(_a.X0))
}
if (int32(_a.X3) & i32(16)) != 0 {
_whereOrInfoDelete(tls, _db, (*XWhereOrInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_a.X10)))))))
goto _7
}
if (int32(_a.X3) & i32(32)) != 0 {
_whereAndInfoDelete(tls, _db, (*XWhereAndInfo)(*(*unsafe.Pointer)(unsafe.Pointer((*t63)(unsafe.Pointer(&(_a.X10)))))))
}
_7:
*(*uintptr)(unsafe.Pointer(func() **XWhereTerm { _i -= 1; return &_a }())) += uintptr(48)
goto _0
_3:
if (*XWhereTerm)(_pWC.X5) != (*XWhereTerm)(unsafe.Pointer((*[8]XWhereTerm)(unsafe.Pointer(&(_pWC.X6))))) {
_sqlite3DbFree(tls, _db, _pWC.X5)
}
}
// Deallocate all memory associated with a WhereOrInfo object.
func _whereOrInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereOrInfo) {
_sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_p.X0))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p))
}
// Deallocate all memory associated with a WhereAndInfo object.
func _whereAndInfoDelete(tls *crt.TLS, _db *Xsqlite3, _p *XWhereAndInfo) {
_sqlite3WhereClauseClear(tls, (*XWhereClause)(unsafe.Pointer(&(_p.X0))))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p))
}
var _sqlite3WhereCodeOneLoopStartØ00aStepØ003 [2]uint8
func init() {
_sqlite3WhereCodeOneLoopStartØ00aStepØ003 = [2]uint8{7, 6}
}
var _sqlite3WhereCodeOneLoopStartØ00aStartØ004 [2]uint8
func init() {
_sqlite3WhereCodeOneLoopStartØ00aStartØ004 = [2]uint8{37, 33}
}
// Return the estimated number of output rows from a WHERE clause
func _sqlite3WhereOutputRowCount(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int16) {
return _pWInfo.X21
}
// Return one of the WHERE_DISTINCT_xxxxx values to indicate how this
// WHERE clause returns outputs for DISTINCT processing.
func _sqlite3WhereIsDistinct(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
return int32(_pWInfo.X16)
}
// Return TRUE if the WHERE clause returns rows in ORDER BY order.
// Return FALSE if the output needs to be sorted.
func _sqlite3WhereIsOrdered(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
return int32(_pWInfo.X12)
}
// Return TRUE if the innermost loop of the WHERE clause implementation
// returns rows in ORDER BY order for complete run of the inner loop.
//
// Across multiple iterations of outer loops, the output rows need not be
// sorted. As long as rows are sorted for just the innermost loop, this
// routine can return TRUE.
func _sqlite3WhereOrderedInnerLoop(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
return int32(_pWInfo.X17)
}
// Return the VDBE address or label to jump to in order to continue
// immediately with the next row of a WHERE clause.
func _sqlite3WhereContinueLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
func() {
if (_pWInfo.X7) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(130460), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereContinueLabelØ00__func__Ø000))), unsafe.Pointer(str(109843)))
crt.X__builtin_abort(tls)
}
}()
return _pWInfo.X7
}
var _sqlite3WhereContinueLabelØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereContinueLabelØ00__func__Ø000[0], str(109864), 26)
}
// Return the VDBE address or label to jump to in order to break
// out of a WHERE loop.
func _sqlite3WhereBreakLabel(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
return _pWInfo.X8
}
// 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 _sqlite3ExprAnalyzeAggList(tls *crt.TLS, _pNC *XNameContext, _pList *XExprList) {
var _i int32
var _pItem *TExprList_item
if _pList == nil {
goto _0
}
*func() *int32 {
_pItem = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))
return &_i
}() = i32(0)
_1:
if _i >= (_pList.X0) {
goto _4
}
_sqlite3ExprAnalyzeAggregates(tls, _pNC, (*XExpr)(_pItem.X0))
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _1
_4:
_0:
}
// 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 _sqlite3ExprAnalyzeAggregates(tls *crt.TLS, _pNC *XNameContext, _pExpr *XExpr) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _analyzeAggregate
*(*func(*crt.TLS, *XWalker, *XSelect) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X2))))) = _analyzeAggregatesInSelect
*(**XNameContext)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pNC
func() {
if (*XSrcList)(_pNC.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000))), unsafe.Pointer(str(94459)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3WalkExpr(tls, &_w, _pExpr)
_ = _w
}
// This is the xExprCallback for a tree walker. It is used to
// implement sqlite3ExprAnalyzeAggregates(). See sqlite3ExprAnalyzeAggregates
// for additional information.
func _analyzeAggregate(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _i, _5_k, _9_j, _9_n int32
var _17_enc uint8
var _pSrcList *XSrcList
var _3_pItem *TSrcList_item
var _9_pGB *XExprList
var _9_pTerm *TExprList_item
var _10_pE *XExpr
var _pParse *XParse
var _pNC *XNameContext
var _pAggInfo *XAggInfo
var _4_pCol *TAggInfo_col
var _14_pItem *TAggInfo_func
_pNC = (*XNameContext)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
_pParse = (*XParse)(_pNC.X0)
_pSrcList = (*XSrcList)(_pNC.X1)
_pAggInfo = (*XAggInfo)(_pNC.X3)
switch int32(_pExpr.X0) {
case i32(152):
goto _1
case i32(153):
goto _3
case i32(154):
goto _1
default:
goto _4
}
_1:
if func() int32 {
if _pSrcList != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95863), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _7
}
_3_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrcList.X2)))))
_i = i32(0)
_8:
if _i >= (_pSrcList.X0) {
goto _11
}
func() {
if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95867), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(96005)))
crt.X__builtin_abort(tls)
}
}()
if (_pExpr.X8) != (_3_pItem.X11) {
goto _14
}
_4_pCol = (*TAggInfo_col)(_pAggInfo.X8)
_5_k = i32(0)
_15:
if _5_k >= (_pAggInfo.X9) {
goto _18
}
if ((_4_pCol.X1) == (_pExpr.X8)) && ((_4_pCol.X2) == int32(_pExpr.X9)) {
goto _18
}
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _5_k += 1; return &_4_pCol }())) += uintptr(24)
goto _15
_18:
if _5_k < (_pAggInfo.X9) || store1(&_5_k, _addAggInfoColumn(tls, (*Xsqlite3)(_pParse.X0), _pAggInfo)) < i32(0) {
goto _22
}
_4_pCol = (*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8) + 24*uintptr(_5_k)))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pCol.X0))))) = (*XTable)(_pExpr.X14)
*(*int32)(unsafe.Pointer(&(_4_pCol.X1))) = _pExpr.X8
*(*int32)(unsafe.Pointer(&(_4_pCol.X2))) = int32(_pExpr.X9)
*(*int32)(unsafe.Pointer(&(_4_pCol.X4))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
*(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = i32(-1)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pCol.X5))))) = _pExpr
if (*XExprList)(_pAggInfo.X7) == nil {
goto _23
}
_9_pGB = (*XExprList)(_pAggInfo.X7)
_9_pTerm = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_9_pGB.X2)))))
_9_n = _9_pGB.X0
_9_j = i32(0)
_24:
if _9_j >= _9_n {
goto _27
}
_10_pE = (*XExpr)(_9_pTerm.X0)
if ((int32(_10_pE.X0) == i32(152)) && ((_10_pE.X8) == (_pExpr.X8))) && (int32(_10_pE.X9) == int32(_pExpr.X9)) {
*(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = _9_j
goto _27
}
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _9_j += 1; return &_9_pTerm }())) += uintptr(20)
goto _24
_27:
_23:
if (_4_pCol.X3) < i32(0) {
*(*int32)(unsafe.Pointer(&(_4_pCol.X3))) = postInc1((*int32)(unsafe.Pointer(&(_pAggInfo.X4))), int32(1))
}
_22:
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
*(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X13))))) = _pAggInfo
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(154))
*(*int16)(unsafe.Pointer(&(_pExpr.X10))) = int16(_5_k)
goto _11
_14:
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_3_pItem }())) += uintptr(68)
goto _8
_11:
_7:
return i32(1)
_3:
if (int32(_pNC.X7)&i32(8)) != i32(0) || (_pWalker.X4) != int32(_pExpr.X12) {
goto _33
}
_14_pItem = (*TAggInfo_func)(_pAggInfo.X11)
_i = i32(0)
_34:
if _i >= (_pAggInfo.X12) {
goto _37
}
if _sqlite3ExprCompare(tls, (*XExpr)(_14_pItem.X0), _pExpr, i32(-1)) == i32(0) {
goto _37
}
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_14_pItem }())) += uintptr(16)
goto _34
_37:
if _i < (_pAggInfo.X12) {
goto _39
}
_17_enc = (*Xsqlite3)(_pParse.X0).X14
_i = _addAggInfoFunc(tls, (*Xsqlite3)(_pParse.X0), _pAggInfo)
if _i < i32(0) {
goto _40
}
func() {
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95945), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(42778)))
crt.X__builtin_abort(tls)
}
}()
_14_pItem = (*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11) + 16*uintptr(_i)))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_14_pItem.X0))))) = _pExpr
*(*int32)(unsafe.Pointer(&(_14_pItem.X2))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
func() {
if ((_pExpr.X2) & uint32(i32(1024))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95949), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(42524)))
crt.X__builtin_abort(tls)
}
}()
*(**XFuncDef)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_14_pItem.X1))))) = _sqlite3FindFunction(tls, (*Xsqlite3)(_pParse.X0), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3))))), func() int32 {
if (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))) != nil {
return ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6)))))).X0)
}
return i32(0)
}(), _17_enc, uint8(i32(0)))
if ((_pExpr.X2) & uint32(i32(16))) != 0 {
*(*int32)(unsafe.Pointer(&(_14_pItem.X3))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
goto _48
}
*(*int32)(unsafe.Pointer(&(_14_pItem.X3))) = i32(-1)
_48:
_40:
_39:
func() {
if ((_pExpr.X2) & uint32(i32(24576))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95962), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeAggregateØ00__func__Ø000))), unsafe.Pointer(str(96005)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
*(*int16)(unsafe.Pointer(&(_pExpr.X10))) = int16(_i)
*(**XAggInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X13))))) = _pAggInfo
return i32(1)
_33:
return i32(0)
_4:
return i32(0)
}
var _analyzeAggregateØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_analyzeAggregateØ00__func__Ø000[0], str(109890), 17)
}
// Add a new element to the pAggInfo->aCol[] array. Return the index of
// the new element. Return a negative number if malloc fails.
func _addAggInfoColumn(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
var _i int32
*(**TAggInfo_col)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X8))))) = (*TAggInfo_col)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X8, int32(u32(24)), (*int32)(unsafe.Pointer(&(_pInfo.X9))), &_i))
return _i
}
// 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 _sqlite3ArrayAllocate(tls *crt.TLS, _db *Xsqlite3, _pArray unsafe.Pointer, _szEntry int32, _pnEntry *int32, _pIdx *int32) (r0 unsafe.Pointer) {
var _n, _1_sz int32
var _z *int8
var _1_pNew unsafe.Pointer
_n = *_pnEntry
if (_n & (_n - i32(1))) != i32(0) {
goto _0
}
_1_sz = func() int32 {
if _n == i32(0) {
return i32(1)
}
return (i32(2) * _n)
}()
_1_pNew = _sqlite3DbRealloc(tls, _db, _pArray, uint64(_1_sz*_szEntry))
if _1_pNew == nil {
*_pIdx = i32(-1)
return _pArray
}
_pArray = _1_pNew
_0:
_z = (*int8)(_pArray)
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_n*_szEntry)))), i32(0), uint32(_szEntry))
*_pIdx = _n
*_pnEntry += 1
return _pArray
}
// Add a new element to the pAggInfo->aFunc[] array. Return the index of
// the new element. Return a negative number if malloc fails.
func _addAggInfoFunc(tls *crt.TLS, _db *Xsqlite3, _pInfo *XAggInfo) (r0 int32) {
var _i int32
*(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInfo.X11))))) = (*TAggInfo_func)(_sqlite3ArrayAllocate(tls, _db, _pInfo.X11, int32(u32(16)), (*int32)(unsafe.Pointer(&(_pInfo.X12))), &_i))
return _i
}
func _analyzeAggregatesInSelect(tls *crt.TLS, _pWalker *XWalker, _pSelect *XSelect) (r0 int32) {
return i32(0)
}
var _sqlite3ExprAnalyzeAggregatesØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAnalyzeAggregatesØ00__func__Ø000[0], str(109907), 29)
}
// Transfer eligible terms from the HAVING clause of a query, which is
// processed after grouping, to the WHERE clause, which is processed before
// grouping. For example, the query:
//
// SELECT * FROM WHERE a=? GROUP BY b HAVING b=? AND c=?
//
// can be rewritten as:
//
// SELECT * FROM WHERE a=? AND b=? GROUP BY b HAVING c=?
//
// A term of the HAVING expression is eligible for transfer if it consists
// entirely of constants and expressions that are also GROUP BY terms that
// use the "BINARY" collation sequence.
func _havingToWhere(tls *crt.TLS, _pParse *XParse, _pGroupBy *XExprList, _pHaving *XExpr, _ppWhere **XExpr) {
var _sWalker XWalker
var _sCtx THavingToWhereCtx
*(***XExpr)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X0))))) = _ppWhere
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sCtx.X1))))) = _pGroupBy
crt.Xmemset(tls, (unsafe.Pointer)(&_sWalker), i32(0), u32(28))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sWalker.X0))))) = _pParse
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_sWalker.X1))))) = _havingToWhereExprCb
*(**THavingToWhereCtx)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_sWalker.X6))))))) = &_sCtx
_sqlite3WalkExpr(tls, &_sWalker, _pHaving)
_ = _sCtx
_ = _sWalker
}
// sqlite3WalkExpr() callback used by havingToWhere().
//
// If the node passed to the callback is a TK_AND node, return
// WRC_Continue to tell sqlite3WalkExpr() to iterate through child nodes.
//
// Otherwise, return WRC_Prune. In this case, also check if the
// sub-expression matches the criteria for being moved to the WHERE
// clause. If so, add it to the WHERE clause and replace the sub-expression
// within the HAVING expression with a constant "1".
func _havingToWhereExprCb(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _2_db *Xsqlite3
var _2_pNew, _3_pWhere *XExpr
var _4_t XExpr
var _1_p *THavingToWhereCtx
if int32(_pExpr.X0) == i32(71) {
goto _0
}
_1_p = (*THavingToWhereCtx)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
if _sqlite3ExprIsConstantOrGroupBy(tls, (*XParse)(_pWalker.X0), _pExpr, (*XExprList)(_1_p.X1)) == 0 {
goto _1
}
_2_db = (*Xsqlite3)((*XParse)(_pWalker.X0).X0)
_2_pNew = _sqlite3ExprAlloc(tls, _2_db, i32(134), (*XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3IntTokens))+8*uintptr(i32(1)))), i32(0))
if _2_pNew != nil {
_3_pWhere = *(**XExpr)(unsafe.Pointer(_1_p.X0))
_4_t = *_2_pNew
*_2_pNew = *_pExpr
*_pExpr = _4_t
_2_pNew = _sqlite3ExprAnd(tls, _2_db, _3_pWhere, _2_pNew)
*(**XExpr)(unsafe.Pointer(_1_p.X0)) = _2_pNew
}
_1:
return i32(1)
_0:
return i32(0)
}
// 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 _sqlite3ExprIsConstantOrGroupBy(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pGroupBy *XExprList) (r0 int32) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(1))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _exprNodeIsConstantOrGroupBy
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))))) = _pGroupBy
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_w.X0))))) = _pParse
_sqlite3WalkExpr(tls, &_w, _p)
return int32(_w.X5)
_ = _w
panic(0)
}
// sqlite3WalkExpr() callback used by sqlite3ExprIsConstantOrGroupBy().
func _exprNodeIsConstantOrGroupBy(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
var _i int32
var _pGroupBy *XExprList
var _1_p *XExpr
var _2_pColl *XCollSeq
_pGroupBy = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))
_i = i32(0)
_0:
if _i >= (_pGroupBy.X0) {
goto _3
}
_1_p = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pGroupBy.X2))))) + 20*uintptr(_i))).X0)
if _sqlite3ExprCompare(tls, _pExpr, _1_p, i32(-1)) >= i32(2) {
goto _4
}
_2_pColl = _sqlite3ExprCollSeq(tls, (*XParse)(_pWalker.X0), _1_p)
if (_2_pColl == nil) || (Xsqlite3_stricmp(tls, str(37881), _2_pColl.X0) == i32(0)) {
return i32(1)
}
_4:
_i += 1
goto _0
_3:
if ((_pExpr.X2) & uint32(i32(2048))) != uint32(i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pWalker.X5))) = uint8(i32(0))
return i32(2)
}
return _exprNodeIsConstant(tls, _pWalker, _pExpr)
}
// Unless an "EXPLAIN QUERY PLAN" command is being processed, this function
// is a no-op. Otherwise, it adds a single row of output to the EQP result,
// where the caption is of the form:
//
// "USE TEMP B-TREE FOR xxx"
//
// where xxx is one of "DISTINCT", "ORDER BY" or "GROUP BY". Exactly which
// is determined by the zUsage argument.
func _explainTempTable(tls *crt.TLS, _pParse *XParse, _zUsage *int8) {
var _1_zMsg *int8
var _1_v *TVdbe
if int32(_pParse.X54) == i32(2) {
_1_v = (*TVdbe)(_pParse.X2)
_1_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(109936), unsafe.Pointer(_zUsage))
_sqlite3VdbeAddOp4(tls, _1_v, i32(165), _pParse.X58, i32(0), i32(0), _1_zMsg, i32(-1))
}
}
// If the WHERE_GROUPBY flag is set in the mask passed to sqlite3WhereBegin(),
// the planner assumes that the specified pOrderBy list is actually a GROUP
// BY clause - and so any order that groups rows as required satisfies the
// request.
//
// Normally, in this case it is not possible for the caller to determine
// whether or not the rows are really being delivered in sorted order, or
// just in some other order that provides the required grouping. However,
// if the WHERE_SORTBYGROUP flag is also passed to sqlite3WhereBegin(), then
// this function may be called on the returned WhereInfo object. It returns
// true if the rows really will be sorted in the specified order, or false
// otherwise.
//
// For example, assuming:
//
// CREATE INDEX i1 ON t1(x, Y);
//
// then
//
// SELECT * FROM t1 GROUP BY x,y ORDER BY x,y; -- IsSorted()==1
// SELECT * FROM t1 GROUP BY y,x ORDER BY y,x; -- IsSorted()==0
func _sqlite3WhereIsSorted(tls *crt.TLS, _pWInfo *XWhereInfo) (r0 int32) {
func() {
if (int32(_pWInfo.X10) & i32(64)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134159), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000))), unsafe.Pointer(str(109959)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pWInfo.X10) & i32(512)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(134160), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WhereIsSortedØ00__func__Ø000))), unsafe.Pointer(str(109994)))
crt.X__builtin_abort(tls)
}
}()
return int32(_pWInfo.X13)
}
var _sqlite3WhereIsSortedØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WhereIsSortedØ00__func__Ø000[0], str(110033), 21)
}
// Update the accumulator memory cells for an aggregate based on
// the current cursor position.
func _updateAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
var _i, _regHit, _addrHitTest, _1_nArg, _1_addrNext, _1_regAgg, _5_j int32
var _v *TVdbe
var _1_pList *XExprList
var _5_pItem *TExprList_item
var _5_pColl *XCollSeq
var _pC *TAggInfo_col
var _pF *TAggInfo_func
_v = (*TVdbe)(_pParse.X2)
_regHit = i32(0)
_addrHitTest = i32(0)
*(*uint8)(unsafe.Pointer(&(_pAggInfo.X0))) = uint8(i32(1))
*func() **TAggInfo_func { _i = i32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.X11)
_0:
if _i >= (_pAggInfo.X12) {
goto _3
}
_1_addrNext = i32(0)
_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pF.X0).X6))))))
func() {
if (((*XExpr)(_pF.X0).X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121330), unsafe.Pointer((*int8)(unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110054)))
crt.X__builtin_abort(tls)
}
}()
if _1_pList != nil {
_1_nArg = _1_pList.X0
_1_regAgg = _sqlite3GetTempRange(tls, _pParse, _1_nArg)
_sqlite3ExprCodeExprList(tls, _pParse, _1_pList, _1_regAgg, i32(0), uint8(i32(1)))
goto _7
}
_1_nArg = i32(0)
_1_regAgg = i32(0)
_7:
if (_pF.X3) >= i32(0) {
_1_addrNext = _sqlite3VdbeMakeLabel(tls, _v)
_codeDistinct(tls, _pParse, _pF.X3, _1_addrNext, i32(1), _1_regAgg)
}
if (int32((*XFuncDef)(_pF.X1).X1) & i32(32)) == 0 {
goto _9
}
_5_pColl = nil
func() {
if _1_pList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121349), unsafe.Pointer((*int8)(unsafe.Pointer(&_updateAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(90087)))
crt.X__builtin_abort(tls)
}
}()
*func() **TExprList_item { _5_j = i32(0); return &_5_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_1_pList.X2)))))
_12:
if _5_pColl != nil || _5_j >= _1_nArg {
goto _16
}
_5_pColl = _sqlite3ExprCollSeq(tls, _pParse, (*XExpr)(_5_pItem.X0))
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _5_j += 1; return &_5_pItem }())) += uintptr(20)
goto _12
_16:
if _5_pColl == nil {
_5_pColl = (*XCollSeq)((*Xsqlite3)(_pParse.X0).X2)
}
if (_regHit == i32(0)) && (_pAggInfo.X10) != 0 {
_regHit = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
}
_sqlite3VdbeAddOp4(tls, _v, i32(68), _regHit, i32(0), i32(0), (*int8)(unsafe.Pointer(_5_pColl)), i32(-3))
_9:
_sqlite3VdbeAddOp3(tls, _v, i32(150), i32(0), _1_regAgg, _pF.X2)
_sqlite3VdbeAppendP4(tls, _v, _pF.X1, i32(-4))
_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_nArg)))
_sqlite3ExprCacheAffinityChange(tls, _pParse, _1_regAgg, _1_nArg)
_sqlite3ReleaseTempRange(tls, _pParse, _1_regAgg, _1_nArg)
if _1_addrNext != 0 {
_sqlite3VdbeResolveLabel(tls, _v, _1_addrNext)
_sqlite3ExprCacheClear(tls, _pParse)
}
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(16)
goto _0
_3:
if _regHit != 0 {
_addrHitTest = _sqlite3VdbeAddOp1(tls, _v, i32(21), _regHit)
}
_sqlite3ExprCacheClear(tls, _pParse)
*func() **TAggInfo_col { _i = i32(0); return &_pC }() = (*TAggInfo_col)(_pAggInfo.X8)
_22:
if _i >= (_pAggInfo.X10) {
goto _25
}
_sqlite3ExprCode(tls, _pParse, (*XExpr)(_pC.X5), _pC.X4)
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_col { _i += 1; return &_pC }())) += uintptr(24)
goto _22
_25:
*(*uint8)(unsafe.Pointer(&(_pAggInfo.X0))) = uint8(i32(0))
_sqlite3ExprCacheClear(tls, _pParse)
if _addrHitTest != 0 {
_sqlite3VdbeJumpHere(tls, _v, _addrHitTest)
}
}
var _updateAccumulatorØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_updateAccumulatorØ00__func__Ø000[0], str(110096), 18)
}
// Invoke the OP_AggFinalize opcode for every aggregate function
// in the AggInfo structure.
func _finalizeAggFunctions(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
var _i int32
var _v *TVdbe
var _1_pList *XExprList
var _pF *TAggInfo_func
_v = (*TVdbe)(_pParse.X2)
*func() **TAggInfo_func { _i = i32(0); return &_pF }() = (*TAggInfo_func)(_pAggInfo.X11)
_0:
if _i >= (_pAggInfo.X12) {
goto _3
}
_1_pList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&((*XExpr)(_pF.X0).X6))))))
func() {
if (((*XExpr)(_pF.X0).X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121306), unsafe.Pointer((*int8)(unsafe.Pointer(&_finalizeAggFunctionsØ00__func__Ø000))), unsafe.Pointer(str(110054)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(152), _pF.X2, func() int32 {
if _1_pList != nil {
return (_1_pList.X0)
}
return i32(0)
}())
_sqlite3VdbeAppendP4(tls, _v, _pF.X1, i32(-4))
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pF }())) += uintptr(16)
goto _0
_3:
}
var _finalizeAggFunctionsØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_finalizeAggFunctionsØ00__func__Ø000[0], str(110114), 21)
}
// Reset the aggregate accumulator.
//
// The aggregate accumulator is a set of memory cells that hold
// intermediate results while calculating an aggregate. This
// routine generates code that stores NULLs in all of those memory
// cells.
func _resetAccumulator(tls *crt.TLS, _pParse *XParse, _pAggInfo *XAggInfo) {
var _i, _nReg int32
var _v *TVdbe
var _4_pE *XExpr
var _6_pKeyInfo *XKeyInfo
var _pFunc *TAggInfo_func
_v = (*TVdbe)(_pParse.X2)
_nReg = (_pAggInfo.X12) + (_pAggInfo.X9)
if _nReg == i32(0) {
return
}
func() {
if _nReg != (((_pAggInfo.X6) - (_pAggInfo.X5)) + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121268), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110135)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_3:
if _i >= (_pAggInfo.X9) {
goto _6
}
func() {
if ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+24*uintptr(_i))).X4) < (_pAggInfo.X5) || ((*TAggInfo_col)(unsafe.Pointer(uintptr(_pAggInfo.X8)+24*uintptr(_i))).X4) > (_pAggInfo.X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121270), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110175)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _3
_6:
_i = i32(0)
_10:
if _i >= (_pAggInfo.X12) {
goto _13
}
func() {
if ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+16*uintptr(_i))).X2) < (_pAggInfo.X5) || ((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+16*uintptr(_i))).X2) > (_pAggInfo.X6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121274), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110258)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _10
_13:
_sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _pAggInfo.X5, _pAggInfo.X6)
*func() *int32 { _pFunc = (*TAggInfo_func)(_pAggInfo.X11); return &_i }() = i32(0)
_17:
if _i >= (_pAggInfo.X12) {
goto _20
}
if (_pFunc.X3) < i32(0) {
goto _21
}
_4_pE = (*XExpr)(_pFunc.X0)
func() {
if ((_4_pE.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(121282), unsafe.Pointer((*int8)(unsafe.Pointer(&_resetAccumulatorØ00__func__Ø000))), unsafe.Pointer(str(110343)))
crt.X__builtin_abort(tls)
}
}()
if ((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))) == nil) || (((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))).X0) != i32(1)) {
_sqlite3ErrorMsg(tls, _pParse, str(110378))
*(*int32)(unsafe.Pointer(&(_pFunc.X3))) = i32(-1)
goto _26
}
_6_pKeyInfo = _keyInfoFromExprList(tls, _pParse, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_4_pE.X6)))))), i32(0), i32(0))
_sqlite3VdbeAddOp4(tls, _v, i32(110), _pFunc.X3, i32(0), i32(0), (*int8)(unsafe.Pointer(_6_pKeyInfo)), i32(-5))
_26:
_21:
*(*uintptr)(unsafe.Pointer(func() **TAggInfo_func { _i += 1; return &_pFunc }())) += uintptr(16)
goto _17
_20:
}
var _resetAccumulatorØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_resetAccumulatorØ00__func__Ø000[0], str(110429), 17)
}
// The select statement passed as the first argument is an aggregate query.
// The second argument is the associated aggregate-info object. This
// function tests if the SELECT is of the form:
//
// SELECT count(*) FROM
//
// where table is a database table, not a sub-select or view. If the query
// does match this pattern, then a pointer to the Table object representing
// is returned. Otherwise, 0 is returned.
func _isSimpleCount(tls *crt.TLS, _p *XSelect, _pAggInfo *XAggInfo) (r0 *XTable) {
var _pTab *XTable
var _pExpr *XExpr
func() {
if (*XExprList)(_p.X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120492), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(110446)))
crt.X__builtin_abort(tls)
}
}()
if ((((*XExpr)(_p.X9) != nil) || (((*XExprList)(_p.X0).X0) != i32(1))) || (((*XSrcList)(_p.X8).X0) != i32(1))) || ((*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2)))))+68*uintptr(i32(0)))).X5) != nil) {
return nil
}
_pTab = (*XTable)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_p.X8).X2))))) + 68*uintptr(i32(0)))).X4)
_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2))))) + 20*uintptr(i32(0)))).X0)
func() {
if _pTab == nil || (*XSelect)(_pTab.X3) != nil || _pExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120501), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(110459)))
crt.X__builtin_abort(tls)
}
}()
if (_pTab.X16) != 0 {
return nil
}
if int32(_pExpr.X0) != i32(153) {
return nil
}
if func() int32 {
if (_pAggInfo.X12) == i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120505), unsafe.Pointer((*int8)(unsafe.Pointer(&_isSimpleCountØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return nil
}
if (int32((*XFuncDef)((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11)+16*uintptr(i32(0)))).X1).X1) & i32(256)) == i32(0) {
return nil
}
if ((_pExpr.X2) & uint32(i32(16))) != 0 {
return nil
}
return _pTab
}
var _isSimpleCountØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_isSimpleCountØ00__func__Ø000[0], str(110491), 14)
}
func _explainSimpleCount(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pIdx *XIndex) {
var _1_bCover int32
var _1_zEqp *int8
if int32(_pParse.X54) == i32(2) {
_1_bCover = bool2int((_pIdx != nil) && ((((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) || (int32((uint32(_pIdx.X16)<>uint(i32(30))) != i32(2))))
_1_zEqp = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(110505), unsafe.Pointer(_pTab.X0), unsafe.Pointer(func() *int8 {
if _1_bCover != 0 {
return str(110523)
}
return str(0)
}()), unsafe.Pointer(func() *int8 {
if _1_bCover != 0 {
return (_pIdx.X0)
}
return str(0)
}()))
_sqlite3VdbeAddOp4(tls, (*TVdbe)(_pParse.X2), i32(165), _pParse.X58, i32(0), i32(0), _1_zEqp, i32(-1))
}
}
// Based on the contents of the AggInfo structure indicated by the first
// argument, this function checks if the following are true:
//
// * the query contains just a single aggregate function,
// * the aggregate function is either min() or max(), and
// * the argument to the aggregate function is a column value.
//
// If all of the above are true, then WHERE_ORDERBY_MIN or WHERE_ORDERBY_MAX
// is returned as appropriate. Also, *ppMinMax is set to point to the
// list of arguments passed to the aggregate before returning.
//
// Or, if the conditions above are not met, *ppMinMax is set to 0 and
// WHERE_ORDERBY_NORMAL is returned.
func _minMaxQuery(tls *crt.TLS, _pAggInfo *XAggInfo, _ppMinMax **XExprList) (r0 uint8) {
var _eRet int32
var _2_zFunc *int8
var _1_pEList *XExprList
var _1_pExpr *XExpr
_eRet = i32(0)
*_ppMinMax = nil
if (_pAggInfo.X12) != i32(1) {
goto _0
}
_1_pExpr = (*XExpr)((*TAggInfo_func)(unsafe.Pointer(uintptr(_pAggInfo.X11) + 16*uintptr(i32(0)))).X0)
_1_pEList = (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_1_pExpr.X6))))))
func() {
if int32(_1_pExpr.X0) != i32(153) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120460), unsafe.Pointer((*int8)(unsafe.Pointer(&_minMaxQueryØ00__func__Ø000))), unsafe.Pointer(str(96778)))
crt.X__builtin_abort(tls)
}
}()
if _1_pEList == nil || (_1_pEList.X0) != i32(1) || int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_1_pEList.X2)))))+20*uintptr(i32(0)))).X0).X0) != i32(154) {
goto _5
}
_2_zFunc = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_1_pExpr.X3)))))
if _sqlite3StrICmp(tls, _2_zFunc, str(7709)) == i32(0) {
_eRet = i32(1)
*_ppMinMax = _1_pEList
goto _8
}
if _sqlite3StrICmp(tls, _2_zFunc, str(7713)) == i32(0) {
_eRet = i32(2)
*_ppMinMax = _1_pEList
}
_8:
_5:
_0:
func() {
if (*_ppMinMax) != nil && ((*_ppMinMax).X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(120473), unsafe.Pointer((*int8)(unsafe.Pointer(&_minMaxQueryØ00__func__Ø000))), unsafe.Pointer(str(110546)))
crt.X__builtin_abort(tls)
}
}()
return uint8(_eRet)
}
var _minMaxQueryØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_minMaxQueryØ00__func__Ø000[0], str(110584), 12)
}
// If the inner loop was generated using a non-null pOrderBy argument,
// then the results were placed in a sorter. After the loop is terminated
// we need to run the sorter and output the results. The following
// routine generates the code needed to do that.
func _generateSortTail(tls *crt.TLS, _pParse *XParse, _p *XSelect, _pSort *XSortCtx, _nColumn int32, _pDest *XSelectDest) {
var _addrBreak, _addrContinue, _addr, _addrOnce, _iTab, _eDest, _iParm, _regRow, _regRowid, _iCol, _nKey, _iSortTab, _nSortData, _i, _bSeq, _4_regSortOut, _7_iRead int32
var _v *TVdbe
var _pOrderBy *XExprList
var _aOutEx *TExprList_item
_v = (*TVdbe)(_pParse.X2)
_addrBreak = _pSort.X6
_addrContinue = _sqlite3VdbeMakeLabel(tls, _v)
_addrOnce = i32(0)
_pOrderBy = (*XExprList)(_pSort.X0)
_eDest = int32(_pDest.X0)
_iParm = _pDest.X2
_aOutEx = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_p.X0).X2)))))
func() {
if _addrBreak >= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117761), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateSortTailØ00__func__Ø000))), unsafe.Pointer(str(110596)))
crt.X__builtin_abort(tls)
}
}()
if (_pSort.X4) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(14), _pSort.X3, _pSort.X4)
_sqlite3VdbeGoto(tls, _v, _addrBreak)
_sqlite3VdbeResolveLabel(tls, _v, _pSort.X4)
}
_iTab = _pSort.X2
if ((_eDest == i32(9)) || (_eDest == i32(13))) || (_eDest == i32(10)) {
_regRowid = i32(0)
_regRow = _pDest.X3
_nSortData = _nColumn
goto _6
}
_regRowid = _sqlite3GetTempReg(tls, _pParse)
_regRow = _sqlite3GetTempRange(tls, _pParse, _nColumn)
_nSortData = _nColumn
_6:
_nKey = (_pOrderBy.X0) - (_pSort.X1)
if (int32(_pSort.X7) & i32(1)) == 0 {
goto _7
}
_4_regSortOut = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_iSortTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
if (_pSort.X4) != 0 {
_addrOnce = _sqlite3VdbeAddOp0(tls, _v, i32(20))
}
_sqlite3VdbeAddOp3(tls, _v, i32(113), _iSortTab, _4_regSortOut, (_nKey+i32(1))+_nSortData)
if _addrOnce != 0 {
_sqlite3VdbeJumpHere(tls, _v, _addrOnce)
}
_addr = i32(1) + _sqlite3VdbeAddOp2(tls, _v, i32(35), _iTab, _addrBreak)
_codeOffset(tls, _v, _p.X5, _addrContinue)
_sqlite3VdbeAddOp3(tls, _v, i32(123), _iTab, _4_regSortOut, _iSortTab)
_bSeq = i32(0)
goto _10
_7:
_addr = i32(1) + _sqlite3VdbeAddOp2(tls, _v, i32(36), _iTab, _addrBreak)
_codeOffset(tls, _v, _p.X5, _addrContinue)
_iSortTab = _iTab
_bSeq = i32(1)
_10:
*func() *int32 { _i = i32(0); return &_iCol }() = _nKey + _bSeq
_11:
if _i >= _nSortData {
goto _14
}
if ((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 20*uintptr(_i))).X5))))).X0) != 0 {
_7_iRead = int32((*t43)(unsafe.Pointer((*t37)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 20*uintptr(_i))).X5))))).X0) - i32(1)
goto _16
}
_7_iRead = postInc1(&_iCol, int32(1))
_16:
_sqlite3VdbeAddOp3(tls, _v, i32(99), _iSortTab, _7_iRead, _regRow+_i)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(func() *int8 {
if ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 20*uintptr(_i))).X1) != nil {
return ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 20*uintptr(_i))).X1)
}
return ((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOutEx)) + 20*uintptr(_i))).X2)
}()))
_i += 1
goto _11
_14:
switch _eDest {
case i32(10):
goto _23
case i32(11):
goto _22
case i32(12):
goto _20
case i32(14):
goto _20
default:
goto _24
}
_20:
_sqlite3VdbeAddOp2(tls, _v, i32(117), _iParm, _regRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _iParm, _regRow, _regRowid)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
goto _25
_22:
func() {
if _nColumn != _sqlite3Strlen30(tls, _pDest.X1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117817), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateSortTailØ00__func__Ø000))), unsafe.Pointer(str(110608)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(101), _regRow, _nColumn, _regRowid, _pDest.X1, _nColumn)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _regRow, _nColumn)
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iParm, _regRowid, _regRow, _nColumn)
goto _25
_23:
goto _25
_24:
func() {
if _eDest != i32(9) && _eDest != i32(13) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(117830), unsafe.Pointer((*int8)(unsafe.Pointer(&_generateSortTailØ00__func__Ø000))), unsafe.Pointer(str(110650)))
crt.X__builtin_abort(tls)
}
}()
if _eDest == i32(9) {
_sqlite3VdbeAddOp2(tls, _v, i32(67), _pDest.X3, _nColumn)
_sqlite3ExprCacheAffinityChange(tls, _pParse, _pDest.X3, _nColumn)
goto _32
}
_sqlite3VdbeAddOp1(tls, _v, i32(16), _pDest.X2)
_32:
goto _25
_25:
if _regRowid == 0 {
goto _33
}
if _eDest == i32(11) {
_sqlite3ReleaseTempRange(tls, _pParse, _regRow, _nColumn)
goto _35
}
_sqlite3ReleaseTempReg(tls, _pParse, _regRow)
_35:
_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
_33:
_sqlite3VdbeResolveLabel(tls, _v, _addrContinue)
if (int32(_pSort.X7) & i32(1)) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(3), _iTab, _addr)
goto _37
}
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iTab, _addr)
_37:
if (_pSort.X3) != 0 {
_sqlite3VdbeAddOp1(tls, _v, i32(52), _pSort.X3)
}
_sqlite3VdbeResolveLabel(tls, _v, _addrBreak)
_ = _iCol
}
var _generateSortTailØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_generateSortTailØ00__func__Ø000[0], str(110692), 17)
}
// Argument pVector points to a vector expression - either a TK_VECTOR
// or TK_SELECT that returns more than one column. This function returns
// the register number of a register that contains the value of
// element iField of the vector.
//
// If pVector is a TK_SELECT expression, then code for it must have
// already been generated using the exprCodeSubselect() routine. In this
// case parameter regSelect should be the first in an array of registers
// containing the results of the sub-select.
//
// If pVector is of type TK_VECTOR, then code for the requested field
// is generated. In this case (*pRegFree) may be set to the number of
// a temporary register to be freed by the caller before returning.
//
// Before returning, output parameter (*ppExpr) is set to point to the
// Expr object corresponding to element iElem of the vector.
func _exprVectorRegister(tls *crt.TLS, _pParse *XParse, _pVector *XExpr, _iField int32, _regSelect int32, _ppExpr **XExpr, _pRegFree *int32) (r0 int32) {
var _op uint8
_op = _pVector.X0
func() {
if int32(_op) != i32(158) && int32(_op) != i32(157) && int32(_op) != i32(119) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91384), unsafe.Pointer((*int8)(unsafe.Pointer(&_exprVectorRegisterØ00__func__Ø000))), unsafe.Pointer(str(110709)))
crt.X__builtin_abort(tls)
}
}()
if int32(_op) == i32(157) {
*_ppExpr = _sqlite3VectorFieldSubexpr(tls, _pVector, _iField)
return (_pVector.X8) + _iField
}
if int32(_op) == i32(119) {
*_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)((*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X0).X2))))) + 20*uintptr(_iField))).X0)
return _regSelect + _iField
}
*_ppExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pVector.X6)))))).X2))))) + 20*uintptr(_iField))).X0)
return _sqlite3ExprCodeTemp(tls, _pParse, *_ppExpr, _pRegFree)
}
var _exprVectorRegisterØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_exprVectorRegisterØ00__func__Ø000[0], str(110759), 19)
}
// The first parameter (pDef) is a function implementation. The
// second parameter (pExpr) is the first argument to this function.
// If pExpr is a column in a virtual table, then let the virtual
// table implementation have an opportunity to overload the function.
//
// This routine is used to allow virtual table implementations to
// overload MATCH, LIKE, GLOB, and REGEXP operators.
//
// Return either the pDef argument (indicating no change) or a
// new FuncDef structure that is marked as ephemeral using the
// SQLITE_FUNC_EPHEM flag.
func _sqlite3VtabOverloadFunction(tls *crt.TLS, _db *Xsqlite3, _pDef *XFuncDef, _nArg int32, _pExpr *XExpr) (r0 *XFuncDef) {
var _rc int32
var _zLowerName *int8
var _pArg unsafe.Pointer
var _z *uint8
var _pTab *XTable
var _xSFunc func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
var _pNew *XFuncDef
var _pVtab *Xsqlite3_vtab
var _pMod *Xsqlite3_module
_xSFunc = nil
_pArg = nil
_rc = i32(0)
if func() int32 {
if _pExpr == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126040), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return _pDef
}
if int32(_pExpr.X0) != i32(152) {
return _pDef
}
_pTab = (*XTable)(_pExpr.X14)
if _pTab == nil {
return _pDef
}
if (_pTab.X16) == 0 {
return _pDef
}
_pVtab = (*Xsqlite3_vtab)(_sqlite3GetVTable(tls, _db, _pTab).X2)
func() {
if _pVtab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126046), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000))), unsafe.Pointer(str(110778)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3_module)(_pVtab.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126047), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabOverloadFunctionØ00__func__Ø000))), unsafe.Pointer(str(110787)))
crt.X__builtin_abort(tls)
}
}()
_pMod = (*Xsqlite3_module)(_pVtab.X0)
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32
}{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32
}{(_pMod.X18)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32
}{nil})) {
return _pDef
}
_zLowerName = _sqlite3DbStrDup(tls, _db, _pDef.X6)
if _zLowerName == nil {
goto _11
}
_z = (*uint8)(unsafe.Pointer(_zLowerName))
_12:
if (*_z) == 0 {
goto _15
}
*_z = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(*_z)))
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _12
_15:
_rc = (*(*func(*crt.TLS, *Xsqlite3_vtab, int32, *int8, *func(*crt.TLS, *Xsqlite3_context, int32, **XMem), *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32
}{(_pMod.X18)})))(tls, _pVtab, _nArg, _zLowerName, &_xSFunc, &_pArg)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zLowerName))
_11:
if _rc == i32(0) {
return _pDef
}
_pNew = (*XFuncDef)(_sqlite3DbMallocZero(tls, _db, uint64((u32(28)+uint32(_sqlite3Strlen30(tls, _pDef.X6)))+uint32(i32(1)))))
if _pNew == nil {
return _pDef
}
*_pNew = *_pDef
*(**int8)(unsafe.Pointer(&(_pNew.X6))) = (*int8)(unsafe.Pointer((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew)) + 28*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)((*XFuncDef)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew))+28*uintptr(i32(1))))), (unsafe.Pointer)(_pDef.X6), uint32(_sqlite3Strlen30(tls, _pDef.X6)+i32(1)))
*(*func(*crt.TLS, *Xsqlite3_context, int32, **XMem))(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&(_pNew.X4))))) = _xSFunc
*(*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2))) = _pArg
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X1)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
return _pNew
}
var _sqlite3VtabOverloadFunctionØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabOverloadFunctionØ00__func__Ø000[0], str(110805), 28)
}
// 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 _sqlite3MayAbort(tls *crt.TLS, _pParse *XParse) {
var _pToplevel *XParse
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
*(*uint8)(unsafe.Pointer(&(_pToplevel.X9))) = uint8(i32(1))
}
// 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 _sqlite3HaltConstraint(tls *crt.TLS, _pParse *XParse, _errCode int32, _onError int32, _p4 *int8, _p4type int8, _p5Errmsg uint8) {
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if (_errCode & i32(255)) != i32(19) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103850), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3HaltConstraintØ00__func__Ø000))), unsafe.Pointer(str(110833)))
crt.X__builtin_abort(tls)
}
}()
if _onError == i32(2) {
_sqlite3MayAbort(tls, _pParse)
}
_sqlite3VdbeAddOp4(tls, _v, i32(55), _errCode, _onError, i32(0), _p4, int32(_p4type))
_sqlite3VdbeChangeP5(tls, _v, uint16(_p5Errmsg))
}
var _sqlite3HaltConstraintØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3HaltConstraintØ00__func__Ø000[0], str(110867), 22)
}
// Prepare a virtual machine for execution for the first time after
// creating the virtual machine. This involves things such
// as allocating registers and initializing the program counter.
// After the VDBE has be prepped, it can be executed by one or more
// calls to sqlite3VdbeExec().
//
// This function may be called exactly once on each virtual machine.
// After this routine is called the VM has been "packaged" and is ready
// to run. After this routine is called, further calls to
// sqlite3VdbeAddOp() functions are prohibited. This routine disconnects
// the Vdbe from the Parse object that helped generate it so that the
// the Vdbe becomes an independent entity and the Parse object can be
// destroyed.
//
// Use the sqlite3VdbeRewind() procedure to restore a virtual machine back
// to its initial state after it has been run.
func _sqlite3VdbeMakeReady(tls *crt.TLS, _p *TVdbe, _pParse *XParse) {
var _nVar, _nMem, _nCursor, _nArg, _n int32
var _db *Xsqlite3
var _x TReusableSpace
func() {
if _p == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73360), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X27) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73361), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(41716)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73362), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110889)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X5) != uint32(i32(381479589)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73363), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(37642)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pParse != (*XParse)(_p.X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73364), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110899)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_p.X0)
func() {
if int32(_db.X17) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73366), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(1244)))
crt.X__builtin_abort(tls)
}
}()
_nVar = int32(_pParse.X52)
_nMem = _pParse.X18
_nCursor = _pParse.X17
_nArg = _pParse.X33
{
p := &_nMem
*p = (*p) + _nCursor
sink1 = *p
}
if (_nCursor == i32(0)) && (_nMem > i32(0)) {
_nMem += 1
}
_n = int32(((u32(24) * uint32(_p.X27)) + uint32(i32(7))) & uint32(i32(-8)))
*(**uint8)(unsafe.Pointer(&(_x.X0))) = (*uint8)(unsafe.Pointer(uintptr(_p.X17) + 1*uintptr(_n)))
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_x.X0))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73386), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110917)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_x.X1))) = ((_pParse.X20) - _n) & i32(-8)
func() {
if (_x.X1) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73388), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110948)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_x.X0))+1*uintptr(_x.X1)))))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73389), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMakeReadyØ00__func__Ø000))), unsafe.Pointer(str(110959)))
crt.X__builtin_abort(tls)
}
}()
_resolveP2Values(tls, _p, &_nArg)
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(uint8(bool2int(((_pParse.X8) != 0) && ((_pParse.X9) != 0)))), 64, 6)
if ((_pParse.X54) != 0) && (_nMem < i32(10)) {
_nMem = i32(10)
}
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 1, 0)
_23:
*(*int32)(unsafe.Pointer(&(_x.X2))) = i32(0)
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X18))))) = (*XMem)(_allocSpace(tls, &_x, _p.X18, int32(uint32(_nMem)*u32(48))))
*(**XMem)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X24))))) = (*XMem)(_allocSpace(tls, &_x, _p.X24, int32(uint32(_nVar)*u32(48))))
*(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X19))))) = (**XMem)(_allocSpace(tls, &_x, (unsafe.Pointer)(_p.X19), int32(uint32(_nArg)*u32(4))))
*(***XVdbeCursor)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_p.X23))))) = (**XVdbeCursor)(_allocSpace(tls, &_x, (unsafe.Pointer)(_p.X23), int32(uint32(_nCursor)*u32(4))))
if (_x.X2) == i32(0) {
goto _25
}
*(**uint8)(unsafe.Pointer(&(_x.X0))) = (*uint8)(store11((*unsafe.Pointer)(unsafe.Pointer(&(_p.X37))), _sqlite3DbMallocRawNN(tls, _db, uint64(_x.X2))))
*(*int32)(unsafe.Pointer(&(_x.X1))) = _x.X2
if (_db.X17) == 0 {
goto _23
}
_25:
*(**int32)(unsafe.Pointer(&(_p.X25))) = _pParse.X60
*(**int32)(unsafe.Pointer(&(_pParse.X60))) = nil
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(_pParse.X54), 12, 2)
if (_db.X17) != 0 {
*(*int16)(unsafe.Pointer(&(_p.X4))) = int16(i32(0))
*(*int32)(unsafe.Pointer(&(_p.X7))) = i32(0)
*(*int32)(unsafe.Pointer(&(_p.X6))) = i32(0)
goto _27
}
*(*int32)(unsafe.Pointer(&(_p.X7))) = _nCursor
*(*int16)(unsafe.Pointer(&(_p.X4))) = int16(_nVar)
_initMemArray(tls, (*XMem)(_p.X24), _nVar, _db, uint16(i32(1)))
*(*int32)(unsafe.Pointer(&(_p.X6))) = _nMem
_initMemArray(tls, (*XMem)(_p.X18), _nMem, _db, uint16(i32(128)))
crt.Xmemset(tls, (unsafe.Pointer)(_p.X23), i32(0), uint32(_nCursor)*u32(4))
_27:
_sqlite3VdbeRewind(tls, _p)
_ = _x
}
var _sqlite3VdbeMakeReadyØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMakeReadyØ00__func__Ø000[0], str(111000), 21)
}
// This routine is called after all opcodes have been inserted. It loops
// through all the opcodes and fixes up some details.
//
// (1) For each jump instruction with a negative P2 value (a label)
// resolve the P2 value to an actual address.
//
// (2) Compute the maximum number of arguments used by any SQL function
// and store that value in *pMaxFuncArgs.
//
// (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately
// indicate what the prepared statement actually does.
//
// (4) Initialize the p4.xAdvance pointer on opcodes that use it.
//
// (5) Reclaim the memory allocated for storing labels.
//
// This routine will only function correctly if the mkopcodeh.tcl generator
// script numbers the opcodes correctly. Changes to this routine must be
// coordinated with changes to mkopcodeh.tcl.
func _resolveP2Values(tls *crt.TLS, _p *TVdbe, _pMaxFuncArgs *int32) {
var _nMaxArgs, _8_n int32
var _aLabel *int32
var _pParse *XParse
var _pOp *XVdbeOp
_nMaxArgs = *_pMaxFuncArgs
_pParse = (*XParse)(_p.X3)
_aLabel = _pParse.X26
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 128, 7)
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 256, 8)
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17) + 24*uintptr((_p.X27)-i32(1))))
_0:
if int32(_pOp.X0) > i32(83) {
goto _2
}
switch int32(_pOp.X0) {
case i32(0):
goto _5
case i32(1):
goto _5
case i32(2):
goto _4
case i32(3):
goto _12
case i32(4):
goto _15
case i32(5):
goto _12
case i32(6):
goto _15
case i32(7):
goto _12
case i32(8):
goto _7
case i32(9):
goto _7
case i32(10):
goto _7
case i32(11):
goto _11
case i32(12):
goto _10
default:
goto _17
}
_4:
if (_pOp.X4) != i32(0) {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 128, 7)
}
_5:
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 256, 8)
goto _17
_7:
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 128, 7)
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 256, 8)
goto _17
_10:
if (_pOp.X4) > _nMaxArgs {
_nMaxArgs = _pOp.X4
}
goto _17
_11:
func() {
if int32((uintptr(unsafe.Pointer(_pOp))-uintptr(unsafe.Pointer((*XVdbeOp)(_p.X17))))/24) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72021), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111021)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp))+24*uintptr(i32(-1)))).X0) != i32(56) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72022), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111041)))
crt.X__builtin_abort(tls)
}
}()
_8_n = (*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOp)) + 24*uintptr(i32(-1)))).X3
if _8_n > _nMaxArgs {
_nMaxArgs = _8_n
}
goto _17
_12:
*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _sqlite3BtreeNext
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-14))
goto _17
_15:
*(*func(*crt.TLS, *XBtCursor, *int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))) = _sqlite3BtreePrevious
*(*int8)(unsafe.Pointer(&(_pOp.X1))) = int8(i32(-14))
goto _17
_17:
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3OpcodeProperty)) + 1*uintptr(_pOp.X0)))) & i32(1)) != i32(0)) && ((_pOp.X4) < i32(0)) {
func() {
if (i32(-1) - (_pOp.X4)) >= (_pParse.X25) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72043), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111068)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pOp.X4))) = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLabel)) + 4*uintptr(i32(-1)-(_pOp.X4))))
}
_2:
if _pOp == (*XVdbeOp)(_p.X17) {
goto _1
}
*(*uintptr)(unsafe.Pointer(&_pOp)) += uintptr(4294967272)
goto _0
_1:
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X0), (unsafe.Pointer)(_pParse.X26))
*(**int32)(unsafe.Pointer(&(_pParse.X26))) = nil
*(*int32)(unsafe.Pointer(&(_pParse.X25))) = i32(0)
*_pMaxFuncArgs = _nMaxArgs
func() {
if int32((uint32((_p.X32)>>uint(i32(8)))<>uint(i32(31))) == i32(0) && (_p.X33) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72054), unsafe.Pointer((*int8)(unsafe.Pointer(&_resolveP2ValuesØ00__func__Ø000))), unsafe.Pointer(str(111097)))
crt.X__builtin_abort(tls)
}
}()
}
var _resolveP2ValuesØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_resolveP2ValuesØ00__func__Ø000[0], str(111144), 16)
}
// Try to allocate nByte bytes of 8-byte aligned bulk memory for pBuf
// from the ReusableSpace object. Return a pointer to the allocated
// memory on success. If insufficient memory is available in the
// ReusableSpace object, increase the ReusableSpace.nNeeded
// value by the amount needed and return NULL.
//
// If pBuf is not initially NULL, that means that the memory has already
// been allocated by a prior call to this routine, so just return a copy
// of pBuf and leave ReusableSpace unchanged.
//
// This allocator is employed to repurpose unused slots at the end of the
// opcode array of prepared state for other memory needs of the prepared
// statement.
func _allocSpace(tls *crt.TLS, _p *TReusableSpace, _pBuf unsafe.Pointer, _nByte int32) (r0 unsafe.Pointer) {
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_p.X0))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73277), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocSpaceØ00__func__Ø000))), unsafe.Pointer(str(111160)))
crt.X__builtin_abort(tls)
}
}()
if _pBuf != nil {
goto _2
}
_nByte = (_nByte + i32(7)) & i32(-8)
if _nByte <= (_p.X1) {
{
p := (*int32)(unsafe.Pointer(&(_p.X1)))
*p = (*p) - _nByte
sink1 = *p
}
_pBuf = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 1*uintptr(_p.X1))))
goto _4
}
{
p := (*int32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) + _nByte
sink1 = *p
}
_4:
_2:
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(_pBuf)))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(73287), unsafe.Pointer((*int8)(unsafe.Pointer(&_allocSpaceØ00__func__Ø000))), unsafe.Pointer(str(111192)))
crt.X__builtin_abort(tls)
}
}()
return _pBuf
}
var _allocSpaceØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_allocSpaceØ00__func__Ø000[0], str(111219), 11)
}
// Generate VDBE code for a BEGIN statement.
func _sqlite3BeginTransaction(tls *crt.TLS, _pParse *XParse, _type int32) {
var _i int32
var _db *Xsqlite3
var _v *TVdbe
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103643), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000))), unsafe.Pointer(str(110889)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _db == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103645), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTransactionØ00__func__Ø000))), unsafe.Pointer(str(1201)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(22), str(24983), nil, nil) != 0 {
return
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
return
}
if _type == i32(7) {
goto _6
}
_i = i32(0)
_7:
if _i >= (_db.X5) {
goto _10
}
_sqlite3VdbeAddOp2(tls, _v, i32(2), _i, bool2int(_type == i32(9))+i32(1))
_sqlite3VdbeUsesBtree(tls, _v, _i)
_i += 1
goto _7
_10:
_6:
_sqlite3VdbeAddOp0(tls, _v, i32(1))
}
var _sqlite3BeginTransactionØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BeginTransactionØ00__func__Ø000[0], str(111230), 24)
}
// Generate VDBE code for a COMMIT statement.
func _sqlite3CommitTransaction(tls *crt.TLS, _pParse *XParse) {
var _v *TVdbe
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000))), unsafe.Pointer(str(110889)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pParse.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CommitTransactionØ00__func__Ø000))), unsafe.Pointer(str(111254)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(22), str(25030), nil, nil) != 0 {
return
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v != nil {
_sqlite3VdbeAddOp1(tls, _v, i32(1), i32(1))
}
}
var _sqlite3CommitTransactionØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CommitTransactionØ00__func__Ø000[0], str(111268), 25)
}
// Generate VDBE code for a ROLLBACK statement.
func _sqlite3RollbackTransaction(tls *crt.TLS, _pParse *XParse) {
var _v *TVdbe
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000))), unsafe.Pointer(str(110889)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*Xsqlite3)(_pParse.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103684), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RollbackTransactionØ00__func__Ø000))), unsafe.Pointer(str(111254)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(22), str(25041), nil, nil) != 0 {
return
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(1), i32(1), i32(1))
}
}
var _sqlite3RollbackTransactionØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RollbackTransactionØ00__func__Ø000[0], str(111293), 27)
}
// This function is called by the parser when it parses a command to create,
// release or rollback an SQL savepoint.
func _sqlite3Savepoint(tls *crt.TLS, _pParse *XParse, _op int32, _pName *XToken) {
var _zName *int8
var _1_v *TVdbe
_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pName)
if _zName == nil {
goto _0
}
_1_v = _sqlite3GetVdbe(tls, _pParse)
i32(0)
if (_1_v == nil) || _sqlite3AuthCheck(tls, _pParse, i32(32), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3SavepointØ00azØ001)) + 4*uintptr(_op))), _zName, nil) != 0 {
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zName))
return
}
_sqlite3VdbeAddOp4(tls, _1_v, i32(0), _op, i32(0), i32(0), _zName, i32(-1))
_0:
}
var _sqlite3SavepointØ00azØ001 [3]*int8
func init() {
_sqlite3SavepointØ00azØ001 = [3]*int8{str(24983), str(25060), str(25041)}
}
// Begin constructing a new table representation in memory. This is
// the first of several action routines that get called in response
// to a CREATE TABLE statement. In particular, this routine is called
// after seeing tokens "CREATE" and "TABLE" and the table name. The isTemp
// flag is true if the table should be stored in the auxiliary database
// file instead of in the main database file. This is normally the case
// when the "TEMP" or "TEMPORARY" keyword occurs in between
// CREATE and TABLE.
//
// The new table record is initialized and put in pParse->pNewTable.
// As more of the CREATE TABLE statement is parsed, additional action
// routines will be called to add more information to this record.
// At the end of the CREATE TABLE statement, the sqlite3EndTable() routine
// is called to complete the construction of the new table record.
func _sqlite3StartTable(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _isTemp int32, _isView int32, _isVirtual int32, _noErr int32) {
var _iDb, _16_addr1, _16_fileFormat, _16_reg1, _16_reg2, _16_reg3 int32
var _zName, _5_zDb, _8_zDb *int8
var _db *Xsqlite3
var _pTable *XTable
var _v *TVdbe
var _pName *XToken
_zName = nil
_db = (*Xsqlite3)(_pParse.X0)
if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) && (((*t21)(unsafe.Pointer(&(_db.X33))).X0) == i32(1)) {
_iDb = int32((*t21)(unsafe.Pointer(&(_db.X33))).X1)
_zName = _sqlite3DbStrDup(tls, _db, func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}())
_pName = _pName1
goto _5
}
_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
if _iDb < i32(0) {
return
}
if ((i32(1) != 0 && _isTemp != 0) && ((_pName2.X1) > uint32(i32(0)))) && (_iDb != i32(1)) {
_sqlite3ErrorMsg(tls, _pParse, str(111320))
return
}
if i32(1) != 0 && _isTemp != 0 {
_iDb = i32(1)
}
_zName = _sqlite3NameFromToken(tls, _db, _pName)
_5:
*(*XToken)(unsafe.Pointer(&(_pParse.X50))) = *_pName
if _zName == nil {
return
}
if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
goto _begin_table_error
}
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) == i32(1) {
_isTemp = i32(1)
}
func() {
if _isTemp != i32(0) && _isTemp != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100579), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(111361)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isView != i32(0) && _isView != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100580), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(111384)))
crt.X__builtin_abort(tls)
}
}()
_5_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
if _sqlite3AuthCheck(tls, _pParse, i32(18), func() *int8 {
if i32(1) != 0 && (_isTemp == i32(1)) {
return str(50007)
}
return str(50026)
}(), nil, _5_zDb) != 0 {
goto _begin_table_error
}
if (_isVirtual == 0) && _sqlite3AuthCheck(tls, _pParse, int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3StartTableØ00aCodeØ001)) + 1*uintptr(_isTemp+(i32(2)*_isView))))), _zName, nil, _5_zDb) != 0 {
goto _begin_table_error
}
if (_pParse.X55) != 0 {
goto _28
}
_8_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
goto _begin_table_error
}
_pTable = _sqlite3FindTable(tls, _db, _zName, _8_zDb)
if _pTable == nil {
goto _30
}
if _noErr == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(111407), unsafe.Pointer(_pName))
goto _32
}
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 && (_sqlite3Config.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100616), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(111431)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_32:
goto _begin_table_error
_30:
if _sqlite3FindIndex(tls, _db, _zName, _8_zDb) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(111460), unsafe.Pointer(_zName))
goto _begin_table_error
}
_28:
_pTable = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80))))
if _pTable == nil {
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100629), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = _sqlite3NomemError(tls, i32(100630))
*(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1
goto _begin_table_error
}
*(**int8)(unsafe.Pointer(&(_pTable.X0))) = _zName
*(*int16)(unsafe.Pointer(&(_pTable.X10))) = int16(i32(-1))
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTable.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
*(*uint32)(unsafe.Pointer(&(_pTable.X8))) = uint32(i32(1))
*(*int16)(unsafe.Pointer(&(_pTable.X12))) = int16(i32(200))
func() {
if i32(200) != int32(_sqlite3LogEst(tls, uint64(i32(1048576)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(48127)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)(_pParse.X63) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100639), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(24634)))
crt.X__builtin_abort(tls)
}
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = _pTable
if ((_pParse.X6) == 0) && (crt.Xstrcmp(tls, _zName, str(111495)) == i32(0)) {
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100648), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3StartTableØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XSchema)(_pTable.X20).X6))))) = _pTable
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 || store38(&_v, _sqlite3GetVdbe(tls, _pParse)) == nil {
goto _49
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
if _isVirtual != 0 {
_sqlite3VdbeAddOp0(tls, _v, i32(155))
}
_16_reg1 = store1((*int32)(unsafe.Pointer(&(_pParse.X31))), preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
_16_reg2 = store1((*int32)(unsafe.Pointer(&(_pParse.X32))), preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
_16_reg3 = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp3(tls, _v, i32(103), _iDb, _16_reg3, i32(2))
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
_16_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(21), _16_reg3)
_16_fileFormat = func() int32 {
if ((_db.X6) & i32(32768)) != i32(0) {
return i32(1)
}
return i32(4)
}()
_sqlite3VdbeAddOp3(tls, _v, i32(104), _iDb, i32(2), _16_fileFormat)
_sqlite3VdbeAddOp3(tls, _v, i32(104), _iDb, i32(5), int32(_db.X14))
_sqlite3VdbeJumpHere(tls, _v, _16_addr1)
if _isView != 0 || _isVirtual != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _16_reg2)
goto _55
}
*(*int32)(unsafe.Pointer(&(_pParse.X41))) = _sqlite3VdbeAddOp2(tls, _v, i32(137), _iDb, _16_reg2)
_55:
_sqlite3OpenMasterTable(tls, _pParse, _iDb)
_sqlite3VdbeAddOp2(tls, _v, i32(117), i32(0), _16_reg1)
_sqlite3VdbeAddOp4(tls, _v, i32(61), i32(6), _16_reg3, i32(0), (*int8)(unsafe.Pointer(&_sqlite3StartTableØ00nullRowØ002)), i32(-2))
_sqlite3VdbeAddOp3(tls, _v, i32(118), i32(0), _16_reg3, _16_reg1)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
_sqlite3VdbeAddOp0(tls, _v, i32(114))
_49:
return
_begin_table_error:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
}
// The table or view or trigger name is passed to this routine via tokens
// pName1 and pName2. If the table name was fully qualified, for example:
//
// CREATE TABLE xxx.yyy (...);
//
// Then pName1 is set to "xxx" and pName2 "yyy". On the other hand if
// the table name is not fully qualified, i.e.:
//
// CREATE TABLE yyy(...);
//
// Then pName1 is set to "yyy" and pName2 is "".
//
// This routine sets the *ppUnqual pointer to point at the token (pName1 or
// pName2) that stores the unqualified table name. The index of the
// database "xxx" is returned.
func _sqlite3TwoPartName(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pUnqual **XToken) (r0 int32) {
var _iDb int32
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pName2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100464), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000))), unsafe.Pointer(str(111511)))
crt.X__builtin_abort(tls)
}
}()
if (_pName2.X1) <= uint32(i32(0)) {
goto _2
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(111521))
return i32(-1)
}
*_pUnqual = _pName2
_iDb = _sqlite3FindDb(tls, _db, _pName1)
if _iDb < i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(111538), unsafe.Pointer(_pName1))
return i32(-1)
}
goto _5
_2:
func() {
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) != i32(0) && ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 && ((_db.X6)&i32(268435456)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TwoPartNameØ00__func__Ø000))), unsafe.Pointer(str(111558)))
crt.X__builtin_abort(tls)
}
}()
_iDb = int32((*t21)(unsafe.Pointer(&(_db.X33))).X1)
*_pUnqual = _pName1
_5:
return _iDb
}
var _sqlite3TwoPartNameØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TwoPartNameØ00__func__Ø000[0], str(111625), 19)
}
// 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 _sqlite3FindDb(tls *crt.TLS, _db *Xsqlite3, _pName *XToken) (r0 int32) {
var _i int32
var _zName *int8
_zName = _sqlite3NameFromToken(tls, _db, _pName)
_i = _sqlite3FindDbName(tls, _db, _zName)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
return _i
}
// 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.
func _sqlite3CheckObjectName(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
if (((((*t21)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X33))).X2) == 0) && (int32(_pParse.X6) == i32(0))) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(2048)) == i32(0))) && (i32(0) == Xsqlite3_strnicmp(tls, _zName, str(111644), i32(7))) {
_sqlite3ErrorMsg(tls, _pParse, str(111652), unsafe.Pointer(_zName))
return i32(1)
}
return i32(0)
}
var _sqlite3StartTableØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3StartTableØ00__func__Ø000[0], str(111694), 18)
}
var _sqlite3StartTableØ00aCodeØ001 [4]uint8
func init() {
_sqlite3StartTableØ00aCodeØ001 = [4]uint8{2, 4, 8, 6}
}
// 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 _sqlite3BeginWriteOperation(tls *crt.TLS, _pParse *XParse, _setStatement int32, _iDb int32) {
var _pToplevel *XParse
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
{
p := (*uint32)(unsafe.Pointer(&(_pToplevel.X29)))
*p = (*p) | (u32(1) << uint(_iDb))
sink5 = *p
}
{
p := (*uint8)(unsafe.Pointer(&(_pToplevel.X8)))
*p = uint8(int32(*p) | _setStatement)
sink2 = *p
}
}
// Open the sqlite_master table stored in database number iDb for
// writing. The table is opened using cursor 0.
func _sqlite3OpenMasterTable(tls *crt.TLS, _p *XParse, _iDb int32) {
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _p)
_sqlite3TableLock(tls, _p, _iDb, i32(1), uint8(i32(1)), str(50026))
_sqlite3VdbeAddOp4Int(tls, _v, i32(107), i32(0), i32(1), _iDb, i32(5))
if (_p.X17) == i32(0) {
*(*int32)(unsafe.Pointer(&(_p.X17))) = i32(1)
}
}
var _sqlite3StartTableØ00nullRowØ002 [6]int8
func init() {
_sqlite3StartTableØ00nullRowØ002 = [6]int8{6, 0, 0, 0, 0, 0}
}
// Disable lookaside memory allocation for objects that might be
// shared across database connections.
func _disableLookaside(tls *crt.TLS, _pParse *XParse) {
*(*uint8)(unsafe.Pointer(&(_pParse.X12))) += 1
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X58))).X0))) += 1
}
// 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 master 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_master table because we just
// connected to the database or because the sqlite_master table has
// recently changed, so the entry for this table already exists in
// the sqlite_master 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 _sqlite3EndTable(tls *crt.TLS, _pParse *XParse, _pCons *XToken, _pEnd *XToken, _tabOpts uint8, _pSelect *XSelect) {
var _iDb, _9_n, _12_regYield, _12_addrTop, _12_regRec, _12_regRowid, _12_addrInsLoop, _19_nName int32
var _9_zType, _9_zType2, _9_zStmt, _19_zName *int8
var _db *Xsqlite3
var _15_pDb *XDb
var _17_pSchema *XSchema
var _p, _12_pSelTab, _17_pOld *XTable
var _9_v *TVdbe
var _14_pEnd2 *XToken
var _pIdx *XIndex
var _12_dest XSelectDest
_db = (*Xsqlite3)(_pParse.X0)
if (_pEnd == nil) && (_pSelect == nil) {
return
}
func() {
if (_db.X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101544), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(23869)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XTable)(_pParse.X63)
if _p == nil {
return
}
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 && _pSelect != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101548), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(111712)))
crt.X__builtin_abort(tls)
}
}()
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
goto _8
}
*(*int32)(unsafe.Pointer(&(_p.X7))) = (*t21)(unsafe.Pointer(&(_db.X33))).X0
if (_p.X7) == i32(1) {
{
p := (*uint32)(unsafe.Pointer(&(_p.X9)))
*p = (*p) | uint32(i32(1))
sink5 = *p
}
}
_8:
if (int32(_tabOpts) & i32(32)) == 0 {
goto _10
}
if ((_p.X9) & uint32(i32(8))) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(111739))
return
}
if ((_p.X9) & uint32(i32(4))) == uint32(i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(111789), unsafe.Pointer(_p.X0))
goto _13
}
{
p := (*uint32)(unsafe.Pointer(&(_p.X9)))
*p = (*p) | uint32(i32(96))
sink5 = *p
}
_convertToWithoutRowidTable(tls, _pParse, _p)
_13:
_10:
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.X20))
if (*XExprList)(_p.X6) != nil {
_sqlite3ResolveSelfReference(tls, _pParse, _p, i32(4), nil, (*XExprList)(_p.X6))
}
_estimateTableWidth(tls, _p)
_pIdx = (*XIndex)(_p.X2)
_15:
if _pIdx == nil {
goto _18
}
_estimateIndexWidth(tls, _pIdx)
_pIdx = (*XIndex)(_pIdx.X5)
goto _15
_18:
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
goto _19
}
_9_v = _sqlite3GetVdbe(tls, _pParse)
if func() int32 {
if _9_v == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
_sqlite3VdbeAddOp1(tls, _9_v, i32(114), i32(0))
if (*XSelect)(_p.X3) == nil {
_9_zType = str(61730)
_9_zType2 = str(25071)
goto _24
}
_9_zType = str(111821)
_9_zType2 = str(25358)
_24:
if _pSelect == nil {
goto _25
}
_12_regYield = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_12_regRec = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_12_regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
func() {
if (_pParse.X17) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101653), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(111826)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3MayAbort(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _9_v, i32(107), i32(1), _pParse.X32, _iDb)
_sqlite3VdbeChangeP5(tls, _9_v, uint16(i32(16)))
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(2)
_12_addrTop = _sqlite3VdbeCurrentAddr(tls, _9_v) + i32(1)
_sqlite3VdbeAddOp3(tls, _9_v, i32(15), _12_regYield, i32(0), _12_addrTop)
_sqlite3SelectDestInit(tls, &_12_dest, i32(13), _12_regYield)
_sqlite3Select(tls, _pParse, _pSelect, &_12_dest)
_sqlite3VdbeEndCoroutine(tls, _9_v, _12_regYield)
_sqlite3VdbeJumpHere(tls, _9_v, _12_addrTop-i32(1))
if (_pParse.X16) != 0 {
return
}
_12_pSelTab = _sqlite3ResultSetOfSelect(tls, _pParse, _pSelect)
if _12_pSelTab == nil {
return
}
func() {
if (*XColumn)(_p.X1) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(111842)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_p.X11))) = _12_pSelTab.X11
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*XColumn)(_12_pSelTab.X1)
*(*int16)(unsafe.Pointer(&(_12_pSelTab.X11))) = int16(i32(0))
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_12_pSelTab.X1))))) = nil
_sqlite3DeleteTable(tls, _db, _12_pSelTab)
_12_addrInsLoop = _sqlite3VdbeAddOp1(tls, _9_v, i32(16), _12_dest.X2)
_sqlite3VdbeAddOp3(tls, _9_v, i32(101), _12_dest.X3, _12_dest.X4, _12_regRec)
_sqlite3TableAffinity(tls, _9_v, _p, i32(0))
_sqlite3VdbeAddOp2(tls, _9_v, i32(117), i32(1), _12_regRowid)
_sqlite3VdbeAddOp3(tls, _9_v, i32(118), i32(1), _12_regRec, _12_regRowid)
_sqlite3VdbeGoto(tls, _9_v, _12_addrInsLoop)
_sqlite3VdbeJumpHere(tls, _9_v, _12_addrInsLoop)
_sqlite3VdbeAddOp1(tls, _9_v, i32(114), i32(1))
_25:
if _pSelect != nil {
_9_zStmt = _createTableStmt(tls, _db, _p)
goto _33
}
_14_pEnd2 = func() *XToken {
if _tabOpts != 0 {
return (*XToken)(unsafe.Pointer(&(_pParse.X51)))
}
return _pEnd
}()
_9_n = int32((uintptr(unsafe.Pointer(_14_pEnd2.X0)) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0))) / 1)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_14_pEnd2.X0)) + 1*uintptr(i32(0))))) != i32(59) {
{
p := &_9_n
*p = int32(uint32(*p) + (_14_pEnd2.X1))
sink1 = *p
}
}
_9_zStmt = _sqlite3MPrintf(tls, _db, str(111853), unsafe.Pointer(_9_zType2), _9_n, unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0))
_33:
_sqlite3NestedParse(tls, _pParse, str(111868), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_9_zType), unsafe.Pointer(_p.X0), unsafe.Pointer(_p.X0), _pParse.X32, unsafe.Pointer(_9_zStmt), _pParse.X31)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_9_zStmt))
_sqlite3ChangeCookie(tls, _pParse, _iDb)
if ((_p.X9) & uint32(i32(8))) == uint32(i32(0)) {
goto _37
}
_15_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101721), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if (*XTable)((*XSchema)(_15_pDb.X4).X6) == nil {
_sqlite3NestedParse(tls, _pParse, str(111955), unsafe.Pointer(_15_pDb.X0))
}
_37:
_sqlite3VdbeAddParseSchemaOp(tls, _9_v, _iDb, _sqlite3MPrintf(tls, _db, str(111997), unsafe.Pointer(_p.X0)))
_19:
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
goto _41
}
_17_pSchema = (*XSchema)(_p.X20)
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101742), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_17_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_17_pSchema.X2))), _p.X0, (unsafe.Pointer)(_p)))
if _17_pOld != nil {
func() {
if _p != _17_pOld {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101745), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(112031)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OomFault(tls, _db)
return
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = nil
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
if (*XSelect)(_p.X3) != nil {
goto _47
}
_19_zName = (*XToken)(unsafe.Pointer(&(_pParse.X50))).X0
func() {
if _pSelect != nil || _pCons == nil || _pEnd == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101756), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3EndTableØ00__func__Ø000))), unsafe.Pointer(str(112039)))
crt.X__builtin_abort(tls)
}
}()
if (_pCons.X0) == nil {
_pCons = _pEnd
}
_19_nName = int32((uintptr(unsafe.Pointer(_pCons.X0)) - uintptr(unsafe.Pointer(_19_zName))) / 1)
*(*int32)(unsafe.Pointer(&(_p.X15))) = i32(13) + _sqlite3Utf8CharLen(tls, _19_zName, _19_nName)
_47:
_41:
_ = _12_dest
}
var _sqlite3EndTableØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3EndTableØ00__func__Ø000[0], str(112065), 16)
}
// This routine runs at the end of parsing a CREATE TABLE statement that
// has a WITHOUT ROWID clause. The job of this routine is to convert both
// internal schema data structures and the generated VDBE code so that they
// are appropriate for a WITHOUT ROWID table instead of a rowid table.
// Changes include:
//
// (1) Set all columns of the PRIMARY KEY schema object to be NOT NULL.
// (2) Convert the OP_CreateTable into an OP_CreateIndex. There is
// no rowid btree for a WITHOUT ROWID. Instead, the canonical
// data storage is a covering index btree.
// (3) Bypass the creation of the sqlite_master table entry
// for the PRIMARY KEY as the primary key index is now
// identified by the sqlite_master table entry of the table itself.
// (4) Set the Index.tnum of the PRIMARY KEY Index object in the
// schema to the rootpage from the main table.
// (5) Add all table columns to the PRIMARY KEY Index object
// so that the PRIMARY KEY is a covering index. The surplus
// columns are part of KeyInfo.nXField and are not used for
// sorting or lookup or uniqueness checks.
// (6) Replace the rowid tail on all automatically generated UNIQUE
// indices with the PRIMARY KEY columns.
//
// For virtual tables, only (1) is performed.
func _convertToWithoutRowidTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
var _nPk, _i, _j, _11_n int32
var _5_ipkToken XToken
var _db *Xsqlite3
var _v *TVdbe
var _5_pList *XExprList
var _pIdx, _pPk *XIndex
_db = (*Xsqlite3)(_pParse.X0)
_v = (*TVdbe)(_pParse.X2)
if ((*t21)(unsafe.Pointer(&(_db.X33))).X4) != 0 {
goto _0
}
_i = i32(0)
_1:
if _i >= int32(_pTab.X11) {
goto _4
}
if (int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X6) & i32(1)) != i32(0) {
*(*uint8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_i))).X3))) = uint8(i32(2))
}
_i += 1
goto _1
_4:
_0:
if (_pParse.X55) != 0 {
return
}
if (_pParse.X41) != 0 {
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101409), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pParse.X41), uint8(i32(136)))
}
if int32(_pTab.X10) < i32(0) {
goto _10
}
_sqlite3TokenInit(tls, &_5_ipkToken, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_pTab.X10))).X0)
_5_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, i32(27), &_5_ipkToken, i32(0)))
if _5_pList == nil {
return
}
*(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_5_pList.X2))))) + 20*uintptr(i32(0)))).X3))) = _pParse.X53
func() {
if (*XTable)(_pParse.X63) != _pTab {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101424), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112081)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _5_pList, int32(_pTab.X14), nil, nil, i32(0), i32(0), uint8(i32(2)))
if (_db.X17) != 0 {
return
}
_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
*(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(i32(-1))
goto _15
_10:
_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
if _v != nil {
func() {
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101438), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(49896)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeChangeOpcode(tls, _v, uint32(_pPk.X11), uint8(i32(13)))
}
_i = store1(&_j, i32(1))
_19:
if _i >= int32(_pPk.X13) {
goto _22
}
if _hasColumn(tls, _pPk.X1, _j, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) != 0 {
*(*uint16)(unsafe.Pointer(&(_pPk.X14))) -= 1
goto _24
}
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(postInc1(&_j, int32(1))))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))
_24:
_i += 1
goto _19
_22:
*(*uint16)(unsafe.Pointer(&(_pPk.X13))) = uint16(_j)
_15:
func() {
if _pPk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101456), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(41994)))
crt.X__builtin_abort(tls)
}
}()
storebits3((*int8)(unsafe.Pointer(&(_pPk.X16))), int8(i32(1)), 32, 5)
if ((*t21)(unsafe.Pointer(&(_db.X33))).X4) == 0 {
storebits3((*int8)(unsafe.Pointer(&(_pPk.X16))), int8(i32(1)), 8, 3)
}
_nPk = int32(_pPk.X13)
*(*int32)(unsafe.Pointer(&(_pPk.X11))) = _pTab.X7
_pIdx = (*XIndex)(_pTab.X2)
_28:
if _pIdx == nil {
goto _31
}
if int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2) {
goto _29
}
_i = store1(&_11_n, i32(0))
_33:
if _i >= _nPk {
goto _36
}
if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) == 0 {
_11_n += 1
}
_i += 1
goto _33
_36:
if _11_n == i32(0) {
*(*uint16)(unsafe.Pointer(&(_pIdx.X14))) = _pIdx.X13
goto _29
}
if _resizeIndexObject(tls, _db, _pIdx, int32(_pIdx.X13)+_11_n) != 0 {
return
}
*func() *int32 { _i = i32(0); return &_j }() = int32(_pIdx.X13)
_40:
if _i >= _nPk {
goto _43
}
if _hasColumn(tls, _pIdx.X1, int32(_pIdx.X13), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))) == 0 {
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j))) = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_j))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 4*uintptr(_i)))
_j += 1
}
_i += 1
goto _40
_43:
func() {
if int32(_pIdx.X14) < (int32(_pIdx.X13) + _11_n) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101486), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112105)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pIdx.X14) < _j {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101487), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112136)))
crt.X__builtin_abort(tls)
}
}()
_29:
_pIdx = (*XIndex)(_pIdx.X5)
goto _28
_31:
if _nPk >= int32(_pTab.X11) {
goto _49
}
if _resizeIndexObject(tls, _db, _pPk, int32(_pTab.X11)) != 0 {
return
}
*func() *int32 { _i = i32(0); return &_j }() = _nPk
_51:
if _i >= int32(_pTab.X11) {
goto _54
}
if _hasColumn(tls, _pPk.X1, _j, _i) == 0 {
func() {
if _j >= int32(_pPk.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101496), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112153)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_j))) = int16(_i)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 4*uintptr(_j))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
_j += 1
}
_i += 1
goto _51
_54:
func() {
if int32(_pPk.X14) != _j {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101502), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112168)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pTab.X11) != _j {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101503), unsafe.Pointer((*int8)(unsafe.Pointer(&_convertToWithoutRowidTableØ00__func__Ø000))), unsafe.Pointer(str(112184)))
crt.X__builtin_abort(tls)
}
}()
goto _62
_49:
*(*uint16)(unsafe.Pointer(&(_pPk.X14))) = uint16(_pTab.X11)
_62:
_ = _5_ipkToken
}
var _convertToWithoutRowidTableØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_convertToWithoutRowidTableØ00__func__Ø000[0], str(112198), 27)
}
// 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 _sqlite3CreateIndex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pTblName *XSrcList, _pList *XExprList, _onError int32, _pStart *XToken, _pPIWhere *XExpr, _sortOrder int32, _ifNotExist int32, _idxType uint8) {
var _nName, _i, _j, _sortOrderMask, _iDb, _nExtra, _nExtraCol, _20_n, _34_requestedSortOrder, _42_nColl, _46_x, _53_k, _62_iMem, _63_n int32
var _zName, _zExtra, _23_zDb, _34_zColl, _54_z1, _54_z2, _62_zStmt *int8
var _26_prevCol XToken
var _db *Xsqlite3
var _pDb *XDb
var _pTab *XTable
var _62_v *TVdbe
var _pName *XToken
var _37_pCopy *XExprList
var _pListItem *TExprList_item
var _28_pExpr, _34_pCExpr *XExpr
var _pIndex, _pPk, _20_pLoop, _52_pIdx, _59_p, _68_pOther *XIndex
var _sFix XDbFixer
_pTab = nil
_pIndex = nil
_zName = nil
_db = (*Xsqlite3)(_pParse.X0)
_pName = nil
_nExtra = i32(0)
_zExtra = nil
_pPk = nil
if ((_db.X17) != 0) || ((_pParse.X16) > i32(0)) {
goto _exit_create_index
}
if ((_pParse.X55) != 0) && (int32(_idxType) != i32(2)) {
goto _exit_create_index
}
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
goto _exit_create_index
}
if _pTblName == nil {
goto _5
}
func() {
if _pName1 == nil || _pName2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112225)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
if _iDb < i32(0) {
goto _exit_create_index
}
func() {
if _pName == nil || (_pName.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102641), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112242)))
crt.X__builtin_abort(tls)
}
}()
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
goto _13
}
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTblName)
if (((_pName2.X1) == uint32(i32(0))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4)) {
_iDb = i32(1)
}
_13:
_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(112260), _pName)
if _sqlite3FixSrcList(tls, &_sFix, _pTblName) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102660), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
}
_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTblName.X2)))))+68*uintptr(i32(0)))))
func() {
if int32(_db.X17) != i32(0) && _pTab != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102663), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112266)))
crt.X__builtin_abort(tls)
}
}()
if _pTab == nil {
goto _exit_create_index
}
if (_iDb == i32(1)) && ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X4) != (*XSchema)(_pTab.X20)) {
_sqlite3ErrorMsg(tls, _pParse, str(112297), unsafe.Pointer(_pTab.X0))
goto _exit_create_index
}
if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
}
goto _25
_5:
func() {
if _pName != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102673), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112347)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pStart != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112356)))
crt.X__builtin_abort(tls)
}
}()
_pTab = (*XTable)(_pParse.X63)
if _pTab == nil {
goto _exit_create_index
}
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_25:
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102681), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pParse.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102682), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112366)))
crt.X__builtin_abort(tls)
}
}()
if ((Xsqlite3_strnicmp(tls, _pTab.X0, str(111644), i32(7)) == i32(0)) && (int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0))) && (Xsqlite3_strnicmp(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTab.X0))+1*uintptr(i32(7)))), str(112382), i32(9)) != i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(112392), unsafe.Pointer(_pTab.X0))
goto _exit_create_index
}
if (*XSelect)(_pTab.X3) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(112420))
goto _exit_create_index
}
if (_pTab.X16) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(112445))
goto _exit_create_index
}
if _pName == nil {
goto _40
}
_zName = _sqlite3NameFromToken(tls, _db, _pName)
if _zName == nil {
goto _exit_create_index
}
func() {
if (_pName.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102721), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112479)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
goto _exit_create_index
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
goto _45
}
if _sqlite3FindTable(tls, _db, _zName, nil) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(112491), unsafe.Pointer(_zName))
goto _exit_create_index
}
_45:
if _sqlite3FindIndex(tls, _db, _zName, _pDb.X0) == nil {
goto _47
}
if _ifNotExist == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(112525), unsafe.Pointer(_zName))
goto _49
}
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102735), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112549)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_49:
goto _exit_create_index
_47:
goto _52
_40:
*func() *int32 { _20_pLoop = (*XIndex)(_pTab.X2); return &_20_n }() = i32(1)
_53:
if _20_pLoop == nil {
goto _56
}
*func() *int32 { _20_pLoop = (*XIndex)(_20_pLoop.X5); return &_20_n }() += 1
goto _53
_56:
_zName = _sqlite3MPrintf(tls, _db, str(112564), unsafe.Pointer(_pTab.X0), _20_n)
if _zName == nil {
goto _exit_create_index
}
if (_pParse.X55) != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(i32(7)))) += 1
}
_52:
_23_zDb = _pDb.X0
if _sqlite3AuthCheck(tls, _pParse, i32(18), func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}(), nil, _23_zDb) != 0 {
goto _exit_create_index
}
_i = i32(1)
if i32(1) != 0 && (_iDb == i32(1)) {
_i = i32(3)
}
if _sqlite3AuthCheck(tls, _pParse, _i, _zName, _pTab.X0, _23_zDb) != 0 {
goto _exit_create_index
}
if _pList != nil {
goto _66
}
_sqlite3TokenInit(tls, &_26_prevCol, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(int32(_pTab.X11)-i32(1)))).X0)
_pList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3ExprAlloc(tls, _db, i32(27), &_26_prevCol, i32(0)))
if _pList == nil {
goto _exit_create_index
}
func() {
if (_pList.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102783), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112587)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprListSetSortOrder(tls, _pList, _sortOrder)
goto _70
_66:
_sqlite3ExprListCheckLength(tls, _pParse, _pList, str(112260))
_70:
_i = i32(0)
_71:
if _i >= (_pList.X0) {
goto _74
}
_28_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_i))).X0)
func() {
if _28_pExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102794), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(43636)))
crt.X__builtin_abort(tls)
}
}()
if int32(_28_pExpr.X0) == i32(94) {
{
p := &_nExtra
*p = (*p) + (i32(1) + _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_28_pExpr.X3)))))))
sink1 = *p
}
}
_i += 1
goto _71
_74:
_nName = _sqlite3Strlen30(tls, _zName)
_nExtraCol = func() int32 {
if _pPk != nil {
return int32(_pPk.X13)
}
return i32(1)
}()
_pIndex = _sqlite3AllocateIndexObject(tls, _db, int16((_pList.X0)+_nExtraCol), (_nName+_nExtra)+i32(1), &_zExtra)
if (_db.X17) != 0 {
goto _exit_create_index
}
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pIndex.X2))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102810), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112603)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pIndex.X8))))-uintptr(unsafe.Pointer(nil)))/1) & i32(7)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102811), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112645)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&(_pIndex.X0))) = _zExtra
{
p := &_zExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_nName+i32(1))))
sink0 = *p
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_pIndex.X0), (unsafe.Pointer)(_zName), uint32(_nName+i32(1)))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X3))))) = _pTab
*(*uint8)(unsafe.Pointer(&(_pIndex.X15))) = uint8(_onError)
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(bool2int(_onError != i32(0))), 8, 3)
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(_idxType), 3, 0)
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X6))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
*(*uint16)(unsafe.Pointer(&(_pIndex.X13))) = uint16(_pList.X0)
if _pPIWhere != nil {
_sqlite3ResolveSelfReference(tls, _pParse, _pTab, i32(2), _pPIWhere, nil)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X9))))) = _pPIWhere
_pPIWhere = nil
}
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102826), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if int32((*XSchema)(_pDb.X4).X7) >= i32(4) {
_sortOrderMask = i32(-1)
goto _89
}
_sortOrderMask = i32(0)
_89:
*func() **TExprList_item { _i = i32(0); return &_pListItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))
_90:
if _i >= (_pList.X0) {
goto _93
}
_sqlite3StringToId(tls, (*XExpr)(_pListItem.X0))
_sqlite3ResolveSelfReference(tls, _pParse, _pTab, i32(32), (*XExpr)(_pListItem.X0), nil)
if (_pParse.X16) != 0 {
goto _exit_create_index
}
_34_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)(_pListItem.X0))
if int32(_34_pCExpr.X0) == i32(152) {
goto _95
}
if _pTab == (*XTable)(_pParse.X63) {
_sqlite3ErrorMsg(tls, _pParse, str(112682))
goto _exit_create_index
}
if (*XExprList)(_pIndex.X10) != nil {
goto _97
}
_37_pCopy = _sqlite3ExprListDup(tls, _db, _pList, i32(0))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X10))))) = _37_pCopy
if (_db.X17) == 0 {
func() {
if _37_pCopy == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102864), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112743)))
crt.X__builtin_abort(tls)
}
}()
_pListItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_37_pCopy.X2))))) + 20*uintptr(_i)))
}
_97:
_j = i32(-2)
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-2))
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 8, 3)
goto _101
_95:
_j = int32(_34_pCExpr.X9)
func() {
if _j > i32(32767) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102873), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112752)))
crt.X__builtin_abort(tls)
}
}()
if _j < i32(0) {
_j = int32(_pTab.X10)
goto _106
}
if int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_j))).X3) == i32(0) {
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 8, 3)
}
_106:
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(_j)
_101:
_34_zColl = nil
if int32((*XExpr)(_pListItem.X0).X0) == i32(94) {
_34_zColl = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_pListItem.X0).X3)))))
_42_nColl = _sqlite3Strlen30(tls, _34_zColl) + i32(1)
func() {
if _nExtra < _42_nColl {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112762)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_34_zColl), uint32(_42_nColl))
_34_zColl = _zExtra
{
p := &_zExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_42_nColl)))
sink0 = *p
}
{
p := &_nExtra
*p = (*p) - _42_nColl
sink1 = *p
}
goto _111
}
if _j >= i32(0) {
_34_zColl = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_j))).X2
}
_111:
if _34_zColl == nil {
_34_zColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
}
if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0) && (_sqlite3LocateCollSeq(tls, _pParse, _34_zColl) == nil) {
goto _exit_create_index
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_i))) = _34_zColl
_34_requestedSortOrder = int32(_pListItem.X3) & _sortOrderMask
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_i))) = uint8(_34_requestedSortOrder)
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pListItem }())) += uintptr(20)
goto _90
_93:
if _pPk == nil {
goto _115
}
_j = i32(0)
_116:
if _j >= int32(_pPk.X13) {
goto _119
}
_46_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_j))))
func() {
if _46_x < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102910), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(109743)))
crt.X__builtin_abort(tls)
}
}()
if _hasColumn(tls, _pIndex.X1, int32(_pIndex.X13), _46_x) != 0 {
*(*uint16)(unsafe.Pointer(&(_pIndex.X14))) -= 1
goto _123
}
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(_46_x)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_i))) = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 4*uintptr(_j)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X7)) + 1*uintptr(_i))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X7)) + 1*uintptr(_j)))
_i += 1
_123:
_j += 1
goto _116
_119:
func() {
if _i != int32(_pIndex.X14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102920), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112776)))
crt.X__builtin_abort(tls)
}
}()
goto _126
_115:
*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i))) = int16(i32(-1))
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_i))) = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
_126:
_sqlite3DefaultRowEst(tls, _pIndex)
if (*XTable)(_pParse.X63) == nil {
_estimateIndexWidth(tls, _pIndex)
}
func() {
if ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) && int32(_pTab.X10) >= i32(0) && int32(_sqlite3ColumnOfIndex(tls, _pIndex, _pTab.X10)) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112795)))
crt.X__builtin_abort(tls)
}
}()
if _pTblName == nil || int32(_pIndex.X14) < int32(_pTab.X11) {
goto _133
}
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(1)), 32, 5)
_j = i32(0)
_134:
if _j >= int32(_pTab.X11) {
goto _137
}
if _j == int32(_pTab.X10) {
goto _135
}
if int32(_sqlite3ColumnOfIndex(tls, _pIndex, int16(_j))) >= i32(0) {
goto _135
}
storebits3((*int8)(unsafe.Pointer(&(_pIndex.X16))), int8(i32(0)), 32, 5)
goto _137
_135:
_j += 1
goto _134
_137:
_133:
if _pTab != (*XTable)(_pParse.X63) {
goto _140
}
_52_pIdx = (*XIndex)(_pTab.X2)
_141:
if _52_pIdx == nil {
goto _144
}
func() {
if int32(_52_pIdx.X15) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102967), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112875)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32(_52_pIdx.X16)<>uint(i32(30))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112895)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pIndex.X15) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112932)))
crt.X__builtin_abort(tls)
}
}()
if int32(_52_pIdx.X13) != int32(_pIndex.X13) {
goto _142
}
_53_k = i32(0)
_152:
if _53_k >= int32(_52_pIdx.X13) {
goto _155
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X1)) + 2*uintptr(_53_k)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112954)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X1)) + 2*uintptr(_53_k)))) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_53_k)))) {
goto _155
}
_54_z1 = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_52_pIdx.X8)) + 4*uintptr(_53_k)))
_54_z2 = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_53_k)))
if _sqlite3StrICmp(tls, _54_z1, _54_z2) != 0 {
goto _155
}
_53_k += 1
goto _152
_155:
if _53_k != int32(_52_pIdx.X13) {
goto _160
}
if int32(_52_pIdx.X15) == int32(_pIndex.X15) {
goto _161
}
if int32(_52_pIdx.X15) != i32(10) && int32(_pIndex.X15) != i32(10) {
_sqlite3ErrorMsg(tls, _pParse, str(112975), i32(0))
}
if int32(_52_pIdx.X15) == i32(10) {
*(*uint8)(unsafe.Pointer(&(_52_pIdx.X15))) = _pIndex.X15
}
_161:
if int32(_idxType) == i32(2) {
storebits3((*int8)(unsafe.Pointer(&(_52_pIdx.X16))), int8(_idxType), 3, 0)
}
goto _exit_create_index
_160:
_142:
_52_pIdx = (*XIndex)(_52_pIdx.X5)
goto _141
_144:
_140:
func() {
if (_pParse.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103007), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(112366)))
crt.X__builtin_abort(tls)
}
}()
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
goto _168
}
func() {
if (_pParse.X55) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103010), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(113017)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_pIndex.X6)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103011), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(113034)))
crt.X__builtin_abort(tls)
}
}()
_59_p = (*XIndex)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pIndex.X6).X3))), _pIndex.X0, (unsafe.Pointer)(_pIndex)))
if _59_p != nil {
func() {
if _59_p != _pIndex {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103015), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateIndexØ00__func__Ø000))), unsafe.Pointer(str(113081)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OomFault(tls, _db)
goto _exit_create_index
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2)
sink1 = *p
}
if _pTblName != nil {
*(*int32)(unsafe.Pointer(&(_pIndex.X11))) = (*t21)(unsafe.Pointer(&(_db.X33))).X0
}
goto _179
_168:
if ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) && _pTblName == nil {
goto _179
}
_62_iMem = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_62_v = _sqlite3GetVdbe(tls, _pParse)
if _62_v == nil {
goto _exit_create_index
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
*(*int32)(unsafe.Pointer(&(_pIndex.X11))) = _sqlite3VdbeAddOp0(tls, _62_v, i32(164))
_sqlite3VdbeAddOp2(tls, _62_v, i32(136), _iDb, _62_iMem)
if _pStart == nil {
goto _181
}
_63_n = int32(uint32(int32((uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X51))).X0))-uintptr(unsafe.Pointer(_pName.X0)))/1)) + ((*XToken)(unsafe.Pointer(&(_pParse.X51))).X1))
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pName.X0)) + 1*uintptr(_63_n-i32(1))))) == i32(59) {
_63_n -= 1
}
_62_zStmt = _sqlite3MPrintf(tls, _db, str(113091), unsafe.Pointer(func() *int8 {
if _onError == i32(0) {
return str(0)
}
return str(113111)
}()), _63_n, unsafe.Pointer(_pName.X0))
goto _185
_181:
_62_zStmt = nil
_185:
_sqlite3NestedParse(tls, _pParse, str(113119), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pIndex.X0), unsafe.Pointer(_pTab.X0), _62_iMem, unsafe.Pointer(_62_zStmt))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_62_zStmt))
if _pTblName != nil {
_sqlite3RefillIndex(tls, _pParse, _pIndex, _62_iMem)
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_sqlite3VdbeAddParseSchemaOp(tls, _62_v, _iDb, _sqlite3MPrintf(tls, _db, str(113167), unsafe.Pointer(_pIndex.X0)))
_sqlite3VdbeAddOp0(tls, _62_v, i32(153))
}
_sqlite3VdbeJumpHere(tls, _62_v, _pIndex.X11)
_179:
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 && _pTblName != nil {
goto _exit_create_index
}
if ((_onError != i32(5)) || ((*XIndex)(_pTab.X2) == nil)) || (int32((*XIndex)(_pTab.X2).X15) == i32(5)) {
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X5))))) = (*XIndex)(_pTab.X2)
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X2))))) = _pIndex
goto _192
}
_68_pOther = (*XIndex)(_pTab.X2)
_193:
if ((*XIndex)(_68_pOther.X5) != nil) && (int32((*XIndex)(_68_pOther.X5).X15) != i32(5)) {
_68_pOther = (*XIndex)(_68_pOther.X5)
goto _193
}
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pIndex.X5))))) = (*XIndex)(_68_pOther.X5)
*(**XIndex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_68_pOther.X5))))) = _pIndex
_192:
_pIndex = nil
_exit_create_index:
if _pIndex != nil {
_freeIndex(tls, _db, _pIndex)
}
_sqlite3ExprDelete(tls, _db, _pPIWhere)
_sqlite3ExprListDelete(tls, _db, _pList)
_sqlite3SrcListDelete(tls, _db, _pTblName)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
_ = _sFix
_ = _26_prevCol
}
var _sqlite3CreateIndexØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CreateIndexØ00__func__Ø000[0], str(113194), 19)
}
// While a SrcList can in general represent multiple tables and subqueries
// (as in the FROM clause of a SELECT statement) in this case it contains
// the name of a single table, as one might find in an INSERT, DELETE,
// or UPDATE statement. Look up that table in the symbol table and
// return a pointer. Set an error message and return NULL if the table
// name is not found or if any other error occurs.
//
// The following fields are initialized appropriate in pSrc:
//
// pSrc->a[0].pTab Pointer to the Table object
// pSrc->a[0].pIndex Pointer to the INDEXED BY index, if there is one
//
func _sqlite3SrcListLookup(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) (r0 *XTable) {
var _pTab *XTable
var _pItem *TSrcList_item
_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))
func() {
if _pItem == nil || (_pSrc.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListLookupØ00__func__Ø000))), unsafe.Pointer(str(113213)))
crt.X__builtin_abort(tls)
}
}()
_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pItem)
_sqlite3DeleteTable(tls, (*Xsqlite3)(_pParse.X0), (*XTable)(_pItem.X4))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X4))))) = _pTab
if _pTab != nil {
*(*uint32)(unsafe.Pointer(&(_pTab.X8))) += 1
}
if _sqlite3IndexedByLookup(tls, _pParse, _pItem) != 0 {
_pTab = nil
}
return _pTab
}
var _sqlite3SrcListLookupØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListLookupØ00__func__Ø000[0], str(113236), 21)
}
// Initialize a DbFixer structure. This routine must be called prior
// to passing the structure to one of the sqliteFixAAAA() routines below.
func _sqlite3FixInit(tls *crt.TLS, _pFix *XDbFixer, _pParse *XParse, _iDb int32, _zType *int8, _pName *XToken) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (_db.X5) <= _iDb {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99270), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FixInitØ00__func__Ø000))), unsafe.Pointer(str(113257)))
crt.X__builtin_abort(tls)
}
}()
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X0))))) = _pParse
*(**int8)(unsafe.Pointer(&(_pFix.X3))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X1))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
*(**int8)(unsafe.Pointer(&(_pFix.X4))) = _zType
*(**XToken)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFix.X5))))) = _pName
*(*int32)(unsafe.Pointer(&(_pFix.X2))) = bool2int(_iDb == i32(1))
}
var _sqlite3FixInitØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FixInitØ00__func__Ø000[0], str(113269), 15)
}
// 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 _sqlite3FixSrcList(tls *crt.TLS, _pFix *XDbFixer, _pList *XSrcList) (r0 int32) {
var _i int32
var _zDb *int8
var _pItem *TSrcList_item
if func() int32 {
if _pList == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99301), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FixSrcListØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return i32(0)
}
_zDb = _pFix.X3
*func() **TSrcList_item { _i = i32(0); return &_pItem }() = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_pList.X2)))))
_3:
if _i >= (_pList.X0) {
goto _6
}
if (_pFix.X2) != i32(0) {
goto _7
}
if ((_pItem.X1) != nil) && _sqlite3StrICmp(tls, _pItem.X1, _zDb) != 0 {
_sqlite3ErrorMsg(tls, (*XParse)(_pFix.X0), str(113284), unsafe.Pointer(_pFix.X4), unsafe.Pointer((*XToken)(_pFix.X5)), unsafe.Pointer(_pItem.X1))
return i32(1)
}
_sqlite3DbFree(tls, (*Xsqlite3)((*XParse)(_pFix.X0).X0), (unsafe.Pointer)(_pItem.X1))
*(**int8)(unsafe.Pointer(&(_pItem.X1))) = nil
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pItem.X0))))) = (*XSchema)(_pFix.X1)
_7:
if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pItem.X5)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.X12)) != 0 {
return i32(1)
}
*(*uintptr)(unsafe.Pointer(func() **TSrcList_item { _i += 1; return &_pItem }())) += uintptr(68)
goto _3
_6:
return i32(0)
}
var _sqlite3FixSrcListØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FixSrcListØ00__func__Ø000[0], str(113330), 18)
}
func _sqlite3FixSelect(tls *crt.TLS, _pFix *XDbFixer, _pSelect *XSelect) (r0 int32) {
_0:
if _pSelect == nil {
goto _1
}
if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.X0)) != 0 {
return i32(1)
}
if _sqlite3FixSrcList(tls, _pFix, (*XSrcList)(_pSelect.X8)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.X9)) != 0 {
return i32(1)
}
if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.X10)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.X11)) != 0 {
return i32(1)
}
if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pSelect.X12)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.X15)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pSelect.X16)) != 0 {
return i32(1)
}
_pSelect = (*XSelect)(_pSelect.X13)
goto _0
_1:
return i32(0)
}
func _sqlite3FixExprList(tls *crt.TLS, _pFix *XDbFixer, _pList *XExprList) (r0 int32) {
var _i int32
var _pItem *TExprList_item
if _pList == nil {
return i32(0)
}
*func() **TExprList_item { _i = i32(0); return &_pItem }() = (*TExprList_item)(unsafe.Pointer((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))
_1:
if _i >= (_pList.X0) {
goto _4
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pItem.X0)) != 0 {
return i32(1)
}
*(*uintptr)(unsafe.Pointer(func() **TExprList_item { _i += 1; return &_pItem }())) += uintptr(20)
goto _1
_4:
return i32(0)
}
func _sqlite3FixExpr(tls *crt.TLS, _pFix *XDbFixer, _pExpr *XExpr) (r0 int32) {
_0:
if _pExpr == nil {
goto _1
}
if int32(_pExpr.X0) != i32(135) {
goto _2
}
if ((*t21)(unsafe.Pointer(&((*Xsqlite3)((*XParse)(_pFix.X0).X0).X33))).X2) != 0 {
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(101))
goto _4
}
_sqlite3ErrorMsg(tls, (*XParse)(_pFix.X0), str(113348), unsafe.Pointer(_pFix.X4))
return i32(1)
_4:
_2:
if ((_pExpr.X2) & uint32(i32(8404992))) != uint32(i32(0)) {
goto _1
}
if ((_pExpr.X2) & uint32(i32(2048))) == uint32(i32(0)) {
goto _6
}
if _sqlite3FixSelect(tls, _pFix, (*XSelect)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 {
return i32(1)
}
goto _8
_6:
if _sqlite3FixExprList(tls, _pFix, (*XExprList)(*(*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) != 0 {
return i32(1)
}
_8:
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pExpr.X5)) != 0 {
return i32(1)
}
_pExpr = (*XExpr)(_pExpr.X4)
goto _0
_1:
return i32(0)
}
// Set the sort order for the last element on the given ExprList.
func _sqlite3ExprListSetSortOrder(tls *crt.TLS, _p *XExprList, _iSortOrder int32) {
if _p == nil {
return
}
i32(0)
func() {
if (_p.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92474), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000))), unsafe.Pointer(str(113372)))
crt.X__builtin_abort(tls)
}
}()
if _iSortOrder < i32(0) {
func() {
if int32((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2)))))+20*uintptr((_p.X0)-i32(1)))).X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92476), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSortOrderØ00__func__Ø000))), unsafe.Pointer(str(113383)))
crt.X__builtin_abort(tls)
}
}()
return
}
*(*uint8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_p.X2))))) + 20*uintptr((_p.X0)-i32(1)))).X3))) = uint8(_iSortOrder)
}
var _sqlite3ExprListSetSortOrderØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListSetSortOrderØ00__func__Ø000[0], str(113425), 28)
}
// If the expression list pEList contains more than iLimit elements,
// leave an error message in pParse.
func _sqlite3ExprListCheckLength(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _zObject *int8) {
var _mx int32
_mx = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(2))))
if (_pEList != nil) && ((_pEList.X0) > _mx) {
_sqlite3ErrorMsg(tls, _pParse, str(113453), unsafe.Pointer(_zObject))
}
}
// Resolve names in expressions that can only reference a single table:
//
// * CHECK constraints
// * WHERE clauses on partial indices
//
// The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression
// is set to -1 and the Expr.iColumn value is set to the column number.
//
// Any errors cause an error message to be set in pParse.
func _sqlite3ResolveSelfReference(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _type int32, _pExpr *XExpr, _pList *XExprList) {
var _sSrc XSrcList
var _sNC XNameContext
func() {
if _type != i32(4) && _type != i32(2) && _type != i32(32) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(90883), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ResolveSelfReferenceØ00__func__Ø000))), unsafe.Pointer(str(113476)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
crt.Xmemset(tls, (unsafe.Pointer)(&_sSrc), i32(0), u32(76))
*(*int32)(unsafe.Pointer(&(_sSrc.X0))) = i32(1)
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 68*uintptr(i32(0)))).X2))) = _pTab.X0
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 68*uintptr(i32(0)))).X4))))) = _pTab
*(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_sSrc.X2))))) + 68*uintptr(i32(0)))).X11))) = i32(-1)
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = &_sSrc
*(*uint16)(unsafe.Pointer(&(_sNC.X7))) = uint16(_type)
if _sqlite3ResolveExprNames(tls, &_sNC, _pExpr) != 0 {
return
}
if _pList != nil {
_sqlite3ResolveExprListNames(tls, &_sNC, _pList)
}
_ = _sSrc
_ = _sNC
}
var _sqlite3ResolveSelfReferenceØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ResolveSelfReferenceØ00__func__Ø000[0], str(113533), 28)
}
// Backwards Compatibility Hack:
//
// Historical versions of SQLite accepted strings as column names in
// indexes and PRIMARY KEY constraints and in UNIQUE constraints. Example:
//
// CREATE TABLE xyz(a,b,c,d,e,PRIMARY KEY('a'),UNIQUE('b','c' COLLATE trim)
// CREATE INDEX abc ON xyz('c','d' DESC,'e' COLLATE nocase DESC);
//
// This is goofy. But to preserve backwards compatibility we continue to
// accept it. This routine does the necessary conversion. It converts
// the expression given in its argument from a TK_STRING into a TK_ID
// if the expression is just a TK_STRING with an optional COLLATE clause.
// If the epxression is anything other than TK_STRING, the expression is
// unchanged.
func _sqlite3StringToId(tls *crt.TLS, _p *XExpr) {
if int32(_p.X0) == i32(97) {
*(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(i32(27))
goto _3
}
if (int32(_p.X0) == i32(94)) && (int32((*XExpr)(_p.X4).X0) == i32(97)) {
*(*uint8)(unsafe.Pointer(&((*XExpr)(_p.X4).X0))) = uint8(i32(27))
}
_3:
}
// Return true if value x is found any of the first nCol entries of aiCol[]
func _hasColumn(tls *crt.TLS, _aiCol *int16, _nCol int32, _x int32) (r0 int32) {
_0:
if postInc1(&_nCol, int32(-1)) <= i32(0) {
goto _1
}
if _x == int32(*postInc72(&_aiCol, 2)) {
return i32(1)
}
goto _0
_1:
return i32(0)
}
// Estimate the average size of a row for an index.
func _estimateIndexWidth(tls *crt.TLS, _pIdx *XIndex) {
var _1_x int16
var _i int32
var _wIndex uint32
var _aCol *XColumn
_wIndex = u32(0)
_aCol = (*XColumn)((*XTable)(_pIdx.X3).X1)
_i = i32(0)
_0:
if _i >= int32(_pIdx.X14) {
goto _3
}
_1_x = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))
func() {
if int32(_1_x) >= int32((*XTable)(_pIdx.X3).X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101344), unsafe.Pointer((*int8)(unsafe.Pointer(&_estimateIndexWidthØ00__func__Ø000))), unsafe.Pointer(str(113561)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_wIndex
*p = (*p) + uint32(func() int32 {
if int32(_1_x) < i32(0) {
return i32(1)
}
return int32((*XColumn)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aCol)) + 16*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))))).X5)
}())
sink5 = *p
}
_i += 1
goto _0
_3:
*(*int16)(unsafe.Pointer(&(_pIdx.X12))) = _sqlite3LogEst(tls, uint64(_wIndex*uint32(i32(4))))
}
var _estimateIndexWidthØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_estimateIndexWidthØ00__func__Ø000[0], str(113582), 19)
}
// 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 SQLITE_MASTER. Use
// care if you decide to try to use this routine for some other purposes.
func _sqlite3NestedParse(tls *crt.TLS, _pParse *XParse, _zFormat *int8, args ...interface{}) {
var _zSql, _zErrMsg *int8
var _ap []interface{}
var _db *Xsqlite3
var _saveBuf [84]int8
_zErrMsg = nil
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X16) != 0 {
return
}
func() {
if int32(_pParse.X6) >= i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99955), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3NestedParseØ00__func__Ø000))), unsafe.Pointer(str(113601)))
crt.X__builtin_abort(tls)
}
}()
_ap = args
_zSql = _sqlite3VMPrintf(tls, _db, _zFormat, _ap)
_ap = nil
if _zSql == nil {
return
}
*(*uint8)(unsafe.Pointer(&(_pParse.X6))) += 1
crt.Xmemcpy(tls, (unsafe.Pointer)(&_saveBuf), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(400))))))))), u32(84))
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(400))))))))), i32(0), u32(84))
_sqlite3RunParser(tls, _pParse, _zSql, &_zErrMsg)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql))
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(_pParse))))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(u32(400))))))))), (unsafe.Pointer)(&_saveBuf), u32(84))
*(*uint8)(unsafe.Pointer(&(_pParse.X6))) -= 1
_ = _saveBuf
}
var _sqlite3NestedParseØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3NestedParseØ00__func__Ø000[0], str(113619), 19)
}
// Generate code that will erase and refill index *pIdx. This is
// used to initialize a newly created index or to recompute the
// content of an index in response to a REINDEX command.
//
// if memRootPage is not negative, it means that the index is newly
// created. The register specified by memRootPage contains the
// root page number of the index. If memRootPage is negative, then
// the index already exists and must be cleared before being refilled and
// the root page number of the index is taken from pIndex->tnum.
func _sqlite3RefillIndex(tls *crt.TLS, _pParse *XParse, _pIndex *XIndex, _memRootPage int32) {
var _iTab, _iIdx, _iSorter, _addr1, _addr2, _tnum, _iPartIdxLabel, _regRecord, _iDb, _4_j2 int32
var _db *Xsqlite3
var _pTab *XTable
var _v *TVdbe
var _pKey *XKeyInfo
_pTab = (*XTable)(_pIndex.X3)
_iTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_iIdx = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_db = (*Xsqlite3)(_pParse.X0)
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.X6))
if _sqlite3AuthCheck(tls, _pParse, i32(27), _pIndex.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0) != 0 {
return
}
_sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(i32(1)), _pTab.X0)
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
return
}
if _memRootPage >= i32(0) {
_tnum = _memRootPage
goto _3
}
_tnum = _pIndex.X11
_3:
_pKey = _sqlite3KeyInfoOfIndex(tls, _pParse, _pIndex)
func() {
if _pKey == nil && (_db.X17) == 0 && (_pParse.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102495), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RefillIndexØ00__func__Ø000))), unsafe.Pointer(str(113638)))
crt.X__builtin_abort(tls)
}
}()
_iSorter = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_sqlite3VdbeAddOp4(tls, _v, i32(111), _iSorter, i32(0), int32(_pIndex.X13), (*int8)(unsafe.Pointer(_sqlite3KeyInfoRef(tls, _pKey))), i32(-5))
_sqlite3OpenTable(tls, _pParse, _iTab, _iDb, _pTab, i32(106))
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iTab, i32(0))
_regRecord = _sqlite3GetTempReg(tls, _pParse)
_sqlite3GenerateIndexKey(tls, _pParse, _pIndex, _iTab, _regRecord, i32(0), &_iPartIdxLabel, nil, i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(127), _iSorter, _regRecord)
_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iTab, _addr1+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _addr1)
if _memRootPage < i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(134), _tnum, _iDb)
}
_sqlite3VdbeAddOp4(tls, _v, i32(107), _iIdx, _tnum, _iDb, (*int8)(unsafe.Pointer(_pKey)), i32(-5))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(1)|func() int32 {
if _memRootPage >= i32(0) {
return i32(16)
}
return i32(0)
}()))
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(35), _iSorter, i32(0))
if int32(_pIndex.X15) != i32(0) {
_4_j2 = _sqlite3VdbeCurrentAddr(tls, _v) + i32(3)
_sqlite3VdbeGoto(tls, _v, _4_j2)
_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp4Int(tls, _v, i32(122), _iSorter, _4_j2, _regRecord, int32(_pIndex.X13))
_sqlite3UniqueConstraint(tls, _pParse, i32(2), _pIndex)
goto _12
}
_addr2 = _sqlite3VdbeCurrentAddr(tls, _v)
_12:
_sqlite3VdbeAddOp3(tls, _v, i32(123), _iSorter, _regRecord, _iIdx)
_sqlite3VdbeAddOp3(tls, _v, i32(33), _iIdx, i32(0), i32(-1))
_sqlite3VdbeAddOp2(tls, _v, i32(128), _iIdx, _regRecord)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
_sqlite3ReleaseTempReg(tls, _pParse, _regRecord)
_sqlite3VdbeAddOp2(tls, _v, i32(3), _iSorter, _addr2)
_sqlite3VdbeJumpHere(tls, _v, _addr1)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _iTab)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _iIdx)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _iSorter)
}
var _sqlite3RefillIndexØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RefillIndexØ00__func__Ø000[0], str(113682), 19)
}
// If a prior call to sqlite3GenerateIndexKey() generated a jump-over label
// because it was a partial index, then this routine should be called to
// resolve that label.
func _sqlite3ResolvePartIdxLabel(tls *crt.TLS, _pParse *XParse, _iLabel int32) {
if _iLabel != 0 {
_sqlite3VdbeResolveLabel(tls, (*TVdbe)(_pParse.X2), _iLabel)
_sqlite3ExprCachePop(tls, _pParse)
}
}
// Code an OP_Halt due to UNIQUE or PRIMARY KEY constraint violation.
func _sqlite3UniqueConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pIdx *XIndex) {
var _j int32
var _zErr, _3_zCol *int8
var _pTab *XTable
var _errMsg XStrAccum
_pTab = (*XTable)(_pIdx.X3)
_sqlite3StrAccumInit(tls, &_errMsg, (*Xsqlite3)(_pParse.X0), nil, i32(0), i32(200))
if (*XExprList)(_pIdx.X10) != nil {
_sqlite3XPrintf(tls, &_errMsg, str(113701), unsafe.Pointer(_pIdx.X0))
goto _1
}
_j = i32(0)
_2:
if _j >= int32(_pIdx.X13) {
goto _5
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103877), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UniqueConstraintØ00__func__Ø000))), unsafe.Pointer(str(113712)))
crt.X__builtin_abort(tls)
}
}()
_3_zCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_j)))))).X0
if _j != 0 {
_sqlite3StrAccumAppend(tls, &_errMsg, str(113733), i32(2))
}
_sqlite3XPrintf(tls, &_errMsg, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_3_zCol))
_j += 1
goto _2
_5:
_1:
_zErr = _sqlite3StrAccumFinish(tls, &_errMsg)
_sqlite3HaltConstraint(tls, _pParse, func() int32 {
if int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2) {
return i32(1555)
}
return i32(2067)
}(), _onError, _zErr, int8(i32(-1)), uint8(i32(2)))
_ = _errMsg
}
var _sqlite3UniqueConstraintØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3UniqueConstraintØ00__func__Ø000[0], str(113736), 24)
}
// 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 _sqlite3ChangeCookie(tls *crt.TLS, _pParse *XParse, _iDb int32) {
var _db *Xsqlite3
var _v *TVdbe
_db = (*Xsqlite3)(_pParse.X0)
_v = (*TVdbe)(_pParse.X2)
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101170), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ChangeCookieØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(104), _iDb, i32(1), ((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X4).X0)+i32(1))
}
var _sqlite3ChangeCookieØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ChangeCookieØ00__func__Ø000[0], str(113760), 20)
}
// Add an OP_ParseSchema opcode. This routine is broken out from
// sqlite3VdbeAddOp4() since it needs to also needs to mark all btrees
// as having been used.
//
// The zWhere string must have been obtained from sqlite3_malloc().
// This routine will take ownership of the allocated memory.
func _sqlite3VdbeAddParseSchemaOp(tls *crt.TLS, _p *TVdbe, _iDb int32, _zWhere *int8) {
var _j int32
_sqlite3VdbeAddOp4(tls, _p, i32(139), _iDb, i32(0), i32(0), _zWhere, i32(-1))
_j = i32(0)
_0:
if _j >= ((*Xsqlite3)(_p.X0).X5) {
goto _3
}
_sqlite3VdbeUsesBtree(tls, _p, _j)
_j += 1
goto _0
_3:
}
// Resize an Index object to hold N columns total. Return SQLITE_OK
// on success and SQLITE_NOMEM on an OOM error.
func _resizeIndexObject(tls *crt.TLS, _db *Xsqlite3, _pIdx *XIndex, _N int32) (r0 int32) {
var _nByte int32
var _zExtra *int8
if int32(_pIdx.X14) >= _N {
return i32(0)
}
func() {
if int32((uint32((_pIdx.X16)>>uint(i32(4)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101304), unsafe.Pointer((*int8)(unsafe.Pointer(&_resizeIndexObjectØ00__func__Ø000))), unsafe.Pointer(str(113780)))
crt.X__builtin_abort(tls)
}
}()
_nByte = int32(u32(7) * uint32(_N))
_zExtra = (*int8)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
if _zExtra == nil {
return _sqlite3NomemError(tls, i32(101307))
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X8), u32(4)*uint32(_pIdx.X14))
*(***int8)(unsafe.Pointer(&(_pIdx.X8))) = (**int8)(unsafe.Pointer(_zExtra))
{
p := &_zExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u32(4)*uint32(_N))))
sink0 = *p
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X1), u32(2)*uint32(_pIdx.X14))
*(**int16)(unsafe.Pointer(&(_pIdx.X1))) = (*int16)(unsafe.Pointer(_zExtra))
{
p := &_zExtra
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(u32(2)*uint32(_N))))
sink0 = *p
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_zExtra), (unsafe.Pointer)(_pIdx.X7), uint32(_pIdx.X14))
*(**uint8)(unsafe.Pointer(&(_pIdx.X7))) = (*uint8)(unsafe.Pointer(_zExtra))
*(*uint16)(unsafe.Pointer(&(_pIdx.X14))) = uint16(_N)
storebits3((*int8)(unsafe.Pointer(&(_pIdx.X16))), int8(i32(1)), 16, 4)
return i32(0)
}
var _resizeIndexObjectØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_resizeIndexObjectØ00__func__Ø000[0], str(113799), 18)
}
// Estimate the total row width for a table.
func _estimateTableWidth(tls *crt.TLS, _pTab *XTable) {
var _i int32
var _wTable uint32
var _pTabCol *XColumn
_wTable = u32(0)
*func() **XColumn { _i = int32(_pTab.X11); return &_pTabCol }() = (*XColumn)(_pTab.X1)
_0:
if _i <= i32(0) {
goto _3
}
{
p := &_wTable
*p = (*p) + uint32(_pTabCol.X5)
sink5 = *p
}
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i -= 1; return &_pTabCol }())) += uintptr(16)
goto _0
_3:
if int32(_pTab.X10) < i32(0) {
_wTable += 1
}
*(*int16)(unsafe.Pointer(&(_pTab.X13))) = _sqlite3LogEst(tls, uint64(_wTable*uint32(i32(4))))
}
// Compute the affinity string for table pTab, if it has not already been
// computed. As an optimization, omit trailing SQLITE_AFF_BLOB affinities.
//
// If the affinity exists (if it is no entirely SQLITE_AFF_BLOB values) and
// if iReg>0 then code an OP_Affinity opcode that will set the affinities
// for register iReg and following. Or if affinities exists and iReg==0,
// then just set the P4 operand of the previous opcode (which should be
// an OP_MakeRecord) to the affinity string.
//
// A column affinity string has one character per column:
//
// Character Column affinity
// ------------------------------
// 'A' BLOB
// 'B' TEXT
// 'C' NUMERIC
// 'D' INTEGER
// 'E' REAL
func _sqlite3TableAffinity(tls *crt.TLS, _v *TVdbe, _pTab *XTable, _iReg int32) {
var _i int32
var _zColAff *int8
var _1_db *Xsqlite3
_zColAff = _pTab.X5
if _zColAff != nil {
goto _0
}
_1_db = _sqlite3VdbeDb(tls, _v)
_zColAff = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(int32(_pTab.X11)+i32(1))))
if _zColAff == nil {
_sqlite3OomFault(tls, _1_db)
return
}
_i = i32(0)
_2:
if _i >= int32(_pTab.X11) {
goto _5
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(_i))) = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_i))).X4
_i += 1
goto _2
_5:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(postInc1(&_i, int32(-1))))) = int8(i32(0))
if (_i >= i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zColAff)) + 1*uintptr(_i)))) == i32(65)) {
goto _5
}
*(**int8)(unsafe.Pointer(&(_pTab.X5))) = _zColAff
_0:
_i = _sqlite3Strlen30(tls, _zColAff)
if _i == 0 {
goto _8
}
if _iReg != 0 {
_sqlite3VdbeAddOp4(tls, _v, i32(100), _iReg, _i, i32(0), _zColAff, _i)
goto _10
}
_sqlite3VdbeChangeP4(tls, _v, i32(-1), _zColAff, _i)
_10:
_8:
}
// Generate a CREATE TABLE statement appropriate for the given
// table. Memory to hold the text of the statement is obtained
// from sqliteMalloc() and must be freed by the calling function.
func _createTableStmt(tls *crt.TLS, _db *Xsqlite3, _p *XTable) (r0 *int8) {
var _i, _k, _n, _5_len int32
var _zStmt, _zSep, _zSep2, _zEnd, _5_zType *int8
var _pCol *XColumn
_n = i32(0)
*func() *int32 { _pCol = (*XColumn)(_p.X1); return &_i }() = i32(0)
_0:
if _i >= int32(_p.X11) {
goto _3
}
{
p := &_n
*p = (*p) + (_identLength(tls, _pCol.X0) + i32(5))
sink1 = *p
}
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
goto _0
_3:
{
p := &_n
*p = (*p) + _identLength(tls, _p.X0)
sink1 = *p
}
if _n < i32(50) {
_zSep = str(0)
_zSep2 = str(107763)
_zEnd = str(37898)
goto _5
}
_zSep = str(113817)
_zSep2 = str(113821)
_zEnd = str(113826)
_5:
{
p := &_n
*p = (*p) + (i32(35) + (i32(6) * int32(_p.X11)))
sink1 = *p
}
_zStmt = (*int8)(_sqlite3DbMallocRaw(tls, nil, uint64(_n)))
if _zStmt == nil {
_sqlite3OomFault(tls, _db)
return nil
}
Xsqlite3_snprintf(tls, _n, _zStmt, str(113829))
_k = _sqlite3Strlen30(tls, _zStmt)
_identPut(tls, _zStmt, &_k, _p.X0)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt)) + 1*uintptr(postInc1(&_k, int32(1))))) = int8(i32(40))
*func() *int32 { _pCol = (*XColumn)(_p.X1); return &_i }() = i32(0)
_7:
if _i >= int32(_p.X11) {
goto _10
}
Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k))), _zSep)
{
p := &_k
*p = (*p) + _sqlite3Strlen30(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k))))
sink1 = *p
}
_zSep = _zSep2
_identPut(tls, _zStmt, &_k, _pCol.X0)
func() {
if (int32(_pCol.X4) - i32(65)) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101276), unsafe.Pointer((*int8)(unsafe.Pointer(&_createTableStmtØ00__func__Ø000))), unsafe.Pointer(str(113843)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pCol.X4) - i32(65)) >= i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101277), unsafe.Pointer((*int8)(unsafe.Pointer(&_createTableStmtØ00__func__Ø000))), unsafe.Pointer(str(113879)))
crt.X__builtin_abort(tls)
}
}()
_5_zType = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_createTableStmtØ00azTypeØ001)) + 4*uintptr(int32(_pCol.X4)-i32(65))))
_5_len = _sqlite3Strlen30(tls, _5_zType)
func() {
if int32(_pCol.X4) != i32(65) && int32(_pCol.X4) != int32(_sqlite3AffinityType(tls, _5_zType, nil)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101286), unsafe.Pointer((*int8)(unsafe.Pointer(&_createTableStmtØ00__func__Ø000))), unsafe.Pointer(str(113930)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k)))), (unsafe.Pointer)(_5_zType), uint32(_5_len))
{
p := &_k
*p = (*p) + _5_len
sink1 = *p
}
func() {
if _k > _n {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101290), unsafe.Pointer((*int8)(unsafe.Pointer(&_createTableStmtØ00__func__Ø000))), unsafe.Pointer(str(114011)))
crt.X__builtin_abort(tls)
}
}()
*(*uintptr)(unsafe.Pointer(func() **XColumn { _i += 1; return &_pCol }())) += uintptr(16)
goto _7
_10:
Xsqlite3_snprintf(tls, _n-_k, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStmt))+1*uintptr(_k))), str(24576), unsafe.Pointer(_zEnd))
return _zStmt
}
// Measure the number of characters needed to output the given
// identifier. The number returned includes any quotes used
// but does not include the null terminator.
//
// The estimate is conservative. It might be larger that what is
// really needed.
func _identLength(tls *crt.TLS, _z *int8) (r0 int32) {
var _n int32
_n = i32(0)
_0:
if (*_z) == 0 {
goto _3
}
if int32(*_z) == i32(34) {
_n += 1
}
*(*uintptr)(unsafe.Pointer(func() **int8 { _n += 1; return &_z }())) += uintptr(1)
goto _0
_3:
return _n + i32(2)
}
// The first parameter is a pointer to an output buffer. The second
// parameter is a pointer to an integer that contains the offset at
// which to write into the output buffer. This function copies the
// nul-terminated string pointed to by the third parameter, zSignedIdent,
// to the specified offset in the buffer and updates *pIdx to refer
// to the first byte after the last byte written before returning.
//
// If the string zSignedIdent consists entirely of alpha-numeric
// characters, does not begin with a digit and is not an SQL keyword,
// then it is copied to the output buffer exactly as it is. Otherwise,
// it is quoted using double-quotes.
func _identPut(tls *crt.TLS, _z *int8, _pIdx *int32, _zSignedIdent *int8) {
var _i, _j, _needQuote int32
var _zIdent *uint8
_zIdent = (*uint8)(unsafe.Pointer(_zSignedIdent))
_i = *_pIdx
_j = i32(0)
_0:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == 0 {
goto _3
}
if ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j))))))) & i32(6)) == 0) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) != i32(95)) {
goto _3
}
_j += 1
goto _0
_3:
_needQuote = bool2int((((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(i32(0))))))))&i32(4)) != 0 || (_sqlite3KeywordCode(tls, _zIdent, _j) != i32(27))) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) != i32(0))) || (_j == i32(0)))
if _needQuote != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34))
}
_j = i32(0)
_10:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == 0 {
goto _13
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j))))
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIdent)) + 1*uintptr(_j)))) == i32(34) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34))
}
_j += 1
goto _10
_13:
if _needQuote != 0 {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(postInc1(&_i, int32(1))))) = int8(i32(34))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_i))) = int8(i32(0))
*_pIdx = _i
}
func _sqlite3KeywordCode(tls *crt.TLS, _z *uint8, _n int32) (r0 int32) {
var _id int32
_id = i32(27)
_keywordCode(tls, (*int8)(unsafe.Pointer(_z)), _n, &_id)
return _id
}
var _createTableStmtØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_createTableStmtØ00__func__Ø000[0], str(114016), 16)
}
var _createTableStmtØ00azTypeØ001 [5]*int8
func init() {
_createTableStmtØ00azTypeØ001 = [5]*int8{str(0), str(114032), str(114038), str(114043), str(114048)}
}
// pZ is a UTF-8 encoded unicode string. If nByte is less than zero,
// return the number of unicode characters in pZ up to (but not including)
// the first 0x00 byte. If nByte is not less than zero, return the
// number of unicode characters in the first nByte of pZ (or up to
// the first 0x00, whichever comes first).
func _sqlite3Utf8CharLen(tls *crt.TLS, _zIn *int8, _nByte int32) (r0 int32) {
var _r int32
var _z, _zTerm *uint8
_r = i32(0)
_z = (*uint8)(unsafe.Pointer(_zIn))
if _nByte >= i32(0) {
_zTerm = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nByte)))
goto _1
}
_zTerm = (*uint8)(unsafe.Pointer(uintptr(u32(4294967295))))
_1:
func() {
if uintptr(unsafe.Pointer(_z)) > uintptr(unsafe.Pointer(_zTerm)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(27515), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3Utf8CharLenØ00__func__Ø000))), unsafe.Pointer(str(114054)))
crt.X__builtin_abort(tls)
}
}()
_4:
if int32(*_z) == i32(0) || uintptr(unsafe.Pointer(_z)) >= uintptr(unsafe.Pointer(_zTerm)) {
goto _5
}
if int32(*postInc13(&_z, 1)) < i32(192) {
goto _7
}
_8:
if (int32(*_z) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _8
}
_7:
_r += 1
goto _4
_5:
return _r
}
var _sqlite3Utf8CharLenØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3Utf8CharLenØ00__func__Ø000[0], str(114063), 19)
}
// 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 _sqlite3AddColumn(tls *crt.TLS, _pParse *XParse, _pName *XToken, _pType *XToken) {
var _i int32
var _z, _zType *int8
var _db *Xsqlite3
var _p *XTable
var _pCol, _4_aNew *XColumn
_db = (*Xsqlite3)(_pParse.X0)
if store44(&_p, (*XTable)(_pParse.X63)) == nil {
return
}
if (int32(_p.X11) + i32(1)) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(2))))) {
_sqlite3ErrorMsg(tls, _pParse, str(114082), unsafe.Pointer(_p.X0))
return
}
_z = (*int8)(_sqlite3DbMallocRaw(tls, _db, uint64(((_pName.X1)+(_pType.X1))+uint32(i32(2)))))
if _z == nil {
return
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_pName.X0), _pName.X1)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_pName.X1))) = int8(i32(0))
_sqlite3Dequote(tls, _z)
_i = i32(0)
_3:
if _i >= int32(_p.X11) {
goto _6
}
if Xsqlite3_stricmp(tls, _z, (*XColumn)(unsafe.Pointer(uintptr(_p.X1)+16*uintptr(_i))).X0) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(114105), unsafe.Pointer(_z))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
return
}
_i += 1
goto _3
_6:
if (int32(_p.X11) & i32(7)) != i32(0) {
goto _8
}
_4_aNew = (*XColumn)(_sqlite3DbRealloc(tls, _db, _p.X1, uint64(uint32(int32(_p.X11)+i32(8))*u32(16))))
if _4_aNew == nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
return
}
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = _4_aNew
_8:
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 16*uintptr(_p.X11)))
crt.Xmemset(tls, (unsafe.Pointer)(_pCol), i32(0), u32(16))
*(**int8)(unsafe.Pointer(&(_pCol.X0))) = _z
if (_pType.X1) == uint32(i32(0)) {
*(*int8)(unsafe.Pointer(&(_pCol.X4))) = int8(i32(65))
*(*uint8)(unsafe.Pointer(&(_pCol.X5))) = uint8(i32(1))
goto _11
}
_zType = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_z))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_sqlite3Strlen30(tls, _z)))))))))) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(i32(1))))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_zType), (unsafe.Pointer)(_pType.X0), _pType.X1)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zType)) + 1*uintptr(_pType.X1))) = int8(i32(0))
_sqlite3Dequote(tls, _zType)
*(*int8)(unsafe.Pointer(&(_pCol.X4))) = _sqlite3AffinityType(tls, _zType, (*uint8)(unsafe.Pointer(&(_pCol.X5))))
{
p := (*uint8)(unsafe.Pointer(&(_pCol.X6)))
*p = uint8(int32(*p) | i32(4))
sink2 = *p
}
_11:
*(*int16)(unsafe.Pointer(&(_p.X11))) += 1
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1))) = uint32(i32(0))
}
// 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 _sqlite3AddDefaultValue(tls *crt.TLS, _pParse *XParse, _pSpan *XExprSpan) {
var _db *Xsqlite3
var _p *XTable
var _3_x XExpr
var _pCol *XColumn
_db = (*Xsqlite3)(_pParse.X0)
_p = (*XTable)(_pParse.X63)
if _p == nil {
goto _0
}
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 16*uintptr(int32(_p.X11)-i32(1))))
if _sqlite3ExprIsConstantOrFunction(tls, (*XExpr)(_pSpan.X0), (*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(114131), unsafe.Pointer(_pCol.X0))
goto _2
}
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pCol.X1))
crt.Xmemset(tls, (unsafe.Pointer)(&_3_x), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_3_x.X0))) = uint8(i32(162))
*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_3_x.X3))))) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_x.X4))))) = (*XExpr)(_pSpan.X0)
*(*uint32)(unsafe.Pointer(&(_3_x.X2))) = uint32(i32(4096))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pCol.X1))))) = _sqlite3ExprDup(tls, _db, &_3_x, i32(1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_3_x.X3)))))))
_2:
_0:
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pSpan.X0))
_ = _3_x
}
// Walk an expression tree. Return non-zero if the expression is constant
// or a function call with constant arguments. Return and 0 if there
// are any variables.
//
// 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 _sqlite3ExprIsConstantOrFunction(tls *crt.TLS, _p *XExpr, _isInit uint8) (r0 int32) {
func() {
if int32(_isInit) != i32(0) && int32(_isInit) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92783), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000))), unsafe.Pointer(str(114176)))
crt.X__builtin_abort(tls)
}
}()
return _exprIsConst(tls, _p, i32(4)+int32(_isInit), i32(0))
}
var _sqlite3ExprIsConstantOrFunctionØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprIsConstantOrFunctionØ00__func__Ø000[0], str(114199), 32)
}
func _spanExpr(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _t XToken) {
var _p *XExpr
_p = (*XExpr)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), uint64((u32(48)+(_t.X1))+uint32(i32(1)))))
if _p == nil {
goto _0
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(48))
*(*uint8)(unsafe.Pointer(&(_p.X0))) = uint8(_op)
*(*uint32)(unsafe.Pointer(&(_p.X2))) = uint32(i32(8388608))
*(*int16)(unsafe.Pointer(&(_p.X10))) = int16(i32(-1))
*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))) = (*int8)(unsafe.Pointer((*XExpr)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 48*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3)))))), (unsafe.Pointer)(_t.X0), _t.X1)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(_t.X1))) = int8(i32(0))
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(i32(0))))))))) & i32(128)) == 0 {
goto _1
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))) + 1*uintptr(i32(0))))) == i32(34) {
{
p := (*uint32)(unsafe.Pointer(&(_p.X2)))
*p = (*p) | uint32(i32(64))
sink5 = *p
}
}
_sqlite3Dequote(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_p.X3))))))
_1:
*(*int32)(unsafe.Pointer(&(_p.X7))) = i32(1)
_0:
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X0))))) = _p
*(**int8)(unsafe.Pointer(&(_pOut.X1))) = _t.X0
*(**int8)(unsafe.Pointer(&(_pOut.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_t.X0)) + 1*uintptr(_t.X1)))
}
// 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 _sqlite3AddNotNull(tls *crt.TLS, _pParse *XParse, _onError int32) {
var _p *XTable
_p = (*XTable)(_pParse.X63)
if (_p == nil) || func() int32 {
if int32(_p.X11) < i32(1) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(100812), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddNotNullØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
*(*uint8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 16*uintptr(int32(_p.X11)-i32(1)))).X3))) = uint8(_onError)
{
p := (*uint32)(unsafe.Pointer(&(_p.X9)))
*p = (*p) | uint32(i32(512))
sink5 = *p
}
}
var _sqlite3AddNotNullØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AddNotNullØ00__func__Ø000[0], str(114231), 18)
}
// 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 _sqlite3AddPrimaryKey(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _onError int32, _autoInc int32, _sortOrder int32) {
var _iCol, _i, _nTerm int32
var _5_zCName *int8
var _pTab *XTable
var _4_pCExpr *XExpr
var _pCol *XColumn
_pTab = (*XTable)(_pParse.X63)
_pCol = nil
_iCol = i32(-1)
if _pTab == nil {
goto _primary_key_exit
}
if ((_pTab.X9) & uint32(i32(4))) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(114249), unsafe.Pointer(_pTab.X0))
goto _primary_key_exit
}
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | uint32(i32(4))
sink5 = *p
}
if _pList == nil {
_iCol = int32(_pTab.X11) - i32(1)
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol)))
{
p := (*uint8)(unsafe.Pointer(&(_pCol.X6)))
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
_nTerm = i32(1)
goto _3
}
_nTerm = _pList.X0
_i = i32(0)
_4:
if _i >= _nTerm {
goto _7
}
_4_pCExpr = _sqlite3ExprSkipCollate(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_i))).X0))
func() {
if _4_pCExpr == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101013), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000))), unsafe.Pointer(str(114290)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3StringToId(tls, _4_pCExpr)
if int32(_4_pCExpr.X0) != i32(27) {
goto _10
}
_5_zCName = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_4_pCExpr.X3)))))
_iCol = i32(0)
_11:
if _iCol >= int32(_pTab.X11) {
goto _14
}
if _sqlite3StrICmp(tls, _5_zCName, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_iCol))).X0) == i32(0) {
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol)))
{
p := (*uint8)(unsafe.Pointer(&(_pCol.X6)))
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
goto _14
}
_iCol += 1
goto _11
_14:
_10:
_i += 1
goto _4
_7:
_3:
if _nTerm != i32(1) || _pCol == nil || _sqlite3StrICmp(tls, _sqlite3ColumnType(tls, _pCol, str(0)), str(25792)) != i32(0) || _sortOrder == i32(1) {
goto _19
}
*(*int16)(unsafe.Pointer(&(_pTab.X10))) = int16(_iCol)
*(*uint8)(unsafe.Pointer(&(_pTab.X14))) = uint8(_onError)
func() {
if _autoInc != i32(0) && _autoInc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101034), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddPrimaryKeyØ00__func__Ø000))), unsafe.Pointer(str(114300)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint32)(unsafe.Pointer(&(_pTab.X9)))
*p = (*p) | uint32(_autoInc*i32(8))
sink5 = *p
}
if _pList != nil {
*(*uint8)(unsafe.Pointer(&(_pParse.X53))) = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(i32(0)))).X3
}
goto _primary_key_exit
_19:
if _autoInc != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(114325))
goto _primary_key_exit
}
_sqlite3CreateIndex(tls, _pParse, nil, nil, nil, _pList, _onError, nil, nil, _sortOrder, i32(0), uint8(i32(2)))
_pList = nil
_primary_key_exit:
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _pList)
}
var _sqlite3AddPrimaryKeyØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AddPrimaryKeyØ00__func__Ø000[0], str(114381), 21)
}
// Add a new CHECK constraint to the table currently under construction.
func _sqlite3AddCheckConstraint(tls *crt.TLS, _pParse *XParse, _pCheckExpr *XExpr) {
var _db *Xsqlite3
var _pTab *XTable
_pTab = (*XTable)(_pParse.X63)
_db = (*Xsqlite3)(_pParse.X0)
if _pTab == nil || (_pParse.X55) != 0 || _sqlite3BtreeIsReadonly(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr((*t21)(unsafe.Pointer(&(_db.X33))).X1))).X1)) != 0 {
goto _2
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTab.X6))))) = _sqlite3ExprListAppend(tls, _pParse, (*XExprList)(_pTab.X6), _pCheckExpr)
if ((*XToken)(unsafe.Pointer(&(_pParse.X28))).X1) != 0 {
_sqlite3ExprListSetName(tls, _pParse, (*XExprList)(_pTab.X6), (*XToken)(unsafe.Pointer(&(_pParse.X28))), i32(1))
}
goto _4
_2:
_sqlite3ExprDelete(tls, (*Xsqlite3)(_pParse.X0), _pCheckExpr)
_4:
}
// Return true if the given Btree is read-only.
func _sqlite3BtreeIsReadonly(tls *crt.TLS, _p *XBtree) (r0 int32) {
return bool2int((int32((*XBtShared)(_p.X1).X10) & i32(1)) != i32(0))
}
// 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 _sqlite3CreateForeignKey(tls *crt.TLS, _pParse *XParse, _pFromCol *XExprList, _pTo *XToken, _pToCol *XExprList, _flags int32) {
var _nByte, _i, _nCol, _1_iCol, _10_j, _15_n int32
var _z *int8
var _db *Xsqlite3
var _p *XTable
var _pFKey, _pNextTo *XFKey
_db = (*Xsqlite3)(_pParse.X0)
_pFKey = nil
_p = (*XTable)(_pParse.X63)
func() {
if _pTo == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(114402)))
crt.X__builtin_abort(tls)
}
}()
if (_p == nil) || ((_pParse.X55) != 0) {
goto _fk_end
}
if _pFromCol != nil {
goto _4
}
_1_iCol = int32(_p.X11) - i32(1)
if func() int32 {
if _1_iCol < i32(0) {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102341), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _fk_end
}
if (_pToCol != nil) && ((_pToCol.X0) != i32(1)) {
_sqlite3ErrorMsg(tls, _pParse, str(114409), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_p.X1)+16*uintptr(_1_iCol))).X0), unsafe.Pointer(_pTo))
goto _fk_end
}
_nCol = i32(1)
goto _13
_4:
if (_pToCol != nil) && ((_pToCol.X0) != (_pFromCol.X0)) {
_sqlite3ErrorMsg(tls, _pParse, str(114472))
goto _fk_end
}
_nCol = _pFromCol.X0
_13:
_nByte = int32(((u32(44) + (uint32(_nCol-i32(1)) * u32(8))) + (_pTo.X1)) + uint32(i32(1)))
if _pToCol == nil {
goto _14
}
_i = i32(0)
_15:
if _i >= (_pToCol.X0) {
goto _18
}
{
p := &_nByte
*p = (*p) + (_sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+20*uintptr(_i))).X1) + i32(1))
sink1 = *p
}
_i += 1
goto _15
_18:
_14:
_pFKey = (*XFKey)(_sqlite3DbMallocZero(tls, _db, uint64(_nByte)))
if _pFKey == nil {
goto _fk_end
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X0))))) = _p
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X1))))) = (*XFKey)(_p.X4)
_z = (*int8)(unsafe.Pointer((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_nCol)))))
*(**int8)(unsafe.Pointer(&(_pFKey.X2))) = _z
crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_pTo.X0), _pTo.X1)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_pTo.X1))) = int8(i32(0))
_sqlite3Dequote(tls, _z)
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr((_pTo.X1)+uint32(i32(1)))))
sink0 = *p
}
*(*int32)(unsafe.Pointer(&(_pFKey.X5))) = _nCol
if _pFromCol == nil {
*(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(i32(0)))).X0))) = int32(_p.X11) - i32(1)
goto _21
}
_i = i32(0)
_22:
if _i >= _nCol {
goto _25
}
_10_j = i32(0)
_26:
if _10_j >= int32(_p.X11) {
goto _29
}
if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_p.X1)+16*uintptr(_10_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pFromCol.X2)))))+20*uintptr(_i))).X1) == i32(0) {
*(*int32)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_i))).X0))) = _10_j
goto _29
}
_10_j += 1
goto _26
_29:
if _10_j >= int32(_p.X11) {
_sqlite3ErrorMsg(tls, _pParse, str(114566), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pFromCol.X2)))))+20*uintptr(_i))).X1))
goto _fk_end
}
_i += 1
goto _22
_25:
_21:
if _pToCol == nil {
goto _32
}
_i = i32(0)
_33:
if _i >= _nCol {
goto _36
}
_15_n = _sqlite3Strlen30(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+20*uintptr(_i))).X1)
*(**int8)(unsafe.Pointer(&((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_i))).X1))) = _z
crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pToCol.X2)))))+20*uintptr(_i))).X1), uint32(_15_n))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_15_n))) = int8(i32(0))
{
p := &_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_15_n+i32(1))))
sink0 = *p
}
_i += 1
goto _33
_36:
_32:
*(*uint8)(unsafe.Pointer(&(_pFKey.X6))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(0)))) = uint8(_flags & i32(255))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(1)))) = uint8((_flags >> uint(i32(8))) & i32(255))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_p.X20)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102408), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(114612)))
crt.X__builtin_abort(tls)
}
}()
_pNextTo = (*XFKey)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_p.X20).X5))), _pFKey.X2, (unsafe.Pointer)(_pFKey)))
if _pNextTo == _pFKey {
_sqlite3OomFault(tls, _db)
goto _fk_end
}
if _pNextTo != nil {
func() {
if (*XFKey)(_pNextTo.X4) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102417), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(114654)))
crt.X__builtin_abort(tls)
}
}()
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X3))))) = _pNextTo
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNextTo.X4))))) = _pFKey
}
*(**XFKey)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))))) = _pFKey
_pFKey = nil
_fk_end:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pFKey))
_sqlite3ExprListDelete(tls, _db, _pFromCol)
_sqlite3ExprListDelete(tls, _db, _pToCol)
}
var _sqlite3CreateForeignKeyØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CreateForeignKeyØ00__func__Ø000[0], str(114674), 24)
}
// 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 _sqlite3DeferForeignKey(tls *crt.TLS, _pParse *XParse, _isDeferred int32) {
var _pTab *XTable
var _pFKey *XFKey
if (store44(&_pTab, (*XTable)(_pParse.X63)) == nil) || (store74(&_pFKey, (*XFKey)(_pTab.X4)) == nil) {
return
}
func() {
if _isDeferred != i32(0) && _isDeferred != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102446), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeferForeignKeyØ00__func__Ø000))), unsafe.Pointer(str(114698)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pFKey.X6))) = uint8(_isDeferred)
}
var _sqlite3DeferForeignKeyØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DeferForeignKeyØ00__func__Ø000[0], str(114729), 23)
}
// Set the collation function of the most recently parsed table column
// to the CollSeq given.
func _sqlite3AddCollateType(tls *crt.TLS, _pParse *XParse, _pToken *XToken) {
var _i int32
var _zColl *int8
var _db *Xsqlite3
var _p *XTable
var _1_pIdx *XIndex
if store44(&_p, (*XTable)(_pParse.X63)) == nil {
return
}
_i = int32(_p.X11) - i32(1)
_db = (*Xsqlite3)(_pParse.X0)
_zColl = _sqlite3NameFromToken(tls, _db, _pToken)
if _zColl == nil {
return
}
if _sqlite3LocateCollSeq(tls, _pParse, _zColl) == nil {
goto _2
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)((*XColumn)(unsafe.Pointer(uintptr(_p.X1)+16*uintptr(_i))).X2))
*(**int8)(unsafe.Pointer(&((*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 16*uintptr(_i))).X2))) = _zColl
_1_pIdx = (*XIndex)(_p.X2)
_3:
if _1_pIdx == nil {
goto _6
}
func() {
if int32(_1_pIdx.X13) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101103), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AddCollateTypeØ00__func__Ø000))), unsafe.Pointer(str(114752)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(i32(0))))) == _i {
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X8)) + 4*uintptr(i32(0)))) = (*XColumn)(unsafe.Pointer(uintptr(_p.X1) + 16*uintptr(_i))).X2
}
_1_pIdx = (*XIndex)(_1_pIdx.X5)
goto _3
_6:
goto _10
_2:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zColl))
_10:
}
var _sqlite3AddCollateTypeØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AddCollateTypeØ00__func__Ø000[0], str(114769), 22)
}
// This routine is called to do the work of a DROP TABLE statement.
// pName is the name of the table to be dropped.
func _sqlite3DropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _isView int32, _noErr int32) {
var _iDb, _4_code int32
var _4_zTab, _4_zDb, _4_zArg2 *int8
var _db *Xsqlite3
var _pTab *XTable
var _v *TVdbe
_db = (*Xsqlite3)(_pParse.X0)
if (_db.X17) != 0 {
goto _exit_drop_table
}
func() {
if (_pParse.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102213), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(112366)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pName.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102214), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(114791)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ReadSchema(tls, _pParse) != 0 {
goto _exit_drop_table
}
if _noErr != 0 {
*(*uint8)(unsafe.Pointer(&(_db.X21))) += 1
}
func() {
if _isView != i32(0) && _isView != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102217), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(114806)))
crt.X__builtin_abort(tls)
}
}()
_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(_isView), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+68*uintptr(i32(0)))))
if _noErr != 0 {
*(*uint8)(unsafe.Pointer(&(_db.X21))) -= 1
}
if _pTab != nil {
goto _11
}
if _noErr != 0 {
_sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+68*uintptr(i32(0)))).X1)
}
goto _exit_drop_table
_11:
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102226), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTableØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
if (_pTab.X16) != 0 && _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
goto _exit_drop_table
}
_4_zTab = func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}()
_4_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_4_zArg2 = nil
if _sqlite3AuthCheck(tls, _pParse, i32(9), _4_zTab, nil, _4_zDb) != 0 {
goto _exit_drop_table
}
if _isView == 0 {
goto _22
}
if i32(1) != 0 && (_iDb == i32(1)) {
_4_code = i32(15)
goto _25
}
_4_code = i32(17)
_25:
goto _28
_22:
if (_pTab.X16) != 0 {
_4_code = i32(30)
_4_zArg2 = (*XModule)(_sqlite3GetVTable(tls, _db, _pTab).X1).X1
goto _28
}
if i32(1) != 0 && (_iDb == i32(1)) {
_4_code = i32(13)
goto _31
}
_4_code = i32(11)
_31:
_28:
if _sqlite3AuthCheck(tls, _pParse, _4_code, _pTab.X0, _4_zArg2, _4_zDb) != 0 {
goto _exit_drop_table
}
if _sqlite3AuthCheck(tls, _pParse, i32(9), _pTab.X0, nil, _4_zDb) != 0 {
goto _exit_drop_table
}
if (Xsqlite3_strnicmp(tls, _pTab.X0, str(111644), i32(7)) == i32(0)) && (Xsqlite3_strnicmp(tls, _pTab.X0, str(114839), i32(11)) != i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(114851), unsafe.Pointer(_pTab.X0))
goto _exit_drop_table
}
if _isView != 0 && ((*XSelect)(_pTab.X3) == nil) {
_sqlite3ErrorMsg(tls, _pParse, str(114879), unsafe.Pointer(_pTab.X0))
goto _exit_drop_table
}
if (_isView == 0) && ((*XSelect)(_pTab.X3) != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(114913), unsafe.Pointer(_pTab.X0))
goto _exit_drop_table
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v != nil {
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
_sqlite3ClearStatTables(tls, _pParse, _iDb, str(61653), _pTab.X0)
_sqlite3FkDropTable(tls, _pParse, _pName, _pTab)
_sqlite3CodeDropTable(tls, _pParse, _pTab, _iDb, _isView)
}
_exit_drop_table:
_sqlite3SrcListDelete(tls, _db, _pName)
}
var _sqlite3DropTableØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DropTableØ00__func__Ø000[0], str(114945), 17)
}
// If argument zDb is NULL, then call sqlite3CodeVerifySchema() for each
// attached database. Otherwise, invoke it for the database named zDb only.
func _sqlite3CodeVerifyNamedSchema(tls *crt.TLS, _pParse *XParse, _zDb *int8) {
var _i int32
var _db *Xsqlite3
var _1_pDb *XDb
_db = (*Xsqlite3)(_pParse.X0)
_i = i32(0)
_0:
if _i >= (_db.X5) {
goto _3
}
_1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
if ((*XBtree)(_1_pDb.X1) != nil) && ((_zDb == nil) || (i32(0) == _sqlite3StrICmp(tls, _zDb, _1_pDb.X0))) {
_sqlite3CodeVerifySchema(tls, _pParse, _i)
}
_i += 1
goto _0
_3:
}
// Remove entries from the sqlite_statN tables (for N in (1,2,3))
// after a DROP INDEX or DROP TABLE command.
func _sqlite3ClearStatTables(tls *crt.TLS, _pParse *XParse, _iDb int32, _zType *int8, _zName *int8) {
var _i int32
var _zDbName *int8
var _1_zTab [24]int8
_zDbName = (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 16*uintptr(_iDb))).X0
_i = i32(1)
_0:
if _i > i32(4) {
goto _3
}
Xsqlite3_snprintf(tls, int32(u32(24)), (*int8)(unsafe.Pointer(&_1_zTab)), str(114962), _i)
if _sqlite3FindTable(tls, (*Xsqlite3)(_pParse.X0), (*int8)(unsafe.Pointer(&_1_zTab)), _zDbName) != nil {
_sqlite3NestedParse(tls, _pParse, str(114976), unsafe.Pointer(_zDbName), unsafe.Pointer((*int8)(unsafe.Pointer(&_1_zTab))), unsafe.Pointer(_zType), unsafe.Pointer(_zName))
}
_i += 1
goto _0
_3:
_ = _1_zTab
}
// 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 " is executed before dropping
// the table from the database. Triggers are disabled while running this
// DELETE, but foreign key actions are not.
func _sqlite3FkDropTable(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _pTab *XTable) {
var _1_iSkip int32
var _db *Xsqlite3
var _1_v *TVdbe
var _2_p *XFKey
_db = (*Xsqlite3)(_pParse.X0)
if ((_db.X6)&i32(524288)) == 0 || (_pTab.X16) != 0 || (*XSelect)(_pTab.X3) != nil {
goto _2
}
_1_iSkip = i32(0)
_1_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _1_v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkDropTableØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3FkReferences(tls, _pTab) != nil {
goto _5
}
_2_p = (*XFKey)(_pTab.X4)
_6:
if _2_p == nil {
goto _9
}
if ((_2_p.X6) != 0) || ((_db.X6)&i32(33554432)) != 0 {
goto _9
}
_2_p = (*XFKey)(_2_p.X1)
goto _6
_9:
if _2_p == nil {
return
}
_1_iSkip = _sqlite3VdbeMakeLabel(tls, _1_v)
_sqlite3VdbeAddOp2(tls, _1_v, i32(45), i32(1), _1_iSkip)
_5:
*(*uint8)(unsafe.Pointer(&(_pParse.X47))) = uint8(i32(1))
_sqlite3DeleteFrom(tls, _pParse, _sqlite3SrcListDup(tls, _db, _pName, i32(0)), nil)
*(*uint8)(unsafe.Pointer(&(_pParse.X47))) = uint8(i32(0))
if ((_db.X6) & i32(33554432)) == i32(0) {
_sqlite3VdbeAddOp2(tls, _1_v, i32(45), i32(0), _sqlite3VdbeCurrentAddr(tls, _1_v)+i32(2))
_sqlite3HaltConstraint(tls, _pParse, i32(787), i32(2), nil, int8(i32(-2)), uint8(i32(4)))
}
if _1_iSkip != 0 {
_sqlite3VdbeResolveLabel(tls, _1_v, _1_iSkip)
}
_2:
}
var _sqlite3FkDropTableØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FkDropTableØ00__func__Ø000[0], str(115006), 19)
}
// 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 _sqlite3FkReferences(tls *crt.TLS, _pTab *XTable) (r0 *XFKey) {
return (*XFKey)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_pTab.X20).X5))), _pTab.X0))
}
// Generate code for a DELETE FROM statement.
//
// DELETE FROM table_wxyz WHERE a<5 AND b NOT NULL;
// \________/ \________________/
// pTabList pWhere
func _sqlite3DeleteFrom(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pWhere *XExpr) {
var _nPk, _nKey int16
var _i, _iTabCur, _iDataCur, _iIdxCur, _nIdx, _iDb, _memCnt, _rcauth, _eOnePass, _iPk, _iKey, _iEphCur, _iRowSet, _addrBypass, _addrLoop, _addrEphOpen, _bComplex, _isView, _28_iAddrOnce, _36_count int32
var _34_pVTab *int8
var _14_wcf uint16
var _aToOpen *uint8
var _db *Xsqlite3
var _pTrigger *XTrigger
var _pTab *XTable
var _v *TVdbe
var _aiCurOnePass [2]int32
var _pIdx, _pPk *XIndex
var _sNC XNameContext
var _sContext XAuthContext
var _pWInfo *XWhereInfo
_iDataCur = i32(0)
_iIdxCur = i32(0)
_memCnt = i32(-1)
_aToOpen = nil
_iPk = i32(0)
_nPk = i16(1)
_iEphCur = i32(0)
_iRowSet = i32(0)
_addrBypass = i32(0)
_addrLoop = i32(0)
_addrEphOpen = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_sContext), i32(0), u32(8))
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
goto _delete_from_cleanup
}
func() {
if (_pTabList.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115025)))
crt.X__builtin_abort(tls)
}
}()
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
if _pTab == nil {
goto _delete_from_cleanup
}
_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)
_isView = bool2int((*XSelect)(_pTab.X3) != nil)
_bComplex = bool2int((_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, i32(0)) != 0)
if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
goto _delete_from_cleanup
}
if _sqlite3IsReadOnly(tls, _pParse, _pTab, func() int32 {
if _pTrigger != nil {
return i32(1)
}
return i32(0)
}()) != 0 {
goto _delete_from_cleanup
}
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
func() {
if _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104923), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(54328)))
crt.X__builtin_abort(tls)
}
}()
_rcauth = _sqlite3AuthCheck(tls, _pParse, i32(9), _pTab.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
func() {
if _rcauth != i32(0) && _rcauth != i32(1) && _rcauth != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115043)))
crt.X__builtin_abort(tls)
}
}()
if _rcauth == i32(1) {
goto _delete_from_cleanup
}
func() {
if _isView != 0 && _pTrigger == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104930), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115109)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTabList.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104934), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115025)))
crt.X__builtin_abort(tls)
}
}()
_iTabCur = store1((*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X11))), postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1)))
*func() **XIndex { _nIdx = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_22:
if _pIdx == nil {
goto _25
}
*(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_nIdx }() += 1
goto _22
_25:
if _isView != 0 {
_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.X0)
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _delete_from_cleanup
}
if int32(_pParse.X6) == i32(0) {
_sqlite3VdbeCountChanges(tls, _v)
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
if _isView != 0 {
_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iTabCur)
_iDataCur = store1(&_iIdxCur, _iTabCur)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList
if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
goto _delete_from_cleanup
}
if ((_db.X6) & i32(128)) != 0 {
_memCnt = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _memCnt)
}
if _rcauth != i32(0) || _pWhere != nil || _bComplex != 0 || (_pTab.X16) != 0 {
goto _35
}
func() {
if _isView != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105002), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115129)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(i32(1)), _pTab.X0)
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_sqlite3VdbeAddOp4(tls, _v, i32(134), _pTab.X7, _iDb, _memCnt, _pTab.X0, i32(-2))
}
_pIdx = (*XIndex)(_pTab.X2)
_39:
if _pIdx == nil {
goto _42
}
func() {
if (*XSchema)(_pIdx.X6) != (*XSchema)(_pTab.X20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115137)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(134), _pIdx.X11, _iDb)
_pIdx = (*XIndex)(_pIdx.X5)
goto _39
_42:
goto _45
_35:
_14_wcf = u16(1044)
if (int32(_sNC.X7) & i32(64)) != 0 {
_bComplex = i32(1)
}
{
p := &_14_wcf
*p = uint16(int32(*p) | func() int32 {
if _bComplex != 0 {
return i32(0)
}
return i32(8)
}())
sink14 = *p
}
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_pPk = nil
_nPk = int16(i32(1))
_iRowSet = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _iRowSet)
goto _50
}
_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
func() {
if _pPk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105028), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(41994)))
crt.X__builtin_abort(tls)
}
}()
_nPk = int16(_pPk.X13)
_iPk = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_nPk)
sink1 = *p
}
_iEphCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_addrEphOpen = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iEphCur, int32(_nPk))
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
_50:
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, _14_wcf, _iTabCur+i32(1))
if _pWInfo == nil {
goto _delete_from_cleanup
}
_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
func() {
if (_pTab.X16) != i32(0) && _eOnePass == i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105048), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115166)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTab.X16) == 0 && _bComplex == 0 && _eOnePass == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105049), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115212)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(128)) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(73), _memCnt, i32(1))
}
if _pPk == nil {
goto _62
}
_i = i32(0)
_63:
if _i >= int32(_nPk) {
goto _66
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105059), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115265)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iTabCur, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i)
_i += 1
goto _63
_66:
_iKey = _iPk
goto _69
_62:
_iKey = (_pParse.X18) + i32(1)
_iKey = _sqlite3ExprCodeGetColumn(tls, _pParse, _pTab, i32(-1), _iTabCur, _iKey, uint8(i32(0)))
if _iKey > (_pParse.X18) {
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = _iKey
}
_69:
if _eOnePass == i32(0) {
goto _71
}
_nKey = _nPk
_aToOpen = (*uint8)(_sqlite3DbMallocRawNN(tls, _db, uint64(_nIdx+i32(2))))
if _aToOpen == nil {
_sqlite3WhereEnd(tls, _pWInfo)
goto _delete_from_cleanup
}
crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint32(_nIdx+i32(1)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0))
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iTabCur))) = uint8(i32(0))
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iTabCur))) = uint8(i32(0))
}
if _addrEphOpen != 0 {
_sqlite3VdbeChangeToNoop(tls, _v, _addrEphOpen)
}
goto _76
_71:
if _pPk != nil {
_iKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_nKey = int16(i32(0))
_sqlite3VdbeAddOp4(tls, _v, i32(101), _iPk, int32(_nPk), _iKey, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pPk), int32(_nPk))
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iEphCur, _iKey, _iPk, int32(_nPk))
goto _78
}
_nKey = int16(i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(145), _iRowSet, _iKey)
_78:
_76:
if _eOnePass != i32(0) {
_addrBypass = _sqlite3VdbeMakeLabel(tls, _v)
goto _80
}
_sqlite3WhereEnd(tls, _pWInfo)
_80:
if _isView != 0 {
goto _81
}
_28_iAddrOnce = i32(0)
if _eOnePass == i32(2) {
_28_iAddrOnce = _sqlite3VdbeAddOp0(tls, _v, i32(20))
}
_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, i32(107), uint8(i32(8)), _iTabCur, _aToOpen, &_iDataCur, &_iIdxCur)
func() {
if _pPk == nil && (_pTab.X16) == 0 && _iDataCur != _iTabCur {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105121), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115285)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pPk == nil && (_pTab.X16) == 0 && _iIdxCur != (_iDataCur+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115329)))
crt.X__builtin_abort(tls)
}
}()
if _eOnePass == i32(2) {
_sqlite3VdbeJumpHere(tls, _v, _28_iAddrOnce)
}
_81:
if _eOnePass == i32(0) {
goto _92
}
func() {
if int32(_nKey) != int32(_nPk) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105130), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115375)))
crt.X__builtin_abort(tls)
}
}()
if ((_pTab.X16) == 0) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_iDataCur-_iTabCur)))) != 0) {
func() {
if _pPk == nil && (*XSelect)(_pTab.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105132), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115385)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iDataCur, _addrBypass, _iKey, int32(_nKey))
}
goto _104
_92:
if _pPk != nil {
_addrLoop = _sqlite3VdbeAddOp1(tls, _v, i32(37), _iEphCur)
_sqlite3VdbeAddOp2(tls, _v, i32(124), _iEphCur, _iKey)
func() {
if int32(_nKey) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105139), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115412)))
crt.X__builtin_abort(tls)
}
}()
goto _104
}
_addrLoop = _sqlite3VdbeAddOp3(tls, _v, i32(42), _iRowSet, i32(0), _iKey)
func() {
if int32(_nKey) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105143), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115420)))
crt.X__builtin_abort(tls)
}
}()
_104:
if (_pTab.X16) == 0 {
goto _107
}
_34_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
_sqlite3VdbeAddOp4(tls, _v, i32(12), i32(0), i32(1), _iKey, _34_pVTab, i32(-8))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(2)))
func() {
if _eOnePass != i32(0) && _eOnePass != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105153), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DeleteFromØ00__func__Ø000))), unsafe.Pointer(str(115428)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3MayAbort(tls, _pParse)
if (_eOnePass == i32(1)) && ((*XParse)(_pParse.X39) == nil) {
*(*uint8)(unsafe.Pointer(&(_pParse.X8))) = uint8(i32(0))
}
goto _113
_107:
_36_count = bool2int(int32(_pParse.X6) == i32(0))
_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _pTrigger, _iDataCur, _iIdxCur, _iKey, _nKey, uint8(_36_count), uint8(i32(10)), uint8(_eOnePass), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))))
_113:
if _eOnePass != i32(0) {
_sqlite3VdbeResolveLabel(tls, _v, _addrBypass)
_sqlite3WhereEnd(tls, _pWInfo)
goto _117
}
if _pPk != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iEphCur, _addrLoop+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
goto _117
}
_sqlite3VdbeGoto(tls, _v, _addrLoop)
_sqlite3VdbeJumpHere(tls, _v, _addrLoop)
_117:
_45:
if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) {
_sqlite3AutoincrementEnd(tls, _pParse)
}
if (((_db.X6)&i32(128)) != 0 && ((_pParse.X6) == 0)) && ((*XTable)(_pParse.X40) == nil) {
_sqlite3VdbeAddOp2(tls, _v, i32(67), _memCnt, i32(1))
_sqlite3VdbeSetNumCols(tls, _v, i32(1))
_sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(115478), nil)
}
_delete_from_cleanup:
_sqlite3AuthContextPop(tls, &_sContext)
_sqlite3SrcListDelete(tls, _db, _pTabList)
_sqlite3ExprDelete(tls, _db, _pWhere)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aToOpen))
_ = _sContext
_ = _sNC
_ = _aiCurOnePass
}
var _sqlite3DeleteFromØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DeleteFromØ00__func__Ø000[0], str(115491), 18)
}
// Return a list of all triggers on table pTab if there exists at least
// one trigger that must be fired when an operation of type 'op' is
// performed on the table, and, if that operation is an UPDATE, if at
// least one of the columns in pChanges is being modified.
func _sqlite3TriggersExist(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _pChanges *XExprList, _pMask *int32) (r0 *XTrigger) {
var _mask int32
var _pList, _p *XTrigger
_mask = i32(0)
_pList = nil
if (((*Xsqlite3)(_pParse.X0).X6) & i32(16777216)) != i32(0) {
_pList = _sqlite3TriggerList(tls, _pParse, _pTab)
}
func() {
if _pList != nil && (_pTab.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123273), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggersExistØ00__func__Ø000))), unsafe.Pointer(str(115509)))
crt.X__builtin_abort(tls)
}
}()
_p = _pList
_4:
if _p == nil {
goto _7
}
if (int32(_p.X2) == _op) && _checkColumnOverlap(tls, (*XIdList)(_p.X5), _pChanges) != 0 {
{
p := &_mask
*p = (*p) | int32(_p.X3)
sink1 = *p
}
}
_p = (*XTrigger)(_p.X9)
goto _4
_7:
if _pMask != nil {
*_pMask = _mask
}
return func() *XTrigger {
if _mask != 0 {
return _pList
}
return nil
}()
}
// Given table pTab, return a list of all the triggers attached to
// the table. The list is connected by Trigger.pNext pointers.
//
// All of the triggers on pTab that are in the same database as pTab
// are already attached to pTab->pTrigger. But there might be additional
// triggers on pTab in the TEMP schema. This routine prepends all
// TEMP triggers on pTab to the beginning of the pTab->pTrigger list
// and returns the combined list.
//
// To state it another way: This routine returns a list of all triggers
// that fire off of pTab. The list will include any TEMP triggers on
// pTab as well as the triggers lised in pTab->pTrigger.
func _sqlite3TriggerList(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *XTrigger) {
var _pTmpSchema *XSchema
var _2_p *XHashElem
var _pList, _3_pTrig *XTrigger
_pTmpSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 16*uintptr(i32(1)))).X4)
_pList = nil
if (_pParse.X47) != 0 {
return nil
}
if _pTmpSchema == (*XSchema)(_pTab.X20) {
goto _1
}
func() {
if _sqlite3SchemaMutexHeld(tls, (*Xsqlite3)(_pParse.X0), i32(0), _pTmpSchema) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122701), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggerListØ00__func__Ø000))), unsafe.Pointer(str(115540)))
crt.X__builtin_abort(tls)
}
}()
_2_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pTmpSchema.X4))).X2)
_4:
if _2_p == nil {
goto _7
}
_3_pTrig = (*XTrigger)(_2_p.X2)
if ((*XSchema)(_3_pTrig.X7) == (*XSchema)(_pTab.X20)) && (i32(0) == _sqlite3StrICmp(tls, _3_pTrig.X1, _pTab.X0)) {
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_pTrig.X9))))) = func() *XTrigger {
if _pList != nil {
return _pList
}
return (*XTrigger)(_pTab.X19)
}()
_pList = _3_pTrig
}
_2_p = (*XHashElem)(_2_p.X0)
goto _4
_7:
_1:
return func() *XTrigger {
if _pList != nil {
return _pList
}
return (*XTrigger)(_pTab.X19)
}()
}
var _sqlite3TriggerListØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TriggerListØ00__func__Ø000[0], str(115590), 19)
}
var _sqlite3TriggersExistØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TriggersExistØ00__func__Ø000[0], str(115609), 21)
}
// pEList is the SET clause of an UPDATE statement. Each entry
// in pEList is of the format =. If any of the entries
// in pEList have an which matches an identifier in pIdList,
// then return TRUE. If pIdList==NULL, then it is considered a
// wildcard that matches anything. Likewise if pEList==NULL then
// it matches anything so always return true. Return false only
// if there is no match.
func _checkColumnOverlap(tls *crt.TLS, _pIdList *XIdList, _pEList *XExprList) (r0 int32) {
var _e int32
if (_pIdList == nil) || func() int32 {
if _pEList == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123246), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkColumnOverlapØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return i32(1)
}
_e = i32(0)
_4:
if _e >= (_pEList.X0) {
goto _7
}
if _sqlite3IdListIndex(tls, _pIdList, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(_e))).X1) >= i32(0) {
return i32(1)
}
_e += 1
goto _4
_7:
return i32(0)
}
var _checkColumnOverlapØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_checkColumnOverlapØ00__func__Ø000[0], str(115630), 19)
}
// 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 _sqlite3FkRequired(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aChange *int32, _chngRowid int32) (r0 int32) {
var _eRet int32
var _3_p *XFKey
_eRet = i32(0)
if (((*Xsqlite3)(_pParse.X0).X6) & i32(524288)) == 0 {
goto _0
}
if _aChange == nil {
_eRet = bool2int((_sqlite3FkReferences(tls, _pTab) != nil) || ((*XFKey)(_pTab.X4) != nil))
goto _3
}
_3_p = (*XFKey)(_pTab.X4)
_4:
if _3_p == nil {
goto _7
}
if i32(0) == Xsqlite3_stricmp(tls, _pTab.X0, _3_p.X2) {
return i32(2)
}
if _fkChildIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) != 0 {
_eRet = i32(1)
}
_3_p = (*XFKey)(_3_p.X1)
goto _4
_7:
_3_p = _sqlite3FkReferences(tls, _pTab)
_10:
if _3_p == nil {
goto _13
}
if _fkParentIsModified(tls, _pTab, _3_p, _aChange, _chngRowid) == 0 {
goto _14
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_3_p.X7))))) + 1*uintptr(i32(1))))) != i32(0) {
return i32(2)
}
_eRet = i32(1)
_14:
_3_p = (*XFKey)(_3_p.X3)
goto _10
_13:
_3:
_0:
return _eRet
}
// The second argument points to an FKey object representing a foreign key
// for which pTab is the child table. An UPDATE statement against pTab
// is currently being processed. For each column of the table that is
// actually updated, the corresponding element in the aChange[] array
// is zero or greater (if a column is unmodified the corresponding element
// is set to -1). If the rowid column is modified by the UPDATE statement
// the bChngRowid argument is non-zero.
//
// This function returns true if any of the columns that are part of the
// child key for FK constraint *p are modified.
func _fkChildIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
var _i, _1_iChildKey int32
_i = i32(0)
_0:
if _i >= (_p.X5) {
goto _3
}
_1_iChildKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_p.X9))))) + 8*uintptr(_i))).X0
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aChange)) + 4*uintptr(_1_iChildKey)))) >= i32(0) {
return i32(1)
}
if (_1_iChildKey == int32(_pTab.X10)) && _bChngRowid != 0 {
return i32(1)
}
_i += 1
goto _0
_3:
return i32(0)
}
// The second argument points to an FKey object representing a foreign key
// for which pTab is the parent table. An UPDATE statement against pTab
// is currently being processed. For each column of the table that is
// actually updated, the corresponding element in the aChange[] array
// is zero or greater (if a column is unmodified the corresponding element
// is set to -1). If the rowid column is modified by the UPDATE statement
// the bChngRowid argument is non-zero.
//
// This function returns true if any of the columns that are part of the
// parent key for FK constraint *p are modified.
func _fkParentIsModified(tls *crt.TLS, _pTab *XTable, _p *XFKey, _aChange *int32, _bChngRowid int32) (r0 int32) {
var _i, _1_iKey int32
var _1_zKey *int8
var _3_pCol *XColumn
_i = i32(0)
_0:
if _i >= (_p.X5) {
goto _3
}
_1_zKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_p.X9))))) + 8*uintptr(_i))).X1
_1_iKey = i32(0)
_4:
if _1_iKey >= int32(_pTab.X11) {
goto _7
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aChange)) + 4*uintptr(_1_iKey)))) < i32(0) && (_1_iKey != int32(_pTab.X10) || _bChngRowid == 0) {
goto _10
}
_3_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_1_iKey)))
if _1_zKey == nil {
goto _11
}
if i32(0) == _sqlite3StrICmp(tls, _3_pCol.X0, _1_zKey) {
return i32(1)
}
goto _14
_11:
if (int32(_3_pCol.X6) & i32(1)) != 0 {
return i32(1)
}
_14:
_10:
_1_iKey += 1
goto _4
_7:
_i += 1
goto _0
_3:
return i32(0)
}
// 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 _sqlite3IsReadOnly(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _viewOk int32) (r0 int32) {
if ((_pTab.X16) != 0 && (*(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32
}{(*(*func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
}{((*Xsqlite3_module)((*XModule)(_sqlite3GetVTable(tls, (*Xsqlite3)(_pParse.X0), _pTab).X1).X0).X13)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, int32, **XMem, *int64) int32
}{nil})))) || (((((_pTab.X9) & uint32(i32(1))) != uint32(i32(0))) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(2048)) == i32(0))) && (int32(_pParse.X6) == i32(0))) {
_sqlite3ErrorMsg(tls, _pParse, str(115649), unsafe.Pointer(_pTab.X0))
return i32(1)
}
if (_viewOk == 0) && ((*XSelect)(_pTab.X3) != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(115678), unsafe.Pointer(_pTab.X0))
return i32(1)
}
return i32(0)
}
// 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 _sqlite3AuthContextPush(tls *crt.TLS, _pParse *XParse, _pContext *XAuthContext, _zContext *int8) {
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99676), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AuthContextPushØ00__func__Ø000))), unsafe.Pointer(str(115716)))
crt.X__builtin_abort(tls)
}
}()
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pContext.X1))))) = _pParse
*(**int8)(unsafe.Pointer(&(_pContext.X0))) = _pParse.X65
*(**int8)(unsafe.Pointer(&(_pParse.X65))) = _zContext
}
var _sqlite3AuthContextPushØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AuthContextPushØ00__func__Ø000[0], str(115723), 23)
}
// Set a flag in the vdbe to update the change counter when it is finalised
// or reset.
func _sqlite3VdbeCountChanges(tls *crt.TLS, _v *TVdbe) {
storebits18((*int16)(unsafe.Pointer(&(_v.X32))), int16(i32(1)), 16, 4)
}
// 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 _sqlite3MaterializeView(tls *crt.TLS, _pParse *XParse, _pView *XTable, _pWhere *XExpr, _iCur int32) {
var _iDb int32
var _db *Xsqlite3
var _pFrom *XSrcList
var _pSel *XSelect
var _dest XSelectDest
_db = (*Xsqlite3)(_pParse.X0)
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pView.X20))
_pWhere = _sqlite3ExprDup(tls, _db, _pWhere, i32(0))
_pFrom = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
if _pFrom != nil {
func() {
if (_pFrom.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104736), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115746)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 68*uintptr(i32(0)))).X2))) = _sqlite3DbStrDup(tls, _db, _pView.X0)
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2))))) + 68*uintptr(i32(0)))).X1))) = _sqlite3DbStrDup(tls, _db, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
func() {
if (*XExpr)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2)))))+68*uintptr(i32(0)))).X12) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104739), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115761)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XIdList)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pFrom.X2)))))+68*uintptr(i32(0)))).X13) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104740), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3MaterializeViewØ00__func__Ø000))), unsafe.Pointer(str(115780)))
crt.X__builtin_abort(tls)
}
}()
}
_pSel = _sqlite3SelectNew(tls, _pParse, nil, _pFrom, _pWhere, nil, nil, nil, uint32(i32(131072)), nil, nil)
_sqlite3SelectDestInit(tls, &_dest, i32(12), _iCur)
_sqlite3Select(tls, _pParse, _pSel, &_dest)
_sqlite3SelectDelete(tls, _db, _pSel)
_ = _dest
}
var _sqlite3MaterializeViewØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3MaterializeViewØ00__func__Ø000[0], str(115802), 23)
}
// Allocate a new Select structure and return a pointer to that
// structure.
func _sqlite3SelectNew(tls *crt.TLS, _pParse *XParse, _pEList *XExprList, _pSrc *XSrcList, _pWhere *XExpr, _pGroupBy *XExprList, _pHaving *XExpr, _pOrderBy *XExprList, _selFlags uint32, _pLimit *XExpr, _pOffset *XExpr) (r0 *XSelect) {
var _standin XSelect
var _pNew *XSelect
_pNew = (*XSelect)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(80))))
if _pNew == nil {
func() {
if ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116638), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(42486)))
crt.X__builtin_abort(tls)
}
}()
_pNew = &_standin
}
if _pEList == nil {
_pEList = _sqlite3ExprListAppend(tls, _pParse, nil, _sqlite3Expr(tls, (*Xsqlite3)(_pParse.X0), i32(161), nil))
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pEList
*(*uint8)(unsafe.Pointer(&(_pNew.X1))) = uint8(i32(119))
*(*uint32)(unsafe.Pointer(&(_pNew.X3))) = _selFlags
*(*int32)(unsafe.Pointer(&(_pNew.X4))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pNew.X5))) = i32(0)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int8)(unsafe.Pointer(&(_pNew.X6))))) + 1*uintptr(i32(0)))) = int8(i32(0))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pNew.X7))))) + 4*uintptr(i32(0)))) = i32(-1)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pNew.X7))))) + 4*uintptr(i32(1)))) = i32(-1)
*(*int16)(unsafe.Pointer(&(_pNew.X2))) = int16(i32(0))
if _pSrc == nil {
_pSrc = (*XSrcList)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(76))))
}
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X8))))) = _pSrc
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X9))))) = _pWhere
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X10))))) = _pGroupBy
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X11))))) = _pHaving
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X12))))) = _pOrderBy
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X13))))) = nil
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X14))))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X15))))) = _pLimit
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X16))))) = _pOffset
*(**XWith)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X17))))) = nil
func() {
if _pOffset != nil && _pLimit == nil && (_pParse.X16) <= i32(0) && int32((*Xsqlite3)(_pParse.X0).X17) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(115825)))
crt.X__builtin_abort(tls)
}
}()
if ((*Xsqlite3)(_pParse.X0).X17) != 0 {
_clearSelect(tls, (*Xsqlite3)(_pParse.X0), _pNew, bool2int(_pNew != &_standin))
_pNew = nil
goto _11
}
func() {
if (*XSrcList)(_pNew.X8) == nil && (_pParse.X16) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116671), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(115898)))
crt.X__builtin_abort(tls)
}
}()
_11:
func() {
if _pNew == &_standin {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116673), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SelectNewØ00__func__Ø000))), unsafe.Pointer(str(115930)))
crt.X__builtin_abort(tls)
}
}()
return _pNew
_ = _standin
panic(0)
}
var _sqlite3SelectNewØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SelectNewØ00__func__Ø000[0], str(115945), 17)
}
// Return ONEPASS_OFF (0) if an UPDATE or DELETE statement is unable to
// operate directly on the rowis returned by a WHERE clause. Return
// ONEPASS_SINGLE (1) if the statement can operation directly because only
// a single row is to be changed. Return ONEPASS_MULTI (2) if the one-pass
// optimization can be used on multiple
//
// If the ONEPASS optimization is used (if this routine returns true)
// then also write the indices of open cursors used by ONEPASS
// into aiCur[0] and aiCur[1]. iaCur[0] gets the cursor of the data
// table and iaCur[1] gets the cursor used by an auxiliary index.
// Either value may be -1, indicating that cursor is not used.
// Any cursors returned will have been opened for writing.
//
// aiCur[0] and aiCur[1] both get -1 if the where-clause logic is
// unable to use the ONEPASS optimization.
func _sqlite3WhereOkOnePass(tls *crt.TLS, _pWInfo *XWhereInfo, _aiCur *int32) (r0 int32) {
crt.Xmemcpy(tls, (unsafe.Pointer)(_aiCur), (unsafe.Pointer)((*[2]int32)(unsafe.Pointer(&(_pWInfo.X6)))), u32(8))
return int32(_pWInfo.X14)
}
// 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 _sqlite3OpenTableAndIndices(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _op int32, _p5 uint8, _iBase int32, _aToOpen *uint8, _piDataCur *int32, _piIdxCur *int32) (r0 int32) {
var _i, _iDb, _iDataCur, _4_iIdxCur int32
var _v *TVdbe
var _pIdx *XIndex
func() {
if _op != i32(106) && _op != i32(107) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110658), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000))), unsafe.Pointer(str(115962)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op != i32(107) && int32(_p5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110659), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000))), unsafe.Pointer(str(115998)))
crt.X__builtin_abort(tls)
}
}()
if (_pTab.X16) != 0 {
return i32(0)
}
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110668), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
if _iBase < i32(0) {
_iBase = _pParse.X17
}
_iDataCur = postInc1(&_iBase, int32(1))
if _piDataCur != nil {
*_piDataCur = _iDataCur
}
if (((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) && ((_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(i32(0))))) != 0)) {
_sqlite3OpenTable(tls, _pParse, _iDataCur, _iDb, _pTab, _op)
goto _14
}
_sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(bool2int(_op == i32(107))), _pTab.X0)
_14:
if _piIdxCur != nil {
*_piIdxCur = _iBase
}
*func() **XIndex { _i = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_16:
if _pIdx == nil {
goto _19
}
_4_iIdxCur = postInc1(&_iBase, int32(1))
func() {
if (*XSchema)(_pIdx.X6) != (*XSchema)(_pTab.X20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3OpenTableAndIndicesØ00__func__Ø000))), unsafe.Pointer(str(115137)))
crt.X__builtin_abort(tls)
}
}()
if int32((uint32(_pIdx.X16)<>uint(i32(30))) != i32(2) || ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) {
goto _23
}
if _piDataCur != nil {
*_piDataCur = _4_iIdxCur
}
_p5 = uint8(i32(0))
_23:
if (_aToOpen == nil) || ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_i+i32(1))))) != 0) {
_sqlite3VdbeAddOp3(tls, _v, _op, _4_iIdxCur, _pIdx.X11, _iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
_sqlite3VdbeChangeP5(tls, _v, uint16(_p5))
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pIdx.X0))
}
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_i }() += 1
goto _16
_19:
if _iBase > (_pParse.X17) {
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = _iBase
}
return _i
}
var _sqlite3OpenTableAndIndicesØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3OpenTableAndIndicesØ00__func__Ø000[0], str(116024), 27)
}
// Make sure virtual table pTab is contained in the pParse->apVirtualLock[]
// array so that an OP_VBegin will get generated for it. Add pTab to the
// array if it is missing. If pTab is already in the array, this routine
// is a no-op.
func _sqlite3VtabMakeWritable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
var _i, _n int32
var _pToplevel *XParse
var _apVtabLock **XTable
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
func() {
if (_pTab.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126093), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabMakeWritableØ00__func__Ø000))), unsafe.Pointer(str(24529)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_4:
if _i >= (_pToplevel.X56) {
goto _7
}
if _pTab == (*(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pToplevel.X67)) + 4*uintptr(_i)))) {
return
}
_i += 1
goto _4
_7:
_n = int32(uint32((_pToplevel.X56)+i32(1)) * u32(4))
_apVtabLock = (**XTable)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_pToplevel.X67), uint64(_n)))
if _apVtabLock != nil {
*(***XTable)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_pToplevel.X67))))) = _apVtabLock
*(**XTable)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pToplevel.X67)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_pToplevel.X56))), int32(1))))) = _pTab
goto _10
}
_sqlite3OomFault(tls, (*Xsqlite3)(_pToplevel.X0))
_10:
}
var _sqlite3VtabMakeWritableØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabMakeWritableØ00__func__Ø000[0], str(116051), 24)
}
// 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 _sqlite3GenerateRowDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pTrigger *XTrigger, _iDataCur int32, _iIdxCur int32, _iPk int32, _nPk int16, _count uint8, _onconf uint8, _eMode uint8, _iIdxNoSeek int32) {
var _iOld, _iLabel, _2_iCol, _2_addrStart int32
var _2_mask uint32
var _opSeek, _6_p5 uint8
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
_iOld = i32(0)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105274), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateRowDeleteØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
_iLabel = _sqlite3VdbeMakeLabel(tls, _v)
_opSeek = uint8(func() int32 {
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
return i32(32)
}
return i32(29)
}())
if int32(_eMode) == i32(0) {
_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
}
if _sqlite3FkRequired(tls, _pParse, _pTab, nil, i32(0)) == 0 && _pTrigger == nil {
goto _6
}
_2_mask = _sqlite3TriggerColmask(tls, _pParse, _pTrigger, nil, i32(0), i32(3), _pTab, int32(_onconf))
{
p := &_2_mask
*p = (*p) | _sqlite3FkOldmask(tls, _pParse, _pTab)
sink5 = *p
}
_iOld = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (i32(1) + int32(_pTab.X11))
sink1 = *p
}
_sqlite3VdbeAddOp2(tls, _v, i32(64), _iPk, _iOld)
_2_iCol = i32(0)
_7:
if _2_iCol >= int32(_pTab.X11) {
goto _10
}
if (_2_mask == u32(4294967295)) || ((_2_iCol <= i32(31)) && ((_2_mask & (u32(1) << uint(_2_iCol))) != uint32(i32(0)))) {
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _2_iCol, (_iOld+_2_iCol)+i32(1))
}
_2_iCol += 1
goto _7
_10:
_2_addrStart = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(109), nil, i32(1), _pTab, _iOld, int32(_onconf), _iLabel)
if _2_addrStart < _sqlite3VdbeCurrentAddr(tls, _v) {
_sqlite3VdbeAddOp4Int(tls, _v, int32(_opSeek), _iDataCur, _iLabel, _iPk, int32(_nPk))
_iIdxNoSeek = i32(-1)
}
_sqlite3FkCheck(tls, _pParse, _pTab, _iOld, i32(0), nil, i32(0))
_6:
if (*XSelect)(_pTab.X3) != nil {
goto _15
}
_6_p5 = u8(0)
_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, _iIdxNoSeek)
_sqlite3VdbeAddOp2(tls, _v, i32(120), _iDataCur, func() int32 {
if _count != 0 {
return i32(1)
}
return i32(0)
}())
if int32(_pParse.X6) == i32(0) {
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pTab), i32(-15))
}
if int32(_eMode) != i32(0) {
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(4)))
}
if (_iIdxNoSeek >= i32(0)) && (_iIdxNoSeek != _iDataCur) {
_sqlite3VdbeAddOp1(tls, _v, i32(120), _iIdxNoSeek)
}
if int32(_eMode) == i32(2) {
{
p := &_6_p5
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
}
_sqlite3VdbeChangeP5(tls, _v, uint16(_6_p5))
_15:
_sqlite3FkActions(tls, _pParse, _pTab, nil, _iOld, nil, i32(0))
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(109), nil, i32(2), _pTab, _iOld, int32(_onconf), _iLabel)
_sqlite3VdbeResolveLabel(tls, _v, _iLabel)
}
var _sqlite3GenerateRowDeleteØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GenerateRowDeleteØ00__func__Ø000[0], str(116075), 25)
}
// Triggers may access values stored in the old.* or new.* pseudo-table.
// This function returns a 32-bit bitmask indicating which columns of the
// old.* or new.* tables actually are used by triggers. This information
// may be used by the caller, for example, to avoid having to load the entire
// old.* record into memory when executing an UPDATE or DELETE command.
//
// Bit 0 of the returned mask is set if the left-most column of the
// table may be accessed using an [old|new]. reference. Bit 1 is set if
// the second leftmost column value is required, and so on. If there
// are more than 32 columns in the table, and at least one of the columns
// with an index greater than 32 may be accessed, 0xffffffff is returned.
//
// It is not possible to determine if the old.rowid or new.rowid column is
// accessed by triggers. The caller must always assume that it is.
//
// Parameter isNew must be either 1 or 0. If it is 0, then the mask returned
// applies to the old.* table. If 1, the new.* table.
//
// Parameter tr_tm must be a mask with one or both of the TRIGGER_BEFORE
// and TRIGGER_AFTER bits set. Values accessed by BEFORE triggers are only
// included in the returned mask if the TRIGGER_BEFORE bit is set in the
// tr_tm parameter. Similarly, values accessed by AFTER triggers are only
// included in the returned mask if the TRIGGER_AFTER bit is set in tr_tm.
func _sqlite3TriggerColmask(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pChanges *XExprList, _isNew int32, _tr_tm int32, _pTab *XTable, _orconf int32) (r0 uint32) {
var _op int32
var _mask uint32
var _p *XTrigger
var _2_pPrg *XTriggerPrg
_op = func() int32 {
if _pChanges != nil {
return i32(110)
}
return i32(109)
}()
_mask = u32(0)
func() {
if _isNew != i32(1) && _isNew != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123727), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggerColmaskØ00__func__Ø000))), unsafe.Pointer(str(116100)))
crt.X__builtin_abort(tls)
}
}()
_p = _pTrigger
_5:
if _p == nil {
goto _8
}
if int32(_p.X2) != _op || (_tr_tm&int32(_p.X3)) == 0 || _checkColumnOverlap(tls, (*XIdList)(_p.X5), _pChanges) == 0 {
goto _11
}
_2_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
if _2_pPrg != nil {
{
p := &_mask
*p = (*p) | (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_2_pPrg.X4))))) + 4*uintptr(_isNew))))
sink5 = *p
}
}
_11:
_p = (*XTrigger)(_p.X9)
goto _5
_8:
return _mask
}
var _sqlite3TriggerColmaskØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TriggerColmaskØ00__func__Ø000[0], str(116121), 22)
}
// Return a pointer to a TriggerPrg object containing the sub-program for
// trigger pTrigger with default ON CONFLICT algorithm orconf. If no such
// TriggerPrg object exists, a new object is allocated and populated before
// being returned.
func _getRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
var _pRoot *XParse
var _pPrg *XTriggerPrg
_pRoot = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
func() {
if (_pTrigger.X0) != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123555), unsafe.Pointer((*int8)(unsafe.Pointer(&_getRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116143)))
crt.X__builtin_abort(tls)
}
}()
_pPrg = (*XTriggerPrg)(_pRoot.X69)
_5:
if _pPrg == nil || (*XTrigger)(_pPrg.X0) == _pTrigger && (_pPrg.X3) == _orconf {
goto _10
}
_pPrg = (*XTriggerPrg)(_pPrg.X1)
goto _5
_10:
if _pPrg == nil {
_pPrg = _codeRowTrigger(tls, _pParse, _pTrigger, _pTab, _orconf)
}
return _pPrg
}
var _getRowTriggerØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_getRowTriggerØ00__func__Ø000[0], str(116196), 14)
}
// Create and populate a new TriggerPrg object with a sub-program
// implementing trigger pTrigger with ON CONFLICT policy orconf.
func _codeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _pTab *XTable, _orconf int32) (r0 *XTriggerPrg) {
var _iEndTrigger int32
var _db *Xsqlite3
var _v *TVdbe
var _pWhen *XExpr
var _pTop, _pSubParse *XParse
var _pProgram *XSubProgram
var _sNC XNameContext
var _pPrg *XTriggerPrg
_pTop = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
_db = (*Xsqlite3)(_pParse.X0)
_pWhen = nil
_pProgram = nil
_iEndTrigger = i32(0)
func() {
if (_pTrigger.X0) != nil && _pTab != _tableOfTrigger(tls, _pTrigger) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123449), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116143)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*TVdbe)(_pTop.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123450), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116210)))
crt.X__builtin_abort(tls)
}
}()
_pPrg = (*XTriggerPrg)(_sqlite3DbMallocZero(tls, _db, uint64(u32(24))))
if _pPrg == nil {
return nil
}
*(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X1))))) = (*XTriggerPrg)(_pTop.X69)
*(**XTriggerPrg)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTop.X69))))) = _pPrg
*(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X2))))) = store75(&_pProgram, (*XSubProgram)(_sqlite3DbMallocZero(tls, _db, uint64(u32(28)))))
if _pProgram == nil {
return nil
}
_sqlite3VdbeLinkSubProgram(tls, (*TVdbe)(_pTop.X2), _pProgram)
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pPrg.X0))))) = _pTrigger
*(*int32)(unsafe.Pointer(&(_pPrg.X3))) = _orconf
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(0)))) = u32(4294967295)
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(1)))) = u32(4294967295)
_pSubParse = (*XParse)(_sqlite3DbMallocZero(tls, _db, uint64(u32(484))))
if _pSubParse == nil {
return nil
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pSubParse
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X0))))) = _db
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X40))))) = _pTab
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSubParse.X39))))) = _pTop
*(**int8)(unsafe.Pointer(&(_pSubParse.X65))) = _pTrigger.X0
*(*uint8)(unsafe.Pointer(&(_pSubParse.X45))) = _pTrigger.X2
*(*uint32)(unsafe.Pointer(&(_pSubParse.X42))) = _pParse.X42
_v = _sqlite3GetVdbe(tls, _pSubParse)
if _v == nil {
goto _10
}
_sqlite3VdbeComment(tls, _v, str(116222), unsafe.Pointer(_pTrigger.X0), unsafe.Pointer(_onErrorText(tls, _orconf)), unsafe.Pointer(func() *int8 {
if int32(_pTrigger.X3) == i32(1) {
return str(25167)
}
return str(25142)
}()), unsafe.Pointer(func() *int8 {
if int32(_pTrigger.X2) == i32(110) {
return str(25640)
}
return str(0)
}()), unsafe.Pointer(func() *int8 {
if int32(_pTrigger.X2) == i32(108) {
return str(25626)
}
return str(0)
}()), unsafe.Pointer(func() *int8 {
if int32(_pTrigger.X2) == i32(109) {
return str(25633)
}
return str(0)
}()), unsafe.Pointer(_pTab.X0))
_sqlite3VdbeChangeP4(tls, _v, i32(-1), _sqlite3MPrintf(tls, _db, str(116253), unsafe.Pointer(_pTrigger.X0)), i32(-1))
if (*XExpr)(_pTrigger.X4) == nil {
goto _19
}
_pWhen = _sqlite3ExprDup(tls, _db, (*XExpr)(_pTrigger.X4), i32(0))
if (i32(0) == _sqlite3ResolveExprNames(tls, &_sNC, _pWhen)) && (int32(_db.X17) == i32(0)) {
_iEndTrigger = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfFalse(tls, _pSubParse, _pWhen, _iEndTrigger, i32(16))
}
_sqlite3ExprDelete(tls, _db, _pWhen)
_19:
_codeTriggerProgram(tls, _pSubParse, (*XTriggerStep)(_pTrigger.X8), _orconf)
if _iEndTrigger != 0 {
_sqlite3VdbeResolveLabel(tls, _v, _iEndTrigger)
}
_sqlite3VdbeAddOp0(tls, _v, i32(55))
_sqlite3VdbeComment(tls, _v, str(116267), unsafe.Pointer(_pTrigger.X0), unsafe.Pointer(_onErrorText(tls, _orconf)))
_transferParseError(tls, _pParse, _pSubParse)
if int32(_db.X17) == i32(0) {
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pProgram.X0))))) = _sqlite3VdbeTakeOpArray(tls, _v, (*int32)(unsafe.Pointer(&(_pProgram.X1))), (*int32)(unsafe.Pointer(&(_pTop.X33))))
}
*(*int32)(unsafe.Pointer(&(_pProgram.X2))) = _pSubParse.X18
*(*int32)(unsafe.Pointer(&(_pProgram.X3))) = _pSubParse.X17
*(*unsafe.Pointer)(unsafe.Pointer(&(_pProgram.X5))) = (unsafe.Pointer)(_pTrigger)
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(0)))) = _pSubParse.X43
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint32)(unsafe.Pointer(&(_pPrg.X4))))) + 4*uintptr(i32(1)))) = _pSubParse.X44
_sqlite3VdbeDelete(tls, _v)
_10:
func() {
if (*TAggInfo_func)(_pSubParse.X38) != nil || (*XTable)(_pSubParse.X68) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123532), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116278)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTriggerPrg)(_pSubParse.X69) != nil || (_pSubParse.X33) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123533), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116322)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ParserReset(tls, _pSubParse)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pSubParse))
return _pPrg
_ = _sNC
panic(0)
}
var _codeRowTriggerØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_codeRowTriggerØ00__func__Ø000[0], str(116369), 15)
}
// Link the SubProgram object passed as the second argument into the linked
// list at Vdbe.pSubProgram. This list is used to delete all sub-program
// objects when the VM is no longer required.
func _sqlite3VdbeLinkSubProgram(tls *crt.TLS, _pVdbe *TVdbe, _p *XSubProgram) {
*(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = (*XSubProgram)(_pVdbe.X42)
*(**XSubProgram)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVdbe.X42))))) = _p
}
// This function is used to add VdbeComment() annotations to a VDBE
// program. It is not used in production code, only for debugging.
func _onErrorText(tls *crt.TLS, _onError int32) (r0 *int8) {
switch _onError {
case i32(1):
goto _2
case i32(2):
goto _1
case i32(3):
goto _3
case i32(4):
goto _5
case i32(5):
goto _4
case i32(10):
goto _6
default:
goto _7
}
_1:
return str(47531)
_2:
return str(47522)
_3:
return str(47537)
_4:
return str(7904)
_5:
return str(47542)
_6:
return str(116384)
_7:
return str(116392)
}
// Generate VDBE code for the statements inside the body of a single
// trigger.
func _codeTriggerProgram(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _orconf int32) (r0 int32) {
var _db *Xsqlite3
var _v *TVdbe
var _6_pSelect *XSelect
var _6_sDest XSelectDest
var _pStep *XTriggerStep
_v = (*TVdbe)(_pParse.X2)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (*XTable)(_pParse.X40) == nil || (*XParse)(_pParse.X39) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123331), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(116396)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pStepList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123332), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(116437)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123333), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_pStep = _pStepList
_7:
if _pStep == nil {
goto _10
}
*(*uint8)(unsafe.Pointer(&(_pParse.X46))) = func() uint8 {
if _orconf == i32(10) {
return (_pStep.X1)
}
return uint8(_orconf)
}()
func() {
if int32(_pParse.X11) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123349), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(116447)))
crt.X__builtin_abort(tls)
}
}()
switch int32(_pStep.X0) {
case i32(108):
goto _17
case i32(109):
goto _18
case i32(110):
goto _16
default:
goto _19
}
_16:
_sqlite3Update(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3ExprListDup(tls, _db, (*XExprList)(_pStep.X6), i32(0)), _sqlite3ExprDup(tls, _db, (*XExpr)(_pStep.X5), i32(0)), int32(_pParse.X46))
goto _20
_17:
_sqlite3Insert(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.X3), i32(0)), _sqlite3IdListDup(tls, _db, (*XIdList)(_pStep.X7)), int32(_pParse.X46))
goto _20
_18:
_sqlite3DeleteFrom(tls, _pParse, _targetSrcList(tls, _pParse, _pStep), _sqlite3ExprDup(tls, _db, (*XExpr)(_pStep.X5), i32(0)))
goto _20
_19:
func() {
if int32(_pStep.X0) != i32(119) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123377), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeTriggerProgramØ00__func__Ø000))), unsafe.Pointer(str(116472)))
crt.X__builtin_abort(tls)
}
}()
_6_pSelect = _sqlite3SelectDup(tls, _db, (*XSelect)(_pStep.X3), i32(0))
_sqlite3SelectDestInit(tls, &_6_sDest, i32(4), i32(0))
_sqlite3Select(tls, _pParse, _6_pSelect, &_6_sDest)
_sqlite3SelectDelete(tls, _db, _6_pSelect)
goto _20
_20:
if int32(_pStep.X0) != i32(119) {
_sqlite3VdbeAddOp0(tls, _v, i32(121))
}
_pStep = (*XTriggerStep)(_pStep.X8)
goto _7
_10:
return i32(0)
_ = _6_sDest
panic(0)
}
var _codeTriggerProgramØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_codeTriggerProgramØ00__func__Ø000[0], str(116493), 19)
}
// Process an UPDATE statement.
//
// UPDATE OR IGNORE table_wxyz SET a=b, c=d WHERE e<5 AND f NOT NULL;
// \_______/ \________/ \______/ \________________/
// * onError pTabList pChanges pWhere
func _sqlite3Update(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pChanges *XExprList, _pWhere *XExpr, _onError int32) {
var _nPk, _21_iIdxCol int16
var _i, _j, _addrTop, _nIdx, _iBaseCur, _iDataCur, _iIdxCur, _iDb, _eOnePass, _hasFK, _labelBreak, _labelContinue, _flags, _isView, _tmask, _newmask, _iEph, _nKey, _addrOpen, _iPk, _bReplace, _regRowCount, _regOldRowid, _regNewRowid, _regNew, _regOld, _regRowSet, _regKey, _15_rc, _18_reg, _36_iCur, _45_addrOnce, _71_addr1 int32
var _55_oldmask uint32
var _aRegIdx, _aXRef *int32
var _chngPk, _chngRowid, _chngKey uint8
var _aToOpen *uint8
var _db *Xsqlite3
var _pTrigger *XTrigger
var _pTab *XTable
var _v *TVdbe
var _aiCurOnePass [2]int32
var _pRowidExpr *XExpr
var _pIdx, _pPk *XIndex
var _sNC XNameContext
var _sContext XAuthContext
var _pWInfo *XWhereInfo
_addrTop = i32(0)
_aRegIdx = nil
_aXRef = nil
_pRowidExpr = nil
_iEph = i32(0)
_nKey = i32(0)
_addrOpen = i32(0)
_iPk = i32(0)
_nPk = i16(0)
_bReplace = i32(0)
_regRowCount = i32(0)
_regOldRowid = i32(0)
_regNewRowid = i32(0)
_regNew = i32(0)
_regOld = i32(0)
_regRowSet = i32(0)
_regKey = i32(0)
crt.Xmemset(tls, (unsafe.Pointer)(&_sContext), i32(0), u32(8))
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
goto _update_cleanup
}
func() {
if (_pTabList.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123900), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(115025)))
crt.X__builtin_abort(tls)
}
}()
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
if _pTab == nil {
goto _update_cleanup
}
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(110), _pChanges, &_tmask)
_isView = bool2int((*XSelect)(_pTab.X3) != nil)
func() {
if _pTrigger == nil && _tmask != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123914), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116512)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
goto _update_cleanup
}
if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
goto _update_cleanup
}
*(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X11))) = store1(&_iBaseCur, store1(&_iDataCur, postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))))
_iIdxCur = _iDataCur + i32(1)
_pPk = func() *XIndex {
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
return nil
}
return _sqlite3PrimaryKeyIndex(tls, _pTab)
}()
*func() **XIndex { _nIdx = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_12:
if _pIdx == nil {
goto _15
}
if (int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2)) && (_pPk != nil) {
_iDataCur = _pParse.X17
*(*int32)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X11))) = _iDataCur
}
*(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_nIdx }() += 1
goto _12
_15:
_aXRef = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(((u32(4)*uint32(int32(_pTab.X11)+_nIdx))+uint32(_nIdx))+uint32(i32(2)))))
if _aXRef == nil {
goto _update_cleanup
}
_aRegIdx = (*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aXRef)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_pTab.X11)))))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))
_aToOpen = (*uint8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(_aRegIdx)) + uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(_nIdx)))))*uintptr(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr(4)))))))))))))
crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint32(_nIdx+i32(1)))
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_nIdx+i32(1)))) = uint8(i32(0))
_i = i32(0)
_19:
if _i >= int32(_pTab.X11) {
goto _22
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i))) = i32(-1)
_i += 1
goto _19
_22:
crt.Xmemset(tls, (unsafe.Pointer)(&_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X0))))) = _pParse
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNC.X1))))) = _pTabList
_chngRowid = store2(&_chngPk, uint8(i32(0)))
_i = i32(0)
_23:
if _i >= (_pChanges.X0) {
goto _26
}
if _sqlite3ResolveExprNames(tls, &_sNC, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(_i))).X0)) != 0 {
goto _update_cleanup
}
_j = i32(0)
_28:
if _j >= int32(_pTab.X11) {
goto _31
}
if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_j))).X0, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(_i))).X1) != i32(0) {
goto _32
}
if _j == int32(_pTab.X10) {
_chngRowid = uint8(i32(1))
_pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2))))) + 20*uintptr(_i))).X0)
goto _36
}
if (_pPk != nil) && ((int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_j))).X6) & i32(1)) != i32(0)) {
_chngPk = uint8(i32(1))
}
_36:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_j))) = _i
goto _31
_32:
_j += 1
goto _28
_31:
if _j < int32(_pTab.X11) {
goto _37
}
if (_pPk == nil) && _sqlite3IsRowid(tls, (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(_i))).X1) != 0 {
_j = i32(-1)
_chngRowid = uint8(i32(1))
_pRowidExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2))))) + 20*uintptr(_i))).X0)
goto _40
}
_sqlite3ErrorMsg(tls, _pParse, str(116533), unsafe.Pointer((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(_i))).X1))
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
goto _update_cleanup
_40:
_37:
_15_rc = _sqlite3AuthCheck(tls, _pParse, i32(23), _pTab.X0, func() *int8 {
if _j < i32(0) {
return str(96456)
}
return ((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_j))).X0)
}(), (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0)
if _15_rc == i32(1) {
goto _update_cleanup
}
if _15_rc == i32(2) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_j))) = i32(-1)
}
_i += 1
goto _23
_26:
func() {
if (int32(_chngRowid) & int32(_chngPk)) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124012), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116552)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_chngRowid) != i32(0) && int32(_chngRowid) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124013), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116576)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_chngPk) != i32(0) && int32(_chngPk) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124014), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116605)))
crt.X__builtin_abort(tls)
}
}()
_chngKey = uint8(int32(_chngRowid) + int32(_chngPk))
*(*uint64)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X14))) = func() uint64 {
if (_pTab.X16) != 0 {
return u64(18446744073709551615)
}
return uint64(i32(0))
}()
_hasFK = _sqlite3FkRequired(tls, _pParse, _pTab, _aXRef, int32(_chngKey))
*func() **XIndex { _j = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_56:
if _pIdx == nil {
goto _59
}
if (((_chngKey != 0) || (_hasFK > i32(1))) || ((*XExpr)(_pIdx.X9) != nil)) || (_pIdx == _pPk) {
_18_reg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_pIdx.X14)
sink1 = *p
}
goto _64
}
_18_reg = i32(0)
_i = i32(0)
_65:
if _i >= int32(_pIdx.X13) {
goto _68
}
_21_iIdxCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))
if int32(_21_iIdxCol) >= i32(0) && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_21_iIdxCol)))) < i32(0) {
goto _70
}
_18_reg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_pIdx.X14)
sink1 = *p
}
if (_onError == i32(5)) || ((_onError == i32(10)) && (int32(_pIdx.X15) == i32(5))) {
_bReplace = i32(1)
}
goto _68
_70:
_i += 1
goto _65
_68:
_64:
if _18_reg == i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_j+i32(1)))) = uint8(i32(0))
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_j))) = _18_reg
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_j }() += 1
goto _56
_59:
if _bReplace != 0 {
crt.Xmemset(tls, (unsafe.Pointer)(_aToOpen), i32(1), uint32(_nIdx+i32(1)))
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _update_cleanup
}
if int32(_pParse.X6) == i32(0) {
_sqlite3VdbeCountChanges(tls, _v)
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
if (_pTab.X16) != 0 {
goto _78
}
_regRowSet = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regOldRowid = store1(&_regNewRowid, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1))
if ((_chngPk != 0) || (_pTrigger != nil)) || _hasFK != 0 {
_regOld = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_pTab.X11)
sink1 = *p
}
}
if ((_chngKey != 0) || (_pTrigger != nil)) || _hasFK != 0 {
_regNewRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
}
_regNew = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_pTab.X11)
sink1 = *p
}
_78:
if _isView != 0 {
_sqlite3AuthContextPush(tls, _pParse, &_sContext, _pTab.X0)
}
if _isView != 0 {
_sqlite3MaterializeView(tls, _pParse, _pTab, _pWhere, _iDataCur)
}
if _sqlite3ResolveExprNames(tls, &_sNC, _pWhere) != 0 {
goto _update_cleanup
}
if (_pTab.X16) != 0 {
_updateVirtualTable(tls, _pParse, _pTabList, _pTab, _pChanges, _pRowidExpr, _aXRef, _pWhere, _onError)
goto _update_cleanup
}
if ((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil) {
_regRowCount = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regRowCount)
}
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_sqlite3VdbeAddOp3(tls, _v, i32(59), i32(0), _regRowSet, _regOldRowid)
goto _92
}
func() {
if _pPk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124122), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(41994)))
crt.X__builtin_abort(tls)
}
}()
_nPk = int16(_pPk.X13)
_iPk = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_nPk)
sink1 = *p
}
_regKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_iEph = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _iPk)
_addrOpen = _sqlite3VdbeAddOp2(tls, _v, i32(110), _iEph, int32(_nPk))
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pPk)
_92:
_flags = i32(4100)
if (((((_pParse.X6) == 0) && (_pTrigger == nil)) && (_hasFK == 0)) && (_chngKey == 0)) && (_bReplace == 0) {
{
p := &_flags
*p = (*p) | i32(8)
sink1 = *p
}
}
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pTabList, _pWhere, nil, nil, uint16(_flags), _iIdxCur)
if _pWInfo == nil {
goto _update_cleanup
}
_eOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aiCurOnePass)))
if _eOnePass != i32(2) {
goto _101
}
_36_iCur = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))
if ((_36_iCur >= i32(0)) && (_36_iCur != _iDataCur)) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr(_36_iCur-_iBaseCur)))) != 0) {
_eOnePass = i32(0)
}
func() {
if _36_iCur == _iDataCur && ((_pTab.X9)&uint32(i32(32))) == uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124164), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116628)))
crt.X__builtin_abort(tls)
}
}()
_101:
if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
goto _108
}
_sqlite3VdbeAddOp2(tls, _v, i32(125), _iDataCur, _regOldRowid)
if _eOnePass == i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(145), _regRowSet, _regOldRowid)
}
goto _110
_108:
_i = i32(0)
_111:
if _i >= int32(_nPk) {
goto _114
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(115265)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))), _iPk+_i)
_i += 1
goto _111
_114:
if _eOnePass != 0 {
_sqlite3VdbeChangeToNoop(tls, _v, _addrOpen)
_nKey = int32(_nPk)
_regKey = _iPk
goto _118
}
_sqlite3VdbeAddOp4(tls, _v, i32(101), _iPk, int32(_nPk), _regKey, _sqlite3IndexAffinityStr(tls, _db, _pPk), int32(_nPk))
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iEph, _regKey, _iPk, int32(_nPk))
_118:
_110:
if _eOnePass != i32(2) {
_sqlite3WhereEnd(tls, _pWInfo)
}
_labelBreak = _sqlite3VdbeMakeLabel(tls, _v)
if _isView != 0 {
goto _120
}
_45_addrOnce = i32(0)
if _eOnePass == i32(0) {
goto _121
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) >= i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0)))))-_iBaseCur))) = uint8(i32(0))
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0) {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aToOpen)) + 1*uintptr((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1)))))-_iBaseCur))) = uint8(i32(0))
}
_121:
if (_eOnePass == i32(2)) && ((_nIdx - bool2int((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) >= i32(0))) > i32(0)) {
_45_addrOnce = _sqlite3VdbeAddOp0(tls, _v, i32(20))
}
_sqlite3OpenTableAndIndices(tls, _pParse, _pTab, i32(107), uint8(i32(0)), _iBaseCur, _aToOpen, nil, nil)
if _45_addrOnce != 0 {
_sqlite3VdbeJumpHere(tls, _v, _45_addrOnce)
}
_120:
if _eOnePass == i32(0) {
goto _127
}
if ((_isView == 0) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(0))))) != _iDataCur)) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aiCurOnePass)) + 4*uintptr(i32(1))))) != _iDataCur) {
func() {
if _pPk == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124221), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116662)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iDataCur, _labelBreak, _regKey, _nKey)
}
if _eOnePass == i32(1) {
_labelContinue = _labelBreak
goto _134
}
_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
_134:
_sqlite3VdbeAddOp2(tls, _v, i32(75), func() int32 {
if _pPk != nil {
return _regKey
}
return _regOldRowid
}(), _labelBreak)
goto _139
_127:
if _pPk != nil {
_labelContinue = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(37), _iEph, _labelBreak)
_addrTop = _sqlite3VdbeAddOp2(tls, _v, i32(124), _iEph, _regKey)
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iDataCur, _labelContinue, _regKey, i32(0))
goto _139
}
_labelContinue = _sqlite3VdbeAddOp3(tls, _v, i32(42), _regRowSet, _labelBreak, _regOldRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(32), _iDataCur, _labelContinue, _regOldRowid)
_139:
func() {
if _chngKey == 0 && _pTrigger == nil && _hasFK == 0 && _regOldRowid != _regNewRowid {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124251), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116666)))
crt.X__builtin_abort(tls)
}
}()
if _chngRowid != 0 {
_sqlite3ExprCode(tls, _pParse, _pRowidExpr, _regNewRowid)
_sqlite3VdbeAddOp1(tls, _v, i32(17), _regNewRowid)
}
if _chngPk == 0 && _hasFK == 0 && _pTrigger == nil {
goto _148
}
_55_oldmask = func() uint32 {
if _hasFK != 0 {
return _sqlite3FkOldmask(tls, _pParse, _pTab)
}
return uint32(i32(0))
}()
{
p := &_55_oldmask
*p = (*p) | _sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, i32(0), i32(3), _pTab, _onError)
sink5 = *p
}
_i = i32(0)
_151:
if _i >= int32(_pTab.X11) {
goto _154
}
if ((_55_oldmask == u32(4294967295)) || ((_i < i32(32)) && ((_55_oldmask & (u32(1) << uint(_i))) != uint32(i32(0))))) || ((int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X6) & i32(1)) != i32(0)) {
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regOld+_i)
goto _159
}
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regOld+_i)
_159:
_i += 1
goto _151
_154:
if (int32(_chngRowid) == i32(0)) && (_pPk == nil) {
_sqlite3VdbeAddOp2(tls, _v, i32(64), _regOldRowid, _regNewRowid)
}
_148:
_newmask = int32(_sqlite3TriggerColmask(tls, _pParse, _pTrigger, _pChanges, i32(1), i32(1), _pTab, _onError))
_i = i32(0)
_162:
if _i >= int32(_pTab.X11) {
goto _165
}
if _i == int32(_pTab.X10) {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regNew+_i)
goto _167
}
_j = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))
if _j >= i32(0) {
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(_j))).X0), _regNew+_i)
goto _173
}
if ((i32(0) == (_tmask & i32(1))) || (_i > i32(31))) || ((uint32(_newmask) & (u32(1) << uint(_i))) != 0) {
_sqlite3ExprCodeGetColumnToReg(tls, _pParse, _pTab, _i, _iDataCur, _regNew+_i)
goto _173
}
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regNew+_i)
_173:
_167:
_i += 1
goto _162
_165:
if (_tmask & i32(1)) == 0 {
goto _174
}
_sqlite3TableAffinity(tls, _v, _pTab, _regNew)
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(110), _pChanges, i32(1), _pTab, _regOldRowid, _onError, _labelContinue)
if _pPk != nil {
_sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iDataCur, _labelContinue, _regKey, _nKey)
goto _176
}
_sqlite3VdbeAddOp3(tls, _v, i32(32), _iDataCur, _labelContinue, _regOldRowid)
_176:
_i = i32(0)
_177:
if _i >= int32(_pTab.X11) {
goto _180
}
if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))) < i32(0)) && (_i != int32(_pTab.X10)) {
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _pTab, _iDataCur, _i, _regNew+_i)
}
_i += 1
goto _177
_180:
_174:
if _isView != 0 {
goto _183
}
_71_addr1 = i32(0)
func() {
if _regOldRowid <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124356), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116723)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regNewRowid, _regOldRowid, _chngKey, uint8(_onError), _labelContinue, &_bReplace, _aXRef)
if _hasFK != 0 {
_sqlite3FkCheck(tls, _pParse, _pTab, _regOldRowid, i32(0), _aXRef, int32(_chngKey))
}
if _bReplace == 0 && _chngKey == 0 {
goto _188
}
if _pPk != nil {
_71_addr1 = _sqlite3VdbeAddOp4Int(tls, _v, i32(29), _iDataCur, i32(0), _regKey, _nKey)
goto _190
}
_71_addr1 = _sqlite3VdbeAddOp3(tls, _v, i32(32), _iDataCur, i32(0), _regOldRowid)
_190:
_188:
_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _aRegIdx, i32(-1))
func() {
if _regNew != (_regNewRowid + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124386), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3UpdateØ00__func__Ø000))), unsafe.Pointer(str(116737)))
crt.X__builtin_abort(tls)
}
}()
if (_hasFK > i32(1)) || (_chngKey != 0) {
_sqlite3VdbeAddOp2(tls, _v, i32(120), _iDataCur, i32(0))
}
if _bReplace != 0 || (_chngKey != 0) {
_sqlite3VdbeJumpHere(tls, _v, _71_addr1)
}
if _hasFK != 0 {
_sqlite3FkCheck(tls, _pParse, _pTab, i32(0), _regNewRowid, _aXRef, int32(_chngKey))
}
_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regNewRowid, _aRegIdx, i32(4)|func() int32 {
if _eOnePass == i32(2) {
return i32(2)
}
return i32(0)
}(), i32(0), i32(0))
if _hasFK != 0 {
_sqlite3FkActions(tls, _pParse, _pTab, _pChanges, _regOldRowid, _aXRef, int32(_chngKey))
}
_183:
if ((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil) {
_sqlite3VdbeAddOp2(tls, _v, i32(73), _regRowCount, i32(1))
}
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(110), _pChanges, i32(2), _pTab, _regOldRowid, _onError, _labelContinue)
if _eOnePass == i32(1) {
goto _208
}
if _eOnePass == i32(2) {
_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
_sqlite3WhereEnd(tls, _pWInfo)
goto _208
}
if _pPk != nil {
_sqlite3VdbeResolveLabel(tls, _v, _labelContinue)
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iEph, _addrTop)
goto _208
}
_sqlite3VdbeGoto(tls, _v, _labelContinue)
_208:
_sqlite3VdbeResolveLabel(tls, _v, _labelBreak)
if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) {
_sqlite3AutoincrementEnd(tls, _pParse)
}
if (((_db.X6)&i32(128)) != 0 && ((*XTable)(_pParse.X40) == nil)) && ((_pParse.X6) == 0) {
_sqlite3VdbeAddOp2(tls, _v, i32(67), _regRowCount, i32(1))
_sqlite3VdbeSetNumCols(tls, _v, i32(1))
_sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(116759), nil)
}
_update_cleanup:
_sqlite3AuthContextPop(tls, &_sContext)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aXRef))
_sqlite3SrcListDelete(tls, _db, _pTabList)
_sqlite3ExprListDelete(tls, _db, _pChanges)
_sqlite3ExprDelete(tls, _db, _pWhere)
_ = _sContext
_ = _sNC
_ = _aiCurOnePass
}
var _sqlite3UpdateØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3UpdateØ00__func__Ø000[0], str(116772), 14)
}
// Generate code for an UPDATE of a virtual table.
//
// There are two possible strategies - the default and the special
// "onepass" strategy. Onepass is only used if the virtual table
// implementation indicates that pWhere may match at most one row.
//
// The default strategy is to create an ephemeral table that contains
// for each row to be changed:
//
// (A) The original rowid of that row.
// (B) The revised rowid for the row.
// (C) The content of every column in the row.
//
// Then loop through the contents of this ephemeral table executing a
// VUpdate for each row. When finished, drop the ephemeral table.
//
// The "onepass" strategy does not use an ephemeral table. Instead, it
// stores the same values (A, B and C above) in a register array and
// makes a single invocation of VUpdate.
func _updateVirtualTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pChanges *XExprList, _pRowid *XExpr, _aXRef *int32, _pWhere *XExpr, _onError int32) {
var _ephemTab, _i, _nArg, _regArg, _regRec, _regRowid, _iCsr, _bOnePass, _addr int32
var _pVTab *int8
var _db *Xsqlite3
var _v *TVdbe
var _aDummy [2]int32
var _pWInfo *XWhereInfo
_v = (*TVdbe)(_pParse.X2)
_db = (*Xsqlite3)(_pParse.X0)
_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
_nArg = i32(2) + int32(_pTab.X11)
_iCsr = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr(i32(0)))).X11
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(124539), unsafe.Pointer((*int8)(unsafe.Pointer(&_updateVirtualTableØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
_ephemTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_addr = _sqlite3VdbeAddOp2(tls, _v, i32(110), _ephemTab, _nArg)
_regArg = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + _nArg
sink1 = *p
}
_regRec = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_regRowid = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(i32(4)), i32(0))
if _pWInfo == nil {
return
}
_sqlite3VdbeAddOp2(tls, _v, i32(125), _iCsr, _regArg)
if _pRowid != nil {
_sqlite3ExprCode(tls, _pParse, _pRowid, _regArg+i32(1))
goto _4
}
_sqlite3VdbeAddOp2(tls, _v, i32(125), _iCsr, _regArg+i32(1))
_4:
_i = i32(0)
_5:
if _i >= int32(_pTab.X11) {
goto _8
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))) >= i32(0) {
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pChanges.X2)))))+20*uintptr(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aXRef)) + 4*uintptr(_i)))))).X0), (_regArg+i32(2))+_i)
goto _10
}
_sqlite3VdbeAddOp3(tls, _v, i32(159), _iCsr, _i, (_regArg+i32(2))+_i)
_10:
_i += 1
goto _5
_8:
_bOnePass = _sqlite3WhereOkOnePass(tls, _pWInfo, (*int32)(unsafe.Pointer(&_aDummy)))
if _bOnePass == 0 {
goto _11
}
_sqlite3VdbeChangeToNoop(tls, _v, _addr)
if (*XParse)(_pParse.X39) == nil {
*(*uint8)(unsafe.Pointer(&(_pParse.X8))) = uint8(i32(0))
}
goto _13
_11:
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regArg, _nArg, _regRec)
_sqlite3VdbeAddOp2(tls, _v, i32(117), _ephemTab, _regRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _ephemTab, _regRec, _regRowid)
_13:
if _bOnePass != i32(0) {
goto _14
}
_sqlite3WhereEnd(tls, _pWInfo)
_addr = _sqlite3VdbeAddOp1(tls, _v, i32(37), _ephemTab)
_i = i32(0)
_15:
if _i >= _nArg {
goto _18
}
_sqlite3VdbeAddOp3(tls, _v, i32(99), _ephemTab, _i, _regArg+_i)
_i += 1
goto _15
_18:
_14:
_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
_sqlite3VdbeAddOp4(tls, _v, i32(12), i32(0), _nArg, _regArg, _pVTab, i32(-8))
_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
if _onError == i32(10) {
return i32(2)
}
return _onError
}()))
_sqlite3MayAbort(tls, _pParse)
if _bOnePass == i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(7), _ephemTab, _addr+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _addr)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _ephemTab, i32(0))
goto _22
}
_sqlite3WhereEnd(tls, _pWInfo)
_22:
_ = _aDummy
}
var _updateVirtualTableØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_updateVirtualTableØ00__func__Ø000[0], str(116786), 19)
}
// This function is called before generating code to update or delete a
// row contained in table pTab.
func _sqlite3FkOldmask(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 uint32) {
var _1_i int32
var _mask uint32
var _3_pIdx *XIndex
var _1_p *XFKey
_mask = u32(0)
if (((*Xsqlite3)(_pParse.X0).X6) & i32(524288)) == 0 {
goto _0
}
_1_p = (*XFKey)(_pTab.X4)
_1:
if _1_p == nil {
goto _4
}
_1_i = i32(0)
_5:
if _1_i >= (_1_p.X5) {
goto _8
}
{
p := &_mask
*p = (*p) | func() uint32 {
if ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_1_p.X9))))) + 8*uintptr(_1_i))).X0) > i32(31) {
return u32(4294967295)
}
return (u32(1) << uint((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_1_p.X9)))))+8*uintptr(_1_i))).X0))
}()
sink5 = *p
}
_1_i += 1
goto _5
_8:
_1_p = (*XFKey)(_1_p.X1)
goto _1
_4:
_1_p = _sqlite3FkReferences(tls, _pTab)
_11:
if _1_p == nil {
goto _14
}
_3_pIdx = nil
_sqlite3FkLocateIndex(tls, _pParse, _pTab, _1_p, &_3_pIdx, nil)
if _3_pIdx == nil {
goto _15
}
_1_i = i32(0)
_16:
if _1_i >= int32(_3_pIdx.X13) {
goto _19
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108482), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkOldmaskØ00__func__Ø000))), unsafe.Pointer(str(116805)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_mask
*p = (*p) | func() uint32 {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i)))) > i32(31) {
return u32(4294967295)
}
return (u32(1) << uint(int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_3_pIdx.X1)) + 2*uintptr(_1_i))))))
}()
sink5 = *p
}
_1_i += 1
goto _16
_19:
_15:
_1_p = (*XFKey)(_1_p.X3)
goto _11
_14:
_0:
return _mask
}
// 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 _sqlite3FkLocateIndex(tls *crt.TLS, _pParse *XParse, _pParent *XTable, _pFKey *XFKey, _ppIdx **XIndex, _paiCol **int32) (r0 int32) {
var _10_iCol int16
var _nCol, _8_i, _9_i, _9_j int32
var _aiCol *int32
var _zKey, _10_zDfltColl, _10_zIdxCol *int8
var _pIdx *XIndex
_pIdx = nil
_aiCol = nil
_nCol = _pFKey.X5
_zKey = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(i32(0)))).X1
func() {
if _ppIdx == nil || (*_ppIdx) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107609), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000))), unsafe.Pointer(str(116826)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _paiCol != nil && (*_paiCol) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107610), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000))), unsafe.Pointer(str(116845)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pParse == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107611), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000))), unsafe.Pointer(str(115716)))
crt.X__builtin_abort(tls)
}
}()
if _nCol != i32(1) {
goto _8
}
if int32(_pParent.X10) < i32(0) {
goto _9
}
if _zKey == nil {
return i32(0)
}
if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pParent.X1)+16*uintptr(_pParent.X10))).X0, _zKey) == 0 {
return i32(0)
}
_9:
goto _13
_8:
if _paiCol == nil {
goto _13
}
func() {
if _nCol <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkLocateIndexØ00__func__Ø000))), unsafe.Pointer(str(116867)))
crt.X__builtin_abort(tls)
}
}()
_aiCol = (*int32)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), uint64(uint32(_nCol)*u32(4))))
if _aiCol == nil {
return i32(1)
}
*_paiCol = _aiCol
_13:
_pIdx = (*XIndex)(_pParent.X2)
_17:
if _pIdx == nil {
goto _20
}
if int32(_pIdx.X13) != _nCol || int32(_pIdx.X15) == i32(0) || (*XExpr)(_pIdx.X9) != nil {
goto _23
}
if _zKey != nil {
goto _24
}
if int32((uint32(_pIdx.X16)<>uint(i32(30))) != i32(2) {
goto _25
}
if _aiCol == nil {
goto _26
}
_8_i = i32(0)
_27:
if _8_i >= _nCol {
goto _30
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_8_i))) = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_8_i))).X0
_8_i += 1
goto _27
_30:
_26:
goto _20
_25:
goto _31
_24:
_9_i = i32(0)
_32:
if _9_i >= _nCol {
goto _35
}
_10_iCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_9_i)))
if int32(_10_iCol) < i32(0) {
goto _35
}
_10_zDfltColl = (*XColumn)(unsafe.Pointer(uintptr(_pParent.X1) + 16*uintptr(_10_iCol))).X2
if _10_zDfltColl == nil {
_10_zDfltColl = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
}
if _sqlite3StrICmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_9_i))), _10_zDfltColl) != 0 {
goto _35
}
_10_zIdxCol = (*XColumn)(unsafe.Pointer(uintptr(_pParent.X1) + 16*uintptr(_10_iCol))).X0
_9_j = i32(0)
_39:
if _9_j >= _nCol {
goto _42
}
if _sqlite3StrICmp(tls, (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9)))))+8*uintptr(_9_j))).X1, _10_zIdxCol) != i32(0) {
goto _43
}
if _aiCol != nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_9_i))) = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_9_j))).X0
}
goto _42
_43:
_9_j += 1
goto _39
_42:
if _9_j == _nCol {
goto _35
}
_9_i += 1
goto _32
_35:
if _9_i == _nCol {
goto _20
}
_31:
_23:
_pIdx = (*XIndex)(_pIdx.X5)
goto _17
_20:
if _pIdx != nil {
goto _47
}
if (_pParse.X47) == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(116874), unsafe.Pointer((*XTable)(_pFKey.X0).X0), unsafe.Pointer(_pFKey.X2))
}
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_aiCol))
return i32(1)
_47:
*_ppIdx = _pIdx
return i32(0)
}
var _sqlite3FkLocateIndexØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FkLocateIndexØ00__func__Ø000[0], str(116919), 21)
}
var _sqlite3FkOldmaskØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FkOldmaskØ00__func__Ø000[0], str(116940), 17)
}
// 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 _sqlite3CodeRowTrigger(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger, _op int32, _pChanges *XExprList, _tr_tm int32, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
var _p *XTrigger
func() {
if _op != i32(110) && _op != i32(108) && _op != i32(109) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123665), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(116957)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _tr_tm != i32(1) && _tr_tm != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123666), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(117005)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_op == i32(110)) != (_pChanges != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123667), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(117051)))
crt.X__builtin_abort(tls)
}
}()
_p = _pTrigger
_9:
if _p == nil {
goto _12
}
func() {
if (*XSchema)(_p.X6) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123674), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(117082)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSchema)(_p.X7) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123675), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(117096)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSchema)(_p.X6) != (*XSchema)(_p.X7) && (*XSchema)(_p.X6) != (*XSchema)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+16*uintptr(i32(1)))).X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123676), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerØ00__func__Ø000))), unsafe.Pointer(str(117113)))
crt.X__builtin_abort(tls)
}
}()
if ((int32(_p.X2) == _op) && (int32(_p.X3) == _tr_tm)) && _checkColumnOverlap(tls, (*XIdList)(_p.X5), _pChanges) != 0 {
_sqlite3CodeRowTriggerDirect(tls, _pParse, _p, _pTab, _reg, _orconf, _ignoreJump)
}
_p = (*XTrigger)(_p.X9)
goto _9
_12:
}
var _sqlite3CodeRowTriggerØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerØ00__func__Ø000[0], str(117181), 22)
}
// 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 _sqlite3CodeRowTriggerDirect(tls *crt.TLS, _pParse *XParse, _p *XTrigger, _pTab *XTable, _reg int32, _orconf int32, _ignoreJump int32) {
var _1_bRecursive int32
var _v *TVdbe
var _pPrg *XTriggerPrg
_v = _sqlite3GetVdbe(tls, _pParse)
_pPrg = _getRowTrigger(tls, _pParse, _p, _pTab, _orconf)
func() {
if _pPrg == nil && (_pParse.X16) == 0 && ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123591), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeRowTriggerDirectØ00__func__Ø000))), unsafe.Pointer(str(117203)))
crt.X__builtin_abort(tls)
}
}()
if _pPrg != nil {
_1_bRecursive = bool2int(((_p.X0) != nil) && (i32(0) == (((*Xsqlite3)(_pParse.X0).X6) & i32(262144))))
_sqlite3VdbeAddOp4(tls, _v, i32(44), _reg, _ignoreJump, preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1), (*int8)(unsafe.Pointer((*XSubProgram)(_pPrg.X2))), i32(-13))
_sqlite3VdbeComment(tls, _v, str(117252), unsafe.Pointer(func() *int8 {
if (_p.X0) != nil {
return (_p.X0)
}
return str(117264)
}()), unsafe.Pointer(_onErrorText(tls, _orconf)))
_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_1_bRecursive)))
}
}
var _sqlite3CodeRowTriggerDirectØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CodeRowTriggerDirectØ00__func__Ø000[0], str(117269), 28)
}
// 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.
//
// 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 _sqlite3GenerateConstraintChecks(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _aRegIdx *int32, _iDataCur int32, _iIdxCur int32, _regNewData int32, _regOldData int32, _pkChng uint8, _overrideError uint8, _ignoreDest int32, _pbMayReplace *int32, _aiChng *int32) {
var _i, _ix, _nCol, _onError, _addr1, _seenReplace, _nPkField, _ipkTop, _ipkBottom, _14_allOk, _17_addrRowidOk, _34_regIdx, _34_regR, _34_iThisCur, _34_addrUniqueOk, _37_iField, _37_x, _50_x, _53_addrJump, _53_op, _53_regCmp int32
var _10_zMsg, _16_zName, _54_p4 *int8
var _isUpdate, _bAffinityDone uint8
var _db *Xsqlite3
var _27_pTrigger, _59_pTrigger *XTrigger
var _v *TVdbe
var _13_pCheck *XExprList
var _14_pExpr *XExpr
var _pIdx, _pPk *XIndex
_pPk = nil
_seenReplace = i32(0)
_ipkTop = i32(0)
_ipkBottom = i32(0)
_bAffinityDone = u8(0)
_isUpdate = uint8(bool2int(_regOldData != i32(0)))
_db = (*Xsqlite3)(_pParse.X0)
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110093), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_pTab.X3) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110094), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(102268)))
crt.X__builtin_abort(tls)
}
}()
_nCol = int32(_pTab.X11)
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_pPk = nil
_nPkField = i32(1)
goto _5
}
_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
_nPkField = int32(_pPk.X13)
_5:
_i = i32(0)
_6:
if _i >= _nCol {
goto _9
}
if _i == int32(_pTab.X10) {
goto _7
}
if (_aiChng != nil) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiChng)) + 4*uintptr(_i)))) < i32(0)) {
goto _7
}
_onError = int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_i))).X3)
if _onError == i32(0) {
goto _7
}
if int32(_overrideError) != i32(10) {
_onError = int32(_overrideError)
goto _16
}
if _onError == i32(10) {
_onError = i32(2)
}
_16:
if (_onError == i32(5)) && ((*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X1) == nil) {
_onError = i32(2)
}
func() {
if _onError != i32(1) && _onError != i32(2) && _onError != i32(3) && _onError != i32(4) && _onError != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110133), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(117297)))
crt.X__builtin_abort(tls)
}
}()
switch _onError {
case i32(1):
goto _27
case i32(2):
goto _26
case i32(3):
goto _27
case i32(4):
goto _29
default:
goto _30
}
_26:
_sqlite3MayAbort(tls, _pParse)
_27:
_10_zMsg = _sqlite3MPrintf(tls, _db, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X0))
_sqlite3VdbeAddOp3(tls, _v, i32(54), i32(1299), _onError, (_regNewData+i32(1))+_i)
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_10_zMsg), i32(-1))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(1)))
goto _31
_29:
_sqlite3VdbeAddOp2(tls, _v, i32(75), (_regNewData+i32(1))+_i, _ignoreDest)
goto _31
_30:
func() {
if _onError != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110156), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(117404)))
crt.X__builtin_abort(tls)
}
}()
_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(76), (_regNewData+i32(1))+_i)
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X1), (_regNewData+i32(1))+_i)
_sqlite3VdbeJumpHere(tls, _v, _addr1)
goto _31
_31:
_7:
_i += 1
goto _6
_9:
if (*XExprList)(_pTab.X6) == nil || ((_db.X6)&i32(8192)) != i32(0) {
goto _35
}
_13_pCheck = (*XExprList)(_pTab.X6)
*(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1)
_onError = func() int32 {
if int32(_overrideError) != i32(10) {
return int32(_overrideError)
}
return i32(2)
}()
_i = i32(0)
_38:
if _i >= (_13_pCheck.X0) {
goto _41
}
_14_pExpr = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pCheck.X2))))) + 20*uintptr(_i))).X0)
if (_aiChng != nil) && _checkConstraintUnchanged(tls, _14_pExpr, _aiChng, int32(_pkChng)) != 0 {
goto _39
}
_14_allOk = _sqlite3VdbeMakeLabel(tls, _v)
_sqlite3ExprIfTrue(tls, _pParse, _14_pExpr, _14_allOk, i32(16))
if _onError == i32(4) {
_sqlite3VdbeGoto(tls, _v, _ignoreDest)
goto _45
}
_16_zName = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_13_pCheck.X2))))) + 20*uintptr(_i))).X1
if _16_zName == nil {
_16_zName = _pTab.X0
}
if _onError == i32(5) {
_onError = i32(2)
}
_sqlite3HaltConstraint(tls, _pParse, i32(275), _onError, _16_zName, int8(i32(0)), uint8(i32(3)))
_45:
_sqlite3VdbeResolveLabel(tls, _v, _14_allOk)
_39:
_i += 1
goto _38
_41:
_35:
if _pkChng == 0 || _pPk != nil {
goto _49
}
_17_addrRowidOk = _sqlite3VdbeMakeLabel(tls, _v)
_onError = int32(_pTab.X14)
if int32(_overrideError) != i32(10) {
_onError = int32(_overrideError)
goto _52
}
if _onError == i32(10) {
_onError = i32(2)
}
_52:
if _isUpdate != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(78), _regNewData, _17_addrRowidOk, _regOldData)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(144)))
}
if _onError != i32(5) || int32(_overrideError) == i32(5) {
goto _55
}
_pIdx = (*XIndex)(_pTab.X2)
_56:
if _pIdx == nil {
goto _59
}
if (int32(_pIdx.X15) == i32(4)) || (int32(_pIdx.X15) == i32(3)) {
_ipkTop = _sqlite3VdbeAddOp0(tls, _v, i32(13))
goto _59
}
_pIdx = (*XIndex)(_pIdx.X5)
goto _56
_59:
_55:
_sqlite3VdbeAddOp3(tls, _v, i32(32), _iDataCur, _17_addrRowidOk, _regNewData)
switch _onError {
case i32(1):
goto _64
case i32(2):
goto _64
case i32(3):
goto _64
case i32(4):
goto _68
case i32(5):
goto _67
default:
goto _63
}
_63:
_onError = i32(2)
_64:
_sqlite3RowidConstraint(tls, _pParse, _onError, _pTab)
goto _69
_67:
_27_pTrigger = nil
if ((_db.X6) & i32(262144)) != 0 {
_27_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)
}
if (_27_pTrigger != nil) || _sqlite3FkRequired(tls, _pParse, _pTab, nil, i32(0)) != 0 {
_sqlite3MultiWrite(tls, _pParse)
_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _27_pTrigger, _iDataCur, _iIdxCur, _regNewData, int16(i32(1)), uint8(i32(0)), uint8(i32(5)), uint8(i32(1)), i32(-1))
goto _73
}
if (*XIndex)(_pTab.X2) != nil {
_sqlite3MultiWrite(tls, _pParse)
_sqlite3GenerateRowIndexDelete(tls, _pParse, _pTab, _iDataCur, _iIdxCur, nil, i32(-1))
}
_73:
_seenReplace = i32(1)
goto _69
_68:
_sqlite3VdbeGoto(tls, _v, _ignoreDest)
goto _69
_69:
_sqlite3VdbeResolveLabel(tls, _v, _17_addrRowidOk)
if _ipkTop != 0 {
_ipkBottom = _sqlite3VdbeAddOp0(tls, _v, i32(13))
_sqlite3VdbeJumpHere(tls, _v, _ipkTop)
}
_49:
*func() **XIndex { _ix = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_76:
if _pIdx == nil {
goto _79
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) == i32(0) {
goto _77
}
if int32(_bAffinityDone) == i32(0) {
_sqlite3TableAffinity(tls, _v, _pTab, _regNewData+i32(1))
_bAffinityDone = uint8(i32(1))
}
_34_iThisCur = _iIdxCur + _ix
_34_addrUniqueOk = _sqlite3VdbeMakeLabel(tls, _v)
if (*XExpr)(_pIdx.X9) != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix))))
*(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1)
_sqlite3ExprIfFalseDup(tls, _pParse, (*XExpr)(_pIdx.X9), _34_addrUniqueOk, i32(16))
*(*int32)(unsafe.Pointer(&(_pParse.X21))) = i32(0)
}
_34_regIdx = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix)))) + i32(1)
_i = i32(0)
_83:
if _i >= int32(_pIdx.X14) {
goto _86
}
_37_iField = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))))
if _37_iField == i32(-2) {
*(*int32)(unsafe.Pointer(&(_pParse.X21))) = _regNewData + i32(1)
_sqlite3ExprCodeCopy(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pIdx.X10).X2)))))+20*uintptr(_i))).X0), _34_regIdx+_i)
*(*int32)(unsafe.Pointer(&(_pParse.X21))) = i32(0)
_sqlite3VdbeComment(tls, _v, str(117424), unsafe.Pointer(_pIdx.X0), _i)
goto _88
}
if (_37_iField == i32(-1)) || (_37_iField == int32(_pTab.X10)) {
_37_x = _regNewData
goto _91
}
_37_x = (_37_iField + _regNewData) + i32(1)
_91:
_sqlite3VdbeAddOp2(tls, _v, func() int32 {
if _37_iField < i32(0) {
return i32(66)
}
return i32(65)
}(), _37_x, _34_regIdx+_i)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(func() *int8 {
if _37_iField < i32(0) {
return str(27227)
}
return ((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_37_iField))).X0)
}()))
_88:
_i += 1
goto _83
_86:
_sqlite3VdbeAddOp3(tls, _v, i32(101), _34_regIdx, int32(_pIdx.X14), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_ix))))
_sqlite3VdbeComment(tls, _v, str(107188), unsafe.Pointer(_pIdx.X0))
if ((_isUpdate != 0) && (_pPk == _pIdx)) && (int32(_pkChng) == i32(0)) {
_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
goto _77
}
_onError = int32(_pIdx.X15)
if _onError == i32(0) {
_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
goto _77
}
if int32(_overrideError) != i32(10) {
_onError = int32(_overrideError)
goto _102
}
if _onError == i32(10) {
_onError = i32(2)
}
_102:
if (((((_ix == i32(0)) && ((*XIndex)(_pIdx.X5) == nil)) && (_pPk == _pIdx)) && (_onError == i32(5))) && ((i32(0) == ((_db.X6) & i32(262144))) || (nil == _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)))) && ((i32(0) == ((_db.X6) & i32(524288))) || ((nil == (*XFKey)(_pTab.X4)) && (nil == _sqlite3FkReferences(tls, _pTab)))) {
_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
goto _77
}
_sqlite3VdbeAddOp4Int(tls, _v, i32(28), _34_iThisCur, _34_addrUniqueOk, _34_regIdx, int32(_pIdx.X13))
_34_regR = func() int32 {
if _pIdx == _pPk {
return _34_regIdx
}
return _sqlite3GetTempRange(tls, _pParse, _nPkField)
}()
if _isUpdate == 0 && _onError != i32(5) {
goto _115
}
if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
goto _116
}
_sqlite3VdbeAddOp2(tls, _v, i32(131), _34_iThisCur, _34_regR)
if _isUpdate != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(78), _34_regR, _34_addrUniqueOk, _regOldData)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(144)))
}
goto _118
_116:
if _pIdx == _pPk {
goto _119
}
_i = i32(0)
_120:
if _i >= int32(_pPk.X13) {
goto _123
}
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110431), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(115265)))
crt.X__builtin_abort(tls)
}
}()
_50_x = int32(_sqlite3ColumnOfIndex(tls, _pIdx, *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))))
_sqlite3VdbeAddOp3(tls, _v, i32(99), _34_iThisCur, _50_x, _34_regR+_i)
_sqlite3VdbeComment(tls, _v, str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i)))))).X0))
_i += 1
goto _120
_123:
_119:
if _isUpdate == 0 {
goto _126
}
_53_addrJump = _sqlite3VdbeCurrentAddr(tls, _v) + int32(_pPk.X13)
_53_op = i32(77)
_53_regCmp = func() int32 {
if int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2) {
return _34_regIdx
}
return _34_regR
}()
_i = i32(0)
_129:
if _i >= int32(_pPk.X13) {
goto _132
}
_54_p4 = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X8)) + 4*uintptr(_i))))))
_50_x = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPk.X1)) + 2*uintptr(_i))))
func() {
if _50_x < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110453), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(109743)))
crt.X__builtin_abort(tls)
}
}()
if _i == (int32(_pPk.X13) - i32(1)) {
_53_addrJump = _34_addrUniqueOk
_53_op = i32(78)
}
_sqlite3VdbeAddOp4(tls, _v, _53_op, (_regOldData+i32(1))+_50_x, _53_addrJump, _53_regCmp+_i, _54_p4, i32(-3))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(144)))
_i += 1
goto _129
_132:
_126:
_118:
_115:
func() {
if _onError != i32(1) && _onError != i32(2) && _onError != i32(3) && _onError != i32(4) && _onError != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110470), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(117297)))
crt.X__builtin_abort(tls)
}
}()
switch _onError {
case i32(1):
goto _143
case i32(2):
goto _143
case i32(3):
goto _143
case i32(4):
goto _146
default:
goto _147
}
_143:
_sqlite3UniqueConstraint(tls, _pParse, _onError, _pIdx)
goto _148
_146:
_sqlite3VdbeGoto(tls, _v, _ignoreDest)
goto _148
_147:
_59_pTrigger = nil
func() {
if _onError != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110485), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateConstraintChecksØ00__func__Ø000))), unsafe.Pointer(str(117404)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3MultiWrite(tls, _pParse)
if ((_db.X6) & i32(262144)) != 0 {
_59_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(109), nil, nil)
}
_sqlite3GenerateRowDelete(tls, _pParse, _pTab, _59_pTrigger, _iDataCur, _iIdxCur, _34_regR, int16(_nPkField), uint8(i32(0)), uint8(i32(5)), uint8(func() int32 {
if _pIdx == _pPk {
return i32(1)
}
return i32(0)
}()), _34_iThisCur)
_seenReplace = i32(1)
goto _148
_148:
_sqlite3VdbeResolveLabel(tls, _v, _34_addrUniqueOk)
if _34_regR != _34_regIdx {
_sqlite3ReleaseTempRange(tls, _pParse, _34_regR, _nPkField)
}
_77:
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_ix }() += 1
goto _76
_79:
if _ipkTop != 0 {
_sqlite3VdbeGoto(tls, _v, _ipkTop+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _ipkBottom)
}
*_pbMayReplace = _seenReplace
}
var _sqlite3GenerateConstraintChecksØ00__func__Ø000 [32]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GenerateConstraintChecksØ00__func__Ø000[0], str(117437), 32)
}
// 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 does not use any of the
// changing columns (or the rowid if it is changing). In other words,
// return true if this CHECK constraint can be skipped when validating
// the new row in the UPDATE statement.
func _checkConstraintUnchanged(tls *crt.TLS, _pExpr *XExpr, _aiChng *int32, _chngRowid int32) (r0 int32) {
var _w XWalker
crt.Xmemset(tls, (unsafe.Pointer)(&_w), i32(0), u32(28))
*(*uint8)(unsafe.Pointer(&(_w.X5))) = uint8(i32(0))
*(*func(*crt.TLS, *XWalker, *XExpr) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_w.X1))))) = _checkConstraintExprNode
*(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_w.X6))))) = _aiChng
_sqlite3WalkExpr(tls, &_w, _pExpr)
if _chngRowid == 0 {
{
p := (*uint8)(unsafe.Pointer(&(_w.X5)))
*p = uint8(int32(*p) & i32(-3))
sink2 = *p
}
}
return bool2int((_w.X5) == 0)
_ = _w
panic(0)
}
// This is the Walker callback from checkConstraintUnchanged(). Set
// bit 0x01 of pWalker->eCode if
// pWalker->eCode to 0 if this expression node references any of the
// columns that are being modifed by an UPDATE statement.
func _checkConstraintExprNode(tls *crt.TLS, _pWalker *XWalker, _pExpr *XExpr) (r0 int32) {
if int32(_pExpr.X0) != i32(152) {
goto _0
}
func() {
if int32(_pExpr.X9) < i32(0) && int32(_pExpr.X9) != i32(-1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109937), unsafe.Pointer((*int8)(unsafe.Pointer(&_checkConstraintExprNodeØ00__func__Ø000))), unsafe.Pointer(str(117469)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pExpr.X9) < i32(0) {
goto _4
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int32)(unsafe.Pointer((*t58)(unsafe.Pointer(&(_pWalker.X6))))))) + 4*uintptr(_pExpr.X9)))) >= i32(0) {
{
p := (*uint8)(unsafe.Pointer(&(_pWalker.X5)))
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
}
goto _6
_4:
{
p := (*uint8)(unsafe.Pointer(&(_pWalker.X5)))
*p = uint8(int32(*p) | i32(2))
sink2 = *p
}
_6:
_0:
return i32(0)
}
var _checkConstraintExprNodeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_checkConstraintExprNodeØ00__func__Ø000[0], str(117509), 24)
}
// Code an OP_Halt due to non-unique rowid.
func _sqlite3RowidConstraint(tls *crt.TLS, _pParse *XParse, _onError int32, _pTab *XTable) {
var _rc int32
var _zMsg *int8
if int32(_pTab.X10) >= i32(0) {
_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(8018), unsafe.Pointer(_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_pTab.X10))).X0))
_rc = i32(1555)
goto _1
}
_zMsg = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(117533), unsafe.Pointer(_pTab.X0))
_rc = i32(2579)
_1:
_sqlite3HaltConstraint(tls, _pParse, _rc, _onError, _zMsg, int8(i32(-1)), uint8(i32(2)))
}
// 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 _sqlite3MultiWrite(tls *crt.TLS, _pParse *XParse) {
var _pToplevel *XParse
_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
*(*uint8)(unsafe.Pointer(&(_pToplevel.X8))) = uint8(i32(1))
}
// 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 _sqlite3GenerateRowIndexDelete(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _aRegIdx *int32, _iIdxNoSeek int32) {
var _i, _r1, _iPartIdxLabel int32
var _v *TVdbe
var _pIdx, _pPrior, _pPk *XIndex
_r1 = i32(-1)
_pPrior = nil
_v = (*TVdbe)(_pParse.X2)
_pPk = func() *XIndex {
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
return nil
}
return _sqlite3PrimaryKeyIndex(tls, _pTab)
}()
*func() **XIndex { _i = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_2:
if _pIdx == nil {
goto _5
}
func() {
if (_iIdxCur+_i) == _iDataCur && _pPk != _pIdx {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105425), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GenerateRowIndexDeleteØ00__func__Ø000))), unsafe.Pointer(str(117542)))
crt.X__builtin_abort(tls)
}
}()
if (_aRegIdx != nil) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i)))) == i32(0)) {
goto _3
}
if _pIdx == _pPk {
goto _3
}
if (_iIdxCur + _i) == _iIdxNoSeek {
goto _3
}
_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _pIdx, _iDataCur, i32(0), i32(1), &_iPartIdxLabel, _pPrior, _r1)
_sqlite3VdbeAddOp3(tls, _v, i32(129), _iIdxCur+_i, _r1, int32(func() uint16 {
if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return (_pIdx.X13)
}
return (_pIdx.X14)
}()))
_sqlite3ResolvePartIdxLabel(tls, _pParse, _iPartIdxLabel)
_pPrior = _pIdx
_3:
*func() **XIndex { _i += 1; return &_pIdx }() = (*XIndex)(_pIdx.X5)
goto _2
_5:
}
var _sqlite3GenerateRowIndexDeleteØ00__func__Ø000 [30]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GenerateRowIndexDeleteØ00__func__Ø000[0], str(117575), 30)
}
// 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 _sqlite3FkCheck(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regOld int32, _regNew int32, _aChange *int32, _bChngRowid int32) {
var _iDb, _isIgnoreErrors, _1_iCol, _1_i, _1_bIgnore, _6_iJump, _7_iReg, _12_rcauth, _21_eAction int32
var _1_aiFree, _1_aiCol, _15_aiCol *int32
var _zDb, _12_zCol *int8
var _db *Xsqlite3
var _1_pTo *XTable
var _6_v *TVdbe
var _15_pSrc *XSrcList
var _19_pItem *TSrcList_item
var _1_pIdx, _15_pIdx *XIndex
var _pFKey *XFKey
_db = (*Xsqlite3)(_pParse.X0)
_isIgnoreErrors = int32(_pParse.X47)
func() {
if (_regOld == i32(0)) == (_regNew == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108281), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117605)))
crt.X__builtin_abort(tls)
}
}()
if ((_db.X6) & i32(524288)) == i32(0) {
return
}
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_pFKey = (*XFKey)(_pTab.X4)
_3:
if _pFKey == nil {
goto _6
}
_1_pIdx = nil
_1_aiFree = nil
_1_bIgnore = i32(0)
if ((_aChange != nil) && (Xsqlite3_stricmp(tls, _pTab.X0, _pFKey.X2) != i32(0))) && (_fkChildIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == i32(0)) {
goto _4
}
if (_pParse.X47) != 0 {
_1_pTo = _sqlite3FindTable(tls, _db, _pFKey.X2, _zDb)
goto _11
}
_1_pTo = _sqlite3LocateTable(tls, _pParse, uint32(i32(0)), _pFKey.X2, _zDb)
_11:
if _1_pTo != nil && _sqlite3FkLocateIndex(tls, _pParse, _1_pTo, _pFKey, &_1_pIdx, &_1_aiFree) == 0 {
goto _13
}
func() {
if _isIgnoreErrors != i32(0) && (_regOld == i32(0) || _regNew != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108317), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117630)))
crt.X__builtin_abort(tls)
}
}()
if (_isIgnoreErrors == 0) || ((_db.X17) != 0) {
return
}
if _1_pTo != nil {
goto _20
}
_6_v = _sqlite3GetVdbe(tls, _pParse)
_6_iJump = (_sqlite3VdbeCurrentAddr(tls, _6_v) + (_pFKey.X5)) + i32(1)
_1_i = i32(0)
_21:
if _1_i >= (_pFKey.X5) {
goto _24
}
_7_iReg = (((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(_1_i))).X0) + _regOld) + i32(1)
_sqlite3VdbeAddOp2(tls, _6_v, i32(75), _7_iReg, _6_iJump)
_1_i += 1
goto _21
_24:
_sqlite3VdbeAddOp2(tls, _6_v, i32(147), int32(_pFKey.X6), i32(-1))
_20:
goto _4
_13:
func() {
if (_pFKey.X5) != i32(1) && (_1_aiFree == nil || _1_pIdx == nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108337), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117676)))
crt.X__builtin_abort(tls)
}
}()
if _1_aiFree != nil {
_1_aiCol = _1_aiFree
goto _30
}
_1_iCol = (*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(i32(0)))).X0
_1_aiCol = &_1_iCol
_30:
_1_i = i32(0)
_31:
if _1_i >= (_pFKey.X5) {
goto _34
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aiCol)) + 4*uintptr(_1_i)))) == int32(_pTab.X10) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aiCol)) + 4*uintptr(_1_i))) = i32(-1)
}
func() {
if _1_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(_1_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108349), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117711)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X59) != nil {
_12_zCol = (*XColumn)(unsafe.Pointer(uintptr(_1_pTo.X1) + 16*uintptr(func() int16 {
if _1_pIdx != nil {
return (*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pIdx.X1)) + 2*uintptr(_1_i))))
}
return (_1_pTo.X10)
}()))).X0
_12_rcauth = _sqlite3AuthReadCol(tls, _pParse, _1_pTo.X0, _12_zCol, _iDb)
_1_bIgnore = bool2int(_12_rcauth == i32(2))
}
_1_i += 1
goto _31
_34:
_sqlite3TableLock(tls, _pParse, _iDb, _1_pTo.X7, uint8(i32(0)), _1_pTo.X0)
*(*int32)(unsafe.Pointer(&(_pParse.X17))) += 1
if _regOld != i32(0) {
_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regOld, i32(-1), _1_bIgnore)
}
if (_regNew != i32(0)) && (_isSetNullAction(tls, _pParse, _pFKey) == 0) {
_fkLookupParent(tls, _pParse, _iDb, _1_pTo, _1_pIdx, _pFKey, _1_aiCol, _regNew, i32(1), _1_bIgnore)
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_aiFree))
_4:
_pFKey = (*XFKey)(_pFKey.X1)
goto _3
_6:
_pFKey = _sqlite3FkReferences(tls, _pTab)
_45:
if _pFKey == nil {
goto _48
}
_15_pIdx = nil
_15_aiCol = nil
if (_aChange != nil) && (_fkParentIsModified(tls, _pTab, _pFKey, _aChange, _bChngRowid) == i32(0)) {
goto _46
}
if ((((_pFKey.X6) == 0) && (((_db.X6) & i32(33554432)) == 0)) && ((*XParse)(_pParse.X39) == nil)) && ((_pParse.X8) == 0) {
func() {
if _regOld != i32(0) || _regNew == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108404), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117743)))
crt.X__builtin_abort(tls)
}
}()
goto _46
}
if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_15_pIdx, &_15_aiCol) == 0 {
goto _58
}
if (_isIgnoreErrors == 0) || ((_db.X17) != 0) {
return
}
goto _46
_58:
func() {
if _15_aiCol == nil && (_pFKey.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108414), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FkCheckØ00__func__Ø000))), unsafe.Pointer(str(117766)))
crt.X__builtin_abort(tls)
}
}()
_15_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
if _15_pSrc == nil {
goto _64
}
_19_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&(_15_pSrc.X2)))))
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_19_pItem.X4))))) = (*XTable)(_pFKey.X0)
*(**int8)(unsafe.Pointer(&(_19_pItem.X2))) = (*XTable)(_pFKey.X0).X0
*(*uint32)(unsafe.Pointer(&((*XTable)(_19_pItem.X4).X8))) += 1
*(*int32)(unsafe.Pointer(&(_19_pItem.X11))) = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
if _regNew != i32(0) {
_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regNew, i32(-1))
}
if _regOld == i32(0) {
goto _66
}
_21_eAction = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(bool2int(_aChange != nil)))))
_fkScanChildren(tls, _pParse, _15_pSrc, _pTab, _15_pIdx, _pFKey, _15_aiCol, _regOld, i32(1))
if (((_pFKey.X6) == 0) && (_21_eAction != i32(9))) && (_21_eAction != i32(7)) {
_sqlite3MayAbort(tls, _pParse)
}
_66:
*(**int8)(unsafe.Pointer(&(_19_pItem.X2))) = nil
_sqlite3SrcListDelete(tls, _db, _15_pSrc)
_64:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_15_aiCol))
_46:
_pFKey = (*XFKey)(_pFKey.X3)
goto _45
_48:
_ = _1_iCol
}
var _sqlite3FkCheckØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FkCheckØ00__func__Ø000[0], str(117790), 15)
}
// This function is called when a row is inserted into or deleted from the
// child table of foreign key constraint pFKey. If an SQL UPDATE is executed
// on the child table of pFKey, this function is invoked twice for each row
// affected - once to "delete" the old row, and then again to "insert" the
// new row.
//
// Each time it is called, this function generates VDBE code to locate the
// row in the parent table that corresponds to the row being inserted into
// or deleted from the child table. If the parent row can be found, no
// special action is taken. Otherwise, if the parent row can *not* be
// found in the parent table:
//
// Operation | FK type | Action taken
// --------------------------------------------------------------------------
// INSERT immediate Increment the "immediate constraint counter".
//
// DELETE immediate Decrement the "immediate constraint counter".
//
// INSERT deferred Increment the "deferred constraint counter".
//
// DELETE deferred Decrement the "deferred constraint counter".
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.1" and "D.1".
func _fkLookupParent(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32, _isIgnore int32) {
var _i, _iCur, _iOk, _2_iReg, _4_iMustBeInt, _4_regTemp, _6_nCol, _6_regTemp, _6_regRec, _8_iJump, _9_iChild, _9_iParent int32
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
_iCur = (_pParse.X17) - i32(1)
_iOk = _sqlite3VdbeMakeLabel(tls, _v)
if _nIncr < i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(45), int32(_pFKey.X6), _iOk)
}
_i = i32(0)
_1:
if _i >= (_pFKey.X5) {
goto _4
}
_2_iReg = ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) + _regData) + i32(1)
_sqlite3VdbeAddOp2(tls, _v, i32(75), _2_iReg, _iOk)
_i += 1
goto _1
_4:
if _isIgnore != i32(0) {
goto _5
}
if _pIdx != nil {
goto _6
}
_4_regTemp = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp2(tls, _v, i32(65), ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(i32(0)))))+i32(1))+_regData, _4_regTemp)
_4_iMustBeInt = _sqlite3VdbeAddOp2(tls, _v, i32(17), _4_regTemp, i32(0))
if (_pTab == (*XTable)(_pFKey.X0)) && (_nIncr == i32(1)) {
_sqlite3VdbeAddOp3(tls, _v, i32(78), _regData, _iOk, _4_regTemp)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(144)))
}
_sqlite3OpenTable(tls, _pParse, _iCur, _iDb, _pTab, i32(106))
_sqlite3VdbeAddOp3(tls, _v, i32(32), _iCur, i32(0), _4_regTemp)
_sqlite3VdbeGoto(tls, _v, _iOk)
_sqlite3VdbeJumpHere(tls, _v, _sqlite3VdbeCurrentAddr(tls, _v)-i32(2))
_sqlite3VdbeJumpHere(tls, _v, _4_iMustBeInt)
_sqlite3ReleaseTempReg(tls, _pParse, _4_regTemp)
goto _9
_6:
_6_nCol = _pFKey.X5
_6_regTemp = _sqlite3GetTempRange(tls, _pParse, _6_nCol)
_6_regRec = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(106), _iCur, _pIdx.X11, _iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
_i = i32(0)
_10:
if _i >= _6_nCol {
goto _13
}
_sqlite3VdbeAddOp2(tls, _v, i32(64), ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i))))+i32(1))+_regData, _6_regTemp+_i)
_i += 1
goto _10
_13:
if _pTab != (*XTable)(_pFKey.X0) || _nIncr != i32(1) {
goto _15
}
_8_iJump = (_sqlite3VdbeCurrentAddr(tls, _v) + _6_nCol) + i32(1)
_i = i32(0)
_16:
if _i >= _6_nCol {
goto _19
}
_9_iChild = ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) + i32(1)) + _regData
_9_iParent = (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) + i32(1)) + _regData
func() {
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107820), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(116805)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i)))) == int32(_pTab.X10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107821), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(117805)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))) == int32(_pTab.X10) {
_9_iParent = _regData
}
_sqlite3VdbeAddOp3(tls, _v, i32(77), _9_iChild, _8_iJump, _9_iParent)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(16)))
_i += 1
goto _16
_19:
_sqlite3VdbeGoto(tls, _v, _iOk)
_15:
_sqlite3VdbeAddOp4(tls, _v, i32(101), _6_regTemp, _6_nCol, _6_regRec, _sqlite3IndexAffinityStr(tls, (*Xsqlite3)(_pParse.X0), _pIdx), _6_nCol)
_sqlite3VdbeAddOp4Int(tls, _v, i32(30), _iCur, _iOk, _6_regRec, i32(0))
_sqlite3ReleaseTempReg(tls, _pParse, _6_regRec)
_sqlite3ReleaseTempRange(tls, _pParse, _6_regTemp, _6_nCol)
_9:
_5:
if ((((_pFKey.X6) == 0) && ((((*Xsqlite3)(_pParse.X0).X6) & i32(33554432)) == 0)) && ((*XParse)(_pParse.X39) == nil)) && ((_pParse.X8) == 0) {
func() {
if _nIncr != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107849), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkLookupParentØ00__func__Ø000))), unsafe.Pointer(str(117827)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3HaltConstraint(tls, _pParse, i32(787), i32(2), nil, int8(i32(-2)), uint8(i32(4)))
goto _31
}
if (_nIncr > i32(0)) && (int32(_pFKey.X6) == i32(0)) {
_sqlite3MayAbort(tls, _pParse)
}
_sqlite3VdbeAddOp2(tls, _v, i32(147), int32(_pFKey.X6), _nIncr)
_31:
_sqlite3VdbeResolveLabel(tls, _v, _iOk)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _iCur)
}
var _fkLookupParentØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_fkLookupParentØ00__func__Ø000[0], str(117836), 15)
}
// Return true if the parser passed as the first argument is being
// used to code a trigger that is really a "SET NULL" action belonging
// to trigger pFKey.
func _isSetNullAction(tls *crt.TLS, _pParse *XParse, _pFKey *XFKey) (r0 int32) {
var _1_p *XTrigger
var _pTop *XParse
_pTop = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
if (*XTriggerPrg)(_pTop.X69) == nil {
goto _2
}
_1_p = (*XTrigger)((*XTriggerPrg)(_pTop.X69).X0)
if ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(i32(0)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(0))))) == i32(7))) || ((_1_p == (*(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(i32(1)))))) && (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(i32(1))))) == i32(7))) {
return i32(1)
}
_2:
return i32(0)
}
// This function is called to generate code executed when a row is deleted
// from the parent table of foreign key constraint pFKey and, if pFKey is
// deferred, when a row is inserted into the same table. When generating
// code for an SQL UPDATE operation, this function may be called twice -
// once to "delete" the old row and once to "insert" the new row.
//
// Parameter nIncr is passed -1 when inserting a row (as this may decrease
// the number of FK violations in the db) or +1 when deleting one (as this
// may increase the number of FK constraint problems).
//
// The code generated by this function scans through the rows in the child
// table that correspond to the parent table row being deleted or inserted.
// For each child row found, one of the following actions is taken:
//
// Operation | FK type | Action taken
// --------------------------------------------------------------------------
// DELETE immediate Increment the "immediate constraint counter".
// Or, if the ON (UPDATE|DELETE) action is RESTRICT,
// throw a "FOREIGN KEY constraint failed" exception.
//
// INSERT immediate Decrement the "immediate constraint counter".
//
// DELETE deferred Increment the "deferred constraint counter".
// Or, if the ON (UPDATE|DELETE) action is RESTRICT,
// throw a "FOREIGN KEY constraint failed" exception.
//
// INSERT deferred Decrement the "deferred constraint counter".
//
// These operations are identified in the comment at the top of this file
// (fkey.c) as "I.2" and "D.2".
func _fkScanChildren(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pTab *XTable, _pIdx *XIndex, _pFKey *XFKey, _aiCol *int32, _regData int32, _nIncr int32) {
var _2_iCol, _6_iCol int16
var _i, _iFkIfZero int32
var _2_zCol *int8
var _db *Xsqlite3
var _v *TVdbe
var _pWhere, _2_pLeft, _2_pRight, _2_pEq, _3_pNe, _3_pLeft, _3_pRight, _5_pEq, _5_pAll *XExpr
var _5_pPk *XIndex
var _sNameContext XNameContext
var _pWInfo *XWhereInfo
_db = (*Xsqlite3)(_pParse.X0)
_pWhere = nil
_iFkIfZero = i32(0)
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _pIdx != nil && (*XTable)(_pIdx.X3) != _pTab {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107969), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117851)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pIdx != nil && int32(_pIdx.X13) != (_pFKey.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107970), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117881)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pIdx == nil && (_pFKey.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107971), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117919)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pIdx == nil && ((_pTab.X9)&uint32(i32(32))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107972), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(117945)))
crt.X__builtin_abort(tls)
}
}()
if _nIncr < i32(0) {
_iFkIfZero = _sqlite3VdbeAddOp2(tls, _v, i32(45), int32(_pFKey.X6), i32(0))
}
_i = i32(0)
_13:
if _i >= (_pFKey.X5) {
goto _16
}
_2_iCol = int16(func() int32 {
if _pIdx != nil {
return int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i))))
}
return i32(-1)
}())
_2_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _2_iCol)
_2_iCol = int16(func() int32 {
if _aiCol != nil {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aiCol)) + 4*uintptr(_i))))
}
return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(i32(0)))).X0)
}())
func() {
if int32(_2_iCol) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107997), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(99182)))
crt.X__builtin_abort(tls)
}
}()
_2_zCol = (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pFKey.X0).X1) + 16*uintptr(_2_iCol))).X0
_2_pRight = _sqlite3Expr(tls, _db, i32(27), _2_zCol)
_2_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _2_pLeft, _2_pRight)
_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _2_pEq)
_i += 1
goto _13
_16:
if _pTab != (*XTable)(_pFKey.X0) || _nIncr <= i32(0) {
goto _24
}
if ((_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, int16(i32(-1)))
_3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(i32(0)))).X11, int16(i32(-1)))
_3_pNe = _sqlite3PExpr(tls, _pParse, i32(77), _3_pLeft, _3_pRight)
goto _26
}
_5_pAll = nil
_5_pPk = _sqlite3PrimaryKeyIndex(tls, _pTab)
func() {
if _pIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108026), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(42069)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_29:
if _i >= int32(_5_pPk.X13) {
goto _32
}
_6_iCol = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X1)) + 2*uintptr(_i)))
func() {
if int32(_6_iCol) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108029), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkScanChildrenØ00__func__Ø000))), unsafe.Pointer(str(99182)))
crt.X__builtin_abort(tls)
}
}()
_3_pLeft = _exprTableRegister(tls, _pParse, _pTab, _regData, _6_iCol)
_3_pRight = _exprTableColumn(tls, _db, _pTab, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(i32(0)))).X11, _6_iCol)
_5_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _3_pLeft, _3_pRight)
_5_pAll = _sqlite3ExprAnd(tls, _db, _5_pAll, _5_pEq)
_i += 1
goto _29
_32:
_3_pNe = _sqlite3PExpr(tls, _pParse, i32(19), _5_pAll, nil)
_26:
_pWhere = _sqlite3ExprAnd(tls, _db, _pWhere, _3_pNe)
_24:
crt.Xmemset(tls, (unsafe.Pointer)(&_sNameContext), i32(0), u32(32))
*(**XSrcList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNameContext.X1))))) = _pSrc
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sNameContext.X0))))) = _pParse
_sqlite3ResolveExprNames(tls, &_sNameContext, _pWhere)
_pWInfo = _sqlite3WhereBegin(tls, _pParse, _pSrc, _pWhere, nil, nil, uint16(i32(0)), i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(147), int32(_pFKey.X6), _nIncr)
if _pWInfo != nil {
_sqlite3WhereEnd(tls, _pWInfo)
}
_sqlite3ExprDelete(tls, _db, _pWhere)
if _iFkIfZero != 0 {
_sqlite3VdbeJumpHere(tls, _v, _iFkIfZero)
}
_ = _sNameContext
}
var _fkScanChildrenØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_fkScanChildrenØ00__func__Ø000[0], str(117971), 15)
}
// Return an Expr object that refers to a memory register corresponding
// to column iCol of table pTab.
//
// regBase is the first of an array of register that contains the data
// for pTab. regBase itself holds the rowid. regBase+1 holds the first
// column. regBase+2 holds the second column, and so forth.
func _exprTableRegister(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _regBase int32, _iCol int16) (r0 *XExpr) {
var _zColl *int8
var _db *Xsqlite3
var _pExpr *XExpr
var _pCol *XColumn
_db = (*Xsqlite3)(_pParse.X0)
_pExpr = _sqlite3Expr(tls, _db, i32(157), nil)
if _pExpr == nil {
goto _0
}
if int32(_iCol) < i32(0) || int32(_iCol) == int32(_pTab.X10) {
goto _2
}
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol)))
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = (_regBase + int32(_iCol)) + i32(1)
*(*int8)(unsafe.Pointer(&(_pExpr.X1))) = _pCol.X4
_zColl = _pCol.X2
if _zColl == nil {
_zColl = (*XCollSeq)(_db.X2).X0
}
_pExpr = _sqlite3ExprAddCollateString(tls, _pParse, _pExpr, _zColl)
goto _4
_2:
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _regBase
*(*int8)(unsafe.Pointer(&(_pExpr.X1))) = int8(i32(68))
_4:
_0:
return _pExpr
}
// Return an Expr object that refers to column iCol of table pTab which
// has cursor iCur.
func _exprTableColumn(tls *crt.TLS, _db *Xsqlite3, _pTab *XTable, _iCursor int32, _iCol int16) (r0 *XExpr) {
var _pExpr *XExpr
_pExpr = _sqlite3Expr(tls, _db, i32(152), nil)
if _pExpr != nil {
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pExpr.X14))))) = _pTab
*(*int32)(unsafe.Pointer(&(_pExpr.X8))) = _iCursor
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = _iCol
}
return _pExpr
}
// 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 _sqlite3CompleteInsertion(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDataCur int32, _iIdxCur int32, _regNewData int32, _aRegIdx *int32, _update_flags int32, _appendBias int32, _useSeekResult int32) {
var _regData, _regRec, _i int32
var _pik_flags, _bAffinityDone uint8
var _v *TVdbe
var _pIdx *XIndex
_bAffinityDone = u8(0)
func() {
if _update_flags != i32(0) && _update_flags != i32(4) && _update_flags != i32(6) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110559), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000))), unsafe.Pointer(str(117986)))
crt.X__builtin_abort(tls)
}
}()
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110565), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSelect)(_pTab.X3) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110566), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000))), unsafe.Pointer(str(102268)))
crt.X__builtin_abort(tls)
}
}()
*func() **XIndex { _i = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_8:
if _pIdx == nil {
goto _11
}
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i)))) == i32(0) {
goto _9
}
_bAffinityDone = uint8(i32(1))
if (*XExpr)(_pIdx.X9) != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(75), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))), _sqlite3VdbeCurrentAddr(tls, _v)+i32(2))
}
_pik_flags = uint8(func() int32 {
if _useSeekResult != 0 {
return i32(16)
}
return i32(0)
}())
if (int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2)) && (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) {
func() {
if int32(_pParse.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CompleteInsertionØ00__func__Ø000))), unsafe.Pointer(str(118090)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_pik_flags
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
{
p := &_pik_flags
*p = uint8(int32(*p) | (_update_flags & i32(2)))
sink2 = *p
}
}
_sqlite3VdbeAddOp4Int(tls, _v, i32(128), _iIdxCur+_i, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))), (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))))+i32(1), int32(func() uint16 {
if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return (_pIdx.X13)
}
return (_pIdx.X14)
}()))
_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
_9:
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_i }() += 1
goto _8
_11:
if ((_pTab.X9) & uint32(i32(32))) != uint32(i32(0)) {
return
}
_regData = _regNewData + i32(1)
_regRec = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regData, int32(_pTab.X11), _regRec)
if _bAffinityDone == 0 {
_sqlite3TableAffinity(tls, _v, _pTab, i32(0))
_sqlite3ExprCacheAffinityChange(tls, _pParse, _regData, int32(_pTab.X11))
}
if (_pParse.X6) != 0 {
_pik_flags = uint8(i32(0))
goto _25
}
_pik_flags = uint8(i32(1))
{
p := &_pik_flags
*p = uint8(int32(*p) | func() int32 {
if _update_flags != 0 {
return _update_flags
}
return i32(32)
}())
sink2 = *p
}
_25:
if _appendBias != 0 {
{
p := &_pik_flags
*p = uint8(int32(*p) | i32(8))
sink2 = *p
}
}
if _useSeekResult != 0 {
{
p := &_pik_flags
*p = uint8(int32(*p) | i32(16))
sink2 = *p
}
}
_sqlite3VdbeAddOp3(tls, _v, i32(118), _iDataCur, _regRec, _regNewData)
if (_pParse.X6) == 0 {
_sqlite3VdbeAppendP4(tls, _v, (unsafe.Pointer)(_pTab), i32(-15))
}
_sqlite3VdbeChangeP5(tls, _v, uint16(_pik_flags))
}
var _sqlite3CompleteInsertionØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CompleteInsertionØ00__func__Ø000[0], str(118108), 25)
}
// This function is called when deleting or updating a row to implement
// any required CASCADE, SET NULL or SET DEFAULT actions.
func _sqlite3FkActions(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pChanges *XExprList, _regOld int32, _aChange *int32, _bChngRowid int32) {
var _3_pAct *XTrigger
var _1_pFKey *XFKey
if (((*Xsqlite3)(_pParse.X0).X6) & i32(524288)) == 0 {
goto _0
}
_1_pFKey = _sqlite3FkReferences(tls, _pTab)
_1:
if _1_pFKey == nil {
goto _4
}
if _aChange != nil && _fkParentIsModified(tls, _pTab, _1_pFKey, _aChange, _bChngRowid) == 0 {
goto _6
}
_3_pAct = _fkActionTrigger(tls, _pParse, _pTab, _1_pFKey, _pChanges)
if _3_pAct != nil {
_sqlite3CodeRowTriggerDirect(tls, _pParse, _3_pAct, _pTab, _regOld, i32(2), i32(0))
}
_6:
_1_pFKey = (*XFKey)(_1_pFKey.X3)
goto _1
_4:
_0:
}
// This function is called when an UPDATE or DELETE operation is being
// compiled on table pTab, which is the parent table of foreign-key pFKey.
// If the current operation is an UPDATE, then the pChanges parameter is
// passed a pointer to the list of columns being modified. If it is a
// DELETE, pChanges is passed a NULL pointer.
//
// It returns a pointer to a Trigger structure containing a trigger
// equivalent to the ON UPDATE or ON DELETE action specified by pFKey.
// If the action is "NO ACTION" or "RESTRICT", then a NULL pointer is
// returned (these actions require no special handling by the triggers
// sub-system, code for them is created by fkScanChildren()).
//
// For example, if pFKey is the foreign key and pTab is table "p" in
// the following schema:
//
// CREATE TABLE p(pk PRIMARY KEY);
// CREATE TABLE c(ck REFERENCES p ON DELETE CASCADE);
//
// then the returned trigger structure is equivalent to:
//
// CREATE TRIGGER ... DELETE ON p BEGIN
// DELETE FROM c WHERE ck = old.pk;
// END;
//
// The returned pointer is cached as part of the foreign key object. It
// is eventually freed along with the rest of the foreign key object by
// sqlite3FkDelete().
func _fkActionTrigger(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pFKey *XFKey, _pChanges *XExprList) (r0 *XTrigger) {
var _action, _iAction, _2_nFrom, _2_i, _3_iFromCol int32
var _2_aiCol *int32
var _2_zFrom *int8
var _3_tOld, _3_tNew, _3_tFromCol, _3_tToCol, _11_tFrom XToken
var _db *Xsqlite3
var _pTrigger *XTrigger
var _2_pList *XExprList
var _2_pSelect *XSelect
var _2_pWhere, _2_pWhen, _3_pEq, _5_pNew, _7_pDflt, _11_pRaise *XExpr
var _2_pIdx *XIndex
var _2_pStep *XTriggerStep
_db = (*Xsqlite3)(_pParse.X0)
_iAction = bool2int(_pChanges != nil)
_action = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_pFKey.X7))))) + 1*uintptr(_iAction))))
if (_action == i32(6)) && ((_db.X6)&i32(33554432)) != 0 {
return nil
}
_pTrigger = *(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(_iAction)))
if _action == i32(0) || _pTrigger != nil {
goto _3
}
_2_pIdx = nil
_2_aiCol = nil
_2_pStep = nil
_2_pWhere = nil
_2_pList = nil
_2_pSelect = nil
_2_pWhen = nil
if _sqlite3FkLocateIndex(tls, _pParse, _pTab, _pFKey, &_2_pIdx, &_2_aiCol) != 0 {
return nil
}
func() {
if _2_aiCol == nil && (_pFKey.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108611), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(117766)))
crt.X__builtin_abort(tls)
}
}()
_2_i = i32(0)
_8:
if _2_i >= (_pFKey.X5) {
goto _11
}
_3_tOld = XToken{}
*(**int8)(unsafe.Pointer(&(_3_tOld.X0))) = str(43177)
*(*uint32)(unsafe.Pointer(&(_3_tOld.X1))) = uint32(i32(3))
_3_tNew = XToken{}
*(**int8)(unsafe.Pointer(&(_3_tNew.X0))) = str(43173)
*(*uint32)(unsafe.Pointer(&(_3_tNew.X1))) = uint32(i32(3))
_3_iFromCol = func() int32 {
if _2_aiCol != nil {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_aiCol)) + 4*uintptr(_2_i))))
}
return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_pFKey.X9))))) + 8*uintptr(i32(0)))).X0)
}()
func() {
if _3_iFromCol < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108622), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(118133)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _2_pIdx == nil && (int32(_pTab.X10) < i32(0) || int32(_pTab.X10) >= int32(_pTab.X11)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108623), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(118145)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _2_pIdx != nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X1)) + 2*uintptr(_2_i)))) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108624), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(117711)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3TokenInit(tls, &_3_tToCol, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(func() int16 {
if _2_pIdx != nil {
return (*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pIdx.X1)) + 2*uintptr(_2_i))))
}
return (_pTab.X10)
}()))).X0)
_sqlite3TokenInit(tls, &_3_tFromCol, (*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pFKey.X0).X1)+16*uintptr(_3_iFromCol))).X0)
_3_pEq = _sqlite3PExpr(tls, _pParse, i32(78), _sqlite3PExpr(tls, _pParse, i32(122), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tOld, i32(0)), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tToCol, i32(0))), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tFromCol, i32(0)))
_2_pWhere = _sqlite3ExprAnd(tls, _db, _2_pWhere, _3_pEq)
if _pChanges != nil {
_3_pEq = _sqlite3PExpr(tls, _pParse, i32(72), _sqlite3PExpr(tls, _pParse, i32(122), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tOld, i32(0)), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tToCol, i32(0))), _sqlite3PExpr(tls, _pParse, i32(122), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tNew, i32(0)), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tToCol, i32(0))))
_2_pWhen = _sqlite3ExprAnd(tls, _db, _2_pWhen, _3_pEq)
}
if _action == i32(6) || _action == i32(9) && _pChanges == nil {
goto _28
}
if _action == i32(9) {
_5_pNew = _sqlite3PExpr(tls, _pParse, i32(122), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tNew, i32(0)), _sqlite3ExprAlloc(tls, _db, i32(27), &_3_tToCol, i32(0)))
goto _34
}
if _action != i32(8) {
goto _31
}
_7_pDflt = (*XExpr)((*XColumn)(unsafe.Pointer(uintptr((*XTable)(_pFKey.X0).X1) + 16*uintptr(_3_iFromCol))).X1)
if _7_pDflt != nil {
_5_pNew = _sqlite3ExprDup(tls, _db, _7_pDflt, i32(0))
goto _33
}
_5_pNew = _sqlite3ExprAlloc(tls, _db, i32(101), nil, i32(0))
_33:
goto _34
_31:
_5_pNew = _sqlite3ExprAlloc(tls, _db, i32(101), nil, i32(0))
_34:
_2_pList = _sqlite3ExprListAppend(tls, _pParse, _2_pList, _5_pNew)
_sqlite3ExprListSetName(tls, _pParse, _2_pList, &_3_tFromCol, i32(0))
_28:
_2_i += 1
goto _8
_11:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_aiCol))
_2_zFrom = (*XTable)(_pFKey.X0).X0
_2_nFrom = _sqlite3Strlen30(tls, _2_zFrom)
if _action != i32(6) {
goto _35
}
*(**int8)(unsafe.Pointer(&(_11_tFrom.X0))) = _2_zFrom
*(*uint32)(unsafe.Pointer(&(_11_tFrom.X1))) = uint32(_2_nFrom)
_11_pRaise = _sqlite3Expr(tls, _db, i32(56), str(58234))
if _11_pRaise != nil {
*(*int8)(unsafe.Pointer(&(_11_pRaise.X1))) = int8(i32(2))
}
_2_pSelect = _sqlite3SelectNew(tls, _pParse, _sqlite3ExprListAppend(tls, _pParse, nil, _11_pRaise), _sqlite3SrcListAppend(tls, _db, nil, &_11_tFrom, nil), _2_pWhere, nil, nil, nil, uint32(i32(0)), nil, nil)
_2_pWhere = nil
_35:
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) += 1
_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, uint64((u32(72)+uint32(_2_nFrom))+uint32(i32(1)))))
if _pTrigger == nil {
goto _37
}
_2_pStep = store76((**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X8))))), (*XTriggerStep)(unsafe.Pointer((*XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTrigger))+36*uintptr(i32(1)))))))
*(**int8)(unsafe.Pointer(&(_2_pStep.X4))) = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_pStep)) + 36*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_2_pStep.X4), (unsafe.Pointer)(_2_zFrom), uint32(_2_nFrom))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X5))))) = _sqlite3ExprDup(tls, _db, _2_pWhere, i32(1))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X6))))) = _sqlite3ExprListDup(tls, _db, _2_pList, i32(1))
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X3))))) = _sqlite3SelectDup(tls, _db, _2_pSelect, i32(1))
if _2_pWhen != nil {
_2_pWhen = _sqlite3PExpr(tls, _pParse, i32(19), _2_pWhen, nil)
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X4))))) = _sqlite3ExprDup(tls, _db, _2_pWhen, i32(1))
}
_37:
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) -= 1
_sqlite3ExprDelete(tls, _db, _2_pWhere)
_sqlite3ExprDelete(tls, _db, _2_pWhen)
_sqlite3ExprListDelete(tls, _db, _2_pList)
_sqlite3SelectDelete(tls, _db, _2_pSelect)
if int32(_db.X17) == i32(1) {
_fkTriggerDelete(tls, _db, _pTrigger)
return nil
}
func() {
if _2_pStep == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(108735), unsafe.Pointer((*int8)(unsafe.Pointer(&_fkActionTriggerØ00__func__Ø000))), unsafe.Pointer(str(118199)))
crt.X__builtin_abort(tls)
}
}()
switch _action {
case i32(6):
goto _43
case i32(9):
goto _44
default:
goto _47
}
_43:
*(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(119))
goto _46
_44:
if _pChanges == nil {
*(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(109))
goto _46
}
_47:
*(*uint8)(unsafe.Pointer(&(_2_pStep.X0))) = uint8(i32(110))
_46:
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_2_pStep.X2))))) = _pTrigger
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X6))))) = (*XSchema)(_pTab.X20)
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X7))))) = (*XSchema)(_pTab.X20)
*(**XTrigger)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]unsafe.Pointer)(unsafe.Pointer(&(_pFKey.X8))))) + 4*uintptr(_iAction))) = _pTrigger
*(*uint8)(unsafe.Pointer(&(_pTrigger.X2))) = uint8(func() int32 {
if _pChanges != nil {
return i32(110)
}
return i32(109)
}())
_3:
return _pTrigger
_ = _3_tOld
_ = _3_tNew
_ = _3_tFromCol
_ = _3_tToCol
_ = _11_tFrom
panic(0)
}
var _fkActionTriggerØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_fkActionTriggerØ00__func__Ø000[0], str(118208), 16)
}
func _sqlite3AutoincrementEnd(tls *crt.TLS, _pParse *XParse) {
if (*TAggInfo_func)(_pParse.X38) != nil {
_autoIncrementEnd(tls, _pParse)
}
}
// This routine generates the code needed to write autoincrement
// maximum rowid values back into the sqlite_sequence register.
// Every statement that might do an INSERT into an autoincrement
// table (either directly or through triggers) needs to call this
// routine just before the "exit" code.
func _autoIncrementEnd(tls *crt.TLS, _pParse *XParse) {
var _1_iRec, _1_memId int32
var _db *Xsqlite3
var _1_pDb *XDb
var _v *TVdbe
var _1_aOp *XVdbeOp
var _p *TAggInfo_func
_v = (*TVdbe)(_pParse.X2)
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109164), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000))), unsafe.Pointer(str(41861)))
crt.X__builtin_abort(tls)
}
}()
_p = (*TAggInfo_func)(_pParse.X38)
_2:
if _p == nil {
goto _5
}
_1_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_p.X2)))
_1_memId = _p.X3
_1_iRec = _sqlite3GetTempReg(tls, _pParse)
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), (*XSchema)(_1_pDb.X4)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109180), unsafe.Pointer((*int8)(unsafe.Pointer(&_autoIncrementEndØ00__func__Ø000))), unsafe.Pointer(str(41863)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3OpenTable(tls, _pParse, i32(0), _p.X2, (*XTable)((*XSchema)(_1_pDb.X4).X6), i32(107))
_1_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(5), (*XVdbeOpList)(unsafe.Pointer(&_autoIncrementEndØ00autoIncEndØ002)), _autoIncrementEndØ00iLnØ001)
if _1_aOp == nil {
goto _5
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(0)))).X3))) = _1_memId + i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(1)))).X4))) = _1_memId + i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(2)))).X3))) = _1_memId - i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(2)))).X5))) = _1_iRec
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X4))) = _1_iRec
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X5))) = _1_memId + i32(1)
*(*uint16)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_aOp)) + 24*uintptr(i32(3)))).X2))) = uint16(i32(8))
_sqlite3ReleaseTempReg(tls, _pParse, _1_iRec)
_p = (*TAggInfo_func)(_p.X0)
goto _2
_5:
}
var _autoIncrementEndØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_autoIncrementEndØ00__func__Ø000[0], str(118224), 17)
}
var _autoIncrementEndØ00autoIncEndØ002 [5]XVdbeOpList
func init() {
_autoIncrementEndØ00autoIncEndØ002 = [5]XVdbeOpList{XVdbeOpList{X0: u8(76), X1: i8(0), X2: i8(2), X3: i8(0)}, XVdbeOpList{X0: u8(117), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(101), X1: i8(0), X2: i8(2), X3: i8(0)}, XVdbeOpList{X0: u8(118), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(114), X1: i8(0), X2: i8(0), X3: i8(0)}}
}
var _autoIncrementEndØ00iLnØ001 int32
// Pop an authorization context that was previously pushed
// by sqlite3AuthContextPush
func _sqlite3AuthContextPop(tls *crt.TLS, _pContext *XAuthContext) {
if (*XParse)(_pContext.X1) != nil {
*(**int8)(unsafe.Pointer(&((*XParse)(_pContext.X1).X65))) = _pContext.X0
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pContext.X1))))) = nil
}
}
// Convert the pStep->zTarget string into a SrcList and return a pointer
// to that SrcList.
//
// This routine adds a specific database name, if needed, to the target when
// forming the SrcList. This prevents a trigger in one database from
// referring to a target in another database. An exception is when the
// trigger is in TEMP in which case it can refer to any other database it
// wants.
func _targetSrcList(tls *crt.TLS, _pParse *XParse, _pStep *XTriggerStep) (r0 *XSrcList) {
var _iDb int32
var _2_zDb *int8
var _db *Xsqlite3
var _pSrc *XSrcList
_db = (*Xsqlite3)(_pParse.X0)
_pSrc = _sqlite3SrcListAppend(tls, _db, nil, nil, nil)
if _pSrc == nil {
goto _0
}
func() {
if (_pSrc.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123305), unsafe.Pointer((*int8)(unsafe.Pointer(&_targetSrcListØ00__func__Ø000))), unsafe.Pointer(str(118241)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr((_pSrc.X0)-i32(1)))).X2))) = _sqlite3DbStrDup(tls, _db, _pStep.X4)
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)((*XTrigger)(_pStep.X2).X6))
if (_iDb == i32(0)) || (_iDb >= i32(2)) {
func() {
if _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123310), unsafe.Pointer((*int8)(unsafe.Pointer(&_targetSrcListØ00__func__Ø000))), unsafe.Pointer(str(54328)))
crt.X__builtin_abort(tls)
}
}()
_2_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2))))) + 68*uintptr((_pSrc.X0)-i32(1)))).X1))) = _sqlite3DbStrDup(tls, _db, _2_zDb)
}
_0:
return _pSrc
}
var _targetSrcListØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_targetSrcListØ00__func__Ø000[0], str(118254), 14)
}
// 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 and its indices
// put VALUES clause expressions into registers
// write the resulting record into
// cleanup
//
// The three remaining templates assume the statement is of the form
//
// INSERT INTO SELECT ...
//
// If the SELECT clause is of the restricted form "SELECT * FROM " -
// 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 and are distinct tables but have identical
// schemas, including all the same indices, then a special optimization
// is invoked that copies raw records from over to .
// See the xferOptimization() function for the implementation of this
// template. This is the 2nd template.
//
// open a write cursor to
// open read cursor on
// transfer all records in over to
// close cursors
// foreach index on
// open a write cursor on the index
// open a read cursor on the corresponding 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 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 and its indices
// C: yield X, at EOF goto D
// insert the select result into 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 and its indices
// rewind temp table
// C: loop over rows of intermediate table
// transfer values form intermediate table into
// end loop
// D: cleanup
func _sqlite3Insert(tls *crt.TLS, _pParse *XParse, _pTabList *XSrcList, _pSelect *XSelect, _pColumn *XIdList, _onError int32) {
var _i, _j, _nColumn, _nHidden, _iDataCur, _iIdxCur, _ipkColumn, _endOfLoop, _srcTab, _addrInsTop, _addrCont, _iDb, _regFromSelect, _regAutoinc, _regRowCount, _regIns, _regRowid, _regData, _isView, _tmask, _18_regYield, _18_addrTop, _18_rc, _20_regRec, _20_regTempRowid, _20_addrL, _30_nIdx, _35_regCols, _37_addr1, _54_addr1, _59_iRegStore, _72_isReplace, _72_bUseSeek int32
var _aRegIdx *int32
var _zTab, _71_pVTab *int8
var _useTempTable, _appendFlag, _withoutRowid, _bIdListInOrder uint8
var _db *Xsqlite3
var _pTrigger *XTrigger
var _pTab *XTable
var _v *TVdbe
var _pList *XExprList
var _pIdx *XIndex
var _52_pOp *XVdbeOp
var _21_sNC XNameContext
var _dest XSelectDest
_nHidden = i32(0)
_iDataCur = i32(0)
_iIdxCur = i32(0)
_ipkColumn = i32(-1)
_srcTab = i32(0)
_addrInsTop = i32(0)
_addrCont = i32(0)
_useTempTable = u8(0)
_appendFlag = u8(0)
_pList = nil
_regFromSelect = i32(0)
_regAutoinc = i32(0)
_regRowCount = i32(0)
_aRegIdx = nil
_db = (*Xsqlite3)(_pParse.X0)
crt.Xmemset(tls, (unsafe.Pointer)(&_dest), i32(0), u32(24))
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
goto _insert_cleanup
}
if ((_pSelect != nil) && (((_pSelect.X3) & uint32(i32(512))) != uint32(i32(0)))) && ((*XSelect)(_pSelect.X13) == nil) {
_pList = (*XExprList)(_pSelect.X0)
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSelect.X0))))) = nil
_sqlite3SelectDelete(tls, _db, _pSelect)
_pSelect = nil
}
func() {
if (_pTabList.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109377), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(115025)))
crt.X__builtin_abort(tls)
}
}()
_zTab = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTabList.X2))))) + 68*uintptr(i32(0)))).X2
if func() int32 {
if _zTab == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109379), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _insert_cleanup
}
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTabList)
if _pTab == nil {
goto _insert_cleanup
}
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
func() {
if _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109385), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(54328)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(18), _pTab.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0) != 0 {
goto _insert_cleanup
}
_withoutRowid = uint8(bool2int(((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))))
_pTrigger = _sqlite3TriggersExist(tls, _pParse, _pTab, i32(108), nil, &_tmask)
_isView = bool2int((*XSelect)(_pTab.X3) != nil)
func() {
if (_pTrigger == nil || _tmask == 0) && (_pTrigger != nil || _tmask != i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109407), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118268)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
goto _insert_cleanup
}
if _sqlite3IsReadOnly(tls, _pParse, _pTab, _tmask) != 0 {
goto _insert_cleanup
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _insert_cleanup
}
if int32(_pParse.X6) == i32(0) {
_sqlite3VdbeCountChanges(tls, _v)
}
_sqlite3BeginWriteOperation(tls, _pParse, bool2int((_pSelect != nil) || (_pTrigger != nil)), _iDb)
if (_pColumn == nil) && _xferOptimization(tls, _pParse, _pTab, _pSelect, _onError, _iDb) != 0 {
func() {
if _pTrigger != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109440), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118317)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pList != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109441), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118327)))
crt.X__builtin_abort(tls)
}
}()
goto _insert_end
}
_regAutoinc = _autoIncBegin(tls, _pParse, _iDb, _pTab)
_regRowid = store1(&_regIns, (_pParse.X18)+i32(1))
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + (int32(_pTab.X11) + i32(1))
sink1 = *p
}
if (_pTab.X16) != 0 {
_regRowid += 1
*(*int32)(unsafe.Pointer(&(_pParse.X18))) += 1
}
_regData = _regRowid + i32(1)
_bIdListInOrder = uint8(bool2int(((_pTab.X9) & uint32(i32(128))) == uint32(i32(0))))
if _pColumn == nil {
goto _31
}
_i = i32(0)
_32:
if _i >= (_pColumn.X1) {
goto _35
}
*(*int32)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 8*uintptr(_i))).X1))) = i32(-1)
_i += 1
goto _32
_35:
_i = i32(0)
_36:
if _i >= (_pColumn.X1) {
goto _39
}
_j = i32(0)
_40:
if _j >= int32(_pTab.X11) {
goto _43
}
if _sqlite3StrICmp(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0)+8*uintptr(_i))).X0, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_j))).X0) != i32(0) {
goto _44
}
*(*int32)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 8*uintptr(_i))).X1))) = _j
if _i != _j {
_bIdListInOrder = uint8(i32(0))
}
if _j == int32(_pTab.X10) {
_ipkColumn = _i
func() {
if _withoutRowid != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109484), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118336)))
crt.X__builtin_abort(tls)
}
}()
}
goto _43
_44:
_j += 1
goto _40
_43:
if _j < int32(_pTab.X11) {
goto _49
}
if _sqlite3IsRowid(tls, (*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0)+8*uintptr(_i))).X0) != 0 && (_withoutRowid == 0) {
_ipkColumn = _i
_bIdListInOrder = uint8(i32(0))
goto _52
}
_sqlite3ErrorMsg(tls, _pParse, str(118350), unsafe.Pointer(_pTabList), i32(0), unsafe.Pointer((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0)+8*uintptr(_i))).X0))
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
goto _insert_cleanup
_52:
_49:
_i += 1
goto _36
_39:
_31:
if _pSelect == nil {
goto _53
}
_18_regYield = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_18_addrTop = _sqlite3VdbeCurrentAddr(tls, _v) + i32(1)
_sqlite3VdbeAddOp3(tls, _v, i32(15), _18_regYield, i32(0), _18_addrTop)
_sqlite3SelectDestInit(tls, &_dest, i32(13), _18_regYield)
*(*int32)(unsafe.Pointer(&(_dest.X3))) = func() int32 {
if _bIdListInOrder != 0 {
return _regData
}
return i32(0)
}()
*(*int32)(unsafe.Pointer(&(_dest.X4))) = int32(_pTab.X11)
_18_rc = _sqlite3Select(tls, _pParse, _pSelect, &_dest)
_regFromSelect = _dest.X3
if (_18_rc != 0 || ((_db.X17) != 0)) || (_pParse.X16) != 0 {
goto _insert_cleanup
}
_sqlite3VdbeEndCoroutine(tls, _v, _18_regYield)
_sqlite3VdbeJumpHere(tls, _v, _18_addrTop-i32(1))
func() {
if (*XExprList)(_pSelect.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109526), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118382)))
crt.X__builtin_abort(tls)
}
}()
_nColumn = (*XExprList)(_pSelect.X0).X0
if (_pTrigger != nil) || _readsTable(tls, _pParse, _iDb, _pTab) != 0 {
_useTempTable = uint8(i32(1))
}
if _useTempTable != 0 {
_srcTab = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_20_regRec = _sqlite3GetTempReg(tls, _pParse)
_20_regTempRowid = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp2(tls, _v, i32(110), _srcTab, _nColumn)
_20_addrL = _sqlite3VdbeAddOp1(tls, _v, i32(16), _dest.X2)
_sqlite3VdbeAddOp3(tls, _v, i32(101), _regFromSelect, _nColumn, _20_regRec)
_sqlite3VdbeAddOp2(tls, _v, i32(117), _srcTab, _20_regTempRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _srcTab, _20_regRec, _20_regTempRowid)
_sqlite3VdbeGoto(tls, _v, _20_addrL)
_sqlite3VdbeJumpHere(tls, _v, _20_addrL)
_sqlite3ReleaseTempReg(tls, _pParse, _20_regRec)
_sqlite3ReleaseTempReg(tls, _pParse, _20_regTempRowid)
}
goto _64
_53:
crt.Xmemset(tls, (unsafe.Pointer)(&_21_sNC), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_21_sNC.X0))))) = _pParse
_srcTab = i32(-1)
func() {
if int32(_useTempTable) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109578), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118398)))
crt.X__builtin_abort(tls)
}
}()
if _pList == nil {
goto _67
}
_nColumn = _pList.X0
if _sqlite3ResolveExprListNames(tls, &_21_sNC, _pList) != 0 {
goto _insert_cleanup
}
goto _69
_67:
_nColumn = i32(0)
_69:
_64:
if (_pColumn == nil) && (_nColumn > i32(0)) {
_ipkColumn = int32(_pTab.X10)
}
_i = i32(0)
_72:
if _i >= int32(_pTab.X11) {
goto _75
}
{
p := &_nHidden
*p = (*p) + func() int32 {
if (int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X6) & i32(2)) != i32(0) {
return i32(1)
}
return i32(0)
}()
sink1 = *p
}
_i += 1
goto _72
_75:
if ((_pColumn == nil) && _nColumn != 0) && (_nColumn != (int32(_pTab.X11) - _nHidden)) {
_sqlite3ErrorMsg(tls, _pParse, str(118414), unsafe.Pointer(_pTabList), i32(0), int32(_pTab.X11)-_nHidden, _nColumn)
goto _insert_cleanup
}
if (_pColumn != nil) && (_nColumn != (_pColumn.X1)) {
_sqlite3ErrorMsg(tls, _pParse, str(118466), _nColumn, _pColumn.X1)
goto _insert_cleanup
}
if ((_db.X6) & i32(128)) != 0 {
_regRowCount = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regRowCount)
}
if _isView != 0 {
goto _84
}
_30_nIdx = _sqlite3OpenTableAndIndices(tls, _pParse, _pTab, i32(107), uint8(i32(0)), i32(-1), nil, &_iDataCur, &_iIdxCur)
_aRegIdx = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(4)*uint32(_30_nIdx+i32(1)))))
if _aRegIdx == nil {
goto _insert_cleanup
}
*func() **XIndex { _i = i32(0); return &_pIdx }() = (*XIndex)(_pTab.X2)
_86:
if _i >= _30_nIdx {
goto _89
}
func() {
if _pIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109631), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118491)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aRegIdx)) + 4*uintptr(_i))) = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + int32(_pIdx.X14)
sink1 = *p
}
*func() *int32 { _pIdx = (*XIndex)(_pIdx.X5); return &_i }() += 1
goto _86
_89:
_84:
if _useTempTable != 0 {
_addrInsTop = _sqlite3VdbeAddOp1(tls, _v, i32(37), _srcTab)
_addrCont = _sqlite3VdbeCurrentAddr(tls, _v)
goto _94
}
if _pSelect != nil {
_addrInsTop = store1(&_addrCont, _sqlite3VdbeAddOp1(tls, _v, i32(16), _dest.X2))
}
_94:
_endOfLoop = _sqlite3VdbeMakeLabel(tls, _v)
if (_tmask & i32(1)) == 0 {
goto _95
}
_35_regCols = _sqlite3GetTempRange(tls, _pParse, int32(_pTab.X11)+i32(1))
if _ipkColumn < i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(-1), _35_regCols)
goto _97
}
func() {
if _withoutRowid != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118336)))
crt.X__builtin_abort(tls)
}
}()
if _useTempTable != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _ipkColumn, _35_regCols)
goto _101
}
func() {
if _pSelect != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109683), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118496)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_ipkColumn))).X0), _35_regCols)
_101:
_37_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(76), _35_regCols)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(-1), _35_regCols)
_sqlite3VdbeJumpHere(tls, _v, _37_addr1)
_sqlite3VdbeAddOp1(tls, _v, i32(17), _35_regCols)
_97:
func() {
if (_pTab.X16) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109695), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(41933)))
crt.X__builtin_abort(tls)
}
}()
_i = store1(&_j, i32(0))
_106:
if _i >= int32(_pTab.X11) {
goto _109
}
if _pColumn == nil {
goto _110
}
_j = i32(0)
_111:
if _j >= (_pColumn.X1) {
goto _114
}
if ((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 8*uintptr(_j))).X1) == _i {
goto _114
}
_j += 1
goto _111
_114:
_110:
if (((_useTempTable == 0) && (_pList == nil)) || ((_pColumn != nil) && (_j >= (_pColumn.X1)))) || ((_pColumn == nil) && i32(0) != 0) {
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X1), (_35_regCols+_i)+i32(1))
goto _124
}
if _useTempTable != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _j, (_35_regCols+_i)+i32(1))
goto _124
}
func() {
if _pSelect != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109711), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(118496)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCodeAndCache(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_j))).X0), (_35_regCols+_i)+i32(1))
_124:
if (_pColumn == nil) && i32(1) != 0 {
_j += 1
}
_i += 1
goto _106
_109:
if _isView == 0 {
_sqlite3TableAffinity(tls, _v, _pTab, _35_regCols+i32(1))
}
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(108), nil, i32(1), _pTab, (_35_regCols-int32(_pTab.X11))-i32(1), _onError, _endOfLoop)
_sqlite3ReleaseTempRange(tls, _pParse, _35_regCols, int32(_pTab.X11)+i32(1))
_95:
if _isView != 0 {
goto _130
}
if (_pTab.X16) != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regIns)
}
if _ipkColumn < i32(0) {
goto _132
}
if _useTempTable != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _ipkColumn, _regRowid)
goto _136
}
if _pSelect != nil {
_sqlite3VdbeAddOp2(tls, _v, i32(64), _regFromSelect+_ipkColumn, _regRowid)
goto _136
}
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_ipkColumn))).X0), _regRowid)
_52_pOp = _sqlite3VdbeGetOp(tls, _v, i32(-1))
if (func() int32 {
if _52_pOp != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109750), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3InsertØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && (int32(_52_pOp.X0) == i32(59))) && ((_pTab.X16) == 0) {
_appendFlag = uint8(i32(1))
*(*uint8)(unsafe.Pointer(&(_52_pOp.X0))) = uint8(i32(117))
*(*int32)(unsafe.Pointer(&(_52_pOp.X3))) = _iDataCur
*(*int32)(unsafe.Pointer(&(_52_pOp.X4))) = _regRowid
*(*int32)(unsafe.Pointer(&(_52_pOp.X5))) = _regAutoinc
}
_136:
if _appendFlag != 0 {
goto _142
}
if (_pTab.X16) == 0 {
_54_addr1 = _sqlite3VdbeAddOp1(tls, _v, i32(76), _regRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(117), _iDataCur, _regRowid, _regAutoinc)
_sqlite3VdbeJumpHere(tls, _v, _54_addr1)
goto _144
}
_54_addr1 = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeAddOp2(tls, _v, i32(75), _regRowid, _54_addr1+i32(2))
_144:
_sqlite3VdbeAddOp1(tls, _v, i32(17), _regRowid)
_142:
goto _148
_132:
if (_pTab.X16) != 0 || (_withoutRowid != 0) {
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regRowid)
goto _148
}
_sqlite3VdbeAddOp3(tls, _v, i32(117), _iDataCur, _regRowid, _regAutoinc)
_appendFlag = uint8(i32(1))
_148:
_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
_nHidden = i32(0)
_i = i32(0)
_149:
if _i >= int32(_pTab.X11) {
goto _152
}
_59_iRegStore = (_regRowid + i32(1)) + _i
if _i == int32(_pTab.X10) {
_sqlite3VdbeAddOp1(tls, _v, i32(60), _59_iRegStore)
goto _150
}
if _pColumn != nil {
goto _154
}
if (int32((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X6) & i32(2)) != i32(0) {
_j = i32(-1)
_nHidden += 1
goto _156
}
_j = _i - _nHidden
_156:
goto _157
_154:
_j = i32(0)
_158:
if _j >= (_pColumn.X1) {
goto _161
}
if ((*TIdList_item)(unsafe.Pointer(uintptr(_pColumn.X0) + 8*uintptr(_j))).X1) == _i {
goto _161
}
_j += 1
goto _158
_161:
_157:
if ((_j < i32(0)) || (_nColumn == i32(0))) || ((_pColumn != nil) && (_j >= (_pColumn.X1))) {
_sqlite3ExprCodeFactorable(tls, _pParse, (*XExpr)((*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_i))).X1), _59_iRegStore)
goto _172
}
if _useTempTable != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(99), _srcTab, _j, _59_iRegStore)
goto _172
}
if _pSelect == nil {
goto _170
}
if _regFromSelect != _regData {
_sqlite3VdbeAddOp2(tls, _v, i32(65), _regFromSelect+_j, _59_iRegStore)
}
goto _172
_170:
_sqlite3ExprCode(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2)))))+20*uintptr(_j))).X0), _59_iRegStore)
_172:
_150:
_i += 1
goto _149
_152:
if (_pTab.X16) != 0 {
_71_pVTab = (*int8)(unsafe.Pointer(_sqlite3GetVTable(tls, _db, _pTab)))
_sqlite3VtabMakeWritable(tls, _pParse, _pTab)
_sqlite3VdbeAddOp4(tls, _v, i32(12), i32(1), int32(_pTab.X11)+i32(2), _regIns, _71_pVTab, i32(-8))
_sqlite3VdbeChangeP5(tls, _v, uint16(func() int32 {
if _onError == i32(10) {
return i32(2)
}
return _onError
}()))
_sqlite3MayAbort(tls, _pParse)
goto _176
}
_sqlite3GenerateConstraintChecks(tls, _pParse, _pTab, _aRegIdx, _iDataCur, _iIdxCur, _regIns, i32(0), uint8(bool2int(_ipkColumn >= i32(0))), uint8(_onError), _endOfLoop, &_72_isReplace, nil)
_sqlite3FkCheck(tls, _pParse, _pTab, i32(0), _regIns, nil, i32(0))
_72_bUseSeek = bool2int((_72_isReplace == i32(0)) || ((_pTrigger == nil) && ((((_db.X6) & i32(524288)) == i32(0)) || (_sqlite3FkReferences(tls, _pTab) == nil))))
_sqlite3CompleteInsertion(tls, _pParse, _pTab, _iDataCur, _iIdxCur, _regIns, _aRegIdx, i32(0), int32(_appendFlag), _72_bUseSeek)
_176:
_130:
if ((_db.X6) & i32(128)) != i32(0) {
_sqlite3VdbeAddOp2(tls, _v, i32(73), _regRowCount, i32(1))
}
if _pTrigger != nil {
_sqlite3CodeRowTrigger(tls, _pParse, _pTrigger, i32(108), nil, i32(2), _pTab, (_regData-i32(2))-int32(_pTab.X11), _onError, _endOfLoop)
}
_sqlite3VdbeResolveLabel(tls, _v, _endOfLoop)
if _useTempTable != 0 {
_sqlite3VdbeAddOp2(tls, _v, i32(7), _srcTab, _addrCont)
_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
_sqlite3VdbeAddOp1(tls, _v, i32(114), _srcTab)
goto _insert_end
}
if _pSelect != nil {
_sqlite3VdbeGoto(tls, _v, _addrCont)
_sqlite3VdbeJumpHere(tls, _v, _addrInsTop)
}
_insert_end:
if (int32(_pParse.X6) == i32(0)) && ((*XTable)(_pParse.X40) == nil) {
_sqlite3AutoincrementEnd(tls, _pParse)
}
if (((_db.X6)&i32(128)) != 0 && ((_pParse.X6) == 0)) && ((*XTable)(_pParse.X40) == nil) {
_sqlite3VdbeAddOp2(tls, _v, i32(67), _regRowCount, i32(1))
_sqlite3VdbeSetNumCols(tls, _v, i32(1))
_sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), str(118507), nil)
}
_insert_cleanup:
_sqlite3SrcListDelete(tls, _db, _pTabList)
_sqlite3ExprListDelete(tls, _db, _pList)
_sqlite3SelectDelete(tls, _db, _pSelect)
_sqlite3IdListDelete(tls, _db, _pColumn)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_aRegIdx))
_ = _dest
_ = _21_sNC
}
var _sqlite3InsertØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3InsertØ00__func__Ø000[0], str(118521), 14)
}
// Attempt the transfer optimization on INSERTs of the form
//
// INSERT INTO tab1 SELECT * FROM tab2;
//
// The xfer optimization transfers raw records from tab2 over to tab1.
// Columns are not decoded and reassembled, which greatly improves
// performance. Raw index records are transferred in the same way.
//
// The xfer optimization is only attempted if tab1 and tab2 are compatible.
// There are lots of rules for determining compatibility - see comments
// embedded in the code for details.
//
// This routine returns TRUE if the optimization is guaranteed to be used.
// Sometimes the xfer optimization will only work if the destination table
// is empty - a factor that can only be determined at run-time. In that
// case, this routine generates code for the xfer optimization but also
// does a test to see if the destination table is empty and jumps over the
// xfer optimization code if the test fails. In that case, this routine
// returns FALSE so that the caller will know to go ahead and generate
// an unoptimized transfer. This routine also returns FALSE if there
// is no chance that the xfer optimization can be applied.
//
// This optimization is particularly useful at making VACUUM run faster.
func _xferOptimization(tls *crt.TLS, _pParse *XParse, _pDest *XTable, _pSelect *XSelect, _onError int32, _iDbDest int32) (r0 int32) {
var _i, _iDbSrc, _iSrc, _iDest, _addr1, _addr2, _emptyDestTest, _emptySrcTest, _regAutoinc, _destHasUniqueIdx, _regData, _regRowid int32
var _47_zColl *int8
var _37_insFlags, _44_idxInsFlags uint8
var _db *Xsqlite3
var _pSrc *XTable
var _v *TVdbe
var _pItem *TSrcList_item
var _pEList *XExprList
var _23_pDestCol, _23_pSrcCol *XColumn
var _pSrcIdx, _pDestIdx *XIndex
_db = (*Xsqlite3)(_pParse.X0)
_emptyDestTest = i32(0)
_emptySrcTest = i32(0)
_destHasUniqueIdx = i32(0)
if _pSelect == nil {
return i32(0)
}
if ((*XWith)(_pParse.X70) != nil) || ((*XWith)(_pSelect.X17) != nil) {
return i32(0)
}
if _sqlite3TriggerList(tls, _pParse, _pDest) != nil {
return i32(0)
}
if (_pDest.X16) != 0 {
return i32(0)
}
if _onError != i32(10) {
goto _5
}
if int32(_pDest.X10) >= i32(0) {
_onError = int32(_pDest.X14)
}
if _onError == i32(10) {
_onError = i32(2)
}
_5:
func() {
if (*XSrcList)(_pSelect.X8) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110825), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118535)))
crt.X__builtin_abort(tls)
}
}()
if ((*XSrcList)(_pSelect.X8).X0) != i32(1) {
return i32(0)
}
if (*XSelect)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.X8).X2)))))+68*uintptr(i32(0)))).X5) != nil {
return i32(0)
}
if (*XExpr)(_pSelect.X9) != nil {
return i32(0)
}
if (*XExprList)(_pSelect.X12) != nil {
return i32(0)
}
if (*XExprList)(_pSelect.X10) != nil {
return i32(0)
}
if (*XExpr)(_pSelect.X15) != nil {
return i32(0)
}
func() {
if (*XExpr)(_pSelect.X16) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110846), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118549)))
crt.X__builtin_abort(tls)
}
}()
if (*XSelect)(_pSelect.X13) != nil {
return i32(0)
}
if ((_pSelect.X3) & uint32(i32(1))) != 0 {
return i32(0)
}
_pEList = (*XExprList)(_pSelect.X0)
func() {
if _pEList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110854), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(45052)))
crt.X__builtin_abort(tls)
}
}()
if (_pEList.X0) != i32(1) {
return i32(0)
}
func() {
if (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(i32(0)))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110858), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118569)))
crt.X__builtin_abort(tls)
}
}()
if int32((*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pEList.X2)))))+20*uintptr(i32(0)))).X0).X0) != i32(161) {
return i32(0)
}
_pItem = (*TSrcList_item)(unsafe.Pointer((*[1]TSrcList_item)(unsafe.Pointer(&((*XSrcList)(_pSelect.X8).X2)))))
_pSrc = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), _pItem)
if _pSrc == nil {
return i32(0)
}
if _pSrc == _pDest {
return i32(0)
}
if (((_pDest.X9) & uint32(i32(32))) == uint32(i32(0))) != (((_pSrc.X9) & uint32(i32(32))) == uint32(i32(0))) {
return i32(0)
}
if (_pSrc.X16) != 0 {
return i32(0)
}
if (*XSelect)(_pSrc.X3) != nil {
return i32(0)
}
if int32(_pDest.X11) != int32(_pSrc.X11) {
return i32(0)
}
if int32(_pDest.X10) != int32(_pSrc.X10) {
return i32(0)
}
_i = i32(0)
_33:
if _i >= int32(_pDest.X11) {
goto _36
}
_23_pDestCol = (*XColumn)(unsafe.Pointer(uintptr(_pDest.X1) + 16*uintptr(_i)))
_23_pSrcCol = (*XColumn)(unsafe.Pointer(uintptr(_pSrc.X1) + 16*uintptr(_i)))
if int32(_23_pDestCol.X4) != int32(_23_pSrcCol.X4) {
return i32(0)
}
if Xsqlite3_stricmp(tls, _23_pDestCol.X2, _23_pSrcCol.X2) != i32(0) {
return i32(0)
}
if ((_23_pDestCol.X3) != 0) && ((_23_pSrcCol.X3) == 0) {
return i32(0)
}
if _i <= i32(0) {
goto _41
}
func() {
if (*XExpr)(_23_pDestCol.X1) != nil && int32((*XExpr)(_23_pDestCol.X1).X0) != i32(162) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110913), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118588)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XExpr)(_23_pSrcCol.X1) != nil && int32((*XExpr)(_23_pSrcCol.X1).X0) != i32(162) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110914), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118639)))
crt.X__builtin_abort(tls)
}
}()
if (((*XExpr)(_23_pDestCol.X1) == nil) != ((*XExpr)(_23_pSrcCol.X1) == nil)) || (((*XExpr)(_23_pDestCol.X1) != nil) && (crt.Xstrcmp(tls, *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pDestCol.X1).X3))))), *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_23_pSrcCol.X1).X3)))))) != i32(0))) {
return i32(0)
}
_41:
_i += 1
goto _33
_36:
_pDestIdx = (*XIndex)(_pDest.X2)
_51:
if _pDestIdx == nil {
goto _54
}
if int32(_pDestIdx.X15) != i32(0) {
_destHasUniqueIdx = i32(1)
}
_pSrcIdx = (*XIndex)(_pSrc.X2)
_56:
if _pSrcIdx == nil {
goto _59
}
if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
goto _59
}
_pSrcIdx = (*XIndex)(_pSrcIdx.X5)
goto _56
_59:
if _pSrcIdx == nil {
return i32(0)
}
_pDestIdx = (*XIndex)(_pDestIdx.X5)
goto _51
_54:
if ((*XExprList)(_pDest.X6) != nil) && _sqlite3ExprListCompare(tls, (*XExprList)(_pSrc.X6), (*XExprList)(_pDest.X6), i32(-1)) != 0 {
return i32(0)
}
if (((_db.X6) & i32(524288)) != i32(0)) && ((*XFKey)(_pDest.X4) != nil) {
return i32(0)
}
if ((_db.X6) & i32(128)) != i32(0) {
return i32(0)
}
_iDbSrc = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pSrc.X20))
_v = _sqlite3GetVdbe(tls, _pParse)
_sqlite3CodeVerifySchema(tls, _pParse, _iDbSrc)
_iSrc = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_iDest = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_regAutoinc = _autoIncBegin(tls, _pParse, _iDbDest, _pDest)
_regData = _sqlite3GetTempReg(tls, _pParse)
_regRowid = _sqlite3GetTempReg(tls, _pParse)
_sqlite3OpenTable(tls, _pParse, _iDest, _iDbDest, _pDest, i32(107))
func() {
if ((_pDest.X9)&uint32(i32(32))) != uint32(i32(0)) && _destHasUniqueIdx == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110971), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118688)))
crt.X__builtin_abort(tls)
}
}()
if (((_db.X6) & i32(268435456)) == i32(0)) && ((((int32(_pDest.X10) < i32(0)) && ((*XIndex)(_pDest.X2) != nil)) || _destHasUniqueIdx != 0) || ((_onError != i32(2)) && (_onError != i32(1)))) {
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iDest, i32(0))
_emptyDestTest = _sqlite3VdbeAddOp0(tls, _v, i32(13))
_sqlite3VdbeJumpHere(tls, _v, _addr1)
}
if ((_pSrc.X9) & uint32(i32(32))) != uint32(i32(0)) {
goto _76
}
_sqlite3OpenTable(tls, _pParse, _iSrc, _iDbSrc, _pSrc, i32(106))
_emptySrcTest = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iSrc, i32(0))
if int32(_pDest.X10) >= i32(0) {
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(125), _iSrc, _regRowid)
_addr2 = _sqlite3VdbeAddOp3(tls, _v, i32(32), _iDest, i32(0), _regRowid)
_sqlite3RowidConstraint(tls, _pParse, _onError, _pDest)
_sqlite3VdbeJumpHere(tls, _v, _addr2)
_autoIncStep(tls, _pParse, _regAutoinc, _regRowid)
goto _80
}
if (*XIndex)(_pDest.X2) == nil {
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(117), _iDest, _regRowid)
goto _80
}
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(125), _iSrc, _regRowid)
func() {
if ((_pDest.X9) & uint32(i32(8))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111013), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118724)))
crt.X__builtin_abort(tls)
}
}()
_80:
_sqlite3VdbeAddOp3(tls, _v, i32(124), _iSrc, _regData, i32(1))
if ((_db.X6) & i32(268435456)) != 0 {
_sqlite3VdbeAddOp3(tls, _v, i32(33), _iDest, i32(0), i32(-1))
_37_insFlags = uint8(i32(57))
goto _84
}
_37_insFlags = uint8(i32(41))
_84:
_sqlite3VdbeAddOp4(tls, _v, i32(118), _iDest, _regData, _regRowid, (*int8)(unsafe.Pointer(_pDest)), i32(-15))
_sqlite3VdbeChangeP5(tls, _v, uint16(_37_insFlags))
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iSrc, _addr1)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _iSrc, i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(114), _iDest, i32(0))
goto _85
_76:
_sqlite3TableLock(tls, _pParse, _iDbDest, _pDest.X7, uint8(i32(1)), _pDest.X0)
_sqlite3TableLock(tls, _pParse, _iDbSrc, _pSrc.X7, uint8(i32(0)), _pSrc.X0)
_85:
_pDestIdx = (*XIndex)(_pDest.X2)
_86:
if _pDestIdx == nil {
goto _89
}
_44_idxInsFlags = uint8(i32(0))
_pSrcIdx = (*XIndex)(_pSrc.X2)
_90:
if func() int32 {
if _pSrcIdx != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111035), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _95
}
if _xferCompatibleIndex(tls, _pDestIdx, _pSrcIdx) != 0 {
goto _95
}
_pSrcIdx = (*XIndex)(_pSrcIdx.X5)
goto _90
_95:
func() {
if _pSrcIdx == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(111038), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferOptimizationØ00__func__Ø000))), unsafe.Pointer(str(118764)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(106), _iSrc, _pSrcIdx.X11, _iDbSrc)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pSrcIdx)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pSrcIdx.X0))
_sqlite3VdbeAddOp3(tls, _v, i32(107), _iDest, _pDestIdx.X11, _iDbDest)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pDestIdx)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(1)))
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pDestIdx.X0))
_addr1 = _sqlite3VdbeAddOp2(tls, _v, i32(37), _iSrc, i32(0))
_sqlite3VdbeAddOp3(tls, _v, i32(124), _iSrc, _regData, i32(1))
if ((_db.X6) & i32(268435456)) == 0 {
goto _99
}
_i = i32(0)
_100:
if _i >= int32(_pSrcIdx.X14) {
goto _103
}
_47_zColl = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrcIdx.X8)) + 4*uintptr(_i)))
if Xsqlite3_stricmp(tls, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), _47_zColl) != 0 {
goto _103
}
_i += 1
goto _100
_103:
if _i == int32(_pSrcIdx.X14) {
_44_idxInsFlags = uint8(i32(16))
_sqlite3VdbeAddOp3(tls, _v, i32(33), _iDest, i32(0), i32(-1))
}
_99:
if (((_pSrc.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pDestIdx.X16)<>uint(i32(30))) == i32(2)) {
{
p := &_44_idxInsFlags
*p = uint8(int32(*p) | i32(1))
sink2 = *p
}
}
_sqlite3VdbeAddOp2(tls, _v, i32(128), _iDest, _regData)
_sqlite3VdbeChangeP5(tls, _v, uint16(int32(_44_idxInsFlags)|i32(8)))
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iSrc, _addr1+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _addr1)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _iSrc, i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(114), _iDest, i32(0))
_pDestIdx = (*XIndex)(_pDestIdx.X5)
goto _86
_89:
if _emptySrcTest != 0 {
_sqlite3VdbeJumpHere(tls, _v, _emptySrcTest)
}
_sqlite3ReleaseTempReg(tls, _pParse, _regRowid)
_sqlite3ReleaseTempReg(tls, _pParse, _regData)
if _emptyDestTest != 0 {
_sqlite3AutoincrementEnd(tls, _pParse)
_sqlite3VdbeAddOp2(tls, _v, i32(55), i32(0), i32(0))
_sqlite3VdbeJumpHere(tls, _v, _emptyDestTest)
_sqlite3VdbeAddOp2(tls, _v, i32(114), _iDest, i32(0))
return i32(0)
}
return i32(1)
}
var _xferOptimizationØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_xferOptimizationØ00__func__Ø000[0], str(118772), 17)
}
// Check to see if index pSrc is compatible as a source of data
// for index pDest in an insert transfer optimization. The rules
// for a compatible index:
//
// * The index is over the same set of columns
// * The same DESC and ASC markings occurs on all columns
// * The same onError processing (OE_Abort, OE_Ignore, etc)
// * The same collating sequence on each column
// * The index has the exact same WHERE clause
func _xferCompatibleIndex(tls *crt.TLS, _pDest *XIndex, _pSrc *XIndex) (r0 int32) {
var _i int32
func() {
if _pDest == nil || _pSrc == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110722), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000))), unsafe.Pointer(str(118789)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XTable)(_pDest.X3) == (*XTable)(_pSrc.X3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110723), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000))), unsafe.Pointer(str(118803)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pDest.X13) != int32(_pSrc.X13) {
return i32(0)
}
if int32(_pDest.X15) != int32(_pSrc.X15) {
return i32(0)
}
_i = i32(0)
_7:
if _i >= int32(_pSrc.X13) {
goto _10
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X1)) + 2*uintptr(_i)))) != int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X1)) + 2*uintptr(_i)))) {
return i32(0)
}
if int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X1)) + 2*uintptr(_i)))) != i32(-2) {
goto _12
}
func() {
if (*XExprList)(_pSrc.X10) == nil || (*XExprList)(_pDest.X10) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(110735), unsafe.Pointer((*int8)(unsafe.Pointer(&_xferCompatibleIndexØ00__func__Ø000))), unsafe.Pointer(str(118831)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3ExprCompare(tls, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pSrc.X10).X2)))))+20*uintptr(_i))).X0), (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&((*XExprList)(_pDest.X10).X2)))))+20*uintptr(_i))).X0), i32(-1)) != i32(0) {
return i32(0)
}
_12:
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X7)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X7)) + 1*uintptr(_i)))) {
return i32(0)
}
if Xsqlite3_stricmp(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pSrc.X8)) + 4*uintptr(_i))), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pDest.X8)) + 4*uintptr(_i)))) != i32(0) {
return i32(0)
}
_i += 1
goto _7
_10:
if _sqlite3ExprCompare(tls, (*XExpr)(_pSrc.X9), (*XExpr)(_pDest.X9), i32(-1)) != 0 {
return i32(0)
}
return i32(1)
}
var _xferCompatibleIndexØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_xferCompatibleIndexØ00__func__Ø000[0], str(118871), 20)
}
// Locate or create an AutoincInfo structure associated with table pTab
// which is in database iDb. Return the register number for the register
// that holds the maximum rowid. Return zero if pTab is not an AUTOINCREMENT
// table. (Also return zero when doing a VACUUM since we do not want to
// update the AUTOINCREMENT counters during a VACUUM.)
//
// There is at most one AutoincInfo structure per table even if the
// same table is autoincremented multiple times due to inserts within
// triggers. A new AutoincInfo structure is created if this is the
// first use of table pTab. On 2nd and subsequent uses, the original
// AutoincInfo structure is used.
//
// Three memory locations are allocated:
//
// (1) Register to hold the name of the pTab table.
// (2) Register to hold the maximum ROWID of pTab.
// (3) Register to hold the rowid in sqlite_sequence of pTab
//
// The 2nd register is the one that is returned. That is all the
// insert routine needs to know about.
func _autoIncBegin(tls *crt.TLS, _pParse *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
var _memId int32
var _1_pToplevel *XParse
var _1_pInfo *TAggInfo_func
_memId = i32(0)
if ((_pTab.X9)&uint32(i32(8))) == uint32(i32(0)) || (((*Xsqlite3)(_pParse.X0).X6)&i32(268435456)) != i32(0) {
goto _1
}
_1_pToplevel = func() *XParse {
if (*XParse)(_pParse.X39) != nil {
return (*XParse)(_pParse.X39)
}
return _pParse
}()
_1_pInfo = (*TAggInfo_func)(_1_pToplevel.X38)
_4:
if (_1_pInfo != nil) && ((*XTable)(_1_pInfo.X1) != _pTab) {
_1_pInfo = (*TAggInfo_func)(_1_pInfo.X0)
goto _4
}
if _1_pInfo != nil {
goto _7
}
_1_pInfo = (*TAggInfo_func)(_sqlite3DbMallocRawNN(tls, (*Xsqlite3)(_pParse.X0), uint64(u32(16))))
if _1_pInfo == nil {
return i32(0)
}
*(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInfo.X0))))) = (*TAggInfo_func)(_1_pToplevel.X38)
*(**TAggInfo_func)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pToplevel.X38))))) = _1_pInfo
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInfo.X1))))) = _pTab
*(*int32)(unsafe.Pointer(&(_1_pInfo.X2))) = _iDb
*(*int32)(unsafe.Pointer(&(_1_pToplevel.X18))) += 1
*(*int32)(unsafe.Pointer(&(_1_pInfo.X3))) = preInc1((*int32)(unsafe.Pointer(&(_1_pToplevel.X18))), 1)
*(*int32)(unsafe.Pointer(&(_1_pToplevel.X18))) += 1
_7:
_memId = _1_pInfo.X3
_1:
return _memId
}
// Update the maximum rowid for an autoincrement calculation.
//
// This routine should be called when the regRowid register holds a
// new rowid that is about to be inserted. If that new rowid is
// larger than the maximum rowid in the memId memory cell, then the
// memory cell is updated.
func _autoIncStep(tls *crt.TLS, _pParse *XParse, _memId int32, _regRowid int32) {
if _memId > i32(0) {
_sqlite3VdbeAddOp2(tls, (*TVdbe)(_pParse.X2), i32(148), _memId, _regRowid)
}
}
// Return non-zero if the table pTab in database iDb or any of its indices
// have been opened at any point in the VDBE program. This is used to see if
// a statement of the form "INSERT INTO SELECT ..." can
// run without using a temporary table for the results of the SELECT.
func _readsTable(tls *crt.TLS, _p *XParse, _iDb int32, _pTab *XTable) (r0 int32) {
var _i, _iEnd, _2_tnum int32
var _v *TVdbe
var _2_pIndex *XIndex
var _1_pOp *XVdbeOp
var _pVTab *XVTable
_v = _sqlite3GetVdbe(tls, _p)
_iEnd = _sqlite3VdbeCurrentAddr(tls, _v)
_pVTab = func() *XVTable {
if (_pTab.X16) != 0 {
return _sqlite3GetVTable(tls, (*Xsqlite3)(_p.X0), _pTab)
}
return nil
}()
_i = i32(1)
_2:
if _i >= _iEnd {
goto _5
}
_1_pOp = _sqlite3VdbeGetOp(tls, _v, _i)
func() {
if _1_pOp == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109010), unsafe.Pointer((*int8)(unsafe.Pointer(&_readsTableØ00__func__Ø000))), unsafe.Pointer(str(109348)))
crt.X__builtin_abort(tls)
}
}()
if int32(_1_pOp.X0) != i32(106) || (_1_pOp.X5) != _iDb {
goto _9
}
_2_tnum = _1_pOp.X4
if _2_tnum == (_pTab.X7) {
return i32(1)
}
_2_pIndex = (*XIndex)(_pTab.X2)
_11:
if _2_pIndex == nil {
goto _14
}
if _2_tnum == (_2_pIndex.X11) {
return i32(1)
}
_2_pIndex = (*XIndex)(_2_pIndex.X5)
goto _11
_14:
_9:
if (int32(_1_pOp.X0) == i32(158)) && ((*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6)))))) == _pVTab) {
func() {
if (*XVTable)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_1_pOp.X6)))))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109025), unsafe.Pointer((*int8)(unsafe.Pointer(&_readsTableØ00__func__Ø000))), unsafe.Pointer(str(118891)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_1_pOp.X1) != i32(-8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(109026), unsafe.Pointer((*int8)(unsafe.Pointer(&_readsTableØ00__func__Ø000))), unsafe.Pointer(str(72269)))
crt.X__builtin_abort(tls)
}
}()
return i32(1)
}
_i += 1
goto _2
_5:
return i32(0)
}
var _readsTableØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_readsTableØ00__func__Ø000[0], str(118908), 11)
}
// Generate code that evaluates the given expression and puts the result
// in register target.
//
// Also make a copy of the expression results into another "cache" register
// and modify the expression so that the next time it is evaluated,
// the result is a copy of the cache register.
//
// This routine is used for expressions that are used multiple
// times. They are evaluated once and the results of the expression
// are reused.
func _sqlite3ExprCodeAndCache(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _target int32) {
var _iMem int32
var _v *TVdbe
_v = (*TVdbe)(_pParse.X2)
func() {
if _target <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95114), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000))), unsafe.Pointer(str(99594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pExpr.X0) == i32(157) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(95115), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprCodeAndCacheØ00__func__Ø000))), unsafe.Pointer(str(118919)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprCode(tls, _pParse, _pExpr, _target)
_iMem = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeAddOp2(tls, _v, i32(64), _target, _iMem)
_exprToRegister(tls, _pExpr, _iMem)
}
var _sqlite3ExprCodeAndCacheØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprCodeAndCacheØ00__func__Ø000[0], str(118942), 24)
}
// Parse context structure pFrom has just been used to create a sub-vdbe
// (trigger program). If an error has occurred, transfer error information
// from pFrom to pTo.
func _transferParseError(tls *crt.TLS, _pTo *XParse, _pFrom *XParse) {
func() {
if (_pFrom.X1) != nil && (_pFrom.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123418), unsafe.Pointer((*int8)(unsafe.Pointer(&_transferParseErrorØ00__func__Ø000))), unsafe.Pointer(str(118966)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTo.X1) != nil && (_pTo.X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123419), unsafe.Pointer((*int8)(unsafe.Pointer(&_transferParseErrorØ00__func__Ø000))), unsafe.Pointer(str(118999)))
crt.X__builtin_abort(tls)
}
}()
if (_pTo.X16) == i32(0) {
*(**int8)(unsafe.Pointer(&(_pTo.X1))) = _pFrom.X1
*(*int32)(unsafe.Pointer(&(_pTo.X16))) = _pFrom.X16
*(*int32)(unsafe.Pointer(&(_pTo.X3))) = _pFrom.X3
goto _7
}
_sqlite3DbFree(tls, (*Xsqlite3)(_pFrom.X0), (unsafe.Pointer)(_pFrom.X1))
_7:
}
var _transferParseErrorØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_transferParseErrorØ00__func__Ø000[0], str(119028), 19)
}
// This function returns a pointer to the array of opcodes associated with
// the Vdbe passed as the first argument. It is the callers responsibility
// to arrange for the returned array to be eventually freed using the
// vdbeFreeOpArray() function.
//
// Before returning, *pnOp is set to the number of entries in the returned
// array. Also, *pnMaxArg is set to the larger of its current value and
// the number of entries in the Vdbe.apArg[] array required to execute the
// returned program.
func _sqlite3VdbeTakeOpArray(tls *crt.TLS, _p *TVdbe, _pnOp *int32, _pnMaxArg *int32) (r0 *XVdbeOp) {
var _aOp *XVdbeOp
_aOp = (*XVdbeOp)(_p.X17)
func() {
if _aOp == nil || ((*Xsqlite3)(_p.X0).X17) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72108), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000))), unsafe.Pointer(str(119047)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_p.X33) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72111), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeTakeOpArrayØ00__func__Ø000))), unsafe.Pointer(str(119075)))
crt.X__builtin_abort(tls)
}
}()
_resolveP2Values(tls, _p, _pnMaxArg)
*_pnOp = _p.X27
*(**XVdbeOp)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X17))))) = nil
return _aOp
}
var _sqlite3VdbeTakeOpArrayØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeTakeOpArrayØ00__func__Ø000[0], str(119103), 23)
}
// Generate code to drop a table.
func _sqlite3CodeDropTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _iDb int32, _isView int32) {
var _db *Xsqlite3
var _pDb *XDb
var _pTrigger *XTrigger
var _v *TVdbe
_db = (*Xsqlite3)(_pParse.X0)
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
_v = _sqlite3GetVdbe(tls, _pParse)
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102140), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
if (_pTab.X16) != 0 {
_sqlite3VdbeAddOp0(tls, _v, i32(155))
}
_pTrigger = _sqlite3TriggerList(tls, _pParse, _pTab)
_3:
if _pTrigger != nil {
func() {
if (*XSchema)(_pTrigger.X6) != (*XSchema)(_pTab.X20) && (*XSchema)(_pTrigger.X6) != (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102155), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CodeDropTableØ00__func__Ø000))), unsafe.Pointer(str(119126)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
_pTrigger = (*XTrigger)(_pTrigger.X9)
goto _3
}
if ((_pTab.X9) & uint32(i32(8))) != 0 {
_sqlite3NestedParse(tls, _pParse, str(119200), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_pTab.X0))
}
_sqlite3NestedParse(tls, _pParse, str(119245), unsafe.Pointer(_pDb.X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pTab.X0))
if (_isView == 0) && ((_pTab.X16) == 0) {
_destroyTable(tls, _pParse, _pTab)
}
if (_pTab.X16) != 0 {
_sqlite3VdbeAddOp4(tls, _v, i32(157), _iDb, i32(0), i32(0), _pTab.X0, i32(0))
}
_sqlite3VdbeAddOp4(tls, _v, i32(141), _iDb, i32(0), i32(0), _pTab.X0, i32(0))
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_sqliteViewResetAll(tls, _db, _iDb)
}
var _sqlite3CodeDropTableØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CodeDropTableØ00__func__Ø000[0], str(119301), 21)
}
// Drop a trigger given a pointer to that trigger.
func _sqlite3DropTriggerPtr(tls *crt.TLS, _pParse *XParse, _pTrigger *XTrigger) {
var _iDb, _1_code int32
var _1_zDb, _1_zTab *int8
var _db *Xsqlite3
var _pTable *XTable
var _v *TVdbe
_db = (*Xsqlite3)(_pParse.X0)
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTrigger.X6))
func() {
if _iDb < i32(0) || _iDb >= (_db.X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123183), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000))), unsafe.Pointer(str(21738)))
crt.X__builtin_abort(tls)
}
}()
_pTable = _tableOfTrigger(tls, _pTrigger)
func() {
if _pTable == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000))), unsafe.Pointer(str(94083)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XSchema)(_pTable.X20) != (*XSchema)(_pTrigger.X6) && _iDb != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000))), unsafe.Pointer(str(119322)))
crt.X__builtin_abort(tls)
}
}()
_1_code = i32(16)
_1_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_1_zTab = func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}()
if _iDb == i32(1) {
_1_code = i32(14)
}
if _sqlite3AuthCheck(tls, _pParse, _1_code, _pTrigger.X0, _pTable.X0, _1_zDb) != 0 || _sqlite3AuthCheck(tls, _pParse, i32(9), _1_zTab, nil, _1_zDb) != 0 {
return
}
func() {
if _pTable == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123202), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerPtrØ00__func__Ø000))), unsafe.Pointer(str(21956)))
crt.X__builtin_abort(tls)
}
}()
if store38(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil {
_sqlite3NestedParse(tls, _pParse, str(119367), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pTrigger.X0))
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_sqlite3VdbeAddOp4(tls, _v, i32(143), _iDb, i32(0), i32(0), _pTrigger.X0, i32(0))
}
}
var _sqlite3DropTriggerPtrØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DropTriggerPtrØ00__func__Ø000[0], str(119418), 22)
}
// Write VDBE code to erase table pTab and all associated indices on disk.
// Code to update the sqlite_master tables and internal schema definitions
// in case a root-page belonging to another table is moved by the btree layer
// is also added (this can happen with an auto-vacuum database).
func _destroyTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable) {
var _iTab, _iDestroyed, _1_iLargest, _3_iIdx, _6_iDb int32
var _1_pIdx *XIndex
_iTab = _pTab.X7
_iDestroyed = i32(0)
_0:
_1_iLargest = i32(0)
if (_iDestroyed == i32(0)) || (_iTab < _iDestroyed) {
_1_iLargest = _iTab
}
_1_pIdx = (*XIndex)(_pTab.X2)
_4:
if _1_pIdx == nil {
goto _7
}
_3_iIdx = _1_pIdx.X11
func() {
if (*XSchema)(_1_pIdx.X6) != (*XSchema)(_pTab.X20) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102089), unsafe.Pointer((*int8)(unsafe.Pointer(&_destroyTableØ00__func__Ø000))), unsafe.Pointer(str(115137)))
crt.X__builtin_abort(tls)
}
}()
if ((_iDestroyed == i32(0)) || (_3_iIdx < _iDestroyed)) && (_3_iIdx > _1_iLargest) {
_1_iLargest = _3_iIdx
}
_1_pIdx = (*XIndex)(_1_pIdx.X5)
goto _4
_7:
if _1_iLargest == i32(0) {
return
}
_6_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
func() {
if _6_iDb < i32(0) || _6_iDb >= ((*Xsqlite3)(_pParse.X0).X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102098), unsafe.Pointer((*int8)(unsafe.Pointer(&_destroyTableØ00__func__Ø000))), unsafe.Pointer(str(102338)))
crt.X__builtin_abort(tls)
}
}()
_destroyRootPage(tls, _pParse, _1_iLargest, _6_iDb)
_iDestroyed = _1_iLargest
goto _0
}
var _destroyTableØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_destroyTableØ00__func__Ø000[0], str(119440), 13)
}
func _destroyRootPage(tls *crt.TLS, _pParse *XParse, _iTable int32, _iDb int32) {
var _r1 int32
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
_r1 = _sqlite3GetTempReg(tls, _pParse)
func() {
if _iTable <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(102026), unsafe.Pointer((*int8)(unsafe.Pointer(&_destroyRootPageØ00__func__Ø000))), unsafe.Pointer(str(119453)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(133), _iTable, _r1, _iDb)
_sqlite3MayAbort(tls, _pParse)
_sqlite3NestedParse(tls, _pParse, str(119462), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), _iTable, _r1, _r1)
_sqlite3ReleaseTempReg(tls, _pParse, _r1)
}
var _destroyRootPageØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_destroyRootPageØ00__func__Ø000[0], str(119518), 16)
}
// Clear the column names from every VIEW in database idx.
func _sqliteViewResetAll(tls *crt.TLS, _db *Xsqlite3, _idx int32) {
var _i *XHashElem
var _1_pTab *XTable
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _idx, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101959), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqliteViewResetAllØ00__func__Ø000))), unsafe.Pointer(str(119534)))
crt.X__builtin_abort(tls)
}
}()
if (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_idx))).X4).X9) & i32(2)) != i32(2) {
return
}
_i = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_idx))).X4).X2))).X2)
_3:
if _i == nil {
goto _6
}
_1_pTab = (*XTable)(_i.X2)
if (*XSelect)(_1_pTab.X3) != nil {
_sqlite3DeleteColumnNames(tls, _db, _1_pTab)
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pTab.X1))))) = nil
*(*int16)(unsafe.Pointer(&(_1_pTab.X11))) = int16(i32(0))
}
_i = (*XHashElem)(_i.X0)
goto _3
_6:
{
p := (*uint16)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_idx))).X4).X9)))
*p = uint16(int32(*p) & i32(-3))
sink14 = *p
}
}
var _sqliteViewResetAllØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqliteViewResetAllØ00__func__Ø000[0], str(119569), 19)
}
// The parser calls this routine in order to create a new VIEW
func _sqlite3CreateView(tls *crt.TLS, _pParse *XParse, _pBegin *XToken, _pName1 *XToken, _pName2 *XToken, _pCNames *XExprList, _pSelect *XSelect, _isTemp int32, _noErr int32) {
var _n, _iDb int32
var _z *int8
var _sEnd XToken
var _db *Xsqlite3
var _p *XTable
var _pName *XToken
var _sFix XDbFixer
_pName = nil
_db = (*Xsqlite3)(_pParse.X0)
if int32(_pParse.X52) > i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(119588))
goto _create_view_fail
}
_sqlite3StartTable(tls, _pParse, _pName1, _pName2, _isTemp, i32(1), i32(0), _noErr)
_p = (*XTable)(_pParse.X63)
if (_p == nil) || (_pParse.X16) != 0 {
goto _create_view_fail
}
_sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_p.X20))
_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(111821), _pName)
if _sqlite3FixSelect(tls, &_sFix, _pSelect) != 0 {
goto _create_view_fail
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1))
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X6))))) = _sqlite3ExprListDup(tls, _db, _pCNames, i32(1))
if (_db.X17) != 0 {
goto _create_view_fail
}
_sEnd = _pParse.X51
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_sEnd.X0)) + 1*uintptr(i32(0))))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000))), unsafe.Pointer(str(119624)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_sEnd.X0)) + 1*uintptr(i32(0))))) != i32(59) {
{
p := (**int8)(unsafe.Pointer(&(_sEnd.X0)))
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sEnd.X1)))
sink0 = *p
}
}
*(*uint32)(unsafe.Pointer(&(_sEnd.X1))) = uint32(i32(0))
_n = int32((uintptr(unsafe.Pointer(_sEnd.X0)) - uintptr(unsafe.Pointer(_pBegin.X0))) / 1)
func() {
if _n <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(101821), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3CreateViewØ00__func__Ø000))), unsafe.Pointer(str(1358)))
crt.X__builtin_abort(tls)
}
}()
_z = _pBegin.X0
_10:
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))))))) & i32(1)) != 0 {
_n -= 1
goto _10
}
*(**int8)(unsafe.Pointer(&(_sEnd.X0))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))
*(*uint32)(unsafe.Pointer(&(_sEnd.X1))) = uint32(i32(1))
_sqlite3EndTable(tls, _pParse, nil, &_sEnd, uint8(i32(0)), nil)
_create_view_fail:
_sqlite3SelectDelete(tls, _db, _pSelect)
_sqlite3ExprListDelete(tls, _db, _pCNames)
_ = _sEnd
_ = _sFix
}
var _sqlite3CreateViewØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3CreateViewØ00__func__Ø000[0], str(119637), 18)
}
func _parserDoubleLinkSelect(tls *crt.TLS, _pParse *XParse, _p *XSelect) {
var _1_mxSelect, _1_cnt int32
var _1_pNext, _1_pLoop *XSelect
if (*XSelect)(_p.X13) == nil {
goto _0
}
_1_pNext = nil
_1_cnt = i32(0)
_1_pLoop = _p
_1:
if _1_pLoop == nil {
goto _4
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pLoop.X14))))) = _1_pNext
{
p := (*uint32)(unsafe.Pointer(&(_1_pLoop.X3)))
*p = (*p) | uint32(i32(256))
sink5 = *p
}
*func() *int32 {
*func() **XSelect { _1_pNext = _1_pLoop; return &_1_pLoop }() = (*XSelect)(_1_pLoop.X13)
return &_1_cnt
}() += 1
goto _1
_4:
if ((((_p.X3) & uint32(i32(1024))) == uint32(i32(0))) && (store1(&_1_mxSelect, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X31))))) + 4*uintptr(i32(4))))) > i32(0))) && (_1_cnt > _1_mxSelect) {
_sqlite3ErrorMsg(tls, _pParse, str(119655))
}
_0:
}
var _yy_reduceØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_yy_reduceØ00__func__Ø000[0], str(119689), 10)
}
// 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 _sqlite3ExprListSetSpan(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pSpan *XExprSpan) {
var _db *Xsqlite3
var _1_pItem *TExprList_item
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pList == nil && int32(_db.X17) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92521), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000))), unsafe.Pointer(str(119699)))
crt.X__builtin_abort(tls)
}
}()
if _pList != nil {
_1_pItem = (*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr((_pList.X0)-i32(1))))
func() {
if (_pList.X0) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92524), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000))), unsafe.Pointer(str(21335)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_db.X17) == 0 && (*XExpr)(_1_pItem.X0) != (*XExpr)(_pSpan.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92525), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListSetSpanØ00__func__Ø000))), unsafe.Pointer(str(119731)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_pItem.X2))
*(**int8)(unsafe.Pointer(&(_1_pItem.X2))) = _sqlite3DbStrNDup(tls, _db, _pSpan.X1, uint64(int32((uintptr(unsafe.Pointer(_pSpan.X2))-uintptr(unsafe.Pointer(_pSpan.X1)))/1)))
}
}
var _sqlite3ExprListSetSpanØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListSetSpanØ00__func__Ø000[0], str(119778), 23)
}
// When building up a FROM clause in the parser, the join operator
// is initially attached to the left operand. But the code generator
// expects the join operator to be on the right operand. This routine
// Shifts all join operators from left to right for an entire FROM
// clause.
//
// Example: Suppose the join is like this:
//
// A natural cross join B
//
// The operator is "natural cross join". The A and B operands are stored
// in p->a[0] and p->a[1], respectively. The parser initially stores the
// operator with A. This routine shifts that operator over to B.
func _sqlite3SrcListShiftJoinType(tls *crt.TLS, _p *XSrcList) {
var _1_i int32
if _p == nil {
goto _0
}
_1_i = (_p.X0) - i32(1)
_1:
if _1_i <= i32(0) {
goto _4
}
*(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr(_1_i))).X9))).X0))) = (*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr(_1_i-i32(1)))).X9))).X0
_1_i -= 1
goto _1
_4:
*(*uint8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr(i32(0)))).X9))).X0))) = uint8(i32(0))
_0:
}
// Add an INDEXED BY or NOT INDEXED clause to the most recently added
// element of the source-list passed as the second argument.
func _sqlite3SrcListIndexedBy(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pIndexedBy *XToken) {
var _1_pItem *TSrcList_item
func() {
if _pIndexedBy == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119801)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil || func() int32 {
if (_p.X0) > i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103577), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _5
}
_1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr((_p.X0)-i32(1))))
func() {
if int32((uint32((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103579), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119815)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(1)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103580), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119839)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(2)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListIndexedByØ00__func__Ø000))), unsafe.Pointer(str(119864)))
crt.X__builtin_abort(tls)
}
}()
if ((_pIndexedBy.X1) == uint32(i32(1))) && ((_pIndexedBy.X0) == nil) {
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(i32(1)), 1, 0)
goto _14
}
*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15))))) = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pIndexedBy)
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(bool2int((*(**int8)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15)))))) != nil)), 2, 1)
_14:
_5:
}
var _sqlite3SrcListIndexedByØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListIndexedByØ00__func__Ø000[0], str(119887), 24)
}
// Add the list of function arguments to the SrcList entry for a
// table-valued-function.
func _sqlite3SrcListFuncArgs(tls *crt.TLS, _pParse *XParse, _p *XSrcList, _pList *XExprList) {
var _1_pItem *TSrcList_item
if _p != nil {
_1_pItem = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_p.X2))))) + 68*uintptr((_p.X0)-i32(1))))
func() {
if int32((uint32((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103600), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119815)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(1)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103601), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119839)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((uint32(((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1)>>uint(i32(2)))<>uint(i32(31))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103602), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3SrcListFuncArgsØ00__func__Ø000))), unsafe.Pointer(str(119864)))
crt.X__builtin_abort(tls)
}
}()
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t29)(unsafe.Pointer(&(_1_pItem.X15))))))) = _pList
storebits3((*int8)(unsafe.Pointer(&((*t28)(unsafe.Pointer(&(_1_pItem.X9))).X1))), int8(i32(1)), 4, 2)
goto _7
}
_sqlite3ExprListDelete(tls, (*Xsqlite3)(_pParse.X0), _pList)
_7:
}
var _sqlite3SrcListFuncArgsØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3SrcListFuncArgsØ00__func__Ø000[0], str(119911), 23)
}
// 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 _sqlite3JoinType(tls *crt.TLS, _pParse *XParse, _pA *XToken, _pB *XToken, _pC *XToken) (r0 int32) {
var _jointype, _i, _j int32
var _5_zSp *int8
var _p *XToken
var _apAll [3]*XToken
_jointype = i32(0)
*(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 4*uintptr(i32(0)))) = _pA
*(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 4*uintptr(i32(1)))) = _pB
*(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 4*uintptr(i32(2)))) = _pC
_i = i32(0)
_0:
if _i >= i32(3) || (*(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 4*uintptr(_i)))) == nil {
goto _4
}
_p = *(**XToken)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_apAll)) + 4*uintptr(_i)))
_j = i32(0)
_5:
if _j >= i32(7) {
goto _8
}
if ((_p.X1) == uint32((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X1)) && (Xsqlite3_strnicmp(tls, _p.X0, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00zKeyTextØ001))+1*uintptr((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X0))), int32(_p.X1)) == i32(0)) {
{
p := &_jointype
*p = (*p) | int32((*t77)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3JoinTypeØ00aKeywordØ002))+3*uintptr(_j))).X2)
sink1 = *p
}
goto _8
}
_j += 1
goto _5
_8:
if _j >= i32(7) {
{
p := &_jointype
*p = (*p) | i32(64)
sink1 = *p
}
goto _4
}
_i += 1
goto _0
_4:
if (_jointype&i32(33)) != i32(33) && (_jointype&i32(64)) == i32(0) {
goto _13
}
_5_zSp = str(119934)
func() {
if _pB == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116764), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3JoinTypeØ00__func__Ø000))), unsafe.Pointer(str(119936)))
crt.X__builtin_abort(tls)
}
}()
if _pC == nil {
*(*uintptr)(unsafe.Pointer(&_5_zSp)) += uintptr(1)
}
_sqlite3ErrorMsg(tls, _pParse, str(119942), unsafe.Pointer(_pA), unsafe.Pointer(_pB), unsafe.Pointer(_5_zSp), unsafe.Pointer(_pC))
_jointype = i32(1)
goto _19
_13:
if ((_jointype & i32(32)) != i32(0)) && ((_jointype & i32(24)) != i32(8)) {
_sqlite3ErrorMsg(tls, _pParse, str(119986))
_jointype = i32(1)
}
_19:
return _jointype
_ = _apAll
panic(0)
}
var _sqlite3JoinTypeØ00aKeywordØ002 [7]struct {
X0 uint8
X1 uint8
X2 uint8
}
func init() {
_sqlite3JoinTypeØ00aKeywordØ002 = [7]struct {
X0 uint8
X1 uint8
X2 uint8
}{t77{X0: u8(0), X1: u8(7), X2: u8(4)}, t77{X0: u8(6), X1: u8(4), X2: u8(40)}, t77{X0: u8(10), X1: u8(5), X2: u8(32)}, t77{X0: u8(14), X1: u8(5), X2: u8(48)}, t77{X0: u8(19), X1: u8(4), X2: u8(56)}, t77{X0: u8(23), X1: u8(5), X2: u8(1)}, t77{X0: u8(28), X1: u8(5), X2: u8(3)}}
}
var _sqlite3JoinTypeØ00zKeyTextØ001 [34]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00zKeyTextØ001[0], str(120041), 34)
}
var _sqlite3JoinTypeØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3JoinTypeØ00__func__Ø000[0], str(120075), 16)
}
// 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 _sqlite3ExprListAppendVector(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pColumns *XIdList, _pExpr *XExpr) (r0 *XExprList) {
var _n, _i, _iFirst int32
var _db *Xsqlite3
var _2_pSubExpr, _4_pFirst *XExpr
_db = (*Xsqlite3)(_pParse.X0)
_iFirst = func() int32 {
if _pList != nil {
return (_pList.X0)
}
return i32(0)
}()
if func() int32 {
if _pColumns == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92423), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _vector_append_error
}
if _pExpr == nil {
goto _vector_append_error
}
if (int32(_pExpr.X0) != i32(119)) && ((_pColumns.X1) != store1(&_n, _sqlite3ExprVectorSize(tls, _pExpr))) {
_sqlite3ErrorMsg(tls, _pParse, str(42971), _pColumns.X1, _n)
goto _vector_append_error
}
_i = i32(0)
_8:
if _i >= (_pColumns.X1) {
goto _11
}
_2_pSubExpr = _sqlite3ExprForVectorField(tls, _pParse, _pExpr, _i)
_pList = _sqlite3ExprListAppend(tls, _pParse, _pList, _2_pSubExpr)
if _pList != nil {
func() {
if (_pList.X0) != ((_iFirst + _i) + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92441), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(120091)))
crt.X__builtin_abort(tls)
}
}()
*(**int8)(unsafe.Pointer(&((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr((_pList.X0)-i32(1)))).X1))) = (*TIdList_item)(unsafe.Pointer(uintptr(_pColumns.X0) + 8*uintptr(_i))).X0
*(**int8)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pColumns.X0) + 8*uintptr(_i))).X0))) = nil
}
_i += 1
goto _8
_11:
if (((_db.X17) == 0) && (int32(_pExpr.X0) == i32(119))) && func() int32 {
if _pList != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92447), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
_4_pFirst = (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_pList.X2))))) + 20*uintptr(_iFirst))).X0)
func() {
if _4_pFirst == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92449), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(120116)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_4_pFirst.X0) != i32(159) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(92450), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprListAppendVectorØ00__func__Ø000))), unsafe.Pointer(str(120126)))
crt.X__builtin_abort(tls)
}
}()
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pFirst.X5))))) = _pExpr
_pExpr = nil
*(*int32)(unsafe.Pointer(&(_4_pFirst.X8))) = _pColumns.X1
}
_vector_append_error:
_sqlite3ExprDelete(tls, _db, _pExpr)
_sqlite3IdListDelete(tls, _db, _pColumns)
return _pList
}
var _sqlite3ExprListAppendVectorØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprListAppendVectorØ00__func__Ø000[0], str(120155), 28)
}
// 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 _sqlite3IdListAppend(tls *crt.TLS, _db *Xsqlite3, _pList *XIdList, _pToken *XToken) (r0 *XIdList) {
var _i int32
if _pList != nil {
goto _0
}
_pList = (*XIdList)(_sqlite3DbMallocZero(tls, _db, uint64(u32(8))))
if _pList == nil {
return nil
}
_0:
*(**TIdList_item)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pList.X0))))) = (*TIdList_item)(_sqlite3ArrayAllocate(tls, _db, _pList.X0, int32(u32(8)), (*int32)(unsafe.Pointer(&(_pList.X1))), &_i))
if _i < i32(0) {
_sqlite3IdListDelete(tls, _db, _pList)
return nil
}
*(**int8)(unsafe.Pointer(&((*TIdList_item)(unsafe.Pointer(uintptr(_pList.X0) + 8*uintptr(_i))).X0))) = _sqlite3NameFromToken(tls, _db, _pToken)
return _pList
}
func _spanSet(tls *crt.TLS, _pOut *XExprSpan, _pStart *XToken, _pEnd *XToken) {
*(**int8)(unsafe.Pointer(&(_pOut.X1))) = _pStart.X0
*(**int8)(unsafe.Pointer(&(_pOut.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pEnd.X0)) + 1*uintptr(_pEnd.X1)))
}
// 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 _sqlite3ExprAssignVarNumber(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _n uint32) {
var _x int16
var _2_doAdd, _3_bOk int32
var _3_i int64
var _z *int8
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
if _pExpr == nil {
return
}
func() {
if ((_pExpr.X2) & uint32(i32(25600))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91849), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120183)))
crt.X__builtin_abort(tls)
}
}()
_z = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pExpr.X3)))))
func() {
if _z == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91851), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(44451)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91852), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120244)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n != uint32(_sqlite3Strlen30(tls, _z)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91853), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120252)))
crt.X__builtin_abort(tls)
}
}()
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) == i32(0) {
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(63) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91856), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprAssignVarNumberØ00__func__Ø000))), unsafe.Pointer(str(120279)))
crt.X__builtin_abort(tls)
}
}()
_x = preInc18((*int16)(unsafe.Pointer(&(_pParse.X52))), 1)
goto _12
}
_2_doAdd = i32(0)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != i32(63) {
goto _13
}
if _n == uint32(i32(2)) {
_3_i = int64(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(1))))) - i32(48))
_3_bOk = i32(1)
goto _15
}
_3_bOk = bool2int(i32(0) == _sqlite3Atoi64(tls, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(i32(1)))), &_3_i, int32(_n-uint32(i32(1))), uint8(i32(1))))
_15:
if ((_3_bOk == i32(0)) || (_3_i < int64(i32(1)))) || (_3_i > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9)))))) {
_sqlite3ErrorMsg(tls, _pParse, str(120289), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9)))))
return
}
_x = int16(_3_i)
if int32(_x) > int32(_pParse.X52) {
*(*int16)(unsafe.Pointer(&(_pParse.X52))) = int16(int32(_x))
_2_doAdd = i32(1)
goto _21
}
if _sqlite3VListNumToName(tls, _pParse.X60, int32(_x)) == nil {
_2_doAdd = i32(1)
}
_21:
goto _22
_13:
_x = int16(_sqlite3VListNameToNum(tls, _pParse.X60, _z, int32(_n)))
if int32(_x) == i32(0) {
_x = preInc18((*int16)(unsafe.Pointer(&(_pParse.X52))), 1)
_2_doAdd = i32(1)
}
_22:
if _2_doAdd != 0 {
*(**int32)(unsafe.Pointer(&(_pParse.X60))) = _sqlite3VListAdd(tls, _db, _pParse.X60, _z, int32(_n), int32(_x))
}
_12:
*(*int16)(unsafe.Pointer(&(_pExpr.X9))) = _x
if int32(_x) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(9))))) {
_sqlite3ErrorMsg(tls, _pParse, str(120332))
}
}
var _sqlite3ExprAssignVarNumberØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprAssignVarNumberØ00__func__Ø000[0], str(120355), 27)
}
// Add a new name/number pair to a VList. This might require that the
// VList object be reallocated, so return the new VList. If an OOM
// error occurs, the original VList returned and the
// db->mallocFailed flag is set.
//
// A VList is really just an array of integers. To destroy a VList,
// simply pass it to sqlite3DbFree().
//
// The first integer is the number of integers allocated for the whole
// VList. The second integer is the number of integers actually used.
// Each name/number pair is encoded by subsequent groups of 3 or more
// integers.
//
// Each name/number pair starts with two integers which are the numeric
// value for the pair and the size of the name/number pair, respectively.
// The text name overlays one or more following integers. The text name
// is always zero-terminated.
//
// Conceptually:
//
// struct VList {
// int nAlloc; // Number of allocated slots
// int nUsed; // Number of used slots
// struct VListEntry {
// int iValue; // Value for this entry
// int nSlot; // Slots used by this entry
// // ... variable name goes here
// } a[0];
// }
//
// During code generation, pointers to the variable names within the
// VList are taken. When that happens, nAlloc is set to zero as an
// indication that the VList may never again be enlarged, since the
// accompanying realloc() would invalidate the pointers.
func _sqlite3VListAdd(tls *crt.TLS, _db *Xsqlite3, _pIn *int32, _zName *int8, _nName int32, _iVal int32) (r0 *int32) {
var _nInt, _i, _1_nAlloc int32
var _1_pOut *int32
var _z *int8
_nInt = (_nName / i32(4)) + i32(3)
func() {
if _pIn != nil && (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) < i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29170), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000))), unsafe.Pointer(str(120382)))
crt.X__builtin_abort(tls)
}
}()
if _pIn != nil && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))))+_nInt) <= (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) {
goto _4
}
_1_nAlloc = func() int32 {
if _pIn != nil {
return ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) * i32(2))
}
return i32(10)
}() + _nInt
_1_pOut = (*int32)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pIn), uint64(uint32(_1_nAlloc)*u32(4))))
if _1_pOut == nil {
return _pIn
}
if _pIn == nil {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_pOut)) + 4*uintptr(i32(1)))) = i32(2)
}
_pIn = _1_pOut
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0)))) = _1_nAlloc
_4:
_i = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1))))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i))) = _iVal
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(1)))) = _nInt
_z = (*int8)(unsafe.Pointer((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(_i+i32(2))))))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1)))) = _i + _nInt
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(1))))) > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIn)) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(29185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VListAddØ00__func__Ø000))), unsafe.Pointer(str(120402)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(_zName), uint32(_nName))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_nName))) = int8(i32(0))
return _pIn
}
var _sqlite3VListAddØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VListAddØ00__func__Ø000[0], str(120417), 16)
}
// Construct a new expression node for a function with multiple
// arguments.
func _sqlite3ExprFunction(tls *crt.TLS, _pParse *XParse, _pList *XExprList, _pToken *XToken) (r0 *XExpr) {
var _db *Xsqlite3
var _pNew *XExpr
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pToken == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91815), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000))), unsafe.Pointer(str(120433)))
crt.X__builtin_abort(tls)
}
}()
_pNew = _sqlite3ExprAlloc(tls, _db, i32(151), _pToken, i32(1))
if _pNew == nil {
_sqlite3ExprListDelete(tls, _db, _pList)
return nil
}
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pNew.X6))))))) = _pList
func() {
if ((_pNew.X2) & uint32(i32(2048))) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91822), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ExprFunctionØ00__func__Ø000))), unsafe.Pointer(str(103875)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pNew)
return _pNew
}
var _sqlite3ExprFunctionØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ExprFunctionØ00__func__Ø000[0], str(120440), 20)
}
// 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 _sqlite3ExprSetHeightAndFlags(tls *crt.TLS, _pParse *XParse, _p *XExpr) {
if (_pParse.X16) != 0 {
return
}
_exprSetHeight(tls, _p)
_sqlite3ExprCheckHeight(tls, _pParse, _p.X7)
}
func _spanBinaryExpr(tls *crt.TLS, _pParse *XParse, _op int32, _pLeft *XExprSpan, _pRight *XExprSpan) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pLeft.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pLeft.X0), (*XExpr)(_pRight.X0))
*(**int8)(unsafe.Pointer(&(_pLeft.X2))) = _pRight.X2
}
func _exprNot(tls *crt.TLS, _pParse *XParse, _doNot int32, _pSpan *XExprSpan) {
if _doNot != 0 {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pSpan.X0))))) = _sqlite3PExpr(tls, _pParse, i32(19), (*XExpr)(_pSpan.X0), nil)
}
}
func _spanUnaryPostfix(tls *crt.TLS, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPostOp *XToken) {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOperand.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil)
*(**int8)(unsafe.Pointer(&(_pOperand.X2))) = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pPostOp.X0)) + 1*uintptr(_pPostOp.X1)))
}
func _binaryToUnaryIfNull(tls *crt.TLS, _pParse *XParse, _pY *XExpr, _pA *XExpr, _op int32) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
if ((_pA != nil) && (_pY != nil)) && (int32(_pY.X0) == i32(101)) {
*(*uint8)(unsafe.Pointer(&(_pA.X0))) = uint8(_op)
_sqlite3ExprDelete(tls, _db, (*XExpr)(_pA.X5))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pA.X5))))) = nil
}
}
func _spanUnaryPrefix(tls *crt.TLS, _pOut *XExprSpan, _pParse *XParse, _op int32, _pOperand *XExprSpan, _pPreOp *XToken) {
*(**int8)(unsafe.Pointer(&(_pOut.X1))) = _pPreOp.X0
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pOut.X0))))) = _sqlite3PExpr(tls, _pParse, _op, (*XExpr)(_pOperand.X0), nil)
*(**int8)(unsafe.Pointer(&(_pOut.X2))) = _pOperand.X2
}
// Add pSelect to the Expr.x.pSelect field. Or, if pExpr is NULL (due
// do a memory allocation failure) then delete the pSelect object.
func _sqlite3PExprAddSelect(tls *crt.TLS, _pParse *XParse, _pExpr *XExpr, _pSelect *XSelect) {
if _pExpr != nil {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer((*t12)(unsafe.Pointer(&(_pExpr.X6))))))) = _pSelect
{
p := (*uint32)(unsafe.Pointer(&(_pExpr.X2)))
*p = (*p) | uint32(i32(2099200))
sink5 = *p
}
_sqlite3ExprSetHeightAndFlags(tls, _pParse, _pExpr)
goto _1
}
func() {
if ((*Xsqlite3)(_pParse.X0).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(91751), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PExprAddSelectØ00__func__Ø000))), unsafe.Pointer(str(42486)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3SelectDelete(tls, (*Xsqlite3)(_pParse.X0), _pSelect)
_1:
}
var _sqlite3PExprAddSelectØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PExprAddSelectØ00__func__Ø000[0], str(120460), 22)
}
func _parserAddExprIdListTerm(tls *crt.TLS, _pParse *XParse, _pPrior *XExprList, _pIdToken *XToken, _hasCollate int32, _sortOrder int32) (r0 *XExprList) {
var _p *XExprList
_p = _sqlite3ExprListAppend(tls, _pParse, _pPrior, nil)
if (_hasCollate != 0 || (_sortOrder != i32(-1))) && (int32((*t21)(unsafe.Pointer(&((*Xsqlite3)(_pParse.X0).X33))).X2) == i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(120482), _pIdToken.X1, unsafe.Pointer(_pIdToken.X0))
}
_sqlite3ExprListSetName(tls, _pParse, _p, _pIdToken, i32(1))
return _p
}
// This routine will drop an existing named index. This routine
// implements the DROP INDEX statement.
func _sqlite3DropIndex(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _ifExists int32) {
var _iDb, _7_code int32
var _7_zDb, _7_zTab *int8
var _db *Xsqlite3
var _7_pTab *XTable
var _v *TVdbe
var _pIndex *XIndex
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (_pParse.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103185), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000))), unsafe.Pointer(str(112366)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) != 0 {
goto _exit_drop_index
}
func() {
if (_pName.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103189), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropIndexØ00__func__Ø000))), unsafe.Pointer(str(114791)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
goto _exit_drop_index
}
_pIndex = _sqlite3FindIndex(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+68*uintptr(i32(0)))).X2, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+68*uintptr(i32(0)))).X1)
if _pIndex != nil {
goto _6
}
if _ifExists == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(120520), unsafe.Pointer(_pName), i32(0))
goto _8
}
_sqlite3CodeVerifyNamedSchema(tls, _pParse, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2)))))+68*uintptr(i32(0)))).X1)
_8:
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
goto _exit_drop_index
_6:
if int32((uint32(_pIndex.X16)<>uint(i32(30))) != i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(120538), i32(0))
goto _exit_drop_index
}
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIndex.X6))
_7_code = i32(10)
_7_pTab = (*XTable)(_pIndex.X3)
_7_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_7_zTab = func() *int8 {
if i32(1) != 0 && (_iDb == i32(1)) {
return str(50007)
}
return str(50026)
}()
if _sqlite3AuthCheck(tls, _pParse, i32(9), _7_zTab, nil, _7_zDb) != 0 {
goto _exit_drop_index
}
if i32(1) != 0 && _iDb != 0 {
_7_code = i32(12)
}
if _sqlite3AuthCheck(tls, _pParse, _7_code, _pIndex.X0, _7_pTab.X0, _7_zDb) != 0 {
goto _exit_drop_index
}
_v = _sqlite3GetVdbe(tls, _pParse)
if _v != nil {
_sqlite3BeginWriteOperation(tls, _pParse, i32(1), _iDb)
_sqlite3NestedParse(tls, _pParse, str(120611), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pIndex.X0))
_sqlite3ClearStatTables(tls, _pParse, _iDb, str(61657), _pIndex.X0)
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_destroyRootPage(tls, _pParse, _pIndex.X11, _iDb)
_sqlite3VdbeAddOp4(tls, _v, i32(142), _iDb, i32(0), i32(0), _pIndex.X0, i32(0))
}
_exit_drop_index:
_sqlite3SrcListDelete(tls, _db, _pName)
}
var _sqlite3DropIndexØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DropIndexØ00__func__Ø000[0], str(120660), 17)
}
// The VACUUM command is used to clean up the database,
// collapse free space, etc. It is modelled after the VACUUM command
// in PostgreSQL. The VACUUM command works as follows:
//
// (1) Create a new transient database file
// (2) Copy all content from the database being vacuumed into
// the new transient database file
// (3) Copy content from the transient database back into the
// original database.
//
// The transient database requires temporary disk space approximately
// equal to the size of the original database. The copy operation of
// step (3) requires additional temporary disk space approximately equal
// to the size of the original database for the rollback journal.
// Hence, temporary disk space that is approximately 2x the size of the
// original database is required. Every page of the database is written
// approximately 3 times: Once for step (2) and twice for step (3).
// Two writes per page are required in step (3) because the original
// database content must be written into the rollback journal prior to
// overwriting the database with the vacuumed content.
//
// Only 1x temporary space and only 1x writes would be required if
// the copy of step (3) were replaced by deleting the original database
// and renaming the transient database as the original. But that will
// not work if other processes are attached to the original database.
// And a power loss in between deleting the original and renaming the
// transient would cause the database file to appear to be deleted
// following reboot.
func _sqlite3Vacuum(tls *crt.TLS, _pParse *XParse, _pNm *XToken) {
var _iDb int32
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
_iDb = i32(0)
if _v == nil {
return
}
if _pNm == nil {
goto _1
}
_iDb = _sqlite3TwoPartName(tls, _pParse, _pNm, _pNm, &_pNm)
if _iDb < i32(0) {
return
}
_1:
if _iDb != i32(1) {
_sqlite3VdbeAddOp1(tls, _v, i32(10), _iDb)
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
}
}
// Process a pragma statement.
//
// Pragmas are of this form:
//
// PRAGMA [schema.]id [= value]
//
// The identifier might also be a string. The value is a string, and
// identifier, or a number. If minusFlag is true, then the value is
// a number that was preceded by a minus sign.
//
// If the left side is "database.id" then pId1 is the database name
// and pId2 is the id. If the left side is just "id" then pId1 is the
// id and pId2 is any empty string.
func _sqlite3Pragma(tls *crt.TLS, _pParse *XParse, _pId1 *XToken, _pId2 *XToken, _pValue *XToken, _minusFlag int32) {
var _99_cnum, _177_szThreshold int16
var _iDb, _rc, _13_size, _15_size, _18_b, _20_ii, _22_iReg, _25_eMode, _28_ii, _31_eMode, _31_ii, _33_n, _43_eAuto, _44_iAddr, _45_iLimit, _45_addr, _49_size, _52_size, _57_ii, _68_res, _77_iLevel, _80_mask, _85_i, _85_k, _85_nHidden, _96_i, _96_mx, _101_i, _104_i, _106_i, _110_i, _111_j, _113_i, _113_j, _113_x, _113_regResult, _113_regKey, _113_regRow, _113_addrTop, _113_addrOk, _124_iCol, _126_jmp, _135_i, _135_j, _135_addr, _135_mxErr, _135_isQuick, _138_cnt, _138_mxIdx, _138_nIdx, _143_loopTop, _143_iDataCur, _143_iIdxCur, _143_r1, _146_jmp2, _148_addrCkFault, _148_addrCkOk, _148_k, _150_jmp2, _150_jmp3, _150_jmp4, _150_jmp5, _150_ckUniq, _151_uniqOk, _151_jmp6, _151_kk, _152_iCol, _164_iCookie, _167_i, _169_iBt, _169_eMode, _177_iDbLast, _177_iTabCur, _185_r1, _193_i, _194_j int32
var _39_iLimit, _56_sz, _189_N, _191_N int64
var _177_opMask uint32
var _113_aiCols, _138_aRoot *int32
var _zLeft, _zRight, _zDb, _25_zRet, _33_zMode, _146_zErr, _148_zErr, _167_zOpt, _177_zSubSql, _194_zState *int8
var _db *Xsqlite3
var _14_pBt, _18_pBt, _41_pBt, _194_pBt *XBtree
var _pDb *XDb
var _27_pPager, _39_pPager *XPager
var _177_pSchema *XSchema
var _92_i, _106_p, _113_k, _138_x, _177_k *XHashElem
var _138_pTbls *XHash
var _84_pTab, _93_pTab, _95_pTab, _101_pTab, _108_pTab, _113_pTab, _113_pParent, _139_pTab, _141_pTab, _143_pTab, _177_pTab *XTable
var _v *TVdbe
var _pId *XToken
var _147_pCheck *XExprList
var _85_pCol *XColumn
var _85_pPk, _92_pIdx, _95_pIdx, _101_pIdx, _113_pIdx, _139_pIdx, _141_pIdx, _143_pIdx, _143_pPk, _143_pPrior, _177_pIdx *XIndex
var _11_aOp, _44_aOp, _155_aOp, _165_aOp, _166_aOp *XVdbeOp
var _107_pColl *XCollSeq
var _aFcntl [4]*int8
var _108_pFK, _113_pFK *XFKey
var _103_azOrigin [3]*int8
var _pPragma *XPragmaName
var _157_pEnc *TEncName
_zLeft = nil
_zRight = nil
_zDb = nil
_db = (*Xsqlite3)(_pParse.X0)
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
return
}
_sqlite3VdbeRunOnlyOnce(tls, _v)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2)
_iDb = _sqlite3TwoPartName(tls, _pParse, _pId1, _pId2, &_pId)
if _iDb < i32(0) {
return
}
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
if (_iDb == i32(1)) && _sqlite3OpenTempDatabase(tls, _pParse) != 0 {
return
}
_zLeft = _sqlite3NameFromToken(tls, _db, _pId)
if _zLeft == nil {
return
}
if _minusFlag != 0 {
_zRight = _sqlite3MPrintf(tls, _db, str(120677), unsafe.Pointer(_pValue))
goto _6
}
_zRight = _sqlite3NameFromToken(tls, _db, _pValue)
_6:
func() {
if _pId2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113600), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120681)))
crt.X__builtin_abort(tls)
}
}()
_zDb = func() *int8 {
if (_pId2.X1) > uint32(i32(0)) {
return (_pDb.X0)
}
return nil
}()
if _sqlite3AuthCheck(tls, _pParse, i32(19), _zLeft, _zRight, _zDb) != 0 {
goto _pragma_out
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0)))) = nil
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(1)))) = _zLeft
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(2)))) = _zRight
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(3)))) = nil
*(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0)
_rc = Xsqlite3_file_control(tls, _db, _zDb, i32(14), (unsafe.Pointer)(&_aFcntl))
if _rc == i32(0) {
_sqlite3VdbeSetNumCols(tls, _v, i32(1))
_sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0)))), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_returnSingleText(tls, _v, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0)))))
Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0))))))
goto _pragma_out
}
if _rc == i32(12) {
goto _13
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0))))) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0))))))
Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aFcntl)) + 4*uintptr(i32(0))))))
}
*(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc
goto _pragma_out
_13:
_pPragma = _pragmaLocate(tls, _zLeft)
if _pPragma == nil {
goto _pragma_out
}
if (int32(_pPragma.X2) & i32(1)) == i32(0) {
goto _16
}
if _sqlite3ReadSchema(tls, _pParse) != 0 {
goto _pragma_out
}
_16:
if ((int32(_pPragma.X2) & i32(2)) == i32(0)) && (((int32(_pPragma.X2) & i32(4)) == i32(0)) || (_zRight == nil)) {
_setPragmaResultColumnNames(tls, _v, _pPragma)
}
switch int32(_pPragma.X1) {
case i32(0):
goto _50
case i32(1):
goto _29
case i32(2):
goto _37
case i32(4):
goto _31
case i32(5):
goto _32
case i32(6):
goto _47
case i32(7):
goto _43
case i32(8):
goto _51
case i32(10):
goto _42
case i32(11):
goto _22
case i32(12):
goto _49
case i32(13):
goto _45
case i32(14):
goto _44
case i32(15):
goto _30
case i32(16):
goto _40
case i32(17):
goto _41
case i32(18):
goto _48
case i32(19):
goto _27
case i32(20):
goto _28
case i32(22):
goto _26
case i32(23):
goto _25
case i32(24):
goto _33
case i32(25):
goto _55
case i32(26):
goto _23
case i32(27):
goto _24
case i32(28):
goto _54
case i32(29):
goto _57
case i32(30):
goto _36
case i32(31):
goto _38
case i32(32):
goto _34
case i32(33):
goto _35
case i32(34):
goto _58
case i32(35):
goto _53
case i32(36):
goto _52
case i32(41):
goto _59
case i32(42):
goto _46
case i32(43):
goto _39
default:
goto _56
}
_22:
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
if _zRight != nil {
goto _60
}
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + i32(2)
sink1 = *p
}
_sqlite3VdbeVerifyNoMallocRequired(tls, _v, i32(9))
_11_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(9), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00getCacheSizeØ002)), _sqlite3PragmaØ00iLnØ001)
if func() int32 {
if _11_aOp == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113699), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _64
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 24*uintptr(i32(0)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 24*uintptr(i32(1)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_11_aOp)) + 24*uintptr(i32(6)))).X3))) = i32(-2000)
goto _65
_60:
_13_size = _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight))
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_sqlite3VdbeAddOp3(tls, _v, i32(104), _iDb, i32(3), _13_size)
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113707), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X10))) = _13_size
_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.X1), (*XSchema)(_pDb.X4).X10)
_65:
goto _64
_23:
_14_pBt = (*XBtree)(_pDb.X1)
func() {
if _14_pBt == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113727), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120686)))
crt.X__builtin_abort(tls)
}
}()
if _zRight == nil {
_15_size = func() int32 {
if func() int32 {
if _14_pBt != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113729), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
return _sqlite3BtreeGetPageSize(tls, _14_pBt)
}
return i32(0)
}()
_returnSingleInt(tls, _v, int64(_15_size))
goto _75
}
*(*int32)(unsafe.Pointer(&(_db.X27))) = _sqlite3Atoi(tls, _zRight)
if i32(7) == _sqlite3BtreeSetPageSize(tls, _14_pBt, _db.X27, i32(-1), i32(0)) {
_sqlite3OomFault(tls, _db)
}
_75:
goto _64
_24:
_18_pBt = (*XBtree)(_pDb.X1)
_18_b = i32(-1)
func() {
if _18_pBt == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120686)))
crt.X__builtin_abort(tls)
}
}()
if _zRight != nil {
_18_b = int32(_sqlite3GetBoolean(tls, _zRight, uint8(i32(0))))
}
if (_pId2.X1) != uint32(i32(0)) || _18_b < i32(0) {
goto _81
}
_20_ii = i32(0)
_82:
if _20_ii >= (_db.X5) {
goto _85
}
_sqlite3BtreeSecureDelete(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_20_ii))).X1), _18_b)
_20_ii += 1
goto _82
_85:
_81:
_18_b = _sqlite3BtreeSecureDelete(tls, _18_pBt, _18_b)
_returnSingleInt(tls, _v, int64(_18_b))
goto _64
_25:
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_22_iReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(112) {
_sqlite3VdbeAddOp2(tls, _v, i32(161), _iDb, _22_iReg)
goto _87
}
_sqlite3VdbeAddOp3(tls, _v, i32(162), _iDb, _22_iReg, _sqlite3AbsInt32(tls, _sqlite3Atoi(tls, _zRight)))
_87:
_sqlite3VdbeAddOp2(tls, _v, i32(67), _22_iReg, i32(1))
goto _64
_26:
_25_zRet = str(91148)
_25_eMode = _getLockingMode(tls, _zRight)
if ((_pId2.X1) == uint32(i32(0))) && (_25_eMode == i32(-1)) {
_25_eMode = int32(_db.X19)
goto _90
}
if (_pId2.X1) != uint32(i32(0)) {
goto _91
}
func() {
if _pDb != (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113826), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120693)))
crt.X__builtin_abort(tls)
}
}()
_28_ii = i32(2)
_94:
if _28_ii >= (_db.X5) {
goto _97
}
_27_pPager = _sqlite3BtreePager(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_28_ii))).X1))
_sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
_28_ii += 1
goto _94
_97:
*(*uint8)(unsafe.Pointer(&(_db.X19))) = uint8(_25_eMode)
_91:
_27_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.X1))
_25_eMode = _sqlite3PagerLockingMode(tls, _27_pPager, _25_eMode)
_90:
func() {
if _25_eMode != i32(0) && _25_eMode != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113837), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120710)))
crt.X__builtin_abort(tls)
}
}()
if _25_eMode == i32(1) {
_25_zRet = str(91138)
}
_returnSingleText(tls, _v, _25_zRet)
goto _64
_27:
if _zRight == nil {
_31_eMode = i32(-1)
goto _103
}
_33_n = _sqlite3Strlen30(tls, _zRight)
_31_eMode = i32(0)
_104:
if store0(&_33_zMode, _sqlite3JournalModename(tls, _31_eMode)) == nil {
goto _107
}
if Xsqlite3_strnicmp(tls, _zRight, _33_zMode, _33_n) == i32(0) {
goto _107
}
_31_eMode += 1
goto _104
_107:
if _33_zMode == nil {
_31_eMode = i32(-1)
}
_103:
if (_31_eMode == i32(-1)) && ((_pId2.X1) == uint32(i32(0))) {
_iDb = i32(0)
*(*uint32)(unsafe.Pointer(&(_pId2.X1))) = uint32(i32(1))
}
_31_ii = (_db.X5) - i32(1)
_112:
if _31_ii < i32(0) {
goto _115
}
if ((*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_31_ii))).X1) != nil) && ((_31_ii == _iDb) || ((_pId2.X1) == uint32(i32(0)))) {
_sqlite3VdbeUsesBtree(tls, _v, _31_ii)
_sqlite3VdbeAddOp3(tls, _v, i32(9), _31_ii, i32(1), _31_eMode)
}
_31_ii -= 1
goto _112
_115:
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1))
goto _64
_28:
_39_pPager = _sqlite3BtreePager(tls, (*XBtree)(_pDb.X1))
_39_iLimit = i64(-2)
if _zRight == nil {
goto _119
}
_sqlite3DecOrHexToI64(tls, _zRight, &_39_iLimit)
if _39_iLimit < int64(i32(-1)) {
_39_iLimit = int64(i32(-1))
}
_119:
_39_iLimit = _sqlite3PagerJournalSizeLimit(tls, _39_pPager, _39_iLimit)
_returnSingleInt(tls, _v, _39_iLimit)
goto _64
_29:
_41_pBt = (*XBtree)(_pDb.X1)
func() {
if _41_pBt == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113916), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120686)))
crt.X__builtin_abort(tls)
}
}()
if _zRight == nil {
_returnSingleInt(tls, _v, int64(_sqlite3BtreeGetAutoVacuum(tls, _41_pBt)))
goto _124
}
_43_eAuto = _getAutoVacuum(tls, _zRight)
func() {
if _43_eAuto < i32(0) || _43_eAuto > i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113921), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120780)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(&(_db.X20))) = int8(uint8(_43_eAuto))
_rc = _sqlite3BtreeSetAutoVacuum(tls, _41_pBt, _43_eAuto)
if _rc != i32(0) || _43_eAuto != i32(1) && _43_eAuto != i32(2) {
goto _130
}
_44_iAddr = _sqlite3VdbeCurrentAddr(tls, _v)
_sqlite3VdbeVerifyNoMallocRequired(tls, _v, i32(5))
_44_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(5), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setMeta6Ø004)), _sqlite3PragmaØ00iLnØ003)
if func() int32 {
if _44_aOp == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113947), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _64
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 24*uintptr(i32(0)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 24*uintptr(i32(1)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 24*uintptr(i32(2)))).X4))) = _44_iAddr + i32(4)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 24*uintptr(i32(4)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_44_aOp)) + 24*uintptr(i32(4)))).X5))) = _43_eAuto - i32(1)
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
_130:
_124:
goto _64
_30:
if ((_zRight == nil) || (_sqlite3GetInt32(tls, _zRight, &_45_iLimit) == 0)) || (_45_iLimit <= i32(0)) {
_45_iLimit = i32(2147483647)
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_sqlite3VdbeAddOp2(tls, _v, i32(56), _45_iLimit, i32(1))
_45_addr = _sqlite3VdbeAddOp1(tls, _v, i32(49), _iDb)
_sqlite3VdbeAddOp1(tls, _v, i32(67), i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(73), i32(1), i32(-1))
_sqlite3VdbeAddOp2(tls, _v, i32(46), i32(1), _45_addr)
_sqlite3VdbeJumpHere(tls, _v, _45_addr)
goto _64
_31:
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _zRight == nil {
_returnSingleInt(tls, _v, int64((*XSchema)(_pDb.X4).X10))
goto _140
}
_49_size = _sqlite3Atoi(tls, _zRight)
*(*int32)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X10))) = _49_size
_sqlite3BtreeSetCacheSize(tls, (*XBtree)(_pDb.X1), (*XSchema)(_pDb.X4).X10)
_140:
goto _64
_32:
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114029), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _zRight == nil {
_returnSingleInt(tls, _v, int64(func() int32 {
if ((_db.X6) & i32(32)) == i32(0) {
return i32(0)
}
return _sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.X1), i32(0))
}()))
goto _146
}
_52_size = i32(1)
if _sqlite3GetInt32(tls, _zRight, &_52_size) != 0 {
_sqlite3BtreeSetSpillSize(tls, (*XBtree)(_pDb.X1), _52_size)
}
if _sqlite3GetBoolean(tls, _zRight, uint8(bool2int(_52_size != i32(0)))) != 0 {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(32)
sink1 = *p
}
goto _149
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-33)
sink1 = *p
}
_149:
_setAllPagerFlags(tls, _db)
_146:
goto _64
_33:
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114066), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _zRight == nil {
goto _152
}
_sqlite3DecOrHexToI64(tls, _zRight, &_56_sz)
if _56_sz < int64(i32(0)) {
_56_sz = _sqlite3Config.X17
}
if (_pId2.X1) == uint32(i32(0)) {
*(*int64)(unsafe.Pointer(&(_db.X8))) = _56_sz
}
_57_ii = (_db.X5) - i32(1)
_155:
if _57_ii < i32(0) {
goto _158
}
if ((*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_57_ii))).X1) != nil) && ((_57_ii == _iDb) || ((_pId2.X1) == uint32(i32(0)))) {
_sqlite3BtreeSetMmapLimit(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_57_ii))).X1), _56_sz)
}
_57_ii -= 1
goto _155
_158:
_152:
_56_sz = int64(i32(-1))
_rc = Xsqlite3_file_control(tls, _db, _zDb, i32(18), (unsafe.Pointer)(&_56_sz))
if _rc == i32(0) {
_returnSingleInt(tls, _v, _56_sz)
goto _164
}
if _rc != i32(12) {
*(*int32)(unsafe.Pointer(&(_pParse.X16))) += 1
*(*int32)(unsafe.Pointer(&(_pParse.X3))) = _rc
}
_164:
goto _64
_34:
if _zRight == nil {
_returnSingleInt(tls, _v, int64(_db.X16))
goto _166
}
_changeTempStorage(tls, _pParse, _zRight)
_166:
goto _64
_35:
if _zRight == nil {
_returnSingleText(tls, _v, Xsqlite3_temp_directory)
goto _168
}
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRight)) + 1*uintptr(i32(0))))) == 0 {
goto _169
}
_rc = _sqlite3OsAccess(tls, (*Xsqlite3_vfs)(_db.X0), _zRight, i32(1), &_68_res)
if (_rc != i32(0)) || (_68_res == i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(120801))
goto _pragma_out
}
_169:
if (i32(0) != 0 || (i32(1) != 0 && (int32(_db.X16) <= i32(1)))) || i32(0) != 0 {
_invalidateTempStorage(tls, _pParse)
}
Xsqlite3_free(tls, (unsafe.Pointer)(Xsqlite3_temp_directory))
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zRight)) + 1*uintptr(i32(0))))) != 0 {
Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(_zRight))
bug20530(Xsqlite3_temp_directory)
goto _177
}
Xsqlite3_temp_directory = nil
bug20530(Xsqlite3_temp_directory)
_177:
_168:
goto _64
_36:
if _zRight == nil {
_returnSingleInt(tls, _v, int64(int32(_pDb.X2)-i32(1)))
goto _179
}
if (_db.X15) == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(120826))
goto _182
}
if _iDb == i32(1) {
goto _182
}
_77_iLevel = (int32(_getSafetyLevel(tls, _zRight, i32(0), uint8(i32(1)))) + i32(1)) & i32(7)
if _77_iLevel == i32(0) {
_77_iLevel = i32(1)
}
*(*uint8)(unsafe.Pointer(&(_pDb.X2))) = uint8(_77_iLevel)
*(*uint8)(unsafe.Pointer(&(_pDb.X3))) = uint8(i32(1))
_setAllPagerFlags(tls, _db)
_182:
_179:
goto _64
_37:
if _zRight == nil {
_setPragmaResultColumnNames(tls, _v, _pPragma)
_returnSingleInt(tls, _v, int64(bool2int((uint32(_db.X6)&(_pPragma.X5)) != uint32(i32(0)))))
goto _185
}
_80_mask = int32(_pPragma.X5)
if int32(_db.X15) == i32(0) {
{
p := &_80_mask
*p = (*p) & i32(-524289)
sink1 = *p
}
}
if _sqlite3GetBoolean(tls, _zRight, uint8(i32(0))) != 0 {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | _80_mask
sink1 = *p
}
goto _188
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & (^_80_mask)
sink1 = *p
}
if _80_mask == i32(33554432) {
*(*int64)(unsafe.Pointer(&(_db.X78))) = int64(i32(0))
}
_188:
_sqlite3VdbeAddOp0(tls, _v, i32(153))
_setAllPagerFlags(tls, _db)
_185:
goto _64
_38:
if _zRight == nil {
goto _190
}
_84_pTab = _sqlite3LocateTable(tls, _pParse, uint32(i32(2)), _zRight, _zDb)
if _84_pTab == nil {
goto _191
}
_85_nHidden = i32(0)
_85_pPk = _sqlite3PrimaryKeyIndex(tls, _84_pTab)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_sqlite3ViewGetColumnNames(tls, _pParse, _84_pTab)
*func() **XColumn { _85_i = i32(0); return &_85_pCol }() = (*XColumn)(_84_pTab.X1)
_192:
if _85_i >= int32(_84_pTab.X11) {
goto _195
}
if (int32(_85_pCol.X6) & i32(2)) != i32(0) {
_85_nHidden += 1
goto _193
}
if (int32(_85_pCol.X6) & i32(1)) == i32(0) {
_85_k = i32(0)
goto _200
}
if _85_pPk == nil {
_85_k = i32(1)
goto _200
}
_85_k = i32(1)
_201:
if _85_k > int32(_84_pTab.X11) || int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_85_pPk.X1)) + 2*uintptr(_85_k-i32(1))))) == _85_i {
goto _205
}
_85_k += 1
goto _201
_205:
_200:
func() {
if (*XExpr)(_85_pCol.X1) != nil && int32((*XExpr)(_85_pCol.X1).X0) != i32(162) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114330), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120879)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120922), _85_i-_85_nHidden, unsafe.Pointer(_85_pCol.X0), unsafe.Pointer(_sqlite3ColumnType(tls, _85_pCol, str(0))), func() int32 {
if (_85_pCol.X3) != 0 {
return i32(1)
}
return i32(0)
}(), unsafe.Pointer(func() *int8 {
if (*XExpr)(_85_pCol.X1) != nil {
return (*(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&((*XExpr)(_85_pCol.X1).X3))))))
}
return nil
}()), _85_k)
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(6))
_193:
*(*uintptr)(unsafe.Pointer(func() **XColumn { _85_i += 1; return &_85_pCol }())) += uintptr(16)
goto _192
_195:
_191:
_190:
goto _64
_39:
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(5)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_92_i = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X2))).X2)
_213:
if _92_i == nil {
goto _216
}
_93_pTab = (*XTable)(_92_i.X2)
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120929), unsafe.Pointer(_93_pTab.X0), i32(0), int32(_93_pTab.X13), int32(_93_pTab.X12), _93_pTab.X9)
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(5))
_92_pIdx = (*XIndex)(_93_pTab.X2)
_217:
if _92_pIdx == nil {
goto _220
}
_sqlite3VdbeMultiLoad(tls, _v, i32(2), str(120935), unsafe.Pointer(_92_pIdx.X0), int32(_92_pIdx.X12), int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_92_pIdx.X2)) + 2*uintptr(i32(0))))), (uint32((_92_pIdx.X16)>>uint(i32(7)))<>uint(i32(31)))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(5))
_92_pIdx = (*XIndex)(_92_pIdx.X5)
goto _217
_220:
_92_i = (*XHashElem)(_92_i.X0)
goto _213
_216:
goto _64
_40:
if _zRight == nil {
goto _221
}
_95_pIdx = _sqlite3FindIndex(tls, _db, _zRight, _zDb)
if _95_pIdx == nil {
goto _222
}
if (_pPragma.X5) != 0 {
_96_mx = int32(_95_pIdx.X14)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6)
goto _224
}
_96_mx = int32(_95_pIdx.X13)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3)
_224:
_95_pTab = (*XTable)(_95_pIdx.X3)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
func() {
if (_pParse.X18) > int32(_pPragma.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114390), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120940)))
crt.X__builtin_abort(tls)
}
}()
_96_i = i32(0)
_227:
if _96_i >= _96_mx {
goto _230
}
_99_cnum = *(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X1)) + 2*uintptr(_96_i)))
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120974), _96_i, int32(_99_cnum), unsafe.Pointer(func() *int8 {
if int32(_99_cnum) < i32(0) {
return nil
}
return ((*XColumn)(unsafe.Pointer(uintptr(_95_pTab.X1) + 16*uintptr(_99_cnum))).X0)
}()))
if (_pPragma.X5) != 0 {
_sqlite3VdbeMultiLoad(tls, _v, i32(4), str(120978), int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X7)) + 1*uintptr(_96_i)))), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_95_pIdx.X8)) + 4*uintptr(_96_i)))), bool2int(_96_i < int32(_95_pIdx.X13)))
}
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), _pParse.X18)
_96_i += 1
goto _227
_230:
_222:
_221:
goto _64
_41:
if _zRight == nil {
goto _234
}
_101_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
if _101_pTab == nil {
goto _235
}
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(5)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
*func() *int32 { _101_pIdx = (*XIndex)(_101_pTab.X2); return &_101_i }() = i32(0)
_236:
if _101_pIdx == nil {
goto _239
}
_103_azOrigin = [3]*int8{}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 4*uintptr(i32(0)))) = str(120982)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 4*uintptr(i32(1)))) = str(120984)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 4*uintptr(i32(2)))) = str(61650)
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(120986), _101_i, unsafe.Pointer(_101_pIdx.X0), bool2int(int32(_101_pIdx.X15) != i32(0)), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_103_azOrigin)) + 4*uintptr((uint32(_101_pIdx.X16)<>uint(i32(30)))))), bool2int((*XExpr)(_101_pIdx.X9) != nil))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(5))
*func() *int32 { _101_pIdx = (*XIndex)(_101_pIdx.X5); return &_101_i }() += 1
goto _236
_239:
_235:
_234:
goto _64
_42:
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3)
_104_i = i32(0)
_240:
if _104_i >= (_db.X5) {
goto _243
}
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_104_i))).X1) == nil {
goto _241
}
func() {
if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_104_i))).X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114434), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(120992)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121015), _104_i, unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_104_i))).X0), unsafe.Pointer(_sqlite3BtreeGetFilename(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_104_i))).X1))))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(3))
_241:
_104_i += 1
goto _240
_243:
goto _64
_43:
_106_i = i32(0)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2)
_106_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_db.X70))).X2)
_247:
if _106_p == nil {
goto _250
}
_107_pColl = (*XCollSeq)(_106_p.X2)
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121019), postInc1(&_106_i, int32(1)), unsafe.Pointer(_107_pColl.X0))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(2))
_106_p = (*XHashElem)(_106_p.X0)
goto _247
_250:
goto _64
_44:
if _zRight == nil {
goto _251
}
_108_pTab = _sqlite3FindTable(tls, _db, _zRight, _zDb)
if _108_pTab == nil {
goto _252
}
_108_pFK = (*XFKey)(_108_pTab.X4)
if _108_pFK == nil {
goto _253
}
_110_i = i32(0)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(8)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_254:
if _108_pFK == nil {
goto _255
}
_111_j = i32(0)
_256:
if _111_j >= (_108_pFK.X5) {
goto _259
}
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121022), _110_i, _111_j, unsafe.Pointer(_108_pFK.X2), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_108_pTab.X1)+16*uintptr((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_108_pFK.X9)))))+8*uintptr(_111_j))).X0))).X0), unsafe.Pointer((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_108_pFK.X9)))))+8*uintptr(_111_j))).X1), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_108_pFK.X7))))) + 1*uintptr(i32(1)))))), unsafe.Pointer(_actionName(tls, *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[2]uint8)(unsafe.Pointer(&(_108_pFK.X7))))) + 1*uintptr(i32(0)))))), unsafe.Pointer(str(121031)))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(8))
_111_j += 1
goto _256
_259:
_110_i += 1
_108_pFK = (*XFKey)(_108_pFK.X1)
goto _254
_255:
_253:
_252:
_251:
goto _64
_45:
_113_regResult = (_pParse.X18) + i32(1)
{
p := (*int32)(unsafe.Pointer(&(_pParse.X18)))
*p = (*p) + i32(4)
sink1 = *p
}
_113_regKey = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_113_regRow = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_113_k = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X2))).X2)
_260:
if _113_k == nil {
goto _261
}
if _zRight != nil {
_113_pTab = _sqlite3LocateTable(tls, _pParse, uint32(i32(0)), _zRight, _zDb)
_113_k = nil
goto _263
}
_113_pTab = (*XTable)(_113_k.X2)
_113_k = (*XHashElem)(_113_k.X0)
_263:
if (_113_pTab == nil) || ((*XFKey)(_113_pTab.X4) == nil) {
goto _260
}
_sqlite3TableLock(tls, _pParse, _iDb, _113_pTab.X7, uint8(i32(0)), _113_pTab.X0)
if (int32(_113_pTab.X11) + _113_regRow) > (_pParse.X18) {
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = int32(_113_pTab.X11) + _113_regRow
}
_sqlite3OpenTable(tls, _pParse, i32(0), _iDb, _113_pTab, i32(106))
_sqlite3VdbeLoadString(tls, _v, _113_regResult, _113_pTab.X0)
*func() **XFKey { _113_i = i32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.X4)
_267:
if _113_pFK == nil {
goto _270
}
_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.X2, _zDb)
if _113_pParent == nil {
goto _268
}
_113_pIdx = nil
_sqlite3TableLock(tls, _pParse, _iDb, _113_pParent.X7, uint8(i32(0)), _113_pParent.X0)
_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, nil)
if _113_x != i32(0) {
goto _272
}
if _113_pIdx == nil {
_sqlite3OpenTable(tls, _pParse, _113_i, _iDb, _113_pParent, i32(106))
goto _274
}
_sqlite3VdbeAddOp3(tls, _v, i32(106), _113_i, _113_pIdx.X11, _iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _113_pIdx)
_274:
goto _275
_272:
_113_k = nil
goto _270
_275:
_268:
*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.X1)
goto _267
_270:
func() {
if (_pParse.X16) <= i32(0) && _113_pFK != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114546), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121036)))
crt.X__builtin_abort(tls)
}
}()
if _113_pFK != nil {
goto _261
}
if (_pParse.X17) < _113_i {
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = _113_i
}
_113_addrTop = _sqlite3VdbeAddOp1(tls, _v, i32(37), i32(0))
*func() **XFKey { _113_i = i32(1); return &_113_pFK }() = (*XFKey)(_113_pTab.X4)
_281:
if _113_pFK == nil {
goto _284
}
_113_pParent = _sqlite3FindTable(tls, _db, _113_pFK.X2, _zDb)
_113_pIdx = nil
_113_aiCols = nil
if _113_pParent != nil {
_113_x = _sqlite3FkLocateIndex(tls, _pParse, _113_pParent, _113_pFK, &_113_pIdx, &_113_aiCols)
func() {
if _113_x != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114556), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121061)))
crt.X__builtin_abort(tls)
}
}()
}
_113_addrOk = _sqlite3VdbeMakeLabel(tls, _v)
_113_j = i32(0)
_288:
if _113_j >= (_113_pFK.X5) {
goto _291
}
_124_iCol = func() int32 {
if _113_aiCols != nil {
return (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_113_aiCols)) + 4*uintptr(_113_j))))
}
return ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_113_pFK.X9))))) + 8*uintptr(_113_j))).X0)
}()
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _113_pTab, i32(0), _124_iCol, _113_regRow+_113_j)
_sqlite3VdbeAddOp2(tls, _v, i32(75), _113_regRow+_113_j, _113_addrOk)
_113_j += 1
goto _288
_291:
if _113_pIdx != nil {
_sqlite3VdbeAddOp4(tls, _v, i32(101), _113_regRow, _113_pFK.X5, _113_regKey, _sqlite3IndexAffinityStr(tls, _db, _113_pIdx), _113_pFK.X5)
_sqlite3VdbeAddOp4Int(tls, _v, i32(30), _113_i, _113_addrOk, _113_regKey, i32(0))
goto _296
}
if _113_pParent != nil {
_126_jmp = _sqlite3VdbeCurrentAddr(tls, _v) + i32(2)
_sqlite3VdbeAddOp3(tls, _v, i32(31), _113_i, _126_jmp, _113_regRow)
_sqlite3VdbeGoto(tls, _v, _113_addrOk)
func() {
if (_113_pFK.X5) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114581), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121066)))
crt.X__builtin_abort(tls)
}
}()
}
_296:
if ((_113_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_sqlite3VdbeAddOp2(tls, _v, i32(125), i32(0), _113_regResult+i32(1))
goto _300
}
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _113_regResult+i32(1))
_300:
_sqlite3VdbeMultiLoad(tls, _v, _113_regResult+i32(2), str(121079), unsafe.Pointer(_113_pFK.X2), _113_i-i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(67), _113_regResult, i32(4))
_sqlite3VdbeResolveLabel(tls, _v, _113_addrOk)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_113_aiCols))
*func() **XFKey { _113_i += 1; return &_113_pFK }() = (*XFKey)(_113_pFK.X1)
goto _281
_284:
_sqlite3VdbeAddOp2(tls, _v, i32(7), i32(0), _113_addrTop+i32(1))
_sqlite3VdbeJumpHere(tls, _v, _113_addrTop)
goto _260
_261:
goto _64
_46:
if _zRight == nil {
goto _301
}
if _sqlite3GetBoolean(tls, _zRight, uint8(i32(0))) != 0 {
_sqlite3ParserTrace(tls, (*crt.XFILE)(Xstdout), str(121082))
goto _303
}
_sqlite3ParserTrace(tls, nil, nil)
_303:
_301:
goto _64
_47:
if _zRight != nil {
_sqlite3RegisterLikeFunctions(tls, _db, int32(_sqlite3GetBoolean(tls, _zRight, uint8(i32(0)))))
}
goto _64
_48:
_135_isQuick = bool2int(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zLeft)) + 1*uintptr(i32(0))))))))) == i32(113))
func() {
if _iDb < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114657), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(42040)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iDb != i32(0) && (_pId2.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114658), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121091)))
crt.X__builtin_abort(tls)
}
}()
if (_pId2.X0) == nil {
_iDb = i32(-1)
}
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(6)
_135_mxErr = i32(100)
if _zRight == nil {
goto _311
}
_sqlite3GetInt32(tls, _zRight, &_135_mxErr)
if _135_mxErr <= i32(0) {
_135_mxErr = i32(100)
}
_311:
_sqlite3VdbeAddOp2(tls, _v, i32(56), _135_mxErr-i32(1), i32(1))
_135_i = i32(0)
_313:
if _135_i >= (_db.X5) {
goto _316
}
_138_cnt = i32(0)
_138_mxIdx = i32(0)
goto _317
_317:
if (_iDb >= i32(0)) && (_135_i != _iDb) {
goto _314
}
_sqlite3CodeVerifySchema(tls, _pParse, _135_i)
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _135_i, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114693), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121109)))
crt.X__builtin_abort(tls)
}
}()
_138_pTbls = (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_135_i))).X4).X2)))
*func() **XHashElem { _138_cnt = i32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.X2)
_322:
if _138_x == nil {
goto _325
}
_139_pTab = (*XTable)(_138_x.X2)
if ((_139_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
_138_cnt += 1
}
*func() **XIndex { _138_nIdx = i32(0); return &_139_pIdx }() = (*XIndex)(_139_pTab.X2)
_327:
if _139_pIdx == nil {
goto _330
}
_138_cnt += 1
*func() *int32 { _139_pIdx = (*XIndex)(_139_pIdx.X5); return &_138_nIdx }() += 1
goto _327
_330:
if _138_nIdx > _138_mxIdx {
_138_mxIdx = _138_nIdx
}
_138_x = (*XHashElem)(_138_x.X0)
goto _322
_325:
_138_aRoot = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(4)*uint32(_138_cnt+i32(1)))))
if _138_aRoot == nil {
goto _316
}
*func() **XHashElem { _138_cnt = i32(0); return &_138_x }() = (*XHashElem)(_138_pTbls.X2)
_333:
if _138_x == nil {
goto _336
}
_141_pTab = (*XTable)(_138_x.X2)
if ((_141_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, int32(1))))) = _141_pTab.X7
}
_141_pIdx = (*XIndex)(_141_pTab.X2)
_338:
if _141_pIdx == nil {
goto _341
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(postInc1(&_138_cnt, int32(1))))) = _141_pIdx.X11
_141_pIdx = (*XIndex)(_141_pIdx.X5)
goto _338
_341:
_138_x = (*XHashElem)(_138_x.X0)
goto _333
_336:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_138_aRoot)) + 4*uintptr(_138_cnt))) = i32(0)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 {
if (_pParse.X18) > (i32(8) + _138_mxIdx) {
return (_pParse.X18)
}
return (i32(8) + _138_mxIdx)
}()
_sqlite3VdbeAddOp4(tls, _v, i32(144), i32(2), _138_cnt, i32(1), (*int8)(unsafe.Pointer(_138_aRoot)), i32(-12))
_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_135_i)))
_135_addr = _sqlite3VdbeAddOp1(tls, _v, i32(75), i32(2))
_sqlite3VdbeAddOp4(tls, _v, i32(97), i32(0), i32(3), i32(0), _sqlite3MPrintf(tls, _db, str(121142), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_135_i))).X0)), i32(-1))
_sqlite3VdbeAddOp3(tls, _v, i32(63), i32(2), i32(4), i32(1))
_sqlite3VdbeAddOp3(tls, _v, i32(93), i32(4), i32(3), i32(2))
_integrityCheckResultRow(tls, _v, i32(2))
_sqlite3VdbeJumpHere(tls, _v, _135_addr)
_138_x = (*XHashElem)(_138_pTbls.X2)
_344:
if _138_x == nil {
goto _347
}
_143_pTab = (*XTable)(_138_x.X2)
_143_pPrior = nil
_143_r1 = i32(-1)
if (_143_pTab.X7) < i32(1) {
goto _345
}
if (((*XExprList)(_143_pTab.X6) == nil) && (((_143_pTab.X9) & uint32(i32(512))) == uint32(i32(0)))) && (((*XIndex)(_143_pTab.X2) == nil) || _135_isQuick != 0) {
goto _345
}
_143_pPk = func() *XIndex {
if ((_143_pTab.X9) & uint32(i32(32))) == uint32(i32(0)) {
return nil
}
return _sqlite3PrimaryKeyIndex(tls, _143_pTab)
}()
_sqlite3ExprCacheClear(tls, _pParse)
_sqlite3OpenTableAndIndices(tls, _pParse, _143_pTab, i32(106), uint8(i32(0)), i32(1), nil, &_143_iDataCur, &_143_iIdxCur)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), i32(7))
*func() **XIndex { _135_j = i32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.X2)
_355:
if _143_pIdx == nil {
goto _358
}
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), i32(8)+_135_j)
*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.X5); return &_135_j }() += 1
goto _355
_358:
func() {
if (_pParse.X18) < (i32(8) + _135_j) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114754), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121166)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3NoTempsInRange(tls, _pParse, i32(1), i32(7)+_135_j) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114755), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121184)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _v, i32(37), _143_iDataCur, i32(0))
_143_loopTop = _sqlite3VdbeAddOp2(tls, _v, i32(73), i32(7), i32(1))
_135_j = i32(0)
_363:
if _135_j >= int32(_143_pTab.X11) {
goto _366
}
if _135_j == int32(_143_pTab.X10) {
goto _364
}
if int32((*XColumn)(unsafe.Pointer(uintptr(_143_pTab.X1)+16*uintptr(_135_j))).X3) == i32(0) {
goto _364
}
_sqlite3ExprCodeGetColumnOfTable(tls, _v, _143_pTab, _143_iDataCur, _135_j, i32(3))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(128)))
_146_jmp2 = _sqlite3VdbeAddOp1(tls, _v, i32(76), i32(3))
_146_zErr = _sqlite3MPrintf(tls, _db, str(121220), unsafe.Pointer(_143_pTab.X0), unsafe.Pointer((*XColumn)(unsafe.Pointer(uintptr(_143_pTab.X1)+16*uintptr(_135_j))).X0))
_sqlite3VdbeAddOp4(tls, _v, i32(97), i32(0), i32(3), i32(0), _146_zErr, i32(-1))
_integrityCheckResultRow(tls, _v, i32(3))
_sqlite3VdbeJumpHere(tls, _v, _146_jmp2)
_364:
_135_j += 1
goto _363
_366:
if (*XExprList)(_143_pTab.X6) == nil || ((_db.X6)&i32(8192)) != i32(0) {
goto _370
}
_147_pCheck = _sqlite3ExprListDup(tls, _db, (*XExprList)(_143_pTab.X6), i32(0))
if int32(_db.X17) != i32(0) {
goto _371
}
_148_addrCkFault = _sqlite3VdbeMakeLabel(tls, _v)
_148_addrCkOk = _sqlite3VdbeMakeLabel(tls, _v)
*(*int32)(unsafe.Pointer(&(_pParse.X22))) = _143_iDataCur
_sqlite3ExprCachePush(tls, _pParse)
_148_k = (_147_pCheck.X0) - i32(1)
_372:
if _148_k <= i32(0) {
goto _375
}
_sqlite3ExprIfFalse(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_147_pCheck.X2)))))+20*uintptr(_148_k))).X0), _148_addrCkFault, i32(0))
_148_k -= 1
goto _372
_375:
_sqlite3ExprIfTrue(tls, _pParse, (*XExpr)((*TExprList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TExprList_item)(unsafe.Pointer(&(_147_pCheck.X2)))))+20*uintptr(i32(0)))).X0), _148_addrCkOk, i32(16))
_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkFault)
_148_zErr = _sqlite3MPrintf(tls, _db, str(121240), unsafe.Pointer(_143_pTab.X0))
_sqlite3VdbeAddOp4(tls, _v, i32(97), i32(0), i32(3), i32(0), _148_zErr, i32(-1))
_integrityCheckResultRow(tls, _v, i32(3))
_sqlite3VdbeResolveLabel(tls, _v, _148_addrCkOk)
_sqlite3ExprCachePop(tls, _pParse)
_371:
_sqlite3ExprListDelete(tls, _db, _147_pCheck)
_370:
*func() **XIndex { _135_j = i32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.X2)
_376:
if _143_pIdx == nil || _135_isQuick != 0 {
goto _380
}
_150_ckUniq = _sqlite3VdbeMakeLabel(tls, _v)
if _143_pPk == _143_pIdx {
goto _377
}
_143_r1 = _sqlite3GenerateIndexKey(tls, _pParse, _143_pIdx, _143_iDataCur, i32(0), i32(0), &_150_jmp3, _143_pPrior, _143_r1)
_143_pPrior = _143_pIdx
_sqlite3VdbeAddOp2(tls, _v, i32(73), i32(8)+_135_j, i32(1))
_150_jmp2 = _sqlite3VdbeAddOp4Int(tls, _v, i32(30), _143_iIdxCur+_135_j, _150_ckUniq, _143_r1, int32(_143_pIdx.X14))
_sqlite3VdbeLoadString(tls, _v, i32(3), str(121270))
_sqlite3VdbeAddOp3(tls, _v, i32(93), i32(7), i32(3), i32(3))
_sqlite3VdbeLoadString(tls, _v, i32(4), str(121275))
_sqlite3VdbeAddOp3(tls, _v, i32(93), i32(4), i32(3), i32(3))
_150_jmp5 = _sqlite3VdbeLoadString(tls, _v, i32(4), _143_pIdx.X0)
_sqlite3VdbeAddOp3(tls, _v, i32(93), i32(4), i32(3), i32(3))
_150_jmp4 = _integrityCheckResultRow(tls, _v, i32(3))
_sqlite3VdbeJumpHere(tls, _v, _150_jmp2)
if int32(_143_pIdx.X15) == i32(0) {
goto _382
}
_151_uniqOk = _sqlite3VdbeMakeLabel(tls, _v)
_151_kk = i32(0)
_383:
if _151_kk >= int32(_143_pIdx.X13) {
goto _386
}
_152_iCol = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_143_pIdx.X1)) + 2*uintptr(_151_kk))))
func() {
if _152_iCol == i32(-1) || _152_iCol >= int32(_143_pTab.X11) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114827), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121296)))
crt.X__builtin_abort(tls)
}
}()
if (_152_iCol >= i32(0)) && (((*XColumn)(unsafe.Pointer(uintptr(_143_pTab.X1) + 16*uintptr(_152_iCol))).X3) != 0) {
goto _384
}
_sqlite3VdbeAddOp2(tls, _v, i32(75), _143_r1+_151_kk, _151_uniqOk)
_384:
_151_kk += 1
goto _383
_386:
_151_jmp6 = _sqlite3VdbeAddOp1(tls, _v, i32(7), _143_iIdxCur+_135_j)
_sqlite3VdbeGoto(tls, _v, _151_uniqOk)
_sqlite3VdbeJumpHere(tls, _v, _151_jmp6)
_sqlite3VdbeAddOp4Int(tls, _v, i32(39), _143_iIdxCur+_135_j, _151_uniqOk, _143_r1, int32(_143_pIdx.X13))
_sqlite3VdbeLoadString(tls, _v, i32(3), str(121330))
_sqlite3VdbeGoto(tls, _v, _150_jmp5)
_sqlite3VdbeResolveLabel(tls, _v, _151_uniqOk)
_382:
_sqlite3VdbeJumpHere(tls, _v, _150_jmp4)
_sqlite3ResolvePartIdxLabel(tls, _pParse, _150_jmp3)
_377:
*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.X5); return &_135_j }() += 1
goto _376
_380:
_sqlite3VdbeAddOp2(tls, _v, i32(7), _143_iDataCur, _143_loopTop)
_sqlite3VdbeJumpHere(tls, _v, _143_loopTop-i32(1))
if _135_isQuick != 0 {
goto _392
}
_sqlite3VdbeLoadString(tls, _v, i32(2), str(121357))
*func() **XIndex { _135_j = i32(0); return &_143_pIdx }() = (*XIndex)(_143_pTab.X2)
_393:
if _143_pIdx == nil {
goto _396
}
if _143_pPk == _143_pIdx {
goto _394
}
_sqlite3VdbeAddOp2(tls, _v, i32(102), _143_iIdxCur+_135_j, i32(3))
_135_addr = _sqlite3VdbeAddOp3(tls, _v, i32(78), i32(8)+_135_j, i32(0), i32(3))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(144)))
_sqlite3VdbeLoadString(tls, _v, i32(3), _143_pIdx.X0)
_sqlite3VdbeAddOp3(tls, _v, i32(93), i32(3), i32(2), i32(7))
_integrityCheckResultRow(tls, _v, i32(7))
_sqlite3VdbeJumpHere(tls, _v, _135_addr)
_394:
*func() *int32 { _143_pIdx = (*XIndex)(_143_pIdx.X5); return &_135_j }() += 1
goto _393
_396:
_392:
_345:
_138_x = (*XHashElem)(_138_x.X0)
goto _344
_347:
_314:
_135_i += 1
goto _313
_316:
_155_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(4), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00endCodeØ006)), _sqlite3PragmaØ00iLnØ005)
if _155_aOp != nil {
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 24*uintptr(i32(0)))).X4))) = i32(1) - _135_mxErr
*(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 24*uintptr(i32(2)))).X1))) = int8(i32(-2))
*(**int8)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_155_aOp)) + 24*uintptr(i32(2)))).X6))))) = str(121386)
}
goto _64
_49:
if _zRight != nil {
goto _399
}
if _sqlite3ReadSchema(tls, _pParse) != 0 {
goto _pragma_out
}
func() {
if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+8*uintptr(i32(1)))).X1) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121389)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+8*uintptr(i32(2)))).X1) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114926), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121428)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32((*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+8*uintptr(i32(3)))).X1) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(114927), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121473)))
crt.X__builtin_abort(tls)
}
}()
_returnSingleText(tls, _v, (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007))+8*uintptr((*Xsqlite3)(_pParse.X0).X14))).X0)
goto _407
_399:
if (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X4).X9)&i32(1)) == i32(1) && (int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X4).X9)&i32(4)) != i32(4) {
goto _409
}
_157_pEnc = (*TEncName)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00encnamesØ007)) + 8*uintptr(i32(0))))
_410:
if (_157_pEnc.X0) == nil {
goto _413
}
if i32(0) == _sqlite3StrICmp(tls, _zRight, _157_pEnc.X0) {
*(*uint8)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4).X8))) = store2((*uint8)(unsafe.Pointer(&(_db.X14))), uint8(func() int32 {
if (_157_pEnc.X1) != 0 {
return int32(_157_pEnc.X1)
}
return i32(2)
}()))
goto _413
}
*(*uintptr)(unsafe.Pointer(&_157_pEnc)) += uintptr(8)
goto _410
_413:
if (_157_pEnc.X0) == nil {
_sqlite3ErrorMsg(tls, _pParse, str(121518), unsafe.Pointer(_zRight))
}
_409:
_407:
goto _64
_50:
_164_iCookie = int32(_pPragma.X5)
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
if _zRight == nil || (int32(_pPragma.X2)&i32(8)) != i32(0) {
goto _419
}
_sqlite3VdbeVerifyNoMallocRequired(tls, _v, i32(2))
_165_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(2), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00setCookieØ008)), i32(0))
if func() int32 {
if _165_aOp == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115000), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _64
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 24*uintptr(i32(0)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 24*uintptr(i32(1)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 24*uintptr(i32(1)))).X4))) = _164_iCookie
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_165_aOp)) + 24*uintptr(i32(1)))).X5))) = _sqlite3Atoi(tls, _zRight)
goto _423
_419:
_sqlite3VdbeVerifyNoMallocRequired(tls, _v, i32(3))
_166_aOp = _sqlite3VdbeAddOpList(tls, _v, i32(3), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3PragmaØ00readCookieØ009)), i32(0))
if func() int32 {
if _166_aOp == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115015), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _64
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 24*uintptr(i32(0)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 24*uintptr(i32(1)))).X3))) = _iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_166_aOp)) + 24*uintptr(i32(1)))).X5))) = _164_iCookie
_sqlite3VdbeReusable(tls, _v)
_423:
goto _64
_51:
_167_i = i32(0)
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(1)
_427:
if store0(&_167_zOpt, Xsqlite3_compileoption_get(tls, postInc1(&_167_i, int32(1)))) != nil {
_sqlite3VdbeLoadString(tls, _v, i32(1), _167_zOpt)
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1))
goto _427
}
_sqlite3VdbeReusable(tls, _v)
goto _64
_52:
_169_iBt = func() int32 {
if (_pId2.X0) != nil {
return _iDb
}
return i32(10)
}()
_169_eMode = i32(0)
if _zRight == nil {
goto _431
}
if _sqlite3StrICmp(tls, _zRight, str(121543)) == i32(0) {
_169_eMode = i32(1)
goto _436
}
if _sqlite3StrICmp(tls, _zRight, str(121548)) == i32(0) {
_169_eMode = i32(2)
goto _436
}
if _sqlite3StrICmp(tls, _zRight, str(91181)) == i32(0) {
_169_eMode = i32(3)
}
_436:
_431:
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(3)
_sqlite3VdbeAddOp3(tls, _v, i32(8), _169_iBt, _169_eMode, i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(3))
goto _64
_53:
if _zRight != nil {
Xsqlite3_wal_autocheckpoint(tls, _db, _sqlite3Atoi(tls, _zRight))
}
_returnSingleInt(tls, _v, int64(func() int32 {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
}{(*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
}{(_db.X51)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32
}{_sqlite3WalDefaultHook})) {
return int32(uintptr(_db.X52))
}
return i32(0)
}()))
goto _64
_54:
Xsqlite3_db_release_memory(tls, _db)
goto _64
_55:
if _zRight == nil {
goto _440
}
_177_opMask = uint32(_sqlite3Atoi(tls, _zRight))
if (_177_opMask & uint32(i32(2))) == uint32(i32(0)) {
goto _64
}
goto _442
_440:
_177_opMask = uint32(i32(65534))
_442:
_177_iTabCur = postInc1((*int32)(unsafe.Pointer(&(_pParse.X17))), int32(1))
_177_iDbLast = func() int32 {
if _zDb != nil {
return _iDb
}
return ((_db.X5) - i32(1))
}()
_445:
if _iDb > _177_iDbLast {
goto _448
}
if _iDb == i32(1) {
goto _446
}
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_177_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
_177_k = (*XHashElem)((*XHash)(unsafe.Pointer(&(_177_pSchema.X2))).X2)
_450:
if _177_k == nil {
goto _453
}
_177_pTab = (*XTable)(_177_k.X2)
if ((_177_pTab.X9) & uint32(i32(256))) == uint32(i32(0)) {
goto _451
}
_177_szThreshold = int16(int32(_177_pTab.X12) + i32(46))
func() {
if int32(_sqlite3LogEst(tls, uint64(i32(25)))) != i32(46) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115184), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121556)))
crt.X__builtin_abort(tls)
}
}()
_177_pIdx = (*XIndex)(_177_pTab.X2)
_457:
if _177_pIdx == nil {
goto _460
}
if ((uint32((_177_pIdx.X16)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31))) == 0 {
_177_szThreshold = int16(i32(0))
goto _460
}
_177_pIdx = (*XIndex)(_177_pIdx.X5)
goto _457
_460:
if _177_szThreshold != 0 {
_sqlite3OpenTable(tls, _pParse, _177_iTabCur, _iDb, _177_pTab, i32(106))
_sqlite3VdbeAddOp3(tls, _v, i32(34), _177_iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, _v)+i32(2))+(_177_opMask&uint32(i32(1)))), int32(_177_szThreshold))
}
_177_zSubSql = _sqlite3MPrintf(tls, _db, str(121578), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(_177_pTab.X0))
if (_177_opMask & uint32(i32(1))) != 0 {
_185_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp4(tls, _v, i32(97), i32(0), _185_r1, i32(0), _177_zSubSql, i32(-1))
_sqlite3VdbeAddOp2(tls, _v, i32(67), _185_r1, i32(1))
goto _464
}
_sqlite3VdbeAddOp4(tls, _v, i32(138), i32(0), i32(0), i32(0), _177_zSubSql, i32(-1))
_464:
_451:
_177_k = (*XHashElem)(_177_k.X0)
goto _450
_453:
_446:
_iDb += 1
goto _445
_448:
_sqlite3VdbeAddOp0(tls, _v, i32(153))
goto _64
_56:
func() {
if int32(_pPragma.X1) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(115222), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PragmaØ00__func__Ø000))), unsafe.Pointer(str(121596)))
crt.X__builtin_abort(tls)
}
}()
if _zRight != nil {
Xsqlite3_busy_timeout(tls, _db, _sqlite3Atoi(tls, _zRight))
}
_returnSingleInt(tls, _v, int64(_db.X74))
goto _64
_57:
if (_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_189_N) == i32(0)) {
Xsqlite3_soft_heap_limit64(tls, _189_N)
}
_returnSingleInt(tls, _v, Xsqlite3_soft_heap_limit64(tls, int64(i32(-1))))
goto _64
_58:
if ((_zRight != nil) && (_sqlite3DecOrHexToI64(tls, _zRight, &_191_N) == i32(0))) && (_191_N >= int64(i32(0))) {
Xsqlite3_limit(tls, _db, i32(11), int32(_191_N&int64(i32(2147483647))))
}
_returnSingleInt(tls, _v, int64(Xsqlite3_limit(tls, _db, i32(11), i32(-1))))
goto _64
_59:
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(2)
_193_i = i32(0)
_473:
if _193_i >= (_db.X5) {
goto _476
}
_194_zState = str(121636)
if ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_193_i))).X0) == nil {
goto _474
}
_194_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_193_i))).X1)
if (_194_pBt == nil) || (_sqlite3BtreePager(tls, _194_pBt) == nil) {
_194_zState = str(121644)
goto _483
}
if Xsqlite3_file_control(tls, _db, func() *int8 {
if _193_i != 0 {
return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_193_i))).X0)
}
return nil
}(), i32(1), (unsafe.Pointer)(&_194_j)) == i32(0) {
_194_zState = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3PragmaØ00azLockNameØ0010)) + 4*uintptr(_194_j)))
}
_483:
_sqlite3VdbeMultiLoad(tls, _v, i32(1), str(121651), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_193_i))).X0), unsafe.Pointer(_194_zState))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(2))
_474:
_193_i += 1
goto _473
_476:
goto _64
_64:
if (int32(_pPragma.X2)&i32(4)) != 0 && (_zRight != nil) {
_sqlite3VdbeVerifyNoResultRow(tls, _v)
}
_pragma_out:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zLeft))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zRight))
_ = _aFcntl
_ = _103_azOrigin
_ = _106_i
_ = _167_i
}
// Mark the VDBE as one that can only be run one time.
func _sqlite3VdbeRunOnlyOnce(tls *crt.TLS, _p *TVdbe) {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 32, 5)
}
var _sqlite3PragmaØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PragmaØ00__func__Ø000[0], str(121654), 14)
}
// Invoke the xFileControl method on a particular database.
func Xsqlite3_file_control(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _op int32, _pArg unsafe.Pointer) (r0 int32) {
var _rc int32
var _pBtree *XBtree
var _1_pPager *XPager
var _1_fd *Xsqlite3_file
_rc = i32(1)
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(143986))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pBtree = _sqlite3DbNameToBtree(tls, _db, _zDbName)
if _pBtree == nil {
goto _1
}
_sqlite3BtreeEnter(tls, _pBtree)
_1_pPager = _sqlite3BtreePager(tls, _pBtree)
func() {
if _1_pPager == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143995), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_file_controlØ00__func__Ø000))), unsafe.Pointer(str(15864)))
crt.X__builtin_abort(tls)
}
}()
_1_fd = _sqlite3PagerFile(tls, _1_pPager)
func() {
if _1_fd == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143997), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_file_controlØ00__func__Ø000))), unsafe.Pointer(str(121668)))
crt.X__builtin_abort(tls)
}
}()
if _op == i32(7) {
*(**Xsqlite3_file)(_pArg) = _1_fd
_rc = i32(0)
goto _13
}
if _op == i32(27) {
*(**Xsqlite3_vfs)(_pArg) = _sqlite3PagerVfs(tls, _1_pPager)
_rc = i32(0)
goto _13
}
if _op == i32(28) {
*(**Xsqlite3_file)(_pArg) = _sqlite3PagerJrnlFile(tls, _1_pPager)
_rc = i32(0)
goto _13
}
if (*Xsqlite3_io_methods)(_1_fd.X0) != nil {
_rc = _sqlite3OsFileControl(tls, _1_fd, _op, _pArg)
goto _13
}
_rc = i32(12)
_13:
_sqlite3BtreeLeave(tls, _pBtree)
_1:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// Return the Btree pointer identified by zDbName. Return NULL if not found.
func _sqlite3DbNameToBtree(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *XBtree) {
var _iDb int32
_iDb = func() int32 {
if _zDbName != nil {
return _sqlite3FindDbName(tls, _db, _zDbName)
}
return i32(0)
}()
return func() *XBtree {
if _iDb < i32(0) {
return nil
}
return (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X1)
}()
}
var _sqlite3_file_controlØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_file_controlØ00__func__Ø000[0], str(121674), 21)
}
// Return the file handle for the journal file (if it exists).
// This will be either the rollback journal or the WAL file.
func _sqlite3PagerJrnlFile(tls *crt.TLS, _pPager *XPager) (r0 *Xsqlite3_file) {
return func() *Xsqlite3_file {
if (*XWal)(_pPager.X60) != nil {
return _sqlite3WalFile(tls, (*XWal)(_pPager.X60))
}
return (*Xsqlite3_file)(_pPager.X32)
}()
}
// Return the sqlite3_file object for the WAL file
func _sqlite3WalFile(tls *crt.TLS, _pWal *XWal) (r0 *Xsqlite3_file) {
return (*Xsqlite3_file)(_pWal.X2)
}
// Generate code to return a single text value.
func _returnSingleText(tls *crt.TLS, _v *TVdbe, _zValue *int8) {
if _zValue != nil {
_sqlite3VdbeLoadString(tls, _v, i32(1), _zValue)
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1))
}
}
// Set result column names for a pragma.
func _setPragmaResultColumnNames(tls *crt.TLS, _v *TVdbe, _pPragma *XPragmaName) {
var _2_i, _2_j int32
var _n uint8
_n = _pPragma.X4
_sqlite3VdbeSetNumCols(tls, _v, func() int32 {
if int32(_n) == i32(0) {
return i32(1)
}
return int32(_n)
}())
if int32(_n) == i32(0) {
_sqlite3VdbeSetColName(tls, _v, i32(0), i32(0), _pPragma.X0, nil)
goto _3
}
*func() *int32 { _2_i = i32(0); return &_2_j }() = int32(_pPragma.X3)
_4:
if _2_i >= int32(_n) {
goto _7
}
_sqlite3VdbeSetColName(tls, _v, _2_i, i32(0), *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_pragCName)) + 4*uintptr(_2_j))), nil)
*func() *int32 { _2_i += 1; return &_2_j }() += 1
goto _4
_7:
_3:
}
func _sqlite3VdbeVerifyNoMallocRequired(tls *crt.TLS, _p *TVdbe, _N int32) {
func() {
if ((_p.X27) + _N) > ((*XParse)(_p.X3).X19) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72075), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000))), unsafe.Pointer(str(121695)))
crt.X__builtin_abort(tls)
}
}()
}
var _sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000 [34]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoMallocRequiredØ00__func__Ø000[0], str(121729), 34)
}
var _sqlite3PragmaØ00getCacheSizeØ002 [9]XVdbeOpList
func init() {
_sqlite3PragmaØ00getCacheSizeØ002 = [9]XVdbeOpList{XVdbeOpList{X0: u8(2), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(103), X1: i8(0), X2: i8(1), X3: i8(3)}, XVdbeOpList{X0: u8(46), X1: i8(1), X2: i8(8), X3: i8(0)}, XVdbeOpList{X0: u8(56), X1: i8(0), X2: i8(2), X3: i8(0)}, XVdbeOpList{X0: u8(89), X1: i8(1), X2: i8(2), X3: i8(1)}, XVdbeOpList{X0: u8(46), X1: i8(1), X2: i8(8), X3: i8(0)}, XVdbeOpList{X0: u8(56), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(164), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(67), X1: i8(1), X2: i8(1), X3: i8(0)}}
}
var _sqlite3PragmaØ00iLnØ001 int32
// Generate code to return a single integer value.
func _returnSingleInt(tls *crt.TLS, _v *TVdbe, _value int64) {
_sqlite3VdbeAddOp4Dup8(tls, _v, i32(57), i32(0), i32(1), i32(0), (*uint8)(unsafe.Pointer(&_value)), i32(-10))
_sqlite3VdbeAddOp2(tls, _v, i32(67), i32(1), i32(1))
}
// Set the BTS_SECURE_DELETE flag if newFlag is 0 or 1. If newFlag is -1,
// then make no changes. Always return the value of the BTS_SECURE_DELETE
// setting after the change.
func _sqlite3BtreeSecureDelete(tls *crt.TLS, _p *XBtree, _newFlag int32) (r0 int32) {
var _b int32
if _p == nil {
return i32(0)
}
_sqlite3BtreeEnter(tls, _p)
if _newFlag < i32(0) {
goto _1
}
{
p := (*uint16)(unsafe.Pointer(&((*XBtShared)(_p.X1).X10)))
*p = uint16(int32(*p) & i32(-5))
sink14 = *p
}
if _newFlag != 0 {
{
p := (*uint16)(unsafe.Pointer(&((*XBtShared)(_p.X1).X10)))
*p = uint16(int32(*p) | i32(4))
sink14 = *p
}
}
_1:
_b = bool2int((int32((*XBtShared)(_p.X1).X10) & i32(4)) != i32(0))
_sqlite3BtreeLeave(tls, _p)
return _b
}
// Interpret the given string as a locking mode value.
func _getLockingMode(tls *crt.TLS, _z *int8) (r0 int32) {
if _z == nil {
goto _0
}
if i32(0) == _sqlite3StrICmp(tls, _z, str(91138)) {
return i32(1)
}
if i32(0) == _sqlite3StrICmp(tls, _z, str(91148)) {
return i32(0)
}
_0:
return i32(-1)
}
// Get/set the locking-mode for this pager. Parameter eMode must be one
// of PAGER_LOCKINGMODE_QUERY, PAGER_LOCKINGMODE_NORMAL or
// PAGER_LOCKINGMODE_EXCLUSIVE. If the parameter is not _QUERY, then
// the locking-mode is set to the value specified.
//
// The returned value is either PAGER_LOCKINGMODE_NORMAL or
// PAGER_LOCKINGMODE_EXCLUSIVE, indicating the current (possibly updated)
// locking-mode.
func _sqlite3PagerLockingMode(tls *crt.TLS, _pPager *XPager, _eMode int32) (r0 int32) {
func() {
if _eMode != i32(-1) && _eMode != i32(0) && _eMode != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54047), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000))), unsafe.Pointer(str(121763)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
func() {
if (_pPager.X1) == 0 && i32(0) != _sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(54052), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerLockingModeØ00__func__Ø000))), unsafe.Pointer(str(121867)))
crt.X__builtin_abort(tls)
}
}()
if ((_eMode >= i32(0)) && ((_pPager.X10) == 0)) && (_sqlite3WalHeapMemory(tls, (*XWal)(_pPager.X60)) == 0) {
*(*uint8)(unsafe.Pointer(&(_pPager.X1))) = uint8(_eMode)
}
return int32(_pPager.X1)
}
var _sqlite3PagerLockingModeØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerLockingModeØ00__func__Ø000[0], str(121930), 24)
}
// Return true if the argument is non-NULL and the WAL module is using
// heap-memory for the wal-index. Otherwise, if the argument is NULL or the
// WAL module is using shared-memory, return false.
func _sqlite3WalHeapMemory(tls *crt.TLS, _pWal *XWal) (r0 int32) {
return bool2int((_pWal != nil) && (int32(_pWal.X11) == i32(2)))
}
// Get/set the size-limit used for persistent journal files.
//
// Setting the size limit to -1 means no limit is enforced.
// An attempt to set a limit smaller than -1 is a no-op.
func _sqlite3PagerJournalSizeLimit(tls *crt.TLS, _pPager *XPager, _iLimit int64) (r0 int64) {
if _iLimit >= int64(i32(-1)) {
*(*int64)(unsafe.Pointer(&(_pPager.X50))) = _iLimit
_sqlite3WalLimit(tls, (*XWal)(_pPager.X60), _iLimit)
}
return _pPager.X50
}
// Change the size to which the WAL file is trucated on each reset.
func _sqlite3WalLimit(tls *crt.TLS, _pWal *XWal, _iLimit int64) {
if _pWal != nil {
*(*int64)(unsafe.Pointer(&(_pWal.X4))) = _iLimit
}
}
// Interpret the given string as an auto-vacuum mode value.
//
// The following strings, "none", "full" and "incremental" are
// acceptable, as are their numeric equivalents: 0, 1 and 2 respectively.
func _getAutoVacuum(tls *crt.TLS, _z *int8) (r0 int32) {
var _i int32
if i32(0) == _sqlite3StrICmp(tls, _z, str(42897)) {
return i32(0)
}
if i32(0) == _sqlite3StrICmp(tls, _z, str(121543)) {
return i32(1)
}
if i32(0) == _sqlite3StrICmp(tls, _z, str(121954)) {
return i32(2)
}
_i = _sqlite3Atoi(tls, _z)
return int32(uint8(func() int32 {
if (_i >= i32(0)) && (_i <= i32(2)) {
return _i
}
return i32(0)
}()))
}
var _sqlite3PragmaØ00setMeta6Ø004 [5]XVdbeOpList
func init() {
_sqlite3PragmaØ00setMeta6Ø004 = [5]XVdbeOpList{XVdbeOpList{X0: u8(2), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(103), X1: i8(0), X2: i8(1), X3: i8(4)}, XVdbeOpList{X0: u8(21), X1: i8(1), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(55), X1: i8(0), X2: i8(2), X3: i8(0)}, XVdbeOpList{X0: u8(104), X1: i8(0), X2: i8(7), X3: i8(0)}}
}
var _sqlite3PragmaØ00iLnØ003 int32
func _setAllPagerFlags(tls *crt.TLS, _db *Xsqlite3) {
var _1_n int32
var _1_pDb *XDb
if (_db.X15) == 0 {
goto _0
}
_1_pDb = (*XDb)(_db.X4)
_1_n = _db.X5
i32(0)
i32(0)
i32(0)
i32(0)
func() {
if (int32(_1_pDb.X2) & i32(7)) != int32(_1_pDb.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113447), unsafe.Pointer((*int8)(unsafe.Pointer(&_setAllPagerFlagsØ00__func__Ø000))), unsafe.Pointer(str(121966)))
crt.X__builtin_abort(tls)
}
}()
_3:
if postInc1(&_1_n, int32(-1)) <= i32(0) {
goto _4
}
if (*XBtree)(_1_pDb.X1) != nil {
_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_1_pDb.X1), uint32(int32(_1_pDb.X2)|((_db.X6)&i32(56))))
}
*(*uintptr)(unsafe.Pointer(&_1_pDb)) += uintptr(16)
goto _3
_4:
_0:
_ = _1_n
}
var _setAllPagerFlagsØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_setAllPagerFlagsØ00__func__Ø000[0], str(122030), 17)
}
// Change the limit on the amount of the database file that may be
// memory mapped.
func _sqlite3BtreeSetMmapLimit(tls *crt.TLS, _p *XBtree, _szMmap int64) (r0 int32) {
var _pBt *XBtShared
_pBt = (*XBtShared)(_p.X1)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(61696), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreeSetMmapLimitØ00__func__Ø000))), unsafe.Pointer(str(8984)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnter(tls, _p)
_sqlite3PagerSetMmapLimit(tls, (*XPager)(_pBt.X0), _szMmap)
_sqlite3BtreeLeave(tls, _p)
return i32(0)
}
var _sqlite3BtreeSetMmapLimitØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreeSetMmapLimitØ00__func__Ø000[0], str(122047), 25)
}
// If the TEMP database is open, close it and mark the database schema
// as needing reloading. This must be done when using the SQLITE_TEMP_STORE
// or DEFAULT_TEMP_STORE pragmas.
func _changeTempStorage(tls *crt.TLS, _pParse *XParse, _zStorageType *int8) (r0 int32) {
var _ts int32
var _db *Xsqlite3
_ts = _getTempStore(tls, _zStorageType)
_db = (*Xsqlite3)(_pParse.X0)
if int32(_db.X16) == _ts {
return i32(0)
}
if _invalidateTempStorage(tls, _pParse) != i32(0) {
return i32(1)
}
*(*uint8)(unsafe.Pointer(&(_db.X16))) = uint8(_ts)
return i32(0)
}
// Interpret the given string as a temp db location. Return 1 for file
// backed temporary databases, 2 for the Red-Black tree in memory database
// and 0 to use the compile-time default.
func _getTempStore(tls *crt.TLS, _z *int8) (r0 int32) {
if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) >= i32(48)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) <= i32(50)) {
return int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) - i32(48)
}
if _sqlite3StrICmp(tls, _z, str(61722)) == i32(0) {
return i32(1)
}
if _sqlite3StrICmp(tls, _z, str(91155)) == i32(0) {
return i32(2)
}
return i32(0)
}
// Invalidate temp storage, either when the temp storage is changed
// from default, or when 'file' and the temp_store_directory has changed
func _invalidateTempStorage(tls *crt.TLS, _pParse *XParse) (r0 int32) {
var _db *Xsqlite3
_db = (*Xsqlite3)(_pParse.X0)
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X1) == nil {
goto _0
}
if ((_db.X15) == 0) || _sqlite3BtreeIsInReadTrans(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X1)) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(122072))
return i32(1)
}
_sqlite3BtreeClose(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X1))
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X1))))) = nil
_sqlite3ResetAllSchemasOfConnection(tls, _db)
_0:
return i32(0)
}
var Xsqlite3_temp_directory *int8
// Generate code that initializes multiple registers to string or integer
// constants. The registers begin with iDest and increase consecutively.
// One register is initialized for each characgter in zTypes[]. For each
// "s" character in zTypes[], the register is a string if the argument is
// not NULL, or OP_Null if the value is a null pointer. For each "i" character
// in zTypes[], the register is initialized to an integer.
func _sqlite3VdbeMultiLoad(tls *crt.TLS, _p *TVdbe, _iDest int32, _zTypes *int8, args ...interface{}) {
var _i int32
var _c int8
var _2_z *int8
var _ap []interface{}
_ap = args
_i = i32(0)
_0:
if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zTypes)) + 1*uintptr(_i))))) == i32(0) {
goto _3
}
if int32(_c) == i32(115) {
_2_z = (*int8)(crt.VAPointer(&_ap))
_sqlite3VdbeAddOp4(tls, _p, func() int32 {
if _2_z == nil {
return i32(59)
}
return i32(97)
}(), i32(0), postInc1(&_iDest, int32(1)), i32(0), _2_z, i32(0))
goto _7
}
func() {
if int32(_c) != i32(105) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(71676), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeMultiLoadØ00__func__Ø000))), unsafe.Pointer(str(122134)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp2(tls, _p, i32(56), crt.VAInt32(&_ap), postInc1(&_iDest, int32(1)))
_7:
_i += 1
goto _0
_3:
_ap = nil
}
var _sqlite3VdbeMultiLoadØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeMultiLoadØ00__func__Ø000[0], str(122141), 21)
}
func _actionName(tls *crt.TLS, _action uint8) (r0 *int8) {
var _zName *int8
switch int32(_action) {
case i32(6):
goto _4
case i32(7):
goto _1
case i32(8):
goto _2
case i32(9):
goto _3
default:
goto _5
}
_1:
_zName = str(122162)
goto _6
_2:
_zName = str(122171)
goto _6
_3:
_zName = str(25177)
goto _6
_4:
_zName = str(25330)
goto _6
_5:
_zName = str(122183)
func() {
if int32(_action) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(113474), unsafe.Pointer((*int8)(unsafe.Pointer(&_actionNameØ00__func__Ø000))), unsafe.Pointer(str(122193)))
crt.X__builtin_abort(tls)
}
}()
goto _6
_6:
return _zName
}
var _actionNameØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_actionNameØ00__func__Ø000[0], str(122209), 11)
}
// Turn parser tracing on by giving a stream to which to write the trace
// and a prompt to preface each trace message. Tracing is turned off
// by making either argument NULL
//
// Inputs:
//
// - A FILE* to which trace output should be written.
// If NULL, then tracing is turned off.
//
- A prefix string written at the beginning of every
// line of trace output. If NULL, then tracing is
// turned off.
//
//
// Outputs:
// None.
func _sqlite3ParserTrace(tls *crt.TLS, _TraceFILE *crt.XFILE, _zTracePrompt *int8) {
_yyTraceFILE = _TraceFILE
bug20530(_yyTraceFILE)
_yyTracePrompt = _zTracePrompt
bug20530(_yyTracePrompt)
if _yyTraceFILE == nil {
_yyTracePrompt = nil
bug20530(_yyTracePrompt)
goto _2
}
if _yyTracePrompt == nil {
_yyTraceFILE = nil
bug20530(_yyTraceFILE)
}
_2:
}
// Register the built-in LIKE and GLOB functions. The caseSensitive
// parameter determines whether or not the LIKE operator is case
// sensitive. GLOB is always case sensitive.
func _sqlite3RegisterLikeFunctions(tls *crt.TLS, _db *Xsqlite3, _caseSensitive int32) {
var _pInfo *TcompareInfo
if _caseSensitive != 0 {
_pInfo = &_likeInfoAlt
goto _1
}
_pInfo = &_likeInfoNorm
_1:
_sqlite3CreateFunc(tls, _db, str(7966), i32(2), i32(1), (unsafe.Pointer)(_pInfo), _likeFunc, nil, nil, nil)
_sqlite3CreateFunc(tls, _db, str(7966), i32(3), i32(1), (unsafe.Pointer)(_pInfo), _likeFunc, nil, nil, nil)
_sqlite3CreateFunc(tls, _db, str(7961), i32(2), i32(1), (unsafe.Pointer)(&_globInfo), _likeFunc, nil, nil, nil)
_setLikeOptFlag(tls, _db, str(7961), uint8(i32(12)))
_setLikeOptFlag(tls, _db, str(7966), uint8(func() int32 {
if _caseSensitive != 0 {
return i32(12)
}
return i32(4)
}()))
}
// Implementation of the like() SQL function. This function implements
// the build-in LIKE operator. The first argument to the function is the
// pattern and the second argument is the string. So, the SQL statements:
//
// A LIKE B
//
// is implemented as like(B,A).
//
// This same function (with a different compareInfo structure) computes
// the GLOB operator.
func _likeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nPat int32
var _escape uint32
var _zA, _zB, _2_zEsc *uint8
var _db *Xsqlite3
var _pInfo *TcompareInfo
_db = Xsqlite3_context_db_handle(tls, _context)
_pInfo = (*TcompareInfo)(Xsqlite3_user_data(tls, _context))
_zB = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_zA = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
_nPat = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _nPat > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(8))))) {
Xsqlite3_result_error(tls, _context, str(122220), i32(-1))
return
}
func() {
if _zB != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106383), unsafe.Pointer((*int8)(unsafe.Pointer(&_likeFuncØ00__func__Ø000))), unsafe.Pointer(str(122253)))
crt.X__builtin_abort(tls)
}
}()
if _argc != i32(3) {
goto _3
}
_2_zEsc = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))))
if _2_zEsc == nil {
return
}
if _sqlite3Utf8CharLen(tls, (*int8)(unsafe.Pointer(_2_zEsc)), i32(-1)) != i32(1) {
Xsqlite3_result_error(tls, _context, str(122285), i32(-1))
return
}
_escape = _sqlite3Utf8Read(tls, &_2_zEsc)
goto _6
_3:
_escape = uint32(_pInfo.X2)
_6:
if (_zA != nil) && (_zB != nil) {
Xsqlite3_result_int(tls, _context, bool2int(_patternCompare(tls, _zB, _zA, _pInfo, _escape) == i32(0)))
}
}
// Extract the user data from a sqlite3_context structure and return a
// pointer to it.
func Xsqlite3_user_data(tls *crt.TLS, _p *Xsqlite3_context) (r0 unsafe.Pointer) {
func() {
if _p == nil || (*XFuncDef)(_p.X1) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76799), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_user_dataØ00__func__Ø000))), unsafe.Pointer(str(122330)))
crt.X__builtin_abort(tls)
}
}()
return (*XFuncDef)(_p.X1).X2
}
var _sqlite3_user_dataØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_user_dataØ00__func__Ø000[0], str(122344), 18)
}
var _likeFuncØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_likeFuncØ00__func__Ø000[0], str(122362), 9)
}
func Xsqlite3_result_int(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int32) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76465), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_intØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.X0), int64(_iVal))
}
var _sqlite3_result_intØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_intØ00__func__Ø000[0], str(122371), 19)
}
// Set the LIKEOPT flag on the 2-argument function with the given name.
func _setLikeOptFlag(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _flagVal uint8) {
var _pDef *XFuncDef
_pDef = _sqlite3FindFunction(tls, _db, _zName, i32(2), uint8(i32(1)), uint8(i32(0)))
if func() int32 {
if _pDef != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107216), unsafe.Pointer((*int8)(unsafe.Pointer(&_setLikeOptFlagØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pDef.X1)))
*p = uint16(int32(*p) | int32(_flagVal))
sink14 = *p
}
}
}
var _setLikeOptFlagØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_setLikeOptFlagØ00__func__Ø000[0], str(122390), 15)
}
// Helper subroutine for PRAGMA integrity_check:
//
// Generate code to output a single-column result row with the result
// held in register regResult. Decrement the result count and halt if
// the maximum number of result rows have been issued.
func _integrityCheckResultRow(tls *crt.TLS, _v *TVdbe, _regResult int32) (r0 int32) {
var _addr int32
_sqlite3VdbeAddOp2(tls, _v, i32(67), _regResult, i32(1))
_addr = _sqlite3VdbeAddOp3(tls, _v, i32(46), i32(1), _sqlite3VdbeCurrentAddr(tls, _v)+i32(2), i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(55), i32(0), i32(0))
return _addr
}
func _sqlite3NoTempsInRange(tls *crt.TLS, _pParse *XParse, _iFirst int32, _iLast int32) (r0 int32) {
var _i int32
if (((_pParse.X14) > i32(0)) && (((_pParse.X15) + (_pParse.X14)) < _iLast)) && ((_pParse.X15) >= _iFirst) {
return i32(0)
}
_i = i32(0)
_3:
if _i >= int32(_pParse.X7) {
goto _6
}
if ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(_i)))) >= _iFirst) && ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[8]int32)(unsafe.Pointer(&(_pParse.X49))))) + 4*uintptr(_i)))) <= _iLast) {
return i32(0)
}
_i += 1
goto _3
_6:
return i32(1)
}
var _sqlite3PragmaØ00endCodeØ006 [4]XVdbeOpList
func init() {
_sqlite3PragmaØ00endCodeØ006 = [4]XVdbeOpList{XVdbeOpList{X0: u8(73), X1: i8(1), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(47), X1: i8(1), X2: i8(4), X3: i8(0)}, XVdbeOpList{X0: u8(97), X1: i8(0), X2: i8(3), X3: i8(0)}, XVdbeOpList{X0: u8(67), X1: i8(3), X2: i8(1), X3: i8(0)}}
}
var _sqlite3PragmaØ00iLnØ005 int32
var _sqlite3PragmaØ00encnamesØ007 [9]TEncName
func init() {
_sqlite3PragmaØ00encnamesØ007 = [9]TEncName{TEncName{X0: str(122405), X1: u8(1)}, TEncName{X0: str(122410), X1: u8(1)}, TEncName{X0: str(122416), X1: u8(2)}, TEncName{X0: str(122425), X1: u8(3)}, TEncName{X0: str(122434), X1: u8(2)}, TEncName{X0: str(122442), X1: u8(3)}, TEncName{X0: str(122450), X1: u8(0)}, TEncName{X0: str(122457), X1: u8(0)}, TEncName{}}
}
var _sqlite3PragmaØ00setCookieØ008 [2]XVdbeOpList
func init() {
_sqlite3PragmaØ00setCookieØ008 = [2]XVdbeOpList{XVdbeOpList{X0: u8(2), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(104), X1: i8(0), X2: i8(0), X3: i8(0)}}
}
var _sqlite3PragmaØ00readCookieØ009 [3]XVdbeOpList
func init() {
_sqlite3PragmaØ00readCookieØ009 = [3]XVdbeOpList{XVdbeOpList{X0: u8(2), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(103), X1: i8(0), X2: i8(1), X3: i8(0)}, XVdbeOpList{X0: u8(67), X1: i8(1), X2: i8(1), X3: i8(0)}}
}
// Mark the VDBE as one that can only be run multiple times.
func _sqlite3VdbeReusable(tls *crt.TLS, _p *TVdbe) {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(0)), 32, 5)
}
// Return the N-th compile-time option string. If N is out of range,
// return a NULL pointer.
func Xsqlite3_compileoption_get(tls *crt.TLS, _N int32) (r0 *int8) {
if (_N >= i32(0)) && (_N < i32(6)) {
return *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 4*uintptr(_N)))
}
return nil
}
var _azCompileOpt [6]*int8
func init() {
_azCompileOpt = [6]*int8{str(122463), str(122469), str(122491), str(122517), str(122534), str(122548)}
}
// Configure an sqlite3_wal_hook() callback to automatically checkpoint
// a database after committing a transaction if there are nFrame or
// more frames in the log file. Passing zero or a negative value as the
// nFrame parameter disables automatic checkpoints entirely.
//
// The callback registered by this function replaces any existing callback
// registered using sqlite3_wal_hook(). Likewise, registering a callback
// using sqlite3_wal_hook() disables the automatic checkpoint mechanism
// configured by this function.
func Xsqlite3_wal_autocheckpoint(tls *crt.TLS, _db *Xsqlite3, _nFrame int32) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(142507))
}
if _nFrame > i32(0) {
Xsqlite3_wal_hook(tls, _db, _sqlite3WalDefaultHook, (unsafe.Pointer)(uintptr(_nFrame)))
goto _2
}
Xsqlite3_wal_hook(tls, _db, nil, nil)
_2:
return i32(0)
}
// Register a callback to be invoked each time a transaction is written
// into the write-ahead-log by this database connection.
func Xsqlite3_wal_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32, _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pRet unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142531))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pRet = _db.X52
*(*func(*crt.TLS, unsafe.Pointer, *Xsqlite3, *int8, int32) int32)(unsafe.Pointer((*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&(_db.X51))))) = _xCallback
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X52))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pRet
}
func _sqlite3WalDefaultHook(tls *crt.TLS, _pClientData unsafe.Pointer, _db *Xsqlite3, _zDb *int8, _nFrame int32) (r0 int32) {
if _nFrame >= int32(uintptr(_pClientData)) {
_sqlite3BeginBenignMalloc(tls)
Xsqlite3_wal_checkpoint(tls, _db, _zDb)
_sqlite3EndBenignMalloc(tls)
}
return i32(0)
}
// Checkpoint database zDb. If zDb is NULL, or if the buffer zDb points
// to contains a zero-length string, all attached databases are
// checkpointed.
func Xsqlite3_wal_checkpoint(tls *crt.TLS, _db *Xsqlite3, _zDb *int8) (r0 int32) {
return Xsqlite3_wal_checkpoint_v2(tls, _db, _zDb, i32(0), nil, nil)
}
// Checkpoint database zDb.
func Xsqlite3_wal_checkpoint_v2(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _eMode int32, _pnLog *int32, _pnCkpt *int32) (r0 int32) {
var _rc, _iDb int32
_iDb = i32(10)
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(142563))
}
if _pnLog != nil {
*_pnLog = i32(-1)
}
if _pnCkpt != nil {
*_pnCkpt = i32(-1)
}
i32(0)
i32(0)
i32(0)
i32(0)
if (_eMode < i32(0)) || (_eMode > i32(3)) {
return i32(21)
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if (_zDb != nil) && ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDb)) + 1*uintptr(i32(0))))) != 0) {
_iDb = _sqlite3FindDbName(tls, _db, _zDb)
}
if _iDb < i32(0) {
_rc = i32(1)
_sqlite3ErrorWithMsg(tls, _db, i32(1), str(122561), unsafe.Pointer(_zDb))
goto _8
}
*(*int32)(unsafe.Pointer(&((*t19)(unsafe.Pointer(&(_db.X71))).X2))) = i32(0)
_rc = _sqlite3Checkpoint(tls, _db, _iDb, _eMode, _pnLog, _pnCkpt)
_sqlite3Error(tls, _db, _rc)
_8:
_rc = _sqlite3ApiExit(tls, _db, _rc)
if (_db.X34) == i32(0) {
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(0)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// Free up as much memory as we can from the given database
// connection.
func Xsqlite3_db_release_memory(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _i int32
var _1_pBt *XBtree
var _2_pPager *XPager
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(141206))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_sqlite3BtreeEnterAll(tls, _db)
_i = i32(0)
_1:
if _i >= (_db.X5) {
goto _4
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_pBt != nil {
_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
_sqlite3PagerShrink(tls, _2_pPager)
}
_i += 1
goto _1
_4:
_sqlite3BtreeLeaveAll(tls, _db)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// Free as much memory as possible from the pager.
func _sqlite3PagerShrink(tls *crt.TLS, _pPager *XPager) {
_sqlite3PcacheShrink(tls, (*XPCache)(_pPager.X59))
}
// Free up as much memory as possible from the page cache.
func _sqlite3PcacheShrink(tls *crt.TLS, _pCache *XPCache) {
func() {
if (_pCache.X12) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(44968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PcacheShrinkØ00__func__Ø000))), unsafe.Pointer(str(15958)))
crt.X__builtin_abort(tls)
}
}()
((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X12)(tls, _pCache.X12)
}
var _sqlite3PcacheShrinkØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PcacheShrinkØ00__func__Ø000[0], str(122582), 20)
}
// Set the soft heap-size limit for the library. Passing a zero or
// negative value indicates no limit.
func Xsqlite3_soft_heap_limit64(tls *crt.TLS, _n int64) (r0 int64) {
var _rc int32
var _priorLimit, _excess, _nUsed int64
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return int64(i32(-1))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_mem0.X0))
_priorLimit = _mem0.X1
if _n < int64(i32(0)) {
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
return _priorLimit
}
*(*int64)(unsafe.Pointer(&(_mem0.X1))) = _n
_nUsed = _sqlite3StatusValue(tls, i32(0))
*(*int32)(unsafe.Pointer(&(_mem0.X5))) = bool2int((_n > int64(i32(0))) && (_n <= _nUsed))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_mem0.X0))
_excess = Xsqlite3_memory_used(tls) - _n
if _excess > int64(i32(0)) {
Xsqlite3_release_memory(tls, int32(_excess&int64(i32(2147483647))))
}
return _priorLimit
}
// Return the amount of memory currently checked out.
func Xsqlite3_memory_used(tls *crt.TLS) (r0 int64) {
var _res, _mx int64
Xsqlite3_status64(tls, i32(0), &_res, &_mx, i32(0))
return _res
_ = _mx
panic(0)
}
// Query status information.
func Xsqlite3_status64(tls *crt.TLS, _op int32, _pCurrent *int64, _pHighwater *int64, _resetFlag int32) (r0 int32) {
var _pMutex *Xsqlite3_mutex
if (_op < i32(0)) || (_op >= i32(10)) {
return _sqlite3MisuseError(tls, i32(18616))
}
if (_pCurrent == nil) || (_pHighwater == nil) {
return _sqlite3MisuseError(tls, i32(18619))
}
_pMutex = func() *Xsqlite3_mutex {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_statMutex)) + 1*uintptr(_op)))) != 0 {
return _sqlite3Pcache1Mutex(tls)
}
return _sqlite3MallocMutex(tls)
}()
Xsqlite3_mutex_enter(tls, _pMutex)
*_pCurrent = int64(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op))))
*_pHighwater = int64(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op))))
if _resetFlag != 0 {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X1))))) + 4*uintptr(_op))) = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[10]uint32)(unsafe.Pointer(&(_sqlite3Stat.X0))))) + 4*uintptr(_op)))
}
Xsqlite3_mutex_leave(tls, _pMutex)
return i32(0)
}
// Change the value of a limit. Report the old value.
// If an invalid limit index is supplied, report -1.
// Make no changes but still report the old value if the
// new limit is negative.
//
// A new lower limit does not shrink existing constructs.
// It merely prevents new constructs that exceed the limit
// from forming.
func Xsqlite3_limit(tls *crt.TLS, _db *Xsqlite3, _limitId int32, _newLimit int32) (r0 int32) {
var _oldLimit int32
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142955))
return i32(-1)
}
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(0))))) != i32(1000000000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142965), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122602)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(1))))) != i32(1000000000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142966), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122653)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(2))))) != i32(2000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142967), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122712)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(3))))) != i32(1000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142968), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122763)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(4))))) != i32(500) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142969), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122822)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(5))))) != i32(250000000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142970), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122891)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(6))))) != i32(127) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142971), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(122944)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(7))))) != i32(10) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142972), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123007)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(8))))) != i32(50000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123062)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(9))))) != i32(999) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142975), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123140)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(10))))) != i32(1000) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142976), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123209)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(i32(11))))) != i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(142977), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_limitØ00__func__Ø000))), unsafe.Pointer(str(123274)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
if (_limitId < i32(0)) || (_limitId >= i32(12)) {
return i32(-1)
}
_oldLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(_limitId)))
if _newLimit < i32(0) {
goto _27
}
if _newLimit > (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(_limitId)))) {
_newLimit = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aHardLimit)) + 4*uintptr(_limitId)))
}
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(_limitId))) = _newLimit
_27:
return _oldLimit
}
var _aHardLimit [12]int32
func init() {
_aHardLimit = [12]int32{i32(1000000000), i32(1000000000), i32(2000), i32(1000), i32(500), i32(250000000), i32(127), i32(10), i32(50000), i32(999), i32(1000), i32(8)}
}
var _sqlite3_limitØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_limitØ00__func__Ø000[0], str(123341), 14)
}
var _sqlite3PragmaØ00azLockNameØ0010 [5]*int8
func init() {
_sqlite3PragmaØ00azLockNameØ0010 = [5]*int8{str(123355), str(123364), str(123371), str(123380), str(91138)}
}
func _sqlite3VdbeVerifyNoResultRow(tls *crt.TLS, _p *TVdbe) {
var _i int32
_i = i32(0)
_0:
if _i >= (_p.X27) {
goto _3
}
func() {
if int32((*XVdbeOp)(unsafe.Pointer(uintptr(_p.X17)+24*uintptr(_i))).X0) == i32(67) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(72090), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000))), unsafe.Pointer(str(123388)))
crt.X__builtin_abort(tls)
}
}()
_i += 1
goto _0
_3:
}
var _sqlite3VdbeVerifyNoResultRowØ00__func__Ø000 [29]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VdbeVerifyNoResultRowØ00__func__Ø000[0], str(123419), 29)
}
// This routine is called after all of the trigger actions have been parsed
// in order to complete the process of building the trigger.
func _sqlite3FinishTrigger(tls *crt.TLS, _pParse *XParse, _pStepList *XTriggerStep, _pAll *XToken) {
var _iDb int32
var _zName, _3_z *int8
var _nameToken XToken
var _db *Xsqlite3
var _4_pHash *XHash
var _pTrig, _4_pLink *XTrigger
var _6_pTab *XTable
var _3_v *TVdbe
var _sFix XDbFixer
_pTrig = (*XTrigger)(_pParse.X64)
_db = (*Xsqlite3)(_pParse.X0)
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X64))))) = nil
if func() int32 {
if (_pParse.X16) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122925), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 || (_pTrig == nil) {
goto _triggerfinish_cleanup
}
_zName = _pTrig.X0
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTrig.X6))
*(**XTriggerStep)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrig.X8))))) = _pStepList
_4:
if _pStepList != nil {
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pStepList.X2))))) = _pTrig
_pStepList = (*XTriggerStep)(_pStepList.X8)
goto _4
}
_sqlite3TokenInit(tls, &_nameToken, _pTrig.X0)
_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23834), &_nameToken)
if _sqlite3FixTriggerStep(tls, &_sFix, (*XTriggerStep)(_pTrig.X8)) != 0 || _sqlite3FixExpr(tls, &_sFix, (*XExpr)(_pTrig.X4)) != 0 {
goto _triggerfinish_cleanup
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
goto _8
}
_3_v = _sqlite3GetVdbe(tls, _pParse)
if _3_v == nil {
goto _triggerfinish_cleanup
}
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_3_z = _sqlite3DbStrNDup(tls, _db, _pAll.X0, uint64(_pAll.X1))
_sqlite3NestedParse(tls, _pParse, str(123448), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_zName), unsafe.Pointer(_pTrig.X1), unsafe.Pointer(_3_z))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_z))
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_sqlite3VdbeAddParseSchemaOp(tls, _3_v, _iDb, _sqlite3MPrintf(tls, _db, str(123512), unsafe.Pointer(_zName)))
_8:
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) == 0 {
goto _triggerfinish_cleanup
}
_4_pLink = _pTrig
_4_pHash = (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4).X4)))
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122966), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_pTrig = (*XTrigger)(_sqlite3HashInsert(tls, _4_pHash, _zName, (unsafe.Pointer)(_pTrig)))
if _pTrig != nil {
_sqlite3OomFault(tls, _db)
goto _15
}
if (*XSchema)(_4_pLink.X6) == (*XSchema)(_4_pLink.X7) {
_6_pTab = (*XTable)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)(_4_pLink.X7).X2))), _4_pLink.X1))
func() {
if _6_pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122973), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_4_pLink.X9))))) = (*XTrigger)(_6_pTab.X19)
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_pTab.X19))))) = _4_pLink
}
_15:
_triggerfinish_cleanup:
_sqlite3DeleteTrigger(tls, _db, _pTrig)
func() {
if (*XTrigger)(_pParse.X64) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122981), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3FinishTriggerØ00__func__Ø000))), unsafe.Pointer(str(123541)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3DeleteTriggerStep(tls, _db, _pStepList)
_ = _sFix
_ = _nameToken
}
var _sqlite3FinishTriggerØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3FinishTriggerØ00__func__Ø000[0], str(123562), 21)
}
func _sqlite3FixTriggerStep(tls *crt.TLS, _pFix *XDbFixer, _pStep *XTriggerStep) (r0 int32) {
_0:
if _pStep == nil {
goto _1
}
if _sqlite3FixSelect(tls, _pFix, (*XSelect)(_pStep.X3)) != 0 {
return i32(1)
}
if _sqlite3FixExpr(tls, _pFix, (*XExpr)(_pStep.X5)) != 0 {
return i32(1)
}
if _sqlite3FixExprList(tls, _pFix, (*XExprList)(_pStep.X6)) != 0 {
return i32(1)
}
_pStep = (*XTriggerStep)(_pStep.X8)
goto _0
_1:
return i32(0)
}
// 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 _sqlite3BeginTrigger(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _tr_tm int32, _op int32, _pColumns *XIdList, _pTableName *XSrcList, _pWhen *XExpr, _isTemp int32, _noErr int32) {
var _iDb, _19_iTabDb, _19_code int32
var _zName, _19_zDb, _19_zDbTrig *int8
var _db *Xsqlite3
var _pTrigger *XTrigger
var _pTab *XTable
var _pName *XToken
var _sFix XDbFixer
_pTrigger = nil
_zName = nil
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _pName1 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122744), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123583)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pName2 == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122745), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(111511)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op != i32(108) && _op != i32(110) && _op != i32(109) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122746), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123593)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _op <= i32(0) || _op >= i32(255) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122747), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123641)))
crt.X__builtin_abort(tls)
}
}()
if _isTemp == 0 {
goto _11
}
if (_pName2.X1) > uint32(i32(0)) {
_sqlite3ErrorMsg(tls, _pParse, str(123657))
goto _trigger_cleanup
}
_iDb = i32(1)
_pName = _pName1
goto _13
_11:
_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pName)
if _iDb < i32(0) {
goto _trigger_cleanup
}
_13:
if (_pTableName == nil) || ((_db.X17) != 0) {
goto _trigger_cleanup
}
if (((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0) && (_iDb != i32(1)) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2)))))+68*uintptr(i32(0)))).X1))
*(**int8)(unsafe.Pointer(&((*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2))))) + 68*uintptr(i32(0)))).X1))) = nil
}
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
if (((int32((*t21)(unsafe.Pointer(&(_db.X33))).X2) == i32(0)) && ((_pName2.X1) == uint32(i32(0)))) && (_pTab != nil)) && ((*XSchema)(_pTab.X20) == (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(1)))).X4)) {
_iDb = i32(1)
}
if (_db.X17) != 0 {
goto _trigger_cleanup
}
func() {
if (_pTableName.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122793), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123703)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3FixInit(tls, &_sFix, _pParse, _iDb, str(23834), _pName)
if _sqlite3FixSrcList(tls, &_sFix, _pTableName) != 0 {
goto _trigger_cleanup
}
_pTab = _sqlite3SrcListLookup(tls, _pParse, _pTableName)
if _pTab != nil {
goto _27
}
if int32((*t21)(unsafe.Pointer(&(_db.X33))).X1) == i32(1) {
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_db.X33))).X3))) = uint8(i32(1))
}
goto _trigger_cleanup
_27:
if (_pTab.X16) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(123723))
goto _trigger_cleanup
}
_zName = _sqlite3NameFromToken(tls, _db, _pName)
if (_zName == nil) || (i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName)) {
goto _trigger_cleanup
}
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122825), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X4).X4))), _zName) == nil {
goto _34
}
if _noErr == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(123764), unsafe.Pointer(_pName))
goto _36
}
func() {
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122830), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(112549)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3CodeVerifySchema(tls, _pParse, _iDb)
_36:
goto _trigger_cleanup
_34:
if Xsqlite3_strnicmp(tls, _pTab.X0, str(111644), i32(7)) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(123790))
goto _trigger_cleanup
}
if ((*XSelect)(_pTab.X3) != nil) && (_tr_tm != i32(48)) {
_sqlite3ErrorMsg(tls, _pParse, str(123828), unsafe.Pointer(func() *int8 {
if _tr_tm == i32(34) {
return str(25167)
}
return str(25142)
}()), unsafe.Pointer(_pTableName), i32(0))
goto _trigger_cleanup
}
if ((*XSelect)(_pTab.X3) == nil) && (_tr_tm == i32(48)) {
_sqlite3ErrorMsg(tls, _pParse, str(123865), unsafe.Pointer(_pTableName), i32(0))
goto _trigger_cleanup
}
_19_iTabDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_19_code = i32(7)
_19_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_19_iTabDb))).X0
_19_zDbTrig = func() *int8 {
if _isTemp != 0 {
return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X0)
}
return _19_zDb
}()
if (_19_iTabDb == i32(1)) || _isTemp != 0 {
_19_code = i32(5)
}
if _sqlite3AuthCheck(tls, _pParse, _19_code, _zName, _pTab.X0, _19_zDbTrig) != 0 {
goto _trigger_cleanup
}
if _sqlite3AuthCheck(tls, _pParse, i32(18), func() *int8 {
if i32(1) != 0 && (_19_iTabDb == i32(1)) {
return str(50007)
}
return str(50026)
}(), nil, _19_zDb) != 0 {
goto _trigger_cleanup
}
if _tr_tm == i32(48) {
_tr_tm = i32(34)
}
_pTrigger = (*XTrigger)(_sqlite3DbMallocZero(tls, _db, uint64(u32(36))))
if _pTrigger == nil {
goto _trigger_cleanup
}
*(**int8)(unsafe.Pointer(&(_pTrigger.X0))) = _zName
_zName = nil
*(**int8)(unsafe.Pointer(&(_pTrigger.X1))) = _sqlite3DbStrDup(tls, _db, (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pTableName.X2)))))+68*uintptr(i32(0)))).X2)
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X6))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X7))))) = (*XSchema)(_pTab.X20)
*(*uint8)(unsafe.Pointer(&(_pTrigger.X2))) = uint8(_op)
*(*uint8)(unsafe.Pointer(&(_pTrigger.X3))) = uint8(func() int32 {
if _tr_tm == i32(34) {
return i32(1)
}
return i32(2)
}())
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X4))))) = _sqlite3ExprDup(tls, _db, _pWhen, i32(1))
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTrigger.X5))))) = _sqlite3IdListDup(tls, _db, _pColumns)
func() {
if (*XTrigger)(_pParse.X64) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122893), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(24655)))
crt.X__builtin_abort(tls)
}
}()
*(**XTrigger)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X64))))) = _pTrigger
_trigger_cleanup:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
_sqlite3SrcListDelete(tls, _db, _pTableName)
_sqlite3IdListDelete(tls, _db, _pColumns)
_sqlite3ExprDelete(tls, _db, _pWhen)
if (*XTrigger)(_pParse.X64) == nil {
_sqlite3DeleteTrigger(tls, _db, _pTrigger)
goto _62
}
func() {
if (*XTrigger)(_pParse.X64) != _pTrigger {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122904), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BeginTriggerØ00__func__Ø000))), unsafe.Pointer(str(123911)))
crt.X__builtin_abort(tls)
}
}()
_62:
_ = _sFix
}
var _sqlite3BeginTriggerØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BeginTriggerØ00__func__Ø000[0], str(123941), 20)
}
// Construct a trigger step that implements an UPDATE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees an UPDATE statement inside the body of a CREATE TRIGGER.
func _sqlite3TriggerUpdateStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pEList *XExprList, _pWhere *XExpr, _orconf uint8) (r0 *XTriggerStep) {
var _pTriggerStep *XTriggerStep
_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(110)), _pTableName)
if _pTriggerStep != nil {
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X6))))) = _sqlite3ExprListDup(tls, _db, _pEList, i32(1))
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X5))))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1))
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = _orconf
}
_sqlite3ExprListDelete(tls, _db, _pEList)
_sqlite3ExprDelete(tls, _db, _pWhere)
return _pTriggerStep
}
// Allocate space to hold a new trigger step. The allocated space
// holds both the TriggerStep object and the TriggerStep.target.z string.
//
// If an OOM error occurs, NULL is returned and db->mallocFailed is set.
func _triggerStepAllocate(tls *crt.TLS, _db *Xsqlite3, _op uint8, _pName *XToken) (r0 *XTriggerStep) {
var _1_z *int8
var _pTriggerStep *XTriggerStep
_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, uint64((u32(36)+(_pName.X1))+uint32(i32(1)))))
if _pTriggerStep != nil {
_1_z = (*int8)(unsafe.Pointer((*XTriggerStep)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTriggerStep)) + 36*uintptr(i32(1))))))
crt.Xmemcpy(tls, (unsafe.Pointer)(_1_z), (unsafe.Pointer)(_pName.X0), _pName.X1)
_sqlite3Dequote(tls, _1_z)
*(**int8)(unsafe.Pointer(&(_pTriggerStep.X4))) = _1_z
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X0))) = _op
}
return _pTriggerStep
}
// Build a trigger step out of an INSERT statement. Return a pointer
// to the new trigger step.
//
// The parser calls this routine when it sees an INSERT inside the
// body of a trigger.
func _sqlite3TriggerInsertStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pColumn *XIdList, _pSelect *XSelect, _orconf uint8) (r0 *XTriggerStep) {
var _pTriggerStep *XTriggerStep
func() {
if _pSelect == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123044), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3TriggerInsertStepØ00__func__Ø000))), unsafe.Pointer(str(123961)))
crt.X__builtin_abort(tls)
}
}()
_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(108)), _pTableName)
if _pTriggerStep != nil {
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X3))))) = _sqlite3SelectDup(tls, _db, _pSelect, i32(1))
*(**XIdList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X7))))) = _pColumn
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = _orconf
goto _4
}
_sqlite3IdListDelete(tls, _db, _pColumn)
_4:
_sqlite3SelectDelete(tls, _db, _pSelect)
return _pTriggerStep
}
var _sqlite3TriggerInsertStepØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3TriggerInsertStepØ00__func__Ø000[0], str(123994), 25)
}
// Construct a trigger step that implements a DELETE statement and return
// a pointer to that trigger step. The parser calls this routine when it
// sees a DELETE statement inside the body of a CREATE TRIGGER.
func _sqlite3TriggerDeleteStep(tls *crt.TLS, _db *Xsqlite3, _pTableName *XToken, _pWhere *XExpr) (r0 *XTriggerStep) {
var _pTriggerStep *XTriggerStep
_pTriggerStep = _triggerStepAllocate(tls, _db, uint8(i32(109)), _pTableName)
if _pTriggerStep != nil {
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X5))))) = _sqlite3ExprDup(tls, _db, _pWhere, i32(1))
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = uint8(i32(10))
}
_sqlite3ExprDelete(tls, _db, _pWhere)
return _pTriggerStep
}
// Turn a SELECT statement (that the pSelect parameter points to) into
// a trigger step. Return a pointer to a TriggerStep structure.
//
// The parser calls this routine when it finds a SELECT statement in
// body of a TRIGGER.
func _sqlite3TriggerSelectStep(tls *crt.TLS, _db *Xsqlite3, _pSelect *XSelect) (r0 *XTriggerStep) {
var _pTriggerStep *XTriggerStep
_pTriggerStep = (*XTriggerStep)(_sqlite3DbMallocZero(tls, _db, uint64(u32(36))))
if _pTriggerStep == nil {
_sqlite3SelectDelete(tls, _db, _pSelect)
return nil
}
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X0))) = uint8(i32(119))
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pTriggerStep.X3))))) = _pSelect
*(*uint8)(unsafe.Pointer(&(_pTriggerStep.X1))) = uint8(i32(10))
return _pTriggerStep
}
// 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 _sqlite3DropTrigger(tls *crt.TLS, _pParse *XParse, _pName *XSrcList, _noErr int32) {
var _i, _2_j int32
var _zDb, _zName *int8
var _db *Xsqlite3
var _pTrigger *XTrigger
_pTrigger = nil
_db = (*Xsqlite3)(_pParse.X0)
if (_db.X17) != 0 {
goto _drop_trigger_cleanup
}
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
goto _drop_trigger_cleanup
}
func() {
if (_pName.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123138), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000))), unsafe.Pointer(str(114791)))
crt.X__builtin_abort(tls)
}
}()
_zDb = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2))))) + 68*uintptr(i32(0)))).X1
_zName = (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pName.X2))))) + 68*uintptr(i32(0)))).X2
func() {
if _zDb == nil && _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123141), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000))), unsafe.Pointer(str(59917)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_7:
if _i >= (_db.X5) {
goto _10
}
_2_j = func() int32 {
if _i < i32(2) {
return (_i ^ i32(1))
}
return _i
}()
if (_zDb != nil) && _sqlite3StrICmp(tls, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_2_j))).X0, _zDb) != 0 {
goto _8
}
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _2_j, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(123145), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3DropTriggerØ00__func__Ø000))), unsafe.Pointer(str(59967)))
crt.X__builtin_abort(tls)
}
}()
_pTrigger = (*XTrigger)(_sqlite3HashFind(tls, (*XHash)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_2_j))).X4).X4))), _zName))
if _pTrigger != nil {
goto _10
}
_8:
_i += 1
goto _7
_10:
if _pTrigger != nil {
goto _18
}
if _noErr == 0 {
_sqlite3ErrorMsg(tls, _pParse, str(124019), unsafe.Pointer(_pName), i32(0))
goto _20
}
_sqlite3CodeVerifyNamedSchema(tls, _pParse, _zDb)
_20:
*(*uint8)(unsafe.Pointer(&(_pParse.X5))) = uint8(i32(1))
goto _drop_trigger_cleanup
_18:
_sqlite3DropTriggerPtr(tls, _pParse, _pTrigger)
_drop_trigger_cleanup:
_sqlite3SrcListDelete(tls, _db, _pName)
}
var _sqlite3DropTriggerØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3DropTriggerØ00__func__Ø000[0], str(124039), 19)
}
// Called by the parser to compile an ATTACH statement.
//
// ATTACH p AS pDbname KEY pKey
func _sqlite3Attach(tls *crt.TLS, _pParse *XParse, _p *XExpr, _pDbname *XExpr, _pKey *XExpr) {
_codeAttach(tls, _pParse, i32(24), &_sqlite3AttachØ00attach_funcØ001, _p, _p, _pDbname, _pKey)
}
// This procedure generates VDBE code for a single invocation of either the
// sqlite_detach() or sqlite_attach() SQL user functions.
func _codeAttach(tls *crt.TLS, _pParse *XParse, _type int32, _pFunc *XFuncDef, _pAuthArg *XExpr, _pFilename *XExpr, _pDbname *XExpr, _pKey *XExpr) {
var _rc, _regArgs int32
var _2_zAuthArg *int8
var _db *Xsqlite3
var _v *TVdbe
var _sName XNameContext
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X16) != 0 {
goto _attach_end
}
crt.Xmemset(tls, (unsafe.Pointer)(&_sName), i32(0), u32(32))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_sName.X0))))) = _pParse
if ((i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pFilename))) || (i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pDbname)))) || (i32(0) != store1(&_rc, _resolveAttachExpr(tls, &_sName, _pKey))) {
goto _attach_end
}
if _pAuthArg == nil {
goto _4
}
if int32(_pAuthArg.X0) == i32(97) {
_2_zAuthArg = *(**int8)(unsafe.Pointer((*t27)(unsafe.Pointer(&(_pAuthArg.X3)))))
goto _6
}
_2_zAuthArg = nil
_6:
_rc = _sqlite3AuthCheck(tls, _pParse, _type, _2_zAuthArg, nil, nil)
if _rc != i32(0) {
goto _attach_end
}
_4:
_v = _sqlite3GetVdbe(tls, _pParse)
_regArgs = _sqlite3GetTempRange(tls, _pParse, i32(4))
_sqlite3ExprCode(tls, _pParse, _pFilename, _regArgs)
_sqlite3ExprCode(tls, _pParse, _pDbname, _regArgs+i32(1))
_sqlite3ExprCode(tls, _pParse, _pKey, _regArgs+i32(2))
func() {
if _v == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99197), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAttachØ00__func__Ø000))), unsafe.Pointer(str(124058)))
crt.X__builtin_abort(tls)
}
}()
if _v != nil {
_sqlite3VdbeAddOp4(tls, _v, i32(69), i32(0), (_regArgs+i32(3))-int32(_pFunc.X0), _regArgs+i32(3), (*int8)(unsafe.Pointer(_pFunc)), i32(-4))
func() {
if int32(_pFunc.X0) != i32(-1) && (int32(_pFunc.X0)&i32(255)) != int32(_pFunc.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99201), unsafe.Pointer((*int8)(unsafe.Pointer(&_codeAttachØ00__func__Ø000))), unsafe.Pointer(str(124080)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeChangeP5(tls, _v, uint16(uint8(_pFunc.X0)))
_sqlite3VdbeAddOp1(tls, _v, i32(153), bool2int(_type == i32(24)))
}
_attach_end:
_sqlite3ExprDelete(tls, _db, _pFilename)
_sqlite3ExprDelete(tls, _db, _pDbname)
_sqlite3ExprDelete(tls, _db, _pKey)
_ = _sName
}
// Resolve an expression that was part of an ATTACH or DETACH statement. This
// is slightly different from resolving a normal SQL expression, because simple
// identifiers are treated as strings, not possible column names or aliases.
//
// i.e. if the parser sees:
//
// ATTACH DATABASE abc AS def
//
// it treats the two expressions as literal strings 'abc' and 'def' instead of
// looking for columns of the same name.
//
// This only applies to the root node of pExpr, so the statement:
//
// ATTACH DATABASE abc||def AS 'db2'
//
// will fail because neither abc or def can be resolved.
func _resolveAttachExpr(tls *crt.TLS, _pName *XNameContext, _pExpr *XExpr) (r0 int32) {
var _rc int32
_rc = i32(0)
if _pExpr == nil {
goto _0
}
if int32(_pExpr.X0) != i32(27) {
_rc = _sqlite3ResolveExprNames(tls, _pName, _pExpr)
goto _2
}
*(*uint8)(unsafe.Pointer(&(_pExpr.X0))) = uint8(i32(97))
_2:
_0:
return _rc
}
var _codeAttachØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_codeAttachØ00__func__Ø000[0], str(124131), 11)
}
var _sqlite3AttachØ00attach_funcØ001 XFuncDef
func init() {
_sqlite3AttachØ00attach_funcØ001 = XFuncDef{X0: i8(3), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_attachFunc})), X5: nil, X6: str(124142), X7: t12{}}
}
// An SQL user-function registered to do the work of an ATTACH statement. The
// three arguments to the function come directly from an attach statement:
//
// ATTACH DATABASE x AS y KEY z
//
// SELECT sqlite_attach(x, y, z)
//
// If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the
// third argument.
func _attachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _i, _rc, _14_iDb int32
var _flags uint32
var _zName, _zFile, _zPath, _zErr, _zErrDyn, _3_z *int8
var _db *Xsqlite3
var _aNew *XDb
var _9_pPager *XPager
var _pVfs *Xsqlite3_vfs
_rc = i32(0)
_db = Xsqlite3_context_db_handle(tls, _context)
_zPath = nil
_zErr = nil
_zErrDyn = nil
_zFile = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))))
if _zFile == nil {
_zFile = str(0)
}
if _zName == nil {
_zName = str(0)
}
if (_db.X5) >= ((*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(7))))) + i32(2)) {
_zErrDyn = _sqlite3MPrintf(tls, _db, str(124156), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(7)))))
goto _attach_error
}
if (_db.X15) == 0 {
_zErrDyn = _sqlite3MPrintf(tls, _db, str(124193))
goto _attach_error
}
_i = i32(0)
_4:
if _i >= (_db.X5) {
goto _7
}
_3_z = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X0
func() {
if _3_z == nil || _zName == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98935), unsafe.Pointer((*int8)(unsafe.Pointer(&_attachFuncØ00__func__Ø000))), unsafe.Pointer(str(124235)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3StrICmp(tls, _3_z, _zName) == i32(0) {
_zErrDyn = _sqlite3MPrintf(tls, _db, str(124246), unsafe.Pointer(_zName))
goto _attach_error
}
_i += 1
goto _4
_7:
if (*XDb)(_db.X4) != (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72))))) {
goto _12
}
_aNew = (*XDb)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(48))))
if _aNew == nil {
return
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_aNew), _db.X4, u32(32))
goto _14
_12:
_aNew = (*XDb)(_sqlite3DbRealloc(tls, _db, _db.X4, uint64(u32(16)*uint32((_db.X5)+i32(1)))))
if _aNew == nil {
return
}
_14:
*(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = _aNew
_aNew = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_db.X5)))
crt.Xmemset(tls, (unsafe.Pointer)(_aNew), i32(0), u32(16))
_flags = _db.X9
_rc = _sqlite3ParseUri(tls, (*Xsqlite3_vfs)(_db.X0).X4, _zFile, &_flags, &_pVfs, &_zPath, &_zErr)
if _rc == i32(0) {
goto _16
}
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
Xsqlite3_result_error(tls, _context, _zErr, i32(-1))
Xsqlite3_free(tls, (unsafe.Pointer)(_zErr))
return
_16:
func() {
if _pVfs == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98969), unsafe.Pointer((*int8)(unsafe.Pointer(&_attachFuncØ00__func__Ø000))), unsafe.Pointer(str(124276)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_flags
*p = (*p) | uint32(i32(256))
sink5 = *p
}
_rc = _sqlite3BtreeOpen(tls, _pVfs, _zPath, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_aNew.X1))))), i32(0), int32(_flags))
Xsqlite3_free(tls, (unsafe.Pointer)(_zPath))
*(*int32)(unsafe.Pointer(&(_db.X5))) += 1
*(*uint8)(unsafe.Pointer(&(_db.X25))) = uint8(i32(0))
if _rc == i32(19) {
_rc = i32(1)
_zErrDyn = _sqlite3MPrintf(tls, _db, str(124281))
goto _22
}
if _rc != i32(0) {
goto _22
}
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_aNew.X4))))) = _sqlite3SchemaGet(tls, _db, (*XBtree)(_aNew.X1))
if (*XSchema)(_aNew.X4) == nil {
_rc = _sqlite3NomemError(tls, i32(98982))
goto _26
}
if (((*XSchema)(_aNew.X4).X7) != 0) && (int32((*XSchema)(_aNew.X4).X8) != int32(_db.X14)) {
_zErrDyn = _sqlite3MPrintf(tls, _db, str(50118))
_rc = i32(1)
}
_26:
_sqlite3BtreeEnter(tls, (*XBtree)(_aNew.X1))
_9_pPager = _sqlite3BtreePager(tls, (*XBtree)(_aNew.X1))
_sqlite3PagerLockingMode(tls, _9_pPager, int32(_db.X19))
_sqlite3BtreeSecureDelete(tls, (*XBtree)(_aNew.X1), _sqlite3BtreeSecureDelete(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1), i32(-1)))
_sqlite3BtreeSetPagerFlags(tls, (*XBtree)(_aNew.X1), uint32(i32(3)|((_db.X6)&i32(56))))
_sqlite3BtreeLeave(tls, (*XBtree)(_aNew.X1))
_22:
*(*uint8)(unsafe.Pointer(&(_aNew.X2))) = uint8(i32(3))
*(**int8)(unsafe.Pointer(&(_aNew.X0))) = _sqlite3DbStrDup(tls, _db, _zName)
if (_rc == i32(0)) && ((_aNew.X0) == nil) {
_rc = _sqlite3NomemError(tls, i32(99002))
}
if _rc == i32(0) {
_sqlite3BtreeEnterAll(tls, _db)
_rc = _sqlite3Init(tls, _db, &_zErrDyn)
_sqlite3BtreeLeaveAll(tls, _db)
}
if _rc == 0 {
goto _30
}
_14_iDb = (_db.X5) - i32(1)
func() {
if _14_iDb < i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(99059), unsafe.Pointer((*int8)(unsafe.Pointer(&_attachFuncØ00__func__Ø000))), unsafe.Pointer(str(124310)))
crt.X__builtin_abort(tls)
}
}()
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_14_iDb))).X1) != nil {
_sqlite3BtreeClose(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_14_iDb))).X1))
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_14_iDb))).X1))))) = nil
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_14_iDb))).X4))))) = nil
}
_sqlite3ResetAllSchemasOfConnection(tls, _db)
*(*int32)(unsafe.Pointer(&(_db.X5))) = _14_iDb
if (_rc == i32(7)) || (_rc == i32(3082)) {
_sqlite3OomFault(tls, _db)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrDyn))
_zErrDyn = _sqlite3MPrintf(tls, _db, str(59419))
goto _37
}
if _zErrDyn == nil {
_zErrDyn = _sqlite3MPrintf(tls, _db, str(124317), unsafe.Pointer(_zFile))
}
_37:
goto _attach_error
_30:
return
_attach_error:
if _zErrDyn != nil {
Xsqlite3_result_error(tls, _context, _zErrDyn, i32(-1))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrDyn))
}
if _rc != 0 {
Xsqlite3_result_error_code(tls, _context, _rc)
}
}
var _attachFuncØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_attachFuncØ00__func__Ø000[0], str(124345), 11)
}
// This function is used to parse both URIs and non-URI filenames passed by the
// user to API functions sqlite3_open() or sqlite3_open_v2(), and for database
// URIs specified as part of ATTACH statements.
//
// The first argument to this function is the name of the VFS to use (or
// a NULL to signify the default VFS) if the URI does not contain a "vfs=xxx"
// query parameter. The second argument contains the URI (or non-URI filename)
// itself. When this function is called the *pFlags variable should contain
// the default flags to open the database handle with. The value stored in
// *pFlags may be updated before returning if the URI filename contains
// "cache=xxx" or "mode=xxx" query parameters.
//
// If successful, SQLITE_OK is returned. In this case *ppVfs is set to point to
// the VFS that should be used to open the database file. *pzFile is set to
// point to a buffer containing the name of the file to open. It is the
// responsibility of the caller to eventually call sqlite3_free() to release
// this buffer.
//
// If an error occurs, then an SQLite error code is returned and *pzErrMsg
// may be set to point to a buffer containing an English language error
// message. It is the responsibility of the caller to eventually release
// this buffer by calling sqlite3_free().
func _sqlite3ParseUri(tls *crt.TLS, _zDefaultVfs *int8, _zUri *int8, _pFlags *uint32, _ppVfs **Xsqlite3_vfs, _pzFile **int8, _pzErrMsg **int8) (r0 int32) {
var _rc, _nUri, _1_eState, _1_iIn, _1_iOut, _5_octet, _13_nOpt, _13_nVal, _15_mask, _15_limit, _18_i, _18_mode int32
var _c int8
var _flags uint32
var _1_nByte uint64
var _zVfs, _zFile, _1_zOpt, _13_zVal, _15_zModeType, _19_z *int8
var _15_aMode *TIdList_item
_rc = i32(0)
_flags = *_pFlags
_zVfs = _zDefaultVfs
_nUri = _sqlite3Strlen30(tls, _zUri)
func() {
if (*_pzErrMsg) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143033), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000))), unsafe.Pointer(str(124356)))
crt.X__builtin_abort(tls)
}
}()
if (_flags&uint32(i32(64))) == 0 && (_sqlite3Config.X3) == 0 || _nUri < i32(5) || crt.Xmemcmp(tls, (unsafe.Pointer)(_zUri), (unsafe.Pointer)(str(124369)), uint32(i32(5))) != i32(0) {
goto _5
}
_1_iOut = i32(0)
_1_nByte = uint64(_nUri + i32(2))
{
p := &_flags
*p = (*p) | uint32(i32(64))
sink5 = *p
}
_1_iIn = i32(0)
_6:
if _1_iIn >= _nUri {
goto _9
}
{
p := &_1_nByte
*p = (*p) + uint64(bool2int(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) == i32(38)))
sink17 = *p
}
_1_iIn += 1
goto _6
_9:
_zFile = (*int8)(Xsqlite3_malloc64(tls, _1_nByte))
if _zFile == nil {
return _sqlite3NomemError(tls, i32(143051))
}
_1_iIn = i32(5)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(i32(5))))) != i32(47) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(i32(6))))) != i32(47) {
goto _12
}
_1_iIn = i32(7)
_13:
if ((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != i32(47)) {
_1_iIn += 1
goto _13
}
if (_1_iIn != i32(7)) && ((_1_iIn != i32(16)) || crt.Xmemcmp(tls, (unsafe.Pointer)(str(124375)), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri))+1*uintptr(i32(7))))), uint32(i32(9))) != 0) {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(124385), _1_iIn-i32(7), unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri))+1*uintptr(i32(7))))))
_rc = i32(1)
goto _parse_uri_out
}
_12:
_1_eState = i32(0)
_19:
if int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))) == i32(0) || int32(_c) == i32(35) {
goto _20
}
_1_iIn += 1
if int32(_c) != i32(37) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))))))&i32(8)) == 0 || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn+i32(1)))))))))&i32(8)) == 0 {
goto _24
}
_5_octet = int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(postInc1(&_1_iIn, int32(1)))))))) << uint(i32(4))
{
p := &_5_octet
*p = (*p) + int32(_sqlite3HexToInt(tls, int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(postInc1(&_1_iIn, int32(1))))))))
sink1 = *p
}
func() {
if _5_octet < i32(0) || _5_octet >= i32(256) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143100), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ParseUriØ00__func__Ø000))), unsafe.Pointer(str(124413)))
crt.X__builtin_abort(tls)
}
}()
if _5_octet != i32(0) {
goto _28
}
_29:
if ((((int32(store3(&_c, *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn))))) != i32(0)) && (int32(_c) != i32(35))) && ((_1_eState != i32(0)) || (int32(_c) != i32(63)))) && ((_1_eState != i32(1)) || ((int32(_c) != i32(61)) && (int32(_c) != i32(38))))) && ((_1_eState != i32(2)) || (int32(_c) != i32(38))) {
_1_iIn += 1
goto _29
}
goto _19
_28:
_c = int8(_5_octet)
goto _54
_24:
if _1_eState != i32(1) || int32(_c) != i32(38) && int32(_c) != i32(61) {
goto _42
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_1_iOut-i32(1))))) != i32(0) {
goto _43
}
_44:
if (((*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != 0) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn)))) != i32(35))) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zUri)) + 1*uintptr(_1_iIn-i32(1))))) != i32(38)) {
_1_iIn += 1
goto _44
}
goto _19
_43:
if int32(_c) == i32(38) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0))
goto _49
}
_1_eState = i32(2)
_49:
_c = int8(i32(0))
goto _54
_42:
if ((_1_eState == i32(0)) && (int32(_c) == i32(63))) || ((_1_eState == i32(2)) && (int32(_c) == i32(38))) {
_c = int8(i32(0))
_1_eState = i32(1)
}
_54:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = _c
goto _19
_20:
if _1_eState == i32(1) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(postInc1(&_1_iOut, int32(1))))) = int8(i32(0))
_1_zOpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_sqlite3Strlen30(tls, _zFile)+i32(1))))
_56:
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zOpt)) + 1*uintptr(i32(0))))) == 0 {
goto _57
}
_13_nOpt = _sqlite3Strlen30(tls, _1_zOpt)
_13_zVal = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_zOpt)) + 1*uintptr(_13_nOpt+i32(1))))
_13_nVal = _sqlite3Strlen30(tls, _13_zVal)
if (_13_nOpt == i32(3)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124435)), (unsafe.Pointer)(_1_zOpt), uint32(i32(3))) == i32(0)) {
_zVfs = _13_zVal
goto _60
}
_15_aMode = nil
_15_zModeType = nil
_15_mask = i32(0)
_15_limit = i32(0)
if (_13_nOpt == i32(5)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124439)), (unsafe.Pointer)(_1_zOpt), uint32(i32(5))) == i32(0)) {
_15_mask = i32(393216)
_15_aMode = (*TIdList_item)(unsafe.Pointer(&_sqlite3ParseUriØ00aCacheModeØ001))
_15_limit = _15_mask
_15_zModeType = str(124439)
}
if (_13_nOpt == i32(4)) && (crt.Xmemcmp(tls, (unsafe.Pointer)(str(124445)), (unsafe.Pointer)(_1_zOpt), uint32(i32(4))) == i32(0)) {
_15_mask = i32(135)
_15_aMode = (*TIdList_item)(unsafe.Pointer(&_sqlite3ParseUriØ00aOpenModeØ002))
_15_limit = int32(uint32(_15_mask) & _flags)
_15_zModeType = str(124450)
}
if _15_aMode == nil {
goto _65
}
_18_mode = i32(0)
_18_i = i32(0)
_66:
if ((*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 8*uintptr(_18_i))).X0) == nil {
goto _69
}
_19_z = (*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 8*uintptr(_18_i))).X0
if (_13_nVal == _sqlite3Strlen30(tls, _19_z)) && (i32(0) == crt.Xmemcmp(tls, (unsafe.Pointer)(_13_zVal), (unsafe.Pointer)(_19_z), uint32(_13_nVal))) {
_18_mode = (*TIdList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)(_15_aMode)) + 8*uintptr(_18_i))).X1
goto _69
}
_18_i += 1
goto _66
_69:
if _18_mode == i32(0) {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(124457), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
_rc = i32(1)
goto _parse_uri_out
}
if (_18_mode & i32(-129)) > _15_limit {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(124477), unsafe.Pointer(_15_zModeType), unsafe.Pointer(_13_zVal))
_rc = i32(3)
goto _parse_uri_out
}
_flags = (_flags & uint32(^_15_mask)) | uint32(_18_mode)
_65:
_60:
_1_zOpt = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_13_zVal)) + 1*uintptr(_13_nVal+i32(1))))
goto _56
_57:
goto _74
_5:
_zFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_nUri+i32(2))))
if _zFile == nil {
return _sqlite3NomemError(tls, i32(143224))
}
if _nUri != 0 {
crt.Xmemcpy(tls, (unsafe.Pointer)(_zFile), (unsafe.Pointer)(_zUri), uint32(_nUri))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_nUri))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFile)) + 1*uintptr(_nUri+i32(1)))) = int8(i32(0))
{
p := &_flags
*p = (*p) & uint32(i32(-65))
sink5 = *p
}
_74:
*_ppVfs = Xsqlite3_vfs_find(tls, _zVfs)
if (*_ppVfs) == nil {
*_pzErrMsg = Xsqlite3_mprintf(tls, str(124501), unsafe.Pointer(_zVfs))
_rc = i32(1)
}
_parse_uri_out:
if _rc != i32(0) {
Xsqlite3_free(tls, (unsafe.Pointer)(_zFile))
_zFile = nil
}
*_pFlags = _flags
*_pzFile = _zFile
return _rc
}
var _sqlite3ParseUriØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ParseUriØ00__func__Ø000[0], str(124517), 16)
}
var _sqlite3ParseUriØ00aCacheModeØ001 [3]TIdList_item
func init() {
_sqlite3ParseUriØ00aCacheModeØ001 = [3]TIdList_item{TIdList_item{X0: str(123364), X1: i32(131072)}, TIdList_item{X0: str(124533), X1: i32(262144)}, TIdList_item{}}
}
var _sqlite3ParseUriØ00aOpenModeØ002 [5]TIdList_item
func init() {
_sqlite3ParseUriØ00aOpenModeØ002 = [5]TIdList_item{TIdList_item{X0: str(124541), X1: i32(1)}, TIdList_item{X0: str(124544), X1: i32(2)}, TIdList_item{X0: str(124547), X1: i32(6)}, TIdList_item{X0: str(91155), X1: i32(128)}, TIdList_item{}}
}
// Find and return the schema associated with a BTree. Create
// a new one if necessary.
func _sqlite3SchemaGet(tls *crt.TLS, _db *Xsqlite3, _pBt *XBtree) (r0 *XSchema) {
var _p *XSchema
if _pBt != nil {
_p = (*XSchema)(_sqlite3BtreeSchema(tls, _pBt, int32(u32(84)), _sqlite3SchemaClear))
goto _1
}
_p = (*XSchema)(_sqlite3DbMallocZero(tls, nil, uint64(u32(84))))
_1:
if _p == nil {
_sqlite3OomFault(tls, _db)
goto _4
}
if i32(0) == int32(_p.X7) {
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X2))))
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X3))))
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X4))))
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_p.X5))))
*(*uint8)(unsafe.Pointer(&(_p.X8))) = uint8(i32(1))
}
_4:
return _p
}
func Xsqlite3_result_error_code(tls *crt.TLS, _pCtx *Xsqlite3_context, _errCode int32) {
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = _errCode
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
if (*TVdbe)(_pCtx.X3) != nil {
*(*int32)(unsafe.Pointer(&((*TVdbe)(_pCtx.X3).X28))) = _errCode
}
if (int32((*XMem)(_pCtx.X0).X1) & i32(1)) != 0 {
_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), _sqlite3ErrStr(tls, _errCode), i32(-1), uint8(i32(1)), nil)
}
}
// Called by the parser to compile a DETACH statement.
//
// DETACH pDbname
func _sqlite3Detach(tls *crt.TLS, _pParse *XParse, _pDbname *XExpr) {
_codeAttach(tls, _pParse, i32(25), &_sqlite3DetachØ00detach_funcØ001, _pDbname, nil, nil, _pDbname)
}
var _sqlite3DetachØ00detach_funcØ001 XFuncDef
func init() {
_sqlite3DetachØ00detach_funcØ001 = XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_detachFunc})), X5: nil, X6: str(124551), X7: t12{}}
}
// An SQL user-function registered to do the work of an DETACH statement. The
// three arguments to the function come directly from a detach statement:
//
// DETACH DATABASE x
//
// SELECT sqlite_detach(x)
func _detachFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _i int32
var _zName *int8
var _db *Xsqlite3
var _pDb *XDb
var _zErr [128]int8
_zName = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_db = Xsqlite3_context_db_handle(tls, _context)
_pDb = nil
if _zName == nil {
_zName = str(0)
}
_i = i32(0)
_1:
if _i >= (_db.X5) {
goto _4
}
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i)))
if (*XBtree)(_pDb.X1) == nil {
goto _2
}
if _sqlite3StrICmp(tls, _pDb.X0, _zName) == i32(0) {
goto _4
}
_2:
_i += 1
goto _1
_4:
if _i >= (_db.X5) {
Xsqlite3_snprintf(tls, int32(u32(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124565), unsafe.Pointer(_zName))
goto _detach_error
}
if _i < i32(2) {
Xsqlite3_snprintf(tls, int32(u32(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124586), unsafe.Pointer(_zName))
goto _detach_error
}
if (_db.X15) == 0 {
Xsqlite3_snprintf(tls, int32(u32(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124612))
goto _detach_error
}
if _sqlite3BtreeIsInReadTrans(tls, (*XBtree)(_pDb.X1)) != 0 || _sqlite3BtreeIsInBackup(tls, (*XBtree)(_pDb.X1)) != 0 {
Xsqlite3_snprintf(tls, int32(u32(128)), (*int8)(unsafe.Pointer(&_zErr)), str(124654), unsafe.Pointer(_zName))
goto _detach_error
}
_sqlite3BtreeClose(tls, (*XBtree)(_pDb.X1))
*(**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X1))))) = nil
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDb.X4))))) = nil
_sqlite3CollapseDatabaseArray(tls, _db)
return
_detach_error:
Xsqlite3_result_error(tls, _context, (*int8)(unsafe.Pointer(&_zErr)), i32(-1))
_ = _zErr
}
func _sqlite3Reindex(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
var _iDb int32
var _z, _zDb, _3_zColl *int8
var _db *Xsqlite3
var _pTab *XTable
var _pObjName *XToken
var _pIndex *XIndex
var _pColl *XCollSeq
_db = (*Xsqlite3)(_pParse.X0)
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
return
}
if _pName1 == nil {
_reindexDatabases(tls, _pParse, nil)
return
}
if func() int32 {
if _pName2 == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104007), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() == 0 && (_pName2.X0) != nil {
goto _6
}
func() {
if (_pName1.X0) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104009), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3ReindexØ00__func__Ø000))), unsafe.Pointer(str(124676)))
crt.X__builtin_abort(tls)
}
}()
_3_zColl = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pName1)
if _3_zColl == nil {
return
}
_pColl = _sqlite3FindCollSeq(tls, _db, _db.X14, _3_zColl, i32(0))
if _pColl != nil {
_reindexDatabases(tls, _pParse, _3_zColl)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zColl))
return
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_3_zColl))
_6:
_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pObjName)
if _iDb < i32(0) {
return
}
_z = _sqlite3NameFromToken(tls, _db, _pObjName)
if _z == nil {
return
}
_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_pTab = _sqlite3FindTable(tls, _db, _z, _zDb)
if _pTab != nil {
_reindexTable(tls, _pParse, _pTab, nil)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
return
}
_pIndex = _sqlite3FindIndex(tls, _db, _z, _zDb)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
if _pIndex != nil {
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_sqlite3RefillIndex(tls, _pParse, _pIndex, i32(-1))
return
}
_sqlite3ErrorMsg(tls, _pParse, str(124686))
}
func _reindexDatabases(tls *crt.TLS, _pParse *XParse, _zColl *int8) {
var _iDb int32
var _db *Xsqlite3
var _pDb *XDb
var _k *XHashElem
var _pTab *XTable
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103963), unsafe.Pointer((*int8)(unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
*func() **XDb { _iDb = i32(0); return &_pDb }() = (*XDb)(_db.X4)
_2:
if _iDb >= (_db.X5) {
goto _5
}
func() {
if _pDb == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103965), unsafe.Pointer((*int8)(unsafe.Pointer(&_reindexDatabasesØ00__func__Ø000))), unsafe.Pointer(str(124732)))
crt.X__builtin_abort(tls)
}
}()
_k = (*XHashElem)((*XHash)(unsafe.Pointer(&((*XSchema)(_pDb.X4).X2))).X2)
_8:
if _k == nil {
goto _11
}
_pTab = (*XTable)(_k.X2)
_reindexTable(tls, _pParse, _pTab, _zColl)
_k = (*XHashElem)(_k.X0)
goto _8
_11:
*(*uintptr)(unsafe.Pointer(func() **XDb { _iDb += 1; return &_pDb }())) += uintptr(16)
goto _2
_5:
}
var _reindexDatabasesØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_reindexDatabasesØ00__func__Ø000[0], str(124739), 17)
}
func _reindexTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zColl *int8) {
var _2_iDb int32
var _pIndex *XIndex
_pIndex = (*XIndex)(_pTab.X2)
_0:
if _pIndex == nil {
goto _3
}
if (_zColl == nil) || _collationMatch(tls, _zColl, _pIndex) != 0 {
_2_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _2_iDb)
_sqlite3RefillIndex(tls, _pParse, _pIndex, i32(-1))
}
_pIndex = (*XIndex)(_pIndex.X5)
goto _0
_3:
}
func _collationMatch(tls *crt.TLS, _zColl *int8, _pIndex *XIndex) (r0 int32) {
var _i int32
var _1_z *int8
func() {
if _zColl == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103920), unsafe.Pointer((*int8)(unsafe.Pointer(&_collationMatchØ00__func__Ø000))), unsafe.Pointer(str(124756)))
crt.X__builtin_abort(tls)
}
}()
_i = i32(0)
_2:
if _i >= int32(_pIndex.X14) {
goto _5
}
_1_z = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X8)) + 4*uintptr(_i)))
func() {
if _1_z == nil && int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(103923), unsafe.Pointer((*int8)(unsafe.Pointer(&_collationMatchØ00__func__Ø000))), unsafe.Pointer(str(124765)))
crt.X__builtin_abort(tls)
}
}()
if (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIndex.X1)) + 2*uintptr(_i)))) >= i32(0)) && (i32(0) == _sqlite3StrICmp(tls, _1_z, _zColl)) {
return i32(1)
}
_i += 1
goto _2
_5:
return i32(0)
}
var _collationMatchØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_collationMatchØ00__func__Ø000[0], str(124795), 15)
}
var _sqlite3ReindexØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3ReindexØ00__func__Ø000[0], str(124810), 15)
}
// Generate code for the ANALYZE command. The parser calls this routine
// when it recognizes an ANALYZE command.
//
// ANALYZE -- 1
// ANALYZE -- 2
// ANALYZE ?.? -- 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 _sqlite3Analyze(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken) {
var _iDb, _i int32
var _z, _zDb *int8
var _db *Xsqlite3
var _pTab *XTable
var _v *TVdbe
var _pTableName *XToken
var _pIdx *XIndex
_db = (*Xsqlite3)(_pParse.X0)
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98299), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000))), unsafe.Pointer(str(124825)))
crt.X__builtin_abort(tls)
}
}()
if i32(0) != _sqlite3ReadSchema(tls, _pParse) {
return
}
func() {
if _pName2 == nil && _pName1 != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98304), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AnalyzeØ00__func__Ø000))), unsafe.Pointer(str(124865)))
crt.X__builtin_abort(tls)
}
}()
if _pName1 != nil {
goto _6
}
_i = i32(0)
_7:
if _i >= (_db.X5) {
goto _10
}
if _i == i32(1) {
goto _8
}
_analyzeDatabase(tls, _pParse, _i)
_8:
_i += 1
goto _7
_10:
goto _15
_6:
if ((_pName2.X1) == uint32(i32(0))) && (store1(&_iDb, _sqlite3FindDb(tls, _db, _pName1)) >= i32(0)) {
_analyzeDatabase(tls, _pParse, _iDb)
goto _15
}
_iDb = _sqlite3TwoPartName(tls, _pParse, _pName1, _pName2, &_pTableName)
if _iDb < i32(0) {
goto _16
}
_zDb = func() *int8 {
if (_pName2.X1) != 0 {
return ((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0)
}
return nil
}()
_z = _sqlite3NameFromToken(tls, _db, _pTableName)
if _z == nil {
goto _19
}
if store69(&_pIdx, _sqlite3FindIndex(tls, _db, _z, _zDb)) != nil {
_analyzeTable(tls, _pParse, (*XTable)(_pIdx.X3), _pIdx)
goto _22
}
if store44(&_pTab, _sqlite3LocateTable(tls, _pParse, uint32(i32(0)), _z, _zDb)) != nil {
_analyzeTable(tls, _pParse, _pTab, nil)
}
_22:
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_z))
_19:
_16:
_15:
if (int32(_db.X26) == i32(0)) && (store38(&_v, _sqlite3GetVdbe(tls, _pParse)) != nil) {
_sqlite3VdbeAddOp0(tls, _v, i32(153))
}
}
var _sqlite3AnalyzeØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AnalyzeØ00__func__Ø000[0], str(124888), 15)
}
// Generate code that will do an analysis of an entire database
func _analyzeDatabase(tls *crt.TLS, _pParse *XParse, _iDb int32) {
var _iStatCur, _iMem, _iTab int32
var _db *Xsqlite3
var _pSchema *XSchema
var _k *XHashElem
var _1_pTab *XTable
_db = (*Xsqlite3)(_pParse.X0)
_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_iStatCur = _pParse.X17
{
p := (*int32)(unsafe.Pointer(&(_pParse.X17)))
*p = (*p) + i32(3)
sink1 = *p
}
_openStatTable(tls, _pParse, _iDb, _iStatCur, nil, nil)
_iMem = (_pParse.X18) + i32(1)
_iTab = _pParse.X17
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98243), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeDatabaseØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
_k = (*XHashElem)((*XHash)(unsafe.Pointer(&(_pSchema.X2))).X2)
_2:
if _k == nil {
goto _5
}
_1_pTab = (*XTable)(_k.X2)
_analyzeOneTable(tls, _pParse, _1_pTab, nil, _iStatCur, _iMem, _iTab)
_k = (*XHashElem)(_k.X0)
goto _2
_5:
_loadAnalysis(tls, _pParse, _iDb)
}
// This routine generates code that opens the sqlite_statN tables.
// The sqlite_stat1 table is always relevant. sqlite_stat2 is now
// obsolete. sqlite_stat3 and sqlite_stat4 are only opened when
// appropriate compile-time options are provided.
//
// If the sqlite_statN tables do not previously exist, it is created.
//
// Argument zWhere may be a pointer to a buffer containing a table name,
// or it may be a NULL pointer. If it is not NULL, then all entries in
// the sqlite_statN tables associated with the named table are deleted.
// If zWhere==0, then code is generated to delete all stat table entries.
func _openStatTable(tls *crt.TLS, _pParse *XParse, _iDb int32, _iStatCur int32, _zWhere *int8, _zWhereType *int8) {
var _i int32
var _1_zTab *int8
var _aRoot [3]int32
var _db *Xsqlite3
var _pDb *XDb
var _1_pStat *XTable
var _v *TVdbe
var _aCreateTbl [3]uint8
_db = (*Xsqlite3)(_pParse.X0)
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
return
}
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97123), unsafe.Pointer((*int8)(unsafe.Pointer(&_openStatTableØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3VdbeDb(tls, _v) != _db {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97124), unsafe.Pointer((*int8)(unsafe.Pointer(&_openStatTableØ00__func__Ø000))), unsafe.Pointer(str(124903)))
crt.X__builtin_abort(tls)
}
}()
_pDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb)))
_i = i32(0)
_5:
if _i >= i32(3) {
goto _8
}
_1_zTab = (*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 8*uintptr(_i))).X0
if store44(&_1_pStat, _sqlite3FindTable(tls, _db, _1_zTab, _pDb.X0)) != nil {
goto _9
}
if ((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 8*uintptr(_i))).X1) != nil {
_sqlite3NestedParse(tls, _pParse, str(124924), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_1_zTab), unsafe.Pointer((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001))+8*uintptr(_i))).X1))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))) = _pParse.X32
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(16))
}
goto _11
_9:
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))) = _1_pStat.X7
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i))) = uint8(i32(0))
_sqlite3TableLock(tls, _pParse, _iDb, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), uint8(i32(1)), _1_zTab)
if _zWhere != nil {
_sqlite3NestedParse(tls, _pParse, str(114976), unsafe.Pointer(_pDb.X0), unsafe.Pointer(_1_zTab), unsafe.Pointer(_zWhereType), unsafe.Pointer(_zWhere))
goto _13
}
_sqlite3VdbeAddOp2(tls, _v, i32(134), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), _iDb)
_13:
_11:
_i += 1
goto _5
_8:
_i = i32(0)
_14:
if ((*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001)) + 8*uintptr(_i))).X1) == nil {
goto _17
}
func() {
if _i >= i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97166), unsafe.Pointer((*int8)(unsafe.Pointer(&_openStatTableØ00__func__Ø000))), unsafe.Pointer(str(124947)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4Int(tls, _v, i32(107), _iStatCur+_i, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aRoot)) + 4*uintptr(_i))), _iDb, i32(3))
_sqlite3VdbeChangeP5(tls, _v, uint16(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aCreateTbl)) + 1*uintptr(_i)))))
_sqlite3VdbeComment(tls, _v, (*t78)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_openStatTableØ00aTableØ001))+8*uintptr(_i))).X0)
_i += 1
goto _14
_17:
_ = _aRoot
_ = _aCreateTbl
}
var _openStatTableØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_openStatTableØ00__func__Ø000[0], str(124967), 14)
}
var _openStatTableØ00aTableØ001 [3]struct {
X0 *int8
X1 *int8
}
func init() {
_openStatTableØ00aTableØ001 = [3]struct {
X0 *int8
X1 *int8
}{t78{X0: str(60088), X1: str(124981)}, t78{X0: str(124994), X1: nil}, t78{X0: str(125007), X1: nil}}
}
var _analyzeDatabaseØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_analyzeDatabaseØ00__func__Ø000[0], str(125020), 16)
}
// Generate code to do an analysis of all indices associated with
// a single table.
func _analyzeOneTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex, _iStatCur int32, _iMem int32, _iTab int32) {
var _iIdxCur, _iTabCur, _i, _jZeroRows, _iDb, _regNewRowid, _regStat4, _regChng, _regTemp, _regTabname, _regIdxname, _regStat1, _regPrev, _5_nCol, _5_addrRewind, _5_addrNextRow, _5_nColTest, _8_endDistinctTest int32
var _8_aGotoChng *int32
var _5_zIdxName, _10_pColl *int8
var _needTableCnt uint8
var _db *Xsqlite3
var _v *TVdbe
var _pIdx *XIndex
_db = (*Xsqlite3)(_pParse.X0)
_jZeroRows = i32(-1)
_needTableCnt = u8(1)
_regNewRowid = postInc1(&_iMem, int32(1))
_regStat4 = postInc1(&_iMem, int32(1))
_regChng = postInc1(&_iMem, int32(1))
_regTemp = postInc1(&_iMem, int32(1))
_regTabname = postInc1(&_iMem, int32(1))
_regIdxname = postInc1(&_iMem, int32(1))
_regStat1 = postInc1(&_iMem, int32(1))
_regPrev = _iMem
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 {
if (_pParse.X18) > _iMem {
return (_pParse.X18)
}
return _iMem
}()
_v = _sqlite3GetVdbe(tls, _pParse)
if (_v == nil) || func() int32 {
if _pTab == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97924), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
if (_pTab.X7) == i32(0) {
return
}
if Xsqlite3_strlike(tls, str(125036), _pTab.X0, uint32(i32(0))) == i32(0) {
return
}
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97935), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
func() {
if _iDb < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97937), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(42040)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3SchemaMutexHeld(tls, _db, _iDb, nil) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97938), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(51150)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(28), _pTab.X0, nil, (*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_iDb))).X0) != 0 {
return
}
_sqlite3TableLock(tls, _pParse, _iDb, _pTab.X7, uint8(i32(0)), _pTab.X0)
_iTabCur = postInc1(&_iTab, int32(1))
_iIdxCur = postInc1(&_iTab, int32(1))
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = func() int32 {
if (_pParse.X17) > _iTab {
return (_pParse.X17)
}
return _iTab
}()
_sqlite3OpenTable(tls, _pParse, _iTabCur, _iDb, _pTab, i32(106))
_sqlite3VdbeLoadString(tls, _v, _regTabname, _pTab.X0)
_pIdx = (*XIndex)(_pTab.X2)
_17:
if _pIdx == nil {
goto _20
}
if (_pOnlyIdx != nil) && (_pOnlyIdx != _pIdx) {
goto _18
}
if (*XExpr)(_pIdx.X9) == nil {
_needTableCnt = uint8(i32(0))
}
if (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) && (int32((uint32(_pIdx.X16)<>uint(i32(30))) == i32(2)) {
_5_nCol = int32(_pIdx.X13)
_5_zIdxName = _pTab.X0
_5_nColTest = _5_nCol - i32(1)
goto _26
}
_5_nCol = int32(_pIdx.X14)
_5_zIdxName = _pIdx.X0
_5_nColTest = func() int32 {
if ((uint32((_pIdx.X16)>>uint(i32(3))) << uint(i32(31))) >> uint(i32(31))) != 0 {
return (int32(_pIdx.X13) - i32(1))
}
return (_5_nCol - i32(1))
}()
_26:
_sqlite3VdbeLoadString(tls, _v, _regIdxname, _5_zIdxName)
_sqlite3VdbeComment(tls, _v, str(125045), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_5_zIdxName))
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = func() int32 {
if (_pParse.X18) > (_regPrev + _5_nColTest) {
return (_pParse.X18)
}
return (_regPrev + _5_nColTest)
}()
func() {
if _iDb != _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pIdx.X6)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98019), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125064)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp3(tls, _v, i32(106), _iIdxCur, _pIdx.X11, _iDb)
_sqlite3VdbeSetP4KeyInfo(tls, _pParse, _pIdx)
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pIdx.X0))
_sqlite3VdbeAddOp2(tls, _v, i32(56), _5_nCol, _regStat4+i32(1))
_sqlite3VdbeAddOp2(tls, _v, i32(56), int32(_pIdx.X13), _regStat4+i32(2))
_sqlite3VdbeAddOp4(tls, _v, i32(69), i32(0), _regStat4+i32(1), _regStat4, (*int8)(unsafe.Pointer(&_statInitFuncdef)), i32(-4))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(2)))
_5_addrRewind = _sqlite3VdbeAddOp1(tls, _v, i32(37), _iIdxCur)
_sqlite3VdbeAddOp2(tls, _v, i32(56), i32(0), _regChng)
_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
if _5_nColTest <= i32(0) {
goto _33
}
_8_endDistinctTest = _sqlite3VdbeMakeLabel(tls, _v)
_8_aGotoChng = (*int32)(_sqlite3DbMallocRawNN(tls, _db, uint64(u32(4)*uint32(_5_nColTest))))
if _8_aGotoChng == nil {
goto _18
}
_sqlite3VdbeAddOp0(tls, _v, i32(13))
_5_addrNextRow = _sqlite3VdbeCurrentAddr(tls, _v)
if ((_5_nColTest == i32(1)) && (int32(_pIdx.X13) == i32(1))) && (int32(_pIdx.X15) != i32(0)) {
_sqlite3VdbeAddOp2(tls, _v, i32(76), _regPrev, _8_endDistinctTest)
}
_i = i32(0)
_38:
if _i >= _5_nColTest {
goto _41
}
_10_pColl = (*int8)(unsafe.Pointer(_sqlite3LocateCollSeq(tls, _pParse, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pIdx.X8)) + 4*uintptr(_i))))))
_sqlite3VdbeAddOp2(tls, _v, i32(56), _i, _regChng)
_sqlite3VdbeAddOp3(tls, _v, i32(99), _iIdxCur, _i, _regTemp)
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aGotoChng)) + 4*uintptr(_i))) = _sqlite3VdbeAddOp4(tls, _v, i32(77), _regTemp, i32(0), _regPrev+_i, _10_pColl, i32(-3))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(128)))
_i += 1
goto _38
_41:
_sqlite3VdbeAddOp2(tls, _v, i32(56), _5_nColTest, _regChng)
_sqlite3VdbeGoto(tls, _v, _8_endDistinctTest)
_sqlite3VdbeJumpHere(tls, _v, _5_addrNextRow-i32(1))
_i = i32(0)
_42:
if _i >= _5_nColTest {
goto _45
}
_sqlite3VdbeJumpHere(tls, _v, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_aGotoChng)) + 4*uintptr(_i))))
_sqlite3VdbeAddOp3(tls, _v, i32(99), _iIdxCur, _i, _regPrev+_i)
_i += 1
goto _42
_45:
_sqlite3VdbeResolveLabel(tls, _v, _8_endDistinctTest)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_8_aGotoChng))
_33:
func() {
if _regChng != (_regStat4 + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98135), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125109)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(69), i32(1), _regStat4, _regTemp, (*int8)(unsafe.Pointer(&_statPushFuncdef)), i32(-4))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(2)))
_sqlite3VdbeAddOp2(tls, _v, i32(7), _iIdxCur, _5_addrNextRow)
_callStatGet(tls, _v, _regStat4, i32(0), _regStat1)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(str(125131))) + 1*uintptr(i32(0))))) != i32(66) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98143), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125135)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(101), _regTabname, i32(3), _regTemp, str(125131), i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(117), _iStatCur, _regNewRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _iStatCur, _regTemp, _regNewRowid)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
_sqlite3VdbeJumpHere(tls, _v, _5_addrRewind)
_18:
_pIdx = (*XIndex)(_pIdx.X5)
goto _17
_20:
if (_pOnlyIdx == nil) && (_needTableCnt != 0) {
_sqlite3VdbeComment(tls, _v, str(24576), unsafe.Pointer(_pTab.X0))
_sqlite3VdbeAddOp2(tls, _v, i32(102), _iTabCur, _regStat1)
_jZeroRows = _sqlite3VdbeAddOp1(tls, _v, i32(22), _regStat1)
_sqlite3VdbeAddOp2(tls, _v, i32(59), i32(0), _regIdxname)
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(str(125131))) + 1*uintptr(i32(0))))) != i32(66) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98205), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeOneTableØ00__func__Ø000))), unsafe.Pointer(str(125135)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(101), _regTabname, i32(3), _regTemp, str(125131), i32(0))
_sqlite3VdbeAddOp2(tls, _v, i32(117), _iStatCur, _regNewRowid)
_sqlite3VdbeAddOp3(tls, _v, i32(118), _iStatCur, _regTemp, _regNewRowid)
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(8)))
_sqlite3VdbeJumpHere(tls, _v, _jZeroRows)
}
}
var _analyzeOneTableØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_analyzeOneTableØ00__func__Ø000[0], str(125161), 16)
}
var _statInitFuncdef XFuncDef
func init() {
_statInitFuncdef = XFuncDef{X0: i8(2), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_statInit})), X5: nil, X6: str(125177), X7: t12{}}
}
// Implementation of the stat_init(N,K,C) SQL function. The three parameters
// are:
// N: The number of columns in the index including the rowid/pk (note 1)
// K: The number of columns in the index excluding the rowid/pk.
// C: The number of rows in the index (note 2)
//
// Note 1: In the special case of the covering index that implements a
// WITHOUT ROWID table, N is the number of PRIMARY KEY columns, not the
// total number of columns in the table.
//
// Note 2: C is only used for STAT3 and STAT4.
//
// For indexes on ordinary rowid tables, N==K+1. But for indexes on
// WITHOUT ROWID tables, N=K+P where P is the number of columns in the
// PRIMARY KEY of the table. The covering index that implements the
// original WITHOUT ROWID table as N==K as a special case.
//
// This routine allocates the Stat4Accum object in heap memory. The return
// value is a pointer to the Stat4Accum object. The datatype of the
// return value is BLOB, but it is really just a pointer to the Stat4Accum
// object.
func _statInit(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nCol, _nKeyCol, _nColUp, _n int32
var _db *Xsqlite3
var _p *XStat4Accum
_nCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _nCol <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97333), unsafe.Pointer((*int8)(unsafe.Pointer(&_statInitØ00__func__Ø000))), unsafe.Pointer(str(125187)))
crt.X__builtin_abort(tls)
}
}()
_nColUp = (_nCol + i32(1)) & i32(-2)
_nKeyCol = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
func() {
if _nKeyCol > _nCol {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97336), unsafe.Pointer((*int8)(unsafe.Pointer(&_statInitØ00__func__Ø000))), unsafe.Pointer(str(125194)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nKeyCol <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97337), unsafe.Pointer((*int8)(unsafe.Pointer(&_statInitØ00__func__Ø000))), unsafe.Pointer(str(107110)))
crt.X__builtin_abort(tls)
}
}()
_n = int32((u32(60) + (u32(4) * uint32(_nColUp))) + (u32(4) * uint32(_nColUp)))
_db = Xsqlite3_context_db_handle(tls, _context)
_p = (*XStat4Accum)(_sqlite3DbMallocZero(tls, _db, uint64(_n)))
if _p == nil {
Xsqlite3_result_error_nomem(tls, _context)
return
}
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X13))))) = _db
*(*uint32)(unsafe.Pointer(&(_p.X0))) = uint32(i32(0))
*(*int32)(unsafe.Pointer(&(_p.X2))) = _nCol
*(*int32)(unsafe.Pointer(&(_p.X3))) = _nKeyCol
*(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&(_p.X5))).X1))) = (*uint32)(unsafe.Pointer((*XStat4Accum)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p)) + 60*uintptr(i32(1))))))
*(**uint32)(unsafe.Pointer(&((*t79)(unsafe.Pointer(&(_p.X5))).X0))) = (*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_nColUp)))
Xsqlite3_result_blob(tls, _context, (unsafe.Pointer)(_p), int32(u32(60)), _stat4Destructor)
}
var _statInitØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_statInitØ00__func__Ø000[0], str(125208), 9)
}
func Xsqlite3_result_blob(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if _n < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76428), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_blobØ00__func__Ø000))), unsafe.Pointer(str(125217)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76429), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_blobØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(i32(0)), _xDel)
}
var _sqlite3_result_blobØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_blobØ00__func__Ø000[0], str(125222), 20)
}
// Reclaim all memory of a Stat4Accum structure.
func _stat4Destructor(tls *crt.TLS, _pOld unsafe.Pointer) {
var _p *XStat4Accum
_p = (*XStat4Accum)(_pOld)
_sqlite3DbFree(tls, (*Xsqlite3)(_p.X13), (unsafe.Pointer)(_p))
}
var _statPushFuncdef XFuncDef
func init() {
_statPushFuncdef = XFuncDef{X0: i8(2), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_statPush})), X5: nil, X6: str(125242), X7: t12{}}
}
// Implementation of the stat_push SQL function: stat_push(P,C,R)
// Arguments:
//
// P Pointer to the Stat4Accum object created by stat_init()
// C Index of left-most column to differ from previous row
// R Rowid for the current row. Might be a key record for
// WITHOUT ROWID tables.
//
// This SQL function always returns NULL. It's purpose it to accumulate
// statistical data and/or samples in the Stat4Accum object about the
// index being analyzed. The stat_get() SQL function will later be used to
// extract relevant information for constructing the sqlite_statN tables.
//
// The R parameter is only used for STAT3 and STAT4
func _statPush(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i, _iChng int32
var _p *XStat4Accum
_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
_iChng = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
func() {
if (_p.X2) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97657), unsafe.Pointer((*int8)(unsafe.Pointer(&_statPushØ00__func__Ø000))), unsafe.Pointer(str(125252)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iChng >= (_p.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97658), unsafe.Pointer((*int8)(unsafe.Pointer(&_statPushØ00__func__Ø000))), unsafe.Pointer(str(125262)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X0) != uint32(i32(0)) {
goto _4
}
_i = i32(0)
_5:
if _i >= (_p.X2) {
goto _8
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) = uint32(i32(1))
_i += 1
goto _5
_8:
goto _9
_4:
_samplePushPrevious(tls, _p, _iChng)
_i = i32(0)
_10:
if _i >= _iChng {
goto _13
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) += 1
_i += 1
goto _10
_13:
_i = _iChng
_14:
if _i >= (_p.X2) {
goto _17
}
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_i))) += 1
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_i))) = uint32(i32(1))
_i += 1
goto _14
_17:
_9:
*(*uint32)(unsafe.Pointer(&(_p.X0))) += 1
}
var _statPushØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_statPushØ00__func__Ø000[0], str(125276), 9)
}
// Field iChng of the index being scanned has changed. So at this point
// p->current contains a sample that reflects the previous row of the
// index. The value of anEq[iChng] and subsequent anEq[] elements are
// correct at this point.
func _samplePushPrevious(tls *crt.TLS, _p *XStat4Accum, _iChng int32) {
}
func _callStatGet(tls *crt.TLS, _v *TVdbe, _regStat4 int32, _iParam int32, _regOut int32) {
func() {
if _regOut == _regStat4 || _regOut == (_regStat4+i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97876), unsafe.Pointer((*int8)(unsafe.Pointer(&_callStatGetØ00__func__Ø000))), unsafe.Pointer(str(125285)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _iParam != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97880), unsafe.Pointer((*int8)(unsafe.Pointer(&_callStatGetØ00__func__Ø000))), unsafe.Pointer(str(125324)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(69), i32(0), _regStat4, _regOut, (*int8)(unsafe.Pointer(&_statGetFuncdef)), i32(-4))
_sqlite3VdbeChangeP5(tls, _v, uint16(i32(1)))
}
var _callStatGetØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_callStatGetØ00__func__Ø000[0], str(125347), 12)
}
var _statGetFuncdef XFuncDef
func init() {
_statGetFuncdef = XFuncDef{X0: i8(1), X1: u16(1), X2: nil, X3: nil, X4: *(*func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_context, int32, **XMem)
}{_statGet})), X5: nil, X6: str(125359), X7: t12{}}
}
// Implementation of the stat_get(P,J) SQL function. This routine is
// used to query statistical information that has been gathered into
// the Stat4Accum object by prior calls to stat_push(). The P parameter
// has type BLOB but it is really just a pointer to the Stat4Accum object.
// The content to returned is determined by the parameter J
// which is one of the STAT_GET_xxxx values defined above.
//
// The stat_get(P,J) function is not available to generic SQL. It is
// inserted as part of a manually constructed bytecode program. (See
// the callStatGet() routine below.) It is guaranteed that the P
// parameter will always be a poiner to a Stat4Accum object, never a
// NULL.
//
// If neither STAT3 nor STAT4 are enabled, then J is always
// STAT_GET_STAT1 and is hence omitted and this routine becomes
// a one-parameter function, stat_get(P), that always returns the
// stat1 table entry information.
func _statGet(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _1_i int32
var _3_nDistinct, _3_iVal uint64
var _1_z, _1_zRet *int8
var _p *XStat4Accum
_p = (*XStat4Accum)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97765), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_1_zRet = (*int8)(_sqlite3MallocZero(tls, uint64(((_p.X3)+i32(1))*i32(25))))
if _1_zRet == nil {
Xsqlite3_result_error_nomem(tls, _context)
return
}
Xsqlite3_snprintf(tls, i32(24), _1_zRet, str(125376), uint64(_p.X0))
_1_z = (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(_1_zRet)) + uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_sqlite3Strlen30(tls, _1_zRet))))))))
_1_i = i32(0)
_3:
if _1_i >= (_p.X3) {
goto _6
}
_3_nDistinct = uint64((*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X1)) + 4*uintptr(_1_i)))) + uint32(i32(1)))
_3_iVal = ((uint64(_p.X0) + _3_nDistinct) - uint64(i32(1))) / _3_nDistinct
Xsqlite3_snprintf(tls, i32(24), _1_z, str(125381), _3_iVal)
{
p := &_1_z
*p = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_sqlite3Strlen30(tls, _1_z))))
sink0 = *p
}
func() {
if (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*t79)(unsafe.Pointer(&(_p.X5))).X0)) + 4*uintptr(_1_i)))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97805), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125387)))
crt.X__builtin_abort(tls)
}
}()
_1_i += 1
goto _3
_6:
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_1_z)) + 1*uintptr(i32(0))))) != i32(0) || uintptr(unsafe.Pointer(_1_z)) <= uintptr(unsafe.Pointer(_1_zRet)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(97807), unsafe.Pointer((*int8)(unsafe.Pointer(&_statGetØ00__func__Ø000))), unsafe.Pointer(str(125406)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_result_text(tls, _context, _1_zRet, i32(-1), Xsqlite3_free)
}
var _statGetØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_statGetØ00__func__Ø000[0], str(125427), 8)
}
// Generate code that will cause the most recent index analysis to
// be loaded into internal hash tables where is can be used.
func _loadAnalysis(tls *crt.TLS, _pParse *XParse, _iDb int32) {
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
if _v != nil {
_sqlite3VdbeAddOp1(tls, _v, i32(140), _iDb)
}
}
// Generate code that will do an analysis of a single table in
// a database. If pOnlyIdx is not NULL then it is a single index
// in pTab that should be analyzed.
func _analyzeTable(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _pOnlyIdx *XIndex) {
var _iDb, _iStatCur int32
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98260), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeTableØ00__func__Ø000))), unsafe.Pointer(str(43594)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(98261), unsafe.Pointer((*int8)(unsafe.Pointer(&_analyzeTableØ00__func__Ø000))), unsafe.Pointer(str(124825)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_iStatCur = _pParse.X17
{
p := (*int32)(unsafe.Pointer(&(_pParse.X17)))
*p = (*p) + i32(3)
sink1 = *p
}
if _pOnlyIdx != nil {
_openStatTable(tls, _pParse, _iDb, _iStatCur, _pOnlyIdx.X0, str(61657))
goto _5
}
_openStatTable(tls, _pParse, _iDb, _iStatCur, _pTab.X0, str(61653))
_5:
_analyzeOneTable(tls, _pParse, _pTab, _pOnlyIdx, _iStatCur, (_pParse.X18)+i32(1), _pParse.X17)
_loadAnalysis(tls, _pParse, _iDb)
}
var _analyzeTableØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_analyzeTableØ00__func__Ø000[0], str(125435), 13)
}
// Generate code to implement the "ALTER TABLE xxx RENAME TO yyy"
// command.
func _sqlite3AlterRenameTable(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList, _pName *XToken) {
var _iDb, _nTabName, _savedDbFlags, _10_i int32
var _zDb, _zName, _zTabName, _zWhere *int8
var _db *Xsqlite3
var _pTab, _16_pFrom *XTable
var _v *TVdbe
var _pVTab *XVTable
var _15_p *XFKey
_zName = nil
_db = (*Xsqlite3)(_pParse.X0)
_zWhere = nil
_pVTab = nil
_savedDbFlags = _db.X6
if func() int32 {
if (_db.X17) != 0 {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96518), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
goto _exit_rename_table
}
func() {
if (_pSrc.X0) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96519), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000))), unsafe.Pointer(str(125448)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96520), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterRenameTableØ00__func__Ø000))), unsafe.Pointer(str(124825)))
crt.X__builtin_abort(tls)
}
}()
_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(i32(0)))))
if _pTab == nil {
goto _exit_rename_table
}
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2097152)
sink1 = *p
}
_zName = _sqlite3NameFromToken(tls, _db, _pName)
if _zName == nil {
goto _exit_rename_table
}
if (_sqlite3FindTable(tls, _db, _zName, _zDb) != nil) || (_sqlite3FindIndex(tls, _db, _zName, _zDb) != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(125462), unsafe.Pointer(_zName))
goto _exit_rename_table
}
if i32(0) != _isSystemTable(tls, _pParse, _pTab.X0) {
goto _exit_rename_table
}
if i32(0) != _sqlite3CheckObjectName(tls, _pParse, _zName) {
goto _exit_rename_table
}
if (*XSelect)(_pTab.X3) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(125521), unsafe.Pointer(_pTab.X0))
goto _exit_rename_table
}
if _sqlite3AuthCheck(tls, _pParse, i32(26), _zDb, _pTab.X0, nil) != 0 {
goto _exit_rename_table
}
if _sqlite3ViewGetColumnNames(tls, _pParse, _pTab) != 0 {
goto _exit_rename_table
}
if (_pTab.X16) == 0 {
goto _16
}
_pVTab = _sqlite3GetVTable(tls, _db, _pTab)
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, *int8) int32
}{(*(*func(*crt.TLS, *Xsqlite3_vtab, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8) int32
}{((*Xsqlite3_module)((*Xsqlite3_vtab)(_pVTab.X2).X0).X19)})))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vtab, *int8) int32
}{nil})) {
_pVTab = nil
}
_16:
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _exit_rename_table
}
_sqlite3BeginWriteOperation(tls, _pParse, bool2int(_pVTab != nil), _iDb)
_sqlite3ChangeCookie(tls, _pParse, _iDb)
if _pVTab != nil {
_10_i = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeLoadString(tls, _v, _10_i, _zName)
_sqlite3VdbeAddOp4(tls, _v, i32(160), _10_i, i32(0), i32(0), (*int8)(unsafe.Pointer(_pVTab)), i32(-8))
_sqlite3MayAbort(tls, _pParse)
}
_zTabName = _pTab.X0
_nTabName = _sqlite3Utf8CharLen(tls, _zTabName, i32(-1))
if ((_db.X6) & i32(524288)) == 0 {
goto _20
}
if store0(&_zWhere, _whereForeignKeys(tls, _pParse, _pTab)) != nil {
_sqlite3NestedParse(tls, _pParse, str(125548), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), unsafe.Pointer(_zTabName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere))
}
_20:
_sqlite3NestedParse(tls, _pParse, str(125617), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zName), _nTabName, unsafe.Pointer(_zTabName))
if _sqlite3FindTable(tls, _db, str(111495), _zDb) != nil {
_sqlite3NestedParse(tls, _pParse, str(126001), unsafe.Pointer(_zDb), unsafe.Pointer(_zName), unsafe.Pointer(_pTab.X0))
}
if store0(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
_sqlite3NestedParse(tls, _pParse, str(126059), unsafe.Pointer(_zName), unsafe.Pointer(_zName), unsafe.Pointer(_zWhere))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere))
}
if ((_db.X6) & i32(524288)) == 0 {
goto _24
}
_15_p = _sqlite3FkReferences(tls, _pTab)
_25:
if _15_p == nil {
goto _28
}
_16_pFrom = (*XTable)(_15_p.X0)
if _16_pFrom != _pTab {
_reloadTableSchema(tls, _pParse, (*XTable)(_15_p.X0), _16_pFrom.X0)
}
_15_p = (*XFKey)(_15_p.X3)
goto _25
_28:
_24:
_reloadTableSchema(tls, _pParse, _pTab, _zName)
_exit_rename_table:
_sqlite3SrcListDelete(tls, _db, _pSrc)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
*(*int32)(unsafe.Pointer(&(_db.X6))) = _savedDbFlags
}
var _sqlite3AlterRenameTableØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AlterRenameTableØ00__func__Ø000[0], str(126151), 24)
}
// Parameter zName is the name of a table that is about to be altered
// (either with ALTER TABLE ... RENAME TO or ALTER TABLE ... ADD COLUMN).
// If the table is a system table, this function leaves an error message
// in pParse->zErr (system tables may not be altered) and returns non-zero.
//
// Or, if zName is not a system table, zero is returned.
func _isSystemTable(tls *crt.TLS, _pParse *XParse, _zName *int8) (r0 int32) {
if (_sqlite3Strlen30(tls, _zName) > i32(6)) && (i32(0) == Xsqlite3_strnicmp(tls, _zName, str(111644), i32(7))) {
_sqlite3ErrorMsg(tls, _pParse, str(126175), unsafe.Pointer(_zName))
return i32(1)
}
return i32(0)
}
// Generate the text of a WHERE expression which can be used to select all
// tables that have foreign key constraints that refer to table pTab (i.e.
// constraints for which pTab is the parent table) from the sqlite_master
// table.
func _whereForeignKeys(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
var _zWhere *int8
var _p *XFKey
_zWhere = nil
_p = _sqlite3FkReferences(tls, _pTab)
_0:
if _p == nil {
goto _3
}
_zWhere = _whereOrName(tls, (*Xsqlite3)(_pParse.X0), _zWhere, (*XTable)(_p.X0).X0)
_p = (*XFKey)(_p.X3)
goto _0
_3:
return _zWhere
}
// This function is used to create the text of expressions of the form:
//
// name= OR name= OR ...
//
// If argument zWhere is NULL, then a pointer string containing the text
// "name=" is returned, where is the quoted version
// of the string passed as argument zConstant. The returned buffer is
// allocated using sqlite3DbMalloc(). It is the responsibility of the
// caller to ensure that it is eventually freed.
//
// If argument zWhere is not NULL, then the string returned is
// " OR name=", where is the contents of zWhere.
// In this case zWhere is passed to sqlite3DbFree() before returning.
//
func _whereOrName(tls *crt.TLS, _db *Xsqlite3, _zWhere *int8, _zConstant *int8) (r0 *int8) {
var _zNew *int8
if _zWhere == nil {
_zNew = _sqlite3MPrintf(tls, _db, str(126203), unsafe.Pointer(_zConstant))
goto _1
}
_zNew = _sqlite3MPrintf(tls, _db, str(126211), unsafe.Pointer(_zWhere), unsafe.Pointer(_zConstant))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zWhere))
_1:
return _zNew
}
// Generate the text of a WHERE expression which can be used to select all
// temporary triggers on table pTab from the sqlite_temp_master table. If
// table pTab has no temporary triggers, or is itself stored in the
// temporary database, NULL is returned.
func _whereTempTriggers(tls *crt.TLS, _pParse *XParse, _pTab *XTable) (r0 *int8) {
var _zWhere, _4_zNew *int8
var _1_db *Xsqlite3
var _pTempSchema *XSchema
var _pTrig *XTrigger
_zWhere = nil
_pTempSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4) + 16*uintptr(i32(1)))).X4)
if (*XSchema)(_pTab.X20) == _pTempSchema {
goto _0
}
_1_db = (*Xsqlite3)(_pParse.X0)
_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
_1:
if _pTrig == nil {
goto _4
}
if (*XSchema)(_pTrig.X6) == _pTempSchema {
_zWhere = _whereOrName(tls, _1_db, _zWhere, _pTrig.X0)
}
_pTrig = (*XTrigger)(_pTrig.X9)
goto _1
_4:
_0:
if _zWhere != nil {
_4_zNew = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(126225), unsafe.Pointer(_zWhere))
_sqlite3DbFree(tls, (*Xsqlite3)(_pParse.X0), (unsafe.Pointer)(_zWhere))
_zWhere = _4_zNew
}
return _zWhere
}
// Generate code to drop and reload the internal representation of table
// pTab from the database, including triggers and temporary triggers.
// Argument zName is the name of the table in the database schema at
// the time the generated code is executed. This can be different from
// pTab->zName if this function is being called to code part of an
// "ALTER TABLE RENAME TO" statement.
func _reloadTableSchema(tls *crt.TLS, _pParse *XParse, _pTab *XTable, _zName *int8) {
var _iDb, _1_iTrigDb int32
var _zWhere *int8
var _pTrig *XTrigger
var _v *TVdbe
_v = _sqlite3GetVdbe(tls, _pParse)
if func() int32 {
if _v == nil {
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96446), unsafe.Pointer((*int8)(unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(1)
}()
}
return i32(0)
}() != 0 {
return
}
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, (*Xsqlite3)(_pParse.X0)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96447), unsafe.Pointer((*int8)(unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000))), unsafe.Pointer(str(124825)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTab.X20))
func() {
if _iDb < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96449), unsafe.Pointer((*int8)(unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000))), unsafe.Pointer(str(42040)))
crt.X__builtin_abort(tls)
}
}()
_pTrig = _sqlite3TriggerList(tls, _pParse, _pTab)
_7:
if _pTrig == nil {
goto _10
}
_1_iTrigDb = _sqlite3SchemaToIndex(tls, (*Xsqlite3)(_pParse.X0), (*XSchema)(_pTrig.X6))
func() {
if _1_iTrigDb != _iDb && _1_iTrigDb != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96455), unsafe.Pointer((*int8)(unsafe.Pointer(&_reloadTableSchemaØ00__func__Ø000))), unsafe.Pointer(str(126249)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeAddOp4(tls, _v, i32(143), _1_iTrigDb, i32(0), i32(0), _pTrig.X0, i32(0))
_pTrig = (*XTrigger)(_pTrig.X9)
goto _7
_10:
_sqlite3VdbeAddOp4(tls, _v, i32(141), _iDb, i32(0), i32(0), _pTab.X0, i32(0))
_zWhere = _sqlite3MPrintf(tls, (*Xsqlite3)(_pParse.X0), str(126276), unsafe.Pointer(_zName))
if _zWhere == nil {
return
}
_sqlite3VdbeAddParseSchemaOp(tls, _v, _iDb, _zWhere)
if store0(&_zWhere, _whereTempTriggers(tls, _pParse, _pTab)) != nil {
_sqlite3VdbeAddParseSchemaOp(tls, _v, i32(1), _zWhere)
}
}
var _reloadTableSchemaØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_reloadTableSchemaØ00__func__Ø000[0], str(126288), 18)
}
// 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 _sqlite3AlterFinishAddColumn(tls *crt.TLS, _pParse *XParse, _pColDef *XToken) {
var _iDb, _r1, _7_rc, _10_savedDbFlags int32
var _zDb, _zTab, _zCol, _10_zEnd *int8
var _db *Xsqlite3
var _pNew, _pTab *XTable
var _v *TVdbe
var _7_pVal *XMem
var _pDflt *XExpr
var _pCol *XColumn
_v = (*TVdbe)(_pParse.X2)
_db = (*Xsqlite3)(_pParse.X0)
if (_pParse.X16) != 0 || ((_db.X17) != 0) {
return
}
func() {
if _v == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96717), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(42064)))
crt.X__builtin_abort(tls)
}
}()
_pNew = (*XTable)(_pParse.X63)
func() {
if _pNew == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96719), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126306)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96721), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pNew.X20))
_zDb = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X0
_zTab = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pNew.X0)) + 1*uintptr(i32(16))))
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pNew.X1) + 16*uintptr(int32(_pNew.X11)-i32(1))))
_pDflt = (*XExpr)(_pCol.X1)
_pTab = _sqlite3FindTable(tls, _db, _zTab, _zDb)
func() {
if _pTab == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96728), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(94241)))
crt.X__builtin_abort(tls)
}
}()
if _sqlite3AuthCheck(tls, _pParse, i32(26), _zDb, _pTab.X0, nil) != 0 {
return
}
func() {
if _pDflt != nil && int32(_pDflt.X0) != i32(162) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96741), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126311)))
crt.X__builtin_abort(tls)
}
}()
if (_pDflt != nil) && (int32((*XExpr)(_pDflt.X4).X0) == i32(101)) {
_pDflt = nil
}
if (int32(_pCol.X6) & i32(1)) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(126342))
return
}
if (*XIndex)(_pNew.X2) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(126374))
return
}
if (((_db.X6)&i32(524288)) != 0 && ((*XFKey)(_pNew.X4) != nil)) && (_pDflt != nil) {
_sqlite3ErrorMsg(tls, _pParse, str(126401))
return
}
if ((_pCol.X3) != 0) && (_pDflt == nil) {
_sqlite3ErrorMsg(tls, _pParse, str(126460))
return
}
if _pDflt == nil {
goto _23
}
_7_pVal = nil
_7_rc = _sqlite3ValueFromExpr(tls, _db, _pDflt, uint8(i32(1)), uint8(i32(65)), &_7_pVal)
func() {
if _7_rc != i32(0) && _7_rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96776), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(5805)))
crt.X__builtin_abort(tls)
}
}()
if _7_rc != i32(0) {
func() {
if int32(_db.X17) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterFinishAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126513)))
crt.X__builtin_abort(tls)
}
}()
return
}
if _7_pVal == nil {
_sqlite3ErrorMsg(tls, _pParse, str(126535))
return
}
_sqlite3ValueFree(tls, _7_pVal)
_23:
_zCol = _sqlite3DbStrNDup(tls, _db, _pColDef.X0, uint64(_pColDef.X1))
if _zCol == nil {
goto _31
}
_10_zEnd = (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zCol)) + 1*uintptr((_pColDef.X1)-uint32(i32(1)))))
_10_savedDbFlags = _db.X6
_32:
if (uintptr(unsafe.Pointer(_10_zEnd)) > uintptr(unsafe.Pointer(_zCol))) && ((int32(*_10_zEnd) == i32(59)) || (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*_10_zEnd)))))&i32(1)) != 0) {
*postInc0(&_10_zEnd, -1) = int8(i32(0))
goto _32
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(2097152)
sink1 = *p
}
_sqlite3NestedParse(tls, _pParse, str(126581), unsafe.Pointer(_zDb), unsafe.Pointer(str(50026)), _pNew.X15, unsafe.Pointer(_zCol), (_pNew.X15)+i32(1), unsafe.Pointer(_zTab))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zCol))
*(*int32)(unsafe.Pointer(&(_db.X6))) = _10_savedDbFlags
_31:
_r1 = _sqlite3GetTempReg(tls, _pParse)
_sqlite3VdbeAddOp3(tls, _v, i32(103), _iDb, _r1, i32(2))
_sqlite3VdbeUsesBtree(tls, _v, _iDb)
_sqlite3VdbeAddOp2(tls, _v, i32(73), _r1, i32(-2))
_sqlite3VdbeAddOp2(tls, _v, i32(46), _r1, _sqlite3VdbeCurrentAddr(tls, _v)+i32(2))
_sqlite3VdbeAddOp3(tls, _v, i32(104), _iDb, i32(2), i32(3))
_sqlite3ReleaseTempReg(tls, _pParse, _r1)
_reloadTableSchema(tls, _pParse, _pTab, _pTab.X0)
}
var _sqlite3AlterFinishAddColumnØ00__func__Ø000 [28]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AlterFinishAddColumnØ00__func__Ø000[0], str(126690), 28)
}
// This function is called by the parser after the table-name in
// an "ALTER TABLE 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 _sqlite3AlterBeginAddColumn(tls *crt.TLS, _pParse *XParse, _pSrc *XSrcList) {
var _iDb, _i, _nAlloc int32
var _db *Xsqlite3
var _pNew, _pTab *XTable
var _v *TVdbe
var _5_pCol *XColumn
_db = (*Xsqlite3)(_pParse.X0)
func() {
if (*XTable)(_pParse.X63) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96850), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(24634)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _sqlite3BtreeHoldsAllMutexes(tls, _db) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96851), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(9421)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) != 0 {
goto _exit_begin_add_column
}
_pTab = _sqlite3LocateTableItem(tls, _pParse, uint32(i32(0)), (*TSrcList_item)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TSrcList_item)(unsafe.Pointer(&(_pSrc.X2)))))+68*uintptr(i32(0)))))
if _pTab == nil {
goto _exit_begin_add_column
}
if (_pTab.X16) != 0 {
_sqlite3ErrorMsg(tls, _pParse, str(126718))
goto _exit_begin_add_column
}
if (*XSelect)(_pTab.X3) != nil {
_sqlite3ErrorMsg(tls, _pParse, str(126752))
goto _exit_begin_add_column
}
if i32(0) != _isSystemTable(tls, _pParse, _pTab.X0) {
goto _exit_begin_add_column
}
func() {
if (_pTab.X15) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96872), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126782)))
crt.X__builtin_abort(tls)
}
}()
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_pNew = (*XTable)(_sqlite3DbMallocZero(tls, _db, uint64(u32(80))))
if _pNew == nil {
goto _exit_begin_add_column
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = _pNew
*(*uint32)(unsafe.Pointer(&(_pNew.X8))) = uint32(i32(1))
*(*int16)(unsafe.Pointer(&(_pNew.X11))) = _pTab.X11
func() {
if int32(_pNew.X11) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96887), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126803)))
crt.X__builtin_abort(tls)
}
}()
_nAlloc = (((int32(_pNew.X11) - i32(1)) / i32(8)) * i32(8)) + i32(8)
func() {
if _nAlloc < int32(_pNew.X11) || (_nAlloc%i32(8)) != i32(0) || (_nAlloc-int32(_pNew.X11)) >= i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96889), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(126816)))
crt.X__builtin_abort(tls)
}
}()
*(**XColumn)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = (*XColumn)(_sqlite3DbMallocZero(tls, _db, uint64(u32(16)*uint32(_nAlloc))))
*(**int8)(unsafe.Pointer(&(_pNew.X0))) = _sqlite3MPrintf(tls, _db, str(126873), unsafe.Pointer(_pTab.X0))
if ((*XColumn)(_pNew.X1) == nil) || ((_pNew.X0) == nil) {
func() {
if (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(96893), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AlterBeginAddColumnØ00__func__Ø000))), unsafe.Pointer(str(47848)))
crt.X__builtin_abort(tls)
}
}()
goto _exit_begin_add_column
}
crt.Xmemcpy(tls, _pNew.X1, _pTab.X1, u32(16)*uint32(_pNew.X11))
_i = i32(0)
_22:
if _i >= int32(_pNew.X11) {
goto _25
}
_5_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pNew.X1) + 16*uintptr(_i)))
*(**int8)(unsafe.Pointer(&(_5_pCol.X0))) = _sqlite3DbStrDup(tls, _db, _5_pCol.X0)
*(**int8)(unsafe.Pointer(&(_5_pCol.X2))) = nil
*(**XExpr)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_5_pCol.X1))))) = nil
_i += 1
goto _22
_25:
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X20))))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_iDb))).X4)
*(*int32)(unsafe.Pointer(&(_pNew.X15))) = _pTab.X15
*(*uint32)(unsafe.Pointer(&(_pNew.X8))) = uint32(i32(1))
_sqlite3BeginWriteOperation(tls, _pParse, i32(0), _iDb)
_v = _sqlite3GetVdbe(tls, _pParse)
if _v == nil {
goto _exit_begin_add_column
}
_sqlite3ChangeCookie(tls, _pParse, _iDb)
_exit_begin_add_column:
_sqlite3SrcListDelete(tls, _db, _pSrc)
}
var _sqlite3AlterBeginAddColumnØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AlterBeginAddColumnØ00__func__Ø000[0], str(126892), 27)
}
// The parser calls this routine after the CREATE VIRTUAL TABLE statement
// has been completely parsed.
func _sqlite3VtabFinishParse(tls *crt.TLS, _pParse *XParse, _pEnd *XToken) {
var _1_iDb, _1_iReg int32
var _1_zStmt, _1_zWhere, _3_zName *int8
var _db *Xsqlite3
var _3_pSchema *XSchema
var _pTab, _3_pOld *XTable
var _1_v *TVdbe
_pTab = (*XTable)(_pParse.X63)
_db = (*Xsqlite3)(_pParse.X0)
if _pTab == nil {
return
}
_addArgumentToVtab(tls, _pParse)
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0))) = nil
if (_pTab.X16) < i32(1) {
return
}
if ((*t21)(unsafe.Pointer(&(_db.X33))).X2) != 0 {
goto _2
}
if _pEnd != nil {
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X50))).X1))) = uint32(int32((uintptr(unsafe.Pointer(_pEnd.X0))-uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0)))/1)) + (_pEnd.X1)
}
_1_zStmt = _sqlite3MPrintf(tls, _db, str(126919), unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50)))))
_1_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_sqlite3NestedParse(tls, _pParse, str(126943), unsafe.Pointer((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_1_iDb))).X0), unsafe.Pointer(str(50026)), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_pTab.X0), unsafe.Pointer(_1_zStmt), _pParse.X31)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_1_zStmt))
_1_v = _sqlite3GetVdbe(tls, _pParse)
_sqlite3ChangeCookie(tls, _pParse, _1_iDb)
_sqlite3VdbeAddOp0(tls, _1_v, i32(153))
_1_zWhere = _sqlite3MPrintf(tls, _db, str(127031), unsafe.Pointer(_pTab.X0))
_sqlite3VdbeAddParseSchemaOp(tls, _1_v, _1_iDb, _1_zWhere)
_1_iReg = preInc1((*int32)(unsafe.Pointer(&(_pParse.X18))), 1)
_sqlite3VdbeLoadString(tls, _1_v, _1_iReg, _pTab.X0)
_sqlite3VdbeAddOp2(tls, _1_v, i32(156), _1_iDb, _1_iReg)
goto _4
_2:
_3_pSchema = (*XSchema)(_pTab.X20)
_3_zName = _pTab.X0
func() {
if _sqlite3SchemaMutexHeld(tls, _db, i32(0), _3_pSchema) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125440), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000))), unsafe.Pointer(str(127058)))
crt.X__builtin_abort(tls)
}
}()
_3_pOld = (*XTable)(_sqlite3HashInsert(tls, (*XHash)(unsafe.Pointer(&(_3_pSchema.X2))), _3_zName, (unsafe.Pointer)(_pTab)))
if _3_pOld != nil {
_sqlite3OomFault(tls, _db)
func() {
if _pTab != _3_pOld {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125444), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabFinishParseØ00__func__Ø000))), unsafe.Pointer(str(127097)))
crt.X__builtin_abort(tls)
}
}()
return
}
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X63))))) = nil
_4:
}
// This routine takes the module argument that has been accumulating
// in pParse->zArg[] and appends it to the list of arguments on the
// virtual table currently under construction in pParse->pTable.
func _addArgumentToVtab(tls *crt.TLS, _pParse *XParse) {
var _1_n int32
var _1_z *int8
var _1_db *Xsqlite3
if (((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0) != nil) && ((*XTable)(_pParse.X63) != nil) {
_1_z = (*XToken)(unsafe.Pointer(&(_pParse.X66))).X0
_1_n = int32((*XToken)(unsafe.Pointer(&(_pParse.X66))).X1)
_1_db = (*Xsqlite3)(_pParse.X0)
_addModuleArgument(tls, _1_db, (*XTable)(_pParse.X63), _sqlite3DbStrNDup(tls, _1_db, _1_z, uint64(_1_n)))
}
}
var _sqlite3VtabFinishParseØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabFinishParseØ00__func__Ø000[0], str(127108), 23)
}
// The parser calls this routine when it first sees a CREATE VIRTUAL TABLE
// statement. The module name has been parsed, but the optional list
// of parameters that follow the module name are still pending.
func _sqlite3VtabBeginParse(tls *crt.TLS, _pParse *XParse, _pName1 *XToken, _pName2 *XToken, _pModuleName *XToken, _ifNotExists int32) {
var _iDb int32
var _db *Xsqlite3
var _pTable *XTable
_sqlite3StartTable(tls, _pParse, _pName1, _pName2, i32(0), i32(0), i32(1), _ifNotExists)
_pTable = (*XTable)(_pParse.X63)
if _pTable == nil {
return
}
func() {
if nil != (*XIndex)(_pTable.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125323), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(127131)))
crt.X__builtin_abort(tls)
}
}()
_db = (*Xsqlite3)(_pParse.X0)
_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTable.X20))
func() {
if _iDb < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125327), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(42040)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pTable.X16) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125329), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(127149)))
crt.X__builtin_abort(tls)
}
}()
_addModuleArgument(tls, _db, _pTable, _sqlite3NameFromToken(tls, _db, _pModuleName))
_addModuleArgument(tls, _db, _pTable, nil)
_addModuleArgument(tls, _db, _pTable, _sqlite3DbStrDup(tls, _db, _pTable.X0))
func() {
if (((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0) != (_pName2.X0) || (_pName2.X0) == nil) && (((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0) != (_pName1.X0) || (_pName2.X0) != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125333), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabBeginParseØ00__func__Ø000))), unsafe.Pointer(str(127171)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X50))).X1))) = uint32(int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pModuleName.X0))+1*uintptr(_pModuleName.X1))))) - uintptr(unsafe.Pointer((*XToken)(unsafe.Pointer(&(_pParse.X50))).X0))) / 1))
if (_pTable.X17) != nil {
_sqlite3AuthCheck(tls, _pParse, i32(29), _pTable.X0, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pTable.X17)) + 4*uintptr(i32(0)))), (*XDb)(unsafe.Pointer(uintptr((*Xsqlite3)(_pParse.X0).X4)+16*uintptr(_iDb))).X0)
}
}
var _sqlite3VtabBeginParseØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabBeginParseØ00__func__Ø000[0], str(127274), 22)
}
// The parser calls this routine when it sees the first token
// of an argument to the module name in a CREATE VIRTUAL TABLE statement.
func _sqlite3VtabArgInit(tls *crt.TLS, _pParse *XParse) {
_addArgumentToVtab(tls, _pParse)
*(**int8)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X0))) = nil
*(*uint32)(unsafe.Pointer(&((*XToken)(unsafe.Pointer(&(_pParse.X66))).X1))) = uint32(i32(0))
}
// The parser calls this routine for each token after the first token
// in an argument to the module name in a CREATE VIRTUAL TABLE statement.
func _sqlite3VtabArgExtend(tls *crt.TLS, _pParse *XParse, _p *XToken) {
var _pArg *XToken
_pArg = (*XToken)(unsafe.Pointer(&(_pParse.X66)))
if (_pArg.X0) == nil {
*(**int8)(unsafe.Pointer(&(_pArg.X0))) = _p.X0
*(*uint32)(unsafe.Pointer(&(_pArg.X1))) = _p.X1
goto _1
}
func() {
if uintptr(unsafe.Pointer(_pArg.X0)) > uintptr(unsafe.Pointer(_p.X0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(125471), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3VtabArgExtendØ00__func__Ø000))), unsafe.Pointer(str(127296)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_pArg.X1))) = uint32(int32((uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0))+1*uintptr(_p.X1))))) - uintptr(unsafe.Pointer(_pArg.X0))) / 1))
_1:
}
var _sqlite3VtabArgExtendØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VtabArgExtendØ00__func__Ø000[0], str(127312), 21)
}
// This routine is invoked once per CTE by the parser while parsing a
// WITH clause.
func _sqlite3WithAdd(tls *crt.TLS, _pParse *XParse, _pWith *XWith, _pName *XToken, _pArglist *XExprList, _pQuery *XSelect) (r0 *XWith) {
var _1_i, _4_nByte int32
var _zName *int8
var _db *Xsqlite3
var _pNew *XWith
_db = (*Xsqlite3)(_pParse.X0)
_zName = _sqlite3NameFromToken(tls, (*Xsqlite3)(_pParse.X0), _pName)
if _zName == nil || _pWith == nil {
goto _1
}
_1_i = i32(0)
_2:
if _1_i >= (_pWith.X0) {
goto _5
}
if _sqlite3StrICmp(tls, _zName, (*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pWith.X2)))))+16*uintptr(_1_i))).X0) == i32(0) {
_sqlite3ErrorMsg(tls, _pParse, str(127333), unsafe.Pointer(_zName))
}
_1_i += 1
goto _2
_5:
_1:
if _pWith != nil {
_4_nByte = int32(u32(24) + (u32(16) * uint32(_pWith.X0)))
_pNew = (*XWith)(_sqlite3DbRealloc(tls, _db, (unsafe.Pointer)(_pWith), uint64(_4_nByte)))
goto _8
}
_pNew = (*XWith)(_sqlite3DbMallocZero(tls, _db, uint64(u32(24))))
_8:
func() {
if (_pNew == nil || _zName == nil) && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(104109), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3WithAddØ00__func__Ø000))), unsafe.Pointer(str(127363)))
crt.X__builtin_abort(tls)
}
}()
if (_db.X17) != 0 {
_sqlite3ExprListDelete(tls, _db, _pArglist)
_sqlite3SelectDelete(tls, _db, _pQuery)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zName))
_pNew = _pWith
goto _14
}
*(**XSelect)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 16*uintptr(_pNew.X0))).X2))))) = _pQuery
*(**XExprList)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 16*uintptr(_pNew.X0))).X1))))) = _pArglist
*(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 16*uintptr(_pNew.X0))).X0))) = _zName
*(**int8)(unsafe.Pointer(&((*TCte)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]TCte)(unsafe.Pointer(&(_pNew.X2))))) + 16*uintptr(_pNew.X0))).X3))) = nil
*(*int32)(unsafe.Pointer(&(_pNew.X0))) += 1
_14:
return _pNew
}
var _sqlite3WithAddØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3WithAddØ00__func__Ø000[0], str(127405), 15)
}
// Find the appropriate action for a parser given the non-terminal
// look-ahead token iLookAhead.
func _yy_find_reduce_action(tls *crt.TLS, _stateno int32, _iLookAhead uint8) (r0 int32) {
var _i int32
func() {
if _stateno > i32(324) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137186), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127420)))
crt.X__builtin_abort(tls)
}
}()
_i = int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_reduce_ofst)) + 2*uintptr(_stateno))))
func() {
if _i == i32(-174) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137189), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127445)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_iLookAhead) == i32(252) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137190), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(26915)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_i
*p = (*p) + int32(_iLookAhead)
sink1 = *p
}
func() {
if _i < i32(0) || _i >= i32(1566) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137197), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127467)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_lookahead)) + 1*uintptr(_i)))) != int32(_iLookAhead) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(137198), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_find_reduce_actionØ00__func__Ø000))), unsafe.Pointer(str(127493)))
crt.X__builtin_abort(tls)
}
}()
return int32(*(*uint16)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_yy_action)) + 2*uintptr(_i))))
}
var _yy_find_reduce_actionØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_yy_find_reduce_actionØ00__func__Ø000[0], str(127521), 22)
}
var _yy_reduce_ofst [325]int16
func init() {
_yy_reduce_ofst = [325]int16{i16(-119), i16(1014), i16(131), i16(1031), i16(-12), i16(225), i16(228), i16(300), i16(-40), i16(-45), i16(243), i16(256), i16(293), i16(129), i16(218), i16(418), i16(79), i16(376), i16(433), i16(298), i16(16), i16(137), i16(367), i16(323), i16(-38), i16(391), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(374), i16(437), i16(443), i16(508), i16(513), i16(522), i16(532), i16(582), i16(584), i16(620), i16(633), i16(635), i16(637), i16(644), i16(646), i16(648), i16(650), i16(652), i16(659), i16(661), i16(696), i16(709), i16(711), i16(714), i16(720), i16(722), i16(724), i16(726), i16(728), i16(733), i16(772), i16(784), i16(786), i16(822), i16(834), i16(836), i16(884), i16(886), i16(922), i16(934), i16(936), i16(986), i16(989), i16(1008), i16(1016), i16(1018), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(-173), i16(544), i16(-37), i16(274), i16(299), i16(501), i16(161), i16(-173), i16(193), i16(-173), i16(-173), i16(-173), i16(-173), i16(22), i16(22), i16(22), i16(64), i16(141), i16(212), i16(342), i16(208), i16(504), i16(504), i16(132), i16(494), i16(606), i16(677), i16(678), i16(750), i16(794), i16(796), i16(-58), i16(32), i16(383), i16(660), i16(737), i16(386), i16(787), i16(800), i16(441), i16(872), i16(224), i16(850), i16(803), i16(949), i16(624), i16(830), i16(669), i16(961), i16(979), i16(983), i16(1011), i16(1013), i16(1032), i16(753), i16(789), i16(321), i16(94), i16(116), i16(304), i16(375), i16(210), i16(388), i16(392), i16(478), i16(545), i16(649), i16(721), i16(727), i16(736), i16(752), i16(795), i16(853), i16(952), i16(958), i16(1004), i16(1040), i16(1046), i16(1049), i16(1050), i16(1056), i16(1059), i16(1067), i16(559), i16(774), i16(811), i16(1068), i16(1080), i16(938), i16(1082), i16(1083), i16(1088), i16(962), i16(1089), i16(1090), i16(1052), i16(1093), i16(1094), i16(1095), i16(388), i16(1096), i16(1103), i16(1104), i16(1105), i16(1106), i16(1107), i16(965), i16(998), i16(1055), i16(1057), i16(1058), i16(938), i16(1069), i16(1071), i16(1120), i16(1073), i16(1061), i16(1062), i16(1033), i16(1076), i16(1039), i16(1108), i16(1087), i16(1099), i16(1111), i16(1066), i16(1054), i16(1112), i16(1113), i16(1091), i16(1084), i16(1135), i16(1060), i16(1133), i16(1138), i16(1064), i16(1081), i16(1139), i16(1100), i16(1119), i16(1109), i16(1124), i16(1127), i16(1140), i16(1142), i16(1168), i16(1173), i16(1132), i16(1115), i16(1147), i16(1148), i16(1137), i16(1180), i16(1182), i16(1110), i16(1121), i16(1188), i16(1189), i16(1197), i16(1181), i16(1200), i16(1202), i16(1205), i16(1203), i16(1191), i16(1192), i16(1199), i16(1206), i16(1207), i16(1209), i16(1210), i16(1211), i16(1214), i16(1212), i16(1218), i16(1219), i16(1175), i16(1183), i16(1185), i16(1184), i16(1186), i16(1190), i16(1187), i16(1196), i16(1237), i16(1193), i16(1253), i16(1194), i16(1236), i16(1195), i16(1198), i16(1238), i16(1213), i16(1221), i16(1220), i16(1227), i16(1229), i16(1271), i16(1275), i16(1284), i16(1285), i16(1289), i16(1290), i16(1292), i16(1293), i16(1201), i16(1208), i16(1216), i16(1280), i16(1281), i16(1264), i16(1269), i16(1283)}
}
// The following is executed when the parser accepts
func _yy_accept(tls *crt.TLS, _yypParser *XyyParser) {
var _pParse *XParse
_pParse = (*XParse)(_yypParser.X1)
if _yyTraceFILE != nil {
crt.Xfprintf(tls, _yyTraceFILE, str(127543), unsafe.Pointer(_yyTracePrompt))
}
func() {
if (*XyyStackEntry)(_yypParser.X0) != (*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_yypParser.X2))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138991), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_acceptØ00__func__Ø000))), unsafe.Pointer(str(127554)))
crt.X__builtin_abort(tls)
}
}()
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse
}
var _yy_acceptØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_yy_acceptØ00__func__Ø000[0], str(127591), 10)
}
// The following code executes when a syntax error first occurs.
func _yy_syntax_error(tls *crt.TLS, _yypParser *XyyParser, _yymajor int32, _yyminor XToken) {
var _pParse *XParse
_pParse = (*XParse)(_yypParser.X1)
func() {
if (*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_yyminor.X0)) + 1*uintptr(i32(0))))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(138970), unsafe.Pointer((*int8)(unsafe.Pointer(&_yy_syntax_errorØ00__func__Ø000))), unsafe.Pointer(str(127601)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3ErrorMsg(tls, _pParse, str(27285), unsafe.Pointer(&_yyminor))
*(**XParse)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_yypParser.X1))))) = _pParse
}
var _yy_syntax_errorØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_yy_syntax_errorØ00__func__Ø000[0], str(127612), 16)
}
// Clear all secondary memory allocations from the parser
func _sqlite3ParserFinalize(tls *crt.TLS, _p unsafe.Pointer) {
var _pParser *XyyParser
_pParser = (*XyyParser)(_p)
_0:
if uintptr(unsafe.Pointer((*XyyStackEntry)(_pParser.X0))) > uintptr(unsafe.Pointer((*XyyStackEntry)(unsafe.Pointer((*[100]XyyStackEntry)(unsafe.Pointer(&(_pParser.X2))))))) {
_yy_pop_parser_stack(tls, _pParser)
goto _0
}
}
// Enable or disable the shared pager and schema features.
//
// This routine has no effect on existing database connections.
// The shared cache setting effects only future calls to
// sqlite3_open(), sqlite3_open16(), or sqlite3_open_v2().
func Xsqlite3_enable_shared_cache(tls *crt.TLS, _enable int32) (r0 int32) {
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X26))) = _enable
return i32(0)
}
// Return the most recent error code generated by an SQLite routine. If NULL is
// passed to this function, we assume a malloc() failed during sqlite3_open().
func Xsqlite3_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
return _sqlite3MisuseError(tls, i32(142777))
}
if (_db == nil) || ((_db.X17) != 0) {
return _sqlite3NomemError(tls, i32(142780))
}
return (_db.X10) & (_db.X11)
}
// Return UTF-16 encoded English language explanation of the most recent
// error.
func Xsqlite3_errmsg16(tls *crt.TLS, _db *Xsqlite3) (r0 unsafe.Pointer) {
var _z unsafe.Pointer
if _db == nil {
return (unsafe.Pointer)(&_sqlite3_errmsg16Ø00outOfMemØ001)
}
if _sqlite3SafetyCheckSickOrOk(tls, _db) == 0 {
return (unsafe.Pointer)(&_sqlite3_errmsg16Ø00misuseØ002)
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if (_db.X17) != 0 {
_z = (unsafe.Pointer)(&_sqlite3_errmsg16Ø00outOfMemØ001)
goto _3
}
_z = Xsqlite3_value_text16(tls, (*XMem)(_db.X56))
if _z == nil {
_sqlite3ErrorWithMsg(tls, _db, _db.X10, _sqlite3ErrStr(tls, _db.X10))
_z = Xsqlite3_value_text16(tls, (*XMem)(_db.X56))
}
_sqlite3OomClear(tls, _db)
_3:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _z
}
var _sqlite3_errmsg16Ø00outOfMemØ001 [14]uint16
func init() {
_sqlite3_errmsg16Ø00outOfMemØ001 = [14]uint16{u16(111), u16(117), u16(116), u16(32), u16(111), u16(102), u16(32), u16(109), u16(101), u16(109), u16(111), u16(114), u16(121), u16(0)}
}
var _sqlite3_errmsg16Ø00misuseØ002 [39]uint16
func init() {
_sqlite3_errmsg16Ø00misuseØ002 = [39]uint16{u16(108), u16(105), u16(98), u16(114), u16(97), u16(114), u16(121), u16(32), u16(114), u16(111), u16(117), u16(116), u16(105), u16(110), u16(101), u16(32), u16(99), u16(97), u16(108), u16(108), u16(101), u16(100), u16(32), u16(111), u16(117), u16(116), u16(32), u16(111), u16(102), u16(32), u16(115), u16(101), u16(113), u16(117), u16(101), u16(110), u16(99), u16(101), u16(0)}
}
// Return TRUE (non-zero) of the statement supplied as an argument needs
// to be recompiled. A statement needs to be recompiled whenever the
// execution environment changes in a way that would alter the program
// that sqlite3_prepare() generates. For example, if new functions or
// collating sequences are registered or if an authorizer function is
// added or changed.
func Xsqlite3_expired(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
return bool2int((_p == nil) || (((uint32(_p.X32) << uint(i32(31))) >> uint(i32(31))) != 0))
}
// This routine frees the space the sqlite3_get_table() malloced.
func Xsqlite3_free_table(tls *crt.TLS, _azResult **int8) {
var _1_i, _1_n int32
if _azResult == nil {
goto _0
}
*(*uintptr)(unsafe.Pointer(&_azResult)) += uintptr(4294967292)
func() {
if _azResult == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(122634), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_free_tableØ00__func__Ø000))), unsafe.Pointer(str(127628)))
crt.X__builtin_abort(tls)
}
}()
_1_n = int32(uintptr(unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 4*uintptr(i32(0)))))))
_1_i = i32(1)
_3:
if _1_i >= _1_n {
goto _6
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 4*uintptr(_1_i)))) != nil {
Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azResult)) + 4*uintptr(_1_i)))))
}
_1_i += 1
goto _3
_6:
Xsqlite3_free(tls, (unsafe.Pointer)(_azResult))
_0:
}
var _sqlite3_free_tableØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_free_tableØ00__func__Ø000[0], str(127640), 19)
}
// Test to see whether or not the database connection is in autocommit
// mode. Return TRUE if it is and FALSE if not. Autocommit mode is on
// by default. Autocommit is disabled by a BEGIN statement and reenabled
// by the next COMMIT or ROLLBACK.
func Xsqlite3_get_autocommit(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(143772))
return i32(0)
}
return int32(_db.X15)
}
// Return the auxiliary data pointer, if any, for the iArg'th argument to
// the user-function defined by pCtx.
//
// The left-most argument is 0.
//
// Undocumented behavior: If iArg is negative then access a cache of
// auxiliary data pointers that is available to all functions within a
// single prepared statement. The iArg values must match.
func Xsqlite3_get_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32) (r0 unsafe.Pointer) {
var _pAuxData *XAuxData
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76913), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_get_auxdataØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*TVdbe)(_pCtx.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76917), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_get_auxdataØ00__func__Ø000))), unsafe.Pointer(str(127659)))
crt.X__builtin_abort(tls)
}
}()
_pAuxData = (*XAuxData)((*TVdbe)(_pCtx.X3).X43)
_4:
if _pAuxData == nil {
goto _7
}
if ((_pAuxData.X1) == _iArg) && (((_pAuxData.X0) == (_pCtx.X4)) || (_iArg < i32(0))) {
return _pAuxData.X2
}
_pAuxData = (*XAuxData)(_pAuxData.X4)
goto _4
_7:
return nil
}
var _sqlite3_get_auxdataØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_get_auxdataØ00__func__Ø000[0], str(127674), 20)
}
// Query the database. But instead of invoking a callback for each row,
// malloc() for space to hold the result and return the entire results
// at the conclusion of the call.
//
// The result that is written to ***pazResult is held in memory obtained
// from malloc(). But the caller cannot free this memory directly.
// Instead, the entire table should be passed to sqlite3_free_table() when
// the calling procedure is finished using it.
func Xsqlite3_get_table(tls *crt.TLS, _db *Xsqlite3, _zSql *int8, _pazResult ***int8, _pnRow *int32, _pnColumn *int32, _pzErrMsg **int8) (r0 int32) {
var _rc int32
var _6_azNew **int8
var _res XTabResult
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pazResult == nil) {
return _sqlite3MisuseError(tls, i32(122571))
}
*_pazResult = nil
if _pnColumn != nil {
*_pnColumn = i32(0)
}
if _pnRow != nil {
*_pnRow = i32(0)
}
if _pzErrMsg != nil {
*_pzErrMsg = nil
}
*(**int8)(unsafe.Pointer(&(_res.X1))) = nil
*(*uint32)(unsafe.Pointer(&(_res.X3))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_res.X4))) = uint32(i32(0))
*(*uint32)(unsafe.Pointer(&(_res.X5))) = uint32(i32(1))
*(*uint32)(unsafe.Pointer(&(_res.X2))) = uint32(i32(20))
*(*int32)(unsafe.Pointer(&(_res.X6))) = i32(0)
*(***int8)(unsafe.Pointer(&(_res.X0))) = (**int8)(Xsqlite3_malloc64(tls, uint64(u32(4)*(_res.X2))))
if (_res.X0) == nil {
*(*int32)(unsafe.Pointer(&(_db.X10))) = i32(7)
return _sqlite3NomemError(tls, i32(122586))
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 4*uintptr(i32(0)))) = nil
_rc = Xsqlite3_exec(tls, _db, _zSql, _sqlite3_get_table_cb, (unsafe.Pointer)(&_res), _pzErrMsg)
i32(0)
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 4*uintptr(i32(0)))) = (*int8)((unsafe.Pointer)(uintptr(int32(_res.X5))))
if (_rc & i32(255)) != i32(4) {
goto _6
}
Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+4*uintptr(i32(1)))))
if (_res.X1) == nil {
goto _7
}
if _pzErrMsg != nil {
Xsqlite3_free(tls, (unsafe.Pointer)(*_pzErrMsg))
*_pzErrMsg = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(_res.X1))
}
Xsqlite3_free(tls, (unsafe.Pointer)(_res.X1))
_7:
*(*int32)(unsafe.Pointer(&(_db.X10))) = _res.X6
return _res.X6
_6:
Xsqlite3_free(tls, (unsafe.Pointer)(_res.X1))
if _rc != i32(0) {
Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+4*uintptr(i32(1)))))
return _rc
}
if (_res.X2) <= (_res.X5) {
goto _10
}
_6_azNew = (**int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_res.X0), uint64(u32(4)*(_res.X5))))
if _6_azNew == nil {
Xsqlite3_free_table(tls, (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0))+4*uintptr(i32(1)))))
*(*int32)(unsafe.Pointer(&(_db.X10))) = i32(7)
return _sqlite3NomemError(tls, i32(122615))
}
*(***int8)(unsafe.Pointer(&(_res.X0))) = _6_azNew
_10:
*_pazResult = (**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_res.X0)) + 4*uintptr(i32(1))))
if _pnColumn != nil {
*_pnColumn = int32(_res.X4)
}
if _pnRow != nil {
*_pnRow = int32(_res.X3)
}
return _rc
_ = _res
panic(0)
}
// This routine is called once for each row in the result table. Its job
// is to fill in the TabResult structure appropriately, allocating new
// memory as necessary.
func _sqlite3_get_table_cb(tls *crt.TLS, _pArg unsafe.Pointer, _nCol int32, _argv **int8, _colv **int8) (r0 int32) {
var _need, _i, _10_n int32
var _z *int8
var _3_azNew **int8
var _p *XTabResult
_p = (*XTabResult)(_pArg)
if ((_p.X3) == uint32(i32(0))) && (_argv != nil) {
_need = _nCol * i32(2)
goto _2
}
_need = _nCol
_2:
if ((_p.X5) + uint32(_need)) <= (_p.X2) {
goto _3
}
*(*uint32)(unsafe.Pointer(&(_p.X2))) = ((_p.X2) * uint32(i32(2))) + uint32(_need)
_3_azNew = (**int8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_p.X0), uint64(u32(4)*(_p.X2))))
if _3_azNew == nil {
goto _malloc_failed
}
*(***int8)(unsafe.Pointer(&(_p.X0))) = _3_azNew
_3:
if (_p.X3) != uint32(i32(0)) {
goto _5
}
*(*uint32)(unsafe.Pointer(&(_p.X4))) = uint32(_nCol)
_i = i32(0)
_6:
if _i >= _nCol {
goto _9
}
_z = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_colv)) + 4*uintptr(_i)))))
if _z == nil {
goto _malloc_failed
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 4*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X5))), uint32(1))))) = _z
_i += 1
goto _6
_9:
goto _12
_5:
if int32(_p.X4) != _nCol {
Xsqlite3_free(tls, (unsafe.Pointer)(_p.X1))
*(**int8)(unsafe.Pointer(&(_p.X1))) = Xsqlite3_mprintf(tls, str(127694))
*(*int32)(unsafe.Pointer(&(_p.X6))) = i32(1)
return i32(1)
}
_12:
if _argv == nil {
goto _13
}
_i = i32(0)
_14:
if _i >= _nCol {
goto _17
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i)))) == nil {
_z = nil
goto _19
}
_10_n = _sqlite3Strlen30(tls, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i)))) + i32(1)
_z = (*int8)(Xsqlite3_malloc64(tls, uint64(_10_n)))
if _z == nil {
goto _malloc_failed
}
crt.Xmemcpy(tls, (unsafe.Pointer)(_z), (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i)))), uint32(_10_n))
_19:
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X0)) + 4*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X5))), uint32(1))))) = _z
_i += 1
goto _14
_17:
*(*uint32)(unsafe.Pointer(&(_p.X3))) += 1
_13:
return i32(0)
_malloc_failed:
*(*int32)(unsafe.Pointer(&(_p.X6))) = _sqlite3NomemError(tls, i32(122545))
return i32(1)
}
// Cause any pending operation to stop at its earliest opportunity.
func Xsqlite3_interrupt(tls *crt.TLS, _db *Xsqlite3) {
if (_sqlite3SafetyCheckOk(tls, _db) == 0) && ((_db == nil) || ((_db.X28) != uint32(i32(1691352191)))) {
_sqlite3MisuseError(tls, i32(142055))
return
}
*(*int32)(unsafe.Pointer((*t9)(unsafe.Pointer(&(_db.X57))))) = i32(1)
}
// Return the ROWID of the most recent insert
func Xsqlite3_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3) (r0 int64) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(141385))
return int64(i32(0))
}
return _db.X7
}
// IMPLEMENTATION-OF: R-53536-42575 The sqlite3_libversion() function returns
// a pointer to the to the sqlite3_version[] string constant.
func Xsqlite3_libversion(tls *crt.TLS) (r0 *int8) {
return (*int8)(unsafe.Pointer(&Xsqlite3_version))
}
var Xsqlite3_version [7]int8
func init() {
crt.Xstrncpy(nil, &Xsqlite3_version[0], str(127759), 7)
}
// IMPLEMENTATION-OF: R-35210-63508 The sqlite3_libversion_number() function
// returns an integer equal to SQLITE_VERSION_NUMBER.
func Xsqlite3_libversion_number(tls *crt.TLS) (r0 int32) {
return i32(3019003)
}
// Open a new database handle.
func Xsqlite3_open(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3) (r0 int32) {
return _openDatabase(tls, _zFilename, _ppDb, uint32(i32(6)), nil)
}
// This routine does the work of opening a database on behalf of
// sqlite3_open() and sqlite3_open16(). The database filename "zFilename"
// is UTF-8 encoded.
func _openDatabase(tls *crt.TLS, _zFilename *int8, _ppDb **Xsqlite3, _flags uint32, _zVfs *int8) (r0 int32) {
var _rc, _isThreadsafe int32
var _zOpen, _zErrMsg *int8
var _db *Xsqlite3
_zOpen = nil
_zErrMsg = nil
if _ppDb == nil {
return _sqlite3MisuseError(tls, i32(143267))
}
*_ppDb = nil
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return _rc
}
i32(0)
i32(0)
i32(0)
if ((i32(1) << uint(int32(_flags&uint32(i32(7))))) & i32(70)) == i32(0) {
return _sqlite3MisuseError(tls, i32(143292))
}
if (_sqlite3Config.X1) == i32(0) {
_isThreadsafe = i32(0)
goto _8
}
if (_flags & uint32(i32(32768))) != 0 {
_isThreadsafe = i32(0)
goto _8
}
if (_flags & uint32(i32(65536))) != 0 {
_isThreadsafe = i32(1)
goto _8
}
_isThreadsafe = _sqlite3Config.X2
_8:
if (_flags & uint32(i32(262144))) != 0 {
{
p := &_flags
*p = (*p) & uint32(i32(-131073))
sink5 = *p
}
goto _11
}
if (_sqlite3Config.X26) != 0 {
{
p := &_flags
*p = (*p) | uint32(i32(131072))
sink5 = *p
}
}
_11:
{
p := &_flags
*p = (*p) & uint32(i32(-655129))
sink5 = *p
}
_db = (*Xsqlite3)(_sqlite3MallocZero(tls, uint64(u32(456))))
if _db == nil {
goto _opendb_out
}
if _isThreadsafe == 0 {
goto _13
}
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X3))))) = _sqlite3MutexAlloc(tls, i32(1))
if (*Xsqlite3_mutex)(_db.X3) == nil {
Xsqlite3_free(tls, (unsafe.Pointer)(_db))
_db = nil
goto _opendb_out
}
_13:
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*int32)(unsafe.Pointer(&(_db.X11))) = i32(255)
*(*int32)(unsafe.Pointer(&(_db.X5))) = i32(2)
*(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(4030429446)
*(**XDb)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X4))))) = (*XDb)(unsafe.Pointer((*[2]XDb)(unsafe.Pointer(&(_db.X72)))))
i32(0)
crt.Xmemcpy(tls, (unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31)))), (unsafe.Pointer)(&_aHardLimit), u32(48))
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(11)))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_db.X15))) = uint8(i32(1))
*(*int8)(unsafe.Pointer(&(_db.X20))) = int8(i32(-1))
*(*int64)(unsafe.Pointer(&(_db.X8))) = _sqlite3Config.X17
*(*int32)(unsafe.Pointer(&(_db.X27))) = i32(0)
*(*int32)(unsafe.Pointer(&(_db.X32))) = i32(2147483647)
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(17825888)
sink1 = *p
}
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_db.X70))))
_sqlite3HashInit(tls, (*XHash)(unsafe.Pointer(&(_db.X65))))
_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(1)), nil, _binCollFunc, nil)
_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(3)), nil, _binCollFunc, nil)
_createCollation(tls, _db, (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(i32(2)), nil, _binCollFunc, nil)
_createCollation(tls, _db, str(103035), uint8(i32(1)), nil, _nocaseCollatingFunc, nil)
_createCollation(tls, _db, str(127766), uint8(i32(1)), (unsafe.Pointer)(uintptr(u32(1))), _binCollFunc, nil)
if (_db.X17) != 0 {
goto _opendb_out
}
*(**XCollSeq)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X2))))) = _sqlite3FindCollSeq(tls, _db, uint8(i32(1)), (*int8)(unsafe.Pointer(&_sqlite3StrBINARY)), i32(0))
func() {
if (*XCollSeq)(_db.X2) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143411), unsafe.Pointer((*int8)(unsafe.Pointer(&_openDatabaseØ00__func__Ø000))), unsafe.Pointer(str(127772)))
crt.X__builtin_abort(tls)
}
}()
*(*uint32)(unsafe.Pointer(&(_db.X9))) = _flags
_rc = _sqlite3ParseUri(tls, _zVfs, _zFilename, &_flags, (**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_db.X0))))), &_zOpen, &_zErrMsg)
if _rc == i32(0) {
goto _18
}
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
if _zErrMsg != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_zErrMsg))
Xsqlite3_free(tls, (unsafe.Pointer)(_zErrMsg))
goto _opendb_out
_18:
_rc = _sqlite3BtreeOpen(tls, (*Xsqlite3_vfs)(_db.X0), _zOpen, _db, (**XBtree)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X1))))), i32(0), int32(_flags|uint32(i32(256))))
if _rc == i32(0) {
goto _22
}
if _rc == i32(3082) {
_rc = _sqlite3NomemError(tls, i32(143428))
}
_sqlite3Error(tls, _db, _rc)
goto _opendb_out
_22:
_sqlite3BtreeEnter(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1))
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4))))) = _sqlite3SchemaGet(tls, _db, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1))
if (_db.X17) == 0 {
*(*uint8)(unsafe.Pointer(&(_db.X14))) = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X4).X8
}
_sqlite3BtreeLeave(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(i32(0)))).X1))
*(**XSchema)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X4))))) = _sqlite3SchemaGet(tls, _db, nil)
*(**int8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X0))) = str(60448)
*(*uint8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X2))) = uint8(i32(3))
*(**int8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X0))) = str(23842)
*(*uint8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(1)))).X2))) = uint8(i32(1))
*(*uint32)(unsafe.Pointer(&(_db.X28))) = u32(2687084183)
if (_db.X17) != 0 {
goto _opendb_out
}
_sqlite3Error(tls, _db, i32(0))
_sqlite3RegisterPerConnectionBuiltinFunctions(tls, _db)
_rc = Xsqlite3_errcode(tls, _db)
if _rc != i32(0) {
goto _26
}
_sqlite3AutoLoadExtensions(tls, _db)
_rc = Xsqlite3_errcode(tls, _db)
if _rc != i32(0) {
goto _opendb_out
}
_26:
if _rc != 0 {
_sqlite3Error(tls, _db, _rc)
}
_setupLookaside(tls, _db, nil, _sqlite3Config.X7, _sqlite3Config.X8)
Xsqlite3_wal_autocheckpoint(tls, _db, i32(1000))
_opendb_out:
if _db != nil {
func() {
if (*Xsqlite3_mutex)(_db.X3) == nil && _isThreadsafe != i32(0) && (_sqlite3Config.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143544), unsafe.Pointer((*int8)(unsafe.Pointer(&_openDatabaseØ00__func__Ø000))), unsafe.Pointer(str(127789)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
}
_rc = Xsqlite3_errcode(tls, _db)
func() {
if _db == nil && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143549), unsafe.Pointer((*int8)(unsafe.Pointer(&_openDatabaseØ00__func__Ø000))), unsafe.Pointer(str(127858)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(7) {
Xsqlite3_close(tls, _db)
_db = nil
goto _39
}
if _rc != i32(0) {
*(*uint32)(unsafe.Pointer(&(_db.X28))) = uint32(i32(1266094736))
}
_39:
*_ppDb = _db
Xsqlite3_free(tls, (unsafe.Pointer)(_zOpen))
return _rc & i32(255)
}
// This is the default collating function named "BINARY" which is always
// available.
//
// If the padFlag argument is not NULL then space padding at the end
// of strings is ignored. This implements the RTRIM collation.
func _binCollFunc(tls *crt.TLS, _padFlag unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
var _rc, _n int32
_n = func() int32 {
if _nKey1 < _nKey2 {
return _nKey1
}
return _nKey2
}()
_rc = crt.Xmemcmp(tls, _pKey1, _pKey2, uint32(_n))
if _rc != i32(0) {
goto _2
}
if ((_padFlag != nil) && _allSpaces(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pKey1)))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_n))))))), _nKey1-_n) != 0) && _allSpaces(tls, (*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(_pKey2)))+uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_n))))))), _nKey2-_n) != 0 {
goto _6
}
_rc = _nKey1 - _nKey2
_6:
_2:
return _rc
}
// Return true if the buffer z[0..n-1] contains all spaces.
func _allSpaces(tls *crt.TLS, _z *int8, _n int32) (r0 int32) {
_0:
if (_n > i32(0)) && (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(_n-i32(1))))) == i32(32)) {
_n -= 1
goto _0
}
return bool2int(_n == i32(0))
}
// Another built-in collating sequence: NOCASE.
//
// This collating sequence is intended to be used for "case independent
// comparison". SQLite's knowledge of upper and lower case equivalents
// extends only to the 26 characters used in the English language.
//
// At the moment there is only a UTF-8 implementation.
func _nocaseCollatingFunc(tls *crt.TLS, _NotUsed unsafe.Pointer, _nKey1 int32, _pKey1 unsafe.Pointer, _nKey2 int32, _pKey2 unsafe.Pointer) (r0 int32) {
var _r int32
_r = Xsqlite3_strnicmp(tls, (*int8)(_pKey1), (*int8)(_pKey2), func() int32 {
if _nKey1 < _nKey2 {
return _nKey1
}
return _nKey2
}())
if i32(0) == _r {
_r = _nKey1 - _nKey2
}
return _r
}
var _openDatabaseØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_openDatabaseØ00__func__Ø000[0], str(127884), 13)
}
// This routine does per-connection function registration. Most
// of the built-in functions above are part of the global function set.
// This routine only deals with those that are not global.
func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *crt.TLS, _db *Xsqlite3) {
var _rc int32
_rc = Xsqlite3_overload_function(tls, _db, str(25276), i32(2))
func() {
if _rc != i32(7) && _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107204), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000))), unsafe.Pointer(str(127897)))
crt.X__builtin_abort(tls)
}
}()
if _rc == i32(7) {
_sqlite3OomFault(tls, _db)
}
}
// Declare that a function has been overloaded by a virtual table.
//
// If the function already exists as a regular global function, then
// this routine is a no-op. If the function does not exist, then create
// a new one that always throws a run-time error.
//
// When virtual tables intend to provide an overloaded function, they
// should call this routine to make sure the global function exists.
// A global function must exist in order for name resolution to work
// properly.
func Xsqlite3_overload_function(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _nArg int32) (r0 int32) {
var _rc int32
_rc = i32(0)
if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil)) || (_nArg < i32(-2)) {
return _sqlite3MisuseError(tls, i32(142274))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _sqlite3FindFunction(tls, _db, _zName, _nArg, uint8(i32(1)), uint8(i32(0))) == nil {
_rc = _sqlite3CreateFunc(tls, _db, _zName, _nArg, i32(1), nil, _sqlite3InvalidFunction, nil, nil, nil)
}
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// The following is the implementation of an SQL function that always
// fails with an error message stating that the function is used in the
// wrong context. The sqlite3_overload_function() API might construct
// SQL function that use this routine so that the functions will exist
// for name resolution but are actually overloaded by the xFindFunction
// method of virtual tables.
func _sqlite3InvalidFunction(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
var _zName, _zErr *int8
_zName = (*XFuncDef)(_context.X1).X6
_ = _NotUsed2
_zErr = Xsqlite3_mprintf(tls, str(127931), unsafe.Pointer(_zName))
Xsqlite3_result_error(tls, _context, _zErr, i32(-1))
Xsqlite3_free(tls, (unsafe.Pointer)(_zErr))
}
var _sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000 [45]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3RegisterPerConnectionBuiltinFunctionsØ00__func__Ø000[0], str(127982), 45)
}
// Load all automatic extensions.
//
// If anything goes wrong, set an error in the database connection.
func _sqlite3AutoLoadExtensions(tls *crt.TLS, _db *Xsqlite3) {
var _go, _rc int32
var _i uint32
var _2_zErrmsg *int8
var _2_mutex *Xsqlite3_mutex
var _xInit func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32
var _2_pThunk *Xsqlite3_api_routines
_go = i32(1)
if (_sqlite3Autoext.X0) == uint32(i32(0)) {
return
}
_i = uint32(i32(0))
_1:
if _go == 0 {
goto _4
}
_2_mutex = _sqlite3MutexAlloc(tls, i32(2))
_2_pThunk = &_sqlite3Apis
Xsqlite3_mutex_enter(tls, _2_mutex)
if _i >= (_sqlite3Autoext.X0) {
_xInit = nil
_go = i32(0)
goto _6
}
_xInit = *(*func(*crt.TLS, *Xsqlite3, **int8, *Xsqlite3_api_routines) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_i))))}))
_6:
Xsqlite3_mutex_leave(tls, _2_mutex)
_2_zErrmsg = nil
if (_xInit != nil) && (store1(&_rc, _xInit(tls, _db, &_2_zErrmsg, _2_pThunk)) != i32(0)) {
_sqlite3ErrorWithMsg(tls, _db, _rc, str(128027), unsafe.Pointer(_2_zErrmsg))
_go = i32(0)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_2_zErrmsg))
_i += 1
goto _1
_4:
}
var _sqlite3Autoext Tsqlite3AutoExtList
// Set up the lookaside buffers for a database connection.
// Return SQLITE_OK on success.
// If lookaside is already active, return SQLITE_BUSY.
//
// The sz parameter is the number of bytes in each lookaside slot.
// The cnt parameter is the number of slots. If pStart is NULL the
// space for the lookaside memory is obtained from sqlite3_malloc().
// If pStart is not NULL then it is sz*cnt bytes of memory to use for
// the lookaside memory.
func _setupLookaside(tls *crt.TLS, _db *Xsqlite3, _pBuf unsafe.Pointer, _sz int32, _cnt int32) (r0 int32) {
var _6_i int32
var _pStart unsafe.Pointer
var _6_p *Xsqlite3_file
if ((*t7)(unsafe.Pointer(&(_db.X58))).X3) != 0 {
return i32(5)
}
if ((*t7)(unsafe.Pointer(&(_db.X58))).X2) != 0 {
Xsqlite3_free(tls, (*t7)(unsafe.Pointer(&(_db.X58))).X7)
}
_sz = _sz & i32(-8)
if _sz <= i32(4) {
_sz = i32(0)
}
if _cnt < i32(0) {
_cnt = i32(0)
}
if (_sz == i32(0)) || (_cnt == i32(0)) {
_sz = i32(0)
_pStart = nil
goto _9
}
if _pBuf != nil {
goto _7
}
_sqlite3BeginBenignMalloc(tls)
_pStart = _sqlite3Malloc(tls, uint64(_sz*_cnt))
_sqlite3EndBenignMalloc(tls)
if _pStart != nil {
_cnt = _sqlite3MallocSize(tls, _pStart) / _sz
}
goto _9
_7:
_pStart = _pBuf
_9:
*(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X7))) = _pStart
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = nil
*(*uint16)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X1))) = uint16(_sz)
if _pStart == nil {
goto _10
}
func() {
if _sz <= i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(141165), unsafe.Pointer((*int8)(unsafe.Pointer(&_setupLookasideØ00__func__Ø000))), unsafe.Pointer(str(128066)))
crt.X__builtin_abort(tls)
}
}()
_6_p = (*Xsqlite3_file)(_pStart)
_6_i = _cnt - i32(1)
_13:
if _6_i < i32(0) {
goto _16
}
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_6_p.X0))))) = (*Xsqlite3_file)((*t7)(unsafe.Pointer(&(_db.X58))).X6)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X6))))) = _6_p
_6_p = (*Xsqlite3_file)(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_6_p)) + 1*uintptr(_sz)))))
_6_i -= 1
goto _13
_16:
*(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X8))) = (unsafe.Pointer)(_6_p)
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) = uint32(i32(0))
*(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X2))) = uint8(func() int32 {
if _pBuf == nil {
return i32(1)
}
return i32(0)
}())
goto _19
_10:
*(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X7))) = (unsafe.Pointer)(_db)
*(*unsafe.Pointer)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X8))) = (unsafe.Pointer)(_db)
*(*uint32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X0))) = uint32(i32(1))
*(*uint8)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X2))) = uint8(i32(0))
_19:
return i32(0)
}
var _setupLookasideØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_setupLookasideØ00__func__Ø000[0], str(128099), 15)
}
// Open a new database handle.
func Xsqlite3_open16(tls *crt.TLS, _zFilename unsafe.Pointer, _ppDb **Xsqlite3) (r0 int32) {
var _rc int32
var _zFilename8 *int8
var _pVal *XMem
if _ppDb == nil {
return _sqlite3MisuseError(tls, i32(143617))
}
*_ppDb = nil
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return _rc
}
if _zFilename == nil {
_zFilename = (unsafe.Pointer)(str(128114))
}
_pVal = _sqlite3ValueNew(tls, nil)
_sqlite3ValueSetStr(tls, _pVal, i32(-1), _zFilename, uint8(i32(2)), nil)
_zFilename8 = (*int8)(_sqlite3ValueText(tls, _pVal, uint8(i32(1))))
if _zFilename8 == nil {
goto _3
}
_rc = _openDatabase(tls, _zFilename8, _ppDb, uint32(i32(6)), nil)
func() {
if (*_ppDb) == nil && _rc != i32(7) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(143631), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_open16Ø00__func__Ø000))), unsafe.Pointer(str(128117)))
crt.X__builtin_abort(tls)
}
}()
if (_rc == i32(0)) && ((int32((*XSchema)((*XDb)(unsafe.Pointer(uintptr((*_ppDb).X4)+16*uintptr(i32(0)))).X4).X9) & i32(1)) != i32(1)) {
*(*uint8)(unsafe.Pointer(&((*XSchema)((*XDb)(unsafe.Pointer(uintptr((*_ppDb).X4) + 16*uintptr(i32(0)))).X4).X8))) = store2((*uint8)(unsafe.Pointer(&((*_ppDb).X14))), uint8(i32(2)))
}
goto _9
_3:
_rc = _sqlite3NomemError(tls, i32(143636))
_9:
_sqlite3ValueFree(tls, _pVal)
return _rc & i32(255)
}
var _sqlite3_open16Ø00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_open16Ø00__func__Ø000[0], str(128143), 15)
}
// Two versions of the official API. Legacy and new use. In the legacy
// version, the original SQL text is not saved in the prepared statement
// and so if a schema change occurs, SQLITE_SCHEMA is returned by
// sqlite3_step(). In the new version, the original SQL text is retained
// and the statement is automatically recompiled if an schema change
// occurs.
func Xsqlite3_prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
var _rc int32
_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, i32(0), _ppStmt, _pzTail)
func() {
if _rc != i32(0) && _ppStmt != nil && *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116502), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_prepare16Ø00__func__Ø000))), unsafe.Pointer(str(50464)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
// Compile the UTF-16 encoded SQL statement zSql into a statement handle.
func _sqlite3Prepare16(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _saveSqlFlag int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
var _rc, _2_sz, _5_chars_parsed int32
var _zSql8, _zTail8, _2_z *int8
_zTail8 = nil
_rc = i32(0)
if _ppStmt == nil {
return _sqlite3MisuseError(tls, i32(116452))
}
*_ppStmt = nil
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zSql == nil) {
return _sqlite3MisuseError(tls, i32(116456))
}
if _nBytes < i32(0) {
goto _3
}
_2_z = (*int8)(_zSql)
_2_sz = i32(0)
_4:
if _2_sz >= _nBytes || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_z)) + 1*uintptr(_2_sz)))) == i32(0) && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_2_z)) + 1*uintptr(_2_sz+i32(1))))) == i32(0) {
goto _9
}
{
p := &_2_sz
*p = (*p) + i32(2)
sink1 = *p
}
goto _4
_9:
_nBytes = _2_sz
_3:
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_zSql8 = _sqlite3Utf16to8(tls, _db, _zSql, _nBytes, uint8(i32(2)))
if _zSql8 != nil {
_rc = _sqlite3LockAndPrepare(tls, _db, _zSql8, i32(-1), _saveSqlFlag, nil, _ppStmt, &_zTail8)
}
if (_zTail8 != nil) && (_pzTail != nil) {
_5_chars_parsed = _sqlite3Utf8CharLen(tls, _zSql8, int32((uintptr(unsafe.Pointer(_zTail8))-uintptr(unsafe.Pointer(_zSql8)))/1))
*_pzTail = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer((*uint8)(_zSql))) + uintptr(unsafe.Pointer((*uint8)(unsafe.Pointer(uintptr(_sqlite3Utf16ByteLen(tls, _zSql, _5_chars_parsed)))))))))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zSql8))
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// zIn is a UTF-16 encoded unicode string at least nChar characters long.
// Return the number of bytes in the first nChar unicode characters
// in pZ. nChar must be non-negative.
func _sqlite3Utf16ByteLen(tls *crt.TLS, _zIn unsafe.Pointer, _nChar int32) (r0 int32) {
var _c, _n, _4_c2, _8_c2 int32
var _z *uint8
_z = (*uint8)(_zIn)
_n = i32(0)
goto _0
_0:
_7:
if _n >= _nChar {
goto _8
}
_c = int32(*postInc13(&_z, 1))
{
p := &_c
*p = (*p) + (int32(*postInc13(&_z, 1)) << uint(i32(8)))
sink1 = *p
}
if ((_c >= i32(55296)) && (_c < i32(57344))) && i32(1) != 0 {
_8_c2 = int32(*postInc13(&_z, 1))
{
p := &_8_c2
*p = (*p) + (int32(*postInc13(&_z, 1)) << uint(i32(8)))
sink1 = *p
}
_c = ((_8_c2 & i32(1023)) + ((_c & i32(63)) << uint(i32(10)))) + (((_c & i32(960)) + i32(64)) << uint(i32(10)))
}
_n += 1
goto _7
_8:
return int32((uintptr(unsafe.Pointer(_z)) - uintptr(unsafe.Pointer((*uint8)(_zIn)))) / 1)
_ = _4_c2
panic(0)
}
var _sqlite3_prepare16Ø00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_prepare16Ø00__func__Ø000[0], str(128158), 18)
}
// Register a profile function. The pArg from the previously registered
// profile function is returned.
//
// A NULL profile function means that no profiling is executes. A non-NULL
// profile is a pointer to a function that is invoked at the conclusion of
// each SQL statement that is run.
func Xsqlite3_profile(tls *crt.TLS, _db *Xsqlite3, _xProfile func(*crt.TLS, unsafe.Pointer, *int8, uint64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pOld unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142357))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pOld = _db.X44
*(*func(*crt.TLS, unsafe.Pointer, *int8, uint64))(unsafe.Pointer(&(_db.X43))) = _xProfile
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X44))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pOld
}
// This routine sets the progress callback for an Sqlite database to the
// given callback function with the given argument. The progress callback will
// be invoked every nOps opcodes.
func Xsqlite3_progress_handler(tls *crt.TLS, _db *Xsqlite3, _nOps int32, _xProgress func(*crt.TLS, unsafe.Pointer) int32, _pArg unsafe.Pointer) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142013))
return
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _nOps > i32(0) {
*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X61))) = _xProgress
*(*uint32)(unsafe.Pointer(&(_db.X63))) = uint32(_nOps)
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X62))) = _pArg
goto _2
}
*(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X61))) = nil
*(*uint32)(unsafe.Pointer(&(_db.X63))) = uint32(i32(0))
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X62))) = nil
_2:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
}
// The public interface to sqlite3Realloc. Make sure that the memory
// subsystem is initialized prior to invoking sqliteRealloc.
func Xsqlite3_realloc(tls *crt.TLS, _pOld unsafe.Pointer, _n int32) (r0 unsafe.Pointer) {
if Xsqlite3_initialize(tls) != 0 {
return nil
}
if _n < i32(0) {
_n = i32(0)
}
return _sqlite3Realloc(tls, _pOld, uint64(_n))
}
func Xsqlite3_result_error16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76458), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_error16Ø00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(1)
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
_sqlite3VdbeMemSetStr(tls, (*XMem)(_pCtx.X0), (*int8)(_z), _n, uint8(i32(2)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
var _sqlite3_result_error16Ø00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_error16Ø00__func__Ø000[0], str(128176), 23)
}
func Xsqlite3_result_int64(tls *crt.TLS, _pCtx *Xsqlite3_context, _iVal int64) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76469), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_int64Ø00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetInt64(tls, (*XMem)(_pCtx.X0), _iVal)
}
var _sqlite3_result_int64Ø00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_int64Ø00__func__Ø000[0], str(128199), 21)
}
func Xsqlite3_result_null(tls *crt.TLS, _pCtx *Xsqlite3_context) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76473), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_nullØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetNull(tls, (*XMem)(_pCtx.X0))
}
var _sqlite3_result_nullØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_nullØ00__func__Ø000[0], str(128220), 20)
}
func Xsqlite3_result_text16(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text16Ø00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(i32(2)), _xDel)
}
var _sqlite3_result_text16Ø00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_text16Ø00__func__Ø000[0], str(128240), 22)
}
func Xsqlite3_result_text16be(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76523), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text16beØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(i32(3)), _xDel)
}
var _sqlite3_result_text16beØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_text16beØ00__func__Ø000[0], str(128262), 24)
}
func Xsqlite3_result_text16le(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n int32, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76532), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text16leØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_setResultStrOrError(tls, _pCtx, (*int8)(_z), _n, uint8(i32(2)), _xDel)
}
var _sqlite3_result_text16leØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_text16leØ00__func__Ø000[0], str(128286), 24)
}
// Register a callback to be invoked each time a transaction is rolled
// back by this database connection.
func Xsqlite3_rollback_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pRet unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142435))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pRet = _db.X47
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_db.X48))) = _xCallback
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X47))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pRet
}
// Set or clear the access authorization function.
//
// The access authorization function is be called during the compilation
// phase to verify that the user has read and/or write access permission on
// various fields of the database. The first argument to the auth function
// is a copy of the 3rd argument to this routine. The second argument
// to the auth function is one of these constants:
//
// SQLITE_CREATE_INDEX
// SQLITE_CREATE_TABLE
// SQLITE_CREATE_TEMP_INDEX
// SQLITE_CREATE_TEMP_TABLE
// SQLITE_CREATE_TEMP_TRIGGER
// SQLITE_CREATE_TEMP_VIEW
// SQLITE_CREATE_TRIGGER
// SQLITE_CREATE_VIEW
// SQLITE_DELETE
// SQLITE_DROP_INDEX
// SQLITE_DROP_TABLE
// SQLITE_DROP_TEMP_INDEX
// SQLITE_DROP_TEMP_TABLE
// SQLITE_DROP_TEMP_TRIGGER
// SQLITE_DROP_TEMP_VIEW
// SQLITE_DROP_TRIGGER
// SQLITE_DROP_VIEW
// SQLITE_INSERT
// SQLITE_PRAGMA
// SQLITE_READ
// SQLITE_SELECT
// SQLITE_TRANSACTION
// SQLITE_UPDATE
//
// The third and fourth arguments to the auth function are the name of
// the table and the column that are being accessed. The auth function
// should return either SQLITE_OK, SQLITE_DENY, or SQLITE_IGNORE. If
// SQLITE_OK is returned, it means that access is allowed. SQLITE_DENY
// means that the SQL statement will never-run - the sqlite3_exec() call
// will return with an error. SQLITE_IGNORE means that the SQL statement
// should run but attempts to read the specified column will return NULL
// and attempts to write the column will be ignored.
//
// Setting the auth function to NULL disables this hook. The default
// setting of the auth function is NULL.
func Xsqlite3_set_authorizer(tls *crt.TLS, _db *Xsqlite3, _xAuth func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, _pArg unsafe.Pointer) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(99496))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32)(unsafe.Pointer(&(_db.X59))) = _xAuth
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X60))) = _pArg
_sqlite3ExpirePreparedStatements(tls, _db)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// Set the auxiliary data pointer and delete function, for the iArg'th
// argument to the user-function defined by pCtx. Any previous value is
// deleted by calling the delete function specified when it was set.
//
// The left-most argument is 0.
//
// Undocumented behavior: If iArg is negative then make the data available
// to all functions within the current prepared statement using iArg as an
// access code.
func Xsqlite3_set_auxdata(tls *crt.TLS, _pCtx *Xsqlite3_context, _iArg int32, _pAux unsafe.Pointer, _xDelete func(*crt.TLS, unsafe.Pointer)) {
var _pVdbe *TVdbe
var _pAuxData *XAuxData
_pVdbe = (*TVdbe)(_pCtx.X3)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76947), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_set_auxdataØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pVdbe == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76951), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_set_auxdataØ00__func__Ø000))), unsafe.Pointer(str(41788)))
crt.X__builtin_abort(tls)
}
}()
_pAuxData = (*XAuxData)(_pVdbe.X43)
_4:
if _pAuxData == nil {
goto _7
}
if ((_pAuxData.X1) == _iArg) && (((_pAuxData.X0) == (_pCtx.X4)) || (_iArg < i32(0))) {
goto _7
}
_pAuxData = (*XAuxData)(_pAuxData.X4)
goto _4
_7:
if _pAuxData != nil {
goto _11
}
_pAuxData = (*XAuxData)(_sqlite3DbMallocZero(tls, (*Xsqlite3)(_pVdbe.X0), uint64(u32(20))))
if _pAuxData == nil {
goto _failed
}
*(*int32)(unsafe.Pointer(&(_pAuxData.X0))) = _pCtx.X4
*(*int32)(unsafe.Pointer(&(_pAuxData.X1))) = _iArg
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pAuxData.X4))))) = (*XAuxData)(_pVdbe.X43)
*(**XAuxData)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVdbe.X43))))) = _pAuxData
if int32(_pCtx.X7) == i32(0) {
*(*int32)(unsafe.Pointer(&(_pCtx.X5))) = i32(0)
*(*uint8)(unsafe.Pointer(&(_pCtx.X7))) = uint8(i32(1))
}
goto _15
_11:
if (_pAuxData.X3) != nil {
(_pAuxData.X3)(tls, _pAuxData.X2)
}
_15:
*(*unsafe.Pointer)(unsafe.Pointer(&(_pAuxData.X2))) = _pAux
*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&(_pAuxData.X3))) = _xDelete
return
_failed:
if _xDelete != nil {
_xDelete(tls, _pAux)
}
}
var _sqlite3_set_auxdataØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_set_auxdataØ00__func__Ø000[0], str(128310), 20)
}
// Return meta information about a specific column of a database table.
// See comment in sqlite3.h (sqlite.h.in) for details.
func Xsqlite3_table_column_metadata(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8, _zTableName *int8, _zColumnName *int8, _pzDataType **int8, _pzCollSeq **int8, _pNotNull *int32, _pPrimaryKey *int32, _pAutoinc *int32) (r0 int32) {
var _rc, _iCol, _notnull, _primarykey, _autoinc int32
var _zErrMsg, _zDataType, _zCollSeq *int8
var _pTab *XTable
var _pCol *XColumn
_zErrMsg = nil
_pTab = nil
_pCol = nil
_iCol = i32(0)
_zDataType = nil
_zCollSeq = nil
_notnull = i32(0)
_primarykey = i32(0)
_autoinc = i32(0)
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTableName == nil) {
return _sqlite3MisuseError(tls, i32(143859))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_sqlite3BtreeEnterAll(tls, _db)
_rc = _sqlite3Init(tls, _db, &_zErrMsg)
if i32(0) != _rc {
goto _error_out
}
_pTab = _sqlite3FindTable(tls, _db, _zTableName, _zDbName)
if (_pTab == nil) || ((*XSelect)(_pTab.X3) != nil) {
_pTab = nil
goto _error_out
}
if _zColumnName == nil {
goto _6
}
_iCol = i32(0)
_7:
if _iCol >= int32(_pTab.X11) {
goto _10
}
_pCol = (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol)))
if i32(0) == _sqlite3StrICmp(tls, _pCol.X0, _zColumnName) {
goto _10
}
_iCol += 1
goto _7
_10:
if _iCol != int32(_pTab.X11) {
goto _12
}
if (((_pTab.X9) & uint32(i32(32))) == uint32(i32(0))) && _sqlite3IsRowid(tls, _zColumnName) != 0 {
_iCol = int32(_pTab.X10)
_pCol = func() *XColumn {
if _iCol >= i32(0) {
return (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1) + 16*uintptr(_iCol)))
}
return nil
}()
goto _17
}
_pTab = nil
goto _error_out
_17:
_12:
_6:
if _pCol != nil {
_zDataType = _sqlite3ColumnType(tls, _pCol, nil)
_zCollSeq = _pCol.X2
_notnull = bool2int(int32(_pCol.X3) != i32(0))
_primarykey = bool2int((int32(_pCol.X6) & i32(1)) != i32(0))
_autoinc = bool2int((int32(_pTab.X10) == _iCol) && (((_pTab.X9) & uint32(i32(8))) != uint32(i32(0))))
goto _20
}
_zDataType = str(25792)
_primarykey = i32(1)
_20:
if _zCollSeq == nil {
_zCollSeq = (*int8)(unsafe.Pointer(&_sqlite3StrBINARY))
}
_error_out:
_sqlite3BtreeLeaveAll(tls, _db)
if _pzDataType != nil {
*_pzDataType = _zDataType
}
if _pzCollSeq != nil {
*_pzCollSeq = _zCollSeq
}
if _pNotNull != nil {
*_pNotNull = _notnull
}
if _pPrimaryKey != nil {
*_pPrimaryKey = _primarykey
}
if _pAutoinc != nil {
*_pAutoinc = _autoinc
}
if (i32(0) == _rc) && (_pTab == nil) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg))
_zErrMsg = _sqlite3MPrintf(tls, _db, str(128330), unsafe.Pointer(_zTableName), unsafe.Pointer(_zColumnName))
_rc = i32(1)
}
_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
if _zErrMsg != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_zErrMsg))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErrMsg))
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
// This is a convenience routine that makes sure that all thread-specific
// data for this thread has been deallocated.
//
// SQLite no longer uses thread-specific data so this routine is now a
// no-op. It is retained for historical compatibility.
func Xsqlite3_thread_cleanup(tls *crt.TLS) {
}
// Return the number of changes since the database handle was opened.
func Xsqlite3_total_changes(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(141426))
return i32(0)
}
return _db.X30
}
func Xsqlite3_trace(tls *crt.TLS, _db *Xsqlite3, _xTrace func(*crt.TLS, unsafe.Pointer, *int8), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pOld unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142302))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pOld = _db.X42
*(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(func() int32 {
if _xTrace != nil {
return i32(128)
}
return i32(0)
}())
*(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X41))) = *(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8)
}{_xTrace}))
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X42))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pOld
}
// Deprecated external interface. Internal/core SQLite code
// should call sqlite3TransferBindings.
//
// It is misuse to call this routine with statements from different
// database connections. But as this is a deprecated interface, we
// will not bother to check for that condition.
//
// If the two statements contain a different number of bindings, then
// an SQLITE_ERROR is returned. Nothing else can go wrong, so otherwise
// SQLITE_OK is returned.
func Xsqlite3_transfer_bindings(tls *crt.TLS, _pFromStmt unsafe.Pointer, _pToStmt unsafe.Pointer) (r0 int32) {
var _pFrom, _pTo *TVdbe
_pFrom = (*TVdbe)(_pFromStmt)
_pTo = (*TVdbe)(_pToStmt)
if int32(_pFrom.X4) != int32(_pTo.X4) {
return i32(1)
}
func() {
if ((uint32((_pTo.X32)>>uint(i32(9)))<>uint(i32(31))) == 0 && (_pTo.X41) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77636), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000))), unsafe.Pointer(str(128358)))
crt.X__builtin_abort(tls)
}
}()
if (_pTo.X41) != 0 {
storebits18((*int16)(unsafe.Pointer(&(_pTo.X32))), int16(i32(1)), 1, 0)
}
func() {
if ((uint32((_pFrom.X32)>>uint(i32(9)))<>uint(i32(31))) == 0 && (_pFrom.X41) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77640), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_transfer_bindingsØ00__func__Ø000))), unsafe.Pointer(str(128394)))
crt.X__builtin_abort(tls)
}
}()
if (_pFrom.X41) != 0 {
storebits18((*int16)(unsafe.Pointer(&(_pFrom.X32))), int16(i32(1)), 1, 0)
}
return _sqlite3TransferBindings(tls, _pFromStmt, _pToStmt)
}
var _sqlite3_transfer_bindingsØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_transfer_bindingsØ00__func__Ø000[0], str(128434), 26)
}
// Register a callback to be invoked each time a row is updated,
// inserted or deleted using this database connection.
func Xsqlite3_update_hook(tls *crt.TLS, _db *Xsqlite3, _xCallback func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), _pArg unsafe.Pointer) (r0 unsafe.Pointer) {
var _pRet unsafe.Pointer
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(142410))
return nil
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pRet = _db.X49
*(*func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64))(unsafe.Pointer(&(_db.X50))) = _xCallback
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X49))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _pRet
}
// Try to convert the type of a function argument or a result column
// into a numeric representation. Use either INTEGER or REAL whichever
// is appropriate. But only do the conversion if it is possible without
// loss of information and return the revised type of the argument.
func Xsqlite3_value_numeric_type(tls *crt.TLS, _pVal *XMem) (r0 int32) {
var _eType int32
var _1_pMem *XMem
_eType = Xsqlite3_value_type(tls, _pVal)
if _eType == i32(3) {
_1_pMem = _pVal
_applyNumericAffinity(tls, _1_pMem, i32(0))
_eType = Xsqlite3_value_type(tls, _pVal)
}
return _eType
}
func Xsqlite3_value_text16be(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
return _sqlite3ValueText(tls, _pVal, uint8(i32(3)))
}
func Xsqlite3_value_text16le(tls *crt.TLS, _pVal *XMem) (r0 unsafe.Pointer) {
return _sqlite3ValueText(tls, _pVal, uint8(i32(2)))
}
func Xsqlite3_prepare16_v2(tls *crt.TLS, _db *Xsqlite3, _zSql unsafe.Pointer, _nBytes int32, _ppStmt *unsafe.Pointer, _pzTail *unsafe.Pointer) (r0 int32) {
var _rc int32
_rc = _sqlite3Prepare16(tls, _db, _zSql, _nBytes, i32(1), _ppStmt, _pzTail)
func() {
if _rc != i32(0) && _ppStmt != nil && *_ppStmt != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(116514), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_prepare16_v2Ø00__func__Ø000))), unsafe.Pointer(str(50464)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3_prepare16_v2Ø00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_prepare16_v2Ø00__func__Ø000[0], str(128460), 21)
}
// Set all the parameters in the compiled SQL statement to NULL.
func Xsqlite3_clear_bindings(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
var _i, _rc int32
var _mutex *Xsqlite3_mutex
var _p *TVdbe
_rc = i32(0)
_p = (*TVdbe)(_pStmt)
_mutex = (*Xsqlite3_mutex)((*Xsqlite3)((*TVdbe)(_pStmt).X0).X3)
Xsqlite3_mutex_enter(tls, _mutex)
_i = i32(0)
_0:
if _i >= int32(_p.X4) {
goto _3
}
_sqlite3VdbeMemRelease(tls, (*XMem)(unsafe.Pointer(uintptr(_p.X24)+48*uintptr(_i))))
*(*uint16)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(_p.X24) + 48*uintptr(_i))).X1))) = uint16(i32(1))
_i += 1
goto _0
_3:
func() {
if ((uint32((_p.X32)>>uint(i32(9)))<>uint(i32(31))) == 0 && (_p.X41) != uint32(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76253), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_clear_bindingsØ00__func__Ø000))), unsafe.Pointer(str(8414)))
crt.X__builtin_abort(tls)
}
}()
if (_p.X41) != 0 {
storebits18((*int16)(unsafe.Pointer(&(_p.X32))), int16(i32(1)), 1, 0)
}
Xsqlite3_mutex_leave(tls, _mutex)
return _rc
}
var _sqlite3_clear_bindingsØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_clear_bindingsØ00__func__Ø000[0], str(128481), 23)
}
// External API function used to create a new virtual-table module.
func Xsqlite3_create_module_v2(tls *crt.TLS, _db *Xsqlite3, _zName *int8, _pModule *Xsqlite3_module, _pAux unsafe.Pointer, _xDestroy func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zName == nil) {
return _sqlite3MisuseError(tls, i32(125106))
}
return _createModule(tls, _db, _zName, _pModule, _pAux, _xDestroy)
}
// Query a blob handle for the size of the data.
//
// The Incrblob.nByte field is fixed for the lifetime of the Incrblob
// so no mutex is required for access.
func Xsqlite3_blob_bytes(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
var _p *XIncrblob
_p = (*XIncrblob)(_pBlob)
return func() int32 {
if (_p != nil) && ((_p.X4) != nil) {
return (_p.X0)
}
return i32(0)
}()
}
// Close a blob handle that was previously created using
// sqlite3_blob_open().
func Xsqlite3_blob_close(tls *crt.TLS, _pBlob unsafe.Pointer) (r0 int32) {
var _rc int32
var _db *Xsqlite3
var _p *XIncrblob
_p = (*XIncrblob)(_pBlob)
if _p != nil {
_db = (*Xsqlite3)(_p.X5)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_rc = Xsqlite3_finalize(tls, _p.X4)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_p))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
goto _1
}
_rc = i32(0)
_1:
return _rc
}
// Open a blob handle.
func Xsqlite3_blob_open(tls *crt.TLS, _db *Xsqlite3, _zDb *int8, _zTable *int8, _zColumn *int8, _iRow int64, _wrFlag int32, _ppBlob *unsafe.Pointer) (r0 int32) {
var _nAttempt, _iCol, _rc, _14_j, _17_j, _21_iDb int32
var _zErr, _12_zFault *int8
var _pTab *XTable
var _21_v *TVdbe
var _pParse *XParse
var _12_pIdx *XIndex
var _21_aOp *XVdbeOp
var _pBlob *XIncrblob
var _13_pFKey *XFKey
_nAttempt = i32(0)
_rc = i32(0)
_zErr = nil
_pParse = nil
_pBlob = nil
if _ppBlob == nil {
return _sqlite3MisuseError(tls, i32(85639))
}
*_ppBlob = nil
if (_sqlite3SafetyCheckOk(tls, _db) == 0) || (_zTable == nil) {
return _sqlite3MisuseError(tls, i32(85645))
}
_wrFlag = bool2int(_wrFlag != 0)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_pBlob = (*XIncrblob)(_sqlite3DbMallocZero(tls, _db, uint64(u32(32))))
if _pBlob == nil {
goto _blob_open_out
}
_pParse = (*XParse)(_sqlite3DbMallocRaw(tls, _db, uint64(u32(484))))
if _pParse == nil {
goto _blob_open_out
}
_4:
crt.Xmemset(tls, (unsafe.Pointer)(_pParse), i32(0), u32(484))
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pParse.X0))))) = _db
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_zErr = nil
_sqlite3BtreeEnterAll(tls, _db)
_pTab = _sqlite3LocateTable(tls, _pParse, uint32(i32(0)), _zTable, _zDb)
if (_pTab != nil) && (_pTab.X16) != 0 {
_pTab = nil
_sqlite3ErrorMsg(tls, _pParse, str(128504), unsafe.Pointer(_zTable))
}
if (_pTab != nil) && (((_pTab.X9) & uint32(i32(32))) != uint32(i32(0))) {
_pTab = nil
_sqlite3ErrorMsg(tls, _pParse, str(128534), unsafe.Pointer(_zTable))
}
if (_pTab != nil) && ((*XSelect)(_pTab.X3) != nil) {
_pTab = nil
_sqlite3ErrorMsg(tls, _pParse, str(128570), unsafe.Pointer(_zTable))
}
if _pTab != nil {
goto _12
}
if (_pParse.X1) != nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_zErr = _pParse.X1
*(**int8)(unsafe.Pointer(&(_pParse.X1))) = nil
}
_rc = i32(1)
_sqlite3BtreeLeaveAll(tls, _db)
goto _blob_open_out
_12:
*(**XTable)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X7))))) = _pTab
*(**int8)(unsafe.Pointer(&(_pBlob.X6))) = (*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))))).X0
_iCol = i32(0)
_14:
if _iCol >= int32(_pTab.X11) {
goto _17
}
if _sqlite3StrICmp(tls, (*XColumn)(unsafe.Pointer(uintptr(_pTab.X1)+16*uintptr(_iCol))).X0, _zColumn) == i32(0) {
goto _17
}
_iCol += 1
goto _14
_17:
if _iCol == int32(_pTab.X11) {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_zErr = _sqlite3MPrintf(tls, _db, str(128591), unsafe.Pointer(_zColumn))
_rc = i32(1)
_sqlite3BtreeLeaveAll(tls, _db)
goto _blob_open_out
}
if _wrFlag == 0 {
goto _20
}
_12_zFault = nil
if ((_db.X6) & i32(524288)) == 0 {
goto _21
}
_13_pFKey = (*XFKey)(_pTab.X4)
_22:
if _13_pFKey == nil {
goto _25
}
_14_j = i32(0)
_26:
if _14_j >= (_13_pFKey.X5) {
goto _29
}
if ((*t73)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]struct {
X0 int32
X1 *int8
})(unsafe.Pointer(&(_13_pFKey.X9))))) + 8*uintptr(_14_j))).X0) == _iCol {
_12_zFault = str(128612)
}
_14_j += 1
goto _26
_29:
_13_pFKey = (*XFKey)(_13_pFKey.X1)
goto _22
_25:
_21:
_12_pIdx = (*XIndex)(_pTab.X2)
_31:
if _12_pIdx == nil {
goto _34
}
_17_j = i32(0)
_35:
if _17_j >= int32(_12_pIdx.X13) {
goto _38
}
if (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == _iCol) || (int32(*(*int16)(unsafe.Pointer(uintptr((unsafe.Pointer)(_12_pIdx.X1)) + 2*uintptr(_17_j)))) == i32(-2)) {
_12_zFault = str(128624)
}
_17_j += 1
goto _35
_38:
_12_pIdx = (*XIndex)(_12_pIdx.X5)
goto _31
_34:
if _12_zFault != nil {
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_zErr = _sqlite3MPrintf(tls, _db, str(128632), unsafe.Pointer(_12_zFault))
_rc = i32(1)
_sqlite3BtreeLeaveAll(tls, _db)
goto _blob_open_out
}
_20:
*(*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X4))) = (unsafe.Pointer)(_sqlite3VdbeCreate(tls, _pParse))
func() {
if (_pBlob.X4) == nil && (_db.X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85748), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_blob_openØ00__func__Ø000))), unsafe.Pointer(str(128666)))
crt.X__builtin_abort(tls)
}
}()
if (_pBlob.X4) == nil {
goto _45
}
_21_v = (*TVdbe)(_pBlob.X4)
_21_iDb = _sqlite3SchemaToIndex(tls, _db, (*XSchema)(_pTab.X20))
_sqlite3VdbeAddOp4Int(tls, _21_v, i32(2), _21_iDb, _wrFlag, (*XSchema)(_pTab.X20).X0, (*XSchema)(_pTab.X20).X1)
_sqlite3VdbeChangeP5(tls, _21_v, uint16(i32(1)))
_21_aOp = _sqlite3VdbeAddOpList(tls, _21_v, i32(6), (*XVdbeOpList)(unsafe.Pointer(&_sqlite3_blob_openØ00openBlobØ002)), _sqlite3_blob_openØ00iLnØ001)
_sqlite3VdbeUsesBtree(tls, _21_v, _21_iDb)
if int32(_db.X17) == i32(0) {
func() {
if _21_aOp == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85790), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_blob_openØ00__func__Ø000))), unsafe.Pointer(str(128699)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(0)))).X3))) = _21_iDb
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(0)))).X4))) = _pTab.X7
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(0)))).X5))) = _wrFlag
_sqlite3VdbeChangeP4(tls, _21_v, i32(1), _pTab.X0, i32(0))
}
if int32(_db.X17) != i32(0) {
goto _49
}
if _wrFlag != 0 {
*(*uint8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(1)))).X0))) = uint8(i32(107))
}
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(1)))).X4))) = _pTab.X7
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(1)))).X5))) = _21_iDb
*(*int8)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(1)))).X1))) = int8(i32(-11))
*(*int32)(unsafe.Pointer((*t39)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(1)))).X6))))) = int32(_pTab.X11) + i32(1)
*(*int32)(unsafe.Pointer(&((*XVdbeOp)(unsafe.Pointer(uintptr((unsafe.Pointer)(_21_aOp)) + 24*uintptr(i32(3)))).X4))) = int32(_pTab.X11)
*(*int16)(unsafe.Pointer(&(_pParse.X52))) = int16(i32(0))
*(*int32)(unsafe.Pointer(&(_pParse.X18))) = i32(1)
*(*int32)(unsafe.Pointer(&(_pParse.X17))) = i32(1)
_sqlite3VdbeMakeReady(tls, _21_v, _pParse)
_49:
_45:
*(*uint16)(unsafe.Pointer(&(_pBlob.X2))) = uint16(_iCol)
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBlob.X5))))) = _db
_sqlite3BtreeLeaveAll(tls, _db)
if (_db.X17) != 0 {
goto _blob_open_out
}
_rc = _blobSeekToRow(tls, _pBlob, _iRow, &_zErr)
if (preInc1(&_nAttempt, 1) < i32(50)) && (_rc == i32(17)) {
goto _4
}
_blob_open_out:
if (_rc == i32(0)) && (int32(_db.X17) == i32(0)) {
*_ppBlob = (unsafe.Pointer)(_pBlob)
goto _55
}
if (_pBlob != nil) && ((_pBlob.X4) != nil) {
_sqlite3VdbeFinalize(tls, (*TVdbe)(_pBlob.X4))
}
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pBlob))
_55:
_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
if _zErr != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_zErr))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_zErr))
_sqlite3ParserReset(tls, _pParse)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_pParse))
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
_ = _nAttempt
panic(0)
}
var _sqlite3_blob_openØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_blob_openØ00__func__Ø000[0], str(128706), 18)
}
var _sqlite3_blob_openØ00openBlobØ002 [6]XVdbeOpList
func init() {
_sqlite3_blob_openØ00openBlobØ002 = [6]XVdbeOpList{XVdbeOpList{X0: u8(154), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(106), X1: i8(0), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(32), X1: i8(0), X2: i8(5), X3: i8(1)}, XVdbeOpList{X0: u8(99), X1: i8(0), X2: i8(0), X3: i8(1)}, XVdbeOpList{X0: u8(67), X1: i8(1), X2: i8(0), X3: i8(0)}, XVdbeOpList{X0: u8(55), X1: i8(0), X2: i8(0), X3: i8(0)}}
}
var _sqlite3_blob_openØ00iLnØ001 int32
// This function is used by both blob_open() and blob_reopen(). It seeks
// the b-tree cursor associated with blob handle p to point to row iRow.
// If successful, SQLITE_OK is returned and subsequent calls to
// sqlite3_blob_read() or sqlite3_blob_write() access the specified row.
//
// If an error occurs, or if the specified row does not exist or does not
// contain a value of type TEXT or BLOB in the column nominated when the
// blob handle was opened, then an error code is returned and *pzErr may
// be set to point to a buffer containing an error message. It is the
// responsibility of the caller to free the error message buffer using
// sqlite3DbFree().
//
// If an error does occur, then the b-tree cursor is closed. All subsequent
// calls to sqlite3_blob_read(), blob_write() or blob_reopen() will
// immediately return SQLITE_ABORT.
func _blobSeekToRow(tls *crt.TLS, _p *XIncrblob, _iRow int64, _pzErr **int8) (r0 int32) {
var _rc int32
var _3_type uint32
var _zErr *int8
var _v *TVdbe
var _3_pC *XVdbeCursor
_zErr = nil
_v = (*TVdbe)(_p.X4)
*(*uint16)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(_v.X18) + 48*uintptr(i32(1)))).X1))) = uint16(i32(4))
*(*int64)(unsafe.Pointer((*t15)(unsafe.Pointer(&((*XMem)(unsafe.Pointer(uintptr(_v.X18) + 48*uintptr(i32(1)))).X0))))) = _iRow
if (_v.X9) > i32(3) {
*(*int32)(unsafe.Pointer(&(_v.X9))) = i32(3)
_rc = _sqlite3VdbeExec(tls, _v)
goto _1
}
_rc = Xsqlite3_step(tls, _p.X4)
_1:
if _rc != i32(100) {
goto _2
}
_3_pC = *(**XVdbeCursor)(unsafe.Pointer(uintptr((unsafe.Pointer)(_v.X23)) + 4*uintptr(i32(0))))
_3_type = func() uint32 {
if int32(_3_pC.X19) > int32(_p.X2) {
return (*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_3_pC.X25))))) + 4*uintptr(_p.X2))))
}
return uint32(i32(0))
}()
if _3_type < uint32(i32(12)) {
_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.X5), str(128724), unsafe.Pointer(func() *int8 {
if _3_type == uint32(i32(0)) {
return str(128753)
}
return func() *int8 {
if _3_type == uint32(i32(7)) {
return str(42883)
}
return str(42875)
}()
}()))
_rc = i32(1)
Xsqlite3_finalize(tls, _p.X4)
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil
goto _10
}
*(*int32)(unsafe.Pointer(&(_p.X1))) = int32(*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[1]uint32)(unsafe.Pointer(&(_3_pC.X25))))) + 4*uintptr(int32(_p.X2)+int32(_3_pC.X18)))))
*(*int32)(unsafe.Pointer(&(_p.X0))) = int32(_sqlite3VdbeSerialTypeLen(tls, _3_type))
*(**XBtCursor)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X3))))) = (*XBtCursor)(*(*unsafe.Pointer)(unsafe.Pointer((*t46)(unsafe.Pointer(&(_3_pC.X14))))))
_sqlite3BtreeIncrblobCursor(tls, (*XBtCursor)(_p.X3))
_10:
_2:
if _rc == i32(100) {
_rc = i32(0)
goto _13
}
if (_p.X4) == nil {
goto _13
}
_rc = Xsqlite3_finalize(tls, _p.X4)
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil
if _rc == i32(0) {
_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.X5), str(128758), _iRow)
_rc = i32(1)
goto _15
}
_zErr = _sqlite3MPrintf(tls, (*Xsqlite3)(_p.X5), str(24576), unsafe.Pointer(Xsqlite3_errmsg(tls, (*Xsqlite3)(_p.X5))))
_15:
_13:
func() {
if _rc == i32(0) && _zErr != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85610), unsafe.Pointer((*int8)(unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000))), unsafe.Pointer(str(128778)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc == i32(100) || _rc == i32(101) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85611), unsafe.Pointer((*int8)(unsafe.Pointer(&_blobSeekToRowØ00__func__Ø000))), unsafe.Pointer(str(128803)))
crt.X__builtin_abort(tls)
}
}()
*_pzErr = _zErr
return _rc
}
// Mark this cursor as an incremental blob cursor.
func _sqlite3BtreeIncrblobCursor(tls *crt.TLS, _pCur *XBtCursor) {
{
p := (*uint8)(unsafe.Pointer(&(_pCur.X10)))
*p = uint8(int32(*p) | i32(16))
sink2 = *p
}
*(*uint8)(unsafe.Pointer(&((*XBtree)(_pCur.X0).X5))) = uint8(i32(1))
}
var _blobSeekToRowØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_blobSeekToRowØ00__func__Ø000[0], str(128837), 14)
}
// Read data from a blob handle.
func Xsqlite3_blob_read(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePayloadChecked)
}
// Perform a read or write operation on a blob
func _blobReadWrite(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32, _xCall func(*crt.TLS, *XBtCursor, uint32, uint32, unsafe.Pointer) int32) (r0 int32) {
var _rc int32
var _db *Xsqlite3
var _v *TVdbe
var _p *XIncrblob
_p = (*XIncrblob)(_pBlob)
if _p == nil {
return _sqlite3MisuseError(tls, i32(85888))
}
_db = (*Xsqlite3)(_p.X5)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_v = (*TVdbe)(_p.X4)
if ((_n < i32(0)) || (_iOffset < i32(0))) || ((int64(_iOffset) + int64(_n)) > int64(_p.X0)) {
_rc = i32(1)
goto _6
}
if _v == nil {
_rc = i32(4)
goto _6
}
func() {
if _db != (*Xsqlite3)(_v.X0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(85905), unsafe.Pointer((*int8)(unsafe.Pointer(&_blobReadWriteØ00__func__Ø000))), unsafe.Pointer(str(128851)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3BtreeEnterCursor(tls, (*XBtCursor)(_p.X3))
_rc = _xCall(tls, (*XBtCursor)(_p.X3), uint32(_iOffset+(_p.X1)), uint32(_n), _z)
_sqlite3BtreeLeaveCursor(tls, (*XBtCursor)(_p.X3))
if _rc == i32(4) {
_sqlite3VdbeFinalize(tls, _v)
*(*unsafe.Pointer)(unsafe.Pointer(&(_p.X4))) = nil
goto _10
}
*(*int32)(unsafe.Pointer(&(_v.X10))) = _rc
_10:
_6:
_sqlite3Error(tls, _db, _rc)
_rc = _sqlite3ApiExit(tls, _db, _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _blobReadWriteØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_blobReadWriteØ00__func__Ø000[0], str(128863), 14)
}
// 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 _sqlite3BtreeEnterCursor(tls *crt.TLS, _pCur *XBtCursor) {
_sqlite3BtreeEnter(tls, (*XBtree)(_pCur.X0))
}
func _sqlite3BtreeLeaveCursor(tls *crt.TLS, _pCur *XBtCursor) {
_sqlite3BtreeLeave(tls, (*XBtree)(_pCur.X0))
}
func _sqlite3BtreePayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
if int32(_pCur.X12) == i32(1) {
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63784), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePayloadCheckedØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), i32(0))
}
return _accessPayloadChecked(tls, _pCur, _offset, _amt, _pBuf)
}
var _sqlite3BtreePayloadCheckedØ00__func__Ø000 [27]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreePayloadCheckedØ00__func__Ø000[0], str(128877), 27)
}
func _accessPayloadChecked(tls *crt.TLS, _pCur *XBtCursor, _offset uint32, _amt uint32, _pBuf unsafe.Pointer) (r0 int32) {
var _rc int32
if int32(_pCur.X12) == i32(0) {
return i32(4)
}
func() {
if _cursorOwnsBtShared(tls, _pCur) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(63778), unsafe.Pointer((*int8)(unsafe.Pointer(&_accessPayloadCheckedØ00__func__Ø000))), unsafe.Pointer(str(73824)))
crt.X__builtin_abort(tls)
}
}()
_rc = _btreeRestoreCursorPosition(tls, _pCur)
return func() int32 {
if _rc != 0 {
return _rc
}
return _accessPayload(tls, _pCur, _offset, _amt, (*uint8)(_pBuf), i32(0))
}()
}
var _accessPayloadCheckedØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_accessPayloadCheckedØ00__func__Ø000[0], str(128904), 21)
}
// Write data to a blob handle.
func Xsqlite3_blob_write(tls *crt.TLS, _pBlob unsafe.Pointer, _z unsafe.Pointer, _n int32, _iOffset int32) (r0 int32) {
return _blobReadWrite(tls, _pBlob, _z, _n, _iOffset, _sqlite3BtreePutData)
}
// 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 _sqlite3BtreePutData(tls *crt.TLS, _pCsr *XBtCursor, _offset uint32, _amt uint32, _z unsafe.Pointer) (r0 int32) {
var _rc int32
func() {
if _cursorOwnsBtShared(tls, _pCsr) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68770), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(128925)))
crt.X__builtin_abort(tls)
}
}()
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XBtree)(_pCsr.X0).X0).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68771), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(128950)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(_pCsr.X10) & i32(16)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68772), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(128994)))
crt.X__builtin_abort(tls)
}
}()
_rc = func() int32 {
if int32(_pCsr.X12) >= i32(3) {
return _btreeRestoreCursorPosition(tls, _pCsr)
}
return i32(0)
}()
if _rc != i32(0) {
return _rc
}
func() {
if int32(_pCsr.X12) == i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68778), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129025)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pCsr.X12) != i32(1) {
return i32(4)
}
_rc = _saveAllCursors(tls, (*XBtShared)(_pCsr.X1), _pCsr.X7, _pCsr)
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68792), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pCsr.X10) & i32(1)) == i32(0) {
return i32(8)
}
func() {
if (int32((*XBtShared)(_pCsr.X1).X10)&i32(1)) != i32(0) || int32((*XBtShared)(_pCsr.X1).X8) != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68804), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129058)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasSharedCacheTableLock(tls, (*XBtree)(_pCsr.X0), _pCsr.X7, i32(0), i32(2)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68806), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129140)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _hasReadConflicts(tls, (*XBtree)(_pCsr.X0), _pCsr.X7) != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68807), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129200)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((*(**XMemPage)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[20]unsafe.Pointer)(unsafe.Pointer(&(_pCsr.X19))))) + 4*uintptr(_pCsr.X14)))).X2) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(68808), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3BtreePutDataØ00__func__Ø000))), unsafe.Pointer(str(129248)))
crt.X__builtin_abort(tls)
}
}()
return _accessPayload(tls, _pCsr, _offset, _amt, (*uint8)(_z), i32(1))
}
var _sqlite3BtreePutDataØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3BtreePutDataØ00__func__Ø000[0], str(129282), 20)
}
// Return the maximum amount of memory that has ever been
// checked out since either the beginning of this process
// or since the most recent reset.
func Xsqlite3_memory_highwater(tls *crt.TLS, _resetFlag int32) (r0 int64) {
var _res, _mx int64
Xsqlite3_status64(tls, i32(0), &_res, &_mx, _resetFlag)
return _mx
_ = _res
panic(0)
}
// Retrieve a pointer to a static mutex or allocate a new dynamic one.
func Xsqlite3_mutex_alloc(tls *crt.TLS, _id int32) (r0 *Xsqlite3_mutex) {
if (_id <= i32(1)) && Xsqlite3_initialize(tls) != 0 {
return nil
}
if (_id > i32(1)) && _sqlite3MutexInit(tls) != 0 {
return nil
}
func() {
if (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)}))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(22836), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_mutex_allocØ00__func__Ø000))), unsafe.Pointer(str(2292)))
crt.X__builtin_abort(tls)
}
}()
return (*(*func(*crt.TLS, int32) *Xsqlite3_mutex)(unsafe.Pointer(&struct {
f func(*crt.TLS, int32) unsafe.Pointer
}{((*Xsqlite3_mutex_methods)(unsafe.Pointer(&(_sqlite3Config.X11))).X2)})))(tls, _id)
}
var _sqlite3_mutex_allocØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_mutex_allocØ00__func__Ø000[0], str(129302), 20)
}
func Xsqlite3_open_v2(tls *crt.TLS, _filename *int8, _ppDb **Xsqlite3, _flags int32, _zVfs *int8) (r0 int32) {
return _openDatabase(tls, _filename, _ppDb, uint32(_flags), _zVfs)
}
// Sleep for a little while. Return the amount of time slept.
func Xsqlite3_sleep(tls *crt.TLS, _ms int32) (r0 int32) {
var _rc int32
var _pVfs *Xsqlite3_vfs
_pVfs = Xsqlite3_vfs_find(tls, nil)
if _pVfs == nil {
return i32(0)
}
_rc = _sqlite3OsSleep(tls, _pVfs, i32(1000)*_ms) / i32(1000)
return _rc
}
func Xsqlite3_soft_heap_limit(tls *crt.TLS, _n int32) {
if _n < i32(0) {
_n = i32(0)
}
Xsqlite3_soft_heap_limit64(tls, int64(_n))
}
// Register a VFS with the system. It is harmless to register the same
// VFS multiple times. The new VFS becomes the default if makeDflt is
// true.
func Xsqlite3_vfs_register(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _makeDflt int32) (r0 int32) {
var _rc int32
var _mutex *Xsqlite3_mutex
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return _rc
}
if _pVfs == nil {
return _sqlite3MisuseError(tls, i32(20464))
}
_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _mutex)
_vfsUnlink(tls, _pVfs)
if _makeDflt != 0 || (_vfsList == nil) {
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVfs.X3))))) = _vfsList
_vfsList = _pVfs
bug20530(_vfsList)
goto _4
}
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pVfs.X3))))) = (*Xsqlite3_vfs)(_vfsList.X3)
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_vfsList.X3))))) = _pVfs
_4:
func() {
if _vfsList == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20477), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_vfs_registerØ00__func__Ø000))), unsafe.Pointer(str(129322)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, _mutex)
return i32(0)
}
// Unlink a VFS from the linked list
func _vfsUnlink(tls *crt.TLS, _pVfs *Xsqlite3_vfs) {
var _3_p *Xsqlite3_vfs
func() {
if Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, i32(2))) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(20436), unsafe.Pointer((*int8)(unsafe.Pointer(&_vfsUnlinkØ00__func__Ø000))), unsafe.Pointer(str(129330)))
crt.X__builtin_abort(tls)
}
}()
if _pVfs == nil {
goto _6
}
if _vfsList == _pVfs {
_vfsList = (*Xsqlite3_vfs)(_pVfs.X3)
bug20530(_vfsList)
goto _6
}
if _vfsList == nil {
goto _6
}
_3_p = _vfsList
_7:
if ((*Xsqlite3_vfs)(_3_p.X3) != nil) && ((*Xsqlite3_vfs)(_3_p.X3) != _pVfs) {
_3_p = (*Xsqlite3_vfs)(_3_p.X3)
goto _7
}
if (*Xsqlite3_vfs)(_3_p.X3) == _pVfs {
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_3_p.X3))))) = (*Xsqlite3_vfs)(_pVfs.X3)
}
_6:
}
var _vfsUnlinkØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_vfsUnlinkØ00__func__Ø000[0], str(129396), 10)
}
var _sqlite3_vfs_registerØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_vfs_registerØ00__func__Ø000[0], str(129406), 21)
}
// Unregister a VFS so that it is no longer accessible.
func Xsqlite3_vfs_unregister(tls *crt.TLS, _pVfs *Xsqlite3_vfs) (r0 int32) {
var _mutex *Xsqlite3_mutex
_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _mutex)
_vfsUnlink(tls, _pVfs)
Xsqlite3_mutex_leave(tls, _mutex)
return i32(0)
}
// IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
// zero if and only if SQLite was compiled with mutexing code omitted due to
// the SQLITE_THREADSAFE compile-time option being set to 0.
func Xsqlite3_threadsafe(tls *crt.TLS) (r0 int32) {
return i32(1)
}
func Xsqlite3_result_zeroblob(tls *crt.TLS, _pCtx *Xsqlite3_context, _n int32) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76541), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_zeroblobØ00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.X0), _n)
}
var _sqlite3_result_zeroblobØ00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_zeroblobØ00__func__Ø000[0], str(129427), 24)
}
// Interface to the testing logic.
func Xsqlite3_test_control(tls *crt.TLS, _op int32, args ...interface{}) (r0 int32) {
var _rc, _5_sz, _10_x, _11_x, _13_x, _15_n, _16_sz int32
var _9_newVal uint32
var _5_aProg *int32
var _15_zWord *int8
var _16_pFree unsafe.Pointer
var _16_ppNew *unsafe.Pointer
var _ap []interface{}
var _7_xBenignBegin, _7_xBenignEnd func(*crt.TLS)
var _13_db, _14_db, _21_db, _23_db *Xsqlite3
_rc = i32(0)
_ap = args
switch _op {
case i32(5):
goto _1
case i32(6):
goto _2
case i32(7):
goto _3
case i32(8):
goto _4
case i32(9):
goto _5
case i32(10):
goto _6
case i32(11):
goto _7
case i32(12):
goto _8
case i32(13):
goto _9
case i32(14):
goto _11
case i32(15):
goto _12
case i32(16):
goto _13
case i32(17):
goto _14
case i32(18):
goto _15
case i32(19):
goto _17
case i32(20):
goto _16
case i32(21):
goto _18
case i32(22):
goto _10
case i32(23):
goto _20
case i32(24):
goto _19
case i32(25):
goto _21
default:
goto _22
}
_1:
_sqlite3PrngSaveState(tls)
goto _22
_2:
_sqlite3PrngRestoreState(tls)
goto _22
_3:
Xsqlite3_randomness(tls, i32(0), nil)
goto _22
_4:
_5_sz = crt.VAInt32(&_ap)
_5_aProg = (*int32)(crt.VAPointer(&_ap))
_rc = _sqlite3BitvecBuiltinTest(tls, _5_sz, _5_aProg)
goto _22
_5:
*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&(_sqlite3Config.X37))) = crt.VAOther(&_ap).(func(*crt.TLS, int32) int32)
_rc = _sqlite3FaultSim(tls, i32(0))
goto _22
_6:
_7_xBenignBegin = crt.VAOther(&_ap).(func(*crt.TLS))
_7_xBenignEnd = crt.VAOther(&_ap).(func(*crt.TLS))
_sqlite3BenignMallocHooks(tls, _7_xBenignBegin, _7_xBenignEnd)
goto _22
_7:
_rc = _sqlite3PendingByte
_9_newVal = crt.VAUint32(&_ap)
if _9_newVal != 0 {
_sqlite3PendingByte = int32(_9_newVal)
bug20530(_sqlite3PendingByte)
}
goto _22
_8:
_10_x = i32(0)
func() {
if store1(&_10_x, crt.VAInt32(&_ap)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(144147), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_test_controlØ00__func__Ø000))), unsafe.Pointer(str(129451)))
crt.X__builtin_abort(tls)
}
}()
_rc = _10_x
goto _22
_9:
_11_x = crt.VAInt32(&_ap)
_rc = func() int32 {
if _11_x != 0 {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(144182), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_test_controlØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}()
goto _22
_10:
_rc = i32(123410)
goto _22
_11:
_13_db = (*Xsqlite3)(crt.VAPointer(&_ap))
_13_x = crt.VAInt32(&_ap)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_13_db.X3))
_sqlite3BtreeSetPageSize(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_13_db.X4)+16*uintptr(i32(0)))).X1), i32(0), _13_x, i32(0))
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_13_db.X3))
goto _22
_12:
_14_db = (*Xsqlite3)(crt.VAPointer(&_ap))
*(*uint16)(unsafe.Pointer(&(_14_db.X13))) = uint16(crt.VAInt32(&_ap) & i32(65535))
goto _22
_13:
_15_zWord = (*int8)(crt.VAPointer(&_ap))
_15_n = _sqlite3Strlen30(tls, _15_zWord)
_rc = func() int32 {
if _sqlite3KeywordCode(tls, (*uint8)(unsafe.Pointer(_15_zWord)), _15_n) != i32(27) {
return i32(124)
}
return i32(0)
}()
goto _22
_14:
_16_sz = crt.VAInt32(&_ap)
_16_ppNew = (*unsafe.Pointer)(crt.VAPointer(&_ap))
_16_pFree = crt.VAPointer(&_ap)
if _16_sz != 0 {
*_16_ppNew = _sqlite3ScratchMalloc(tls, _16_sz)
}
_sqlite3ScratchFree(tls, _16_pFree)
goto _22
_15:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X38))) = crt.VAInt32(&_ap)
goto _22
_16:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X6))) = crt.VAInt32(&_ap)
goto _22
_17:
*(*int32)(unsafe.Pointer(&(_sqlite3Config.X39))) = crt.VAInt32(&_ap)
goto _22
_18:
goto _22
_19:
_21_db = (*Xsqlite3)(crt.VAPointer(&_ap))
*(*int32)(unsafe.Pointer(&(_21_db.X32))) = crt.VAInt32(&_ap)
goto _22
_20:
if (_sqlite3Config.X28) == i32(0) {
_rc = i32(1)
}
goto _22
_21:
_23_db = (*Xsqlite3)(crt.VAPointer(&_ap))
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_23_db.X3))
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X1))) = uint8(_sqlite3FindDbName(tls, _23_db, (*int8)(crt.VAPointer(&_ap))))
*(*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X2))) = store2((*uint8)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X4))), uint8(crt.VAInt32(&_ap)))
*(*int32)(unsafe.Pointer(&((*t21)(unsafe.Pointer(&(_23_db.X33))).X0))) = crt.VAInt32(&_ap)
if (int32((*t21)(unsafe.Pointer(&(_23_db.X33))).X2) == i32(0)) && (((*t21)(unsafe.Pointer(&(_23_db.X33))).X0) > i32(0)) {
_sqlite3ResetAllSchemasOfConnection(tls, _23_db)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_23_db.X3))
goto _22
_22:
_ap = nil
return _rc
}
func _sqlite3PrngSaveState(tls *crt.TLS) {
crt.Xmemcpy(tls, (unsafe.Pointer)(&_sqlite3SavedPrng), (unsafe.Pointer)(&_sqlite3Prng), u32(259))
}
var _sqlite3SavedPrng Tsqlite3PrngType
func _sqlite3PrngRestoreState(tls *crt.TLS) {
crt.Xmemcpy(tls, (unsafe.Pointer)(&_sqlite3Prng), (unsafe.Pointer)(&_sqlite3SavedPrng), u32(259))
}
// 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 _sqlite3BitvecBuiltinTest(tls *crt.TLS, _sz int32, _aOp *int32) (r0 int32) {
var _rc, _i, _nx, _pc, _op int32
var _pTmpSpace unsafe.Pointer
var _pV *uint8
var _pBitvec *XBitvec
_pBitvec = nil
_pV = nil
_rc = i32(-1)
_pBitvec = _sqlite3BitvecCreate(tls, uint32(_sz))
_pV = (*uint8)(_sqlite3MallocZero(tls, uint64(((_sz+i32(7))/i32(8))+i32(1))))
_pTmpSpace = Xsqlite3_malloc64(tls, uint64(i32(512)))
if ((_pBitvec == nil) || (_pV == nil)) || (_pTmpSpace == nil) {
goto _bitvec_end
}
_sqlite3BitvecSet(tls, nil, uint32(i32(1)))
_sqlite3BitvecClear(tls, nil, uint32(i32(1)), _pTmpSpace)
_pc = i32(0)
_3:
if store1(&_op, *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc)))) == i32(0) {
goto _4
}
switch _op {
case i32(1):
goto _6
case i32(2):
goto _6
case i32(3):
goto _9
case i32(4):
goto _9
case i32(5):
goto _6
default:
goto _9
}
_6:
_nx = i32(4)
_i = (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(2))))) - i32(1)
{
p := (*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(2))))
*p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp)) + 4*uintptr(_pc+i32(3)))))
sink1 = *p
}
goto _12
_9:
_nx = i32(2)
Xsqlite3_randomness(tls, int32(u32(4)), (unsafe.Pointer)(&_i))
goto _12
_12:
if preInc1((*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aOp))+4*uintptr(_pc+i32(1)))), -1) > i32(0) {
_nx = i32(0)
}
{
p := &_pc
*p = (*p) + _nx
sink1 = *p
}
_i = (_i & i32(2147483647)) % _sz
if (_op & i32(1)) == i32(0) {
goto _14
}
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3)))))
*p = uint8(int32(*p) | (i32(1) << uint((_i+i32(1))&i32(7))))
sink2 = *p
}
if _op == i32(5) {
goto _15
}
if _sqlite3BitvecSet(tls, _pBitvec, uint32(_i+i32(1))) != 0 {
goto _bitvec_end
}
_15:
goto _17
_14:
{
p := (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr((_i+i32(1))>>uint(i32(3)))))
*p = uint8(int32(*p) & (^(i32(1) << uint((_i+i32(1))&i32(7)))))
sink2 = *p
}
_sqlite3BitvecClear(tls, _pBitvec, uint32(_i+i32(1)), _pTmpSpace)
_17:
goto _3
_4:
_rc = int32(uint32((_sqlite3BitvecTest(tls, nil, uint32(i32(0)))+_sqlite3BitvecTest(tls, _pBitvec, uint32(_sz+i32(1))))+_sqlite3BitvecTest(tls, _pBitvec, uint32(i32(0)))) + (_sqlite3BitvecSize(tls, _pBitvec) - uint32(_sz)))
_i = i32(1)
_18:
if _i > _sz {
goto _bitvec_end
}
if bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pV)) + 1*uintptr(_i>>uint(i32(3))))))&(i32(1)<= i32(6) {
goto _5
}
if (Xsqlite3_strnicmp(tls, _zOptName, *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 4*uintptr(_i))), _n) == i32(0)) && (_sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_azCompileOpt)) + 4*uintptr(_i))))) + 1*uintptr(_n))))) == i32(0)) {
return i32(1)
}
_i += 1
goto _2
_5:
return i32(0)
}
func _sqlite3IsIdChar(tls *crt.TLS, _c uint8) (r0 int32) {
return bool2int((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(_c)))) & i32(70)) != i32(0))
}
// Configuration settings for an individual database connection
func Xsqlite3_db_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
var _rc, _3_sz, _3_cnt, _6_onoff, _6_oldFlags int32
var _4_i uint32
var _6_pRes *int32
var _3_pBuf unsafe.Pointer
var _ap []interface{}
_ap = args
switch _op {
case i32(1000):
goto _1
case i32(1001):
goto _2
default:
goto _3
}
_1:
*(**int8)(unsafe.Pointer(&((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(i32(0)))).X0))) = (*int8)(crt.VAPointer(&_ap))
_rc = i32(0)
goto _4
_2:
_3_pBuf = crt.VAPointer(&_ap)
_3_sz = crt.VAInt32(&_ap)
_3_cnt = crt.VAInt32(&_ap)
_rc = _setupLookaside(tls, _db, _3_pBuf, _3_sz, _3_cnt)
goto _4
_3:
_rc = i32(1)
_4_i = uint32(i32(0))
_5:
if _4_i >= uint32(i32(5)) {
goto _8
}
if ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X0) != _op {
goto _9
}
_6_onoff = crt.VAInt32(&_ap)
_6_pRes = (*int32)(crt.VAPointer(&_ap))
_6_oldFlags = _db.X6
if _6_onoff > i32(0) {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = int32(uint32(*p) | ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1))
sink1 = *p
}
goto _12
}
if _6_onoff == i32(0) {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = int32(uint32(*p) & (^((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)))
sink1 = *p
}
}
_12:
if _6_oldFlags != (_db.X6) {
_sqlite3ExpirePreparedStatements(tls, _db)
}
if _6_pRes != nil {
*_6_pRes = bool2int((uint32(_db.X6) & ((*t80)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_db_configØ00aFlagOpØ001)) + 8*uintptr(_4_i))).X1)) != uint32(i32(0)))
}
_rc = i32(0)
goto _8
_9:
_4_i += 1
goto _5
_8:
goto _4
_4:
_ap = nil
return _rc
}
var _sqlite3_db_configØ00aFlagOpØ001 [5]struct {
X0 int32
X1 uint32
}
func init() {
_sqlite3_db_configØ00aFlagOpØ001 = [5]struct {
X0 int32
X1 uint32
}{t80{X0: i32(1002), X1: u32(524288)}, t80{X0: i32(1003), X1: u32(16777216)}, t80{X0: i32(1004), X1: u32(1073741824)}, t80{X0: i32(1005), X1: u32(4194304)}, t80{X0: i32(1006), X1: u32(2147483648)}}
}
// Return the mutex associated with a database connection.
func Xsqlite3_db_mutex(tls *crt.TLS, _db *Xsqlite3) (r0 *Xsqlite3_mutex) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(141191))
return nil
}
return (*Xsqlite3_mutex)(_db.X3)
}
// Query status information for a single database connection
func Xsqlite3_db_status(tls *crt.TLS, _db *Xsqlite3, _op int32, _pCurrent *int32, _pHighwater *int32, _resetFlag int32) (r0 int32) {
var _rc, _7_totalUsed, _7_i, _9_nByte, _11_i, _11_nByte, _16_nByte, _18_i, _18_nRet int32
var _8_pBt *XBtree
var _9_pPager, _20_pPager *XPager
var _12_pSchema *XSchema
var _13_p *XHashElem
var _16_pVdbe *TVdbe
_rc = i32(0)
if ((_sqlite3SafetyCheckOk(tls, _db) == 0) || (_pCurrent == nil)) || (_pHighwater == nil) {
return _sqlite3MisuseError(tls, i32(18659))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
switch _op {
case i32(0):
goto _4
case i32(1):
goto _8
case i32(2):
goto _10
case i32(3):
goto _11
case i32(4):
goto _5
case i32(5):
goto _5
case i32(6):
goto _5
case i32(7):
goto _12
case i32(8):
goto _12
case i32(9):
goto _12
case i32(10):
goto _15
case i32(11):
goto _8
default:
goto _16
}
_4:
*_pCurrent = (*t7)(unsafe.Pointer(&(_db.X58))).X3
*_pHighwater = (*t7)(unsafe.Pointer(&(_db.X58))).X4
if _resetFlag != 0 {
*(*int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X4))) = (*t7)(unsafe.Pointer(&(_db.X58))).X3
}
goto _18
_5:
func() {
if (_op - i32(4)) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18679), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000))), unsafe.Pointer(str(129595)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_op - i32(4)) >= i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18680), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000))), unsafe.Pointer(str(129633)))
crt.X__builtin_abort(tls)
}
}()
*_pCurrent = i32(0)
*_pHighwater = *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(_op-i32(4))))
if _resetFlag != 0 {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&((*t7)(unsafe.Pointer(&(_db.X58))).X5))))) + 4*uintptr(_op-i32(4)))) = i32(0)
}
goto _18
_8:
_7_totalUsed = i32(0)
_sqlite3BtreeEnterAll(tls, _db)
_7_i = i32(0)
_24:
if _7_i >= (_db.X5) {
goto _27
}
_8_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_7_i))).X1)
if _8_pBt == nil {
goto _28
}
_9_pPager = _sqlite3BtreePager(tls, _8_pBt)
_9_nByte = _sqlite3PagerMemUsed(tls, _9_pPager)
if _op == i32(11) {
_9_nByte = _9_nByte / _sqlite3BtreeConnectionCount(tls, _8_pBt)
}
{
p := &_7_totalUsed
*p = (*p) + _9_nByte
sink1 = *p
}
_28:
_7_i += 1
goto _24
_27:
_sqlite3BtreeLeaveAll(tls, _db)
*_pCurrent = _7_totalUsed
*_pHighwater = i32(0)
goto _18
_10:
_11_nByte = i32(0)
_sqlite3BtreeEnterAll(tls, _db)
*(**int32)(unsafe.Pointer(&(_db.X79))) = &_11_nByte
_11_i = i32(0)
_30:
if _11_i >= (_db.X5) {
goto _33
}
_12_pSchema = (*XSchema)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_11_i))).X4)
if func() int32 {
if _12_pSchema != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(18729), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_db_statusØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _36
}
{
p := &_11_nByte
*p = int32(uint32(*p) + (uint32(((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X4)(tls, int32(u32(16)))) * (((((*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X1) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X1)) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X3))).X1)) + ((*XHash)(unsafe.Pointer(&(_12_pSchema.X5))).X1))))
sink1 = *p
}
{
p := &_11_nByte
*p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X3))
sink1 = *p
}
{
p := &_11_nByte
*p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X3))
sink1 = *p
}
{
p := &_11_nByte
*p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X3))).X3))
sink1 = *p
}
{
p := &_11_nByte
*p = int32(uint64(*p) + Xsqlite3_msize(tls, (*XHash)(unsafe.Pointer(&(_12_pSchema.X5))).X3))
sink1 = *p
}
_13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_12_pSchema.X4))).X2)
_37:
if _13_p == nil {
goto _40
}
_sqlite3DeleteTrigger(tls, _db, (*XTrigger)(_13_p.X2))
_13_p = (*XHashElem)(_13_p.X0)
goto _37
_40:
_13_p = (*XHashElem)((*XHash)(unsafe.Pointer(&(_12_pSchema.X2))).X2)
_41:
if _13_p == nil {
goto _44
}
_sqlite3DeleteTable(tls, _db, (*XTable)(_13_p.X2))
_13_p = (*XHashElem)(_13_p.X0)
goto _41
_44:
_36:
_11_i += 1
goto _30
_33:
*(**int32)(unsafe.Pointer(&(_db.X79))) = nil
_sqlite3BtreeLeaveAll(tls, _db)
*_pHighwater = i32(0)
*_pCurrent = _11_nByte
goto _18
_11:
_16_nByte = i32(0)
*(**int32)(unsafe.Pointer(&(_db.X79))) = &_16_nByte
_16_pVdbe = (*TVdbe)(_db.X1)
_45:
if _16_pVdbe == nil {
goto _48
}
_sqlite3VdbeClearObject(tls, _db, _16_pVdbe)
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_16_pVdbe))
_16_pVdbe = (*TVdbe)(_16_pVdbe.X2)
goto _45
_48:
*(**int32)(unsafe.Pointer(&(_db.X79))) = nil
*_pHighwater = i32(0)
*_pCurrent = _16_nByte
goto _18
_12:
_18_nRet = i32(0)
i32(0)
i32(0)
_18_i = i32(0)
_49:
if _18_i >= (_db.X5) {
goto _52
}
if (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_18_i))).X1) != nil {
_20_pPager = _sqlite3BtreePager(tls, (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4)+16*uintptr(_18_i))).X1))
_sqlite3PagerCacheStat(tls, _20_pPager, _op, _resetFlag, &_18_nRet)
}
_18_i += 1
goto _49
_52:
*_pHighwater = i32(0)
*_pCurrent = _18_nRet
goto _18
_15:
*_pHighwater = i32(0)
*_pCurrent = bool2int(((_db.X78) > int64(i32(0))) || ((_db.X77) > int64(i32(0))))
goto _18
_16:
_rc = i32(1)
_18:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_db_statusØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_db_statusØ00__func__Ø000[0], str(129670), 18)
}
// Return the approximate number of bytes of memory currently
// used by the pager and its associated cache.
func _sqlite3PagerMemUsed(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _perPageSize int32
_perPageSize = int32((uint32((_pPager.X48)+int32(_pPager.X44)) + u32(40)) + u32(20))
return ((_perPageSize * _sqlite3PcachePagecount(tls, (*XPCache)(_pPager.X59))) + _sqlite3MallocSize(tls, (unsafe.Pointer)(_pPager))) + (_pPager.X48)
}
func Xsqlite3_msize(tls *crt.TLS, _p unsafe.Pointer) (r0 uint64) {
i32(0)
i32(0)
return uint64(func() int32 {
if _p != nil {
return ((*Xsqlite3_mem_methods)(unsafe.Pointer(&(_sqlite3Config.X10))).X3)(tls, _p)
}
return i32(0)
}())
}
// Parameter eStat must be either SQLITE_DBSTATUS_CACHE_HIT or
// SQLITE_DBSTATUS_CACHE_MISS. Before returning, *pnVal is incremented by the
// current cache hit or miss count, according to the value of eStat. If the
// reset parameter is non-zero, the cache hit or miss count is zeroed before
// returning.
func _sqlite3PagerCacheStat(tls *crt.TLS, _pPager *XPager, _eStat int32, _reset int32, _pnVal *int32) {
func() {
if _eStat != i32(7) && _eStat != i32(8) && _eStat != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(53576), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerCacheStatØ00__func__Ø000))), unsafe.Pointer(str(129688)))
crt.X__builtin_abort(tls)
}
}()
i32(0)
i32(0)
i32(0)
{
p := _pnVal
*p = (*p) + (*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(_eStat-i32(7)))))
sink1 = *p
}
if _reset != 0 {
*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[3]int32)(unsafe.Pointer(&(_pPager.X55))))) + 4*uintptr(_eStat-i32(7)))) = i32(0)
}
}
var _sqlite3PagerCacheStatØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerCacheStatØ00__func__Ø000[0], str(129796), 22)
}
func Xsqlite3_extended_errcode(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if (_db != nil) && (_sqlite3SafetyCheckSickOrOk(tls, _db) == 0) {
return _sqlite3MisuseError(tls, i32(142786))
}
if (_db == nil) || ((_db.X17) != 0) {
return _sqlite3NomemError(tls, i32(142789))
}
return _db.X10
}
// Return the value of a status counter for a prepared statement
func Xsqlite3_stmt_status(tls *crt.TLS, _pStmt unsafe.Pointer, _op int32, _resetFlag int32) (r0 int32) {
var _v uint32
var _pVdbe *TVdbe
_pVdbe = (*TVdbe)(_pStmt)
if _pStmt == nil {
_sqlite3MisuseError(tls, i32(77706))
return i32(0)
}
_v = *(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pVdbe.X35))))) + 4*uintptr(_op)))
if _resetFlag != 0 {
*(*uint32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[5]uint32)(unsafe.Pointer(&(_pVdbe.X35))))) + 4*uintptr(_op))) = uint32(i32(0))
}
return int32(_v)
}
// Move an existing blob handle to point to a different row of the same
// database table.
//
// If an error occurs, or if the specified row does not exist or does not
// contain a blob or text value, then an error code is returned and the
// database handle error code and message set. If this happens, then all
// subsequent calls to sqlite3_blob_xxx() functions (except blob_close())
// immediately return SQLITE_ABORT.
func Xsqlite3_blob_reopen(tls *crt.TLS, _pBlob unsafe.Pointer, _iRow int64) (r0 int32) {
var _rc int32
var _2_zErr *int8
var _db *Xsqlite3
var _p *XIncrblob
_p = (*XIncrblob)(_pBlob)
if _p == nil {
return _sqlite3MisuseError(tls, i32(85986))
}
_db = (*Xsqlite3)(_p.X5)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _p.X4 == nil {
_rc = i32(4)
goto _2
}
_rc = _blobSeekToRow(tls, _p, _iRow, &_2_zErr)
if _rc != i32(0) {
_sqlite3ErrorWithMsg(tls, _db, _rc, func() *int8 {
if _2_zErr != nil {
return str(24576)
}
return nil
}(), unsafe.Pointer(_2_zErr))
_sqlite3DbFree(tls, _db, (unsafe.Pointer)(_2_zErr))
}
func() {
if _rc == i32(17) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86002), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_blob_reopenØ00__func__Ø000))), unsafe.Pointer(str(129818)))
crt.X__builtin_abort(tls)
}
}()
_2:
_rc = _sqlite3ApiExit(tls, _db, _rc)
func() {
if _rc != i32(0) && _p.X4 != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(86006), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_blob_reopenØ00__func__Ø000))), unsafe.Pointer(str(129836)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_blob_reopenØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_blob_reopenØ00__func__Ø000[0], str(129865), 20)
}
// Call from within the xCreate() or xConnect() methods to provide
// the SQLite core with additional information about the behavior
// of the virtual table being implemented.
func Xsqlite3_vtab_config(tls *crt.TLS, _db *Xsqlite3, _op int32, args ...interface{}) (r0 int32) {
var _rc int32
var _ap []interface{}
var _2_p *XVtabCtx
_rc = i32(0)
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(126200))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_ap = args
switch _op {
case i32(1):
goto _2
default:
goto _3
}
_2:
_2_p = (*XVtabCtx)(_db.X66)
if _2_p == nil {
_rc = _sqlite3MisuseError(tls, i32(126208))
goto _5
}
func() {
if (*XTable)(_2_p.X1) != nil && ((*XTable)(_2_p.X1).X16) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126210), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_vtab_configØ00__func__Ø000))), unsafe.Pointer(str(129885)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&((*XVTable)(_2_p.X0).X4))) = uint8(crt.VAInt32(&_ap))
_5:
goto _9
_3:
_rc = _sqlite3MisuseError(tls, i32(126216))
goto _9
_9:
_ap = nil
if _rc != i32(0) {
_sqlite3Error(tls, _db, _rc)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return _rc
}
var _sqlite3_vtab_configØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_vtab_configØ00__func__Ø000[0], str(129918), 20)
}
// Return the ON CONFLICT resolution mode in effect for the virtual
// table update operation currently in progress.
//
// The results of this routine are undefined unless it is called from
// within an xUpdate method.
func Xsqlite3_vtab_on_conflict(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(126182))
}
i32(0)
i32(0)
func() {
if int32(_db.X22) < i32(1) || int32(_db.X22) > i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(126186), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_vtab_on_conflictØ00__func__Ø000))), unsafe.Pointer(str(129938)))
crt.X__builtin_abort(tls)
}
}()
return int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_vtab_on_conflictØ00aMapØ001)) + 1*uintptr(int32(_db.X22)-i32(1)))))
}
var _sqlite3_vtab_on_conflictØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_vtab_on_conflictØ00__func__Ø000[0], str(129985), 25)
}
var _sqlite3_vtab_on_conflictØ00aMapØ001 [5]uint8
func init() {
_sqlite3_vtab_on_conflictØ00aMapØ001 = [5]uint8{1, 4, 3, 2, 5}
}
func Xsqlite3_close_v2(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
return _sqlite3Close(tls, _db, i32(1))
}
// Return the filename of the database associated with a database
// connection.
func Xsqlite3_db_filename(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 *int8) {
var _pBt *XBtree
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(144428))
return nil
}
_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
return func() *int8 {
if _pBt != nil {
return _sqlite3BtreeGetFilename(tls, _pBt)
}
return nil
}()
}
// Return 1 if database is read-only or 0 if read/write. Return -1 if
// no such database exists.
func Xsqlite3_db_readonly(tls *crt.TLS, _db *Xsqlite3, _zDbName *int8) (r0 int32) {
var _pBt *XBtree
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(144444))
return i32(-1)
}
_pBt = _sqlite3DbNameToBtree(tls, _db, _zDbName)
return func() int32 {
if _pBt != nil {
return _sqlite3BtreeIsReadonly(tls, _pBt)
}
return i32(-1)
}()
}
// Return a string that describes the kind of error specified in the
// argument. For now, this simply calls the internal sqlite3ErrStr()
// function.
func Xsqlite3_errstr(tls *crt.TLS, _rc int32) (r0 *int8) {
return _sqlite3ErrStr(tls, _rc)
}
// Return true if the prepared statement is guaranteed to not modify the
// database.
func Xsqlite3_stmt_readonly(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 int32) {
return int32(func() uint32 {
if _pStmt != nil {
return ((uint32(((*TVdbe)(_pStmt).X32)>>uint(i32(7))) << uint(i32(31))) >> uint(i32(31)))
}
return uint32(i32(1))
}())
}
// Return a 64-bit integer value for a query parameter.
func Xsqlite3_uri_int64(tls *crt.TLS, _zFilename *int8, _zParam *int8, _bDflt int64) (r0 int64) {
var _v int64
var _z *int8
_z = Xsqlite3_uri_parameter(tls, _zFilename, _zParam)
if (_z != nil) && (_sqlite3DecOrHexToI64(tls, _z, &_v) == i32(0)) {
_bDflt = _v
}
return _bDflt
}
// Register a statically linked extension that is automatically
// loaded by every new database connection.
func Xsqlite3_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
var _rc int32
var _2_i uint32
var _4_nByte uint64
var _2_mutex *Xsqlite3_mutex
var _4_aNew *func(*crt.TLS)
_rc = i32(0)
_rc = Xsqlite3_initialize(tls)
if _rc != 0 {
return _rc
}
_2_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _2_mutex)
_2_i = uint32(i32(0))
_2:
if _2_i >= (_sqlite3Autoext.X0) {
goto _5
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_2_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
goto _5
}
_2_i += 1
goto _2
_5:
if _2_i != (_sqlite3Autoext.X0) {
goto _7
}
_4_nByte = uint64(((_sqlite3Autoext.X0) + uint32(i32(1))) * u32(4))
_4_aNew = (*func(*crt.TLS))(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_sqlite3Autoext.X1), _4_nByte))
if _4_aNew == nil {
_rc = _sqlite3NomemError(tls, i32(112498))
goto _9
}
*(**func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Autoext.X1))) = _4_aNew
*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_sqlite3Autoext.X0))) = _xInit
*(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) += 1
_9:
_7:
Xsqlite3_mutex_leave(tls, _2_mutex)
func() {
if (_rc & i32(255)) != _rc {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(112506), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_auto_extensionØ00__func__Ø000))), unsafe.Pointer(str(24579)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
var _sqlite3_auto_extensionØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_auto_extensionØ00__func__Ø000[0], str(130010), 23)
}
func Xsqlite3_bind_blob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData unsafe.Pointer, _nData uint64, _xDel func(*crt.TLS, unsafe.Pointer)) (r0 int32) {
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77435), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_bind_blob64Ø00__func__Ø000))), unsafe.Pointer(str(130033)))
crt.X__builtin_abort(tls)
}
}()
if _nData > uint64(i32(2147483647)) {
return _invokeValueDestructor(tls, _zData, _xDel, nil)
}
return _bindText(tls, _pStmt, _i, _zData, int32(_nData), _xDel, uint8(i32(0)))
}
var _sqlite3_bind_blob64Ø00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_bind_blob64Ø00__func__Ø000[0], str(130054), 20)
}
func _invokeValueDestructor(tls *crt.TLS, _p unsafe.Pointer, _xDel func(*crt.TLS, unsafe.Pointer), _pCtx *Xsqlite3_context) (r0 int32) {
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76411), unsafe.Pointer((*int8)(unsafe.Pointer(&_invokeValueDestructorØ00__func__Ø000))), unsafe.Pointer(str(130033)))
crt.X__builtin_abort(tls)
}
}()
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{nil})) {
goto _5
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))})) {
goto _5
}
_xDel(tls, _p)
_5:
if _pCtx != nil {
Xsqlite3_result_error_toobig(tls, _pCtx)
}
return i32(18)
}
var _invokeValueDestructorØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_invokeValueDestructorØ00__func__Ø000[0], str(130074), 22)
}
func Xsqlite3_bind_text64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _zData *int8, _nData uint64, _xDel func(*crt.TLS, unsafe.Pointer), _enc uint8) (r0 int32) {
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77491), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_bind_text64Ø00__func__Ø000))), unsafe.Pointer(str(130033)))
crt.X__builtin_abort(tls)
}
}()
if _nData > uint64(i32(2147483647)) {
return _invokeValueDestructor(tls, (unsafe.Pointer)(_zData), _xDel, nil)
}
if int32(_enc) == i32(4) {
_enc = uint8(i32(2))
}
return _bindText(tls, _pStmt, _i, (unsafe.Pointer)(_zData), int32(_nData), _xDel, _enc)
}
var _sqlite3_bind_text64Ø00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_bind_text64Ø00__func__Ø000[0], str(130096), 20)
}
// Cancel a prior call to sqlite3_auto_extension. Remove xInit from the
// set of routines that is invoked for each new database connection, if it
// is currently on the list. If xInit is not on the list, then this
// routine is a no-op.
//
// Return 1 if xInit was found on the list and removed. Return 0 if xInit
// was not on the list.
func Xsqlite3_cancel_auto_extension(tls *crt.TLS, _xInit func(*crt.TLS)) (r0 int32) {
var _i, _n int32
var _mutex *Xsqlite3_mutex
_mutex = _sqlite3MutexAlloc(tls, i32(2))
_n = i32(0)
Xsqlite3_mutex_enter(tls, _mutex)
_i = int32(_sqlite3Autoext.X0) - i32(1)
_0:
if _i < i32(0) {
goto _3
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{(*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_i))))})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_xInit})) {
*(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) -= 1
*(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_i))) = *(*func(*crt.TLS))(unsafe.Pointer(uintptr((unsafe.Pointer)(_sqlite3Autoext.X1)) + 4*uintptr(_sqlite3Autoext.X0)))
_n += 1
goto _3
}
_i -= 1
goto _0
_3:
Xsqlite3_mutex_leave(tls, _mutex)
return _n
}
// Reset the automatic extension loading mechanism.
func Xsqlite3_reset_auto_extension(tls *crt.TLS) {
var _1_mutex *Xsqlite3_mutex
if Xsqlite3_initialize(tls) == i32(0) {
_1_mutex = _sqlite3MutexAlloc(tls, i32(2))
Xsqlite3_mutex_enter(tls, _1_mutex)
Xsqlite3_free(tls, (unsafe.Pointer)(_sqlite3Autoext.X1))
*(**func(*crt.TLS))(unsafe.Pointer(&(_sqlite3Autoext.X1))) = nil
*(*uint32)(unsafe.Pointer(&(_sqlite3Autoext.X0))) = uint32(i32(0))
Xsqlite3_mutex_leave(tls, _1_mutex)
}
}
func Xsqlite3_result_blob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z unsafe.Pointer, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer)) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76438), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_blob64Ø00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76439), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_blob64Ø00__func__Ø000))), unsafe.Pointer(str(130033)))
crt.X__builtin_abort(tls)
}
}()
if _n > uint64(i32(2147483647)) {
_invokeValueDestructor(tls, _z, _xDel, _pCtx)
goto _5
}
_setResultStrOrError(tls, _pCtx, (*int8)(_z), int32(_n), uint8(i32(0)), _xDel)
_5:
}
var _sqlite3_result_blob64Ø00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_blob64Ø00__func__Ø000[0], str(130116), 22)
}
func Xsqlite3_result_text64(tls *crt.TLS, _pCtx *Xsqlite3_context, _z *int8, _n uint64, _xDel func(*crt.TLS, unsafe.Pointer), _enc uint8) {
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)((*XMem)(_pCtx.X0).X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76498), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text64Ø00__func__Ø000))), unsafe.Pointer(str(6666)))
crt.X__builtin_abort(tls)
}
}()
func() {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{_xDel})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer)
}{(*(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))})) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76499), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_text64Ø00__func__Ø000))), unsafe.Pointer(str(130033)))
crt.X__builtin_abort(tls)
}
}()
if int32(_enc) == i32(4) {
_enc = uint8(i32(2))
}
if _n > uint64(i32(2147483647)) {
_invokeValueDestructor(tls, (unsafe.Pointer)(_z), _xDel, _pCtx)
goto _6
}
_setResultStrOrError(tls, _pCtx, _z, int32(_n), _enc, _xDel)
_6:
}
var _sqlite3_result_text64Ø00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_text64Ø00__func__Ø000[0], str(130138), 22)
}
// Make a copy of an sqlite3_value object
func Xsqlite3_value_dup(tls *crt.TLS, _pOrig *XMem) (r0 *XMem) {
var _pNew *XMem
if _pOrig == nil {
return nil
}
_pNew = (*XMem)(Xsqlite3_malloc(tls, int32(u32(48))))
if _pNew == nil {
return nil
}
crt.Xmemset(tls, (unsafe.Pointer)(_pNew), i32(0), u32(48))
crt.Xmemcpy(tls, (unsafe.Pointer)(_pNew), (unsafe.Pointer)(_pOrig), u32(20))
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X1)))
*p = uint16(int32(*p) & i32(-1025))
sink14 = *p
}
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X9))))) = nil
if (int32(_pNew.X1) & i32(18)) == 0 {
goto _2
}
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X1)))
*p = uint16(int32(*p) & i32(-3073))
sink14 = *p
}
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X1)))
*p = uint16(int32(*p) | i32(4096))
sink14 = *p
}
if _sqlite3VdbeMemMakeWriteable(tls, _pNew) != i32(0) {
_sqlite3ValueFree(tls, _pNew)
_pNew = nil
}
_2:
return _pNew
}
// Destroy an sqlite3_value object previously obtained from
// sqlite3_value_dup().
func Xsqlite3_value_free(tls *crt.TLS, _pOld *XMem) {
_sqlite3ValueFree(tls, _pOld)
}
func Xsqlite3_result_zeroblob64(tls *crt.TLS, _pCtx *Xsqlite3_context, _n uint64) (r0 int32) {
var _pOut *XMem
_pOut = (*XMem)(_pCtx.X0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76546), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_zeroblob64Ø00__func__Ø000))), unsafe.Pointer(str(130160)))
crt.X__builtin_abort(tls)
}
}()
if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_pOut.X9).X31))))) + 4*uintptr(i32(0))))) {
return i32(18)
}
_sqlite3VdbeMemSetZeroBlob(tls, (*XMem)(_pCtx.X0), int32(_n))
return i32(0)
}
var _sqlite3_result_zeroblob64Ø00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_zeroblob64Ø00__func__Ø000[0], str(130196), 26)
}
func Xsqlite3_bind_zeroblob64(tls *crt.TLS, _pStmt unsafe.Pointer, _i int32, _n uint64) (r0 int32) {
var _rc int32
var _p *TVdbe
_p = (*TVdbe)(_pStmt)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
if _n > uint64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&((*Xsqlite3)(_p.X0).X31))))) + 4*uintptr(i32(0))))) {
_rc = i32(18)
goto _1
}
func() {
if (_n & uint64(i32(2147483647))) != _n {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(77558), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_bind_zeroblob64Ø00__func__Ø000))), unsafe.Pointer(str(130222)))
crt.X__builtin_abort(tls)
}
}()
_rc = Xsqlite3_bind_zeroblob(tls, _pStmt, _i, int32(_n))
_1:
_rc = _sqlite3ApiExit(tls, (*Xsqlite3)(_p.X0), _rc)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_p.X0).X3))
return _rc
}
var _sqlite3_bind_zeroblob64Ø00__func__Ø000 [24]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_bind_zeroblob64Ø00__func__Ø000[0], str(130242), 24)
}
func Xsqlite3_value_subtype(tls *crt.TLS, _pVal *XMem) (r0 uint32) {
var _pMem *XMem
_pMem = _pVal
return uint32(func() int32 {
if (int32(_pMem.X1) & i32(32768)) != 0 {
return int32(_pMem.X3)
}
return i32(0)
}())
}
func Xsqlite3_result_subtype(tls *crt.TLS, _pCtx *Xsqlite3_context, _eSubtype uint32) {
var _pOut *XMem
_pOut = (*XMem)(_pCtx.X0)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_pOut.X9).X3)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(76478), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3_result_subtypeØ00__func__Ø000))), unsafe.Pointer(str(130160)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pOut.X3))) = uint8(_eSubtype & uint32(i32(255)))
{
p := (*uint16)(unsafe.Pointer(&(_pOut.X1)))
*p = uint16(int32(*p) | i32(32768))
sink14 = *p
}
}
var _sqlite3_result_subtypeØ00__func__Ø000 [23]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_result_subtypeØ00__func__Ø000[0], str(130266), 23)
}
// Flush any dirty pages in the pager-cache for any attached database
// to disk.
func Xsqlite3_db_cacheflush(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
var _i, _rc, _bSeenBusy int32
var _1_pBt *XBtree
var _2_pPager *XPager
_rc = i32(0)
_bSeenBusy = i32(0)
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(141232))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
_sqlite3BtreeEnterAll(tls, _db)
_i = i32(0)
_1:
if _rc != i32(0) || _i >= (_db.X5) {
goto _5
}
_1_pBt = (*XBtree)((*XDb)(unsafe.Pointer(uintptr(_db.X4) + 16*uintptr(_i))).X1)
if _1_pBt == nil || _sqlite3BtreeIsInTrans(tls, _1_pBt) == 0 {
goto _7
}
_2_pPager = _sqlite3BtreePager(tls, _1_pBt)
_rc = _sqlite3PagerFlush(tls, _2_pPager)
if _rc == i32(5) {
_bSeenBusy = i32(1)
_rc = i32(0)
}
_7:
_i += 1
goto _1
_5:
_sqlite3BtreeLeaveAll(tls, _db)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return func() int32 {
if (_rc == i32(0)) && _bSeenBusy != 0 {
return i32(5)
}
return _rc
}()
}
// Flush all unreferenced dirty pages to disk.
func _sqlite3PagerFlush(tls *crt.TLS, _pPager *XPager) (r0 int32) {
var _rc int32
var _1_pList, _2_pNext *XPgHdr
_rc = _pPager.X26
if (_pPager.X13) != 0 {
goto _0
}
_1_pList = _sqlite3PcacheDirtyList(tls, (*XPCache)(_pPager.X59))
func() {
if _assert_pager_state(tls, _pPager) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(51520), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3PagerFlushØ00__func__Ø000))), unsafe.Pointer(str(11016)))
crt.X__builtin_abort(tls)
}
}()
_3:
if _rc != i32(0) || _1_pList == nil {
goto _4
}
_2_pNext = (*XPgHdr)(_1_pList.X3)
if int32(_1_pList.X7) == i32(0) {
_rc = _pagerStress(tls, (unsafe.Pointer)(_pPager), _1_pList)
}
_1_pList = _2_pNext
goto _3
_4:
_0:
return _rc
}
var _sqlite3PagerFlushØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3PagerFlushØ00__func__Ø000[0], str(130289), 18)
}
func Xsqlite3_system_errno(tls *crt.TLS, _db *Xsqlite3) (r0 int32) {
return func() int32 {
if _db != nil {
return (_db.X12)
}
return i32(0)
}()
}
// Register a trace callback using the version-2 interface.
func Xsqlite3_trace_v2(tls *crt.TLS, _db *Xsqlite3, _mTrace uint32, _xTrace func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, _pArg unsafe.Pointer) (r0 int32) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
return _sqlite3MisuseError(tls, i32(142326))
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _mTrace == uint32(i32(0)) {
_xTrace = nil
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
}{_xTrace})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
}{nil})) {
_mTrace = uint32(i32(0))
}
*(*uint8)(unsafe.Pointer(&(_db.X24))) = uint8(_mTrace)
*(*func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32)(unsafe.Pointer(&(_db.X41))) = _xTrace
*(*unsafe.Pointer)(unsafe.Pointer(&(_db.X42))) = _pArg
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
// Return the SQL associated with a prepared statement with
// bound parameters expanded. Space to hold the returned string is
// obtained from sqlite3_malloc(). The caller is responsible for
// freeing the returned string by passing it to sqlite3_free().
//
// The SQLITE_TRACE_SIZE_LIMIT puts an upper bound on the size of
// expanded bound parameters.
func Xsqlite3_expanded_sql(tls *crt.TLS, _pStmt unsafe.Pointer) (r0 *int8) {
var _z, _zSql *int8
var _1_p *TVdbe
_z = nil
_zSql = Xsqlite3_sql(tls, _pStmt)
if _zSql != nil {
_1_p = (*TVdbe)(_pStmt)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.X0).X3))
_z = _sqlite3VdbeExpandSql(tls, _1_p, _zSql)
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)((*Xsqlite3)(_1_p.X0).X3))
}
return _z
}
// Set the value returned by the sqlite3_last_insert_rowid() API function.
func Xsqlite3_set_last_insert_rowid(tls *crt.TLS, _db *Xsqlite3, _iRowid int64) {
if _sqlite3SafetyCheckOk(tls, _db) == 0 {
_sqlite3MisuseError(tls, i32(141398))
return
}
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
*(*int64)(unsafe.Pointer(&(_db.X7))) = _iRowid
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
}
func _compileoptionusedFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _zOptName *int8
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106483), unsafe.Pointer((*int8)(unsafe.Pointer(&_compileoptionusedFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
if store0(&_zOptName, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))) != nil {
Xsqlite3_result_int(tls, _context, Xsqlite3_compileoption_used(tls, _zOptName))
}
}
var _compileoptionusedFuncØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_compileoptionusedFuncØ00__func__Ø000[0], str(130307), 22)
}
func _compileoptiongetFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _n int32
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106507), unsafe.Pointer((*int8)(unsafe.Pointer(&_compileoptiongetFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
Xsqlite3_result_text(tls, _context, Xsqlite3_compileoption_get(tls, _n), i32(-1), nil)
}
var _compileoptiongetFuncØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_compileoptiongetFuncØ00__func__Ø000[0], str(130329), 21)
}
// Implementation of the sqlite_version() function. The result is the version
// of the SQLite library that is running.
func _versionFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
_ = _NotUsed2
Xsqlite3_result_text(tls, _context, Xsqlite3_libversion(tls), i32(-1), nil)
}
// Implementation of the TRIM(), LTRIM(), and RTRIM() functions.
// The userdata is 0x1 for left trim, 0x2 for right trim, 0x3 for both.
func _trimFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nIn, _flags, _i, _nChar, _17_len, _20_len int32
var _zIn, _zCharSet, _aLen, _4_z *uint8
var _azChar **uint8
_aLen = nil
_azChar = nil
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == i32(5) {
return
}
_zIn = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _zIn == nil {
return
}
_nIn = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _zIn != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106818), unsafe.Pointer((*int8)(unsafe.Pointer(&_trimFuncØ00__func__Ø000))), unsafe.Pointer(str(130350)))
crt.X__builtin_abort(tls)
}
}()
if _argc == i32(1) {
_nChar = i32(1)
_aLen = (*uint8)(unsafe.Pointer(&_trimFuncØ00lenOneØ001))
_azChar = (**uint8)(unsafe.Pointer(&_trimFuncØ00azOneØ002))
_zCharSet = nil
goto _7
}
if store13(&_zCharSet, Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))) == nil {
return
}
*func() *int32 { _4_z = _zCharSet; return &_nChar }() = i32(0)
_8:
if (*_4_z) == 0 {
goto _11
}
if int32(*postInc13(&_4_z, 1)) < i32(192) {
goto _12
}
_13:
if (int32(*_4_z) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
goto _13
}
_12:
_nChar += 1
goto _8
_11:
if _nChar <= i32(0) {
goto _15
}
_azChar = (**uint8)(_contextMalloc(tls, _context, int64(_nChar)*int64(u32(5))))
if _azChar == nil {
return
}
_aLen = (*uint8)(unsafe.Pointer((**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 4*uintptr(_nChar)))))
*func() *int32 { _4_z = _zCharSet; return &_nChar }() = i32(0)
_17:
if (*_4_z) == 0 {
goto _20
}
*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 4*uintptr(_nChar))) = _4_z
if int32(*postInc13(&_4_z, 1)) < i32(192) {
goto _21
}
_22:
if (int32(*_4_z) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_4_z)) += uintptr(1)
goto _22
}
_21:
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_nChar))) = uint8(int32((uintptr(unsafe.Pointer(_4_z)) - uintptr(unsafe.Pointer(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 4*uintptr(_nChar)))))) / 1))
_nChar += 1
goto _17
_20:
_15:
_7:
if _nChar <= i32(0) {
goto _24
}
_flags = int32(uintptr(Xsqlite3_user_data(tls, _context)))
if (_flags & i32(1)) == 0 {
goto _25
}
_26:
if _nIn <= i32(0) {
goto _27
}
_17_len = i32(0)
_i = i32(0)
_28:
if _i >= _nChar {
goto _31
}
_17_len = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_i))))
if (_17_len <= _nIn) && (crt.Xmemcmp(tls, (unsafe.Pointer)(_zIn), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 4*uintptr(_i)))), uint32(_17_len)) == i32(0)) {
goto _31
}
_i += 1
goto _28
_31:
if _i >= _nChar {
goto _27
}
{
p := &_zIn
*p = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(*p)) + 1*uintptr(_17_len)))
sink13 = *p
}
{
p := &_nIn
*p = (*p) - _17_len
sink1 = *p
}
goto _26
_27:
_25:
if (_flags & i32(2)) == 0 {
goto _35
}
_36:
if _nIn <= i32(0) {
goto _37
}
_20_len = i32(0)
_i = i32(0)
_38:
if _i >= _nChar {
goto _41
}
_20_len = int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_aLen)) + 1*uintptr(_i))))
if (_20_len <= _nIn) && (crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn))+1*uintptr(_nIn-_20_len)))), (unsafe.Pointer)(*(**uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_azChar)) + 4*uintptr(_i)))), uint32(_20_len)) == i32(0)) {
goto _41
}
_i += 1
goto _38
_41:
if _i >= _nChar {
goto _37
}
{
p := &_nIn
*p = (*p) - _20_len
sink1 = *p
}
goto _36
_37:
_35:
if _zCharSet != nil {
Xsqlite3_free(tls, (unsafe.Pointer)(_azChar))
}
_24:
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zIn)), _nIn, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
}
var _trimFuncØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_trimFuncØ00__func__Ø000[0], str(130383), 9)
}
var _trimFuncØ00lenOneØ001 [1]uint8
func init() {
_trimFuncØ00lenOneØ001 = [1]uint8{1}
}
var _trimFuncØ00azOneØ002 [1]*uint8
func init() {
_trimFuncØ00azOneØ002 = [1]*uint8{(*byte)(unsafe.Pointer(str(119934)))}
}
// Allocate nByte bytes of space using sqlite3Malloc(). If the
// allocation fails, call sqlite3_result_error_nomem() to notify
// the database handle that malloc() has failed and return NULL.
// If nByte is larger than the maximum string or blob length, then
// raise an SQLITE_TOOBIG exception and return NULL.
func _contextMalloc(tls *crt.TLS, _context *Xsqlite3_context, _nByte int64) (r0 unsafe.Pointer) {
var _z *int8
var _db *Xsqlite3
_db = Xsqlite3_context_db_handle(tls, _context)
func() {
if _nByte <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105944), unsafe.Pointer((*int8)(unsafe.Pointer(&_contextMallocØ00__func__Ø000))), unsafe.Pointer(str(130392)))
crt.X__builtin_abort(tls)
}
}()
if _nByte > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0))))) {
Xsqlite3_result_error_toobig(tls, _context)
_z = nil
goto _3
}
_z = (*int8)(_sqlite3Malloc(tls, uint64(_nByte)))
if _z == nil {
Xsqlite3_result_error_nomem(tls, _context)
}
_3:
return (unsafe.Pointer)(_z)
}
var _contextMallocØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_contextMallocØ00__func__Ø000[0], str(130400), 14)
}
// Implementation of the non-aggregate min() and max() functions
func _minmaxFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i, _mask, _iBest int32
var _pColl *XCollSeq
func() {
if _argc <= i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105594), unsafe.Pointer((*int8)(unsafe.Pointer(&_minmaxFuncØ00__func__Ø000))), unsafe.Pointer(str(130414)))
crt.X__builtin_abort(tls)
}
}()
_mask = func() int32 {
if Xsqlite3_user_data(tls, _context) == nil {
return i32(0)
}
return i32(-1)
}()
_pColl = _sqlite3GetFuncCollSeq(tls, _context)
func() {
if _pColl == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105597), unsafe.Pointer((*int8)(unsafe.Pointer(&_minmaxFuncØ00__func__Ø000))), unsafe.Pointer(str(130421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _mask != i32(-1) && _mask != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105598), unsafe.Pointer((*int8)(unsafe.Pointer(&_minmaxFuncØ00__func__Ø000))), unsafe.Pointer(str(130427)))
crt.X__builtin_abort(tls)
}
}()
_iBest = i32(0)
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == i32(5) {
return
}
_i = i32(1)
_10:
if _i >= _argc {
goto _13
}
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i)))) == i32(5) {
return
}
if (_sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_iBest))), *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i))), _pColl) ^ _mask) >= i32(0) {
_iBest = _i
}
_i += 1
goto _10
_13:
Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_iBest))))
}
var _minmaxFuncØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_minmaxFuncØ00__func__Ø000[0], str(130447), 11)
}
// Return the collating function associated with a function.
func _sqlite3GetFuncCollSeq(tls *crt.TLS, _context *Xsqlite3_context) (r0 *XCollSeq) {
var _pOp *XVdbeOp
func() {
if (*TVdbe)(_context.X3) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105566), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000))), unsafe.Pointer(str(130458)))
crt.X__builtin_abort(tls)
}
}()
_pOp = (*XVdbeOp)(unsafe.Pointer(uintptr((*TVdbe)(_context.X3).X17) + 24*uintptr((_context.X4)-i32(1))))
func() {
if int32(_pOp.X0) != i32(68) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105568), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000))), unsafe.Pointer(str(130476)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pOp.X1) != i32(-3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105569), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3GetFuncCollSeqØ00__func__Ø000))), unsafe.Pointer(str(64393)))
crt.X__builtin_abort(tls)
}
}()
return (*XCollSeq)(*(*unsafe.Pointer)(unsafe.Pointer((*t39)(unsafe.Pointer(&(_pOp.X6))))))
}
var _sqlite3GetFuncCollSeqØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3GetFuncCollSeqØ00__func__Ø000[0], str(130500), 22)
}
// Routines to implement min() and max() aggregate functions.
func _minmaxStep(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _2_max, _2_cmp int32
var _pArg, _pBest *XMem
var _2_pColl *XCollSeq
_pArg = *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))
_pBest = (*XMem)(Xsqlite3_aggregate_context(tls, _context, int32(u32(48))))
if _pBest == nil {
return
}
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) != i32(5) {
goto _1
}
if (_pBest.X1) != 0 {
_sqlite3SkipAccumulatorLoad(tls, _context)
}
goto _10
_1:
if (_pBest.X1) == 0 {
goto _4
}
_2_pColl = _sqlite3GetFuncCollSeq(tls, _context)
_2_max = bool2int(Xsqlite3_user_data(tls, _context) != nil)
_2_cmp = _sqlite3MemCompare(tls, _pBest, _pArg, _2_pColl)
if (_2_max != 0 && (_2_cmp < i32(0))) || ((_2_max == 0) && (_2_cmp > i32(0))) {
_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
goto _9
}
_sqlite3SkipAccumulatorLoad(tls, _context)
_9:
goto _10
_4:
*(**Xsqlite3)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pBest.X9))))) = Xsqlite3_context_db_handle(tls, _context)
_sqlite3VdbeMemCopy(tls, _pBest, _pArg)
_10:
}
// Indicate that the accumulator load should be skipped on this
// iteration of the aggregate loop.
func _sqlite3SkipAccumulatorLoad(tls *crt.TLS, _context *Xsqlite3_context) {
*(*uint8)(unsafe.Pointer(&(_context.X6))) = uint8(i32(1))
}
func _minMaxFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _pRes *XMem
_pRes = (*XMem)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
if _pRes == nil {
goto _0
}
if (_pRes.X1) != 0 {
Xsqlite3_result_value(tls, _context, _pRes)
}
_sqlite3VdbeMemRelease(tls, _pRes)
_0:
}
// Return the type of the argument.
func _typeofFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _z *int8
_z = nil
switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
case i32(1):
goto _1
case i32(2):
goto _3
case i32(3):
goto _2
case i32(4):
goto _4
default:
goto _5
}
_1:
_z = str(42875)
goto _6
_2:
_z = str(42862)
goto _6
_3:
_z = str(42883)
goto _6
_4:
_z = str(42857)
goto _6
_5:
_z = str(128753)
goto _6
_6:
Xsqlite3_result_text(tls, _context, _z, i32(-1), nil)
}
// Implementation of the length() function
func _lengthFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _len int32
var _3_z *uint8
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105642), unsafe.Pointer((*int8)(unsafe.Pointer(&_lengthFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
case i32(1):
goto _3
case i32(2):
goto _3
case i32(3):
goto _6
case i32(4):
goto _3
default:
goto _7
}
_3:
Xsqlite3_result_int(tls, _context, Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
goto _8
_6:
_3_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _3_z == nil {
return
}
_len = i32(0)
_10:
if (*_3_z) == 0 {
goto _11
}
_len += 1
if int32(*postInc13(&_3_z, 1)) < i32(192) {
goto _12
}
_13:
if (int32(*_3_z) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_3_z)) += uintptr(1)
goto _13
}
_12:
goto _10
_11:
Xsqlite3_result_int(tls, _context, _len)
goto _8
_7:
Xsqlite3_result_null(tls, _context)
goto _8
_8:
}
var _lengthFuncØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_lengthFuncØ00__func__Ø000[0], str(130522), 11)
}
// Implementation of the instr() function.
//
// instr(haystack,needle) finds the first occurrence of needle
// in haystack and returns the number of previous characters plus 1,
// or 0 if needle does not occur within haystack.
//
// If both haystack and needle are BLOBs, then the result is one more than
// the number of bytes in haystack prior to the first occurrence of needle,
// or 0 if needle never occurs in haystack.
func _instrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nHaystack, _nNeedle, _typeHaystack, _typeNeedle, _N, _isText int32
var _zHaystack, _zNeedle *uint8
_N = i32(1)
_typeHaystack = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_typeNeedle = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
if (_typeHaystack == i32(5)) || (_typeNeedle == i32(5)) {
return
}
_nHaystack = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_nNeedle = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
if _nNeedle <= i32(0) {
goto _2
}
if (_typeHaystack == i32(4)) && (_typeNeedle == i32(4)) {
_zHaystack = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
_zNeedle = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))))
_isText = i32(0)
goto _5
}
_zHaystack = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_zNeedle = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
_isText = i32(1)
_5:
if (_zNeedle == nil) || (_nHaystack != 0 && (_zHaystack == nil)) {
return
}
_8:
if _nNeedle > _nHaystack || crt.Xmemcmp(tls, (unsafe.Pointer)(_zHaystack), (unsafe.Pointer)(_zNeedle), uint32(_nNeedle)) == i32(0) {
goto _10
}
_N += 1
_12:
_nHaystack -= 1
*(*uintptr)(unsafe.Pointer(&_zHaystack)) += uintptr(1)
if _isText != 0 && ((int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zHaystack)) + 1*uintptr(i32(0))))) & i32(192)) == i32(128)) {
goto _12
}
goto _8
_10:
if _nNeedle > _nHaystack {
_N = i32(0)
}
_2:
Xsqlite3_result_int(tls, _context, _N)
}
// Implementation of the printf() function.
func _printfFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _n int32
var _zFormat *int8
var _db *Xsqlite3
var _str XStrAccum
var _x XPrintfArguments
_db = Xsqlite3_context_db_handle(tls, _context)
if (_argc >= i32(1)) && (store0(&_zFormat, (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))) != nil) {
*(*int32)(unsafe.Pointer(&(_x.X0))) = _argc - i32(1)
*(*int32)(unsafe.Pointer(&(_x.X1))) = i32(0)
*(***XMem)(unsafe.Pointer((**unsafe.Pointer)(unsafe.Pointer(&(_x.X2))))) = (**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer(_argv)) + uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(i32(1))))))*uintptr(unsafe.Pointer((**XMem)(unsafe.Pointer(uintptr(4)))))))))))
_sqlite3StrAccumInit(tls, &_str, _db, nil, i32(0), *(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_db.X31))))) + 4*uintptr(i32(0)))))
*(*uint8)(unsafe.Pointer(&(_str.X7))) = uint8(i32(2))
_sqlite3XPrintf(tls, &_str, _zFormat, unsafe.Pointer(&_x))
_n = int32(_str.X3)
Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, &_str), _n, *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{_sqlite3MallocSize})))
}
_ = _x
_ = _str
}
// The unicode() function. Return the integer unicode code-point value
// for the first character of the input string.
func _unicodeFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _z *uint8
_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if (_z != nil) && ((*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z)) + 1*uintptr(i32(0))))) != 0) {
Xsqlite3_result_int(tls, _context, int32(_sqlite3Utf8Read(tls, &_z)))
}
}
// The char() function takes zero or more arguments, each of which is
// an integer. It constructs a string where each character of the string
// is the unicode character for the corresponding integer argument.
func _charFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i int32
var _2_x int64
var _2_c uint32
var _z, _zOut *uint8
_zOut = store13(&_z, (*uint8)(Xsqlite3_malloc64(tls, uint64((_argc*i32(4))+i32(1)))))
if _z == nil {
Xsqlite3_result_error_nomem(tls, _context)
return
}
_i = i32(0)
_1:
if _i >= _argc {
goto _4
}
_2_x = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(_i))))
if (_2_x < int64(i32(0))) || (_2_x > int64(i32(1114111))) {
_2_x = int64(i32(65533))
}
_2_c = uint32(_2_x & int64(i32(2097151)))
if _2_c < uint32(i32(128)) {
*postInc13(&_zOut, 1) = uint8(_2_c & uint32(i32(255)))
goto _12
}
if _2_c < uint32(i32(2048)) {
*postInc13(&_zOut, 1) = uint8(i32(192) + int32(uint8((_2_c>>uint(i32(6)))&uint32(i32(31)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8(_2_c&uint32(i32(63)))))
goto _12
}
if _2_c < uint32(i32(65536)) {
*postInc13(&_zOut, 1) = uint8(i32(224) + int32(uint8((_2_c>>uint(i32(12)))&uint32(i32(15)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8((_2_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8(_2_c&uint32(i32(63)))))
goto _12
}
*postInc13(&_zOut, 1) = uint8(i32(240) + int32(uint8((_2_c>>uint(i32(18)))&uint32(i32(7)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8((_2_c>>uint(i32(12)))&uint32(i32(63)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8((_2_c>>uint(i32(6)))&uint32(i32(63)))))
*postInc13(&_zOut, 1) = uint8(i32(128) + int32(uint8(_2_c&uint32(i32(63)))))
_12:
_i += 1
goto _1
_4:
Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int32((uintptr(unsafe.Pointer(_zOut))-uintptr(unsafe.Pointer(_z)))/1)), Xsqlite3_free, uint8(i32(1)))
}
// Implementation of the abs() function.
//
// IMP: R-23979-26855 The abs(X) function returns the absolute value of
// the numeric argument X.
func _absFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _2_iVal int64
var _6_rVal float64
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105676), unsafe.Pointer((*int8)(unsafe.Pointer(&_absFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
case i32(1):
goto _3
case i32(5):
goto _4
default:
goto _5
}
_3:
_2_iVal = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _2_iVal >= int64(i32(0)) {
goto _6
}
if _2_iVal == i64(-9223372036854775808) {
Xsqlite3_result_error(tls, _context, str(130533), i32(-1))
return
}
_2_iVal = -_2_iVal
_6:
Xsqlite3_result_int64(tls, _context, _2_iVal)
goto _8
_4:
Xsqlite3_result_null(tls, _context)
goto _8
_5:
_6_rVal = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _6_rVal < float64(i32(0)) {
_6_rVal = -_6_rVal
}
Xsqlite3_result_double(tls, _context, _6_rVal)
goto _8
_8:
}
var _absFuncØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_absFuncØ00__func__Ø000[0], str(130550), 8)
}
func _roundFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _n int32
var _zBuf *int8
var _r float64
_n = i32(0)
func() {
if _argc != i32(1) && _argc != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105904), unsafe.Pointer((*int8)(unsafe.Pointer(&_roundFuncØ00__func__Ø000))), unsafe.Pointer(str(130558)))
crt.X__builtin_abort(tls)
}
}()
if _argc != i32(2) {
goto _3
}
if i32(5) == Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) {
return
}
_n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
if _n > i32(30) {
_n = i32(30)
}
if _n < i32(0) {
_n = i32(0)
}
_3:
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == i32(5) {
return
}
_r = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if ((_n == i32(0)) && (_r >= float64(i32(0)))) && (_r < float64(i64(9223372036854775806))) {
_r = float64(int64(_r + (0.5)))
goto _15
}
if ((_n == i32(0)) && (_r < float64(i32(0)))) && ((-_r) < float64(i64(9223372036854775806))) {
_r = -float64(int64((-_r) + (0.5)))
goto _15
}
_zBuf = Xsqlite3_mprintf(tls, str(130577), _n, _r)
if _zBuf == nil {
Xsqlite3_result_error_nomem(tls, _context)
return
}
_sqlite3AtoF(tls, _zBuf, &_r, _sqlite3Strlen30(tls, _zBuf), uint8(i32(1)))
Xsqlite3_free(tls, (unsafe.Pointer)(_zBuf))
_15:
Xsqlite3_result_double(tls, _context, _r)
}
var _roundFuncØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_roundFuncØ00__func__Ø000[0], str(130582), 10)
}
// Implementation of the upper() and lower() SQL functions.
func _upperFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i, _n int32
var _z1, _z2 *int8
_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105970), unsafe.Pointer((*int8)(unsafe.Pointer(&_upperFuncØ00__func__Ø000))), unsafe.Pointer(str(130592)))
crt.X__builtin_abort(tls)
}
}()
if _z2 == nil {
goto _2
}
_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(i32(1))))
if _z1 == nil {
goto _3
}
_i = i32(0)
_4:
if _i >= _n {
goto _7
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z1)) + 1*uintptr(_i))) = int8(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i)))) & (^(int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i)))))))) & i32(32))))
_i += 1
goto _4
_7:
Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
_3:
_2:
}
var _upperFuncØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_upperFuncØ00__func__Ø000[0], str(130631), 10)
}
func _lowerFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i, _n int32
var _z1, _z2 *int8
_z2 = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _z2 != (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105989), unsafe.Pointer((*int8)(unsafe.Pointer(&_lowerFuncØ00__func__Ø000))), unsafe.Pointer(str(130592)))
crt.X__builtin_abort(tls)
}
}()
if _z2 == nil {
goto _2
}
_z1 = (*int8)(_contextMalloc(tls, _context, int64(_n)+int64(i32(1))))
if _z1 == nil {
goto _3
}
_i = i32(0)
_4:
if _i >= _n {
goto _7
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z1)) + 1*uintptr(_i))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3UpperToLower)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z2)) + 1*uintptr(_i))))))))
_i += 1
goto _4
_7:
Xsqlite3_result_text(tls, _context, _z1, _n, Xsqlite3_free)
_3:
_2:
}
var _lowerFuncØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_lowerFuncØ00__func__Ø000[0], str(130641), 10)
}
// The hex() function. Interpret the argument as a blob. Return
// a hexadecimal rendering as text.
func _hexFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _i, _n int32
var _zHex, _z *int8
var _2_c uint8
var _pBlob *uint8
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106671), unsafe.Pointer((*int8)(unsafe.Pointer(&_hexFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_pBlob = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
_n = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _pBlob != (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106675), unsafe.Pointer((*int8)(unsafe.Pointer(&_hexFuncØ00__func__Ø000))), unsafe.Pointer(str(130651)))
crt.X__builtin_abort(tls)
}
}()
_z = store0(&_zHex, (*int8)(_contextMalloc(tls, _context, (int64(_n)*int64(i32(2)))+int64(i32(1)))))
if _zHex == nil {
goto _4
}
_i = i32(0)
_5:
if _i >= _n {
goto _8
}
_2_c = *_pBlob
*postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr((int32(_2_c)>>uint(i32(4)))&i32(15))))
*postInc0(&_z, 1) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr(int32(_2_c)&i32(15))))
*(*uintptr)(unsafe.Pointer(func() **uint8 { _i += 1; return &_pBlob }())) += uintptr(1)
goto _5
_8:
*_z = int8(i32(0))
Xsqlite3_result_text(tls, _context, _zHex, _n*i32(2), Xsqlite3_free)
_4:
}
var _hexFuncØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_hexFuncØ00__func__Ø000[0], str(130686), 8)
}
var _hexdigits [16]int8
func init() {
_hexdigits = [16]int8{48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 65, 66, 67, 68, 69, 70}
}
// Implementation of random(). Return a random integer.
func _randomFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
var _r int64
_ = _NotUsed2
Xsqlite3_randomness(tls, int32(u32(8)), (unsafe.Pointer)(&_r))
if _r < int64(i32(0)) {
_r = -(_r & i64(9223372036854775807))
}
Xsqlite3_result_int64(tls, _context, _r)
}
// Implementation of randomblob(N). Return a random blob
// that is N bytes long.
func _randomBlob(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _n int32
var _p *uint8
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106047), unsafe.Pointer((*int8)(unsafe.Pointer(&_randomBlobØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_n = Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _n < i32(1) {
_n = i32(1)
}
_p = (*uint8)(_contextMalloc(tls, _context, int64(_n)))
if _p != nil {
Xsqlite3_randomness(tls, _n, (unsafe.Pointer)(_p))
Xsqlite3_result_blob(tls, _context, (unsafe.Pointer)(_p), _n, Xsqlite3_free)
}
}
var _randomBlobØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_randomBlobØ00__func__Ø000[0], str(130694), 11)
}
// Implementation of the NULLIF(x,y) function. The result is the first
// argument if the arguments are different. The result is NULL if the
// arguments are equal to each other.
func _nullifFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _argv **XMem) {
var _pColl *XCollSeq
_pColl = _sqlite3GetFuncCollSeq(tls, _context)
if _sqlite3MemCompare(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))), *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))), _pColl) != i32(0) {
Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
}
}
// Implementation of the sqlite_source_id() function. The result is a string
// that identifies the particular version of the source code used to build
// SQLite.
func _sourceidFunc(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
_ = _NotUsed2
Xsqlite3_result_text(tls, _context, Xsqlite3_sourceid(tls), i32(-1), nil)
}
// Implementation of the sqlite_log() function. This is a wrapper around
// sqlite3_log(). The return value is NULL. The function exists purely for
// its side-effects.
func _errlogFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))), str(24576), unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))))
}
// Implementation of the QUOTE() function. This function takes a single
// argument. If the argument is numeric, the return value is the same as
// the argument. If the argument is NULL, the return value is the string
// "NULL". Otherwise, the argument is enclosed in single quotes with
// single-quote escapes.
func _quoteFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _5_nBlob, _6_i, _8_i, _8_j int32
var _8_n uint64
var _5_zText, _5_zBlob, _8_z *int8
var _2_r1, _2_r2 float64
var _8_zArg *uint8
var _2_zBuf [50]int8
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106532), unsafe.Pointer((*int8)(unsafe.Pointer(&_quoteFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
switch Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
case i32(1):
goto _4
case i32(2):
goto _3
case i32(3):
goto _6
case i32(4):
goto _5
default:
goto _7
}
_3:
_2_r1 = Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
Xsqlite3_snprintf(tls, int32(u32(50)), (*int8)(unsafe.Pointer(&_2_zBuf)), str(6367), _2_r1)
_sqlite3AtoF(tls, (*int8)(unsafe.Pointer(&_2_zBuf)), &_2_r2, i32(20), uint8(i32(1)))
if _2_r1 != _2_r2 {
Xsqlite3_snprintf(tls, int32(u32(50)), (*int8)(unsafe.Pointer(&_2_zBuf)), str(130705), _2_r1)
}
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(&_2_zBuf)), i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
goto _9
_4:
Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
goto _9
_5:
_5_zText = nil
_5_zBlob = (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
_5_nBlob = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _5_zBlob != (*int8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106555), unsafe.Pointer((*int8)(unsafe.Pointer(&_quoteFuncØ00__func__Ø000))), unsafe.Pointer(str(130712)))
crt.X__builtin_abort(tls)
}
}()
_5_zText = (*int8)(_contextMalloc(tls, _context, (int64(i32(2))*int64(_5_nBlob))+int64(i32(4))))
if _5_zText == nil {
goto _12
}
_6_i = i32(0)
_13:
if _6_i >= _5_nBlob {
goto _16
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(2)))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr((int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zBlob)) + 1*uintptr(_6_i))))>>uint(i32(4)))&i32(15))))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_6_i*i32(2))+i32(3)))) = *(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_hexdigits)) + 1*uintptr(int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zBlob)) + 1*uintptr(_6_i))))&i32(15))))
_6_i += 1
goto _13
_16:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(2)))) = int8(i32(39))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr((_5_nBlob*i32(2))+i32(3)))) = int8(i32(0))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr(i32(0)))) = int8(i32(88))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_5_zText)) + 1*uintptr(i32(1)))) = int8(i32(39))
Xsqlite3_result_text(tls, _context, _5_zText, i32(-1), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
Xsqlite3_free(tls, (unsafe.Pointer)(_5_zText))
_12:
goto _9
_6:
_8_zArg = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _8_zArg == nil {
return
}
*func() *uint64 { _8_i = i32(0); return &_8_n }() = uint64(i32(0))
_18:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == 0 {
goto _21
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) {
_8_n += 1
}
_8_i += 1
goto _18
_21:
_8_z = (*int8)(_contextMalloc(tls, _context, (int64(_8_i)+int64(_8_n))+int64(i32(3))))
if _8_z == nil {
goto _23
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(i32(0)))) = int8(i32(39))
*func() *int32 { _8_i = i32(0); return &_8_j }() = i32(1)
_24:
if (*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == 0 {
goto _27
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i))))
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_zArg)) + 1*uintptr(_8_i)))) == i32(39) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(i32(39))
}
_8_i += 1
goto _24
_27:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(postInc1(&_8_j, int32(1))))) = int8(i32(39))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_8_z)) + 1*uintptr(_8_j))) = int8(i32(0))
Xsqlite3_result_text(tls, _context, _8_z, _8_j, Xsqlite3_free)
_23:
goto _9
_7:
func() {
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) != i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106596), unsafe.Pointer((*int8)(unsafe.Pointer(&_quoteFuncØ00__func__Ø000))), unsafe.Pointer(str(130747)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_result_text(tls, _context, str(155), i32(4), nil)
goto _9
_9:
_ = _2_zBuf
}
var _quoteFuncØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_quoteFuncØ00__func__Ø000[0], str(130788), 10)
}
// Implementation of the last_insert_rowid() SQL function. The return
// value is the same as the sqlite3_last_insert_rowid() API function.
func _last_insert_rowid(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
var _db *Xsqlite3
_db = Xsqlite3_context_db_handle(tls, _context)
_ = _NotUsed2
Xsqlite3_result_int64(tls, _context, Xsqlite3_last_insert_rowid(tls, _db))
}
// Implementation of the changes() SQL function.
//
// IMP: R-62073-11209 The changes() SQL function is a wrapper
// around the sqlite3_changes() C/C++ function and hence follows the same
// rules for counting changes.
func _changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
var _db *Xsqlite3
_db = Xsqlite3_context_db_handle(tls, _context)
_ = _NotUsed2
Xsqlite3_result_int(tls, _context, Xsqlite3_changes(tls, _db))
}
// Implementation of the total_changes() SQL function. The return value is
// the same as the sqlite3_total_changes() API function.
func _total_changes(tls *crt.TLS, _context *Xsqlite3_context, _NotUsed int32, _NotUsed2 **XMem) {
var _db *Xsqlite3
_db = Xsqlite3_context_db_handle(tls, _context)
_ = _NotUsed2
Xsqlite3_result_int(tls, _context, Xsqlite3_total_changes(tls, _db))
}
// The replace() function. Three arguments are all strings: call
// them A, B, and C. The result is also a string which is derived
// from A by replacing every occurrence of B with C. The match
// must be exact. Collating sequences are not used.
func _replaceFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nStr, _nPattern, _nRep, _loopLimit, _i, _j int32
var _nOut int64
var _zStr, _zPattern, _zRep, _zOut, _6_zOld *uint8
var _6_db *Xsqlite3
func() {
if _argc != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106730), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(50294)))
crt.X__builtin_abort(tls)
}
}()
_zStr = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _zStr == nil {
return
}
_nStr = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
func() {
if _zStr != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106735), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130798)))
crt.X__builtin_abort(tls)
}
}()
_zPattern = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
if _zPattern == nil {
func() {
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) != i32(5) && (Xsqlite3_context_db_handle(tls, _context).X17) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106738), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130832)))
crt.X__builtin_abort(tls)
}
}()
return
}
if int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0))))) == i32(0) {
func() {
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) == i32(5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106743), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130925)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_result_value(tls, _context, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
return
}
_nPattern = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
func() {
if _zPattern != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106748), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(130966)))
crt.X__builtin_abort(tls)
}
}()
_zRep = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))))
if _zRep == nil {
return
}
_nRep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2)))))
func() {
if _zRep != Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106752), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(131004)))
crt.X__builtin_abort(tls)
}
}()
_nOut = int64(_nStr + i32(1))
func() {
if _nOut >= int64(i32(1000000000)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106754), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(131038)))
crt.X__builtin_abort(tls)
}
}()
_zOut = (*uint8)(_contextMalloc(tls, _context, _nOut))
if _zOut == nil {
return
}
_loopLimit = _nStr - _nPattern
_i = store1(&_j, i32(0))
_20:
if _i > _loopLimit {
goto _23
}
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr)) + 1*uintptr(_i)))) != int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPattern)) + 1*uintptr(i32(0)))))) || crt.Xmemcmp(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr))+1*uintptr(_i)))), (unsafe.Pointer)(_zPattern), uint32(_nPattern)) != 0 {
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(postInc1(&_j, int32(1))))) = *(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr)) + 1*uintptr(_i)))
goto _26
}
_6_db = Xsqlite3_context_db_handle(tls, _context)
{
p := &_nOut
*p = (*p) + int64(_nRep-_nPattern)
sink6 = *p
}
if (_nOut - int64(i32(1))) > int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_6_db.X31))))) + 4*uintptr(i32(0))))) {
Xsqlite3_result_error_toobig(tls, _context)
Xsqlite3_free(tls, (unsafe.Pointer)(_zOut))
return
}
_6_zOld = _zOut
_zOut = (*uint8)(Xsqlite3_realloc64(tls, (unsafe.Pointer)(_zOut), uint64(int32(_nOut))))
if _zOut == nil {
Xsqlite3_result_error_nomem(tls, _context)
Xsqlite3_free(tls, (unsafe.Pointer)(_6_zOld))
return
}
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_j)))), (unsafe.Pointer)(_zRep), uint32(_nRep))
{
p := &_j
*p = (*p) + _nRep
sink1 = *p
}
{
p := &_i
*p = (*p) + (_nPattern - i32(1))
sink1 = *p
}
_26:
_i += 1
goto _20
_23:
func() {
if int64(((_j+_nStr)-_i)+i32(1)) != _nOut {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106786), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(131061)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemcpy(tls, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_j)))), (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zStr))+1*uintptr(_i)))), uint32(_nStr-_i))
{
p := &_j
*p = (*p) + (_nStr - _i)
sink1 = *p
}
func() {
if int64(_j) > _nOut {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106789), unsafe.Pointer((*int8)(unsafe.Pointer(&_replaceFuncØ00__func__Ø000))), unsafe.Pointer(str(131078)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_j))) = uint8(i32(0))
Xsqlite3_result_text(tls, _context, (*int8)(unsafe.Pointer(_zOut)), _j, Xsqlite3_free)
}
var _replaceFuncØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_replaceFuncØ00__func__Ø000[0], str(131086), 12)
}
// The zeroblob(N) function returns a zero-filled blob of size N bytes.
func _zeroblobFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _rc int32
var _n int64
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(106698), unsafe.Pointer((*int8)(unsafe.Pointer(&_zeroblobFuncØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_n = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _n < int64(i32(0)) {
_n = int64(i32(0))
}
_rc = Xsqlite3_result_zeroblob64(tls, _context, uint64(_n))
if _rc != 0 {
Xsqlite3_result_error_code(tls, _context, _rc)
}
}
var _zeroblobFuncØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_zeroblobFuncØ00__func__Ø000[0], str(131098), 13)
}
// Implementation of the substr() function.
//
// substr(x,p1,p2) returns p2 characters of x[] beginning with p1.
// p1 is 1-indexed. So substr(x,1,1) returns the first character
// of x. If x is text, then we actually count UTF-8 characters.
// If x is a blob, then we count bytes.
//
// If p1 is negative, then we begin abs(p1) from the end of x[].
//
// If p2 is negative, return the p2 characters preceding p1.
func _substrFunc(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _len, _p0type, _negP2 int32
var _p1, _p2 int64
var _z, _z2 *uint8
_negP2 = i32(0)
func() {
if _argc != i32(3) && _argc != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105817), unsafe.Pointer((*int8)(unsafe.Pointer(&_substrFuncØ00__func__Ø000))), unsafe.Pointer(str(131111)))
crt.X__builtin_abort(tls)
}
}()
if (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))) == i32(5)) || ((_argc == i32(3)) && (Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))) == i32(5))) {
return
}
_p0type = Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_p1 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1))))))
if _p0type != i32(4) {
goto _6
}
_len = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
_z = (*uint8)(Xsqlite3_value_blob(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))
if _z == nil {
return
}
func() {
if _len != Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105829), unsafe.Pointer((*int8)(unsafe.Pointer(&_substrFuncØ00__func__Ø000))), unsafe.Pointer(str(131130)))
crt.X__builtin_abort(tls)
}
}()
goto _10
_6:
_z = Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _z == nil {
return
}
_len = i32(0)
if _p1 >= int64(i32(0)) {
goto _12
}
_z2 = _z
_13:
if (*_z2) == 0 {
goto _16
}
if int32(*postInc13(&_z2, 1)) < i32(192) {
goto _17
}
_18:
if (int32(*_z2) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
goto _18
}
_17:
_len += 1
goto _13
_16:
_12:
_10:
if _argc != i32(3) {
goto _20
}
_p2 = int64(Xsqlite3_value_int(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(2))))))
if _p2 < int64(i32(0)) {
_p2 = -_p2
_negP2 = i32(1)
}
goto _22
_20:
_p2 = int64(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(Xsqlite3_context_db_handle(tls, _context).X31))))) + 4*uintptr(i32(0)))))
_22:
if _p1 >= int64(i32(0)) {
goto _23
}
{
p := &_p1
*p = (*p) + int64(_len)
sink6 = *p
}
if _p1 >= int64(i32(0)) {
goto _24
}
{
p := &_p2
*p = (*p) + _p1
sink6 = *p
}
if _p2 < int64(i32(0)) {
_p2 = int64(i32(0))
}
_p1 = int64(i32(0))
_24:
goto _29
_23:
if _p1 > int64(i32(0)) {
_p1 -= 1
goto _29
}
if _p2 > int64(i32(0)) {
_p2 -= 1
}
_29:
if _negP2 == 0 {
goto _30
}
{
p := &_p1
*p = (*p) - _p2
sink6 = *p
}
if _p1 < int64(i32(0)) {
{
p := &_p2
*p = (*p) + _p1
sink6 = *p
}
_p1 = int64(i32(0))
}
_30:
func() {
if _p1 < int64(i32(0)) || _p2 < int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(105876), unsafe.Pointer((*int8)(unsafe.Pointer(&_substrFuncØ00__func__Ø000))), unsafe.Pointer(str(131164)))
crt.X__builtin_abort(tls)
}
}()
if _p0type == i32(4) {
goto _35
}
_36:
if (*_z) == 0 || _p1 == 0 {
goto _37
}
if int32(*postInc13(&_z, 1)) < i32(192) {
goto _39
}
_40:
if (int32(*_z) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_z)) += uintptr(1)
goto _40
}
_39:
_p1 -= 1
goto _36
_37:
_z2 = _z
_42:
if (*_z2) == 0 || _p2 == 0 {
goto _46
}
if int32(*postInc13(&_z2, 1)) < i32(192) {
goto _47
}
_48:
if (int32(*_z2) & i32(192)) == i32(128) {
*(*uintptr)(unsafe.Pointer(&_z2)) += uintptr(1)
goto _48
}
_47:
_p2 -= 1
goto _42
_46:
Xsqlite3_result_text64(tls, _context, (*int8)(unsafe.Pointer(_z)), uint64(int32((uintptr(unsafe.Pointer(_z2))-uintptr(unsafe.Pointer(_z)))/1)), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})), uint8(i32(1)))
goto _50
_35:
if (_p1 + _p2) <= int64(_len) {
goto _51
}
_p2 = int64(_len) - _p1
if _p2 < int64(i32(0)) {
_p2 = int64(i32(0))
}
_51:
Xsqlite3_result_blob64(tls, _context, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_z))+1*uintptr(_p1)))), uint64(_p2), *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct{ f uintptr }{4294967295})))
_50:
}
var _substrFuncØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_substrFuncØ00__func__Ø000[0], str(131179), 11)
}
// Routines used to compute the sum, average, and total.
//
// The SUM() function follows the (broken) SQL standard which means
// that it returns NULL if it sums over no inputs. TOTAL returns
// 0.0 in that case. In addition, TOTAL always returns a float where
// SUM might return an integer if it never encounters a floating point
// value. TOTAL never fails, but SUM might through an exception if
// it overflows an integer.
func _sumStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _type int32
var _2_v int64
var _p *XSumCtx
func() {
if _argc != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107016), unsafe.Pointer((*int8)(unsafe.Pointer(&_sumStepØ00__func__Ø000))), unsafe.Pointer(str(125368)))
crt.X__builtin_abort(tls)
}
}()
_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, int32(u32(28))))
_type = Xsqlite3_value_numeric_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _p == nil || _type == i32(5) {
goto _3
}
*(*int64)(unsafe.Pointer(&(_p.X2))) += 1
if _type != i32(1) {
goto _4
}
_2_v = Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
{
p := (*float64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + float64(_2_v)
sink4 = *p
}
if ((int32(_p.X4) | int32(_p.X3)) == i32(0)) && _sqlite3AddInt64(tls, (*int64)(unsafe.Pointer(&(_p.X1))), _2_v) != 0 {
*(*uint8)(unsafe.Pointer(&(_p.X3))) = uint8(i32(1))
}
goto _7
_4:
{
p := (*float64)(unsafe.Pointer(&(_p.X0)))
*p = (*p) + Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
sink4 = *p
}
*(*uint8)(unsafe.Pointer(&(_p.X4))) = uint8(i32(1))
_7:
_3:
}
var _sumStepØ00__func__Ø000 [8]int8
func init() {
crt.Xstrncpy(nil, &_sumStepØ00__func__Ø000[0], str(131190), 8)
}
func _sumFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _p *XSumCtx
_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
if _p == nil || (_p.X2) <= int64(i32(0)) {
goto _1
}
if (_p.X3) != 0 {
Xsqlite3_result_error(tls, _context, str(130533), i32(-1))
goto _5
}
if (_p.X4) != 0 {
Xsqlite3_result_double(tls, _context, _p.X0)
goto _5
}
Xsqlite3_result_int64(tls, _context, _p.X1)
_5:
_1:
}
func _totalFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _p *XSumCtx
_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
Xsqlite3_result_double(tls, _context, func() float64 {
if _p != nil {
return (_p.X0)
}
return float64(0)
}())
}
func _avgFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _p *XSumCtx
_p = (*XSumCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
if (_p != nil) && ((_p.X2) > int64(i32(0))) {
Xsqlite3_result_double(tls, _context, (_p.X0)/float64(_p.X2))
}
}
// Routines to implement the count() aggregate function.
func _countStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _p *XCountCtx
_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, int32(u32(8))))
if ((_argc == i32(0)) || (i32(5) != Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))))) && (_p != nil) {
*(*int64)(unsafe.Pointer(&(_p.X0))) += 1
}
func() {
if _argc != i32(1) && _p != nil && (_p.X0) <= int64(i32(2147483647)) && (_p.X0) != int64(Xsqlite3_aggregate_count(tls, _context)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107085), unsafe.Pointer((*int8)(unsafe.Pointer(&_countStepØ00__func__Ø000))), unsafe.Pointer(str(131198)))
crt.X__builtin_abort(tls)
}
}()
}
var _countStepØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_countStepØ00__func__Ø000[0], str(131275), 10)
}
func _countFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _p *XCountCtx
_p = (*XCountCtx)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
Xsqlite3_result_int64(tls, _context, func() int64 {
if _p != nil {
return (_p.X0)
}
return int64(i32(0))
}())
}
// group_concat(EXPR, ?SEPARATOR?)
func _groupConcatStep(tls *crt.TLS, _context *Xsqlite3_context, _argc int32, _argv **XMem) {
var _nVal, _nSep, _1_firstTerm int32
var _zVal, _zSep *int8
var _1_db *Xsqlite3
var _pAccum *XStrAccum
func() {
if _argc != i32(1) && _argc != i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(107159), unsafe.Pointer((*int8)(unsafe.Pointer(&_groupConcatStepØ00__func__Ø000))), unsafe.Pointer(str(130558)))
crt.X__builtin_abort(tls)
}
}()
if Xsqlite3_value_type(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0))))) == i32(5) {
return
}
_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, int32(u32(28))))
if _pAccum == nil {
goto _4
}
_1_db = Xsqlite3_context_db_handle(tls, _context)
_1_firstTerm = bool2int((_pAccum.X5) == uint32(i32(0)))
*(*uint32)(unsafe.Pointer(&(_pAccum.X5))) = uint32(*(*int32)(unsafe.Pointer(uintptr((unsafe.Pointer)((*[12]int32)(unsafe.Pointer(&(_1_db.X31))))) + 4*uintptr(i32(0)))))
if _1_firstTerm != 0 {
goto _5
}
if _argc == i32(2) {
_zSep = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))))
_nSep = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(1)))))
goto _7
}
_zSep = str(107763)
_nSep = i32(1)
_7:
if _zSep != nil {
_sqlite3StrAccumAppend(tls, _pAccum, _zSep, _nSep)
}
_5:
_zVal = (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))))
_nVal = Xsqlite3_value_bytes(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_argv)) + 4*uintptr(i32(0)))))
if _zVal != nil {
_sqlite3StrAccumAppend(tls, _pAccum, _zVal, _nVal)
}
_4:
}
var _groupConcatStepØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_groupConcatStepØ00__func__Ø000[0], str(131285), 16)
}
func _groupConcatFinalize(tls *crt.TLS, _context *Xsqlite3_context) {
var _pAccum *XStrAccum
_pAccum = (*XStrAccum)(Xsqlite3_aggregate_context(tls, _context, i32(0)))
if _pAccum == nil {
goto _0
}
if int32(_pAccum.X6) == i32(2) {
Xsqlite3_result_error_toobig(tls, _context)
goto _4
}
if int32(_pAccum.X6) == i32(1) {
Xsqlite3_result_error_nomem(tls, _context)
goto _4
}
Xsqlite3_result_text(tls, _context, _sqlite3StrAccumFinish(tls, _pAccum), i32(-1), Xsqlite3_free)
_4:
_0:
}
// ************************************************** General Interfaces ******
//
// Initialize and shutdown the page cache subsystem. Neither of these
// functions are threadsafe.
func _sqlite3PcacheInitialize(tls *crt.TLS) (r0 int32) {
if *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer) int32
}{nil})) {
_sqlite3PCacheSetDefault(tls)
}
return ((*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X2)(tls, (*Xsqlite3_pcache_methods2)(unsafe.Pointer(&(_sqlite3Config.X12))).X1)
}
// 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 _sqlite3OsInit(tls *crt.TLS) (r0 int32) {
var _p unsafe.Pointer
_p = Xsqlite3_malloc(tls, i32(10))
if _p == nil {
return _sqlite3NomemError(tls, i32(20396))
}
Xsqlite3_free(tls, _p)
return Xsqlite3_os_init(tls)
}
// Initialize the operating system interface.
//
// This routine registers all VFS implementations for unix-like operating
// systems. This routine, and the sqlite3_os_end() routine that follows,
// should be the only routines in this file that are visible from other
// files.
//
// This routine is called once during SQLite initialization and by a
// single thread. The memory allocation and mutex subsystems have not
// necessarily been initialized when this routine is called, and so they
// should not be used.
func Xsqlite3_os_init(tls *crt.TLS) (r0 int32) {
var _i uint32
i32(0)
_i = uint32(i32(0))
_0:
if _i >= u32(4) {
goto _3
}
Xsqlite3_vfs_register(tls, (*Xsqlite3_vfs)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3_os_initØ00aVfsØ001))+88*uintptr(_i))), bool2int(_i == uint32(i32(0))))
_i += 1
goto _0
_3:
return i32(0)
}
var _sqlite3_os_initØ00aVfsØ001 [4]Xsqlite3_vfs
func init() {
_sqlite3_os_initØ00aVfsØ001 = [4]Xsqlite3_vfs{Xsqlite3_vfs{X0: i32(3), X1: i32(80), X2: i32(512), X3: nil, X4: str(131301), X5: unsafe.Pointer(&_posixIoFinder), X6: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
}{_unixOpen})), X7: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
}{_unixDelete})), X8: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
}{_unixAccess})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
}{_unixFullPathname})), X10: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
}{_unixDlOpen})), X11: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
}{_unixDlError})), X12: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
}{_unixDlSym})), X13: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
}{_unixDlClose})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixRandomness})), X15: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
}{_unixSleep})), X16: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
}{_unixCurrentTime})), X17: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixGetLastError})), X18: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
}{_unixCurrentTimeInt64})), X19: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
}{_unixSetSystemCall})), X20: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
}{_unixGetSystemCall})), X21: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
}{_unixNextSystemCall}))}, Xsqlite3_vfs{X0: i32(3), X1: i32(80), X2: i32(512), X3: nil, X4: str(131306), X5: unsafe.Pointer(&_nolockIoFinder), X6: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
}{_unixOpen})), X7: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
}{_unixDelete})), X8: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
}{_unixAccess})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
}{_unixFullPathname})), X10: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
}{_unixDlOpen})), X11: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
}{_unixDlError})), X12: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
}{_unixDlSym})), X13: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
}{_unixDlClose})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixRandomness})), X15: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
}{_unixSleep})), X16: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
}{_unixCurrentTime})), X17: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixGetLastError})), X18: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
}{_unixCurrentTimeInt64})), X19: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
}{_unixSetSystemCall})), X20: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
}{_unixGetSystemCall})), X21: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
}{_unixNextSystemCall}))}, Xsqlite3_vfs{X0: i32(3), X1: i32(80), X2: i32(512), X3: nil, X4: str(131316), X5: unsafe.Pointer(&_dotlockIoFinder), X6: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
}{_unixOpen})), X7: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
}{_unixDelete})), X8: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
}{_unixAccess})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
}{_unixFullPathname})), X10: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
}{_unixDlOpen})), X11: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
}{_unixDlError})), X12: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
}{_unixDlSym})), X13: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
}{_unixDlClose})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixRandomness})), X15: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
}{_unixSleep})), X16: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
}{_unixCurrentTime})), X17: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixGetLastError})), X18: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
}{_unixCurrentTimeInt64})), X19: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
}{_unixSetSystemCall})), X20: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
}{_unixGetSystemCall})), X21: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
}{_unixNextSystemCall}))}, Xsqlite3_vfs{X0: i32(3), X1: i32(80), X2: i32(512), X3: nil, X4: str(131329), X5: unsafe.Pointer(&_posixIoFinder), X6: *(*func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, *Xsqlite3_file, int32, *int32) int32
}{_unixOpen})), X7: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32) int32
}{_unixDelete})), X8: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int32) int32
}{_unixAccess})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, int32, *int8) int32
}{_unixFullPathname})), X10: *(*func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) unsafe.Pointer
}{_unixDlOpen})), X11: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8)
}{_unixDlError})), X12: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer, *int8) func(*crt.TLS)
}{_unixDlSym})), X13: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, unsafe.Pointer)
}{_unixDlClose})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixRandomness})), X15: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32) int32
}{_unixSleep})), X16: *(*func(*crt.TLS, unsafe.Pointer, *float64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *float64) int32
}{_unixCurrentTime})), X17: *(*func(*crt.TLS, unsafe.Pointer, int32, *int8) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, int32, *int8) int32
}{_unixGetLastError})), X18: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int64) int32
}{_unixCurrentTimeInt64})), X19: *(*func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8, func(*crt.TLS)) int32
}{_unixSetSystemCall})), X20: *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) func(*crt.TLS)
}{_unixGetSystemCall})), X21: *(*func(*crt.TLS, unsafe.Pointer, *int8) *int8)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_vfs, *int8) *int8
}{_unixNextSystemCall}))}}
}
var _posixIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
func init() {
_posixIoFinder = _posixIoFinderImpl
}
// Here are all of the sqlite3_io_methods objects for each of the
// locking strategies. Functions that return pointers to these methods
// are also created.
func _posixIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
return &_posixIoMethods
}
var _posixIoMethods Xsqlite3_io_methods
func init() {
_posixIoMethods = Xsqlite3_io_methods{X0: i32(3), X1: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixClose})), X2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixRead})), X3: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixWrite})), X4: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64) int32
}{_unixTruncate})), X5: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixSync})), X6: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int64) int32
}{_unixFileSize})), X7: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixLock})), X8: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixUnlock})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int32) int32
}{_unixCheckReservedLock})), X10: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
}{_unixFileControl})), X11: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixSectorSize})), X12: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixDeviceCharacteristics})), X13: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32, *unsafe.Pointer) int32
}{_unixShmMap})), X14: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
}{_unixShmLock})), X15: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file)
}{_unixShmBarrier})), X16: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixShmUnmap})), X17: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
}{_unixFetch})), X18: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
}{_unixUnfetch}))}
}
// Close a file.
func _unixClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
var _rc int32
var _pFile *XunixFile
_rc = i32(0)
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_verifyDbFile(tls, _pFile)
_unixUnlock(tls, _id, i32(0))
_unixEnterMutex(tls)
func() {
if ((*XunixInodeInfo)(_pFile.X2).X6) <= i32(0) && int32((*XunixInodeInfo)(_pFile.X2).X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31867), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixCloseØ00__func__Ø000))), unsafe.Pointer(str(131339)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if (*XunixInodeInfo)(_pFile.X2) != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31868), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixCloseØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() != 0 && ((*XunixInodeInfo)(_pFile.X2).X6) != 0 {
_setPendingFd(tls, _pFile)
}
_releaseInodeInfo(tls, _pFile)
_rc = _closeUnixFile(tls, _id)
_unixLeaveMutex(tls)
return _rc
}
// Check a unixFile that is a database. Verify the following:
//
// (1) There is exactly one hard link on the file
// (2) The file is not a symbolic link
// (3) The file has not been renamed or unlinked
//
// Issue sqlite3_log(SQLITE_WARNING,...) messages if anything is not right.
func _verifyDbFile(tls *crt.TLS, _pFile *XunixFile) {
var _rc int32
var _buf crt.Xstruct_stat64
if (int32(_pFile.X5) & i32(128)) != 0 {
return
}
_rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _pFile.X3, &_buf)
if _rc != i32(0) {
Xsqlite3_log(tls, i32(28), str(131396), unsafe.Pointer(_pFile.X9))
return
}
if (_buf.X4) == uint32(i32(0)) {
Xsqlite3_log(tls, i32(28), str(131420), unsafe.Pointer(_pFile.X9))
return
}
if (_buf.X4) > uint32(i32(1)) {
Xsqlite3_log(tls, i32(28), str(131449), unsafe.Pointer(_pFile.X9))
return
}
if _fileHasMoved(tls, _pFile) != 0 {
Xsqlite3_log(tls, i32(28), str(131476), unsafe.Pointer(_pFile.X9))
return
}
_ = _buf
}
var _aSyscall [28]Tunix_syscall
func init() {
_aSyscall = [28]Tunix_syscall{Tunix_syscall{X0: str(131504), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, int32, int32) int32
}{_posixOpen})), X2: nil}, Tunix_syscall{X0: str(131509), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, int32) int32 }{crt.Xclose})), X2: nil}, Tunix_syscall{X0: str(124450), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, int32) int32
}{crt.Xaccess})), X2: nil}, Tunix_syscall{X0: str(131515), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, uint32) *int8
}{crt.Xgetcwd})), X2: nil}, Tunix_syscall{X0: str(131522), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
}{crt.Xstat64})), X2: nil}, Tunix_syscall{X0: str(131527), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, *crt.Xstruct_stat64) int32
}{crt.Xfstat64})), X2: nil}, Tunix_syscall{X0: str(131533), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, int64) int32
}{crt.Xftruncate64})), X2: nil}, Tunix_syscall{X0: str(131543), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, int32, ...interface{}) int32
}{crt.Xfcntl})), X2: nil}, Tunix_syscall{X0: str(131549), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, unsafe.Pointer, uint32) int32
}{crt.Xread})), X2: nil}, Tunix_syscall{X0: str(131554), X1: nil, X2: nil}, Tunix_syscall{X0: str(131560), X1: nil, X2: nil}, Tunix_syscall{X0: str(131568), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, unsafe.Pointer, uint32) int32
}{crt.Xwrite})), X2: nil}, Tunix_syscall{X0: str(131574), X1: nil, X2: nil}, Tunix_syscall{X0: str(131581), X1: nil, X2: nil}, Tunix_syscall{X0: str(131590), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, uint32) int32
}{crt.Xfchmod})), X2: nil}, Tunix_syscall{X0: str(131597), X1: nil, X2: nil}, Tunix_syscall{X0: str(131607), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, *int8) int32 }{crt.Xunlink})), X2: nil}, Tunix_syscall{X0: str(131614), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, *int32) int32
}{_openDirectory})), X2: nil}, Tunix_syscall{X0: str(131628), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, uint32) int32
}{crt.Xmkdir})), X2: nil}, Tunix_syscall{X0: str(131634), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS, *int8) int32 }{crt.Xrmdir})), X2: nil}, Tunix_syscall{X0: str(131640), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, int32, uint32, uint32) int32
}{crt.Xfchown})), X2: nil}, Tunix_syscall{X0: str(131647), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS) uint32 }{crt.Xgeteuid})), X2: nil}, Tunix_syscall{X0: str(131655), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer
}{crt.Xmmap64})), X2: nil}, Tunix_syscall{X0: str(131660), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, uint32) int32
}{crt.Xmunmap})), X2: nil}, Tunix_syscall{X0: str(131667), X1: nil, X2: nil}, Tunix_syscall{X0: str(131674), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct{ f func(*crt.TLS) int32 }{_unixGetpagesize})), X2: nil}, Tunix_syscall{X0: str(131686), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, *int8, uint32) int32
}{crt.Xreadlink})), X2: nil}, Tunix_syscall{X0: str(131695), X1: *(*func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32
}{crt.Xlstat64})), X2: nil}}
}
// Different Unix systems declare open() in different ways. Same use
// open(const char*,int,mode_t). Others use open(const char*,int,...).
// The difference is important when using a pointer to the function.
//
// The safest way to deal with the problem is to always use this wrapper
// which always has the same well-defined interface.
func _posixOpen(tls *crt.TLS, _zFile *int8, _flags int32, _mode int32) (r0 int32) {
return crt.Xopen64(tls, _zFile, _flags, _mode)
}
// Open a file descriptor to the directory containing file zFilename.
// If successful, *pFd is set to the opened file descriptor and
// SQLITE_OK is returned. If an error occurs, either SQLITE_NOMEM
// or SQLITE_CANTOPEN is returned and *pFd is set to an undefined
// value.
//
// The directory file descriptor is used for only one thing - to
// fsync() a directory to make sure file creation and deletion events
// are flushed to disk. Such fsyncs are not needed on newer
// journaling filesystems, but are required on older filesystems.
//
// This routine can be overridden using the xSetSysCall interface.
// The ability to override this routine was added in support of the
// chromium sandbox. Opening a directory is a security risk (we are
// told) so making it overrideable allows the chromium sandbox to
// replace this routine with a harmless no-op. To make this routine
// a no-op, replace it with a stub that returns SQLITE_OK but leaves
// *pFd set to a negative number.
//
// If SQLITE_OK is returned, the caller is responsible for closing
// the file descriptor *pFd using close().
func _openDirectory(tls *crt.TLS, _zFilename *int8, _pFd *int32) (r0 int32) {
var _ii, _fd int32
var _zDirname [513]int8
_fd = i32(-1)
Xsqlite3_snprintf(tls, i32(512), (*int8)(unsafe.Pointer(&_zDirname)), str(24576), unsafe.Pointer(_zFilename))
_ii = int32(crt.Xstrlen(tls, (*int8)(unsafe.Pointer(&_zDirname))))
_0:
if _ii <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(_ii)))) == i32(47) {
goto _4
}
_ii -= 1
goto _0
_4:
if _ii > i32(0) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(_ii))) = int8(i32(0))
goto _6
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(0))))) != i32(47) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(0)))) = int8(i32(46))
}
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_zDirname)) + 1*uintptr(i32(1)))) = int8(i32(0))
_6:
_fd = _robust_open(tls, (*int8)(unsafe.Pointer(&_zDirname)), i32(0), uint32(i32(0)))
if _fd >= i32(0) {
}
*_pFd = _fd
if _fd >= i32(0) {
return i32(0)
}
return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(33419)), str(131614), (*int8)(unsafe.Pointer(&_zDirname)), i32(33419))
_ = _zDirname
panic(0)
}
// Invoke open(). Do so multiple times, until it either succeeds or
// fails for some reason other than EINTR.
//
// If the file creation mode "m" is 0 then set it to the default for
// SQLite. The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally
// 0644) as modified by the system umask. If m is not 0, then
// make the file creation mode be exactly m ignoring the umask.
//
// The m parameter will be non-zero only when creating -wal, -journal,
// and -shm files. We want those files to have *exactly* the same
// permissions as their original database, unadulterated by the umask.
// In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a
// transaction crashes and leaves behind hot journals, then any
// process that is able to write to the database will also be able to
// recover the hot journals.
func _robust_open(tls *crt.TLS, _z *int8, _f int32, _m uint32) (r0 int32) {
var _fd int32
var _m2 uint32
var _4_statbuf crt.Xstruct_stat64
_m2 = func() uint32 {
if _m != 0 {
return _m
}
return uint32(i32(420))
}()
_2:
_fd = (*(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(0)))).X1)})))(tls, _z, _f, int32(_m2))
if _fd >= i32(0) {
goto _4
}
if (*crt.X__errno_location(tls)) == i32(4) {
goto _2
}
goto _3
_4:
if _fd >= i32(3) {
goto _3
}
(*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(1)))).X1)})))(tls, _fd)
Xsqlite3_log(tls, i32(28), str(131701), unsafe.Pointer(_z), _fd)
_fd = i32(-1)
if (*(*func(*crt.TLS, *int8, int32, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(0)))).X1)})))(tls, str(131744), _f, int32(_m)) < i32(0) {
goto _3
}
goto _2
_3:
if _fd < i32(0) {
goto _8
}
if _m == uint32(i32(0)) {
goto _9
}
if (((*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _fd, &_4_statbuf) == i32(0)) && ((_4_statbuf.X9) == int64(i32(0)))) && (((_4_statbuf.X3) & uint32(i32(511))) != _m) {
(*(*func(*crt.TLS, int32, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(14)))).X1)})))(tls, _fd, _m)
}
_9:
(*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _fd, i32(2), (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _fd, i32(1), i32(0))|i32(1))
_8:
return _fd
_ = _4_statbuf
panic(0)
}
func _unixLogErrorAtLine(tls *crt.TLS, _errcode int32, _zFunc *int8, _zPath *int8, _iLine int32) (r0 int32) {
var _iErrno int32
var _zErr *int8
_iErrno = *crt.X__errno_location(tls)
_zErr = str(0)
if _zPath == nil {
_zPath = str(0)
}
Xsqlite3_log(tls, _errcode, str(131754), _iLine, _iErrno, unsafe.Pointer(_zFunc), unsafe.Pointer(_zPath), unsafe.Pointer(_zErr))
return _errcode
}
// Return the system page size.
//
// This function should not be called directly by other code in this file.
// Instead, it should be called via macro osGetpagesize().
func _unixGetpagesize(tls *crt.TLS) (r0 int32) {
return crt.Xsysconf(tls, i32(30))
}
// Return TRUE if pFile has been renamed or unlinked since it was first opened.
func _fileHasMoved(tls *crt.TLS, _pFile *XunixFile) (r0 int32) {
var _buf crt.Xstruct_stat64
return bool2int(((*XunixInodeInfo)(_pFile.X2) != nil) && (((*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(4)))).X1)})))(tls, _pFile.X9, &_buf) != i32(0)) || ((_buf.X18) != ((*TunixFileId)(unsafe.Pointer(&((*XunixInodeInfo)(_pFile.X2).X0))).X1))))
_ = _buf
panic(0)
}
// Lower the locking level on file descriptor pFile to eFileLock. eFileLock
// must be either NO_LOCK or SHARED_LOCK.
//
// If the locking level of the file descriptor is already at or below
// the requested locking level, this routine is a no-op.
func _unixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
func() {
if _eFileLock != i32(1) && ((*XunixFile)(unsafe.Pointer(_id)).X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31802), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131785)))
crt.X__builtin_abort(tls)
}
}()
return _posixUnlock(tls, _id, _eFileLock, i32(0))
}
var _unixUnlockØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_unixUnlockØ00__func__Ø000[0], str(131842), 11)
}
// Lower the locking level on file descriptor pFile to eFileLock. eFileLock
// must be either NO_LOCK or SHARED_LOCK.
//
// If the locking level of the file descriptor is already at or below
// the requested locking level, this routine is a no-op.
//
// If handleNFSUnlock is true, then on downgrading an EXCLUSIVE_LOCK to SHARED
// the byte range is divided into 2 parts and the first part is unlocked then
// set to a read lock, then the other part is simply unlocked. This works
// around a bug in BSD NFS lockd (also seen on MacOSX 10.3+) that fails to
// remove the write lock on a region when a read lock is set.
func _posixUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32, _handleNFSUnlock int32) (r0 int32) {
var _rc int32
var _pInode *XunixInodeInfo
var _pFile *XunixFile
var _lock Tflock
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_rc = i32(0)
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31646), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eFileLock > i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31651), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131853)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pFile.X4) <= _eFileLock {
return i32(0)
}
_unixEnterMutex(tls)
_pInode = (*XunixInodeInfo)(_pFile.X2)
func() {
if (_pInode.X1) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31657), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131876)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pFile.X4) <= i32(1) {
goto _7
}
func() {
if int32(_pInode.X2) != int32(_pFile.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31659), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131895)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pFile.X19))) = uint8(i32(0))
if _eFileLock != i32(1) {
goto _10
}
func() {
if _handleNFSUnlock != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31685), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131931)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(0))
*(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2))
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510))
if _unixFileLock(tls, _pFile, &_lock) != 0 {
_rc = i32(2314)
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
goto _end_unlock
}
_10:
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2))
*(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte)
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(2))
func() {
if (_sqlite3PendingByte + i32(1)) != (_sqlite3PendingByte + i32(1)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31747), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131950)))
crt.X__builtin_abort(tls)
}
}()
if _unixFileLock(tls, _pFile, &_lock) == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(1))
goto _17
}
_rc = i32(2058)
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
goto _end_unlock
_17:
_7:
if _eFileLock != i32(0) {
goto _end_unlock
}
*(*int32)(unsafe.Pointer(&(_pInode.X1))) -= 1
if (_pInode.X1) != i32(0) {
goto _19
}
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2))
*(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_lock.X2))) = store6((*int64)(unsafe.Pointer(&(_lock.X3))), int64(i32(0)))
if _unixFileLock(tls, _pFile, &_lock) == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(0))
goto _21
}
_rc = i32(2058)
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
*(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(0))
_21:
_19:
*(*int32)(unsafe.Pointer(&(_pInode.X6))) -= 1
func() {
if (_pInode.X6) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31781), unsafe.Pointer((*int8)(unsafe.Pointer(&_posixUnlockØ00__func__Ø000))), unsafe.Pointer(str(131980)))
crt.X__builtin_abort(tls)
}
}()
if (_pInode.X6) == i32(0) {
_closePendingFds(tls, _pFile)
}
_end_unlock:
_unixLeaveMutex(tls)
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock)
}
return _rc
_ = _lock
panic(0)
}
var _posixUnlockØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_posixUnlockØ00__func__Ø000[0], str(131997), 12)
}
// Helper functions to obtain and relinquish the global mutex. The
// global mutex is used to protect the unixInodeInfo and
// vxworksFileId objects used by this file, all of which may be
// shared by multiple threads.
//
// Function unixMutexHeld() is used to assert() that the global mutex
// is held when required. This function is only used as part of assert()
// statements. e.g.
//
// unixEnterMutex()
// assert( unixMutexHeld() );
// unixEnterLeave()
func _unixEnterMutex(tls *crt.TLS) {
Xsqlite3_mutex_enter(tls, _sqlite3MutexAlloc(tls, i32(11)))
}
// Attempt to set a system-lock on the file pFile. The lock is
// described by pLock.
//
// If the pFile was opened read/write from unix-excl, then the only lock
// ever obtained is an exclusive lock, and it is obtained exactly once
// the first time any lock is attempted. All subsequent system locking
// operations become no-ops. Locking operations still happen internally,
// in order to coordinate access between separate database connections
// within this process, but all of that is handled in memory and the
// operating system does not participate.
//
// This function is a pass-through to fcntl(F_SETLK) if pFile is using
// any VFS other than "unix-excl" or if pFile is opened on "unix-excl"
// and is read-only.
//
// Zero is returned if the call completes successfully, or -1 if a call
// to fcntl() fails. In this case, errno is set appropriately (by fcntl()).
func _unixFileLock(tls *crt.TLS, _pFile *XunixFile, _pLock *Tflock) (r0 int32) {
var _rc int32
var _pInode *XunixInodeInfo
var _2_lock Tflock
_pInode = (*XunixInodeInfo)(_pFile.X2)
func() {
if _unixMutexHeld(tls) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31344), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFileLockØ00__func__Ø000))), unsafe.Pointer(str(132009)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pInode == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31345), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFileLockØ00__func__Ø000))), unsafe.Pointer(str(132025)))
crt.X__builtin_abort(tls)
}
}()
if (int32(_pFile.X5) & i32(3)) != i32(1) {
goto _4
}
if int32(_pInode.X3) != i32(0) {
goto _5
}
func() {
if (_pInode.X6) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31349), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFileLockØ00__func__Ø000))), unsafe.Pointer(str(132035)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_2_lock.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_2_lock.X2))) = int64(_sqlite3PendingByte + i32(2))
*(*int64)(unsafe.Pointer(&(_2_lock.X3))) = int64(i32(510))
*(*int16)(unsafe.Pointer(&(_2_lock.X0))) = int16(i32(1))
_rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(13), unsafe.Pointer(&_2_lock))
if _rc < i32(0) {
return _rc
}
*(*uint8)(unsafe.Pointer(&(_pInode.X3))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1
goto _9
_5:
_rc = i32(0)
_9:
goto _10
_4:
_rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(13), unsafe.Pointer(_pLock))
_10:
return _rc
_ = _2_lock
panic(0)
}
func _unixMutexHeld(tls *crt.TLS) (r0 int32) {
return Xsqlite3_mutex_held(tls, _sqlite3MutexAlloc(tls, i32(11)))
}
var _unixFileLockØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_unixFileLockØ00__func__Ø000[0], str(132052), 13)
}
// Set the pFile->lastErrno. Do this in a subroutine as that provides
// a convenient place to set a breakpoint.
func _storeLastErrno(tls *crt.TLS, _pFile *XunixFile, _error int32) {
*(*int32)(unsafe.Pointer(&(_pFile.X6))) = _error
}
func _closePendingFds(tls *crt.TLS, _pFile *XunixFile) {
var _pInode *XunixInodeInfo
var _p, _pNext *XUnixUnusedFd
_pInode = (*XunixInodeInfo)(_pFile.X2)
_p = (*XUnixUnusedFd)(_pInode.X7)
_0:
if _p == nil {
goto _3
}
_pNext = (*XUnixUnusedFd)(_p.X2)
_robust_close(tls, _pFile, _p.X0, i32(31098))
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
_p = _pNext
goto _0
_3:
*(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X7))))) = nil
}
// Close a file descriptor.
//
// We assume that close() almost always works, since it is only in a
// very sick application or on a very sick platform that it might fail.
// If it does fail, simply leak the file descriptor, but do log the
// error.
//
// Note that it is not safe to retry close() after EINTR since the
// file descriptor might have already been reused by another thread.
// So we don't even try to recover from an EINTR. Just log the error
// and move on.
func _robust_close(tls *crt.TLS, _pFile *XunixFile, _h int32, _lineno int32) {
if (*(*func(*crt.TLS, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(1)))).X1)})))(tls, _h) != 0 {
_unixLogErrorAtLine(tls, i32(4106), str(131509), func() *int8 {
if _pFile != nil {
return (_pFile.X9)
}
return nil
}(), _lineno)
}
}
func _unixLeaveMutex(tls *crt.TLS) {
Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, i32(11)))
}
var _unixCloseØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_unixCloseØ00__func__Ø000[0], str(132065), 10)
}
// Add the file descriptor used by file handle pFile to the corresponding
// pUnused list.
func _setPendingFd(tls *crt.TLS, _pFile *XunixFile) {
var _pInode *XunixInodeInfo
var _p *XUnixUnusedFd
_pInode = (*XunixInodeInfo)(_pFile.X2)
_p = (*XUnixUnusedFd)(_pFile.X8)
*(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X2))))) = (*XUnixUnusedFd)(_pInode.X7)
*(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X7))))) = _p
*(*int32)(unsafe.Pointer(&(_pFile.X3))) = i32(-1)
*(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pFile.X8))))) = nil
}
// Release a unixInodeInfo structure previously allocated by findInodeInfo().
//
// The mutex entered using the unixEnterMutex() function must be held
// when this function is called.
func _releaseInodeInfo(tls *crt.TLS, _pFile *XunixFile) {
var _pInode *XunixInodeInfo
_pInode = (*XunixInodeInfo)(_pFile.X2)
func() {
if _unixMutexHeld(tls) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31112), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132009)))
crt.X__builtin_abort(tls)
}
}()
if func() int32 {
if _pInode != nil {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31113), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _4
}
*(*int32)(unsafe.Pointer(&(_pInode.X4))) -= 1
if (_pInode.X4) != i32(0) {
goto _5
}
func() {
if (*XunixShmNode)(_pInode.X5) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31116), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132075)))
crt.X__builtin_abort(tls)
}
}()
_closePendingFds(tls, _pFile)
if (*XunixInodeInfo)(_pInode.X9) != nil {
func() {
if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.X9).X8) != _pInode {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31119), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132095)))
crt.X__builtin_abort(tls)
}
}()
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.X9).X8))))) = (*XunixInodeInfo)(_pInode.X8)
goto _11
}
func() {
if _inodeList != _pInode {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31122), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132124)))
crt.X__builtin_abort(tls)
}
}()
_inodeList = (*XunixInodeInfo)(_pInode.X8)
bug20530(_inodeList)
_11:
if (*XunixInodeInfo)(_pInode.X8) != nil {
func() {
if (*XunixInodeInfo)((*XunixInodeInfo)(_pInode.X8).X9) != _pInode {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31126), unsafe.Pointer((*int8)(unsafe.Pointer(&_releaseInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132142)))
crt.X__builtin_abort(tls)
}
}()
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_pInode.X8).X9))))) = (*XunixInodeInfo)(_pInode.X9)
}
Xsqlite3_free(tls, (unsafe.Pointer)(_pInode))
_5:
_4:
}
var _releaseInodeInfoØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_releaseInodeInfoØ00__func__Ø000[0], str(132171), 17)
}
var _inodeList *XunixInodeInfo
// This function performs the parts of the "close file" operation
// common to all locking schemes. It closes the directory and file
// handles, if they are valid, and sets all fields of the unixFile
// structure to 0.
//
// It is *not* necessary to hold the mutex when this routine is called,
// even on VxWorks. A mutex will be acquired on VxWorks by the
// vxworksReleaseFileId() routine.
func _closeUnixFile(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_unixUnmapfile(tls, _pFile)
if (_pFile.X3) >= i32(0) {
_robust_close(tls, _pFile, _pFile.X3, i32(31828))
*(*int32)(unsafe.Pointer(&(_pFile.X3))) = i32(-1)
}
Xsqlite3_free(tls, _pFile.X8)
crt.Xmemset(tls, (unsafe.Pointer)(_pFile), i32(0), u32(80))
return i32(0)
}
// If it is currently memory mapped, unmap file pFd.
func _unixUnmapfile(tls *crt.TLS, _pFd *XunixFile) {
func() {
if (_pFd.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34596), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnmapfileØ00__func__Ø000))), unsafe.Pointer(str(132188)))
crt.X__builtin_abort(tls)
}
}()
if (_pFd.X16) != nil {
(*(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(23)))).X1)})))(tls, _pFd.X16, uint32(_pFd.X14))
*(*unsafe.Pointer)(unsafe.Pointer(&(_pFd.X16))) = nil
*(*int64)(unsafe.Pointer(&(_pFd.X13))) = int64(i32(0))
*(*int64)(unsafe.Pointer(&(_pFd.X14))) = int64(i32(0))
}
}
var _unixUnmapfileØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_unixUnmapfileØ00__func__Ø000[0], str(132206), 14)
}
// Read data from a file into a buffer. Return SQLITE_OK if all
// bytes were read successfully and SQLITE_IOERR if anything goes
// wrong.
func _unixRead(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
var _got, _3_nCopy int32
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
func() {
if _id == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33063), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixReadØ00__func__Ø000))), unsafe.Pointer(str(61727)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _offset < int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33064), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixReadØ00__func__Ø000))), unsafe.Pointer(str(132220)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _amt <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33065), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixReadØ00__func__Ø000))), unsafe.Pointer(str(132230)))
crt.X__builtin_abort(tls)
}
}()
if _offset >= (_pFile.X13) {
goto _6
}
if (_offset + int64(_amt)) <= (_pFile.X13) {
crt.Xmemcpy(tls, _pBuf, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint32(_amt))
return i32(0)
}
_3_nCopy = int32((_pFile.X13) - _offset)
crt.Xmemcpy(tls, _pBuf, (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFile.X16)+1*uintptr(_offset)))), uint32(_3_nCopy))
_pBuf = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_3_nCopy))))
{
p := &_amt
*p = (*p) - _3_nCopy
sink1 = *p
}
{
p := &_offset
*p = (*p) + int64(_3_nCopy)
sink6 = *p
}
_6:
_got = _seekAndRead(tls, _pFile, _offset, _pBuf, _amt)
if _got == _amt {
return i32(0)
}
if _got < i32(0) {
return i32(266)
}
_storeLastErrno(tls, _pFile, i32(0))
crt.Xmemset(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(_got)))), i32(0), uint32(_amt-_got))
return i32(522)
}
var _unixReadØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_unixReadØ00__func__Ø000[0], str(132236), 9)
}
// Seek to the offset passed as the second argument, then read cnt
// bytes into pBuf. Return the number of bytes actually read.
//
// NB: If you define USE_PREAD or USE_PREAD64, then it might also
// be necessary to define _XOPEN_SOURCE to be 500. This varies from
// one system to another. Since SQLite does not define USE_PREAD
// in any form by default, we will not attempt to define _XOPEN_SOURCE.
// See tickets #2741 and #2681.
//
// To avoid stomping the errno value on a failed read the lastErrno value
// is set before returning.
func _seekAndRead(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
var _got, _prior int32
var _newOffset int64
_prior = i32(0)
func() {
if _cnt != (_cnt & i32(131071)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33013), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndReadØ00__func__Ø000))), unsafe.Pointer(str(132245)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_id.X3) <= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33014), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndReadØ00__func__Ø000))), unsafe.Pointer(str(132264)))
crt.X__builtin_abort(tls)
}
}()
_4:
_newOffset = crt.Xlseek64(tls, _id.X3, _offset, i32(0))
if _newOffset < int64(i32(0)) {
_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
return i32(-1)
}
_got = (*(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(8)))).X1)})))(tls, _id.X3, _pBuf, uint32(_cnt))
if _got == _cnt {
goto _7
}
if _got >= i32(0) {
goto _8
}
if (*crt.X__errno_location(tls)) == i32(4) {
_got = i32(1)
goto _4
}
_prior = i32(0)
_storeLastErrno(tls, _id, *crt.X__errno_location(tls))
goto _7
_8:
if _got > i32(0) {
{
p := &_cnt
*p = (*p) - _got
sink1 = *p
}
{
p := &_offset
*p = (*p) + int64(_got)
sink6 = *p
}
{
p := &_prior
*p = (*p) + _got
sink1 = *p
}
_pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(unsafe.Pointer((*int8)(unsafe.Pointer(uintptr(_got))))) + uintptr(unsafe.Pointer((*int8)(_pBuf))))))
}
if _got > i32(0) {
goto _4
}
_7:
return _got + _prior
}
var _seekAndReadØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_seekAndReadØ00__func__Ø000[0], str(132272), 12)
}
// Write data from a buffer into a file. Return SQLITE_OK on success
// or some other error code on failure.
func _unixWrite(tls *crt.TLS, _id *Xsqlite3_file, _pBuf unsafe.Pointer, _amt int32, _offset int64) (r0 int32) {
var _wrote, _2_rc int32
var _2_oldCntr [4]int8
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_wrote = i32(0)
func() {
if _id == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33177), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixWriteØ00__func__Ø000))), unsafe.Pointer(str(61727)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _amt <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33178), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixWriteØ00__func__Ø000))), unsafe.Pointer(str(132230)))
crt.X__builtin_abort(tls)
}
}()
if (_pFile.X19) == 0 {
goto _4
}
*(*uint8)(unsafe.Pointer(&(_pFile.X18))) = uint8(i32(1))
if _offset > int64(i32(24)) || (_offset+int64(_amt)) < int64(i32(27)) {
goto _6
}
_2_rc = _seekAndRead(tls, _pFile, int64(i32(24)), (unsafe.Pointer)(&_2_oldCntr), i32(4))
if (_2_rc != i32(4)) || (crt.Xmemcmp(tls, (unsafe.Pointer)(&_2_oldCntr), (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf)+1*uintptr(int64(i32(24))-_offset)))), uint32(i32(4))) != i32(0)) {
*(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(1))
}
_6:
_4:
if (store1(&_wrote, _seekAndWrite(tls, _pFile, _offset, _pBuf, _amt)) < _amt) && (_wrote > i32(0)) {
{
p := &_amt
*p = (*p) - _wrote
sink1 = *p
}
{
p := &_offset
*p = (*p) + int64(_wrote)
sink6 = *p
}
_pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_wrote))))
goto _4
}
if _amt <= _wrote {
goto _12
}
if (_wrote < i32(0)) && ((_pFile.X6) != i32(28)) {
return i32(778)
}
_storeLastErrno(tls, _pFile, i32(0))
return i32(13)
_12:
return i32(0)
_ = _2_oldCntr
panic(0)
}
var _unixWriteØ00__func__Ø000 [10]int8
func init() {
crt.Xstrncpy(nil, &_unixWriteØ00__func__Ø000[0], str(132284), 10)
}
// Seek to the offset in id->offset then read cnt bytes into pBuf.
// Return the number of bytes actually read. Update the offset.
//
// To avoid stomping the errno value on a failed write the lastErrno value
// is set before returning.
func _seekAndWrite(tls *crt.TLS, _id *XunixFile, _offset int64, _pBuf unsafe.Pointer, _cnt int32) (r0 int32) {
return _seekAndWriteFd(tls, _id.X3, _offset, _pBuf, _cnt, (*int32)(unsafe.Pointer(&(_id.X6))))
}
// Attempt to seek the file-descriptor passed as the first argument to
// absolute offset iOff, then attempt to write nBuf bytes of data from
// pBuf to it. If an error occurs, return -1 and set *piErrno. Otherwise,
// return the actual number of bytes written (which may be less than
// nBuf).
func _seekAndWriteFd(tls *crt.TLS, _fd int32, _iOff int64, _pBuf unsafe.Pointer, _nBuf int32, _piErrno *int32) (r0 int32) {
var _rc int32
var _1_iSeek int64
_rc = i32(0)
func() {
if _nBuf != (_nBuf & i32(131071)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33123), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000))), unsafe.Pointer(str(132294)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _fd <= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33124), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000))), unsafe.Pointer(str(132315)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _piErrno == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33125), unsafe.Pointer((*int8)(unsafe.Pointer(&_seekAndWriteFdØ00__func__Ø000))), unsafe.Pointer(str(132320)))
crt.X__builtin_abort(tls)
}
}()
{
p := &_nBuf
*p = (*p) & i32(131071)
sink1 = *p
}
_6:
_1_iSeek = crt.Xlseek64(tls, _fd, _iOff, i32(0))
if _1_iSeek < int64(i32(0)) {
_rc = i32(-1)
goto _8
}
_rc = (*(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(11)))).X1)})))(tls, _fd, _pBuf, uint32(_nBuf))
if (_rc < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) {
goto _6
}
_8:
if _rc < i32(0) {
*_piErrno = *crt.X__errno_location(tls)
}
return _rc
}
var _seekAndWriteFdØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_seekAndWriteFdØ00__func__Ø000[0], str(132331), 15)
}
// Truncate an open file to a specified size
func _unixTruncate(tls *crt.TLS, _id *Xsqlite3_file, _nByte int64) (r0 int32) {
var _rc int32
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33490), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixTruncateØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
if (_pFile.X11) > i32(0) {
_nByte = (((_nByte + int64(_pFile.X11)) - int64(i32(1))) / int64(_pFile.X11)) * int64(_pFile.X11)
}
_rc = _robust_ftruncate(tls, _pFile.X3, _nByte)
if _rc != 0 {
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
return _unixLogErrorAtLine(tls, i32(1546), str(131533), _pFile.X9, i32(33505))
}
if ((_pFile.X19) != 0) && (_nByte == int64(i32(0))) {
*(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(1))
}
if _nByte < (_pFile.X13) {
*(*int64)(unsafe.Pointer(&(_pFile.X13))) = _nByte
}
return i32(0)
}
var _unixTruncateØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_unixTruncateØ00__func__Ø000[0], str(132346), 13)
}
// Retry ftruncate() calls that fail due to EINTR
//
// All calls to ftruncate() within this file should be made through
// this wrapper. On the Android platform, bypassing the logic below
// could lead to a corrupt database.
func _robust_ftruncate(tls *crt.TLS, _h int32, _sz int64) (r0 int32) {
var _rc int32
_0:
_rc = (*(*func(*crt.TLS, int32, int64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(6)))).X1)})))(tls, _h, _sz)
if (_rc < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) {
goto _0
}
return _rc
}
// Make sure all writes to a particular file are committed to disk.
//
// If dataOnly==0 then both the file itself and its metadata (file
// size, access time, etc) are synced. If dataOnly!=0 then only the
// file data is synced.
//
// Under Unix, also make sure that the directory entry for the file
// has been created by fsync-ing the directory that contains the file.
// If we do not do this and we encounter a power failure, the directory
// entry for the journal might not exist after we reboot. The next
// SQLite to access the file will not know that the journal exists (because
// the directory entry for the journal was never created) and the transaction
// will not roll back - possibly leading to database corruption.
func _unixSync(tls *crt.TLS, _id *Xsqlite3_file, _flags int32) (r0 int32) {
var _rc, _isDataOnly, _isFullsync, _2_dirfd int32
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_isDataOnly = _flags & i32(16)
_isFullsync = bool2int((_flags & i32(15)) == i32(3))
func() {
if (_flags&i32(15)) != i32(2) && (_flags&i32(15)) != i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33445), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixSyncØ00__func__Ø000))), unsafe.Pointer(str(132359)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33454), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixSyncØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
_rc = _full_fsync(tls, _pFile.X3, _isFullsync, _isDataOnly)
if _rc != 0 {
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
return _unixLogErrorAtLine(tls, i32(1034), str(132426), _pFile.X9, i32(33460))
}
if (int32(_pFile.X5) & i32(8)) == 0 {
goto _6
}
_rc = (*(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(17)))).X1)})))(tls, _pFile.X9, &_2_dirfd)
if _rc == i32(0) {
_full_fsync(tls, _2_dirfd, i32(0), i32(0))
_robust_close(tls, _pFile, _2_dirfd, i32(33474))
goto _8
}
func() {
if _rc != i32(14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33476), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixSyncØ00__func__Ø000))), unsafe.Pointer(str(132437)))
crt.X__builtin_abort(tls)
}
}()
_rc = i32(0)
_8:
{
p := (*uint16)(unsafe.Pointer(&(_pFile.X5)))
*p = uint16(int32(*p) & i32(-9))
sink14 = *p
}
_6:
return _rc
}
var _unixSyncØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_unixSyncØ00__func__Ø000[0], str(132457), 9)
}
// The fsync() system call does not work as advertised on many
// unix systems. The following procedure is an attempt to make
// it work better.
//
// The SQLITE_NO_SYNC macro disables all fsync()s. This is useful
// for testing when we want to run through the test suite quickly.
// You are strongly advised *not* to deploy with SQLITE_NO_SYNC
// enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash
// or power failure will likely corrupt the database file.
//
// SQLite sets the dataOnly flag if the size of the file is unchanged.
// The idea behind dataOnly is that it should only write the file content
// to disk, not the inode. We only set dataOnly if the file size is
// unchanged since the file size is part of the inode. However,
// Ted Ts'o tells us that fdatasync() will also write the inode if the
// file size has changed. The only real difference between fdatasync()
// and fsync(), Ted tells us, is that fdatasync() will not flush the
// inode if the mtime or owner or other inode attributes have changed.
// We only care about the file size, not the other file attributes, so
// as far as SQLite is concerned, an fdatasync() is always adequate.
// So, we always use fdatasync() if it is available, regardless of
// the value of the dataOnly flag.
func _full_fsync(tls *crt.TLS, _fd int32, _fullSync int32, _dataOnly int32) (r0 int32) {
var _rc int32
_rc = crt.Xfsync(tls, _fd)
goto _0
_0:
return _rc
}
// Determine the current size of a file in bytes
func _unixFileSize(tls *crt.TLS, _id *Xsqlite3_file, _pSize *int64) (r0 int32) {
var _rc int32
var _buf crt.Xstruct_stat64
func() {
if _id == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33540), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFileSizeØ00__func__Ø000))), unsafe.Pointer(str(61727)))
crt.X__builtin_abort(tls)
}
}()
_rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, (*XunixFile)(unsafe.Pointer(_id)).X3, &_buf)
if _rc != i32(0) {
_storeLastErrno(tls, (*XunixFile)(unsafe.Pointer(_id)), *crt.X__errno_location(tls))
return i32(1802)
}
*_pSize = _buf.X9
if (*_pSize) == int64(i32(1)) {
*_pSize = int64(i32(0))
}
return i32(0)
_ = _buf
panic(0)
}
var _unixFileSizeØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_unixFileSizeØ00__func__Ø000[0], str(132466), 13)
}
// Lock the file with the lock specified by parameter eFileLock - one
// of the following:
//
// (1) SHARED_LOCK
// (2) RESERVED_LOCK
// (3) PENDING_LOCK
// (4) EXCLUSIVE_LOCK
//
// Sometimes when requesting one lock state, additional lock states
// are inserted in between. The locking might fail on one of the later
// transitions leaving the lock state different from what it started but
// still short of its goal. The following chart shows the allowed
// transitions and the inserted intermediate states:
//
// UNLOCKED -> SHARED
// SHARED -> RESERVED
// SHARED -> (PENDING) -> EXCLUSIVE
// RESERVED -> (PENDING) -> EXCLUSIVE
// PENDING -> EXCLUSIVE
//
// This routine will only increase a lock. Use the sqlite3OsUnlock()
// routine to lower a locking level.
func _unixLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
var _rc, _tErrno int32
var _pInode *XunixInodeInfo
var _pFile *XunixFile
var _lock Tflock
_rc = i32(0)
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_tErrno = i32(0)
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31437), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pFile.X4) >= _eFileLock {
return i32(0)
}
func() {
if int32(_pFile.X4) == i32(0) && _eFileLock != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31458), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132479)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eFileLock == i32(3) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31459), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132531)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eFileLock == i32(2) && int32(_pFile.X4) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31460), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132555)))
crt.X__builtin_abort(tls)
}
}()
_unixEnterMutex(tls)
_pInode = (*XunixInodeInfo)(_pFile.X2)
if (int32(_pFile.X4) != int32(_pInode.X2)) && ((int32(_pInode.X2) >= i32(3)) || (_eFileLock > i32(1))) {
_rc = i32(5)
goto _end_lock
}
if (_eFileLock == i32(1)) && ((int32(_pInode.X2) == i32(1)) || (int32(_pInode.X2) == i32(2))) {
func() {
if _eFileLock != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31483), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132613)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pFile.X4) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31484), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132636)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pInode.X1) <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31485), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132656)))
crt.X__builtin_abort(tls)
}
}()
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_pInode.X1))) += 1
*(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1
goto _end_lock
}
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(1))
*(*int16)(unsafe.Pointer(&(_lock.X1))) = int16(i32(0))
if _eFileLock != i32(1) && (_eFileLock != i32(4) || int32(_pFile.X4) >= i32(3)) {
goto _25
}
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(func() int32 {
if _eFileLock == i32(1) {
return i32(0)
}
return i32(1)
}())
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte)
if _unixFileLock(tls, _pFile, &_lock) == 0 {
goto _28
}
_tErrno = *crt.X__errno_location(tls)
_rc = _sqliteErrorFromPosixError(tls, _tErrno, i32(3850))
if _rc != i32(5) {
_storeLastErrno(tls, _pFile, _tErrno)
}
goto _end_lock
_28:
_25:
if _eFileLock != i32(1) {
goto _30
}
func() {
if (_pInode.X1) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31519), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132674)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pInode.X2) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31520), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132693)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _rc != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31521), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(15012)))
crt.X__builtin_abort(tls)
}
}()
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2))
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510))
if _unixFileLock(tls, _pFile, &_lock) != 0 {
_tErrno = *crt.X__errno_location(tls)
_rc = _sqliteErrorFromPosixError(tls, _tErrno, i32(3850))
}
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte)
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(1))
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(2))
if _unixFileLock(tls, _pFile, &_lock) != 0 && (_rc == i32(0)) {
_tErrno = *crt.X__errno_location(tls)
_rc = i32(2058)
}
if _rc == 0 {
goto _40
}
if _rc != i32(5) {
_storeLastErrno(tls, _pFile, _tErrno)
}
goto _end_lock
_40:
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1))
*(*int32)(unsafe.Pointer(&(_pInode.X6))) += 1
*(*int32)(unsafe.Pointer(&(_pInode.X1))) = i32(1)
goto _46
_30:
if (_eFileLock == i32(4)) && ((_pInode.X1) > i32(1)) {
_rc = i32(5)
goto _46
}
func() {
if i32(0) == int32(_pFile.X4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31560), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132714)))
crt.X__builtin_abort(tls)
}
}()
*(*int16)(unsafe.Pointer(&(_lock.X0))) = int16(i32(1))
func() {
if _eFileLock != i32(2) && _eFileLock != i32(4) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31563), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixLockØ00__func__Ø000))), unsafe.Pointer(str(132734)))
crt.X__builtin_abort(tls)
}
}()
if _eFileLock == i32(2) {
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(1))
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(1))
goto _53
}
*(*int64)(unsafe.Pointer(&(_lock.X2))) = int64(_sqlite3PendingByte + i32(2))
*(*int64)(unsafe.Pointer(&(_lock.X3))) = int64(i32(510))
_53:
if _unixFileLock(tls, _pFile, &_lock) == 0 {
goto _54
}
_tErrno = *crt.X__errno_location(tls)
_rc = _sqliteErrorFromPosixError(tls, _tErrno, i32(3850))
if _rc != i32(5) {
_storeLastErrno(tls, _pFile, _tErrno)
}
_54:
_46:
if ((_rc == i32(0)) && (int32(_pFile.X4) <= i32(1))) && (_eFileLock == i32(2)) {
*(*uint8)(unsafe.Pointer(&(_pFile.X17))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pFile.X18))) = uint8(i32(0))
*(*uint8)(unsafe.Pointer(&(_pFile.X19))) = uint8(i32(1))
}
if _rc == i32(0) {
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock)
*(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(_eFileLock)
goto _end_lock
}
if _eFileLock == i32(4) {
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(3))
*(*uint8)(unsafe.Pointer(&(_pInode.X2))) = uint8(i32(3))
}
_end_lock:
_unixLeaveMutex(tls)
return _rc
_ = _lock
panic(0)
}
var _unixLockØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_unixLockØ00__func__Ø000[0], str(132788), 9)
}
// This routine translates a standard POSIX errno code into something
// useful to the clients of the sqlite3 functions. Specifically, it is
// intended to translate a variety of "try again" errors into SQLITE_BUSY
// and a variety of "please close the file descriptor NOW" errors into
// SQLITE_IOERR
//
// Errors during initialization of locks, or file system support for locks,
// should handle ENOLCK, ENOTSUP, EOPNOTSUPP separately.
func _sqliteErrorFromPosixError(tls *crt.TLS, _posixError int32, _sqliteIOErr int32) (r0 int32) {
func() {
if _sqliteIOErr != i32(3850) && _sqliteIOErr != i32(2058) && _sqliteIOErr != i32(2314) && _sqliteIOErr != i32(3594) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(30686), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqliteErrorFromPosixErrorØ00__func__Ø000))), unsafe.Pointer(str(132797)))
crt.X__builtin_abort(tls)
}
}()
switch _posixError {
case i32(1):
goto _12
case i32(4):
goto _6
case i32(11):
goto _6
case i32(13):
goto _6
case i32(16):
goto _6
case i32(37):
goto _6
case i32(110):
goto _6
default:
goto _13
}
_6:
return i32(5)
_12:
return i32(3)
_13:
return _sqliteIOErr
}
var _sqliteErrorFromPosixErrorØ00__func__Ø000 [26]int8
func init() {
crt.Xstrncpy(nil, &_sqliteErrorFromPosixErrorØ00__func__Ø000[0], str(132963), 26)
}
// This routine checks if there is a RESERVED lock held on the specified
// file by this or any other process. If such a lock is held, set *pResOut
// to a non-zero value otherwise *pResOut is set to zero. The return value
// is set to SQLITE_OK unless an I/O error occurs during lock checking.
func _unixCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
var _rc, _reserved int32
var _pFile *XunixFile
var _2_lock Tflock
_rc = i32(0)
_reserved = i32(0)
_pFile = (*XunixFile)(unsafe.Pointer(_id))
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31288), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if int32(_pFile.X4) > i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31289), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixCheckReservedLockØ00__func__Ø000))), unsafe.Pointer(str(132989)))
crt.X__builtin_abort(tls)
}
}()
_unixEnterMutex(tls)
if int32((*XunixInodeInfo)(_pFile.X2).X2) > i32(1) {
_reserved = i32(1)
}
if _reserved != 0 || ((*XunixInodeInfo)(_pFile.X2).X3) != 0 {
goto _6
}
*(*int16)(unsafe.Pointer(&(_2_lock.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_2_lock.X2))) = int64(_sqlite3PendingByte + i32(1))
*(*int64)(unsafe.Pointer(&(_2_lock.X3))) = int64(i32(1))
*(*int16)(unsafe.Pointer(&(_2_lock.X0))) = int16(i32(1))
if (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _pFile.X3, i32(12), unsafe.Pointer(&_2_lock)) != 0 {
_rc = i32(3594)
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
goto _9
}
if int32(_2_lock.X0) != i32(2) {
_reserved = i32(1)
}
_9:
_6:
_unixLeaveMutex(tls)
*_pResOut = _reserved
return _rc
_ = _2_lock
panic(0)
}
var _unixCheckReservedLockØ00__func__Ø000 [22]int8
func init() {
crt.Xstrncpy(nil, &_unixCheckReservedLockØ00__func__Ø000[0], str(133019), 22)
}
// Information and control of an open file handle.
func _unixFileControl(tls *crt.TLS, _id *Xsqlite3_file, _op int32, _pArg unsafe.Pointer) (r0 int32) {
var _5_rc, _12_rc int32
var _12_newLimit int64
var _9_zTFile *int8
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
switch _op {
case i32(-905363552):
goto _11
case i32(1):
goto _1
case i32(4):
goto _2
case i32(5):
goto _4
case i32(6):
goto _3
case i32(10):
goto _5
case i32(12):
goto _7
case i32(13):
goto _6
case i32(16):
goto _8
case i32(18):
goto _10
case i32(20):
goto _9
default:
goto _12
}
_1:
*(*int32)(_pArg) = int32(_pFile.X4)
return i32(0)
_2:
*(*int32)(_pArg) = _pFile.X6
return i32(0)
_3:
*(*int32)(unsafe.Pointer(&(_pFile.X11))) = *(*int32)(_pArg)
return i32(0)
_4:
_5_rc = _fcntlSizeHint(tls, _pFile, *(*int64)(_pArg))
return _5_rc
_5:
_unixModeBit(tls, _pFile, uint8(i32(4)), (*int32)(_pArg))
return i32(0)
_6:
_unixModeBit(tls, _pFile, uint8(i32(16)), (*int32)(_pArg))
return i32(0)
_7:
*(**int8)(_pArg) = Xsqlite3_mprintf(tls, str(24576), unsafe.Pointer((*Xsqlite3_vfs)(_pFile.X1).X4))
return i32(0)
_8:
_9_zTFile = (*int8)(Xsqlite3_malloc64(tls, uint64((*Xsqlite3_vfs)(_pFile.X1).X2)))
if _9_zTFile != nil {
_unixGetTempname(tls, (*Xsqlite3_vfs)(_pFile.X1).X2, _9_zTFile)
*(**int8)(_pArg) = _9_zTFile
}
return i32(0)
_9:
*(*int32)(_pArg) = _fileHasMoved(tls, _pFile)
return i32(0)
_10:
_12_newLimit = *(*int64)(_pArg)
_12_rc = i32(0)
if _12_newLimit > (_sqlite3Config.X18) {
_12_newLimit = _sqlite3Config.X18
}
*(*int64)(_pArg) = _pFile.X15
if _12_newLimit < int64(i32(0)) || _12_newLimit == (_pFile.X15) || (_pFile.X12) != i32(0) {
goto _17
}
*(*int64)(unsafe.Pointer(&(_pFile.X15))) = _12_newLimit
if (_pFile.X13) > int64(i32(0)) {
_unixUnmapfile(tls, _pFile)
_12_rc = _unixMapfile(tls, _pFile, int64(i32(-1)))
}
_17:
return _12_rc
_11:
*(*uint8)(unsafe.Pointer(&((*XunixFile)(unsafe.Pointer(_id)).X18))) = uint8(i32(0))
return i32(0)
_12:
return i32(12)
}
// This function is called to handle the SQLITE_FCNTL_SIZE_HINT
// file-control operation. Enlarge the database to nBytes in size
// (rounded up to the next chunk-size). If the database is already
// nBytes or larger, this routine is a no-op.
func _fcntlSizeHint(tls *crt.TLS, _pFile *XunixFile, _nByte int64) (r0 int32) {
var _3_nBlk, _3_nWrite, _5_rc int32
var _1_nSize, _3_iWrite int64
var _1_buf crt.Xstruct_stat64
if (_pFile.X11) <= i32(0) {
goto _0
}
if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _pFile.X3, &_1_buf) != 0 {
return i32(1802)
}
_1_nSize = (((_nByte + int64(_pFile.X11)) - int64(i32(1))) / int64(_pFile.X11)) * int64(_pFile.X11)
if _1_nSize <= (_1_buf.X9) {
goto _2
}
_3_nBlk = _1_buf.X10
_3_nWrite = i32(0)
_3_iWrite = ((((_1_buf.X9) / int64(_3_nBlk)) * int64(_3_nBlk)) + int64(_3_nBlk)) - int64(i32(1))
func() {
if _3_iWrite < (_1_buf.X9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33609), unsafe.Pointer((*int8)(unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000))), unsafe.Pointer(str(133041)))
crt.X__builtin_abort(tls)
}
}()
func() {
if ((_3_iWrite + int64(i32(1))) % int64(_3_nBlk)) != int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33610), unsafe.Pointer((*int8)(unsafe.Pointer(&_fcntlSizeHintØ00__func__Ø000))), unsafe.Pointer(str(133061)))
crt.X__builtin_abort(tls)
}
}()
_7:
if _3_iWrite >= ((_1_nSize + int64(_3_nBlk)) - int64(i32(1))) {
goto _10
}
if _3_iWrite >= _1_nSize {
_3_iWrite = _1_nSize - int64(i32(1))
}
_3_nWrite = _seekAndWrite(tls, _pFile, _3_iWrite, (unsafe.Pointer)(str(0)), i32(1))
if _3_nWrite != i32(1) {
return i32(778)
}
{
p := &_3_iWrite
*p = (*p) + int64(_3_nBlk)
sink6 = *p
}
goto _7
_10:
_2:
_0:
if (_pFile.X15) <= int64(i32(0)) || _nByte <= (_pFile.X13) {
goto _14
}
if (_pFile.X11) > i32(0) {
goto _15
}
if _robust_ftruncate(tls, _pFile.X3, _nByte) != 0 {
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
return _unixLogErrorAtLine(tls, i32(1546), str(131533), _pFile.X9, i32(33626))
}
_15:
_5_rc = _unixMapfile(tls, _pFile, _nByte)
return _5_rc
_14:
return i32(0)
_ = _1_buf
panic(0)
}
var _fcntlSizeHintØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_fcntlSizeHintØ00__func__Ø000[0], str(133082), 14)
}
// Memory map or remap the file opened by file-descriptor pFd (if the file
// is already mapped, the existing mapping is replaced by the new). Or, if
// there already exists a mapping for this file, and there are still
// outstanding xFetch() references to it, this function is a no-op.
//
// If parameter nByte is non-negative, then it is the requested size of
// the mapping to create. Otherwise, if nByte is less than zero, then the
// requested size is the size of the file on disk. The actual size of the
// created mapping is either the requested size or the value configured
// using SQLITE_FCNTL_MMAP_LIMIT, whichever is smaller.
//
// SQLITE_OK is returned if no error occurs (even if the mapping is not
// recreated as a result of outstanding references) or an SQLite error
// code otherwise.
func _unixMapfile(tls *crt.TLS, _pFd *XunixFile, _nMap int64) (r0 int32) {
var _1_statbuf crt.Xstruct_stat64
func() {
if _nMap < int64(i32(0)) && (_pFd.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34713), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133096)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nMap <= int64(i32(0)) && ((_pFd.X13) != int64(i32(0)) || _pFd.X16 != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34714), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133125)))
crt.X__builtin_abort(tls)
}
}()
if (_pFd.X12) > i32(0) {
return i32(0)
}
if _nMap >= int64(i32(0)) {
goto _8
}
if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _pFd.X3, &_1_statbuf) != 0 {
return i32(1802)
}
_nMap = _1_statbuf.X9
_8:
if _nMap > (_pFd.X15) {
_nMap = _pFd.X15
}
func() {
if _nMap <= int64(i32(0)) && ((_pFd.X13) != int64(i32(0)) || _pFd.X16 != nil) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34728), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixMapfileØ00__func__Ø000))), unsafe.Pointer(str(133125)))
crt.X__builtin_abort(tls)
}
}()
if _nMap != (_pFd.X13) {
_unixRemapfile(tls, _pFd, _nMap)
}
return i32(0)
_ = _1_statbuf
panic(0)
}
var _unixMapfileØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_unixMapfileØ00__func__Ø000[0], str(133176), 12)
}
// Attempt to set the size of the memory mapping maintained by file
// descriptor pFd to nNew bytes. Any existing mapping is discarded.
//
// If successful, this function sets the following variables:
//
// unixFile.pMapRegion
// unixFile.mmapSize
// unixFile.mmapSizeActual
//
// If unsuccessful, an error message is logged via sqlite3_log() and
// the three variables above are zeroed. In this case SQLite should
// continue accessing the database using the xRead() and xWrite()
// methods.
func _unixRemapfile(tls *crt.TLS, _pFd *XunixFile, _nNew int64) {
var _h, _flags, _1_szSyspage int32
var _nOrig, _1_nReuse int64
var _zErr *int8
var _pOrig, _pNew, _1_pReq *uint8
_zErr = str(131655)
_h = _pFd.X3
_pOrig = (*uint8)(_pFd.X16)
_nOrig = _pFd.X14
_pNew = nil
_flags = i32(1)
func() {
if (_pFd.X12) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34631), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(132188)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nNew <= (_pFd.X13) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34632), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133188)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nNew > (_pFd.X15) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34633), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133207)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _nNew <= int64(i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34634), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(84646)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pFd.X14) < (_pFd.X13) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34635), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133230)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (unsafe.Pointer)(uintptr(u32(4294967295))) == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34636), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRemapfileØ00__func__Ø000))), unsafe.Pointer(str(133265)))
crt.X__builtin_abort(tls)
}
}()
if _pOrig == nil {
goto _12
}
_1_szSyspage = (*(*func(*crt.TLS) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(25)))).X1)})))(tls)
_1_nReuse = (_pFd.X13) & int64(^(_1_szSyspage - i32(1)))
_1_pReq = (*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pOrig)) + 1*uintptr(_1_nReuse)))
if _1_nReuse != _nOrig {
(*(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_1_pReq), uint32(_nOrig-_1_nReuse))
}
_pNew = (*uint8)((*(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(22)))).X1)})))(tls, (unsafe.Pointer)(_1_pReq), uint32(_nNew-_1_nReuse), _flags, i32(1), _h, _1_nReuse))
if _pNew == (*uint8)(unsafe.Pointer(uintptr(u32(4294967295)))) {
goto _14
}
if _pNew != _1_pReq {
(*(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_pNew), uint32(_nNew-_1_nReuse))
_pNew = nil
goto _16
}
_pNew = _pOrig
_16:
_14:
if (_pNew == (*uint8)(unsafe.Pointer(uintptr(u32(4294967295))))) || (_pNew == nil) {
(*(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(_pOrig), uint32(_1_nReuse))
}
_12:
if _pNew == nil {
_pNew = (*uint8)((*(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(22)))).X1)})))(tls, nil, uint32(_nNew), _flags, i32(1), _h, int64(i32(0))))
}
if _pNew == (*uint8)(unsafe.Pointer(uintptr(u32(4294967295)))) {
_pNew = nil
_nNew = int64(i32(0))
_unixLogErrorAtLine(tls, i32(0), _zErr, _pFd.X9, i32(34685))
*(*int64)(unsafe.Pointer(&(_pFd.X15))) = int64(i32(0))
}
*(*unsafe.Pointer)(unsafe.Pointer(&(_pFd.X16))) = (unsafe.Pointer)(_pNew)
*(*int64)(unsafe.Pointer(&(_pFd.X13))) = store6((*int64)(unsafe.Pointer(&(_pFd.X14))), _nNew)
}
var _unixRemapfileØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_unixRemapfileØ00__func__Ø000[0], str(133279), 14)
}
// If *pArg is initially negative then this is a query. Set *pArg to
// 1 or 0 depending on whether or not bit mask of pFile->ctrlFlags is set.
//
// If *pArg is 0 or 1, then clear or set the mask bit of pFile->ctrlFlags.
func _unixModeBit(tls *crt.TLS, _pFile *XunixFile, _mask uint8, _pArg *int32) {
if (*_pArg) < i32(0) {
*_pArg = bool2int((int32(_pFile.X5) & int32(_mask)) != i32(0))
goto _3
}
if (*_pArg) == i32(0) {
{
p := (*uint16)(unsafe.Pointer(&(_pFile.X5)))
*p = uint16(int32(*p) & (^int32(_mask)))
sink14 = *p
}
goto _3
}
{
p := (*uint16)(unsafe.Pointer(&(_pFile.X5)))
*p = uint16(int32(*p) | int32(_mask))
sink14 = *p
}
_3:
}
// Create a temporary file name in zBuf. zBuf must be allocated
// by the calling process and must be big enough to hold at least
// pVfs->mxPathname bytes.
func _unixGetTempname(tls *crt.TLS, _nBuf int32, _zBuf *int8) (r0 int32) {
var _iLimit int32
var _1_r uint64
var _zDir *int8
_iLimit = i32(0)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(i32(0)))) = int8(i32(0))
_zDir = _unixTempFileDir(tls)
if _zDir == nil {
return i32(6410)
}
_0:
Xsqlite3_randomness(tls, int32(u32(8)), (unsafe.Pointer)(&_1_r))
func() {
if _nBuf <= i32(2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35347), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixGetTempnameØ00__func__Ø000))), unsafe.Pointer(str(133293)))
crt.X__builtin_abort(tls)
}
}()
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_nBuf-i32(2)))) = int8(i32(0))
Xsqlite3_snprintf(tls, _nBuf, _zBuf, str(133300), unsafe.Pointer(_zDir), _1_r, i32(0))
if (int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf)) + 1*uintptr(_nBuf-i32(2))))) != i32(0)) || (postInc1(&_iLimit, int32(1)) > i32(10)) {
return i32(1)
}
if (*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(2)))).X1)})))(tls, _zBuf, i32(0)) == i32(0) {
goto _0
}
return i32(0)
_ = _iLimit
panic(0)
}
// Return the name of a directory in which to put temporary files.
// If no suitable temporary file directory can be found, return NULL.
func _unixTempFileDir(tls *crt.TLS) (r0 *int8) {
var _i uint32
var _zDir *int8
var _buf crt.Xstruct_stat64
_i = u32(0)
_zDir = Xsqlite3_temp_directory
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 4*uintptr(i32(0))))) == nil {
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 4*uintptr(i32(0)))) = crt.Xgetenv(tls, str(133317))
}
if (*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 4*uintptr(i32(1))))) == nil {
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 4*uintptr(i32(1)))) = crt.Xgetenv(tls, str(133331))
}
_1:
if (((_zDir != nil) && ((*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(4)))).X1)})))(tls, _zDir, &_buf) == i32(0))) && (((_buf.X3) & uint32(i32(61440))) == uint32(i32(16384)))) && ((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(2)))).X1)})))(tls, _zDir, i32(3)) == i32(0)) {
return _zDir
}
if _i >= u32(6) {
goto _3
}
_zDir = *(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_unixTempFileDirØ00azDirsØ001)) + 4*uintptr(postInc5(&_i, uint32(1)))))
goto _1
_3:
return nil
_ = _buf
panic(0)
}
var _unixTempFileDirØ00azDirsØ001 [6]*int8
func init() {
_unixTempFileDirØ00azDirsØ001 = [6]*int8{nil, nil, str(133338), str(133347), str(133356), str(312)}
}
var _unixGetTempnameØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_unixGetTempnameØ00__func__Ø000[0], str(133361), 16)
}
func _unixSectorSize(tls *crt.TLS, _NotUsed *Xsqlite3_file) (r0 int32) {
return i32(4096)
}
// Return the device characteristics for the file.
//
// This VFS is set up to return SQLITE_IOCAP_POWERSAFE_OVERWRITE by default.
// However, that choice is controversial since technically the underlying
// file system does not always provide powersafe overwrites. (In other
// words, after a power-loss event, parts of the file that were never
// written might end up being altered.) However, non-PSOW behavior is very,
// very rare. And asserting PSOW makes a large reduction in the amount
// of required I/O for journaling, since a lot of padding is eliminated.
// Hence, while POWERSAFE_OVERWRITE is on by default, there is a file-control
// available to turn it off and URI query parameter available to turn it off.
func _unixDeviceCharacteristics(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
var _rc int32
var _p *XunixFile
_p = (*XunixFile)(unsafe.Pointer(_id))
_rc = i32(0)
if (int32(_p.X5) & i32(16)) != 0 {
{
p := &_rc
*p = (*p) | i32(4096)
sink1 = *p
}
}
return _rc
}
// This function is called to obtain a pointer to region iRegion of the
// shared-memory associated with the database file fd. Shared-memory regions
// are numbered starting from zero. Each shared-memory region is szRegion
// bytes in size.
//
// If an error occurs, an error code is returned and *pp is set to NULL.
//
// Otherwise, if the bExtend parameter is 0 and the requested shared-memory
// region has not been allocated (by any client, including one running in a
// separate process), then *pp is set to NULL and SQLITE_OK returned. If
// bExtend is non-zero and the requested shared-memory region has not yet
// been allocated, it is allocated by this function.
//
// If the shared-memory region has already been allocated or is allocated by
// this call as described above, then it is mapped into this processes
// address space (if it is not already), *pp is set to point to the mapped
// memory and SQLITE_OK returned.
func _unixShmMap(tls *crt.TLS, _fd *Xsqlite3_file, _iRegion int32, _szRegion int32, _bExtend int32, _pp *unsafe.Pointer) (r0 int32) {
var _rc, _nShmPerMap, _nReqRegion, _2_nByte, _7_iPg, _8_x, _11_nMap, _11_i int32
var _9_zFile *int8
var _11_pMem unsafe.Pointer
var _2_sStat crt.Xstruct_stat64
var _2_apNew **int8
var _pDbFd *XunixFile
var _pShmNode *XunixShmNode
var _p *TunixShm
_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
_rc = i32(0)
_nShmPerMap = _unixShmRegionPerMap(tls)
if (*TunixShm)(_pDbFd.X10) != nil {
goto _0
}
_rc = _unixOpenSharedMemory(tls, _pDbFd)
if _rc != i32(0) {
return _rc
}
_0:
_p = (*TunixShm)(_pDbFd.X10)
_pShmNode = (*XunixShmNode)(_p.X0)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.X1))
func() {
if _szRegion != (_pShmNode.X4) && int32(_pShmNode.X5) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34296), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133377)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XunixInodeInfo)(_pShmNode.X0) != (*XunixInodeInfo)(_pDbFd.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34297), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133430)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pShmNode.X3) < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34298), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133462)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pShmNode.X3) >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34299), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133511)))
crt.X__builtin_abort(tls)
}
}()
_nReqRegion = ((_iRegion + _nShmPerMap) / _nShmPerMap) * _nShmPerMap
if int32(_pShmNode.X5) >= _nReqRegion {
goto _shmpage_out
}
_2_nByte = _nReqRegion * _szRegion
*(*int32)(unsafe.Pointer(&(_pShmNode.X4))) = _szRegion
if (_pShmNode.X3) < i32(0) {
goto _14
}
if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _pShmNode.X3, &_2_sStat) != 0 {
_rc = i32(4874)
goto _shmpage_out
}
if (_2_sStat.X9) >= int64(_2_nByte) {
goto _16
}
if _bExtend == 0 {
goto _shmpage_out
}
func() {
if (_2_nByte % _unixShmMapØ00pgszØ001) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34341), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmMapØ00__func__Ø000))), unsafe.Pointer(str(133559)))
crt.X__builtin_abort(tls)
}
}()
_7_iPg = int32((_2_sStat.X9) / int64(_unixShmMapØ00pgszØ001))
_21:
if _7_iPg >= (_2_nByte / _unixShmMapØ00pgszØ001) {
goto _24
}
_8_x = i32(0)
if _seekAndWriteFd(tls, _pShmNode.X3, int64(((_7_iPg*_unixShmMapØ00pgszØ001)+_unixShmMapØ00pgszØ001)-i32(1)), (unsafe.Pointer)(str(0)), i32(1), &_8_x) != i32(1) {
_9_zFile = _pShmNode.X2
_rc = _unixLogErrorAtLine(tls, i32(4874), str(131568), _9_zFile, i32(34346))
goto _shmpage_out
}
_7_iPg += 1
goto _21
_24:
_16:
_14:
_2_apNew = (**int8)(Xsqlite3_realloc(tls, (unsafe.Pointer)(_pShmNode.X7), int32(uint32(_nReqRegion)*u32(4))))
if _2_apNew == nil {
_rc = _sqlite3IoerrnomemError(tls, i32(34359))
goto _shmpage_out
}
*(***int8)(unsafe.Pointer(&(_pShmNode.X7))) = _2_apNew
_27:
if int32(_pShmNode.X5) >= _nReqRegion {
goto _28
}
_11_nMap = _szRegion * _nShmPerMap
if (_pShmNode.X3) < i32(0) {
goto _29
}
_11_pMem = (*(*func(*crt.TLS, unsafe.Pointer, uint32, int32, int32, int32, int64) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(22)))).X1)})))(tls, nil, uint32(_11_nMap), func() int32 {
if (_pShmNode.X6) != 0 {
return i32(1)
}
return i32(3)
}(), i32(1), _pShmNode.X3, int64(_szRegion)*int64(_pShmNode.X5))
if _11_pMem == (unsafe.Pointer)(uintptr(u32(4294967295))) {
_rc = _unixLogErrorAtLine(tls, i32(5386), str(131655), _pShmNode.X2, i32(34373))
goto _shmpage_out
}
goto _33
_29:
_11_pMem = Xsqlite3_malloc64(tls, uint64(_szRegion))
if _11_pMem == nil {
_rc = _sqlite3NomemError(tls, i32(34379))
goto _shmpage_out
}
crt.Xmemset(tls, _11_pMem, i32(0), uint32(_szRegion))
_33:
_11_i = i32(0)
_35:
if _11_i >= _nShmPerMap {
goto _38
}
*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode.X7)) + 4*uintptr(int32(_pShmNode.X5)+_11_i))) = (*int8)(unsafe.Pointer(uintptr(_11_pMem) + 1*uintptr(_szRegion*_11_i)))
_11_i += 1
goto _35
_38:
{
p := (*uint16)(unsafe.Pointer(&(_pShmNode.X5)))
*p = uint16(int32(*p) + _nShmPerMap)
sink14 = *p
}
goto _27
_28:
_shmpage_out:
if int32(_pShmNode.X5) > _iRegion {
*_pp = (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode.X7)) + 4*uintptr(_iRegion))))
goto _40
}
*_pp = nil
_40:
if ((_pShmNode.X6) != 0) && (_rc == i32(0)) {
_rc = i32(8)
}
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.X1))
return _rc
_ = _2_sStat
_ = _8_x
panic(0)
}
// Return the minimum number of 32KB shm regions that should be mapped at
// a time, assuming that each mapping must be an integer multiple of the
// current system page-size.
//
// Usually, this is 1. The exception seems to be systems that are configured
// to use 64KB pages - in this case each mapping must cover at least two
// shm regions.
func _unixShmRegionPerMap(tls *crt.TLS) (r0 int32) {
var _shmsz, _pgsz int32
_shmsz = i32(32768)
_pgsz = (*(*func(*crt.TLS) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(25)))).X1)})))(tls)
func() {
if ((_pgsz - i32(1)) & _pgsz) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34053), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmRegionPerMapØ00__func__Ø000))), unsafe.Pointer(str(133577)))
crt.X__builtin_abort(tls)
}
}()
if _pgsz < _shmsz {
return i32(1)
}
return _pgsz / _shmsz
}
var _unixShmRegionPerMapØ00__func__Ø000 [20]int8
func init() {
crt.Xstrncpy(nil, &_unixShmRegionPerMapØ00__func__Ø000[0], str(133596), 20)
}
// Open a shared-memory area associated with open database file pDbFd.
// This particular implementation uses mmapped files.
//
// The file used to implement shared-memory is in the same directory
// as the open database file and has the same name as the open database
// file with the "-shm" suffix added. For example, if the database file
// is "/home/user1/config.db" then the file that is created and mmapped
// for shared memory will be called "/home/user1/config.db-shm".
//
// Another approach to is to use files in /dev/shm or /dev/tmp or an
// some other tmpfs mount. But if a file in a different directory
// from the database file is used, then differing access permissions
// or a chroot() might cause two different processes on the same
// database to end up using different files for shared memory -
// meaning that their memory would not really be shared - resulting
// in database corruption. Nevertheless, this tmpfs file usage
// can be enabled at compile-time using -DSQLITE_SHM_DIRECTORY="/dev/shm"
// or the equivalent. The use of the SQLITE_SHM_DIRECTORY compile-time
// option results in an incompatible build of SQLite; builds of SQLite
// that with differing SQLITE_SHM_DIRECTORY settings attempt to use the
// same database file at the same time, database corruption will likely
// result. The SQLITE_SHM_DIRECTORY compile-time option is considered
// "unsupported" and may go away in a future SQLite release.
//
// When opening a new shared-memory file, if no other instances of that
// file are currently open, in this process or in other processes, then
// the file must be truncated to zero length or have its header cleared.
//
// If the original database file (pDbFd) is using the "unix-excl" VFS
// that means that an exclusive lock is held on the database file and
// that no other processes are able to read or write the database. In
// that case, we do not really need shared memory. No shared memory
// file is created. The shared memory will be simulated with heap memory.
func _unixOpenSharedMemory(tls *crt.TLS, _pDbFd *XunixFile) (r0 int32) {
var _rc, _nShmFilename, _6_openFlags int32
var _zShmFilename, _1_zBasePath *int8
var _1_sStat crt.Xstruct_stat64
var _pInode *XunixInodeInfo
var _pShmNode *XunixShmNode
var _p *TunixShm
_p = nil
_p = (*TunixShm)(Xsqlite3_malloc64(tls, uint64(u32(16))))
if _p == nil {
return _sqlite3NomemError(tls, i32(34134))
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(16))
func() {
if (*TunixShm)(_pDbFd.X10) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34136), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenSharedMemoryØ00__func__Ø000))), unsafe.Pointer(str(133616)))
crt.X__builtin_abort(tls)
}
}()
_unixEnterMutex(tls)
_pInode = (*XunixInodeInfo)(_pDbFd.X2)
_pShmNode = (*XunixShmNode)(_pInode.X5)
if _pShmNode != nil {
goto _3
}
_1_zBasePath = _pDbFd.X9
if (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _pDbFd.X3, &_1_sStat) != 0 {
_rc = i32(1802)
goto _shm_open_err
}
_nShmFilename = i32(6) + int32(crt.Xstrlen(tls, _1_zBasePath))
_pShmNode = (*XunixShmNode)(Xsqlite3_malloc64(tls, uint64(u32(40)+uint32(_nShmFilename))))
if _pShmNode == nil {
_rc = _sqlite3NomemError(tls, i32(34166))
goto _shm_open_err
}
crt.Xmemset(tls, (unsafe.Pointer)(_pShmNode), i32(0), u32(40)+uint32(_nShmFilename))
_zShmFilename = store0((**int8)(unsafe.Pointer(&(_pShmNode.X2))), (*int8)(unsafe.Pointer((*XunixShmNode)(unsafe.Pointer(uintptr((unsafe.Pointer)(_pShmNode))+40*uintptr(i32(1)))))))
Xsqlite3_snprintf(tls, _nShmFilename, _zShmFilename, str(133631), unsafe.Pointer(_1_zBasePath))
*(*int32)(unsafe.Pointer(&(_pShmNode.X3))) = i32(-1)
*(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_pDbFd.X2).X5))))) = _pShmNode
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X0))))) = (*XunixInodeInfo)(_pDbFd.X2)
if (_sqlite3Config.X1) == 0 {
goto _6
}
*(**Xsqlite3_mutex)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X1))))) = Xsqlite3_mutex_alloc(tls, i32(0))
if (*Xsqlite3_mutex)(_pShmNode.X1) == nil {
_rc = _sqlite3NomemError(tls, i32(34185))
goto _shm_open_err
}
_6:
if int32(_pInode.X3) != i32(0) {
goto _8
}
_6_openFlags = i32(66)
if Xsqlite3_uri_boolean(tls, _pDbFd.X9, str(133638), i32(0)) != 0 {
_6_openFlags = i32(0)
*(*uint8)(unsafe.Pointer(&(_pShmNode.X6))) = uint8(i32(1))
}
*(*int32)(unsafe.Pointer(&(_pShmNode.X3))) = _robust_open(tls, _zShmFilename, _6_openFlags, (_1_sStat.X3)&uint32(i32(511)))
if (_pShmNode.X3) < i32(0) {
_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(34198)), str(131504), _zShmFilename, i32(34198))
goto _shm_open_err
}
_robustFchown(tls, _pShmNode.X3, _1_sStat.X5, _1_sStat.X6)
_rc = i32(0)
if _unixShmSystemLock(tls, _pDbFd, i32(1), i32(128), i32(1)) != i32(0) {
goto _11
}
if _robust_ftruncate(tls, _pShmNode.X3, int64(i32(0))) != 0 {
_rc = _unixLogErrorAtLine(tls, i32(4618), str(131533), _zShmFilename, i32(34214))
}
_11:
if _rc == i32(0) {
_rc = _unixShmSystemLock(tls, _pDbFd, i32(0), i32(128), i32(1))
}
if _rc != 0 {
goto _shm_open_err
}
_8:
_3:
*(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X0))))) = _pShmNode
*(*uint8)(unsafe.Pointer(&(_p.X3))) = postInc2((*uint8)(unsafe.Pointer(&(_pShmNode.X12))), uint8(1))
*(*int32)(unsafe.Pointer(&(_pShmNode.X8))) += 1
*(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pDbFd.X10))))) = _p
_unixLeaveMutex(tls)
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_pShmNode.X1))
*(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X1))))) = (*TunixShm)(_pShmNode.X9)
*(**TunixShm)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pShmNode.X9))))) = _p
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_pShmNode.X1))
return i32(0)
_shm_open_err:
_unixShmPurge(tls, _pDbFd)
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
_unixLeaveMutex(tls)
return _rc
_ = _1_sStat
panic(0)
}
var _unixOpenSharedMemoryØ00__func__Ø000 [21]int8
func init() {
crt.Xstrncpy(nil, &_unixOpenSharedMemoryØ00__func__Ø000[0], str(133651), 21)
}
// On some systems, calls to fchown() will trigger a message in a security
// log if they come from non-root processes. So avoid calling fchown() if
// we are not running as root.
func _robustFchown(tls *crt.TLS, _fd int32, _uid uint32, _gid uint32) (r0 int32) {
return func() int32 {
if (*(*func(*crt.TLS) uint32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(21)))).X1)})))(tls) != 0 {
return i32(0)
}
return (*(*func(*crt.TLS, int32, uint32, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(20)))).X1)})))(tls, _fd, _uid, _gid)
}()
}
// Apply posix advisory locks for all bytes from ofst through ofst+n-1.
//
// Locks block if the mask is exactly UNIX_SHM_C and are non-blocking
// otherwise.
func _unixShmSystemLock(tls *crt.TLS, _pFile *XunixFile, _lockType int32, _ofst int32, _n int32) (r0 int32) {
var _rc int32
var _2_mask uint16
var _pShmNode *XunixShmNode
var _f Tflock
_rc = i32(0)
_pShmNode = (*XunixShmNode)((*XunixInodeInfo)(_pFile.X2).X5)
func() {
if Xsqlite3_mutex_held(tls, (*Xsqlite3_mutex)(_pShmNode.X1)) == 0 && (_pShmNode.X8) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33983), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133672)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n != i32(1) && _lockType == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33986), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133729)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n < i32(1) || _n > i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(33989), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133755)))
crt.X__builtin_abort(tls)
}
}()
if (_pShmNode.X3) >= i32(0) {
crt.Xmemset(tls, (unsafe.Pointer)(&_f), i32(0), u32(24))
*(*int16)(unsafe.Pointer(&(_f.X0))) = int16(_lockType)
*(*int16)(unsafe.Pointer(&(_f.X1))) = int16(i32(0))
*(*int64)(unsafe.Pointer(&(_f.X2))) = int64(_ofst)
*(*int64)(unsafe.Pointer(&(_f.X3))) = int64(_n)
_rc = (*(*func(*crt.TLS, int32, int32, ...interface{}) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(7)))).X1)})))(tls, _pShmNode.X3, i32(13), unsafe.Pointer(&_f))
_rc = func() int32 {
if _rc != i32(-1) {
return i32(0)
}
return i32(5)
}()
}
_2_mask = uint16(func() int32 {
if _ofst > i32(31) {
return i32(65535)
}
return ((i32(1) << uint(_ofst+_n)) - (i32(1) << uint(_ofst)))
}())
if _rc != i32(0) {
goto _14
}
if _lockType == i32(2) {
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10)))
*p = uint8(int32(*p) & (^int32(_2_mask)))
sink2 = *p
}
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11)))
*p = uint8(int32(*p) & (^int32(_2_mask)))
sink2 = *p
}
goto _18
}
if _lockType == i32(0) {
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10)))
*p = uint8(int32(*p) & (^int32(_2_mask)))
sink2 = *p
}
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11)))
*p = uint8(int32(*p) | int32(_2_mask))
sink2 = *p
}
goto _18
}
func() {
if _lockType != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34018), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133783)))
crt.X__builtin_abort(tls)
}
}()
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X10)))
*p = uint8(int32(*p) | int32(_2_mask))
sink2 = *p
}
{
p := (*uint8)(unsafe.Pointer(&(_pShmNode.X11)))
*p = uint8(int32(*p) & (^int32(_2_mask)))
sink2 = *p
}
_18:
goto _21
_14:
if _lockType == i32(2) {
goto _25
}
if _lockType == i32(0) {
goto _25
}
func() {
if _lockType != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34029), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmSystemLockØ00__func__Ø000))), unsafe.Pointer(str(133783)))
crt.X__builtin_abort(tls)
}
}()
_25:
_21:
return _rc
_ = _f
panic(0)
}
var _unixShmSystemLockØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_unixShmSystemLockØ00__func__Ø000[0], str(133801), 18)
}
// Purge the unixShmNodeList list of all entries with unixShmNode.nRef==0.
//
// This is not a VFS shared-memory method; it is a utility function called
// by VFS shared-memory methods.
func _unixShmPurge(tls *crt.TLS, _pFd *XunixFile) {
var _1_nShmPerMap, _1_i int32
var _p *XunixShmNode
_p = (*XunixShmNode)((*XunixInodeInfo)(_pFd.X2).X5)
func() {
if _unixMutexHeld(tls) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34066), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000))), unsafe.Pointer(str(132009)))
crt.X__builtin_abort(tls)
}
}()
if _p == nil || func() int32 {
if (_p.X8) == i32(0) {
return i32(1)
}
return func() int32 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34067), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000))), unsafe.Pointer(str(4908)))
crt.X__builtin_abort(tls)
return i32(0)
}()
}() == 0 {
goto _5
}
_1_nShmPerMap = _unixShmRegionPerMap(tls)
func() {
if (*XunixInodeInfo)(_p.X0) != (*XunixInodeInfo)(_pFd.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34070), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmPurgeØ00__func__Ø000))), unsafe.Pointer(str(133819)))
crt.X__builtin_abort(tls)
}
}()
Xsqlite3_mutex_free(tls, (*Xsqlite3_mutex)(_p.X1))
_1_i = i32(0)
_8:
if _1_i >= int32(_p.X5) {
goto _11
}
if (_p.X3) >= i32(0) {
(*(*func(*crt.TLS, unsafe.Pointer, uint32) unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(23)))).X1)})))(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 4*uintptr(_1_i)))), uint32(_p.X4))
goto _13
}
Xsqlite3_free(tls, (unsafe.Pointer)(*(**int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X7)) + 4*uintptr(_1_i)))))
_13:
{
p := &_1_i
*p = (*p) + _1_nShmPerMap
sink1 = *p
}
goto _8
_11:
Xsqlite3_free(tls, (unsafe.Pointer)(_p.X7))
if (_p.X3) >= i32(0) {
_robust_close(tls, _pFd, _p.X3, i32(34081))
*(*int32)(unsafe.Pointer(&(_p.X3))) = i32(-1)
}
*(**XunixShmNode)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*XunixInodeInfo)(_p.X0).X5))))) = nil
Xsqlite3_free(tls, (unsafe.Pointer)(_p))
_5:
}
var _unixShmPurgeØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_unixShmPurgeØ00__func__Ø000[0], str(133842), 13)
}
var _unixShmMapØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_unixShmMapØ00__func__Ø000[0], str(133855), 11)
}
var _unixShmMapØ00pgszØ001 int32
func init() {
_unixShmMapØ00pgszØ001 = i32(4096)
}
// Change the lock state for a shared-memory segment.
//
// Note that the relationship between SHAREd and EXCLUSIVE locks is a little
// different here than in posix. In xShmLock(), one can go from unlocked
// to shared and back or from unlocked to exclusive and back. But one may
// not go from shared to exclusive or from exclusive to shared.
func _unixShmLock(tls *crt.TLS, _fd *Xsqlite3_file, _ofst int32, _n int32, _flags int32) (r0 int32) {
var _rc int32
var _mask, _1_allMask, _6_allShared uint16
var _pDbFd *XunixFile
var _pShmNode *XunixShmNode
var _p, _pX *TunixShm
_pDbFd = (*XunixFile)(unsafe.Pointer(_fd))
_p = (*TunixShm)(_pDbFd.X10)
_pShmNode = (*XunixShmNode)(_p.X0)
_rc = i32(0)
func() {
if _pShmNode != (*XunixShmNode)((*XunixInodeInfo)(_pDbFd.X2).X5) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34424), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133866)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (*XunixInodeInfo)(_pShmNode.X0) != (*XunixInodeInfo)(_pDbFd.X2) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34425), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133430)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _ofst < i32(0) || (_ofst+_n) > i32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34426), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133900)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n < i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34427), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133936)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _flags != i32(6) && _flags != i32(10) && _flags != i32(5) && _flags != i32(9) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34428), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133941)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _n != i32(1) && (_flags&i32(8)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34432), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(134140)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pShmNode.X3) < i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34433), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133462)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_pShmNode.X3) >= i32(0) && int32((*XunixInodeInfo)(_pDbFd.X2).X3) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34434), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixShmLockØ00__func__Ø000))), unsafe.Pointer(str(133511)))
crt.X__builtin_abort(tls)
}
}()
_mask = uint16((i32(1) << uint(_ofst+_n)) - (i32(1) << uint(_ofst)))
func() {
if _n <= i32(1) && int32(_mask) != (i32(1)<= i32(0)) {
(*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(16)))).X1)})))(tls, _pShmNode.X2)
}
_unixShmPurge(tls, _pDbFd)
_11:
_unixLeaveMutex(tls)
return i32(0)
}
var _unixShmUnmapØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_unixShmUnmapØ00__func__Ø000[0], str(134308), 13)
}
// If possible, return a pointer to a mapping of file fd starting at offset
// iOff. The mapping must be valid for at least nAmt bytes.
//
// If such a pointer can be obtained, store it in *pp and return SQLITE_OK.
// Or, if one cannot but no error occurs, set *pp to 0 and return SQLITE_OK.
// Finally, if an error does occur, return an SQLite error code. The final
// value of *pp is undefined in this case.
//
// If this function does return a pointer, the caller must eventually
// release the reference by calling unixUnfetch().
func _unixFetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _nAmt int32, _pp *unsafe.Pointer) (r0 int32) {
var _2_rc int32
var _pFd *XunixFile
_pFd = (*XunixFile)(unsafe.Pointer(_fd))
*_pp = nil
if (_pFd.X15) <= int64(i32(0)) {
goto _0
}
if _pFd.X16 != nil {
goto _1
}
_2_rc = _unixMapfile(tls, _pFd, int64(i32(-1)))
if _2_rc != i32(0) {
return _2_rc
}
_1:
if (_pFd.X13) >= (_iOff + int64(_nAmt)) {
*_pp = (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFd.X16) + 1*uintptr(_iOff))))
*(*int32)(unsafe.Pointer(&(_pFd.X12))) += 1
}
_0:
return i32(0)
}
// If the third argument is non-NULL, then this function releases a
// reference obtained by an earlier call to unixFetch(). The second
// argument passed to this function must be the same as the corresponding
// argument that was passed to the unixFetch() invocation.
//
// Or, if the third argument is NULL, then this function is being called
// to inform the VFS layer that, according to POSIX, any existing mapping
// may now be invalid and should be unmapped.
func _unixUnfetch(tls *crt.TLS, _fd *Xsqlite3_file, _iOff int64, _p unsafe.Pointer) (r0 int32) {
var _pFd *XunixFile
_pFd = (*XunixFile)(unsafe.Pointer(_fd))
func() {
if (_p == nil) != ((_pFd.X12) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34788), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _p != nil && _p != (unsafe.Pointer)((*uint8)(unsafe.Pointer(uintptr(_pFd.X16)+1*uintptr(_iOff)))) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34791), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134349)))
crt.X__builtin_abort(tls)
}
}()
if _p != nil {
*(*int32)(unsafe.Pointer(&(_pFd.X12))) -= 1
goto _6
}
_unixUnmapfile(tls, _pFd)
_6:
func() {
if (_pFd.X12) < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(34799), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixUnfetchØ00__func__Ø000))), unsafe.Pointer(str(134391)))
crt.X__builtin_abort(tls)
}
}()
return i32(0)
}
var _unixUnfetchØ00__func__Ø000 [12]int8
func init() {
crt.Xstrncpy(nil, &_unixUnfetchØ00__func__Ø000[0], str(134409), 12)
}
// Open the file zPath.
//
// Previously, the SQLite OS layer used three functions in place of this
// one:
//
// sqlite3OsOpenReadWrite();
// sqlite3OsOpenReadOnly();
// sqlite3OsOpenExclusive();
//
// These calls correspond to the following combinations of flags:
//
// ReadWrite() -> (READWRITE | CREATE)
// ReadOnly() -> (READONLY)
// OpenExclusive() -> (READWRITE | CREATE | EXCLUSIVE)
//
// The old OpenExclusive() accepted a boolean argument - "delFlag". If
// true, the file was configured to be automatically deleted when the
// file handle closed. To achieve the same effect using this new
// interface, add the DELETEONCLOSE flag to those specified above for
// OpenExclusive().
func _unixOpen(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _pFile *Xsqlite3_file, _flags int32, _pOutFlags *int32) (r0 int32) {
var _fd, _openFlags, _eType, _noLock, _rc, _ctrlFlags, _isExclusive, _isDelete, _isCreate, _isReadonly, _isReadWrite, _syncDir int32
var _8_openMode, _8_uid, _8_gid uint32
var _zName *int8
var _p *XunixFile
var _2_pUnused *XUnixUnusedFd
var _zTmpname [514]int8
_p = (*XunixFile)(unsafe.Pointer(_pFile))
_fd = i32(-1)
_openFlags = i32(0)
_eType = int32(uint32(_flags) & u32(4294967040))
_rc = i32(0)
_ctrlFlags = i32(0)
_isExclusive = _flags & i32(16)
_isDelete = _flags & i32(8)
_isCreate = _flags & i32(4)
_isReadonly = _flags & i32(1)
_isReadWrite = _flags & i32(2)
_syncDir = bool2int(_isCreate != 0 && (((_eType == i32(16384)) || (_eType == i32(2048))) || (_eType == i32(524288))))
_zName = _zPath
func() {
if _isReadonly != i32(0) && _isReadWrite != i32(0) || _isReadWrite == 0 && _isReadonly == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35597), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134421)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isCreate != i32(0) && _isReadWrite == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35598), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134486)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isExclusive != i32(0) && _isCreate == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35599), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134513)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _isDelete != i32(0) && _isCreate == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35600), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134540)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isDelete != 0 || _zName == nil) && _eType == i32(256) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35604), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134564)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isDelete != 0 || _zName == nil) && _eType == i32(2048) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35605), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134615)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isDelete != 0 || _zName == nil) && _eType == i32(16384) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35606), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134671)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (_isDelete != 0 || _zName == nil) && _eType == i32(524288) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35607), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134729)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eType != i32(256) && _eType != i32(512) && _eType != i32(2048) && _eType != i32(4096) && _eType != i32(8192) && _eType != i32(16384) && _eType != i32(1024) && _eType != i32(524288) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35610), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(134776)))
crt.X__builtin_abort(tls)
}
}()
if _randomnessPid != crt.Xgetpid(tls) {
_randomnessPid = crt.Xgetpid(tls)
bug20530(_randomnessPid)
Xsqlite3_randomness(tls, i32(0), nil)
}
crt.Xmemset(tls, (unsafe.Pointer)(_p), i32(0), u32(80))
if _eType != i32(256) {
goto _43
}
_2_pUnused = _findReusableFd(tls, _zName, _flags)
if _2_pUnused != nil {
_fd = _2_pUnused.X0
goto _45
}
_2_pUnused = (*XUnixUnusedFd)(Xsqlite3_malloc64(tls, uint64(u32(12))))
if _2_pUnused == nil {
return _sqlite3NomemError(tls, i32(35636))
}
_45:
*(**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_p.X8))))) = _2_pUnused
func() {
if (_flags&i32(64)) == 0 && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint32(i32(1)))))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35644), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135034)))
crt.X__builtin_abort(tls)
}
}()
goto _51
_43:
if _zName != nil {
goto _51
}
func() {
if _isDelete == 0 || _syncDir != 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35648), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135089)))
crt.X__builtin_abort(tls)
}
}()
_rc = _unixGetTempname(tls, _pVfs.X2, (*int8)(unsafe.Pointer(&_zTmpname)))
if _rc != i32(0) {
return _rc
}
_zName = (*int8)(unsafe.Pointer(&_zTmpname))
func() {
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zName)) + 1*uintptr(crt.Xstrlen(tls, _zName)+uint32(i32(1)))))) != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35657), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135110)))
crt.X__builtin_abort(tls)
}
}()
_51:
if _isReadonly != 0 {
{
p := &_openFlags
*p = (*p) | i32(0)
sink1 = *p
}
}
if _isReadWrite != 0 {
{
p := &_openFlags
*p = (*p) | i32(2)
sink1 = *p
}
}
if _isCreate != 0 {
{
p := &_openFlags
*p = (*p) | i32(64)
sink1 = *p
}
}
if _isExclusive != 0 {
{
p := &_openFlags
*p = (*p) | i32(128)
sink1 = *p
}
}
{
p := &_openFlags
*p = (*p) | i32(32768)
sink1 = *p
}
if _fd >= i32(0) {
goto _62
}
_rc = _findCreateFileMode(tls, _zName, _flags, &_8_openMode, &_8_uid, &_8_gid)
if _rc != i32(0) {
func() {
if (*XUnixUnusedFd)(_p.X8) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35676), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135136)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eType != i32(524288) && _eType != i32(2048) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35677), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135148)))
crt.X__builtin_abort(tls)
}
}()
return _rc
}
_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
func() {
if _isExclusive != 0 && (_openFlags&i32(64)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35682), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135206)))
crt.X__builtin_abort(tls)
}
}()
if ((_fd < i32(0)) && ((*crt.X__errno_location(tls)) != i32(21))) && _isReadWrite != 0 {
{
p := &_flags
*p = (*p) & i32(-7)
sink1 = *p
}
{
p := &_openFlags
*p = (*p) & i32(-67)
sink1 = *p
}
{
p := &_flags
*p = (*p) | i32(1)
sink1 = *p
}
{
p := &_openFlags
*p = (*p) | i32(0)
sink1 = *p
}
_isReadonly = i32(1)
_fd = _robust_open(tls, _zName, _openFlags, _8_openMode)
}
if _fd < i32(0) {
_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35693)), str(131504), _zName, i32(35693))
goto _open_finished
}
if (_flags & i32(526336)) != 0 {
_robustFchown(tls, _fd, _8_uid, _8_gid)
}
_62:
func() {
if _fd < i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35705), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixOpenØ00__func__Ø000))), unsafe.Pointer(str(135247)))
crt.X__builtin_abort(tls)
}
}()
if _pOutFlags != nil {
*_pOutFlags = _flags
}
if (*XUnixUnusedFd)(_p.X8) != nil {
*(*int32)(unsafe.Pointer(&((*XUnixUnusedFd)(_p.X8).X0))) = _fd
*(*int32)(unsafe.Pointer(&((*XUnixUnusedFd)(_p.X8).X1))) = _flags
}
if _isDelete != 0 {
(*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(16)))).X1)})))(tls, _zName)
}
if _isDelete != 0 {
{
p := &_ctrlFlags
*p = (*p) | i32(32)
sink1 = *p
}
}
if _isReadonly != 0 {
{
p := &_ctrlFlags
*p = (*p) | i32(2)
sink1 = *p
}
}
_noLock = bool2int(_eType != i32(256))
if _noLock != 0 {
{
p := &_ctrlFlags
*p = (*p) | i32(128)
sink1 = *p
}
}
if _syncDir != 0 {
{
p := &_ctrlFlags
*p = (*p) | i32(8)
sink1 = *p
}
}
if (_flags & i32(64)) != 0 {
{
p := &_ctrlFlags
*p = (*p) | i32(64)
sink1 = *p
}
}
_rc = _fillInUnixFile(tls, _pVfs, _fd, _pFile, _zPath, _ctrlFlags)
_open_finished:
if _rc != i32(0) {
Xsqlite3_free(tls, _p.X8)
}
return _rc
_ = _zTmpname
panic(0)
}
var _unixOpenØ00__func__Ø000 [9]int8
func init() {
crt.Xstrncpy(nil, &_unixOpenØ00__func__Ø000[0], str(135253), 9)
}
var _randomnessPid int32
// Search for an unused file descriptor that was opened on the database
// file (not a journal or master-journal file) identified by pathname
// zPath with SQLITE_OPEN_XXX flags matching those passed as the second
// argument to this function.
//
// Such a file descriptor may exist if a database connection was closed
// but the associated file descriptor could not be closed because some
// other file descriptor open on the same file is holding a file-lock.
// Refer to comments in the unixClose() function and the lengthy comment
// describing "Posix Advisory Locking" at the start of this file for
// further details. Also, ticket #4018.
//
// If a suitable file descriptor is found, then it is returned. If no
// such file descriptor is located, -1 is returned.
func _findReusableFd(tls *crt.TLS, _zPath *int8, _flags int32) (r0 *XUnixUnusedFd) {
var _sStat crt.Xstruct_stat64
var _1_pInode *XunixInodeInfo
var _pUnused *XUnixUnusedFd
var _3_pp **XUnixUnusedFd
_pUnused = nil
if i32(0) != (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(4)))).X1)})))(tls, _zPath, &_sStat) {
goto _0
}
_unixEnterMutex(tls)
_1_pInode = _inodeList
_1:
if (_1_pInode != nil) && ((((*TunixFileId)(unsafe.Pointer(&(_1_pInode.X0))).X0) != (_sStat.X0)) || (((*TunixFileId)(unsafe.Pointer(&(_1_pInode.X0))).X1) != (_sStat.X18))) {
_1_pInode = (*XunixInodeInfo)(_1_pInode.X8)
goto _1
}
if _1_pInode == nil {
goto _5
}
_3_pp = (**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_pInode.X7)))))
_6:
if (*_3_pp) == nil || ((*_3_pp).X1) == _flags {
goto _10
}
_3_pp = (**XUnixUnusedFd)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&((*_3_pp).X2)))))
goto _6
_10:
_pUnused = *_3_pp
if _pUnused != nil {
*_3_pp = (*XUnixUnusedFd)(_pUnused.X2)
}
_5:
_unixLeaveMutex(tls)
_0:
return _pUnused
_ = _sStat
panic(0)
}
// This function is called by unixOpen() to determine the unix permissions
// to create new files with. If no error occurs, then SQLITE_OK is returned
// and a value suitable for passing as the third argument to open(2) is
// written to *pMode. If an IO error occurs, an SQLite error code is
// returned and the value of *pMode is not modified.
//
// In most cases, this routine sets *pMode to 0, which will become
// an indication to robust_open() to create the file using
// SQLITE_DEFAULT_FILE_PERMISSIONS adjusted by the umask.
// But if the file being opened is a WAL or regular journal file, then
// this function queries the file-system for the permissions on the
// corresponding database file and sets *pMode to this value. Whenever
// possible, WAL and journal files are created using the same permissions
// as the associated database file.
//
// If the SQLITE_ENABLE_8_3_NAMES option is enabled, then the
// original filename is unavailable. But 8_3_NAMES is only used for
// FAT filesystems and permissions do not matter there, so just use
// the default permissions.
func _findCreateFileMode(tls *crt.TLS, _zPath *int8, _flags int32, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
var _rc, _1_nDb int32
var _4_z *int8
var _1_zDb [513]int8
_rc = i32(0)
*_pMode = uint32(i32(0))
*_pUid = uint32(i32(0))
*_pGid = uint32(i32(0))
if (_flags & i32(526336)) == 0 {
goto _0
}
_1_nDb = _sqlite3Strlen30(tls, _zPath) - i32(1)
_1:
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(_1_nDb)))) != i32(45) {
func() {
if _1_nDb <= i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35497), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000))), unsafe.Pointer(str(135262)))
crt.X__builtin_abort(tls)
}
}()
func() {
if (int32(*(*uint8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_sqlite3CtypeMap)) + 1*uintptr(uint8(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(_1_nDb)))))))) & i32(6)) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35498), unsafe.Pointer((*int8)(unsafe.Pointer(&_findCreateFileModeØ00__func__Ø000))), unsafe.Pointer(str(135268)))
crt.X__builtin_abort(tls)
}
}()
_1_nDb -= 1
goto _1
}
crt.Xmemcpy(tls, (unsafe.Pointer)(&_1_zDb), (unsafe.Pointer)(_zPath), uint32(_1_nDb))
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_1_zDb)) + 1*uintptr(_1_nDb))) = int8(i32(0))
_rc = _getFileMode(tls, (*int8)(unsafe.Pointer(&_1_zDb)), _pMode, _pUid, _pGid)
goto _10
_0:
if (_flags & i32(8)) != 0 {
*_pMode = uint32(i32(384))
goto _10
}
if (_flags & i32(64)) == 0 {
goto _10
}
_4_z = Xsqlite3_uri_parameter(tls, _zPath, str(135295))
if _4_z != nil {
_rc = _getFileMode(tls, _4_z, _pMode, _pUid, _pGid)
}
_10:
return _rc
_ = _1_zDb
panic(0)
}
var _findCreateFileModeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_findCreateFileModeØ00__func__Ø000[0], str(135302), 19)
}
// Find the mode, uid and gid of file zFile.
func _getFileMode(tls *crt.TLS, _zFile *int8, _pMode *uint32, _pUid *uint32, _pGid *uint32) (r0 int32) {
var _rc int32
var _sStat crt.Xstruct_stat64
_rc = i32(0)
if i32(0) == (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(4)))).X1)})))(tls, _zFile, &_sStat) {
*_pMode = (_sStat.X3) & uint32(i32(511))
*_pUid = _sStat.X5
*_pGid = _sStat.X6
goto _1
}
_rc = i32(1802)
_1:
return _rc
_ = _sStat
panic(0)
}
// Initialize the contents of the unixFile structure pointed to by pId.
func _fillInUnixFile(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _h int32, _pId *Xsqlite3_file, _zFilename *int8, _ctrlFlags int32) (r0 int32) {
var _rc, _7_nFilename int32
var _7_zLockFile *int8
var _pLockingStyle *Xsqlite3_io_methods
var _pNew *XunixFile
_pNew = (*XunixFile)(unsafe.Pointer(_pId))
_rc = i32(0)
func() {
if (*XunixInodeInfo)(_pNew.X2) != nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35121), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000))), unsafe.Pointer(str(135321)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _zFilename != nil && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zFilename)) + 1*uintptr(i32(0))))) != i32(47) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35131), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000))), unsafe.Pointer(str(135340)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _zFilename == nil && (_ctrlFlags&i32(128)) == i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35135), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000))), unsafe.Pointer(str(135374)))
crt.X__builtin_abort(tls)
}
}()
*(*int32)(unsafe.Pointer(&(_pNew.X3))) = _h
*(**Xsqlite3_vfs)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X1))))) = _pVfs
*(**int8)(unsafe.Pointer(&(_pNew.X9))) = _zFilename
*(*uint16)(unsafe.Pointer(&(_pNew.X5))) = uint16(uint8(_ctrlFlags))
*(*int64)(unsafe.Pointer(&(_pNew.X15))) = _sqlite3Config.X17
if Xsqlite3_uri_boolean(tls, func() *int8 {
if (_ctrlFlags & i32(64)) != 0 {
return _zFilename
}
return nil
}(), str(135423), i32(1)) != 0 {
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X5)))
*p = uint16(int32(*p) | i32(16))
sink14 = *p
}
}
if crt.Xstrcmp(tls, _pVfs.X4, str(131329)) == i32(0) {
{
p := (*uint16)(unsafe.Pointer(&(_pNew.X5)))
*p = uint16(int32(*p) | i32(1))
sink14 = *p
}
}
if (_ctrlFlags & i32(128)) != 0 {
_pLockingStyle = &_nolockIoMethods
goto _13
}
_pLockingStyle = (*(*func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods)(_pVfs.X5))(tls, _zFilename, _pNew)
_13:
if _pLockingStyle != &_posixIoMethods {
goto _14
}
_unixEnterMutex(tls)
_rc = _findInodeInfo(tls, _pNew, (**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X2))))))
if _rc != i32(0) {
_robust_close(tls, _pNew, _h, i32(35199))
_h = i32(-1)
}
_unixLeaveMutex(tls)
goto _17
_14:
if _pLockingStyle != &_dotlockIoMethods {
goto _17
}
func() {
if _zFilename == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35239), unsafe.Pointer((*int8)(unsafe.Pointer(&_fillInUnixFileØ00__func__Ø000))), unsafe.Pointer(str(135428)))
crt.X__builtin_abort(tls)
}
}()
_7_nFilename = int32(crt.Xstrlen(tls, _zFilename)) + i32(6)
_7_zLockFile = (*int8)(Xsqlite3_malloc64(tls, uint64(_7_nFilename)))
if _7_zLockFile == nil {
_rc = _sqlite3NomemError(tls, i32(35243))
goto _21
}
Xsqlite3_snprintf(tls, _7_nFilename, _7_zLockFile, str(135441), unsafe.Pointer(_zFilename))
_21:
*(*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X7))) = (unsafe.Pointer)(_7_zLockFile)
_17:
_storeLastErrno(tls, _pNew, i32(0))
if _rc == i32(0) {
goto _22
}
if _h >= i32(0) {
_robust_close(tls, _pNew, _h, i32(35284))
}
goto _24
_22:
*(**Xsqlite3_io_methods)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pNew.X0))))) = _pLockingStyle
_verifyDbFile(tls, _pNew)
_24:
return _rc
}
var _fillInUnixFileØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_fillInUnixFileØ00__func__Ø000[0], str(135449), 15)
}
var _nolockIoMethods Xsqlite3_io_methods
func init() {
_nolockIoMethods = Xsqlite3_io_methods{X0: i32(3), X1: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_nolockClose})), X2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixRead})), X3: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixWrite})), X4: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64) int32
}{_unixTruncate})), X5: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixSync})), X6: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int64) int32
}{_unixFileSize})), X7: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_nolockLock})), X8: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_nolockUnlock})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int32) int32
}{_nolockCheckReservedLock})), X10: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
}{_unixFileControl})), X11: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixSectorSize})), X12: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixDeviceCharacteristics})), X13: nil, X14: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
}{_unixShmLock})), X15: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file)
}{_unixShmBarrier})), X16: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixShmUnmap})), X17: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
}{_unixFetch})), X18: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
}{_unixUnfetch}))}
}
// Close the file.
func _nolockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
return _closeUnixFile(tls, _id)
}
func _nolockLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
_ = _NotUsed2
return i32(0)
}
func _nolockUnlock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _NotUsed2 int32) (r0 int32) {
_ = _NotUsed2
return i32(0)
}
func _nolockCheckReservedLock(tls *crt.TLS, _NotUsed *Xsqlite3_file, _pResOut *int32) (r0 int32) {
*_pResOut = i32(0)
return i32(0)
}
// Given a file descriptor, locate the unixInodeInfo object that
// describes that file descriptor. Create a new one if necessary. The
// return value might be uninitialized if an error occurs.
//
// The mutex entered using the unixEnterMutex() function must be held
// when this function is called.
//
// Return an appropriate error code.
func _findInodeInfo(tls *crt.TLS, _pFile *XunixFile, _ppInode **XunixInodeInfo) (r0 int32) {
var _rc, _fd int32
var _statbuf crt.Xstruct_stat64
var _pInode *XunixInodeInfo
var _fileId TunixFileId
_pInode = nil
func() {
if _unixMutexHeld(tls) == 0 {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31154), unsafe.Pointer((*int8)(unsafe.Pointer(&_findInodeInfoØ00__func__Ø000))), unsafe.Pointer(str(132009)))
crt.X__builtin_abort(tls)
}
}()
_fd = _pFile.X3
_rc = (*(*func(*crt.TLS, int32, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(5)))).X1)})))(tls, _fd, &_statbuf)
if _rc != i32(0) {
_storeLastErrno(tls, _pFile, *crt.X__errno_location(tls))
return i32(10)
}
crt.Xmemset(tls, (unsafe.Pointer)(&_fileId), i32(0), u32(16))
*(*uint64)(unsafe.Pointer(&(_fileId.X0))) = _statbuf.X0
*(*uint64)(unsafe.Pointer(&(_fileId.X1))) = _statbuf.X18
_pInode = _inodeList
_3:
if (_pInode != nil) && crt.Xmemcmp(tls, (unsafe.Pointer)(&_fileId), (unsafe.Pointer)((*TunixFileId)(unsafe.Pointer(&(_pInode.X0)))), u32(16)) != 0 {
_pInode = (*XunixInodeInfo)(_pInode.X8)
goto _3
}
if _pInode != nil {
goto _6
}
_pInode = (*XunixInodeInfo)(Xsqlite3_malloc64(tls, uint64(u32(48))))
if _pInode == nil {
return _sqlite3NomemError(tls, i32(31208))
}
crt.Xmemset(tls, (unsafe.Pointer)(_pInode), i32(0), u32(48))
crt.Xmemcpy(tls, (unsafe.Pointer)((*TunixFileId)(unsafe.Pointer(&(_pInode.X0)))), (unsafe.Pointer)(&_fileId), u32(16))
*(*int32)(unsafe.Pointer(&(_pInode.X4))) = i32(1)
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X8))))) = _inodeList
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pInode.X9))))) = nil
if _inodeList != nil {
*(**XunixInodeInfo)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_inodeList.X9))))) = _pInode
}
_inodeList = _pInode
bug20530(_inodeList)
goto _9
_6:
*(*int32)(unsafe.Pointer(&(_pInode.X4))) += 1
_9:
*_ppInode = _pInode
return i32(0)
_ = _fileId
_ = _statbuf
panic(0)
}
var _findInodeInfoØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_findInodeInfoØ00__func__Ø000[0], str(135464), 14)
}
var _dotlockIoMethods Xsqlite3_io_methods
func init() {
_dotlockIoMethods = Xsqlite3_io_methods{X0: i32(1), X1: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_dotlockClose})), X2: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixRead})), X3: *(*func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, unsafe.Pointer, int32, int64) int32
}{_unixWrite})), X4: *(*func(*crt.TLS, unsafe.Pointer, int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64) int32
}{_unixTruncate})), X5: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixSync})), X6: *(*func(*crt.TLS, unsafe.Pointer, *int64) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int64) int32
}{_unixFileSize})), X7: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_dotlockLock})), X8: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_dotlockUnlock})), X9: *(*func(*crt.TLS, unsafe.Pointer, *int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, *int32) int32
}{_dotlockCheckReservedLock})), X10: *(*func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, unsafe.Pointer) int32
}{_unixFileControl})), X11: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixSectorSize})), X12: *(*func(*crt.TLS, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file) int32
}{_unixDeviceCharacteristics})), X13: nil, X14: *(*func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32, int32, int32) int32
}{_unixShmLock})), X15: *(*func(*crt.TLS, unsafe.Pointer))(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file)
}{_unixShmBarrier})), X16: *(*func(*crt.TLS, unsafe.Pointer, int32) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int32) int32
}{_unixShmUnmap})), X17: *(*func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, int32, *unsafe.Pointer) int32
}{_unixFetch})), X18: *(*func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32)(unsafe.Pointer(&struct {
f func(*crt.TLS, *Xsqlite3_file, int64, unsafe.Pointer) int32
}{_unixUnfetch}))}
}
// Close a file. Make sure the lock has been released before closing.
func _dotlockClose(tls *crt.TLS, _id *Xsqlite3_file) (r0 int32) {
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
func() {
if _id == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(32100), unsafe.Pointer((*int8)(unsafe.Pointer(&_dotlockCloseØ00__func__Ø000))), unsafe.Pointer(str(135478)))
crt.X__builtin_abort(tls)
}
}()
_dotlockUnlock(tls, _id, i32(0))
Xsqlite3_free(tls, _pFile.X7)
return _closeUnixFile(tls, _id)
}
var _dotlockCloseØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_dotlockCloseØ00__func__Ø000[0], str(135484), 13)
}
// Lower the locking level on file descriptor pFile to eFileLock. eFileLock
// must be either NO_LOCK or SHARED_LOCK.
//
// If the locking level of the file descriptor is already at or below
// the requested locking level, this routine is a no-op.
//
// When the locking level reaches NO_LOCK, delete the lock file.
func _dotlockUnlock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
var _rc, _3_tErrno int32
var _zLockFile *int8
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_zLockFile = (*int8)(_pFile.X7)
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(32060), unsafe.Pointer((*int8)(unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _eFileLock > i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(32063), unsafe.Pointer((*int8)(unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000))), unsafe.Pointer(str(131853)))
crt.X__builtin_abort(tls)
}
}()
if int32(_pFile.X4) == _eFileLock {
return i32(0)
}
if _eFileLock == i32(1) {
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(1))
return i32(0)
}
func() {
if _eFileLock != i32(0) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(32079), unsafe.Pointer((*int8)(unsafe.Pointer(&_dotlockUnlockØ00__func__Ø000))), unsafe.Pointer(str(135497)))
crt.X__builtin_abort(tls)
}
}()
_rc = (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(19)))).X1)})))(tls, _zLockFile)
if _rc >= i32(0) {
goto _8
}
_3_tErrno = *crt.X__errno_location(tls)
if _3_tErrno == i32(2) {
_rc = i32(0)
goto _10
}
_rc = i32(2058)
_storeLastErrno(tls, _pFile, _3_tErrno)
_10:
return _rc
_8:
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(i32(0))
return i32(0)
}
var _dotlockUnlockØ00__func__Ø000 [14]int8
func init() {
crt.Xstrncpy(nil, &_dotlockUnlockØ00__func__Ø000[0], str(135516), 14)
}
// Lock the file with the lock specified by parameter eFileLock - one
// of the following:
//
// (1) SHARED_LOCK
// (2) RESERVED_LOCK
// (3) PENDING_LOCK
// (4) EXCLUSIVE_LOCK
//
// Sometimes when requesting one lock state, additional lock states
// are inserted in between. The locking might fail on one of the later
// transitions leaving the lock state different from what it started but
// still short of its goal. The following chart shows the allowed
// transitions and the inserted intermediate states:
//
// UNLOCKED -> SHARED
// SHARED -> RESERVED
// SHARED -> (PENDING) -> EXCLUSIVE
// RESERVED -> (PENDING) -> EXCLUSIVE
// PENDING -> EXCLUSIVE
//
// This routine will only increase a lock. Use the sqlite3OsUnlock()
// routine to lower a locking level.
//
// With dotfile locking, we really only support state (4): EXCLUSIVE.
// But we track the other locking levels internally.
func _dotlockLock(tls *crt.TLS, _id *Xsqlite3_file, _eFileLock int32) (r0 int32) {
var _rc, _2_tErrno int32
var _zLockFile *int8
var _pFile *XunixFile
_pFile = (*XunixFile)(unsafe.Pointer(_id))
_zLockFile = (*int8)(_pFile.X7)
_rc = i32(0)
if int32(_pFile.X4) > i32(0) {
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock)
crt.Xutimes(tls, _zLockFile, (*[2]crt.Xstruct_timeval)(unsafe.Pointer(nil)))
return i32(0)
}
_rc = (*(*func(*crt.TLS, *int8, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(18)))).X1)})))(tls, _zLockFile, uint32(i32(511)))
if _rc >= i32(0) {
goto _1
}
_2_tErrno = *crt.X__errno_location(tls)
if i32(17) == _2_tErrno {
_rc = i32(5)
goto _3
}
_rc = _sqliteErrorFromPosixError(tls, _2_tErrno, i32(3850))
if _rc != i32(5) {
_storeLastErrno(tls, _pFile, _2_tErrno)
}
_3:
return _rc
_1:
*(*uint8)(unsafe.Pointer(&(_pFile.X4))) = uint8(_eFileLock)
return _rc
}
// This routine checks if there is a RESERVED lock held on the specified
// file by this or any other process. If such a lock is held, set *pResOut
// to a non-zero value otherwise *pResOut is set to zero. The return value
// is set to SQLITE_OK unless an I/O error occurs during lock checking.
//
// In dotfile locking, either a lock exists or it does not. So in this
// variation of CheckReservedLock(), *pResOut is set to true if any lock
// is held on the file and false if the file is unlocked.
func _dotlockCheckReservedLock(tls *crt.TLS, _id *Xsqlite3_file, _pResOut *int32) (r0 int32) {
var _rc, _reserved int32
var _pFile *XunixFile
_rc = i32(0)
_reserved = i32(0)
_pFile = (*XunixFile)(unsafe.Pointer(_id))
func() {
if _pFile == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(31971), unsafe.Pointer((*int8)(unsafe.Pointer(&_dotlockCheckReservedLockØ00__func__Ø000))), unsafe.Pointer(str(58046)))
crt.X__builtin_abort(tls)
}
}()
_reserved = bool2int((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(2)))).X1)})))(tls, (*int8)(_pFile.X7), i32(0)) == i32(0))
*_pResOut = _reserved
return _rc
}
var _dotlockCheckReservedLockØ00__func__Ø000 [25]int8
func init() {
crt.Xstrncpy(nil, &_dotlockCheckReservedLockØ00__func__Ø000[0], str(135530), 25)
}
// Delete the file at zPath. If the dirSync argument is true, fsync()
// the directory after deleting the file.
func _unixDelete(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _dirSync int32) (r0 int32) {
var _rc, _4_fd int32
_rc = i32(0)
if (*(*func(*crt.TLS, *int8) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(16)))).X1)})))(tls, _zPath) != i32(-1) {
goto _0
}
if (*crt.X__errno_location(tls)) == i32(2) {
_rc = i32(5898)
goto _2
}
_rc = _unixLogErrorAtLine(tls, i32(2570), str(131607), _zPath, i32(35819))
_2:
return _rc
_0:
if (_dirSync & i32(1)) == i32(0) {
goto _3
}
_rc = (*(*func(*crt.TLS, *int8, *int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(17)))).X1)})))(tls, _zPath, &_4_fd)
if _rc != i32(0) {
goto _4
}
if _full_fsync(tls, _4_fd, i32(0), i32(0)) != 0 {
_rc = _unixLogErrorAtLine(tls, i32(1290), str(135555), _zPath, i32(35829))
}
_robust_close(tls, nil, _4_fd, i32(35831))
goto _6
_4:
func() {
if _rc != i32(14) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35833), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixDeleteØ00__func__Ø000))), unsafe.Pointer(str(132437)))
crt.X__builtin_abort(tls)
}
}()
_rc = i32(0)
_6:
_3:
return _rc
}
var _unixDeleteØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_unixDeleteØ00__func__Ø000[0], str(135561), 11)
}
// Test the existence of or access permissions of file zPath. The
// test performed depends on the value of flags:
//
// SQLITE_ACCESS_EXISTS: Return 1 if the file exists
// SQLITE_ACCESS_READWRITE: Return 1 if the file is read and writable.
// SQLITE_ACCESS_READONLY: Return 1 if the file is readable.
//
// Otherwise return 0.
func _unixAccess(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zPath *int8, _flags int32, _pResOut *int32) (r0 int32) {
var _1_buf crt.Xstruct_stat64
func() {
if _pResOut == nil {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35859), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixAccessØ00__func__Ø000))), unsafe.Pointer(str(135572)))
crt.X__builtin_abort(tls)
}
}()
func() {
if _flags != i32(0) && _flags != i32(1) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35863), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixAccessØ00__func__Ø000))), unsafe.Pointer(str(135583)))
crt.X__builtin_abort(tls)
}
}()
if _flags == i32(0) {
*_pResOut = bool2int((i32(0) == (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(4)))).X1)})))(tls, _zPath, &_1_buf)) && ((_1_buf.X9) > int64(i32(0))))
goto _7
}
*_pResOut = bool2int((*(*func(*crt.TLS, *int8, int32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(2)))).X1)})))(tls, _zPath, i32(6)) == i32(0))
_7:
return i32(0)
_ = _1_buf
panic(0)
}
var _unixAccessØ00__func__Ø000 [11]int8
func init() {
crt.Xstrncpy(nil, &_unixAccessØ00__func__Ø000[0], str(135645), 11)
}
// Turn a relative pathname into a full pathname. The relative path
// is stored as a nul-terminated string in the buffer pointed to by
// zPath.
//
// zOut points to a buffer of at least sqlite3_vfs.mxPathname bytes
// (in this case, MAX_PATHNAME bytes). The full-path is written to
// this buffer before returning.
func _unixFullPathname(tls *crt.TLS, _pVfs *Xsqlite3_vfs, _zPath *int8, _nOut int32, _zOut *int8) (r0 int32) {
var _rc, _nByte, _nLink, _1_bLink, _11_n int32
var _zIn, _zDel *int8
var _1_buf crt.Xstruct_stat64
_rc = i32(0)
_nLink = i32(1)
_zIn = _zPath
_zDel = nil
func() {
if (_pVfs.X2) != i32(512) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35925), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000))), unsafe.Pointer(str(135656)))
crt.X__builtin_abort(tls)
}
}()
_2:
_1_bLink = i32(0)
if (*(*func(*crt.TLS, *int8, *crt.Xstruct_stat64) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(27)))).X1)})))(tls, _zIn, &_1_buf) == i32(0) {
goto _3
}
if (*crt.X__errno_location(tls)) != i32(2) {
_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35943)), str(131695), _zIn, i32(35943))
}
goto _5
_3:
_1_bLink = bool2int(((_1_buf.X3) & uint32(i32(61440))) == uint32(i32(40960)))
_5:
if _1_bLink == 0 {
goto _6
}
if _zDel != nil {
goto _7
}
_zDel = (*int8)(Xsqlite3_malloc(tls, _nOut))
if _zDel == nil {
_rc = _sqlite3NomemError(tls, i32(35952))
}
goto _10
_7:
if preInc1(&_nLink, 1) > i32(100) {
_rc = _sqlite3CantopenError(tls, i32(35954))
}
_10:
if _rc != i32(0) {
goto _11
}
_nByte = (*(*func(*crt.TLS, *int8, *int8, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(26)))).X1)})))(tls, _zIn, _zDel, uint32(_nOut-i32(1)))
if _nByte < i32(0) {
_rc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35960)), str(131686), _zIn, i32(35960))
goto _13
}
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel)) + 1*uintptr(i32(0))))) == i32(47) {
goto _14
}
_11_n = _sqlite3Strlen30(tls, _zIn)
_15:
if _11_n <= i32(0) || int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(_11_n-i32(1))))) == i32(47) {
goto _19
}
_11_n -= 1
goto _15
_19:
if ((_nByte + _11_n) + i32(1)) > _nOut {
_rc = _sqlite3CantopenError(tls, i32(35966))
goto _21
}
crt.Xmemmove(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel))+1*uintptr(_11_n)))), (unsafe.Pointer)(_zDel), uint32(_nByte+i32(1)))
crt.Xmemcpy(tls, (unsafe.Pointer)(_zDel), (unsafe.Pointer)(_zIn), uint32(_11_n))
{
p := &_nByte
*p = (*p) + _11_n
sink1 = *p
}
_21:
_14:
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zDel)) + 1*uintptr(_nByte))) = int8(i32(0))
_13:
_11:
_zIn = _zDel
_6:
func() {
if _rc == i32(0) && _zIn == _zOut && int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zIn)) + 1*uintptr(i32(0))))) != i32(47) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(35980), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixFullPathnameØ00__func__Ø000))), unsafe.Pointer(str(135687)))
crt.X__builtin_abort(tls)
}
}()
if (_rc == i32(0)) && (_zIn != _zOut) {
_rc = _mkFullPathname(tls, _zIn, _zOut, _nOut)
}
if _1_bLink == i32(0) {
goto _29
}
_zIn = _zOut
if _rc == i32(0) {
goto _2
}
_29:
Xsqlite3_free(tls, (unsafe.Pointer)(_zDel))
return _rc
_ = _nLink
_ = _1_buf
panic(0)
}
var _unixFullPathnameØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_unixFullPathnameØ00__func__Ø000[0], str(135729), 17)
}
//
func _mkFullPathname(tls *crt.TLS, _zPath *int8, _zOut *int8, _nOut int32) (r0 int32) {
var _nPath, _iOff int32
_nPath = _sqlite3Strlen30(tls, _zPath)
_iOff = i32(0)
if int32(*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zPath)) + 1*uintptr(i32(0))))) == i32(47) {
goto _0
}
if (*(*func(*crt.TLS, *int8, uint32) *int8)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(3)))).X1)})))(tls, _zOut, uint32(_nOut-i32(2))) == nil {
return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, i32(35886)), str(131515), _zPath, i32(35886))
}
_iOff = _sqlite3Strlen30(tls, _zOut)
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(postInc1(&_iOff, int32(1))))) = int8(i32(47))
_0:
if ((_iOff + _nPath) + i32(1)) > _nOut {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut)) + 1*uintptr(_iOff))) = int8(i32(0))
return _sqlite3CantopenError(tls, i32(35895))
}
Xsqlite3_snprintf(tls, _nOut-_iOff, (*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zOut))+1*uintptr(_iOff))), str(24576), unsafe.Pointer(_zPath))
return i32(0)
}
func _unixDlOpen(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _zFilename *int8) (r0 unsafe.Pointer) {
return crt.Xdlopen(tls, _zFilename, i32(258))
}
// SQLite calls this function immediately after a call to unixDlSym() or
// unixDlOpen() fails (returns a null pointer). If a more detailed error
// message is available, it is written to zBufOut. If no error message
// is available, zBufOut is left unmodified and SQLite uses a default
// error message.
func _unixDlError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBufOut *int8) {
var _zErr *int8
_unixEnterMutex(tls)
_zErr = crt.Xdlerror(tls)
if _zErr != nil {
Xsqlite3_snprintf(tls, _nBuf, _zBufOut, str(24576), unsafe.Pointer(_zErr))
}
_unixLeaveMutex(tls)
}
func _unixDlSym(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _p unsafe.Pointer, _zSym *int8) (r0 func(*crt.TLS)) {
var _x func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
_x = *(*func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS))(unsafe.Pointer(&struct {
f func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer
}{(crt.Xdlsym)}))
return _x(tls, _p, _zSym)
}
func _unixDlClose(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _pHandle unsafe.Pointer) {
crt.Xdlclose(tls, _pHandle)
}
// Write nBuf bytes of random data to the supplied buffer zBuf.
func _unixRandomness(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _nBuf int32, _zBuf *int8) (r0 int32) {
var _1_fd, _1_got, _2_t int32
func() {
if uint32(_nBuf) < u32(8) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(36061), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRandomnessØ00__func__Ø000))), unsafe.Pointer(str(135746)))
crt.X__builtin_abort(tls)
}
}()
crt.Xmemset(tls, (unsafe.Pointer)(_zBuf), i32(0), uint32(_nBuf))
_randomnessPid = crt.Xgetpid(tls)
bug20530(_randomnessPid)
_1_fd = _robust_open(tls, str(135789), i32(0), uint32(i32(0)))
if _1_fd < i32(0) {
crt.Xtime(tls, &_2_t)
crt.Xmemcpy(tls, (unsafe.Pointer)(_zBuf), (unsafe.Pointer)(&_2_t), u32(4))
crt.Xmemcpy(tls, (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_zBuf))+1*uintptr(u32(4))))), (unsafe.Pointer)(&_randomnessPid), u32(4))
func() {
if u32(8) > uint32(_nBuf) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(36086), unsafe.Pointer((*int8)(unsafe.Pointer(&_unixRandomnessØ00__func__Ø000))), unsafe.Pointer(str(135802)))
crt.X__builtin_abort(tls)
}
}()
_nBuf = int32(u32(8))
goto _5
}
_6:
_1_got = (*(*func(*crt.TLS, int32, unsafe.Pointer, uint32) int32)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(i32(8)))).X1)})))(tls, _1_fd, (unsafe.Pointer)(_zBuf), uint32(_nBuf))
if (_1_got < i32(0)) && ((*crt.X__errno_location(tls)) == i32(4)) {
goto _6
}
_robust_close(tls, nil, _1_fd, i32(36090))
_5:
return _nBuf
_ = _2_t
panic(0)
}
var _unixRandomnessØ00__func__Ø000 [15]int8
func init() {
crt.Xstrncpy(nil, &_unixRandomnessØ00__func__Ø000[0], str(135848), 15)
}
// Sleep for a little while. Return the amount of time slept.
// The argument is the number of microseconds we want to sleep.
// The return value is the number of microseconds of sleep actually
// requested from the underlying operating system, a number which
// might be greater than or equal to the argument, but not less
// than the argument.
func _unixSleep(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _microseconds int32) (r0 int32) {
crt.Xusleep(tls, uint32(_microseconds))
return _microseconds
}
// Find the current time (in Universal Coordinated Time). Write the
// current time and date as a Julian Day number into *prNow and
// return 0. Return 1 if the time and date cannot be found.
func _unixCurrentTime(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _prNow *float64) (r0 int32) {
var _rc int32
var _i int64
_i = i64(0)
_rc = _unixCurrentTimeInt64(tls, nil, &_i)
*_prNow = float64(_i) / (8.64e+07)
return _rc
}
// Find the current time (in Universal Coordinated Time). Write into *piNow
// the current time and date as a Julian Day number times 86_400_000. In
// other words, write into *piNow the number of milliseconds since the Julian
// epoch of noon in Greenwich on November 24, 4714 B.C according to the
// proleptic Gregorian calendar.
//
// On success, return SQLITE_OK. Return SQLITE_ERROR if the time and date
// cannot be found.
func _unixCurrentTimeInt64(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _piNow *int64) (r0 int32) {
var _rc int32
var _sNow crt.Xstruct_timeval
_rc = i32(0)
crt.Xgettimeofday(tls, &_sNow, nil)
*_piNow = (_unixCurrentTimeInt64Ø00unixEpochØ001 + (int64(i32(1000)) * int64(_sNow.X0))) + int64((_sNow.X1)/i32(1000))
return _rc
_ = _sNow
panic(0)
}
var _unixCurrentTimeInt64Ø00unixEpochØ001 int64
func init() {
_unixCurrentTimeInt64Ø00unixEpochØ001 = i64(210866760000000)
}
// The xGetLastError() method is designed to return a better
// low-level error message when operating-system problems come up
// during SQLite operation. Only the integer return code is currently
// used.
func _unixGetLastError(tls *crt.TLS, _NotUsed *Xsqlite3_vfs, _NotUsed2 int32, _NotUsed3 *int8) (r0 int32) {
return *crt.X__errno_location(tls)
}
// This is the xSetSystemCall() method of sqlite3_vfs for all of the
// "unix" VFSes. Return SQLITE_OK opon successfully updating the
// system call pointer, or SQLITE_NOTFOUND if there is no configurable
// system call named zName.
func _unixSetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8, _pNewFunc func(*crt.TLS)) (r0 int32) {
var _rc int32
var _i uint32
_rc = i32(12)
if _zName != nil {
goto _0
}
_rc = i32(0)
_i = uint32(i32(0))
_1:
if _i >= u32(28) {
goto _4
}
if ((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X2) != nil {
*(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X1))) = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X2
}
_i += 1
goto _1
_4:
goto _6
_0:
_i = uint32(i32(0))
_7:
if _i >= u32(28) {
goto _10
}
if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+12*uintptr(_i))).X0) != i32(0) {
goto _11
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X2)})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) {
*(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X2))) = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X1
}
_rc = i32(0)
if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{_pNewFunc})) == *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) {
_pNewFunc = (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X2
}
*(*func(*crt.TLS))(unsafe.Pointer(&((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X1))) = _pNewFunc
goto _10
_11:
_i += 1
goto _7
_10:
_6:
return _rc
}
// Return the value of a system call. Return NULL if zName is not a
// recognized system call name. NULL is also returned if the system call
// is currently undefined.
func _unixGetSystemCall(tls *crt.TLS, _pNotUsed *Xsqlite3_vfs, _zName *int8) (r0 func(*crt.TLS)) {
var _i uint32
_i = uint32(i32(0))
_0:
if _i >= u32(28) {
goto _3
}
if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+12*uintptr(_i))).X0) == i32(0) {
return (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X1
}
_i += 1
goto _0
_3:
return nil
}
// Return the name of the first system call after zName. If zName==NULL
// then return the name of the first system call. Return NULL if zName
// is the last system call or if zName is not the name of a valid
// system call.
func _unixNextSystemCall(tls *crt.TLS, _p *Xsqlite3_vfs, _zName *int8) (r0 *int8) {
var _i int32
_i = i32(-1)
if _zName == nil {
goto _0
}
_i = i32(0)
_1:
if _i >= i32(27) {
goto _4
}
if crt.Xstrcmp(tls, _zName, (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall))+12*uintptr(_i))).X0) == i32(0) {
goto _4
}
_i += 1
goto _1
_4:
_0:
_i += 1
_6:
if _i >= i32(28) {
goto _9
}
if *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{((*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X1)})) != *(*unsafe.Pointer)(unsafe.Pointer(&struct{ f func(*crt.TLS) }{nil})) {
return (*Tunix_syscall)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aSyscall)) + 12*uintptr(_i))).X0
}
_i += 1
goto _6
_9:
return nil
}
var _nolockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
func init() {
_nolockIoFinder = _nolockIoFinderImpl
}
func _nolockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
return &_nolockIoMethods
}
var _dotlockIoFinder func(*crt.TLS, *int8, *XunixFile) *Xsqlite3_io_methods
func init() {
_dotlockIoFinder = _dotlockIoFinderImpl
}
func _dotlockIoFinderImpl(tls *crt.TLS, _z *int8, _p *XunixFile) (r0 *Xsqlite3_io_methods) {
return &_dotlockIoMethods
}
// This function is called during initialization if a static buffer is
// supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE
// verb to sqlite3_config(). Parameter pBuf points to an allocation large
// enough to contain 'n' buffers of 'sz' bytes each.
//
// This routine is called from sqlite3_initialize() and so it is guaranteed
// to be serialized already. There is no need for further mutexing.
func _sqlite3PCacheBufferSetup(tls *crt.TLS, _pBuf unsafe.Pointer, _sz int32, _n int32) {
var _1_p *Xsqlite3_file
if (_pcache1_g.X1) == 0 {
goto _0
}
if _pBuf == nil {
_sz = store1(&_n, i32(0))
}
_sz = _sz & i32(-8)
*(*int32)(unsafe.Pointer(&(_pcache1_g.X4))) = _sz
*(*int32)(unsafe.Pointer(&(_pcache1_g.X5))) = store1((*int32)(unsafe.Pointer(&(_pcache1_g.X11))), _n)
*(*int32)(unsafe.Pointer(&(_pcache1_g.X6))) = func() int32 {
if _n > i32(90) {
return i32(10)
}
return ((_n / i32(10)) + i32(1))
}()
*(*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X7))) = _pBuf
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = nil
*(*int32)(unsafe.Pointer(&(_pcache1_g.X12))) = i32(0)
_4:
if postInc1(&_n, int32(-1)) != 0 {
_1_p = (*Xsqlite3_file)(_pBuf)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_1_p.X0))))) = (*Xsqlite3_file)(_pcache1_g.X10)
*(**Xsqlite3_file)(unsafe.Pointer((*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X10))))) = _1_p
_pBuf = (unsafe.Pointer)((*int8)(unsafe.Pointer(uintptr(_pBuf) + 1*uintptr(_sz))))
goto _4
}
*(*unsafe.Pointer)(unsafe.Pointer(&(_pcache1_g.X8))) = _pBuf
_0:
}
var _sqlite3_initializeØ00__func__Ø000 [19]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_initializeØ00__func__Ø000[0], str(135863), 19)
}
var _enlargeAndAppendØ00__func__Ø000 [17]int8
func init() {
crt.Xstrncpy(nil, &_enlargeAndAppendØ00__func__Ø000[0], str(135882), 17)
}
// Extra argument values from a PrintfArguments object
func _getIntArg(tls *crt.TLS, _p *XPrintfArguments) (r0 int64) {
if (_p.X0) <= (_p.X1) {
return int64(i32(0))
}
return Xsqlite3_value_int64(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1))))))
}
var _sqlite3VXPrintfØ00__func__Ø000 [16]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00__func__Ø000[0], str(135899), 16)
}
var _fmtinfo [23]Xet_info
func init() {
_fmtinfo = [23]Xet_info{Xet_info{X0: i8(100), X1: u8(10), X2: u8(1), X3: u8(16), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(115), X1: u8(0), X2: u8(4), X3: u8(5), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(103), X1: u8(0), X2: u8(1), X3: u8(3), X4: u8(30), X5: u8(0)}, Xet_info{X0: i8(122), X1: u8(0), X2: u8(4), X3: u8(6), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(113), X1: u8(0), X2: u8(4), X3: u8(9), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(81), X1: u8(0), X2: u8(4), X3: u8(10), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(119), X1: u8(0), X2: u8(4), X3: u8(14), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(99), X1: u8(0), X2: u8(0), X3: u8(8), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(111), X1: u8(8), X2: u8(0), X3: u8(0), X4: u8(0), X5: u8(2)}, Xet_info{X0: i8(117), X1: u8(10), X2: u8(0), X3: u8(16), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(120), X1: u8(16), X2: u8(0), X3: u8(0), X4: u8(16), X5: u8(1)}, Xet_info{X0: i8(88), X1: u8(16), X2: u8(0), X3: u8(0), X4: u8(0), X5: u8(4)}, Xet_info{X0: i8(102), X1: u8(0), X2: u8(1), X3: u8(1), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(101), X1: u8(0), X2: u8(1), X3: u8(2), X4: u8(30), X5: u8(0)}, Xet_info{X0: i8(69), X1: u8(0), X2: u8(1), X3: u8(2), X4: u8(14), X5: u8(0)}, Xet_info{X0: i8(71), X1: u8(0), X2: u8(1), X3: u8(3), X4: u8(14), X5: u8(0)}, Xet_info{X0: i8(105), X1: u8(10), X2: u8(1), X3: u8(16), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(110), X1: u8(0), X2: u8(0), X3: u8(4), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(37), X1: u8(0), X2: u8(0), X3: u8(7), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(112), X1: u8(16), X2: u8(0), X3: u8(13), X4: u8(0), X5: u8(1)}, Xet_info{X0: i8(84), X1: u8(0), X2: u8(0), X3: u8(11), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(83), X1: u8(0), X2: u8(0), X3: u8(12), X4: u8(0), X5: u8(0)}, Xet_info{X0: i8(114), X1: u8(10), X2: u8(1), X3: u8(15), X4: u8(0), X5: u8(0)}}
}
var _sqlite3VXPrintfØ00zOrdØ001 [9]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3VXPrintfØ00zOrdØ001[0], str(135915), 9)
}
var _aDigits [33]int8
func init() {
crt.Xstrncpy(nil, &_aDigits[0], str(135924), 33)
}
var _aPrefix [7]int8
func init() {
crt.Xstrncpy(nil, &_aPrefix[0], str(135957), 7)
}
func _getDoubleArg(tls *crt.TLS, _p *XPrintfArguments) (r0 float64) {
if (_p.X0) <= (_p.X1) {
return float64(0)
}
return Xsqlite3_value_double(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1))))))
}
// "*val" is a double such that 0.1 <= *val < 10.0
// Return the ascii code for the leading digit of *val, then
// multiply "*val" by 10.0 to renormalize.
//
// Example:
// input: *val = 3.14159
// output: *val = 1.4159 function return = '3'
//
// The counter *cnt is incremented each time. After counter exceeds
// 16 (the number of significant digits in a 64-bit float) '0' is
// always returned.
func _et_getdigit(tls *crt.TLS, _val *float64, _cnt *int32) (r0 int8) {
var _digit int32
var _d float64
if (*_cnt) <= i32(0) {
return int8(i32(48))
}
*_cnt -= 1
_digit = int32(*_val)
_d = float64(_digit)
{
p := &_digit
*p = (*p) + i32(48)
sink1 = *p
}
*_val = ((*_val) - _d) * float64(10)
return int8(_digit)
}
func _getTextArg(tls *crt.TLS, _p *XPrintfArguments) (r0 *int8) {
if (_p.X0) <= (_p.X1) {
return nil
}
return (*int8)(unsafe.Pointer(Xsqlite3_value_text(tls, *(**XMem)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 4*uintptr(postInc1((*int32)(unsafe.Pointer(&(_p.X1))), int32(1))))))))
}
// Append N copies of character c to the given string buffer.
func _sqlite3AppendChar(tls *crt.TLS, _p *XStrAccum, _N int32, _c int8) {
if ((int64(_p.X3) + int64(_N)) >= int64(_p.X4)) && (store1(&_N, _sqlite3StrAccumEnlarge(tls, _p, _N)) <= i32(0)) {
return
}
func() {
if ((_p.X2) == (_p.X1)) != ((int32(_p.X7) & i32(4)) == i32(0)) {
crt.X__builtin_fprintf(tls, Xstderr, str(1), unsafe.Pointer(str(37)), i32(25886), unsafe.Pointer((*int8)(unsafe.Pointer(&_sqlite3AppendCharØ00__func__Ø000))), unsafe.Pointer(str(6554)))
crt.X__builtin_abort(tls)
}
}()
_4:
if postInc1(&_N, int32(-1)) > i32(0) {
*(*int8)(unsafe.Pointer(uintptr((unsafe.Pointer)(_p.X2)) + 1*uintptr(postInc5((*uint32)(unsafe.Pointer(&(_p.X3))), uint32(1))))) = _c
goto _4
}
}
var _sqlite3AppendCharØ00__func__Ø000 [18]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3AppendCharØ00__func__Ø000[0], str(135964), 18)
}
var _sqlite3_execØ00__func__Ø000 [13]int8
func init() {
crt.Xstrncpy(nil, &_sqlite3_execØ00__func__Ø000[0], str(135982), 13)
}
// Enable or disable extension loading. Extension loading is disabled by
// default so as not to open security holes in older applications.
func Xsqlite3_enable_load_extension(tls *crt.TLS, _db *Xsqlite3, _onoff int32) (r0 int32) {
Xsqlite3_mutex_enter(tls, (*Xsqlite3_mutex)(_db.X3))
if _onoff != 0 {
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) | i32(12582912)
sink1 = *p
}
goto _1
}
{
p := (*int32)(unsafe.Pointer(&(_db.X6)))
*p = (*p) & i32(-12582913)
sink1 = *p
}
_1:
Xsqlite3_mutex_leave(tls, (*Xsqlite3_mutex)(_db.X3))
return i32(0)
}
func bool2int(b bool) int32 {
if b {
return 1
}
return 0
}
func bug20530(interface{}) {} //TODO remove when https://github.com/golang/go/issues/20530 is fixed.
func i16(n int16) int16 { return n }
func i32(n int32) int32 { return n }
func i64(n int64) int64 { return n }
func i8(n int8) int8 { return n }
func init() { nzf32 *= -1; nzf64 *= -1 }
func u16(n uint16) uint16 { return n }
func u32(n uint32) uint32 { return n }
func u64(n uint64) uint64 { return n }
func u8(n byte) byte { return n }
var inf = math.Inf(1)
var nzf32 float32 // -0.0
var nzf64 float64 // -0.0
var sink68 **XWhereLoop //TODO report GC bug
var sink0 *int8 //TODO report GC bug
var sink32 *XCollSeq //TODO report GC bug
var sink71 *TInLoop //TODO report GC bug
var sink34 *XyyStackEntry //TODO report GC bug
var sink20 *XMem //TODO report GC bug
var sink31 *uint32 //TODO report GC bug
var sink13 *uint8 //TODO report GC bug
var sink4 float64 //TODO report GC bug
var sink18 int16 //TODO report GC bug
var sink1 int32 //TODO report GC bug
var sink6 int64 //TODO report GC bug
var sink14 uint16 //TODO report GC bug
var sink5 uint32 //TODO report GC bug
var sink17 uint64 //TODO report GC bug
var sink2 uint8 //TODO report GC bug
func postInc72(p **int16, d int) *int16 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*int16)(unsafe.Pointer(v))
}
func postInc0(p **int8, d int) *int8 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*int8)(unsafe.Pointer(v))
}
func postInc57(p **TRowSetEntry, d int) *TRowSetEntry {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*TRowSetEntry)(unsafe.Pointer(v))
}
func postInc34(p **XyyStackEntry, d int) *XyyStackEntry {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*XyyStackEntry)(unsafe.Pointer(v))
}
func postInc20(p **XMem, d int) *XMem {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*XMem)(unsafe.Pointer(v))
}
func postInc31(p **uint32, d int) *uint32 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*uint32)(unsafe.Pointer(v))
}
func postInc13(p **uint8, d int) *uint8 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q
*q += uintptr(d)
return (*uint8)(unsafe.Pointer(v))
}
func postInc1(p *int32, d int32) int32 { v := *p; *p += d; return v }
func postInc6(p *int64, d int64) int64 { v := *p; *p += d; return v }
func postInc3(p *int8, d int8) int8 { v := *p; *p += d; return v }
func postInc14(p *uint16, d uint16) uint16 { v := *p; *p += d; return v }
func postInc5(p *uint32, d uint32) uint32 { v := *p; *p += d; return v }
func postInc2(p *uint8, d uint8) uint8 { v := *p; *p += d; return v }
func preInc0(p **int8, d int) *int8 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q + uintptr(d)
*q = v
return (*int8)(unsafe.Pointer(v))
}
func preInc20(p **XMem, d int) *XMem {
q := (*uintptr)(unsafe.Pointer(p))
v := *q + uintptr(d)
*q = v
return (*XMem)(unsafe.Pointer(v))
}
func preInc13(p **uint8, d int) *uint8 {
q := (*uintptr)(unsafe.Pointer(p))
v := *q + uintptr(d)
*q = v
return (*uint8)(unsafe.Pointer(v))
}
func preInc18(p *int16, d int16) int16 { v := *p + d; *p = v; return v }
func preInc1(p *int32, d int32) int32 { v := *p + d; *p = v; return v }
func preInc14(p *uint16, d uint16) uint16 { v := *p + d; *p = v; return v }
func preInc5(p *uint32, d uint32) uint32 { v := *p + d; *p = v; return v }
func preInc2(p *uint8, d uint8) uint8 { v := *p + d; *p = v; return v }
func storebits18(p *int16, v int16, m uint64, o uint) int16 {
*p = *p&^int16(m) | (v << o & int16(m))
return v
}
func storebits3(p *int8, v int8, m uint64, o uint) int8 {
*p = *p&^int8(m) | (v << o & int8(m))
return v
}
func store49(p *func(*crt.TLS, *Xsqlite3_vtab) int32, v func(*crt.TLS, *Xsqlite3_vtab) int32) func(*crt.TLS, *Xsqlite3_vtab) int32 {
*p = v
return v
}
func store0(p **int8, v *int8) *int8 { *p = v; return v }
func store69(p **XIndex, v *XIndex) *XIndex { *p = v; return v }
func store30(p **XColumn, v *XColumn) *XColumn { *p = v; return v }
func store44(p **XTable, v *XTable) *XTable { *p = v; return v }
func store74(p **XFKey, v *XFKey) *XFKey { *p = v; return v }
func store25(p **XPgHdr, v *XPgHdr) *XPgHdr { *p = v; return v }
func store38(p **TVdbe, v *TVdbe) *TVdbe { *p = v; return v }
func store65(p **XWhereTerm, v *XWhereTerm) *XWhereTerm { *p = v; return v }
func store55(p **XIncrMerger, v *XIncrMerger) *XIncrMerger { *p = v; return v }
func store51(p **XUnpackedRecord, v *XUnpackedRecord) *XUnpackedRecord { *p = v; return v }
func store26(p **Xsqlite3_backup, v *Xsqlite3_backup) *Xsqlite3_backup { *p = v; return v }
func store54(p **XBtree, v *XBtree) *XBtree { *p = v; return v }
func store24(p **XFileChunk, v *XFileChunk) *XFileChunk { *p = v; return v }
func store75(p **XSubProgram, v *XSubProgram) *XSubProgram { *p = v; return v }
func store59(p **XSelect, v *XSelect) *XSelect { *p = v; return v }
func store8(p **Xsqlite3_file, v *Xsqlite3_file) *Xsqlite3_file { *p = v; return v }
func store56(p **XMergeEngine, v *XMergeEngine) *XMergeEngine { *p = v; return v }
func store42(p **XExprList, v *XExprList) *XExprList { *p = v; return v }
func store60(p **XSrcList, v *XSrcList) *XSrcList { *p = v; return v }
func store57(p **TRowSetEntry, v *TRowSetEntry) *TRowSetEntry { *p = v; return v }
func store33(p **XFuncDef, v *XFuncDef) *XFuncDef { *p = v; return v }
func store64(p **XWhereOrInfo, v *XWhereOrInfo) *XWhereOrInfo { *p = v; return v }
func store10(p **XPgHdr1, v *XPgHdr1) *XPgHdr1 { *p = v; return v }
func store50(p **XKeyInfo, v *XKeyInfo) *XKeyInfo { *p = v; return v }
func store67(p **XWhereLoop, v *XWhereLoop) *XWhereLoop { *p = v; return v }
func store40(p **XVdbeOp, v *XVdbeOp) *XVdbeOp { *p = v; return v }
func store36(p **XExpr, v *XExpr) *XExpr { *p = v; return v }
func store53(p **XVdbeCursor, v *XVdbeCursor) *XVdbeCursor { *p = v; return v }
func store76(p **XTriggerStep, v *XTriggerStep) *XTriggerStep { *p = v; return v }
func store52(p **XMemPage, v *XMemPage) *XMemPage { *p = v; return v }
func store20(p **XMem, v *XMem) *XMem { *p = v; return v }
func store11(p *unsafe.Pointer, v unsafe.Pointer) unsafe.Pointer { *p = v; return v }
func store13(p **uint8, v *uint8) *uint8 { *p = v; return v }
func store1(p *int32, v int32) int32 { *p = v; return v }
func store6(p *int64, v int64) int64 { *p = v; return v }
func store3(p *int8, v int8) int8 { *p = v; return v }
func store14(p *uint16, v uint16) uint16 { *p = v; return v }
func store5(p *uint32, v uint32) uint32 { *p = v; return v }
func store17(p *uint64, v uint64) uint64 { *p = v; return v }
func store2(p *uint8, v uint8) uint8 { *p = v; return v }
type Xva_list struct{ X0 struct{} } // t81 struct{struct{}}
type TSqlite3Config struct {
X0 int32
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 int32
X8 int32
X9 int32
X10 struct {
X0 func(*crt.TLS, int32) unsafe.Pointer
X1 func(*crt.TLS, unsafe.Pointer)
X2 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer) int32
X4 func(*crt.TLS, int32) int32
X5 func(*crt.TLS, unsafe.Pointer) int32
X6 func(*crt.TLS, unsafe.Pointer)
X7 unsafe.Pointer
}
X11 struct {
X0 func(*crt.TLS) int32
X1 func(*crt.TLS) int32
X2 func(*crt.TLS, int32) unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer)
X4 func(*crt.TLS, unsafe.Pointer)
X5 func(*crt.TLS, unsafe.Pointer) int32
X6 func(*crt.TLS, unsafe.Pointer)
X7 func(*crt.TLS, unsafe.Pointer) int32
X8 func(*crt.TLS, unsafe.Pointer) int32
}
X12 struct {
X0 int32
X1 unsafe.Pointer
X2 func(*crt.TLS, unsafe.Pointer) int32
X3 func(*crt.TLS, unsafe.Pointer)
X4 func(*crt.TLS, int32, int32, int32) unsafe.Pointer
X5 func(*crt.TLS, unsafe.Pointer, int32)
X6 func(*crt.TLS, unsafe.Pointer) int32
X7 func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
X8 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
X9 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32)
X10 func(*crt.TLS, unsafe.Pointer, uint32)
X11 func(*crt.TLS, unsafe.Pointer)
X12 func(*crt.TLS, unsafe.Pointer)
}
X13 unsafe.Pointer
X14 int32
X15 int32
X16 int32
X17 int64
X18 int64
X19 unsafe.Pointer
X20 int32
X21 int32
X22 unsafe.Pointer
X23 int32
X24 int32
X25 int32
X26 int32
X27 uint32
X28 int32
X29 int32
X30 int32
X31 int32
X32 int32
X33 int32
X34 unsafe.Pointer
X35 func(*crt.TLS, unsafe.Pointer, int32, *int8)
X36 unsafe.Pointer
X37 func(*crt.TLS, int32) int32
X38 int32
X39 int32
} // t82 struct{int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,struct{*func(int32)*struct{},*func(*struct{}),*func(*struct{},int32)*struct{},*func(*struct{})int32,*func(int32)int32,*func(*struct{})int32,*func(*struct{}),*struct{}},struct{*func()int32,*func()int32,*func(int32)*struct{},*func(*struct{}),*func(*struct{}),*func(*struct{})int32,*func(*struct{}),*func(*struct{})int32,*func(*struct{})int32},struct{int32,*struct{},*func(*struct{})int32,*func(*struct{}),*func(int32,int32,int32)*struct{},*func(*struct{},int32),*func(*struct{})int32,*func(*struct{},uint32,int32)*struct{},*func(*struct{},*struct{},int32),*func(*struct{},*struct{},uint32,uint32),*func(*struct{},uint32),*func(*struct{}),*func(*struct{})},*struct{},int32,int32,int32,int64,int64,*struct{},int32,int32,*struct{},int32,int32,int32,int32,uint32,int32,int32,int32,int32,int32,int32,*struct{},*func(*struct{},int32,*int8),*struct{},*func(int32)int32,int32,int32}
type Xsqlite3_mem_methods struct {
X0 func(*crt.TLS, int32) unsafe.Pointer
X1 func(*crt.TLS, unsafe.Pointer)
X2 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer) int32
X4 func(*crt.TLS, int32) int32
X5 func(*crt.TLS, unsafe.Pointer) int32
X6 func(*crt.TLS, unsafe.Pointer)
X7 unsafe.Pointer
} // t83 struct{*func(int32)*struct{},*func(*struct{}),*func(*struct{},int32)*struct{},*func(*struct{})int32,*func(int32)int32,*func(*struct{})int32,*func(*struct{}),*struct{}}
type Xsqlite3_mutex_methods struct {
X0 func(*crt.TLS) int32
X1 func(*crt.TLS) int32
X2 func(*crt.TLS, int32) unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer)
X4 func(*crt.TLS, unsafe.Pointer)
X5 func(*crt.TLS, unsafe.Pointer) int32
X6 func(*crt.TLS, unsafe.Pointer)
X7 func(*crt.TLS, unsafe.Pointer) int32
X8 func(*crt.TLS, unsafe.Pointer) int32
} // t84 struct{*func()int32,*func()int32,*func(int32)*struct{},*func(*struct{}),*func(*struct{}),*func(*struct{})int32,*func(*struct{}),*func(*struct{})int32,*func(*struct{})int32}
type Xsqlite3_pcache_methods2 struct {
X0 int32
X1 unsafe.Pointer
X2 func(*crt.TLS, unsafe.Pointer) int32
X3 func(*crt.TLS, unsafe.Pointer)
X4 func(*crt.TLS, int32, int32, int32) unsafe.Pointer
X5 func(*crt.TLS, unsafe.Pointer, int32)
X6 func(*crt.TLS, unsafe.Pointer) int32
X7 func(*crt.TLS, unsafe.Pointer, uint32, int32) unsafe.Pointer
X8 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
X9 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint32, uint32)
X10 func(*crt.TLS, unsafe.Pointer, uint32)
X11 func(*crt.TLS, unsafe.Pointer)
X12 func(*crt.TLS, unsafe.Pointer)
} // t85 struct{int32,*struct{},*func(*struct{})int32,*func(*struct{}),*func(int32,int32,int32)*struct{},*func(*struct{},int32),*func(*struct{})int32,*func(*struct{},uint32,int32)*struct{},*func(*struct{},*struct{},int32),*func(*struct{},*struct{},uint32,uint32),*func(*struct{},uint32),*func(*struct{}),*func(*struct{})}
type XFuncDefHash struct{ X0 [23]unsafe.Pointer } // t86 struct{[23]*struct{}}
type XToken struct {
X0 *int8
X1 uint32
} // t87 struct{*int8,uint32}
type Tsqlite3StatType struct {
X0 [10]uint32
X1 [10]uint32
} // t88 struct{[10]uint32,[10]uint32}
type Xsqlite3_file struct{ X0 unsafe.Pointer } // t89 struct{*struct{}}
type Xsqlite3_mutex struct {
X0 struct {
X [0]struct {
X0 struct {
X0 int32
X1 uint32
X2 int32
X3 int32
X4 uint32
X5 struct {
X [0]struct {
X0 struct {
X0 int16
X1 int16
}
X1 struct{ X0 unsafe.Pointer }
}
U [4]byte
}
}
X1 [24]int8
X2 int32
}
U [24]byte
}
X1 int32
X2 int32
X3 uint32
X4 int32
} // t90 struct{union{struct{int32,uint32,int32,int32,uint32,union{struct{int16,int16},struct{*struct{}}}},[24]int8,int32},int32,int32,uint32,int32}
type XHash struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
} // t91 struct{uint32,uint32,*struct{},*struct{}}
type XDb struct {
X0 *int8
X1 unsafe.Pointer
X2 uint8
X3 uint8
X4 unsafe.Pointer
} // t92 struct{*int8,*struct{},uint8,uint8,*struct{}}
type Xsqlite3 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 int32
X6 int32
X7 int64
X8 int64
X9 uint32
X10 int32
X11 int32
X12 int32
X13 uint16
X14 uint8
X15 uint8
X16 uint8
X17 uint8
X18 uint8
X19 uint8
X20 int8
X21 uint8
X22 uint8
X23 uint8
X24 uint8
X25 uint8
X26 uint8
X27 int32
X28 uint32
X29 int32
X30 int32
X31 [12]int32
X32 int32
X33 struct {
X0 int32
X1 uint8
X2 uint8
X3 uint8
X4 uint8
}
X34 int32
X35 int32
X36 int32
X37 int32
X38 int32
X39 int32
X40 *unsafe.Pointer
X41 func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32
X42 unsafe.Pointer
X43 func(*crt.TLS, unsafe.Pointer, *int8, uint64)
X44 unsafe.Pointer
X45 unsafe.Pointer
X46 func(*crt.TLS, unsafe.Pointer) int32
X47 unsafe.Pointer
X48 func(*crt.TLS, unsafe.Pointer)
X49 unsafe.Pointer
X50 func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64)
X51 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32
X52 unsafe.Pointer
X53 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)
X54 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)
X55 unsafe.Pointer
X56 unsafe.Pointer
X57 struct {
X [0]struct {
X0 int32
X1 float64
}
U [8]byte
}
X58 struct {
X0 uint32
X1 uint16
X2 uint8
X3 int32
X4 int32
X5 [3]int32
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
}
X59 func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32
X60 unsafe.Pointer
X61 func(*crt.TLS, unsafe.Pointer) int32
X62 unsafe.Pointer
X63 uint32
X64 int32
X65 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X66 unsafe.Pointer
X67 *unsafe.Pointer
X68 unsafe.Pointer
X69 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X70 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X71 struct {
X0 func(*crt.TLS, unsafe.Pointer, int32) int32
X1 unsafe.Pointer
X2 int32
}
X72 [2]struct {
X0 *int8
X1 unsafe.Pointer
X2 uint8
X3 uint8
X4 unsafe.Pointer
}
X73 unsafe.Pointer
X74 int32
X75 int32
X76 int32
X77 int64
X78 int64
X79 *int32
} // t93 struct{*struct{},*struct{},*struct{},*struct{},*struct{},int32,int32,int64,int64,uint32,int32,int32,int32,uint16,uint8,uint8,uint8,uint8,uint8,uint8,int8,uint8,uint8,uint8,uint8,uint8,uint8,int32,uint32,int32,int32,[12]int32,int32,struct{int32,uint8,uint8,uint8,uint8},int32,int32,int32,int32,int32,int32,**struct{},*func(uint32,*struct{},*struct{},*struct{})int32,*struct{},*func(*struct{},*int8,uint64),*struct{},*struct{},*func(*struct{})int32,*struct{},*func(*struct{}),*struct{},*func(*struct{},int32,*int8,*int8,int64),*func(*struct{},*struct{},*int8,int32)int32,*struct{},*func(*struct{},*struct{},int32,*int8),*func(*struct{},*struct{},int32,*struct{}),*struct{},*struct{},union{int32,float64},struct{uint32,uint16,uint8,int32,int32,[3]int32,*struct{},*struct{},*struct{}},*func(*struct{},int32,*int8,*int8,*int8,*int8)int32,*struct{},*func(*struct{})int32,*struct{},uint32,int32,struct{uint32,uint32,*struct{},*struct{}},*struct{},**struct{},*struct{},struct{uint32,uint32,*struct{},*struct{}},struct{uint32,uint32,*struct{},*struct{}},struct{*func(*struct{},int32)int32,*struct{},int32},[2]struct{*int8,*struct{},uint8,uint8,*struct{}},*struct{},int32,int32,int32,int64,int64,*int32}
type XBtLock struct {
X0 unsafe.Pointer
X1 uint32
X2 uint8
X3 unsafe.Pointer
} // t94 struct{*struct{},uint32,uint8,*struct{}}
type XBtree struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 uint8
X4 uint8
X5 uint8
X6 int32
X7 int32
X8 uint32
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 struct {
X0 unsafe.Pointer
X1 uint32
X2 uint8
X3 unsafe.Pointer
}
} // t95 struct{*struct{},*struct{},uint8,uint8,uint8,uint8,int32,int32,uint32,*struct{},*struct{},struct{*struct{},uint32,uint8,*struct{}}}
type XPager struct {
X0 unsafe.Pointer
X1 uint8
X2 uint8
X3 uint8
X4 uint8
X5 uint8
X6 uint8
X7 uint8
X8 uint8
X9 uint8
X10 uint8
X11 uint8
X12 uint8
X13 uint8
X14 uint8
X15 uint8
X16 uint8
X17 uint8
X18 uint8
X19 uint8
X20 uint8
X21 uint8
X22 uint32
X23 uint32
X24 uint32
X25 uint32
X26 int32
X27 int32
X28 uint32
X29 uint32
X30 unsafe.Pointer
X31 unsafe.Pointer
X32 unsafe.Pointer
X33 unsafe.Pointer
X34 int64
X35 int64
X36 unsafe.Pointer
X37 unsafe.Pointer
X38 int32
X39 uint32
X40 [16]int8
X41 int32
X42 int64
X43 unsafe.Pointer
X44 uint16
X45 int16
X46 uint32
X47 uint32
X48 int32
X49 uint32
X50 int64
X51 *int8
X52 *int8
X53 func(*crt.TLS, unsafe.Pointer) int32
X54 unsafe.Pointer
X55 [3]int32
X56 func(*crt.TLS, unsafe.Pointer)
X57 func(*crt.TLS, unsafe.Pointer, uint32, *unsafe.Pointer, int32) int32
X58 *int8
X59 unsafe.Pointer
X60 unsafe.Pointer
X61 *int8
} // t96 struct{*struct{},uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint32,uint32,uint32,uint32,int32,int32,uint32,uint32,*struct{},*struct{},*struct{},*struct{},int64,int64,*struct{},*struct{},int32,uint32,[16]int8,int32,int64,*struct{},uint16,int16,uint32,uint32,int32,uint32,int64,*int8,*int8,*func(*struct{})int32,*struct{},[3]int32,*func(*struct{}),*func(*struct{},uint32,**struct{},int32)int32,*int8,*struct{},*struct{},*int8}
type XSchema struct {
X0 int32
X1 int32
X2 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X3 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X4 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X5 struct {
X0 uint32
X1 uint32
X2 unsafe.Pointer
X3 unsafe.Pointer
}
X6 unsafe.Pointer
X7 uint8
X8 uint8
X9 uint16
X10 int32
} // t97 struct{int32,int32,struct{uint32,uint32,*struct{},*struct{}},struct{uint32,uint32,*struct{},*struct{}},struct{uint32,uint32,*struct{},*struct{}},struct{uint32,uint32,*struct{},*struct{}},*struct{},uint8,uint8,uint16,int32}
type XHashElem struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 *int8
} // t98 struct{*struct{},*struct{},*struct{},*int8}
type T_ht struct {
X0 int32
X1 unsafe.Pointer
} // t99 struct{int32,*struct{}}
type XTrigger struct {
X0 *int8
X1 *int8
X2 uint8
X3 uint8
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
} // t100 struct{*int8,*int8,uint8,uint8,*struct{},*struct{},*struct{},*struct{},*struct{},*struct{}}
type XTable struct {
X0 *int8
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 *int8
X6 unsafe.Pointer
X7 int32
X8 uint32
X9 uint32
X10 int16
X11 int16
X12 int16
X13 int16
X14 uint8
X15 int32
X16 int32
X17 **int8
X18 unsafe.Pointer
X19 unsafe.Pointer
X20 unsafe.Pointer
X21 unsafe.Pointer
} // t101 struct{*int8,*struct{},*struct{},*struct{},*struct{},*int8,*struct{},int32,uint32,uint32,int16,int16,int16,int16,uint8,int32,int32,**int8,*struct{},*struct{},*struct{},*struct{}}
type TVdbe struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 int16
X5 uint32
X6 int32
X7 int32
X8 uint32
X9 int32
X10 int32
X11 int32
X12 int32
X13 int64
X14 int64
X15 int64
X16 int64
X17 unsafe.Pointer
X18 unsafe.Pointer
X19 *unsafe.Pointer
X20 unsafe.Pointer
X21 unsafe.Pointer
X22 *int8
X23 *unsafe.Pointer
X24 unsafe.Pointer
X25 *int32
X26 int64
X27 int32
X28 int32
X29 uint16
X30 uint8
X31 uint8
X32 int16
X33 uint32
X34 uint32
X35 [5]uint32
X36 *int8
X37 unsafe.Pointer
X38 unsafe.Pointer
X39 unsafe.Pointer
X40 int32
X41 uint32
X42 unsafe.Pointer
X43 unsafe.Pointer
} // t102 struct{*struct{},*struct{},*struct{},*struct{},int16,uint32,int32,int32,uint32,int32,int32,int32,int32,int64,int64,int64,int64,*struct{},*struct{},**struct{},*struct{},*struct{},*int8,**struct{},*struct{},*int32,int64,int32,int32,uint16,uint8,uint8,int16,uint32,uint32,[5]uint32,*int8,*struct{},*struct{},*struct{},int32,uint32,*struct{},*struct{}}
type XDateTime struct {
X0 int64
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 float64
X8 int8
X9 int8
X10 int8
X11 int8
X12 int8
X13 int8
X14 int8
} // t103 struct{int64,int32,int32,int32,int32,int32,int32,float64,int8,int8,int8,int8,int8,int8,int8}
type Xsqlite3_context struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 int32
X5 int32
X6 uint8
X7 uint8
X8 uint8
X9 [1]unsafe.Pointer
} // t104 struct{*struct{},*struct{},*struct{},*struct{},int32,int32,uint8,uint8,uint8,[1]*struct{}}
type XMem struct {
X0 struct {
X [0]struct {
X0 float64
X1 int64
X2 int32
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
}
U [8]byte
}
X1 uint16
X2 uint8
X3 uint8
X4 int32
X5 *int8
X6 *int8
X7 int32
X8 uint32
X9 unsafe.Pointer
X10 func(*crt.TLS, unsafe.Pointer)
X11 unsafe.Pointer
X12 unsafe.Pointer
} // t105 struct{union{float64,int64,int32,*struct{},*struct{},*struct{}},uint16,uint8,uint8,int32,*int8,*int8,int32,uint32,*struct{},*func(*struct{}),*struct{},*struct{}}
type XFuncDef struct {
X0 int8
X1 uint16
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer)
X5 func(*crt.TLS, unsafe.Pointer)
X6 *int8
X7 struct {
X [0]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
U [4]byte
}
} // t106 struct{int8,uint16,*struct{},*struct{},*func(*struct{},int32,**struct{}),*func(*struct{}),*int8,union{*struct{},*struct{}}}
type Xsqlite3_io_methods struct {
X0 int32
X1 func(*crt.TLS, unsafe.Pointer) int32
X2 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
X3 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int64) int32
X4 func(*crt.TLS, unsafe.Pointer, int64) int32
X5 func(*crt.TLS, unsafe.Pointer, int32) int32
X6 func(*crt.TLS, unsafe.Pointer, *int64) int32
X7 func(*crt.TLS, unsafe.Pointer, int32) int32
X8 func(*crt.TLS, unsafe.Pointer, int32) int32
X9 func(*crt.TLS, unsafe.Pointer, *int32) int32
X10 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
X11 func(*crt.TLS, unsafe.Pointer) int32
X12 func(*crt.TLS, unsafe.Pointer) int32
X13 func(*crt.TLS, unsafe.Pointer, int32, int32, int32, *unsafe.Pointer) int32
X14 func(*crt.TLS, unsafe.Pointer, int32, int32, int32) int32
X15 func(*crt.TLS, unsafe.Pointer)
X16 func(*crt.TLS, unsafe.Pointer, int32) int32
X17 func(*crt.TLS, unsafe.Pointer, int64, int32, *unsafe.Pointer) int32
X18 func(*crt.TLS, unsafe.Pointer, int64, unsafe.Pointer) int32
} // t107 struct{int32,*func(*struct{})int32,*func(*struct{},*struct{},int32,int64)int32,*func(*struct{},*struct{},int32,int64)int32,*func(*struct{},int64)int32,*func(*struct{},int32)int32,*func(*struct{},*int64)int32,*func(*struct{},int32)int32,*func(*struct{},int32)int32,*func(*struct{},*int32)int32,*func(*struct{},int32,*struct{})int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},int32,int32,int32,**struct{})int32,*func(*struct{},int32,int32,int32)int32,*func(*struct{}),*func(*struct{},int32)int32,*func(*struct{},int64,int32,**struct{})int32,*func(*struct{},int64,*struct{})int32}
type Xsqlite3_vfs struct {
X0 int32
X1 int32
X2 int32
X3 unsafe.Pointer
X4 *int8
X5 unsafe.Pointer
X6 func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, int32, *int32) int32
X7 func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
X8 func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32) int32
X9 func(*crt.TLS, unsafe.Pointer, *int8, int32, *int8) int32
X10 func(*crt.TLS, unsafe.Pointer, *int8) unsafe.Pointer
X11 func(*crt.TLS, unsafe.Pointer, int32, *int8)
X12 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8) func(*crt.TLS)
X13 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
X14 func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
X15 func(*crt.TLS, unsafe.Pointer, int32) int32
X16 func(*crt.TLS, unsafe.Pointer, *float64) int32
X17 func(*crt.TLS, unsafe.Pointer, int32, *int8) int32
X18 func(*crt.TLS, unsafe.Pointer, *int64) int32
X19 func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS)) int32
X20 func(*crt.TLS, unsafe.Pointer, *int8) func(*crt.TLS)
X21 func(*crt.TLS, unsafe.Pointer, *int8) *int8
} // t108 struct{int32,int32,int32,*struct{},*int8,*struct{},*func(*struct{},*int8,*struct{},int32,*int32)int32,*func(*struct{},*int8,int32)int32,*func(*struct{},*int8,int32,*int32)int32,*func(*struct{},*int8,int32,*int8)int32,*func(*struct{},*int8)*struct{},*func(*struct{},int32,*int8),*func(*struct{},*struct{},*int8)*func(),*func(*struct{},*struct{}),*func(*struct{},int32,*int8)int32,*func(*struct{},int32)int32,*func(*struct{},*float64)int32,*func(*struct{},int32,*int8)int32,*func(*struct{},*int64)int32,*func(*struct{},*int8,*func())int32,*func(*struct{},*int8)*func(),*func(*struct{},*int8)*int8}
type TBenignMallocHooks struct {
X0 func(*crt.TLS)
X1 func(*crt.TLS)
} // t109 struct{*func(),*func()}
type TMem0Global struct {
X0 unsafe.Pointer
X1 int64
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 uint32
X5 int32
} // t110 struct{*struct{},int64,*struct{},*struct{},uint32,int32}
type Xet_info struct {
X0 int8
X1 uint8
X2 uint8
X3 uint8
X4 uint8
X5 uint8
} // t111 struct{int8,uint8,uint8,uint8,uint8,uint8}
type XStrAccum struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 uint32
X4 uint32
X5 uint32
X6 uint8
X7 uint8
} // t112 struct{*struct{},*int8,*int8,uint32,uint32,uint32,uint8,uint8}
type XPrintfArguments struct {
X0 int32
X1 int32
X2 *unsafe.Pointer
} // t113 struct{int32,int32,**struct{}}
type TSrcList_item struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 *int8
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 int32
X7 int32
X8 int32
X9 struct {
X0 uint8
X1 int8
}
X10 uint8
X11 int32
X12 unsafe.Pointer
X13 unsafe.Pointer
X14 uint64
X15 struct {
X [0]struct {
X0 *int8
X1 unsafe.Pointer
}
U [4]byte
}
X16 unsafe.Pointer
} // t114 struct{*struct{},*int8,*int8,*int8,*struct{},*struct{},int32,int32,int32,struct{uint8,int8,},uint8,int32,*struct{},*struct{},uint64,union{*int8,*struct{}},*struct{}}
type XSrcList struct {
X0 int32
X1 uint32
X2 [1]struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 *int8
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 int32
X7 int32
X8 int32
X9 struct {
X0 uint8
X1 int8
}
X10 uint8
X11 int32
X12 unsafe.Pointer
X13 unsafe.Pointer
X14 uint64
X15 struct {
X [0]struct {
X0 *int8
X1 unsafe.Pointer
}
U [4]byte
}
X16 unsafe.Pointer
}
} // t115 struct{int32,uint32,[1]struct{*struct{},*int8,*int8,*int8,*struct{},*struct{},int32,int32,int32,struct{uint8,int8,},uint8,int32,*struct{},*struct{},uint64,union{*int8,*struct{}},*struct{}}}
type TCte struct {
X0 *int8
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 *int8
} // t116 struct{*int8,*struct{},*struct{},*int8}
type XWith struct {
X0 int32
X1 unsafe.Pointer
X2 [1]struct {
X0 *int8
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 *int8
}
} // t117 struct{int32,*struct{},[1]struct{*int8,*struct{},*struct{},*int8}}
type TExprList_item struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 uint8
X4 int8
X5 struct {
X [0]struct {
X0 struct {
X0 uint16
X1 uint16
}
X1 int32
}
U [4]byte
}
} // t118 struct{*struct{},*int8,*int8,uint8,int8,union{struct{uint16,uint16},int32}}
type XExprList struct {
X0 int32
X1 int32
X2 [1]struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 uint8
X4 int8
X5 struct {
X [0]struct {
X0 struct {
X0 uint16
X1 uint16
}
X1 int32
}
U [4]byte
}
}
} // t119 struct{int32,int32,[1]struct{*struct{},*int8,*int8,uint8,int8,union{struct{uint16,uint16},int32}}}
type XSelect struct {
X0 unsafe.Pointer
X1 uint8
X2 int16
X3 uint32
X4 int32
X5 int32
X6 [12]int8
X7 [2]int32
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 unsafe.Pointer
X12 unsafe.Pointer
X13 unsafe.Pointer
X14 unsafe.Pointer
X15 unsafe.Pointer
X16 unsafe.Pointer
X17 unsafe.Pointer
} // t120 struct{*struct{},uint8,int16,uint32,int32,int32,[12]int8,[2]int32,*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*struct{}}
type XExpr struct {
X0 uint8
X1 int8
X2 uint32
X3 struct {
X [0]struct {
X0 *int8
X1 int32
}
U [4]byte
}
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 struct {
X [0]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
U [4]byte
}
X7 int32
X8 int32
X9 int16
X10 int16
X11 int16
X12 uint8
X13 unsafe.Pointer
X14 unsafe.Pointer
} // t121 struct{uint8,int8,uint32,union{*int8,int32},*struct{},*struct{},union{*struct{},*struct{}},int32,int32,int16,int16,int16,uint8,*struct{},*struct{}}
type Tsqlite3PrngType struct {
X0 uint8
X1 uint8
X2 uint8
X3 [256]uint8
} // t122 struct{uint8,uint8,uint8,[256]uint8}
type XSQLiteThread struct {
X0 uint32
X1 int32
X2 unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X4 unsafe.Pointer
} // t123 struct{uint32,int32,*struct{},*func(*struct{})*struct{},*struct{}}
type XColumn struct {
X0 *int8
X1 unsafe.Pointer
X2 *int8
X3 uint8
X4 int8
X5 uint8
X6 uint8
} // t124 struct{*int8,*struct{},*int8,uint8,int8,uint8,uint8}
type TyColCache struct {
X0 int32
X1 int16
X2 uint8
X3 int32
X4 int32
X5 int32
} // t125 struct{int32,int16,uint8,int32,int32,int32}
type XParse struct {
X0 unsafe.Pointer
X1 *int8
X2 unsafe.Pointer
X3 int32
X4 uint8
X5 uint8
X6 uint8
X7 uint8
X8 uint8
X9 uint8
X10 uint8
X11 uint8
X12 uint8
X13 uint8
X14 int32
X15 int32
X16 int32
X17 int32
X18 int32
X19 int32
X20 int32
X21 int32
X22 int32
X23 int32
X24 int32
X25 int32
X26 *int32
X27 unsafe.Pointer
X28 struct {
X0 *int8
X1 uint32
}
X29 uint32
X30 uint32
X31 int32
X32 int32
X33 int32
X34 int32
X35 int32
X36 int32
X37 unsafe.Pointer
X38 unsafe.Pointer
X39 unsafe.Pointer
X40 unsafe.Pointer
X41 int32
X42 uint32
X43 uint32
X44 uint32
X45 uint8
X46 uint8
X47 uint8
X48 [10]struct {
X0 int32
X1 int16
X2 uint8
X3 int32
X4 int32
X5 int32
}
X49 [8]int32
X50 struct {
X0 *int8
X1 uint32
}
X51 struct {
X0 *int8
X1 uint32
}
X52 int16
X53 uint8
X54 uint8
X55 uint8
X56 int32
X57 int32
X58 int32
X59 int32
X60 *int32
X61 unsafe.Pointer
X62 *int8
X63 unsafe.Pointer
X64 unsafe.Pointer
X65 *int8
X66 struct {
X0 *int8
X1 uint32
}
X67 *unsafe.Pointer
X68 unsafe.Pointer
X69 unsafe.Pointer
X70 unsafe.Pointer
X71 unsafe.Pointer
} // t126 struct{*struct{},*int8,*struct{},int32,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,int32,*int32,*struct{},struct{*int8,uint32},uint32,uint32,int32,int32,int32,int32,int32,int32,*struct{},*struct{},*struct{},*struct{},int32,uint32,uint32,uint32,uint8,uint8,uint8,[10]struct{int32,int16,uint8,int32,int32,int32},[8]int32,struct{*int8,uint32},struct{*int8,uint32},int16,uint8,uint8,uint8,int32,int32,int32,int32,*int32,*struct{},*int8,*struct{},*struct{},*int8,struct{*int8,uint32},**struct{},*struct{},*struct{},*struct{},*struct{}}
type Tunix_syscall struct {
X0 *int8
X1 func(*crt.TLS)
X2 func(*crt.TLS)
} // t127 struct{*int8,*func(),*func()}
type TunixFileId struct {
X0 uint64
X1 uint64
} // t128 struct{uint64,uint64}
type XunixInodeInfo struct {
X0 struct {
X0 uint64
X1 uint64
}
X1 int32
X2 uint8
X3 uint8
X4 int32
X5 unsafe.Pointer
X6 int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
} // t129 struct{struct{uint64,uint64},int32,uint8,uint8,int32,*struct{},int32,*struct{},*struct{},*struct{}}
type XunixFile struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 int32
X4 uint8
X5 uint16
X6 int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 *int8
X10 unsafe.Pointer
X11 int32
X12 int32
X13 int64
X14 int64
X15 int64
X16 unsafe.Pointer
X17 uint8
X18 uint8
X19 uint8
} // t130 struct{*struct{},*struct{},*struct{},int32,uint8,uint16,int32,*struct{},*struct{},*int8,*struct{},int32,int32,int64,int64,int64,*struct{},uint8,uint8,uint8}
type XUnixUnusedFd struct {
X0 int32
X1 int32
X2 unsafe.Pointer
} // t131 struct{int32,int32,*struct{}}
type XunixShmNode struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 *int8
X3 int32
X4 int32
X5 uint16
X6 uint8
X7 **int8
X8 int32
X9 unsafe.Pointer
X10 uint8
X11 uint8
X12 uint8
} // t132 struct{*struct{},*struct{},*int8,int32,int32,uint16,uint8,**int8,int32,*struct{},uint8,uint8,uint8}
type Tflock struct {
X0 int16
X1 int16
X2 int64
X3 int64
X4 int32
} // t133 struct{int16,int16,int64,int64,int32}
type TunixShm struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 uint8
X4 uint16
X5 uint16
} // t134 struct{*struct{},*struct{},uint8,uint8,uint16,uint16}
type XBitvec struct {
X0 uint32
X1 uint32
X2 uint32
X3 struct {
X [0]struct {
X0 [500]uint8
X1 [125]uint32
X2 [125]unsafe.Pointer
}
U [500]byte
}
} // t135 struct{uint32,uint32,uint32,union{[500]uint8,[125]uint32,[125]*struct{}}}
type XPgHdr struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 uint32
X6 uint16
X7 int16
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
} // t136 struct{*struct{},*struct{},*struct{},*struct{},*struct{},uint32,uint16,int16,*struct{},*struct{},*struct{}}
type XPCache struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 int32
X4 int32
X5 int32
X6 int32
X7 int32
X8 uint8
X9 uint8
X10 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
X11 unsafe.Pointer
X12 unsafe.Pointer
} // t137 struct{*struct{},*struct{},*struct{},int32,int32,int32,int32,int32,uint8,uint8,*func(*struct{},*struct{})int32,*struct{},*struct{}}
type Xsqlite3_pcache_page struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
} // t138 struct{*struct{},*struct{}}
type TPCacheGlobal struct {
X0 struct {
X0 unsafe.Pointer
X1 uint32
X2 uint32
X3 uint32
X4 uint32
X5 struct {
X0 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X1 uint32
X2 uint8
X3 uint8
X4 uint8
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
}
}
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 int32
X12 int32
} // t139 struct{struct{*struct{},uint32,uint32,uint32,uint32,struct{struct{*struct{},*struct{}},uint32,uint8,uint8,uint8,*struct{},*struct{},*struct{},*struct{}}},int32,int32,int32,int32,int32,int32,*struct{},*struct{},*struct{},*struct{},int32,int32}
type XPgHdr1 struct {
X0 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X1 uint32
X2 uint8
X3 uint8
X4 uint8
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
} // t140 struct{struct{*struct{},*struct{}},uint32,uint8,uint8,uint8,*struct{},*struct{},*struct{},*struct{}}
type XPGroup struct {
X0 unsafe.Pointer
X1 uint32
X2 uint32
X3 uint32
X4 uint32
X5 struct {
X0 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X1 uint32
X2 uint8
X3 uint8
X4 uint8
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
}
} // t141 struct{*struct{},uint32,uint32,uint32,uint32,struct{struct{*struct{},*struct{}},uint32,uint8,uint8,uint8,*struct{},*struct{},*struct{},*struct{}}}
type XPCache1 struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 int32
X5 uint32
X6 uint32
X7 uint32
X8 uint32
X9 uint32
X10 uint32
X11 uint32
X12 *unsafe.Pointer
X13 unsafe.Pointer
X14 unsafe.Pointer
} // t142 struct{*struct{},int32,int32,int32,int32,uint32,uint32,uint32,uint32,uint32,uint32,uint32,**struct{},*struct{},*struct{}}
type XRowSet struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 uint16
X7 uint16
X8 int32
} // t143 struct{*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},uint16,uint16,int32}
type TRowSetEntry struct {
X0 int64
X1 unsafe.Pointer
X2 unsafe.Pointer
} // t144 struct{int64,*struct{},*struct{}}
type TRowSetChunk struct {
X0 unsafe.Pointer
X1 [63]struct {
X0 int64
X1 unsafe.Pointer
X2 unsafe.Pointer
}
} // t145 struct{*struct{},[63]struct{int64,*struct{},*struct{}}}
type XWalIndexHdr struct {
X0 uint32
X1 uint32
X2 uint32
X3 uint8
X4 uint8
X5 uint16
X6 uint32
X7 uint32
X8 [2]uint32
X9 [2]uint32
X10 [2]uint32
} // t146 struct{uint32,uint32,uint32,uint8,uint8,uint16,uint32,uint32,[2]uint32,[2]uint32,[2]uint32}
type XWal struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 uint32
X4 int64
X5 int32
X6 int32
X7 **uint32
X8 uint32
X9 int16
X10 uint8
X11 uint8
X12 uint8
X13 uint8
X14 uint8
X15 uint8
X16 uint8
X17 uint8
X18 struct {
X0 uint32
X1 uint32
X2 uint32
X3 uint8
X4 uint8
X5 uint16
X6 uint32
X7 uint32
X8 [2]uint32
X9 [2]uint32
X10 [2]uint32
}
X19 uint32
X20 uint32
X21 *int8
X22 uint32
X23 uint8
} // t147 struct{*struct{},*struct{},*struct{},uint32,int64,int32,int32,**uint32,uint32,int16,uint8,uint8,uint8,uint8,uint8,uint8,uint8,uint8,struct{uint32,uint32,uint32,uint8,uint8,uint16,uint32,uint32,[2]uint32,[2]uint32,[2]uint32},uint32,uint32,*int8,uint32,uint8}
type XPagerSavepoint struct {
X0 int64
X1 int64
X2 unsafe.Pointer
X3 uint32
X4 uint32
X5 [4]uint32
} // t148 struct{int64,int64,*struct{},uint32,uint32,[4]uint32}
type Xsqlite3_backup struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint32
X3 int32
X4 uint32
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 int32
X8 uint32
X9 uint32
X10 int32
X11 unsafe.Pointer
} // t149 struct{*struct{},*struct{},uint32,int32,uint32,*struct{},*struct{},int32,uint32,uint32,int32,*struct{}}
type XWalCkptInfo struct {
X0 uint32
X1 [5]uint32
X2 [8]uint8
X3 uint32
X4 uint32
} // t150 struct{uint32,[5]uint32,[8]uint8,uint32,uint32}
type TWalSegment struct {
X0 int32
X1 *uint16
X2 *uint32
X3 int32
X4 int32
} // t151 struct{int32,*uint16,*uint32,int32,int32}
type XWalIterator struct {
X0 int32
X1 int32
X2 [1]struct {
X0 int32
X1 *uint16
X2 *uint32
X3 int32
X4 int32
}
} // t152 struct{int32,int32,[1]struct{int32,*uint16,*uint32,int32,int32}}
type TSublist struct {
X0 int32
X1 *uint16
} // t153 struct{int32,*uint16}
type XWalWriter struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int64
X3 int32
X4 int32
} // t154 struct{*struct{},*struct{},int64,int32,int32}
type XBtShared struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 uint8
X5 uint8
X6 uint8
X7 uint8
X8 uint8
X9 uint8
X10 uint16
X11 uint16
X12 uint16
X13 uint16
X14 uint16
X15 uint32
X16 uint32
X17 int32
X18 uint32
X19 unsafe.Pointer
X20 func(*crt.TLS, unsafe.Pointer)
X21 unsafe.Pointer
X22 unsafe.Pointer
X23 int32
X24 unsafe.Pointer
X25 unsafe.Pointer
X26 unsafe.Pointer
X27 *uint8
} // t155 struct{*struct{},*struct{},*struct{},*struct{},uint8,uint8,uint8,uint8,uint8,uint8,uint16,uint16,uint16,uint16,uint16,uint32,uint32,int32,uint32,*struct{},*func(*struct{}),*struct{},*struct{},int32,*struct{},*struct{},*struct{},*uint8}
type XCellInfo struct {
X0 int64
X1 *uint8
X2 uint32
X3 uint16
X4 uint16
} // t156 struct{int64,*uint8,uint32,uint16,uint16}
type XBtCursor struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 *uint32
X4 struct {
X0 int64
X1 *uint8
X2 uint32
X3 uint16
X4 uint16
}
X5 int64
X6 unsafe.Pointer
X7 uint32
X8 int32
X9 int32
X10 uint8
X11 uint8
X12 uint8
X13 uint8
X14 int8
X15 uint8
X16 uint16
X17 [19]uint16
X18 unsafe.Pointer
X19 [20]unsafe.Pointer
} // t157 struct{*struct{},*struct{},*struct{},*uint32,struct{int64,*uint8,uint32,uint16,uint16},int64,*struct{},uint32,int32,int32,uint8,uint8,uint8,uint8,int8,uint8,uint16,[19]uint16,*struct{},[20]*struct{}}
type XIndex struct {
X0 *int8
X1 *int16
X2 *int16
X3 unsafe.Pointer
X4 *int8
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 *uint8
X8 **int8
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 int32
X12 int16
X13 uint16
X14 uint16
X15 uint8
X16 int8
} // t158 struct{*int8,*int16,*int16,*struct{},*int8,*struct{},*struct{},*uint8,**int8,*struct{},*struct{},int32,int16,uint16,uint16,uint8,int8,}
type XMemPage struct {
X0 uint8
X1 uint8
X2 uint8
X3 uint8
X4 uint32
X5 uint8
X6 uint8
X7 uint8
X8 uint8
X9 uint8
X10 uint16
X11 uint16
X12 uint16
X13 uint16
X14 uint16
X15 uint16
X16 [4]uint16
X17 [4]*uint8
X18 unsafe.Pointer
X19 *uint8
X20 *uint8
X21 *uint8
X22 *uint8
X23 unsafe.Pointer
X24 func(*crt.TLS, unsafe.Pointer, *uint8) uint16
X25 func(*crt.TLS, unsafe.Pointer, *uint8, unsafe.Pointer)
} // t159 struct{uint8,uint8,uint8,uint8,uint32,uint8,uint8,uint8,uint8,uint8,uint16,uint16,uint16,uint16,uint16,uint16,[4]uint16,[4]*uint8,*struct{},*uint8,*uint8,*uint8,*uint8,*struct{},*func(*struct{},*uint8)uint16,*func(*struct{},*uint8,*struct{})}
type XUnpackedRecord struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint16
X3 int8
X4 uint8
X5 int8
X6 int8
X7 uint8
} // t160 struct{*struct{},*struct{},uint16,int8,uint8,int8,int8,uint8}
type XKeyInfo struct {
X0 uint32
X1 uint8
X2 uint16
X3 uint16
X4 unsafe.Pointer
X5 *uint8
X6 [1]unsafe.Pointer
} // t161 struct{uint32,uint8,uint16,uint16,*struct{},*uint8,[1]*struct{}}
type XBtreePayload struct {
X0 unsafe.Pointer
X1 int64
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 uint16
X5 int32
X6 int32
} // t162 struct{*struct{},int64,*struct{},*struct{},uint16,int32,int32}
type XCellArray struct {
X0 int32
X1 unsafe.Pointer
X2 **uint8
X3 *uint16
} // t163 struct{int32,*struct{},**uint8,*uint16}
type XIntegrityCk struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 *uint8
X3 uint32
X4 int32
X5 int32
X6 int32
X7 *int8
X8 int32
X9 int32
X10 struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
X3 uint32
X4 uint32
X5 uint32
X6 uint8
X7 uint8
}
X11 *uint32
} // t164 struct{*struct{},*struct{},*uint8,uint32,int32,int32,int32,*int8,int32,int32,struct{*struct{},*int8,*int8,uint32,uint32,uint32,uint8,uint8},*uint32}
type XVdbeFrame struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 *int64
X4 unsafe.Pointer
X5 *unsafe.Pointer
X6 *uint8
X7 unsafe.Pointer
X8 int64
X9 unsafe.Pointer
X10 int32
X11 int32
X12 int32
X13 int32
X14 int32
X15 int32
X16 int32
X17 int32
} // t165 struct{*struct{},*struct{},*struct{},*int64,*struct{},**struct{},*uint8,*struct{},int64,*struct{},int32,int32,int32,int32,int32,int32,int32,int32}
type XVdbeOp struct {
X0 uint8
X1 int8
X2 uint16
X3 int32
X4 int32
X5 int32
X6 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 *int8
X3 *int64
X4 *float64
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 *int32
X12 unsafe.Pointer
X13 unsafe.Pointer
X14 func(*crt.TLS, unsafe.Pointer, *int32) int32
}
U [4]byte
}
X7 *int8
} // t166 struct{uint8,int8,uint16,int32,int32,int32,union{int32,*struct{},*int8,*int64,*float64,*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*int32,*struct{},*struct{},*func(*struct{},*int32)int32},*int8}
type XVdbeOpIter struct {
X0 unsafe.Pointer
X1 *unsafe.Pointer
X2 int32
X3 int32
X4 int32
} // t167 struct{*struct{},**struct{},int32,int32,int32}
type XSubProgram struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 *uint8
X5 unsafe.Pointer
X6 unsafe.Pointer
} // t168 struct{*struct{},int32,int32,int32,*uint8,*struct{},*struct{}}
type XVdbeOpList struct {
X0 uint8
X1 int8
X2 int8
X3 int8
} // t169 struct{uint8,int8,int8,int8}
type XVTable struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 int32
X4 uint8
X5 int32
X6 unsafe.Pointer
} // t170 struct{*struct{},*struct{},*struct{},int32,uint8,int32,*struct{}}
type XCollSeq struct {
X0 *int8
X1 uint8
X2 unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32
X4 func(*crt.TLS, unsafe.Pointer)
} // t171 struct{*int8,uint8,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32,*func(*struct{})}
type Xsqlite3_vtab struct {
X0 unsafe.Pointer
X1 int32
X2 *int8
} // t172 struct{*struct{},int32,*int8}
type XVdbeCursor struct {
X0 uint8
X1 int8
X2 uint8
X3 uint8
X4 uint8
X5 uint8
X6 uint8
X7 int8
X8 unsafe.Pointer
X9 int64
X10 *int32
X11 uint32
X12 int32
X13 unsafe.Pointer
X14 struct {
X [0]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int32
X3 unsafe.Pointer
}
U [4]byte
}
X15 unsafe.Pointer
X16 uint32
X17 uint32
X18 int16
X19 uint16
X20 int64
X21 *uint32
X22 *uint8
X23 uint32
X24 uint32
X25 [1]uint32
} // t173 struct{uint8,int8,uint8,uint8,uint8,uint8,uint8,int8,*struct{},int64,*int32,uint32,int32,*struct{},union{*struct{},*struct{},int32,*struct{}},*struct{},uint32,uint32,int16,uint16,int64,*uint32,*uint8,uint32,uint32,[1]uint32}
type XAuxData struct {
X0 int32
X1 int32
X2 unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer)
X4 unsafe.Pointer
} // t174 struct{int32,int32,*struct{},*func(*struct{}),*struct{}}
type TReusableSpace struct {
X0 *uint8
X1 int32
X2 int32
} // t175 struct{*uint8,int32,int32}
type Xsqlite3_module struct {
X0 int32
X1 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
X2 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, **int8, *unsafe.Pointer, **int8) int32
X3 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
X4 func(*crt.TLS, unsafe.Pointer) int32
X5 func(*crt.TLS, unsafe.Pointer) int32
X6 func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
X7 func(*crt.TLS, unsafe.Pointer) int32
X8 func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, *unsafe.Pointer) int32
X9 func(*crt.TLS, unsafe.Pointer) int32
X10 func(*crt.TLS, unsafe.Pointer) int32
X11 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32) int32
X12 func(*crt.TLS, unsafe.Pointer, *int64) int32
X13 func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer, *int64) int32
X14 func(*crt.TLS, unsafe.Pointer) int32
X15 func(*crt.TLS, unsafe.Pointer) int32
X16 func(*crt.TLS, unsafe.Pointer) int32
X17 func(*crt.TLS, unsafe.Pointer) int32
X18 func(*crt.TLS, unsafe.Pointer, int32, *int8, *func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), *unsafe.Pointer) int32
X19 func(*crt.TLS, unsafe.Pointer, *int8) int32
X20 func(*crt.TLS, unsafe.Pointer, int32) int32
X21 func(*crt.TLS, unsafe.Pointer, int32) int32
X22 func(*crt.TLS, unsafe.Pointer, int32) int32
} // t176 struct{int32,*func(*struct{},*struct{},int32,**int8,**struct{},**int8)int32,*func(*struct{},*struct{},int32,**int8,**struct{},**int8)int32,*func(*struct{},*struct{})int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},**struct{})int32,*func(*struct{})int32,*func(*struct{},int32,*int8,int32,**struct{})int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},*struct{},int32)int32,*func(*struct{},*int64)int32,*func(*struct{},int32,**struct{},*int64)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},int32,*int8,**func(*struct{},int32,**struct{}),**struct{})int32,*func(*struct{},*int8)int32,*func(*struct{},int32)int32,*func(*struct{},int32)int32,*func(*struct{},int32)int32}
type XSavepoint struct {
X0 *int8
X1 int64
X2 int64
X3 unsafe.Pointer
} // t177 struct{*int8,int64,int64,*struct{}}
type XSorterFile struct {
X0 unsafe.Pointer
X1 int64
} // t178 struct{*struct{},int64}
type XSortSubtask struct {
X0 unsafe.Pointer
X1 int32
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 struct {
X0 unsafe.Pointer
X1 *uint8
X2 int32
}
X5 int32
X6 func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
X7 struct {
X0 unsafe.Pointer
X1 int64
}
X8 struct {
X0 unsafe.Pointer
X1 int64
}
} // t179 struct{*struct{},int32,*struct{},*struct{},struct{*struct{},*uint8,int32},int32,*func(*struct{},*int32,*struct{},int32,*struct{},int32)int32,struct{*struct{},int64},struct{*struct{},int64}}
type XVdbeSorter struct {
X0 int32
X1 int32
X2 int32
X3 int32
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 struct {
X0 unsafe.Pointer
X1 *uint8
X2 int32
}
X10 int32
X11 int32
X12 uint8
X13 uint8
X14 uint8
X15 uint8
X16 uint8
X17 [1]struct {
X0 unsafe.Pointer
X1 int32
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 struct {
X0 unsafe.Pointer
X1 *uint8
X2 int32
}
X5 int32
X6 func(*crt.TLS, unsafe.Pointer, *int32, unsafe.Pointer, int32, unsafe.Pointer, int32) int32
X7 struct {
X0 unsafe.Pointer
X1 int64
}
X8 struct {
X0 unsafe.Pointer
X1 int64
}
}
} // t180 struct{int32,int32,int32,int32,*struct{},*struct{},*struct{},*struct{},*struct{},struct{*struct{},*uint8,int32},int32,int32,uint8,uint8,uint8,uint8,uint8,[1]struct{*struct{},int32,*struct{},*struct{},struct{*struct{},*uint8,int32},int32,*func(*struct{},*int32,*struct{},int32,*struct{},int32)int32,struct{*struct{},int64},struct{*struct{},int64}}}
type XInitData struct {
X0 unsafe.Pointer
X1 **int8
X2 int32
X3 int32
} // t181 struct{*struct{},**int8,int32,int32}
type XIncrblob struct {
X0 int32
X1 int32
X2 uint16
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 *int8
X7 unsafe.Pointer
} // t182 struct{int32,int32,uint16,*struct{},*struct{},*struct{},*int8,*struct{}}
type XFKey struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 *int8
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 int32
X6 uint8
X7 [2]uint8
X8 [2]unsafe.Pointer
X9 [1]struct {
X0 int32
X1 *int8
}
} // t183 struct{*struct{},*struct{},*int8,*struct{},*struct{},int32,uint8,[2]uint8,[2]*struct{},[1]struct{int32,*int8}}
type XPmaReader struct {
X0 int64
X1 int64
X2 int32
X3 int32
X4 unsafe.Pointer
X5 *uint8
X6 *uint8
X7 *uint8
X8 int32
X9 *uint8
X10 unsafe.Pointer
} // t184 struct{int64,int64,int32,int32,*struct{},*uint8,*uint8,*uint8,int32,*uint8,*struct{}}
type XIncrMerger struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int64
X3 int32
X4 int32
X5 int32
X6 [2]struct {
X0 unsafe.Pointer
X1 int64
}
} // t185 struct{*struct{},*struct{},int64,int32,int32,int32,[2]struct{*struct{},int64}}
type XSorterRecord struct {
X0 int32
X1 struct {
X [0]struct {
X0 unsafe.Pointer
X1 int32
}
U [4]byte
}
} // t186 struct{int32,union{*struct{},int32}}
type XMergeEngine struct {
X0 int32
X1 unsafe.Pointer
X2 *int32
X3 unsafe.Pointer
} // t187 struct{int32,*struct{},*int32,*struct{}}
type XPmaWriter struct {
X0 int32
X1 *uint8
X2 int32
X3 int32
X4 int32
X5 int64
X6 unsafe.Pointer
} // t188 struct{int32,*uint8,int32,int32,int32,int64,*struct{}}
type XMemJournal struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 unsafe.Pointer
X5 struct {
X0 int64
X1 unsafe.Pointer
}
X6 struct {
X0 int64
X1 unsafe.Pointer
}
X7 int32
X8 unsafe.Pointer
X9 *int8
} // t189 struct{*struct{},int32,int32,int32,*struct{},struct{int64,*struct{}},struct{int64,*struct{}},int32,*struct{},*int8}
type XFileChunk struct {
X0 unsafe.Pointer
X1 [8]uint8
} // t190 struct{*struct{},[8]uint8}
type XWalker struct {
X0 unsafe.Pointer
X1 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
X2 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
X3 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
X4 int32
X5 uint8
X6 struct {
X [0]struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 *int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
}
U [4]byte
}
} // t191 struct{*struct{},*func(*struct{},*struct{})int32,*func(*struct{},*struct{})int32,*func(*struct{},*struct{}),int32,uint8,union{*struct{},int32,int32,*struct{},*struct{},*struct{},*int32,*struct{},*struct{},*struct{},*struct{}}}
type XIdList struct {
X0 unsafe.Pointer
X1 int32
} // t192 struct{*struct{},int32}
type TIdList_item struct {
X0 *int8
X1 int32
} // t193 struct{*int8,int32}
type XNameContext struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 int32
X6 int32
X7 uint16
} // t194 struct{*struct{},*struct{},*struct{},*struct{},*struct{},int32,int32,uint16}
type XExprSpan struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
} // t195 struct{*struct{},*int8,*int8}
type XSelectDest struct {
X0 uint8
X1 *int8
X2 int32
X3 int32
X4 int32
X5 unsafe.Pointer
} // t196 struct{uint8,*int8,int32,int32,int32,*struct{}}
type XAggInfo struct {
X0 uint8
X1 uint8
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 int32
X10 int32
X11 unsafe.Pointer
X12 int32
} // t197 struct{uint8,uint8,int32,int32,int32,int32,int32,*struct{},*struct{},int32,int32,*struct{},int32}
type TAggInfo_col struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 int32
X5 unsafe.Pointer
} // t198 struct{*struct{},int32,int32,int32,int32,*struct{}}
type TAggInfo_func struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int32
X3 int32
} // t199 struct{*struct{},*struct{},int32,int32}
type TSrcCount struct {
X0 unsafe.Pointer
X1 int32
X2 int32
} // t200 struct{*struct{},int32,int32}
type XStat4Accum struct {
X0 uint32
X1 uint32
X2 int32
X3 int32
X4 int32
X5 struct {
X0 *uint32
X1 *uint32
}
X6 uint32
X7 unsafe.Pointer
X8 int32
X9 int32
X10 int32
X11 int32
X12 unsafe.Pointer
X13 unsafe.Pointer
} // t201 struct{uint32,uint32,int32,int32,int32,struct{*uint32,*uint32},uint32,*struct{},int32,int32,int32,int32,*struct{},*struct{}}
type XanalysisInfo struct {
X0 unsafe.Pointer
X1 *int8
} // t202 struct{*struct{},*int8}
type XDbFixer struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int32
X3 *int8
X4 *int8
X5 unsafe.Pointer
} // t203 struct{*struct{},*struct{},int32,*int8,*int8,*struct{}}
type XTriggerStep struct {
X0 uint8
X1 uint8
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 *int8
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
} // t204 struct{uint8,uint8,*struct{},*struct{},*int8,*struct{},*struct{},*struct{},*struct{},*struct{}}
type XAuthContext struct {
X0 *int8
X1 unsafe.Pointer
} // t205 struct{*int8,*struct{}}
type XTableLock struct {
X0 int32
X1 int32
X2 uint8
X3 *int8
} // t206 struct{int32,int32,uint8,*int8}
type XModule struct {
X0 unsafe.Pointer
X1 *int8
X2 unsafe.Pointer
X3 func(*crt.TLS, unsafe.Pointer)
X4 unsafe.Pointer
} // t207 struct{*struct{},*int8,*struct{},*func(*struct{}),*struct{}}
type XWhereTerm struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int16
X3 uint16
X4 uint16
X5 uint8
X6 uint8
X7 int32
X8 int32
X9 int32
X10 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
}
X11 uint64
X12 uint64
} // t208 struct{*struct{},*struct{},int16,uint16,uint16,uint8,uint8,int32,int32,int32,union{int32,*struct{},*struct{}},uint64,uint64}
type XWhereClause struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 int32
X4 int32
X5 unsafe.Pointer
X6 [8]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int16
X3 uint16
X4 uint16
X5 uint8
X6 uint8
X7 int32
X8 int32
X9 int32
X10 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
}
X11 uint64
X12 uint64
}
} // t209 struct{*struct{},*struct{},uint8,int32,int32,*struct{},[8]struct{*struct{},*struct{},int16,uint16,uint16,uint8,uint8,int32,int32,int32,union{int32,*struct{},*struct{}},uint64,uint64}}
type XWhereMaskSet struct {
X0 int32
X1 [64]int32
} // t210 struct{int32,[64]int32}
type XWhereLevel struct {
X0 int32
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 int32
X8 int32
X9 uint32
X10 int32
X11 uint8
X12 uint8
X13 uint8
X14 uint8
X15 int32
X16 int32
X17 struct {
X [0]struct {
X0 struct {
X0 int32
X1 unsafe.Pointer
}
X1 unsafe.Pointer
}
U [8]byte
}
X18 unsafe.Pointer
X19 uint64
} // t211 struct{int32,int32,int32,int32,int32,int32,int32,int32,int32,uint32,int32,uint8,uint8,uint8,uint8,int32,int32,union{struct{int32,*struct{}},*struct{}},*struct{},uint64}
type XWhereInfo struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 int16
X6 [2]int32
X7 int32
X8 int32
X9 int32
X10 uint16
X11 uint8
X12 int8
X13 uint8
X14 uint8
X15 uint8
X16 uint8
X17 uint8
X18 int32
X19 unsafe.Pointer
X20 uint64
X21 int16
X22 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 int32
X4 int32
X5 unsafe.Pointer
X6 [8]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int16
X3 uint16
X4 uint16
X5 uint8
X6 uint8
X7 int32
X8 int32
X9 int32
X10 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
}
X11 uint64
X12 uint64
}
}
X23 struct {
X0 int32
X1 [64]int32
}
X24 [1]struct {
X0 int32
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 int32
X8 int32
X9 uint32
X10 int32
X11 uint8
X12 uint8
X13 uint8
X14 uint8
X15 int32
X16 int32
X17 struct {
X [0]struct {
X0 struct {
X0 int32
X1 unsafe.Pointer
}
X1 unsafe.Pointer
}
U [8]byte
}
X18 unsafe.Pointer
X19 uint64
}
} // t212 struct{*struct{},*struct{},*struct{},*struct{},*struct{},int16,[2]int32,int32,int32,int32,uint16,uint8,int8,uint8,uint8,uint8,uint8,uint8,int32,*struct{},uint64,int16,struct{*struct{},*struct{},uint8,int32,int32,*struct{},[8]struct{*struct{},*struct{},int16,uint16,uint16,uint8,uint8,int32,int32,int32,union{int32,*struct{},*struct{}},uint64,uint64}},struct{int32,[64]int32},[1]struct{int32,int32,int32,int32,int32,int32,int32,int32,int32,uint32,int32,uint8,uint8,uint8,uint8,int32,int32,union{struct{int32,*struct{}},*struct{}},*struct{},uint64}}
type TcompareInfo struct {
X0 uint8
X1 uint8
X2 uint8
X3 uint8
} // t213 struct{uint8,uint8,uint8,uint8}
type XSumCtx struct {
X0 float64
X1 int64
X2 int64
X3 uint8
X4 uint8
} // t214 struct{float64,int64,int64,uint8,uint8}
type XCountCtx struct{ X0 int64 } // t215 struct{int64}
type XFuncDestructor struct {
X0 int32
X1 func(*crt.TLS, unsafe.Pointer)
X2 unsafe.Pointer
} // t216 struct{int32,*func(*struct{}),*struct{}}
type XTriggerPrg struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 int32
X4 [2]uint32
} // t217 struct{*struct{},*struct{},*struct{},int32,[2]uint32}
type Xsqlite3_api_routines struct {
X0 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X1 func(*crt.TLS, unsafe.Pointer) int32
X2 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
X3 func(*crt.TLS, unsafe.Pointer, int32, float64) int32
X4 func(*crt.TLS, unsafe.Pointer, int32, int32) int32
X5 func(*crt.TLS, unsafe.Pointer, int32, int64) int32
X6 func(*crt.TLS, unsafe.Pointer, int32) int32
X7 func(*crt.TLS, unsafe.Pointer) int32
X8 func(*crt.TLS, unsafe.Pointer, *int8) int32
X9 func(*crt.TLS, unsafe.Pointer, int32) *int8
X10 func(*crt.TLS, unsafe.Pointer, int32, *int8, int32, func(*crt.TLS, unsafe.Pointer)) int32
X11 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer)) int32
X12 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer) int32
X13 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32) int32, unsafe.Pointer) int32
X14 func(*crt.TLS, unsafe.Pointer, int32) int32
X15 func(*crt.TLS, unsafe.Pointer) int32
X16 func(*crt.TLS, unsafe.Pointer) int32
X17 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *int8)) int32
X18 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer)) int32
X19 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X20 func(*crt.TLS, unsafe.Pointer, int32) int32
X21 func(*crt.TLS, unsafe.Pointer, int32) int32
X22 func(*crt.TLS, unsafe.Pointer) int32
X23 func(*crt.TLS, unsafe.Pointer, int32) *int8
X24 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X25 func(*crt.TLS, unsafe.Pointer, int32) *int8
X26 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X27 func(*crt.TLS, unsafe.Pointer, int32) float64
X28 func(*crt.TLS, unsafe.Pointer, int32) int32
X29 func(*crt.TLS, unsafe.Pointer, int32) int64
X30 func(*crt.TLS, unsafe.Pointer, int32) *int8
X31 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X32 func(*crt.TLS, unsafe.Pointer, int32) *int8
X33 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X34 func(*crt.TLS, unsafe.Pointer, int32) *int8
X35 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X36 func(*crt.TLS, unsafe.Pointer, int32) *uint8
X37 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X38 func(*crt.TLS, unsafe.Pointer, int32) int32
X39 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X40 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer) unsafe.Pointer
X41 func(*crt.TLS, *int8) int32
X42 func(*crt.TLS, unsafe.Pointer) int32
X43 func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
X44 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32) int32
X45 func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
X46 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
X47 func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer) int32
X48 func(*crt.TLS, unsafe.Pointer) int32
X49 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X50 func(*crt.TLS, unsafe.Pointer, *int8) int32
X51 func(*crt.TLS, int32) int32
X52 func(*crt.TLS, unsafe.Pointer) int32
X53 func(*crt.TLS, unsafe.Pointer) *int8
X54 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X55 func(*crt.TLS, unsafe.Pointer, *int8, func(*crt.TLS, unsafe.Pointer, int32, **int8, **int8) int32, unsafe.Pointer, **int8) int32
X56 func(*crt.TLS, unsafe.Pointer) int32
X57 func(*crt.TLS, unsafe.Pointer) int32
X58 func(*crt.TLS, unsafe.Pointer)
X59 func(*crt.TLS, **int8)
X60 func(*crt.TLS, unsafe.Pointer) int32
X61 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X62 func(*crt.TLS, unsafe.Pointer, *int8, ***int8, *int32, *int32, **int8) int32
X63 func(*crt.TLS) int32
X64 func(*crt.TLS, unsafe.Pointer)
X65 func(*crt.TLS, unsafe.Pointer) int64
X66 func(*crt.TLS) *int8
X67 func(*crt.TLS) int32
X68 func(*crt.TLS, int32) unsafe.Pointer
X69 func(*crt.TLS, *int8, ...interface{}) *int8
X70 func(*crt.TLS, *int8, *unsafe.Pointer) int32
X71 func(*crt.TLS, unsafe.Pointer, *unsafe.Pointer) int32
X72 func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
X73 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
X74 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8, uint64), unsafe.Pointer) unsafe.Pointer
X75 func(*crt.TLS, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer) int32, unsafe.Pointer)
X76 func(*crt.TLS, unsafe.Pointer, int32) unsafe.Pointer
X77 func(*crt.TLS, unsafe.Pointer) int32
X78 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
X79 func(*crt.TLS, unsafe.Pointer, float64)
X80 func(*crt.TLS, unsafe.Pointer, *int8, int32)
X81 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32)
X82 func(*crt.TLS, unsafe.Pointer, int32)
X83 func(*crt.TLS, unsafe.Pointer, int64)
X84 func(*crt.TLS, unsafe.Pointer)
X85 func(*crt.TLS, unsafe.Pointer, *int8, int32, func(*crt.TLS, unsafe.Pointer))
X86 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
X87 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
X88 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, func(*crt.TLS, unsafe.Pointer))
X89 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer)
X90 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer), unsafe.Pointer) unsafe.Pointer
X91 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, *int8, *int8) int32, unsafe.Pointer) int32
X92 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer))
X93 func(*crt.TLS, int32, *int8, *int8, ...interface{}) *int8
X94 func(*crt.TLS, unsafe.Pointer) int32
X95 func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, **int8, **int8, *int32, *int32, *int32) int32
X96 func(*crt.TLS)
X97 func(*crt.TLS, unsafe.Pointer) int32
X98 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, *int8), unsafe.Pointer) unsafe.Pointer
X99 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) int32
X100 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *int8, *int8, int64), unsafe.Pointer) unsafe.Pointer
X101 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X102 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X103 func(*crt.TLS, unsafe.Pointer) int32
X104 func(*crt.TLS, unsafe.Pointer) int32
X105 func(*crt.TLS, unsafe.Pointer) float64
X106 func(*crt.TLS, unsafe.Pointer) int32
X107 func(*crt.TLS, unsafe.Pointer) int64
X108 func(*crt.TLS, unsafe.Pointer) int32
X109 func(*crt.TLS, unsafe.Pointer) *uint8
X110 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X111 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X112 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X113 func(*crt.TLS, unsafe.Pointer) int32
X114 func(*crt.TLS, *int8, unsafe.Pointer) *int8
X115 func(*crt.TLS, unsafe.Pointer, *int8, int32) int32
X116 func(*crt.TLS, unsafe.Pointer, *int8, int32, *unsafe.Pointer, **int8) int32
X117 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, *unsafe.Pointer, *unsafe.Pointer) int32
X118 func(*crt.TLS, unsafe.Pointer) int32
X119 func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer)) int32
X120 func(*crt.TLS, unsafe.Pointer, int32, int32) int32
X121 func(*crt.TLS, unsafe.Pointer) int32
X122 func(*crt.TLS, unsafe.Pointer) int32
X123 func(*crt.TLS, unsafe.Pointer, *int8, *int8, *int8, int64, int32, *unsafe.Pointer) int32
X124 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
X125 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, int32, int32) int32
X126 func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, int32, unsafe.Pointer) int32, func(*crt.TLS, unsafe.Pointer)) int32
X127 func(*crt.TLS, unsafe.Pointer, *int8, int32, unsafe.Pointer) int32
X128 func(*crt.TLS, int32) int64
X129 func(*crt.TLS) int64
X130 func(*crt.TLS, int32) unsafe.Pointer
X131 func(*crt.TLS, unsafe.Pointer)
X132 func(*crt.TLS, unsafe.Pointer)
X133 func(*crt.TLS, unsafe.Pointer)
X134 func(*crt.TLS, unsafe.Pointer) int32
X135 func(*crt.TLS, *int8, *unsafe.Pointer, int32, *int8) int32
X136 func(*crt.TLS, int32) int32
X137 func(*crt.TLS, unsafe.Pointer)
X138 func(*crt.TLS, unsafe.Pointer)
X139 func(*crt.TLS, int32) int32
X140 func(*crt.TLS, int32)
X141 func(*crt.TLS, *int8) unsafe.Pointer
X142 func(*crt.TLS, unsafe.Pointer, int32) int32
X143 func(*crt.TLS, unsafe.Pointer) int32
X144 func(*crt.TLS) int32
X145 func(*crt.TLS, unsafe.Pointer, int32)
X146 func(*crt.TLS, unsafe.Pointer, int32)
X147 func(*crt.TLS, int32, ...interface{}) int32
X148 func(*crt.TLS, int32, unsafe.Pointer)
X149 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X150 func(*crt.TLS, unsafe.Pointer, int32) int32
X151 func(*crt.TLS, unsafe.Pointer, int32, int32) int32
X152 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer) unsafe.Pointer
X153 func(*crt.TLS, unsafe.Pointer) *int8
X154 func(*crt.TLS, int32, *int32, *int32, int32) int32
X155 func(*crt.TLS, unsafe.Pointer) int32
X156 func(*crt.TLS, unsafe.Pointer, *int8, unsafe.Pointer, *int8) unsafe.Pointer
X157 func(*crt.TLS, unsafe.Pointer) int32
X158 func(*crt.TLS, unsafe.Pointer) int32
X159 func(*crt.TLS, unsafe.Pointer, int32) int32
X160 func(*crt.TLS, int32) *int8
X161 func(*crt.TLS, *int8) int32
X162 func(*crt.TLS, unsafe.Pointer, *int8, int32, int32, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer, int32, *unsafe.Pointer), func(*crt.TLS, unsafe.Pointer), func(*crt.TLS, unsafe.Pointer)) int32
X163 func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
X164 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X165 func(*crt.TLS, unsafe.Pointer, int32, *int32, *int32, int32) int32
X166 func(*crt.TLS, unsafe.Pointer) int32
X167 func(*crt.TLS, int32, *int8, ...interface{})
X168 func(*crt.TLS, int64) int64
X169 func(*crt.TLS) *int8
X170 func(*crt.TLS, unsafe.Pointer, int32, int32) int32
X171 func(*crt.TLS, *int8, *int8, int32) int32
X172 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, *unsafe.Pointer, int32), unsafe.Pointer) int32
X173 func(*crt.TLS, unsafe.Pointer, int32) int32
X174 func(*crt.TLS, unsafe.Pointer, *int8) int32
X175 func(*crt.TLS, unsafe.Pointer, func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, *int8, int32) int32, unsafe.Pointer) unsafe.Pointer
X176 func(*crt.TLS, unsafe.Pointer, int64) int32
X177 func(*crt.TLS, unsafe.Pointer, int32, ...interface{}) int32
X178 func(*crt.TLS, unsafe.Pointer) int32
X179 func(*crt.TLS, unsafe.Pointer) int32
X180 func(*crt.TLS, unsafe.Pointer, *int8) *int8
X181 func(*crt.TLS, unsafe.Pointer, *int8) int32
X182 func(*crt.TLS, unsafe.Pointer) int32
X183 func(*crt.TLS, int32) *int8
X184 func(*crt.TLS, unsafe.Pointer) int32
X185 func(*crt.TLS, unsafe.Pointer) int32
X186 func(*crt.TLS, *int8, *int8) int32
X187 func(*crt.TLS, *int8, *int8, int32) int32
X188 func(*crt.TLS, *int8, *int8, int64) int64
X189 func(*crt.TLS, *int8, *int8) *int8
X190 func(*crt.TLS, int32, *int8, *int8, unsafe.Pointer) *int8
X191 func(*crt.TLS, unsafe.Pointer, *int8, int32, *int32, *int32) int32
X192 func(*crt.TLS, func(*crt.TLS)) int32
X193 func(*crt.TLS, unsafe.Pointer, int32, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer)) int32
X194 func(*crt.TLS, unsafe.Pointer, int32, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8) int32
X195 func(*crt.TLS, func(*crt.TLS)) int32
X196 func(*crt.TLS, unsafe.Pointer, *int8, *int8, **int8) int32
X197 func(*crt.TLS, uint64) unsafe.Pointer
X198 func(*crt.TLS, unsafe.Pointer) uint64
X199 func(*crt.TLS, unsafe.Pointer, uint64) unsafe.Pointer
X200 func(*crt.TLS)
X201 func(*crt.TLS, unsafe.Pointer, unsafe.Pointer, uint64, func(*crt.TLS, unsafe.Pointer))
X202 func(*crt.TLS, unsafe.Pointer, *int8, uint64, func(*crt.TLS, unsafe.Pointer), uint8)
X203 func(*crt.TLS, *int8, *int8) int32
X204 func(*crt.TLS, unsafe.Pointer) unsafe.Pointer
X205 func(*crt.TLS, unsafe.Pointer)
X206 func(*crt.TLS, unsafe.Pointer, uint64) int32
X207 func(*crt.TLS, unsafe.Pointer, int32, uint64) int32
X208 func(*crt.TLS, unsafe.Pointer) uint32
X209 func(*crt.TLS, unsafe.Pointer, uint32)
X210 func(*crt.TLS, int32, *int64, *int64, int32) int32
X211 func(*crt.TLS, *int8, *int8, uint32) int32
X212 func(*crt.TLS, unsafe.Pointer) int32
X213 func(*crt.TLS, unsafe.Pointer) int32
X214 func(*crt.TLS, unsafe.Pointer, uint32, func(*crt.TLS, uint32, unsafe.Pointer, unsafe.Pointer, unsafe.Pointer) int32, unsafe.Pointer) int32
X215 func(*crt.TLS, unsafe.Pointer) *int8
X216 func(*crt.TLS, unsafe.Pointer, int64)
} // t218 struct{*func(*struct{},int32)*struct{},*func(*struct{})int32,*func(*struct{},int32,*struct{},int32,*func(*struct{}))int32,*func(*struct{},int32,float64)int32,*func(*struct{},int32,int32)int32,*func(*struct{},int32,int64)int32,*func(*struct{},int32)int32,*func(*struct{})int32,*func(*struct{},*int8)int32,*func(*struct{},int32)*int8,*func(*struct{},int32,*int8,int32,*func(*struct{}))int32,*func(*struct{},int32,*struct{},int32,*func(*struct{}))int32,*func(*struct{},int32,*struct{})int32,*func(*struct{},*func(*struct{},int32)int32,*struct{})int32,*func(*struct{},int32)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},*struct{},*func(*struct{},*struct{},int32,*int8))int32,*func(*struct{},*struct{},*func(*struct{},*struct{},int32,*struct{}))int32,*func(*struct{},int32)*struct{},*func(*struct{},int32)int32,*func(*struct{},int32)int32,*func(*struct{})int32,*func(*struct{},int32)*int8,*func(*struct{},int32)*struct{},*func(*struct{},int32)*int8,*func(*struct{},int32)*struct{},*func(*struct{},int32)float64,*func(*struct{},int32)int32,*func(*struct{},int32)int64,*func(*struct{},int32)*int8,*func(*struct{},int32)*struct{},*func(*struct{},int32)*int8,*func(*struct{},int32)*struct{},*func(*struct{},int32)*int8,*func(*struct{},int32)*struct{},*func(*struct{},int32)*uint8,*func(*struct{},int32)*struct{},*func(*struct{},int32)int32,*func(*struct{},int32)*struct{},*func(*struct{},*func(*struct{})int32,*struct{})*struct{},*func(*int8)int32,*func(*struct{})int32,*func(*struct{},*int8,int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32)int32,*func(*struct{},*struct{},int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32)int32,*func(*struct{},*int8,int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}))int32,*func(*struct{},*struct{},int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}))int32,*func(*struct{},*int8,*struct{},*struct{})int32,*func(*struct{})int32,*func(*struct{})*struct{},*func(*struct{},*int8)int32,*func(int32)int32,*func(*struct{})int32,*func(*struct{})*int8,*func(*struct{})*struct{},*func(*struct{},*int8,*func(*struct{},int32,**int8,**int8)int32,*struct{},**int8)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{}),*func(**int8),*func(*struct{})int32,*func(*struct{},int32)*struct{},*func(*struct{},*int8,***int8,*int32,*int32,**int8)int32,*func()int32,*func(*struct{}),*func(*struct{})int64,*func()*int8,*func()int32,*func(int32)*struct{},*func(*int8...)*int8,*func(*int8,**struct{})int32,*func(*struct{},**struct{})int32,*func(*struct{},*int8,int32,**struct{},**int8)int32,*func(*struct{},*struct{},int32,**struct{},**struct{})int32,*func(*struct{},*func(*struct{},*int8,uint64),*struct{})*struct{},*func(*struct{},int32,*func(*struct{})int32,*struct{}),*func(*struct{},int32)*struct{},*func(*struct{})int32,*func(*struct{},*struct{},int32,*func(*struct{})),*func(*struct{},float64),*func(*struct{},*int8,int32),*func(*struct{},*struct{},int32),*func(*struct{},int32),*func(*struct{},int64),*func(*struct{}),*func(*struct{},*int8,int32,*func(*struct{})),*func(*struct{},*struct{},int32,*func(*struct{})),*func(*struct{},*struct{},int32,*func(*struct{})),*func(*struct{},*struct{},int32,*func(*struct{})),*func(*struct{},*struct{}),*func(*struct{},*func(*struct{}),*struct{})*struct{},*func(*struct{},*func(*struct{},int32,*int8,*int8,*int8,*int8)int32,*struct{})int32,*func(*struct{},int32,*struct{},*func(*struct{})),*func(int32,*int8,*int8...)*int8,*func(*struct{})int32,*func(*struct{},*int8,*int8,*int8,**int8,**int8,*int32,*int32,*int32)int32,*func(),*func(*struct{})int32,*func(*struct{},*func(*struct{},*int8),*struct{})*struct{},*func(*struct{},*struct{})int32,*func(*struct{},*func(*struct{},int32,*int8,*int8,int64),*struct{})*struct{},*func(*struct{})*struct{},*func(*struct{})*struct{},*func(*struct{})int32,*func(*struct{})int32,*func(*struct{})float64,*func(*struct{})int32,*func(*struct{})int64,*func(*struct{})int32,*func(*struct{})*uint8,*func(*struct{})*struct{},*func(*struct{})*struct{},*func(*struct{})*struct{},*func(*struct{})int32,*func(*int8,*struct{})*int8,*func(*struct{},*int8,int32)int32,*func(*struct{},*int8,int32,**struct{},**int8)int32,*func(*struct{},*struct{},int32,**struct{},**struct{})int32,*func(*struct{})int32,*func(*struct{},*int8,*struct{},*struct{},*func(*struct{}))int32,*func(*struct{},int32,int32)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},*int8,*int8,*int8,int64,int32,**struct{})int32,*func(*struct{},*struct{},int32,int32)int32,*func(*struct{},*struct{},int32,int32)int32,*func(*struct{},*int8,int32,*struct{},*func(*struct{},int32,*struct{},int32,*struct{})int32,*func(*struct{}))int32,*func(*struct{},*int8,int32,*struct{})int32,*func(int32)int64,*func()int64,*func(int32)*struct{},*func(*struct{}),*func(*struct{}),*func(*struct{}),*func(*struct{})int32,*func(*int8,**struct{},int32,*int8)int32,*func(int32)int32,*func(*struct{}),*func(*struct{}),*func(int32)int32,*func(int32),*func(*int8)*struct{},*func(*struct{},int32)int32,*func(*struct{})int32,*func()int32,*func(*struct{},int32),*func(*struct{},int32),*func(int32...)int32,*func(int32,*struct{}),*func(*struct{})*struct{},*func(*struct{},int32)int32,*func(*struct{},int32,int32)int32,*func(*struct{},*struct{})*struct{},*func(*struct{})*int8,*func(int32,*int32,*int32,int32)int32,*func(*struct{})int32,*func(*struct{},*int8,*struct{},*int8)*struct{},*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},int32)int32,*func(int32)*int8,*func(*int8)int32,*func(*struct{},*int8,int32,int32,*struct{},*func(*struct{},int32,**struct{}),*func(*struct{},int32,**struct{}),*func(*struct{}),*func(*struct{}))int32,*func(*struct{},int32...)int32,*func(*struct{})*struct{},*func(*struct{},int32,*int32,*int32,int32)int32,*func(*struct{})int32,*func(int32,*int8...),*func(int64)int64,*func()*int8,*func(*struct{},int32,int32)int32,*func(*int8,*int8,int32)int32,*func(*struct{},*func(**struct{},int32),*struct{})int32,*func(*struct{},int32)int32,*func(*struct{},*int8)int32,*func(*struct{},*func(*struct{},*struct{},*int8,int32)int32,*struct{})*struct{},*func(*struct{},int64)int32,*func(*struct{},int32...)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},*int8)*int8,*func(*struct{},*int8)int32,*func(*struct{})int32,*func(int32)*int8,*func(*struct{})int32,*func(*struct{})int32,*func(*int8,*int8)int32,*func(*int8,*int8,int32)int32,*func(*int8,*int8,int64)int64,*func(*int8,*int8)*int8,*func(int32,*int8,*int8,*struct{})*int8,*func(*struct{},*int8,int32,*int32,*int32)int32,*func(*func())int32,*func(*struct{},int32,*struct{},uint64,*func(*struct{}))int32,*func(*struct{},int32,*int8,uint64,*func(*struct{}),uint8)int32,*func(*func())int32,*func(*struct{},*int8,*int8,**int8)int32,*func(uint64)*struct{},*func(*struct{})uint64,*func(*struct{},uint64)*struct{},*func(),*func(*struct{},*struct{},uint64,*func(*struct{})),*func(*struct{},*int8,uint64,*func(*struct{}),uint8),*func(*int8,*int8)int32,*func(*struct{})*struct{},*func(*struct{}),*func(*struct{},uint64)int32,*func(*struct{},int32,uint64)int32,*func(*struct{})uint32,*func(*struct{},uint32),*func(int32,*int64,*int64,int32)int32,*func(*int8,*int8,uint32)int32,*func(*struct{})int32,*func(*struct{})int32,*func(*struct{},uint32,*func(uint32,*struct{},*struct{},*struct{})int32,*struct{})int32,*func(*struct{})*int8,*func(*struct{},int64)}
type Tsqlite3AutoExtList struct {
X0 uint32
X1 *func(*crt.TLS)
} // t219 struct{uint32,**func()}
type XPragmaName struct {
X0 *int8
X1 uint8
X2 uint8
X3 uint8
X4 uint8
X5 uint32
} // t220 struct{*int8,uint8,uint8,uint8,uint8,uint32}
type TEncName struct {
X0 *int8
X1 uint8
} // t221 struct{*int8,uint8}
type XPragmaVtab struct {
X0 struct {
X0 unsafe.Pointer
X1 int32
X2 *int8
}
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 uint8
X4 uint8
} // t222 struct{struct{*struct{},int32,*int8},*struct{},*struct{},uint8,uint8}
type Xsqlite3_index_info struct {
X0 int32
X1 unsafe.Pointer
X2 int32
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 int32
X6 *int8
X7 int32
X8 int32
X9 float64
X10 int64
X11 int32
X12 uint64
} // t223 struct{int32,*struct{},int32,*struct{},*struct{},int32,*int8,int32,int32,float64,int64,int32,uint64}
type Tsqlite3_index_constraint struct {
X0 int32
X1 uint8
X2 uint8
X3 int32
} // t224 struct{int32,uint8,uint8,int32}
type Tsqlite3_index_orderby struct {
X0 int32
X1 uint8
} // t225 struct{int32,uint8}
type XPragmaVtabCursor struct {
X0 struct{ X0 unsafe.Pointer }
X1 unsafe.Pointer
X2 int64
X3 [2]*int8
} // t226 struct{struct{*struct{}},*struct{},int64,[2]*int8}
type XSortCtx struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 int32
X5 int32
X6 int32
X7 uint8
X8 uint8
} // t227 struct{*struct{},int32,int32,int32,int32,int32,int32,uint8,uint8}
type XDistinctCtx struct {
X0 uint8
X1 uint8
X2 int32
X3 int32
} // t228 struct{uint8,uint8,int32,int32}
type XSubstContext struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
X4 unsafe.Pointer
} // t229 struct{*struct{},int32,int32,int32,*struct{}}
type THavingToWhereCtx struct {
X0 *unsafe.Pointer
X1 unsafe.Pointer
} // t230 struct{**struct{},*struct{}}
type XTabResult struct {
X0 **int8
X1 *int8
X2 uint32
X3 uint32
X4 uint32
X5 uint32
X6 int32
} // t231 struct{**int8,*int8,uint32,uint32,uint32,uint32,int32}
type XVtabCtx struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 int32
} // t232 struct{*struct{},*struct{},*struct{},int32}
type XWhereLoop struct {
X0 uint64
X1 uint64
X2 int8
X3 uint8
X4 uint8
X5 int16
X6 int16
X7 int16
X8 struct {
X [0]struct {
X0 struct {
X0 uint16
X1 uint16
X2 uint16
X3 uint16
X4 unsafe.Pointer
}
X1 struct {
X0 int32
X1 uint8
X2 int8
X3 uint16
X4 *int8
}
}
U [12]byte
}
X9 uint32
X10 uint16
X11 uint16
X12 uint16
X13 *unsafe.Pointer
X14 unsafe.Pointer
X15 [3]unsafe.Pointer
} // t233 struct{uint64,uint64,int8,uint8,uint8,int16,int16,int16,union{struct{uint16,uint16,uint16,uint16,*struct{}},struct{int32,uint8,int8,uint16,*int8}},uint32,uint16,uint16,uint16,**struct{},*struct{},[3]*struct{}}
type TInLoop struct {
X0 int32
X1 int32
X2 uint8
} // t234 struct{int32,int32,uint8}
type XIdxExprTrans struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 int32
} // t235 struct{*struct{},int32,int32,int32}
type XWhereOrInfo struct {
X0 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 int32
X4 int32
X5 unsafe.Pointer
X6 [8]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int16
X3 uint16
X4 uint16
X5 uint8
X6 uint8
X7 int32
X8 int32
X9 int32
X10 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
}
X11 uint64
X12 uint64
}
}
X1 uint64
} // t236 struct{struct{*struct{},*struct{},uint8,int32,int32,*struct{},[8]struct{*struct{},*struct{},int16,uint16,uint16,uint8,uint8,int32,int32,int32,union{int32,*struct{},*struct{}},uint64,uint64}},uint64}
type XWhereAndInfo struct {
X0 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 uint8
X3 int32
X4 int32
X5 unsafe.Pointer
X6 [8]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int16
X3 uint16
X4 uint16
X5 uint8
X6 uint8
X7 int32
X8 int32
X9 int32
X10 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
}
X11 uint64
X12 uint64
}
}
} // t237 struct{struct{*struct{},*struct{},uint8,int32,int32,*struct{},[8]struct{*struct{},*struct{},int16,uint16,uint16,uint8,uint8,int32,int32,int32,union{int32,*struct{},*struct{}},uint64,uint64}}}
type XWhereOrCost struct {
X0 uint64
X1 int16
X2 int16
} // t238 struct{uint64,int16,int16}
type XWhereOrSet struct {
X0 uint16
X1 [3]struct {
X0 uint64
X1 int16
X2 int16
}
} // t239 struct{uint16,[3]struct{uint64,int16,int16}}
type XWhereScan struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 *int8
X3 unsafe.Pointer
X4 int8
X5 uint8
X6 uint8
X7 uint32
X8 int32
X9 [11]int32
X10 [11]int16
} // t240 struct{*struct{},*struct{},*int8,*struct{},int8,uint8,uint8,uint32,int32,[11]int32,[11]int16}
type XWhereLoopBuilder struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 uint32
} // t241 struct{*struct{},*struct{},*struct{},*struct{},*struct{},uint32}
type XWherePath struct {
X0 uint64
X1 uint64
X2 int16
X3 int16
X4 int16
X5 int8
X6 *unsafe.Pointer
} // t242 struct{uint64,uint64,int16,int16,int16,int8,**struct{}}
type XYYMINORTYPE struct {
X [0]struct {
X0 int32
X1 struct {
X0 *int8
X1 uint32
}
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
}
X7 int32
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 struct {
X0 int32
X1 unsafe.Pointer
}
X12 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X13 struct {
X0 int32
X1 int32
}
}
U [12]byte
} // t243 union{int32,struct{*int8,uint32},*struct{},*struct{},*struct{},*struct{},struct{*struct{},*int8,*int8},int32,*struct{},*struct{},*struct{},struct{int32,*struct{}},struct{*struct{},*struct{}},struct{int32,int32}}
type XyyStackEntry struct {
X0 uint16
X1 uint8
X2 struct {
X [0]struct {
X0 int32
X1 struct {
X0 *int8
X1 uint32
}
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
}
X7 int32
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 struct {
X0 int32
X1 unsafe.Pointer
}
X12 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X13 struct {
X0 int32
X1 int32
}
}
U [12]byte
}
} // t244 struct{uint16,uint8,union{int32,struct{*int8,uint32},*struct{},*struct{},*struct{},*struct{},struct{*struct{},*int8,*int8},int32,*struct{},*struct{},*struct{},struct{int32,*struct{}},struct{*struct{},*struct{}},struct{int32,int32}}}
type XyyParser struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 [100]struct {
X0 uint16
X1 uint8
X2 struct {
X [0]struct {
X0 int32
X1 struct {
X0 *int8
X1 uint32
}
X2 unsafe.Pointer
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 struct {
X0 unsafe.Pointer
X1 *int8
X2 *int8
}
X7 int32
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 struct {
X0 int32
X1 unsafe.Pointer
}
X12 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
X13 struct {
X0 int32
X1 int32
}
}
U [12]byte
}
}
} // t245 struct{*struct{},*struct{},[100]struct{uint16,uint8,union{int32,struct{*int8,uint32},*struct{},*struct{},*struct{},*struct{},struct{*struct{},*int8,*int8},int32,*struct{},*struct{},*struct{},struct{int32,*struct{}},struct{*struct{},*struct{}},struct{int32,int32}}}}
type t21 struct {
X0 int32
X1 uint8
X2 uint8
X3 uint8
X4 uint8
} // struct{int32,uint8,uint8,uint8,uint8}
type t9 struct {
X [0]struct {
X0 int32
X1 float64
}
U [8]byte
} // union{int32,float64}
type t7 struct {
X0 uint32
X1 uint16
X2 uint8
X3 int32
X4 int32
X5 [3]int32
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
} // struct{uint32,uint16,uint8,int32,int32,[3]int32,*struct{},*struct{},*struct{}}
type t19 struct {
X0 func(*crt.TLS, unsafe.Pointer, int32) int32
X1 unsafe.Pointer
X2 int32
} // struct{*func(*struct{},int32)int32,*struct{},int32}
type t16 struct {
X0 uint8
X1 uint8
X2 *int8
X3 float64
X4 float64
} // struct{uint8,uint8,*int8,float64,float64}
type t15 struct {
X [0]struct {
X0 float64
X1 int64
X2 int32
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
}
U [8]byte
} // union{float64,int64,int32,*struct{},*struct{},*struct{}}
type t12 struct {
X [0]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
}
U [4]byte
} // union{*struct{},*struct{}}
type t28 struct {
X0 uint8
X1 int8
} // struct{uint8,int8,}
type t29 struct {
X [0]struct {
X0 *int8
X1 unsafe.Pointer
}
U [4]byte
} // union{*int8,*struct{}}
type t45 struct {
X0 int32
X1 [100]uint8
} // struct{int32,[100]uint8}
type t43 struct {
X0 uint16
X1 uint16
} // struct{uint16,uint16}
type t37 struct {
X [0]struct {
X0 struct {
X0 uint16
X1 uint16
}
X1 int32
}
U [4]byte
} // union{struct{uint16,uint16},int32}
type t27 struct {
X [0]struct {
X0 *int8
X1 int32
}
U [4]byte
} // union{*int8,int32}
type t22 struct {
X [0]struct {
X0 [500]uint8
X1 [125]uint32
X2 [125]unsafe.Pointer
}
U [500]byte
} // union{[500]uint8,[125]uint32,[125]*struct{}}
type t41 struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 *unsafe.Pointer
X3 int32
} // struct{*struct{},*struct{},**struct{},int32}
type t39 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 *int8
X3 *int64
X4 *float64
X5 unsafe.Pointer
X6 unsafe.Pointer
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
X11 *int32
X12 unsafe.Pointer
X13 unsafe.Pointer
X14 func(*crt.TLS, unsafe.Pointer, *int32) int32
}
U [4]byte
} // union{int32,*struct{},*int8,*int64,*float64,*struct{},*struct{},*struct{},*struct{},*struct{},*struct{},*int32,*struct{},*struct{},*func(*struct{},*int32)int32}
type t46 struct {
X [0]struct {
X0 unsafe.Pointer
X1 unsafe.Pointer
X2 int32
X3 unsafe.Pointer
}
U [4]byte
} // union{*struct{},*struct{},int32,*struct{}}
type t47 struct {
X0 unsafe.Pointer
X1 *uint8
X2 int32
} // struct{*struct{},*uint8,int32}
type t73 struct {
X0 int32
X1 *int8
} // struct{int32,*int8}
type t48 struct {
X [0]struct {
X0 unsafe.Pointer
X1 int32
}
U [4]byte
} // union{*struct{},int32}
type t23 struct {
X0 int64
X1 unsafe.Pointer
} // struct{int64,*struct{}}
type t58 struct {
X [0]struct {
X0 unsafe.Pointer
X1 int32
X2 int32
X3 unsafe.Pointer
X4 unsafe.Pointer
X5 unsafe.Pointer
X6 *int32
X7 unsafe.Pointer
X8 unsafe.Pointer
X9 unsafe.Pointer
X10 unsafe.Pointer
}
U [4]byte
} // union{*struct{},int32,int32,*struct{},*struct{},*struct{},*int32,*struct{},*struct{},*struct{},*struct{}}
type t78 struct {
X0 *int8
X1 *int8
} // struct{*int8,*int8}
type t79 struct {
X0 *uint32
X1 *uint32
} // struct{*uint32,*uint32}
type t63 struct {
X [0]struct {
X0 int32
X1 unsafe.Pointer
X2 unsafe.Pointer
}
U [4]byte
} // union{int32,*struct{},*struct{}}
type t70 struct {
X [0]struct {
X0 struct {
X0 int32
X1 unsafe.Pointer
}
X1 unsafe.Pointer
}
U [8]byte
} // union{struct{int32,*struct{}},*struct{}}
type t77 struct {
X0 uint8
X1 uint8
X2 uint8
} // struct{uint8,uint8,uint8}
type t61 struct {
X0 uint16
X1 uint16
X2 uint16
X3 uint16
X4 unsafe.Pointer
} // struct{uint16,uint16,uint16,uint16,*struct{}}
type t66 struct {
X0 int32
X1 uint8
X2 int8
X3 uint16
X4 *int8
} // struct{int32,uint8,int8,uint16,*int8}
type t62 struct {
X [0]struct {
X0 struct {
X0 uint16
X1 uint16
X2 uint16
X3 uint16
X4 unsafe.Pointer
}
X1 struct {
X0 int32
X1 uint8
X2 int8
X3 uint16
X4 *int8
}
}
U [12]byte
} // union{struct{uint16,uint16,uint16,uint16,*struct{}},struct{int32,uint8,int8,uint16,*int8}}
type t35 struct {
X0 uint8
X1 uint8
} // struct{uint8,uint8}
type t80 struct {
X0 int32
X1 uint32
} // struct{int32,uint32}
func str(n int) *int8 { return (*int8)(unsafe.Pointer(&strTab[n])) }
func wstr(n int) *int32 { return (*int32)(unsafe.Pointer(&strTab[n])) }
var strTab = []byte("\x00%s:%i: assertion failure in %s: %s\x0a\x00../../../sqlite.org/sqlite-amalgamation-3190300/sqlite3.c\x00rc==SQLITE_OK || pStmt==0\x00azCols[i]!=0\x00(rc&db->errMask)==rc\x00NULL\x00unopened\x00API call with %s database connection pointer\x00%\x00width>=0\x00precision>=(-1)\x00NaN\x00Inf\x00precision>0\x00bufpt>zOut\x00(NULL)\x00bArgList==0\x00k>=0 && knSrc\x00.\x00xtype==etINVALID\x00z!=0 || N==0\x00p->zText!=0 || p->nChar==0 || p->accError\x00N>=0\x00p->accError==0 || p->nAlloc==0\x00p->zText\x00sqlite3StrAccumAppend\x00(p->zText==0 || p->zText==p->zBase)==!isMalloced(p)\x00p->nChar+(i64)N >= p->nAlloc\x00p->zText!=0 || p->nChar==0\x00sqlite3StrAccumEnlarge\x00eError==STRACCUM_NOMEM || eError==STRACCUM_TOOBIG\x00setStrAccumError\x00sqlite3StrAccumReset\x00db==0 || sqlite3_mutex_held(db->mutex)\x00p==0 || sqlite3GlobalConfig.mutex.xMutexHeld\x00sqlite3_mutex_held\x00sqlite3DbFree\x00p!=0\x00db!=0 || sqlite3MemdebugNoType(p, MEMTYPE_LOOKASIDE)\x00sqlite3DbFreeNN\x00sqlite3_mutex_held(db->mutex)\x00sqlite3DbMallocSize\x00sqlite3GlobalConfig.mutex.xMutexEnter\x00sqlite3_mutex_enter\x00op>=0 && op=0 && oppnBytesFreed==0\x00db->mallocFailed==0\x00sqlite3DbMallocRawNN\x00dbMallocRawFinish\x00EIGHT_BYTE_ALIGNMENT(p)\x00sqlite3_mutex_held(mem0.mutex)\x00n>0\x00mallocWithAlarm\x00X>=0\x00op==SQLITE_STATUS_MALLOC_SIZE || op==SQLITE_STATUS_PAGECACHE_SIZE || op==SQLITE_STATUS_SCRATCH_SIZE || op==SQLITE_STATUS_PARSER_STACK\x00sqlite3StatusHighwater\x00sqlite3StatusValue\x00sqlite3StatusUp\x00sqlite3Malloc\x00dbReallocFinish\x00sqlite3GlobalConfig.nRefInitMutex==0\x00sqlite3IsNaN(y)\x00sqlite3GlobalConfig.mutex.xMutexInit\x00misuse\x00%s at line %d of [%.10s]\x002017-06-08 14:26:16 0ee482a1e0eae22e08edc8978c9733a96603d4509645f348ebf55b579e89636b\x00p->nRef==0\x00pthreadMutexFree\x00p->id==SQLITE_MUTEX_RECURSIVE || pthreadMutexNotheld(p)\x00p->nRef>0 || p->owner==0\x00enter mutex %p (%d) with nRef=%d\x0a\x00pthreadMutexEnter\x00pthreadMutexTry\x00pthreadMutexHeld(p)\x00p->nRef==0 || p->id==SQLITE_MUTEX_RECURSIVE\x00leave mutex %p (%d) with nRef=%d\x0a\x00pthreadMutexLeave\x00p->cnt==0\x00debugMutexFree\x00p->id==SQLITE_MUTEX_RECURSIVE || debugMutexNotheld(pX)\x00debugMutexEnter\x00debugMutexTry\x00debugMutexHeld(pX)\x00debugMutexLeave\x00sqlite3MutexInit\x00GLOBAL(int, mutexIsInit)\x00sqlite3GlobalConfig.mutex.xMutexAlloc\x00sqlite3MutexAlloc\x00pcache1.isInit==0\x00pcache1Init\x00pcache1.isInit!=0\x00pcache1Shutdown\x00(szPage & (szPage-1))==0 && szPage>=512 && szPage<=65536\x00szExtra < 300\x00(pGroup)->mutex==0\x00pcache1Create\x00sqlite3_mutex_held(p->pGroup->mutex)\x00(p->pGroup)->mutex==0\x00pcache1ResizeHash\x00pCache->bPurgeable || (pCache->nMax==0 && pCache->nMin==0)\x00pGroup->nMaxPage >= pCache->nMax\x00pGroup->nMinPage >= pCache->nMin\x00pcache1Destroy\x00sqlite3_mutex_held(pCache->pGroup->mutex)\x00pCache->iMaxKey >= iLimit\x00pCache->nHash > 0\x00hnHash\x00nPage<0 || pCache->nPage==(unsigned)nPage\x00pcache1TruncateUnsafe\x00pPage!=0\x00pPage->isPinned==0\x00pPage->pLruNext\x00pPage->pLruPrev\x00pPage->isAnchor==0\x00pCache->pGroup->lru.isAnchor==1\x00pcache1PinPage\x00sqlite3_mutex_held(p->pCache->pGroup->mutex)\x00pcache1FreePage\x00pcache1.nFreeSlot<=pcache1.nSlot\x00pcache1Free\x00sqlite3_mutex_held(pGroup->mutex)\x00p->pCache->pGroup==pGroup\x00p->isPinned==0\x00pcache1EnforceMaxPage\x00pcache1RemoveFromHash\x00pcache1Cachesize\x00(pCache->pGroup)->mutex==0\x00pcache1Pagecount\x00pCache->bPurgeable || createFlag!=1\x00pCache->bPurgeable || pCache->nMin==0\x00pCache->bPurgeable==0 || pCache->nMin==10\x00pCache->nMin==0 || pCache->bPurgeable\x00pCache->nHash>0\x00pcache1Fetch\x00pCache->nPage >= pCache->nRecyclable\x00pGroup->mxPinned == pGroup->nMaxPage + 10 - pGroup->nMinPage\x00pCache->n90pct == pCache->nMax*9/10\x00pCache->nHash>0 && pCache->apHash\x00pcache1FetchStage2\x00pcache1AllocPage\x00sqlite3_mutex_notheld(pcache1.grp.mutex)\x00pcache1.nFreeSlot>=0\x00p==0 || sqlite3GlobalConfig.mutex.xMutexNotheld\x00sqlite3_mutex_notheld\x00pcache1Alloc\x00pPage->pCache==pCache\x00pPage->pLruPrev==0 && pPage->pLruNext==0\x00pPage->isPinned==1\x00pcache1Unpin\x00pPage->iKey==iOld\x00pcache1Rekey\x00pcache1Truncate\x00pcache1Shrink\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00pPrior!=0\x00sqlite3MemSize\x00OOM\x00pOther!=&aDef[i] && pOther->pNext!=&aDef[i]\x00sqlite3InsertBuiltinFuncs\x00sqlite_rename_table\x00sqlite_rename_trigger\x00sqlite_rename_parent\x00len>0\x00%.*s\"%w\"%s\x00pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex)\x00(enc&3)==(enc&~SQLITE_UTF16_ALIGNED)\x00(pVal->flags & MEM_RowSet)==0\x00sqlite3ValueText\x00pVal!=0\x00(pVal->flags & (MEM_Null))==0\x00(pVal->flags & (MEM_Ephem|MEM_Static))!=0\x000==(1&SQLITE_PTR_TO_INT(pVal->z))\x00pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0 || pVal->db->mallocFailed\x00valueToText\x00pMem->flags & MEM_Zero\x00pMem->flags&MEM_Blob\x00(pMem->flags&MEM_RowSet)==0\x00pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex)\x00sqlite3VdbeMemExpandBlob\x00sqlite3VdbeCheckMemInvariants(pMem)\x00bPreserve==0 || pMem->flags&(MEM_Blob|MEM_Str)\x00pMem->szMalloc==0 || pMem->szMalloc==sqlite3DbMallocSize(pMem->db, pMem->zMalloc)\x000\x00pMem->xDel!=0 && pMem->xDel!=SQLITE_DYNAMIC\x00(p->flags & MEM_Dyn)==0 || p->xDel!=0\x00(p->flags & MEM_Dyn)==0 || p->szMalloc==0\x00(p->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real)\x00(p->flags & MEM_Null)==0 || (p->flags & (MEM_Int|MEM_Real|MEM_Str|MEM_Blob))==0\x00p->szMalloc==0 || p->szMalloc==sqlite3DbMallocSize(p->db,p->zMalloc)\x00((p->szMalloc>0 && p->z==p->zMalloc)? 1 : 0) + ((p->flags&MEM_Dyn)!=0 ? 1 : 0) + ((p->flags&MEM_Ephem)!=0 ? 1 : 0) + ((p->flags&MEM_Static)!=0 ? 1 : 0) == 1\x00sqlite3VdbeCheckMemInvariants\x00sqlite3VdbeMemGrow\x00p->db==0 || sqlite3_mutex_held(p->db->mutex)\x00VdbeMemDynamic(p)\x00(p->flags & MEM_Agg)==0\x00(p->flags&MEM_RowSet)==0\x00p->xDel!=SQLITE_DYNAMIC && p->xDel!=0\x00vdbeMemClearExternAndSetNull\x00(pMem->flags & MEM_Null)!=0 || pFunc==pMem->u.pDef\x00(pMem->flags & MEM_Dyn)==0\x00sqlite3VdbeMemFinalize\x00desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE || desiredEnc==SQLITE_UTF16BE\x00rc==SQLITE_OK || rc==SQLITE_NOMEM\x00rc==SQLITE_OK || pMem->enc!=desiredEnc\x00rc==SQLITE_NOMEM || pMem->enc==desiredEnc\x00sqlite3VdbeChangeEncoding\x00pMem->flags&MEM_Str\x00pMem->enc!=desiredEnc\x00pMem->enc!=0\x00pMem->n>=0\x00rc==SQLITE_NOMEM\x00desiredEnc==SQLITE_UTF16BE\x00desiredEnc==SQLITE_UTF8\x00(pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len\x00sqlite3VdbeMemTranslate\x00sqlite3VdbeMemMakeWriteable\x00sqlite3VdbeCheckMemInvariants(p)\x00sqlite3VdbeMemRelease\x00sqlite3VdbeMemNulTerminate\x00!(fg&MEM_Zero)\x00!(fg&(MEM_Str|MEM_Blob))\x00fg&(MEM_Int|MEM_Real)\x00EIGHT_BYTE_ALIGNMENT(pMem)\x00%lld\x00fg & MEM_Real\x00%!.15g\x00sqlite3VdbeMemStringify\x00szNew>0\x00(pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0\x00sqlite3VdbeMemClearAndResize\x00p && p->pOut\x00sqlite3_context_db_handle\x00renameTableFunc\x00sqlite3VMPrintf\x00(p->zText==p->zBase)==!isMalloced(p)\x00sqlite3StrAccumFinish\x00p->mxAlloc>0 && !isMalloced(p)\x00strAccumFinishRealloc\x00sqlite3_mutex_held(pCtx->pOut->db->mutex)\x00sqlite3_result_text\x00(pMem->flags & MEM_RowSet)==0\x00enc!=0\x00sqlite3VdbeMemSetStr\x00sqlite3VdbeMemHandleBom\x00string or blob too big\x00sqlite3_result_error_toobig\x00renameTriggerFunc\x00%s%.*s\"%w\"\x00%s%s\x00(n&0x7fffffff)==n\x00sqlite3DbStrNDup\x00z[i]\x00sqlite3Dequote\x00julianday\x00date\x00time\x00datetime\x00strftime\x00current_time\x00current_timestamp\x00current_date\x00p->pVdbe!=0\x00sqlite3StmtCurrentTime\x00sqlite3VdbeRealValue\x00enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE\x00e>=342\x00sqlite3AtoF\x00now\x0040f-21a-21d\x00zFormat[2]>='a' && zFormat[2]<='f'\x00getDigits\x0020c:20e\x0020e\x0020b:20e\x00(p->flags & MEM_Null)==0 || (p->flags & (MEM_Str|MEM_Blob))==0\x00sqlite3ValueBytes\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x00local time unavailable\x00sqlite3_result_error\x00second\x00minute\x00hour\x00sqlite3_result_double\x00%04d-%02d-%02d\x00%02d:%02d:%02d\x00%04d-%02d-%02d %02d:%02d:%02d\x00%02d\x00%06.3f\x00%03d\x00%.16g\x00%04d\x00sqlite3_result_error_nomem\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00affinity\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00length\x00instr\x00printf\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00sum\x00total\x00avg\x00count\x00group_concat\x00glob\x00like\x00coalesce\x00not authorized\x00sqlite3_extension_init\x00%s.%s\x00unable to open shared library [%s]\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00so\x00p && p->pFunc && p->pFunc->xFinalize\x00sqlite3_mutex_held(p->pOut->db->mutex)\x00sqlite3_aggregate_context\x00(pMem->flags & MEM_Agg)==0\x00createAggContext\x00p && p->pMem && p->pFunc && p->pFunc->xFinalize\x00sqlite3_aggregate_count\x00bind on a busy prepared statement: [%s]\x00p->isPrepareV2 || p->expmask==0\x00API called with NULL prepared statement\x00API called with finalized prepared statement\x00sqlite3Error\x00vdbeUnbind\x00sqlite3ApiExit\x00db->lookaside.bDisable>0\x00sqlite3OomClear\x00count>=0\x00sqliteDefaultBusyCallback\x00unable to close due to unfinalized statements or unfinished backups\x00invalid\x00btreeEnterAll\x00p->pNext==0 || p->pNext->pBt>p->pBt\x00p->pPrev==0 || p->pPrev->pBtpBt\x00p->pNext==0 || p->pNext->db==p->db\x00p->pPrev==0 || p->pPrev->db==p->db\x00p->sharable || (p->pNext==0 && p->pPrev==0)\x00!p->locked || p->wantToLock>0\x00p->sharable || p->wantToLock==0\x00sqlite3_mutex_held(p->db->mutex)\x00(p->locked==0 && p->sharable) || p->pBt->db==p->db\x00sqlite3BtreeEnter\x00pLater->sharable\x00pLater->pNext==0 || pLater->pNext->pBt>pLater->pBt\x00!pLater->locked || pLater->wantToLock>0\x00sqlite3GlobalConfig.mutex.xMutexTry\x00sqlite3_mutex_try\x00btreeLockCarefully\x00p->locked==1\x00sqlite3_mutex_held(pBt->mutex)\x00p->db==pBt->db\x00unlockBtreeMutex\x00p->locked==0\x00sqlite3_mutex_notheld(p->pBt->mutex)\x00lockBtreeMutex\x00IsVirtual(p)\x00sqlite3BtreeHoldsAllMutexes(db)\x00sqlite3VtabDisconnect\x00db\x00pVTab->nRef>0\x00db->magic==SQLITE_MAGIC_OPEN || db->magic==SQLITE_MAGIC_ZOMBIE\x00sqlite3VtabUnlock\x00sqlite3VtabUnlockList\x00btreeLeaveAll\x00p->wantToLock>0\x00sqlite3BtreeLeave\x00connectionIsBusy\x00p\x00sqlite3BtreeIsInBackup\x00sqlite3ErrorWithMsg\x00db->nDb<=2\x00db->aDb==db->aDbStatic\x00db->lookaside.nOut==0\x00sqlite3RollbackAll\x00p==0 || sqlite3_mutex_held(p->db->mutex)\x00sqlite3BtreeIsInTrans\x00writeOnly==1 || writeOnly==0\x00tripCode==SQLITE_ABORT_ROLLBACK || tripCode==SQLITE_OK\x00rc==SQLITE_OK || (writeOnly==0 && rc2==SQLITE_OK)\x00p->pBt->inTransaction!=TRANS_NONE || p->pBt->nTransaction==0\x00p->pBt->inTransaction>=p->inTrans\x00TRANS_WRITE==pBt->inTransaction\x00countValidCursors(pBt, 1)==0\x00sqlite3BtreeRollback\x00pExcept==0 || pExcept->pBt==pBt\x00saveAllCursors\x00CURSOR_VALID==pCur->eState || CURSOR_SKIPNEXT==pCur->eState\x000==pCur->pKey\x00cursorHoldsMutex(pCur)\x00saveCursorPosition\x00CURSOR_VALID==pCur->eState\x00!pCur->curIntKey || !pCur->pKey\x00saveCursorKey\x00pCur->eState==CURSOR_VALID\x00pCur->curIntKey\x00sqlite3BtreeIntegerKey\x00CORRUPT_DB || memcmp(&info, &pCur->info, sizeof(info))==0\x00assertCellInfo\x00sqlite3BtreePayloadSize\x00pCur->iPage>=0 && pCur->apPage[pCur->iPage]\x00pCur->ixapPage[pCur->iPage]->nCell\x00sqlite3BtreePayload\x00pPage\x00eOp==0 || eOp==1\x00pCur->ixnCell\x00offset+amt <= pCur->info.nPayload\x00aPayload > pPage->aData\x00rc==SQLITE_OK && amt>0\x00pCur->aOverflow[iIdx]==0 || pCur->aOverflow[iIdx]==nextPage || CORRUPT_DB\x00pCur->curFlags & BTCF_ValidOvfl\x00pCur->pBtree->db==pBt->db\x00accessPayload\x00database corruption\x00(pPg->flags & PGHDR_MMAP)==0\x00pPager->eState>=PAGER_WRITER_LOCKED\x00assert_pager_state(pPager)\x00pPager->tempFile==0\x00sqlite3PagerWrite\x00p->eState==PAGER_OPEN || p->eState==PAGER_READER || p->eState==PAGER_WRITER_LOCKED || p->eState==PAGER_WRITER_CACHEMOD || p->eState==PAGER_WRITER_DBMOD || p->eState==PAGER_WRITER_FINISHED || p->eState==PAGER_ERROR\x00p->tempFile==0 || p->eLock==EXCLUSIVE_LOCK\x00p->tempFile==0 || pPager->changeCountDone\x00p->journalMode==PAGER_JOURNALMODE_OFF || p->useJournal\x00p->journalMode!=PAGER_JOURNALMODE_OFF || !isOpen(p->jfd)\x00!isOpen(p->fd)\x00p->noSync\x00p->journalMode==PAGER_JOURNALMODE_OFF || p->journalMode==PAGER_JOURNALMODE_MEMORY\x00p->eState!=PAGER_ERROR && p->eState!=PAGER_OPEN\x00pagerUseWal(p)==0\x00pPager->changeCountDone==0 || pPager->eLock>=RESERVED_LOCK\x00p->eLock!=PENDING_LOCK\x00!MEMDB\x00pPager->errCode==SQLITE_OK\x00sqlite3PcacheRefCount(pPager->pPCache)==0 || pPager->tempFile\x00p->eLock!=UNKNOWN_LOCK\x00p->eLock>=SHARED_LOCK\x00p->eLock>=RESERVED_LOCK\x00pPager->dbSize==pPager->dbOrigSize\x00pPager->dbOrigSize==pPager->dbFileSize\x00pPager->dbOrigSize==pPager->dbHintSize\x00pPager->setMaster==0\x00isOpen(p->jfd) || p->journalMode==PAGER_JOURNALMODE_OFF || p->journalMode==PAGER_JOURNALMODE_WAL\x00p->eLock==EXCLUSIVE_LOCK\x00!pagerUseWal(pPager)\x00p->eLock>=EXCLUSIVE_LOCK\x00pPager->dbOrigSize<=pPager->dbHintSize\x00pPager->errCode!=SQLITE_OK\x00sqlite3PcacheRefCount(pPager->pPCache)>0 || pPager->tempFile\x00assert_pager_state\x00sqlite3BitvecTestNotNull\x00pPager->useJournal\x00isOpen(pPager->jfd) || pagerUseWal(pPager)\x00isOpen(pPager->sjfd) || pPager->nSubRec==0\x00pagerUseWal(pPager) || pageInJournal(pPager, pPg) || pPg->pgno>pPager->dbOrigSize\x00pPager->nSavepoint>0\x00subjournalPage\x00MEMJOURNAL_DFLT_FILECHUNKSIZE==fileChunkSize(p->nChunkSize)\x00rc==SQLITE_OK || pFile->pMethods==0\x00sqlite3OsOpen\x00sqlite3JournalOpen\x00(iAmt+iOfst)<=p->endpoint.iOffset\x00p->readpoint.iOffset==0 || p->readpoint.pChunk!=0\x00pChunk!=0\x00memjrnlRead\x00iOfst==p->endpoint.iOffset || iOfst==0\x00iOfst>0 || p->pFirst==0\x00p->pFirst\x00!p->pFirst\x00memjrnlWrite\x00I/O OOM error\x00memjrnlTruncate\x00i>0\x00i<=p->iSize\x00sqlite3BitvecSet\x00addToSavepointBitvecs\x00(pPager->doNotSpill & SPILLFLAG_NOSYNC)==0\x00nPage>0\x00pg1<=pPg->pgno\x00(pg1+nPage)>pPg->pgno\x00(pPager->doNotSpill & SPILLFLAG_NOSYNC)!=0\x00pagerWriteLargeSector\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD\x00pPager->errCode==0\x00pPager->readOnly==0\x00pPager->eState>=PAGER_WRITER_CACHEMOD\x00(pPager->pInJournal!=0) == isOpen(pPager->jfd)\x00pagerUseWal(pPager)==0\x00pager_write\x00pPager->eState==PAGER_WRITER_LOCKED\x00pPager->pInJournal==0\x00rc!=SQLITE_OK || isOpen(pPager->jfd)\x00pager_open_journal\x00pPager->zFilename && pPager->zFilename[0]\x00databaseIsUnmoved\x00isOpen(pPager->jfd)\x00isOpen(pPager->fd) || pPager->noSync\x00pPager->journalHdr <= pPager->journalOff\x00writeJournalHdr\x00offset%JOURNAL_HDR_SZ(pPager)==0\x00offset>=c\x00(offset-c)0\x00sqlite3_randomness\x00p->nRef>0\x00sqlite3PcachePageSanity(p)\x00(p->flags & (PGHDR_DIRTY|PGHDR_CLEAN))==PGHDR_DIRTY\x00sqlite3PcacheMakeDirty\x00pPg!=0\x00pPg->pgno>0 || pPg->pPager==0\x00pCache!=0\x00(pPg->flags & PGHDR_DIRTY)==0\x00pCache->pDirty!=pPg\x00pCache->pDirtyTail!=pPg\x00pPg->flags & PGHDR_DIRTY\x00sqlite3PcachePageSanity\x00pPage->pDirtyNext || pPage==p->pDirtyTail\x00pPage->pDirtyPrev || pPage==p->pDirty\x00pPage==p->pDirtyTail\x00pPage==p->pDirty\x00p->bPurgeable || p->eCreate==2\x00p->bPurgeable==0 || p->eCreate==1\x00pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage\x00pPage->pDirtyNext->pDirtyPrev==0\x00p->eCreate==2\x00pcacheManageDirtyList\x00pPg->pgno!=PAGER_MJ_PGNO(pPager)\x00pPager->journalHdr<=pPager->journalOff\x00pPager->pInJournal!=0\x00pagerAddPageToRollbackJournal\x00sqlite3PagerUnrefNotNull\x00pPager->fd->pMethods->iVersion>=3\x00pagerReleaseMapPage\x00sqlite3PcacheRelease\x00pPager->eState==PAGER_READER\x00pagerUnlockAndRollback\x00pPager->eState==PAGER_READER || rc!=SQLITE_OK\x00rc==SQLITE_OK || rc==SQLITE_FULL || rc==SQLITE_CORRUPT || rc==SQLITE_NOMEM || (rc&0xFF)==SQLITE_IOERR || rc==SQLITE_CANTOPEN\x00sqlite3PagerRollback\x00op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK\x00iSavepoint>=0 || op==SAVEPOINT_ROLLBACK\x00rc==SQLITE_OK\x00rc!=SQLITE_DONE\x00sqlite3PagerSavepoint\x00pPager->eState!=PAGER_ERROR\x00pagerUseWal(pPager)==0 || szJ==0\x00rc!=SQLITE_OK || pPager->journalOff>=szJ\x00offset==(i64)ii*(4+pPager->pageSize)\x00pagerPlaybackSavepoint\x00walFramePgno(pWal, iFrame)!=1\x00sqlite3WalUndo\x00pWal->nWiData>0 && pWal->apWiData[0]\x00walIndexHdr\x00(iHash==0 || iFrame>HASHTABLE_NPAGE_ONE) && (iHash>=1 || iFrame<=HASHTABLE_NPAGE_ONE) && (iHash<=1 || iFrame>(HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE)) && (iHash>=2 || iFrame<=HASHTABLE_NPAGE_ONE+HASHTABLE_NPAGE) && (iHash<=2 || iFrame>(HASHTABLE_NPAGE_ONE+2*HASHTABLE_NPAGE))\x00walFramePage\x00pWal->writeLock\x00pWal->nWiData>walFramePage(pWal->hdr.mxFrame)\x00pWal->apWiData[walFramePage(pWal->hdr.mxFrame)]\x00iLimit>0\x00walCleanupHash\x00rc==SQLITE_OK || iHash>0\x00iPage==0 || *ppPage || rc!=SQLITE_OK\x00walIndexPage\x00walHashGet\x00pagerUseWal(pPager)\x00pagerUndoCallback\x00pPager!=0\x00pgno!=0\x00pPager->pPCache!=0\x00pPage==0 || pPager->hasHeldSharedLock\x00sqlite3PagerLookup\x00pCache->pCache!=0\x00createFlag==3 || createFlag==0\x00pCache->eCreate==((pCache->bPurgeable && pCache->pDirty) ? 1 : 2)\x00eCreate==0 || eCreate==1 || eCreate==2\x00createFlag==0 || pCache->eCreate==eCreate\x00createFlag==0 || eCreate==1+(!pCache->bPurgeable||!pCache->pDirty)\x00sqlite3PcacheFetch\x00sqlite3PcachePageSanity(pPgHdr)\x00sqlite3PcacheFetchFinish\x00pPgHdr->pPage==0\x00pcacheFetchFinishWithInit\x00p->nRef==1\x00sqlite3PcacheDrop\x00pWal->readLock>=0 || pWal->lockError\x00iFrame>iRead || CORRUPT_DB\x00sqlite3WalFindFrame\x00iPage>0\x00walHash\x00pPager->eState>=PAGER_READER && !MEMDB\x00isOpen(pPager->fd)\x00readDbPage\x00sqlite3_mutex_held(p->pSrc->pBt->mutex)\x00sqlite3BackupRestart\x00pcacheSortDirtyList\x00pA!=0 && pB!=0\x00pcacheMergeDirtyList\x00(isMainJrnl&~1)==0\x00(isSavepnt&~1)==0\x00isMainJrnl || pDone\x00isSavepnt || pDone==0\x00aData\x00pagerUseWal(pPager)==0 || (!isMainJrnl && isSavepnt)\x00pPager->eState>=PAGER_WRITER_CACHEMOD || (pPager->eState==PAGER_OPEN && pPager->eLock==EXCLUSIVE_LOCK)\x00pPager->eState>=PAGER_WRITER_CACHEMOD || isMainJrnl\x00!isSavepnt\x00pPg || !MEMDB\x00pPager->eState!=PAGER_OPEN || pPg==0 || pPager->tempFile\x00isSavepnt\x00(pPager->doNotSpill & SPILLFLAG_ROLLBACK)==0\x00(pPager->doNotSpill & SPILLFLAG_ROLLBACK)!=0\x00pager_playback_one_page\x00p->pDestDb\x00rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED\x00backupUpdate\x00isFatalError\x00sqlite3BtreeGetReserveNoMutex(p->pSrc)>=0\x00p->bDestLocked\x00!isFatalError(p->rc)\x00iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt)\x00zSrcData\x00sqlite3_mutex_held(p->pBt->mutex)\x00sqlite3BtreeGetReserveNoMutex\x00backupOnePage\x00pPg->nRef>0 || pPg->pPager->memDb\x00sqlite3PagerGetData\x00sqlite3BtreeHoldsMutex(p)\x00((p->pBt->nPage)&0x8000000)==0\x00p->sharable==0 || p->locked==0 || p->wantToLock>0\x00p->sharable==0 || p->locked==0 || p->db==p->pBt->db\x00p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->pBt->mutex)\x00p->sharable==0 || p->locked==0 || sqlite3_mutex_held(p->db->mutex)\x00sqlite3BtreeHoldsMutex\x00sqlite3BtreeLastPage\x00readJournalHdr\x00pageSize==0 || (pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE)\x00nReserve>=0 && nReserve<1000\x00sqlite3PagerSetPagesize\x00p->pgno>0\x00p->flags&PGHDR_DIRTY\x00sqlite3PcacheTruncate\x00(p->flags & PGHDR_CLEAN)==0\x00sqlite3PcacheMakeClean\x00pCache->nRefSum==0 && pCache->pDirty==0\x00sqlite3PcacheSetPageSize\x00getPageError\x00USEFETCH(pPager)\x00pPager->eState>=PAGER_READER\x00pPager->hasHeldSharedLock==1\x00getPageMMap\x00pPager->nExtra>=8\x00p->pExtra==(void *)&p[1]\x00p->pPage==0\x00p->flags==PGHDR_MMAP\x00p->pPager==pPager\x00pagerAcquireMapPage\x00pPg==(*ppPage)\x00pPg->pgno==pgno\x00pPg->pPager==pPager || pPg->pPager==0\x00pgno<=PAGER_MAX_PGNO && pgno!=PAGER_MJ_PGNO(pPager)\x00!isOpen(pPager->fd) || !MEMDB\x00pPg->pPager==pPager\x00rc!=SQLITE_OK\x00getPageNormal\x00sqlite3PcachePagecount\x00aWalData[3]!=pWal->nCkpt || aWalData[0]<=pWal->hdr.mxFrame\x00sqlite3WalSavepointUndo\x00isOpen(pPager->jfd) || pPager->pInJournal==0\x00sqlite3JournalIsInMemory(pPager->jfd)==0\x00pPager->journalMode==PAGER_JOURNALMODE_DELETE || pPager->journalMode==PAGER_JOURNALMODE_MEMORY || pPager->journalMode==PAGER_JOURNALMODE_WAL\x00rc2==SQLITE_OK\x00pPager->eLock==EXCLUSIVE_LOCK\x00pager_end_transaction\x00!sqlite3JournalIsInMemory(pPager->jfd)\x00zeroJournalHdr\x00dirSync==0 || dirSync==1\x00sqlite3OsDelete\x00pPager->eState!=PAGER_READER\x00pager_truncate\x00pWal->writeLock==0\x00pWal->exclusiveMode!=WAL_HEAPMEMORY_MODE || op==-1\x00pWal->readLock>=0 || (op<=0 && pWal->exclusiveMode==0)\x00pWal->exclusiveMode==0\x00pWal->readLock>=0\x00sqlite3WalExclusiveMode\x00!pPager->exclusiveMode || pPager->eLock==eLock\x00eLock==NO_LOCK || eLock==SHARED_LOCK\x00eLock!=NO_LOCK || pagerUseWal(pPager)==0\x00pPager->eLock>=eLock\x00pagerUnlockDb\x00pPager->journalOff==JOURNAL_HDR_SZ(pPager)\x00recovered %d pages from %s\x00pager_playback\x00sqlite3PagerSync\x00!isOpen(pJournal)\x00pager_delmaster\x00isOpen(pPager->fd) || pPager->tempFile\x00setSectorSize\x00rc==SQLITE_OK || !MEMDB\x00pPager->errCode==SQLITE_FULL || pPager->errCode==SQLITE_OK || (pPager->errCode & 0xff)==SQLITE_IOERR\x00pager_error\x00pPager->eState==PAGER_READER || pPager->eState==PAGER_OPEN || pPager->eState==PAGER_ERROR\x00!isOpen(pPager->jfd)\x00pPager->errCode || pPager->eState!=PAGER_ERROR\x00pPager->errCode==SQLITE_OK || !MEMDB\x00pager_unlock\x00EIGHT_BYTE_ALIGNMENT(pNew)\x00sqlite3Realloc\x00pPgnoNext\x00next==0 || rc==SQLITE_DONE\x00rc==SQLITE_OK || pPage==0\x00getOverflowPage\x00ptrmapPageno\x00offset <= (int)pBt->usableSize-5\x00pEType!=0\x00ptrmapGet\x00flags==0 || flags==PAGER_GET_NOCONTENT || flags==PAGER_GET_READONLY\x00btreeGetPage\x00pPage->aData==sqlite3PagerGetData(pDbPage)\x00btreePageFromDbPage\x00pPage->aData\x00pPage->pBt\x00pPage->pDbPage!=0\x00sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage\x00sqlite3PagerGetData(pPage->pDbPage)==pPage->aData\x00sqlite3_mutex_held(pPage->pBt->mutex)\x00releasePageNotNull\x00(writeOnly==0 || writeOnly==1) && BTCF_WriteFlag==1\x00sqlite3BtreeTripAllCursors\x00sqlite3BtreeClearCursor\x00pPager->eState!=PAGER_WRITER_FINISHED\x00sqlite3PagerPagecount\x00btreeEndTransaction\x00pLock->eLock==READ_LOCK || pLock->pBtree==p\x00downgradeAllSharedCacheTableLocks\x00p->sharable || 0==*ppIter\x00p->inTrans>0\x00(pBt->btsFlags & BTS_EXCLUSIVE)==0 || pBt->pWriter==pLock->pBtree\x00pLock->pBtree->inTrans>=pLock->eLock\x00pLock->iTable!=1 || pLock==&p->lock\x00(pBt->btsFlags & BTS_PENDING)==0 || pBt->pWriter\x00clearAllSharedCacheTableLocks\x00countValidCursors(pBt,0)==0 || pBt->inTransaction>TRANS_NONE\x00pPage1->aData\x00sqlite3PagerRefcount(pBt->pPager)==1\x00unlockBtreeIfUnused\x00pNew!=0\x00sqlite3HashInit\x00pH!=0\x00sqlite3HashClear\x00!ExprHasProperty(p, EP_IntValue) || p->u.iValue>=0\x00p->pLeft==0\x00p->pRight==0\x00p->x.pSelect==0\x00p->x.pList==0 || p->pRight==0\x00sqlite3ExprDeleteNN\x00pList->nExpr>0\x00exprListDeleteNN\x00pIndex->pSchema==pTable->pSchema || (IsVirtual(pTable) && pIndex->idxType!=SQLITE_IDXTYPE_APPDEF)\x00db==0 || sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema)\x00pOld==pIndex || pOld==0\x00nLookaside==0 || nLookaside==db->lookaside.nOut\x00deleteTable\x00pKey!=0\x00pH->htsize>0\x00sqlite3HashInsert\x00elem!=0\x00findElementWithHash\x00pEntry->count>=0\x00pH->first==0\x00pH->count==0\x00removeElementGivenHash\x00iDb>=0 && iDbnDb\x00sqlite3SchemaMutexHeld\x00i>=0 && inDb\x00sqlite3SchemaToIndex\x00db==0 || IsVirtual(pTab) || sqlite3SchemaMutexHeld(db, 0, pTab->pSchema)\x00pFKey->isDeferred==0 || pFKey->isDeferred==1\x00sqlite3FkDelete\x00pTable!=0\x00sqlite3DeleteColumnNames\x00db==0 || sqlite3SchemaMutexHeld(db, 0, p->pSchema)\x00db2\x00!db || pRet\x00vtabDisconnectAll\x00p->wantToLock==0 && p->locked==0\x00!pBt->pCursor\x00p->wantToLock==0\x00sqlite3BtreeClose\x00pBt->pCursor!=0\x00sqlite3BtreeCloseCursor\x00sqlite3_mutex_notheld(pBt->mutex)\x00removeFromSharingList\x00sqlite3GlobalConfig.mutex.xMutexFree\x00sqlite3_mutex_free\x00db || pagerUseWal(pPager)==0\x00db || pPager->pWal==0\x00!pPager->aSavepoint && !pPager->pInJournal\x00!isOpen(pPager->jfd) && !isOpen(pPager->sjfd)\x00sqlite3PagerClose\x00pWal->ckptLock==0\x00eMode!=SQLITE_CHECKPOINT_PASSIVE || xBusy==0\x00sqlite3WalCheckpoint\x00pChanged\x00page0 || pWal->writeLock==0\x00badHdr==0 || pWal->writeLock==0\x00walIndexReadHdr\x00walIndexTryHdr\x00nByte>=8\x00(nByte&0x00000007)==0\x00walChecksumBytes\x00pWal->ckptLock==1 || pWal->ckptLock==0\x00recovered %d frames from WAL file %s\x00walIndexRecover\x00cannot open file\x00idx <= HASHTABLE_NSLOT/2 + 1\x00!aPgno[idx]\x00walIndexAppend\x00walIndexWriteHdr\x00walCkptInfo\x00pIter\x00y<=pWal->hdr.mxFrame\x00walFramePgno(pWal, iFrame)==iDbpage\x00pInfo->nBackfill==pWal->hdr.mxFrame\x00pWal->ckptLock && pWal->hdr.mxFrame>0\x00walIteratorInit\x00nList<=HASHTABLE_NPAGE && nList>0\x00iSubaList && p->nList<=(1<aList==&aList[iList&~((2<nList<=(1<aList==&aList[nList&~((2< aContent[aList[i-1]]\x00walMergesort\x00nLeft>0 && nRight>0\x00iLeft>=nLeft || aContent[aLeft[iLeft]]>dbpage\x00iRight>=nRight || aContent[aRight[iRight]]>dbpage\x00walMerge\x00walCheckpoint\x00iMin<0xffffffff\x00walIteratorNext\x00pInfo->aReadMark[0]==0\x00walRestartHdr\x00cannot limit WAL size: %s\x00sqlite3PcacheClose\x00sqlite3LeaveMutexAndCloseZombie\x00sqlite3CloseExtensions\x00p->flags==MEM_Null && p->z==0\x00sqlite3_value_blob\x00pVm->db\x00columnMem\x00p->db!=0\x00columnMallocFailure\x00columnName\x00pMem->z || pMem->n==0\x00sqlite3VdbeIntValue\x00u<=LARGEST_INT64\x00u-1==LARGEST_INT64\x00sqlite3Atoi64\x00922337203685477580\x00create\x00trigger\x00temp\x00temporary\x00end\x00explain\x00!db->mallocFailed\x00sqlite3_create_collation_v2\x00unable to delete/modify collation sequence due to active statements\x00createCollation\x00enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE\x00pDel==0 || pDel==pColl\x00sqlite3HashFind\x00findCollSeqEntry\x00sqlite3FindCollSeq\x00sqlite3_create_collation16\x00(m.flags & MEM_Term)!=0 || db->mallocFailed\x00(m.flags & MEM_Str)!=0 || db->mallocFailed\x00m.z || db->mallocFailed\x00sqlite3Utf16to8\x00unable to delete/modify user-function due to active statements\x00p || db->mallocFailed\x00sqlite3CreateFunc\x00nArg>=(-2)\x00nArg>=(-1) || createFlag==0\x00sqlite3FindFunction\x00sqlite3_create_function_v2\x00sqlite3_create_function16\x00pDel==0 || pDel==pMod\x00sqlite3VtabCreateModule\x00IsVirtual(pTab)\x00pTab->pIndex==0\x00pIdx->pNext==0\x00%s\x00(rc&0xff)==rc\x00sqlite3_declare_vtab\x00zSql!=0\x00pzErrMsg!=0\x00pParse->pNewTable==0\x00pParse->pNewTrigger==0\x00pParse->nVar==0\x00pParse->pVList==0\x00tokenType==TK_SPACE || tokenType==TK_ILLEGAL\x00unrecognized token: \"%.*s\"\x00nErr==0\x00nErr==0 || pParse->rc!=SQLITE_OK\x00sqlite3RunParser\x00yypParser->yytos!=0\x00%sInput '%s'\x0a\x00yyact == YY_ERROR_ACTION\x00%sSyntax Error!\x0a\x00%sReturn. Stack=\x00%c%s\x00]\x0a\x00sqlite3Parser\x00$\x00SEMI\x00EXPLAIN\x00QUERY\x00PLAN\x00BEGIN\x00TRANSACTION\x00DEFERRED\x00IMMEDIATE\x00EXCLUSIVE\x00COMMIT\x00END\x00ROLLBACK\x00SAVEPOINT\x00RELEASE\x00TO\x00TABLE\x00CREATE\x00IF\x00NOT\x00EXISTS\x00TEMP\x00LP\x00RP\x00AS\x00WITHOUT\x00COMMA\x00ID\x00ABORT\x00ACTION\x00AFTER\x00ANALYZE\x00ASC\x00ATTACH\x00BEFORE\x00BY\x00CASCADE\x00CAST\x00COLUMNKW\x00CONFLICT\x00DATABASE\x00DESC\x00DETACH\x00EACH\x00FAIL\x00FOR\x00IGNORE\x00INITIALLY\x00INSTEAD\x00LIKE_KW\x00MATCH\x00NO\x00KEY\x00OF\x00OFFSET\x00PRAGMA\x00RAISE\x00RECURSIVE\x00REPLACE\x00RESTRICT\x00ROW\x00TRIGGER\x00VACUUM\x00VIEW\x00VIRTUAL\x00WITH\x00REINDEX\x00RENAME\x00CTIME_KW\x00ANY\x00OR\x00AND\x00IS\x00BETWEEN\x00IN\x00ISNULL\x00NOTNULL\x00NE\x00EQ\x00GT\x00LE\x00LT\x00GE\x00ESCAPE\x00BITAND\x00BITOR\x00LSHIFT\x00RSHIFT\x00PLUS\x00MINUS\x00STAR\x00SLASH\x00REM\x00CONCAT\x00COLLATE\x00BITNOT\x00INDEXED\x00STRING\x00JOIN_KW\x00CONSTRAINT\x00DEFAULT\x00PRIMARY\x00UNIQUE\x00CHECK\x00REFERENCES\x00AUTOINCR\x00ON\x00INSERT\x00DELETE\x00UPDATE\x00SET\x00DEFERRABLE\x00FOREIGN\x00DROP\x00UNION\x00ALL\x00EXCEPT\x00INTERSECT\x00SELECT\x00VALUES\x00DISTINCT\x00DOT\x00FROM\x00JOIN\x00USING\x00ORDER\x00GROUP\x00HAVING\x00LIMIT\x00WHERE\x00INTO\x00FLOAT\x00BLOB\x00INTEGER\x00VARIABLE\x00CASE\x00WHEN\x00THEN\x00ELSE\x00INDEX\x00ALTER\x00ADD\x00error\x00input\x00cmdlist\x00ecmd\x00cmdx\x00cmd\x00transtype\x00trans_opt\x00nm\x00savepoint_opt\x00create_table\x00create_table_args\x00createkw\x00ifnotexists\x00dbnm\x00columnlist\x00conslist_opt\x00table_options\x00select\x00columnname\x00carglist\x00typetoken\x00typename\x00signed\x00plus_num\x00minus_num\x00ccons\x00term\x00expr\x00onconf\x00sortorder\x00autoinc\x00eidlist_opt\x00refargs\x00defer_subclause\x00refarg\x00refact\x00init_deferred_pred_opt\x00conslist\x00tconscomma\x00tcons\x00sortlist\x00eidlist\x00defer_subclause_opt\x00orconf\x00resolvetype\x00raisetype\x00ifexists\x00fullname\x00selectnowith\x00oneselect\x00with\x00multiselect_op\x00distinct\x00selcollist\x00from\x00where_opt\x00groupby_opt\x00having_opt\x00orderby_opt\x00limit_opt\x00values\x00nexprlist\x00exprlist\x00sclp\x00as\x00seltablist\x00stl_prefix\x00joinop\x00indexed_opt\x00on_opt\x00using_opt\x00idlist\x00setlist\x00insert_cmd\x00idlist_opt\x00likeop\x00between_op\x00in_op\x00paren_exprlist\x00case_operand\x00case_exprlist\x00case_else\x00uniqueflag\x00collate\x00nmnum\x00trigger_decl\x00trigger_cmd_list\x00trigger_time\x00trigger_event\x00foreach_clause\x00when_clause\x00trigger_cmd\x00trnm\x00tridxby\x00database_kw_opt\x00key_opt\x00add_column_fullname\x00kwcolumn_opt\x00create_vtab\x00vtabarglist\x00vtabarg\x00vtabargtoken\x00lp\x00anylist\x00wqlist\x00stateno <= YY_SHIFT_COUNT\x00iLookAhead!=YYNOCODE\x00%sFALLBACK %s => %s\x0a\x00yyFallback[iFallback]==0\x00%sWILDCARD %s => %s\x0a\x00yy_find_shift_action\x00%sStack Overflow!\x0a\x00parser stack overflow\x00pParser->yytos!=0\x00pParser->yytos > pParser->yystack\x00%sPopping %s\x0a\x00yy_pop_parser_stack\x00%sShift '%s', go to state %d\x0a\x00%sShift '%s'\x0a\x00%sReduce [%s], go to state %d.\x0a\x00rowid\x00unknown table option: %.*s\x00#%d\x00%.*s\x00set list\x00t.n>=2\x00near \"%T\": syntax error\x00too many arguments on function %T\x00yymsp[-2].minor.yy145!=0\x00yymsp[-1].minor.yy145!=0\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00yyruleno!=277\x00yyruleno!=294\x00yyruleno!=295\x00yyruleno!=301\x00yyruleno!=303\x00yyruleno!=304\x00yyruleno!=305\x00yyruleno!=309\x00yyruleno!=312\x00yyruleno!=313\x00yyrulenopToplevel==0\x00!pParse->isMultiWrite || sqlite3VdbeAssertMayAbort(v, pParse->mayAbort)\x00sqlite3VdbeGetOp(v, 0)->opcode==OP_Init\x00usesStmtJournal=%d\x00pParse->iCacheLevel==0\x00sqlite3FinishCoding\x00pParse->aLabel==0\x00pParse->nLabel==0\x00pParse->nOpAlloc==0\x00pParse->szOpAlloc==0\x00sqlite3VdbeCreate\x00p->magic==VDBE_MAGIC_INIT\x00op>=0 && op<0xff\x00 r[%d]={%d:%d}\x00\x0a\x00sqlite3VdbeAddOp3\x00p->pParse->nOpAlloc<=p->nOp\x00p->pParse->nOpAlloc>p->nOp\x00growOp3\x00nOp<=(1024/sizeof(Op))\x00nNew>=(p->nOpAlloc+nOp)\x00growOpArray\x00nTemp>=20\x00pKeyInfo->aSortOrder!=0\x00k(%d\x00BINARY\x00B\x00,%s%s\x00-\x00)\x00(%.20s)\x00%s(%d)\x00%d\x00pMem->flags & MEM_Blob\x00(blob)\x00vtab:%p\x00,%d\x00]\x00program\x00zP4!=0\x00displayP4\x00IF \x00r[P2] = (%s)\x00if %s goto P2\x00@P\x00+1\x00..%d\x00..P3\x00; %s\x00Savepoint\x00\x00AutoCommit\x00\x00Transaction\x00\x00SorterNext\x00\x00PrevIfOpen\x00\x00NextIfOpen\x00\x00Prev\x00\x00Next\x00\x00Checkpoint\x00\x00JournalMode\x00\x00Vacuum\x00\x00VFilter\x00iplan=r[P3] zplan='P4'\x00VUpdate\x00data=r[P3@P2]\x00Goto\x00\x00Gosub\x00\x00InitCoroutine\x00\x00Yield\x00\x00MustBeInt\x00\x00Jump\x00\x00Not\x00r[P2]= !r[P1]\x00Once\x00\x00If\x00\x00IfNot\x00\x00IfNullRow\x00if P1.nullRow then r[P3]=NULL, goto P2\x00SeekLT\x00key=r[P3@P4]\x00SeekLE\x00key=r[P3@P4]\x00SeekGE\x00key=r[P3@P4]\x00SeekGT\x00key=r[P3@P4]\x00NoConflict\x00key=r[P3@P4]\x00NotFound\x00key=r[P3@P4]\x00Found\x00key=r[P3@P4]\x00SeekRowid\x00intkey=r[P3]\x00NotExists\x00intkey=r[P3]\x00Last\x00\x00IfSmaller\x00\x00SorterSort\x00\x00Sort\x00\x00Rewind\x00\x00IdxLE\x00key=r[P3@P4]\x00IdxGT\x00key=r[P3@P4]\x00IdxLT\x00key=r[P3@P4]\x00IdxGE\x00key=r[P3@P4]\x00RowSetRead\x00r[P3]=rowset(P1)\x00RowSetTest\x00if r[P3] in rowset(P1) goto P2\x00Program\x00\x00FkIfZero\x00if fkctr[P1]==0 goto P2\x00IfPos\x00if r[P1]>0 then r[P1]-=P3, goto P2\x00IfNotZero\x00if r[P1]!=0 then r[P1]--, goto P2\x00DecrJumpZero\x00if (--r[P1])==0 goto P2\x00IncrVacuum\x00\x00VNext\x00\x00Init\x00Start at P2\x00Return\x00\x00EndCoroutine\x00\x00HaltIfNull\x00if r[P3]=null halt\x00Halt\x00\x00Integer\x00r[P2]=P1\x00Int64\x00r[P2]=P4\x00String\x00r[P2]='P4' (len=P1)\x00Null\x00r[P2..P3]=NULL\x00SoftNull\x00r[P1]=NULL\x00Blob\x00r[P2]=P4 (len=P1)\x00Variable\x00r[P2]=parameter(P1,P4)\x00Move\x00r[P2@P3]=r[P1@P3]\x00Copy\x00r[P2@P3+1]=r[P1@P3+1]\x00SCopy\x00r[P2]=r[P1]\x00IntCopy\x00r[P2]=r[P1]\x00ResultRow\x00output=r[P1@P2]\x00CollSeq\x00\x00Function0\x00r[P3]=func(r[P2@P5])\x00Or\x00r[P3]=(r[P1] || r[P2])\x00And\x00r[P3]=(r[P1] && r[P2])\x00Function\x00r[P3]=func(r[P2@P5])\x00AddImm\x00r[P1]=r[P1]+P2\x00RealAffinity\x00\x00IsNull\x00if r[P1]==NULL goto P2\x00NotNull\x00if r[P1]!=NULL goto P2\x00Ne\x00IF r[P3]!=r[P1]\x00Eq\x00IF r[P3]==r[P1]\x00Gt\x00IF r[P3]>r[P1]\x00Le\x00IF r[P3]<=r[P1]\x00Lt\x00IF r[P3]=r[P1]\x00ElseNotEq\x00\x00BitAnd\x00r[P3]=r[P1]&r[P2]\x00BitOr\x00r[P3]=r[P1]|r[P2]\x00ShiftLeft\x00r[P3]=r[P2]<>r[P1]\x00Add\x00r[P3]=r[P1]+r[P2]\x00Subtract\x00r[P3]=r[P2]-r[P1]\x00Multiply\x00r[P3]=r[P1]*r[P2]\x00Divide\x00r[P3]=r[P2]/r[P1]\x00Remainder\x00r[P3]=r[P2]%r[P1]\x00Concat\x00r[P3]=r[P2]+r[P1]\x00Cast\x00affinity(r[P1])\x00BitNot\x00r[P1]= ~r[P1]\x00Permutation\x00\x00String8\x00r[P2]='P4'\x00Compare\x00r[P1@P3] <-> r[P2@P3]\x00Column\x00r[P3]=PX\x00Affinity\x00affinity(r[P1@P2])\x00MakeRecord\x00r[P3]=mkrec(r[P1@P2])\x00Count\x00r[P2]=count()\x00ReadCookie\x00\x00SetCookie\x00\x00ReopenIdx\x00root=P2 iDb=P3\x00OpenRead\x00root=P2 iDb=P3\x00OpenWrite\x00root=P2 iDb=P3\x00OpenDup\x00\x00OpenAutoindex\x00nColumn=P2\x00OpenEphemeral\x00nColumn=P2\x00SorterOpen\x00\x00SequenceTest\x00if( cursor[P1].ctr++ ) pc = P2\x00OpenPseudo\x00P3 columns in r[P2]\x00Close\x00\x00ColumnsUsed\x00\x00Sequence\x00r[P2]=cursor[P1].ctr++\x00NewRowid\x00r[P2]=rowid\x00Insert\x00intkey=r[P3] data=r[P2]\x00InsertInt\x00intkey=P3 data=r[P2]\x00Delete\x00\x00ResetCount\x00\x00SorterCompare\x00if key(P1)!=trim(r[P3],P4) goto P2\x00SorterData\x00r[P2]=data\x00RowData\x00r[P2]=data\x00Rowid\x00r[P2]=rowid\x00NullRow\x00\x00SorterInsert\x00key=r[P2]\x00IdxInsert\x00key=r[P2]\x00IdxDelete\x00key=r[P2@P3]\x00Seek\x00Move P3 to P1.rowid\x00IdxRowid\x00r[P2]=rowid\x00Real\x00r[P2]=P4\x00Destroy\x00\x00Clear\x00\x00ResetSorter\x00\x00CreateIndex\x00r[P2]=root iDb=P1\x00CreateTable\x00r[P2]=root iDb=P1\x00SqlExec\x00\x00ParseSchema\x00\x00LoadAnalysis\x00\x00DropTable\x00\x00DropIndex\x00\x00DropTrigger\x00\x00IntegrityCk\x00\x00RowSetAdd\x00rowset(P1)=r[P2]\x00Param\x00\x00FkCounter\x00fkctr[P1]+=P2\x00MemMax\x00r[P1]=max(r[P1],r[P2])\x00OffsetLimit\x00if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)\x00AggStep0\x00accum=r[P3] step(r[P2@P5])\x00AggStep\x00accum=r[P3] step(r[P2@P5])\x00AggFinal\x00accum=r[P1] N=P2\x00Expire\x00\x00TableLock\x00iDb=P1 root=P2 write=P3\x00VBegin\x00\x00VCreate\x00\x00VDestroy\x00\x00VOpen\x00\x00VColumn\x00r[P3]=vcolumn(P2)\x00VRename\x00\x00Pagecount\x00\x00MaxPgcnt\x00\x00CursorHint\x00\x00Noop\x00\x00Explain\x00\x00%4d %-13s %4d %4d %4d %-13s %.2X %s\x0a\x00p->iAddr=0 && addrnOp) || p->db->mallocFailed\x00sqlite3VdbeGetOp\x00i>=0 && idb->nDb && i<(int)sizeof(yDbMask)*8\x00i<(int)sizeof(p->btreeMask)*8\x00sqlite3VdbeUsesBtree\x00p->nOp>0 || p->db->mallocFailed\x00sqlite3VdbeChangeP5\x00p->nOp>0 || p->aOp==0\x00p->aOp==0 || p->aOp[p->nOp-1].zComment==0 || p->db->mallocFailed\x00p->aOp\x00vdbeVComment\x00sqlite3GetVTable\x00p->aOp!=0 || db->mallocFailed\x00p->nOp>0\x00addrnOp\x00n<0\x00sqlite3VdbeChangeP4\x00freeP4\x00sqlite3KeyInfoUnref\x00pVdbe!=0\x00codeTableLocks\x00pParse->pTriggerTab==0\x00sqlite3IsToplevel(pParse)\x00v\x00sqlite3SchemaMutexHeld(db, 0, pDb->pSchema)\x00sqlite3AutoincrementBegin\x00!IsVirtual(pTab)\x00opcode==OP_OpenWrite || opcode==OP_OpenRead\x00pPk!=0\x00pPk->tnum==pTab->tnum\x00sqlite3OpenTable\x00iDb>=0\x00sqlite3TableLock\x00v!=0\x00pIdx!=0\x00sqlite3VdbeSetP4KeyInfo\x00sqlite3KeyInfoIsWriteable(pKey)\x00sqlite3KeyInfoOfIndex\x00!p || p->xCmp\x00no such collation sequence: %s\x00!db->xCollNeeded || !db->xCollNeeded16\x00callCollNeeded\x00sqlite3GetCollSeq\x00n!=P4_INT32 && n!=P4_VTAB\x00n<=0\x00pP4!=0\x00pOp->p4type==P4_NOTUSED\x00sqlite3VdbeAppendP4\x00nOp>0\x00aOp->p2>=0\x00sqlite3VdbeAddOpList\x00target>0 && target<=pParse->nMem\x00pParse->pVdbe!=0 || pParse->db->mallocFailed\x00sqlite3ExprCode\x00pParse->db->mallocFailed\x00pCol->iMem>0\x00!ExprHasProperty(pExpr, EP_IntValue)\x00pExpr->u.zToken[0]=='x' || pExpr->u.zToken[0]=='X'\x00pExpr->u.zToken[1]=='\\''\x00z[n]=='\\''\x00pExpr->u.zToken!=0\x00pExpr->u.zToken[0]!=0\x00pExpr->u.zToken[0]=='?' || strcmp(pExpr->u.zToken, z)==0\x00pLeft\x00misuse of aggregate: %s()\x00!ExprHasProperty(pExpr, EP_xIsSelect)\x00unknown function: %s()\x00nFarg>=2\x00nFarg>=1\x00blob\x00text\x00numeric\x00integer\x00real\x00nFarg==1\x00none\x00pFarg->a[0].pExpr!=0\x00pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT\x00%d columns assigned %d values\x00pExpr->iTable==0 || pExpr->iTable==1\x00pExpr->iColumn>=-1 && pExpr->iColumnnCol\x00pTab->iPKey<0 || pExpr->iColumn!=pTab->iPKey\x00p1>=0 && p1<(pTab->nCol*2+2)\x00%s.%s -> $%d\x00new\x00old\x00row value misused\x00op==TK_CASE\x00!ExprHasProperty(pExpr, EP_xIsSelect) && pExpr->x.pList\x00pExpr->x.pList->nExpr > 0\x00pTest!=0\x00pParse->db->mallocFailed || pParse->nErr>0 || pParse->iCacheLevel==iCacheLevel\x00pExpr->affinity==OE_Rollback || pExpr->affinity==OE_Abort || pExpr->affinity==OE_Fail || pExpr->affinity==OE_Ignore\x00RAISE() may only be used within a trigger-program\x00sqlite3ExprCodeTarget\x00sqlite3ExprCodeGetColumn\x00pTab!=0\x00inCol\x00sqlite3ColumnDefault\x00pExpr!=0\x00(pExpr->flags & EP_TokenOnly)==0 || pCtx==0\x00zVal[nVal]=='\\''\x00*ppVal==0\x00pCtx==0\x00valueFromExpr\x00zIn!=0\x00sqlite3AffinityType\x00(h>='0' && h<='9') || (h>='a' && h<='f') || (h>='A' && h<='F')\x00sqlite3HexToInt\x00pMem->flags & MEM_Str || pMem->db->mallocFailed\x00aff==SQLITE_AFF_TEXT\x00affinity==SQLITE_AFF_INTEGER || affinity==SQLITE_AFF_REAL || affinity==SQLITE_AFF_NUMERIC\x00applyAffinity\x00(pRec->flags & (MEM_Str|MEM_Int|MEM_Real))==MEM_Str\x00applyNumericAffinity\x00pMem->flags & MEM_Real\x00sqlite3VdbeIntegerAffinity\x00sqlite3VdbeMemCast\x00(pMem->flags & (MEM_Blob|MEM_Str))!=0\x00(pMem->flags & (MEM_Int|MEM_Real|MEM_Null))!=0\x00sqlite3VdbeMemNumerify\x00sqlite3VdbeMemIntegerify\x00sqlite3VdbeMemRealify\x00iReg>0 || pParse->nErr || pParse->db->mallocFailed\x00iCol>=-1 && iCol<32768\x00p->iTable!=iTab || p->iColumn!=iCol\x00sqlite3ExprCacheStore\x00i>=0\x00z!=0\x000x\x00hex literal too big: %s%s\x00codeInteger\x00!sqlite3IsNaN(value)\x00codeReal\x00pExpr->op==TK_EQ || pExpr->op==TK_NE || pExpr->op==TK_IS || pExpr->op==TK_ISNOT || pExpr->op==TK_LT || pExpr->op==TK_GT || pExpr->op==TK_LE || pExpr->op==TK_GE\x00pExpr->op==op || (pExpr->op==TK_IS && op==TK_EQ) || (pExpr->op==TK_ISNOT && op==TK_NE)\x00p5==0 || pExpr->op!=op\x00p5==SQLITE_NULLEQ || pExpr->op==op\x00i>=0 && imagic==VDBE_MAGIC_INIT\x00sqlite3VdbeMakeLabel\x00codeVectorCompare\x00EXECUTE %s%s SUBQUERY %d\x00CORRELATED \x00LIST\x00SCALAR\x00!isRowid || nVal==1\x00!isRowid\x00pKeyInfo!=0\x00pEList!=0\x00pEList->nExpr>0\x00sqlite3KeyInfoIsWriteable(pKeyInfo)\x00pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT\x00ExprHasProperty(pExpr, EP_xIsSelect)\x00Init subquery result\x00Init EXISTS result\x00sqlite3CodeSubselect\x00PUSH to %d\x0a\x00pExpr->op==TK_IN\x00exprINAffinity\x00iop2==0 || pVector->op==TK_REGISTER\x00sqlite3VectorFieldSubexpr\x00pExpr->flags&EP_xIsSelect\x00pExpr->pLeft->flags&EP_xIsSelect\x00pExpr->x.pList->nExpr>0\x00pExpr->op==TK_FUNCTION\x00pExpr->op==TK_COLLATE\x00sqlite3ExprSkipCollate\x00sqlite3ExprAffinity\x00iColnCol\x00sqlite3TableColumnAffinity\x00aff1==0 || aff2==0\x00sqlite3CompareAffinity\x00%*s%s.%p: \x00begin processing:\x0a\x00p->pOrderBy==0 || pDest->eDest!=SRT_DistFifo\x00p->pOrderBy==0 || pDest->eDest!=SRT_Fifo\x00p->pOrderBy==0 || pDest->eDest!=SRT_DistQueue\x00p->pOrderBy==0 || pDest->eDest!=SRT_Queue\x00pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard || pDest->eDest==SRT_Queue || pDest->eDest==SRT_DistFifo || pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_Fifo\x00p->pEList!=0\x00after name resolution:\x0a\x00expected %d columns for '%s' but got %d\x00end compound-select processing\x0a\x00After WHERE-clause push-down:\x0a\x00pItem->addrFillSub==0\x00materialize \"%s\"\x00end %s\x00After all FROM-clause analysis:\x0a\x00sDistinct.isTnct\x00Transform DISTINCT into GROUP BY:\x0a\x0066==sqlite3LogEst(100)\x000==sqlite3LogEst(1)\x00pWhere==p->pWhere\x00!ExprHasProperty(sAggInfo.aFunc[i].pExpr, EP_xIsSelect)\x00clear abort flag\x00indicate accumulator empty\x00GROUP BY\x00GROUP BY sort\x00output one row\x00check abort flag\x00reset accumulator\x00indicate data in accumulator\x00output final row\x00set abort flag\x00Groupby result generator entry point\x00end groupby result generator\x00p->pGroupBy==0\x00flag==0\x00flag==0 || (pMinMax!=0 && pMinMax->nExpr==1)\x00db->mallocFailed || pMinMax!=0\x00pMinMax==0 || pMinMax->nExpr==1\x00%s() by index\x00RIGHT PART OF ORDER BY\x00ORDER BY\x00end processing\x0a\x00authorizer malfunction\x00nil-SELECT\x00SELECT%s%s (0x%p) selFlags=0x%x nSelectRow=%d\x00 DISTINCT\x00 agg_flag\x00result-set\x00{%d,*}\x00 %s.%s\x00 %s\x00 tabname=%Q\x00 (AS %s)\x00 LEFT-JOIN\x00func-args:\x00GROUPBY\x00ORDERBY\x00UNION ALL\x00| \x00 \x00|-- \x00'-- \x00acc.nChar>0\x00sqlite3TreeViewLine\x00moreToFollow==0 || moreToFollow==1\x00sqlite3TreeViewPush\x00WITH (0x%p, pOuter=0x%p)\x00WITH (0x%p)\x00 AS\x00%s (empty)\x00iOrderByCol=%d\x00nil\x00 flags=0x%x iRJT=%d\x00 flags=0x%x\x00AGG{%d:%d}%s\x00COLUMN(%d)%s\x00{%d:%d}%s\x00%Q\x00VARIABLE(%s,%d)\x00REGISTER(%d)\x00ID \"%w\"\x00CAST %Q\x00ISNOT\x00MUL\x00SUB\x00DIV\x00UMINUS\x00UPLUS\x00SPAN %Q\x00COLLATE %Q\x00AGG_FUNCTION%d %Q\x00FUNCTION %Q\x00EXISTS-expr\x00SELECT-expr\x00NEW\x00OLD\x00unk\x00rollback\x00abort\x00fail\x00ignore\x00RAISE %s(%Q)\x00MATCH {%d:%d}%s\x00VECTOR\x00SELECT-COLUMN %d\x00IF-NULL-ROW %d\x00op=%d\x00sqlite3Select\x00sqlite3SelectPrep\x00(p->selFlags & SF_Converted)==0\x00pNew->pPrior!=0\x00a JOIN clause is required before %s\x00pAlias!=0\x00p==0\x00pDatabase==0 || pTable!=0\x00sqlite3SrcListAppend\x00iStart>=0\x00nExtra>=1\x00pSrc!=0\x00iStart<=pSrc->nSrc\x00db->mallocFailed\x00sqlite3SrcListEnlarge\x00sqlite3SrcListAppendFromTerm\x00sqlite3ExprListAppend\x00iValue>=0\x00pToken->z!=0 || pToken->n==0\x00sqlite3ExprAlloc\x00convertCompoundSelectToSubquery\x00sqlite3WalkSelectFrom\x00pFrom->fg.isRecursive==0 || pFrom->pTab!=0\x00pFrom->pTab==0\x00pSel!=0\x00sqlite_sq_%p\x00200==sqlite3LogEst(1048576)\x00too many references to \"%s\": max 65535\x00pFrom->pSelect==0\x00pE->op!=TK_DOT || pE->pRight!=0\x00pE->op!=TK_DOT || (pE->pLeft!=0 && pE->pLeft->op==TK_ID)\x00pE->op!=TK_DOT || pRight!=0\x00pE->pLeft!=0\x00!ExprHasProperty(pE->pLeft, EP_IntValue)\x00*\x00zName\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00selectExpander\x00bFree==0 || (pParse->pWith==0 && pParse->pWithToFree==0)\x00pParse->pWith!=pWith\x00sqlite3WithPush\x00pList || pParse->db->mallocFailed\x00sqlite3SrcListAssignCursors\x00pFrom->pSelect\x00multiple references to recursive table: %s\x00pTab->nTabRef==1 || ((pSel->selFlags&SF_Recursive) && pTab->nTabRef==2 )\x00circular reference: %s\x00pPrior->pWith==0\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00withExpand\x00'%s' is not a function\x00sqlite3SelectDup\x00pNewExpr->iColumn==0 || i>0\x00pOldExpr->pLeft==pOldExpr->pRight\x00pItem[-1].pExpr!=0\x00pNewExpr->iColumn==pItem[-1].pExpr->iColumn+1\x00pPriorSelectCol==pItem[-1].pExpr->pLeft\x00sqlite3ExprListDup\x00flags==0 || flags==EXPRDUP_REDUCE\x00sqlite3ExprDup\x00dupFlags==0 || dupFlags==EXPRDUP_REDUCE\x00pzBuffer==0 || dupFlags==EXPRDUP_REDUCE\x00ExprHasProperty(p, EP_Reduced)==0\x00p->iColumn==0 || p->pRight==0\x00p->pRight==0 || p->pRight==p->pLeft\x00exprDup\x00flags==EXPRDUP_REDUCE || flags==0\x00!ExprHasProperty(p, EP_TokenOnly|EP_Reduced)\x00!ExprHasProperty(p, EP_FromJoin)\x00!ExprHasProperty(p, EP_MemToken)\x00!ExprHasProperty(p, EP_NoReduce)\x00dupedExprStructSize\x00sqlite3SrcListDup\x00sqlite3IdListDup\x00nCol==(i16)nCol\x00pColExpr!=0\x00!ExprHasProperty(pColExpr, EP_IntValue)\x00%.*z:%u\x00sqlite3ColumnsFromExprList\x00p->pSchema==0 || p->zDatabase==0\x00sqlite3LocateTableItem\x00no such view\x00no such table\x00pragma_\x00%s: %s.%s\x00%s: %s\x00sqlite3ReadSchema\x00sqlite3BtreeHoldsMutex(db->aDb[0].pBt)\x00db->init.busy==0\x00db->nDb>1\x00sqlite3Init\x00db->aDb[iDb].pSchema\x00iDb==1 || sqlite3BtreeHoldsMutex(db->aDb[iDb].pBt)\x00sqlite_temp_master\x00sqlite_master\x001\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage integer,sql text)\x00attached databases must use the same text encoding as main database\x00unsupported file format\x00db->init.busy\x00SELECT name, rootpage, sql FROM \"%w\".%s ORDER BY rowid\x00sqlite3InitOne\x00argc==3\x00create \x00(rc&0xFF)==(rcp&0xFF)\x00saved_iDb==0 || (db->flags & SQLITE_Vacuum)!=0\x00iDb==1\x00invalid rootpage\x00sqlite3InitCallback\x00?\x00malformed database schema (%s)\x00%z - %s\x00rc==SQLITE_OK || ppStmt==0 || *ppStmt==0\x00rc==SQLITE_OK || *ppStmt==0\x00ppStmt && *ppStmt==0\x00sqlite3BtreeHoldsMutex(pBt)\x00database schema is locked: %s\x00statement too long\x000==sParse.nQueryLoop\x00!(*ppStmt)\x00sqlite3Prepare\x00rc==SQLITE_OK || rc==SQLITE_LOCKED_SHAREDCACHE\x00sqlite3BtreeSchemaLocked\x00eLock==READ_LOCK || eLock==WRITE_LOCK\x00!(p->db->flags&SQLITE_ReadUncommitted)||eLock==WRITE_LOCK||iTab==1\x00eLock==READ_LOCK || (p==pBt->pWriter && p->inTrans==TRANS_WRITE)\x00eLock==READ_LOCK || pBt->inTransaction==TRANS_WRITE\x00pIter->eLock==READ_LOCK || pIter->eLock==WRITE_LOCK\x00eLock==READ_LOCK || pIter->pBtree==p || pIter->eLock==READ_LOCK\x00p==pBt->pWriter\x00querySharedCacheTableLock\x00pParse->checkSchema\x00sqlite3SchemaMutexHeld(db, iDb, 0)\x00schemaIsValid\x00sqlite3BtreeIsInReadTrans\x00pBt->inTransaction==TRANS_WRITE || IfNotOmitAV(pBt->bDoTruncate)==0\x00p->lock.pBtree==p && p->lock.iTable==1\x00!pBt->pWriter\x00sqlite3BtreeBeginTrans\x00pBt->pPage1==0\x00@ \x00(pageSize & 7)==0\x00pBt->maxLeaf + 23 <= MX_CELL_SIZE(pBt)\x00lockBtree\x00sqlite3PcacheRefCount(pPager->pPCache)==0\x00pPager->eState==PAGER_OPEN || pPager->eState==PAGER_READER\x00pPager->tempFile==0 || pPager->eLock==EXCLUSIVE_LOCK\x00pPager->eLock==NO_LOCK || pPager->eLock==UNKNOWN_LOCK\x00!pPager->tempFile\x00pPager->eState==PAGER_OPEN\x00(pPager->eLock==SHARED_LOCK) || (pPager->exclusiveMode && pPager->eLock>SHARED_LOCK)\x00pPager->pWal==0 || rc==SQLITE_OK\x00sqlite3PagerSharedLock\x00(pPager->eLock>=locktype) || (pPager->eLock==NO_LOCK && locktype==SHARED_LOCK) || (pPager->eLock==RESERVED_LOCK && locktype==EXCLUSIVE_LOCK)\x00pager_wait_on_lock\x00eLock==SHARED_LOCK || eLock==RESERVED_LOCK || eLock==EXCLUSIVE_LOCK\x00pagerLockDb\x00jrnlOpen==0 || ( sqlite3OsDeviceCharacteristics(pPager->jfd) & SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN )\x00hasHotJournal\x00pPager->eLock>=SHARED_LOCK\x00pagerPagecount\x00sqlite3WalDbsize\x00pagerOpenWalIfPresent\x00pPager->eState==PAGER_OPEN || pbOpen\x00pPager->eState==PAGER_READER || !pbOpen\x00pbOpen==0 || *pbOpen==0\x00pbOpen!=0 || (!pPager->tempFile && !pPager->pWal)\x00sqlite3PagerOpenWal\x00pPager->pWal==0 && pPager->tempFile==0\x00pPager->eLock==SHARED_LOCK || pPager->eLock==EXCLUSIVE_LOCK\x00pagerOpenWal\x00pagerExclusiveLock\x00zWalName && zWalName[0]\x00pDbFd\x00sqlite3WalOpen\x00pagerBeginReadTransaction\x00pWal->readLock<0\x00thisMark!=READMARK_NOT_USED\x00rc==SQLITE_BUSY || (pWal->readOnly & WAL_SHM_RDONLY)!=0\x00mxReadMark<=pWal->hdr.mxFrame\x00walTryBeginRead\x00SQLite format 3\x00pPager->eState>=PAGER_READER && pPager->eStateeState==PAGER_READER\x00rc!=SQLITE_OK || pPager->eState==PAGER_WRITER_LOCKED\x00sqlite3PagerBegin\x00pWal->writeLock==0 && pWal->iReCksum==0\x00sqlite3WalBeginWriteTransaction\x00pP1!=0\x00pBt->usableSize<=pBt->pageSize && pBt->usableSize+255>=pBt->pageSize\x00pBt->autoVacuum==1 || pBt->autoVacuum==0\x00pBt->incrVacuum==1 || pBt->incrVacuum==0\x00newDatabase\x00sqlite3PagerPagenumber(pPage->pDbPage)==pPage->pgno\x00sqlite3PagerGetData(pPage->pDbPage) == data\x00sqlite3PagerIswriteable(pPage->pDbPage)\x00pBt->pageSize>=512 && pBt->pageSize<=65536\x00zeroPage\x00pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0)\x00decodeFlags\x00nSize==debuginfo.nSize || CORRUPT_DB\x00cellSizePtr\x00pPage->leaf==0 || pPage->leaf==1\x00pPage->intKeyLeaf\x00pPage->childPtrSize==0\x00btreeParseCellPtr\x00pPage->childPtrSize==4\x00debuginfo.nSize==(u16)(pIter - pCell) || CORRUPT_DB\x00cellSizePtrNoPayload\x00pPage->leaf==0\x00btreeParseCellPtrNoPayload\x00pPage->intKeyLeaf==0\x00btreeParseCellPtrIndex\x00pBt->db\x00sqlite3_mutex_held(pBt->db->mutex)\x00btreeInvokeBusyHandler\x00sqlite3InvokeBusyHandler\x00sqlite3PagerOpenSavepoint\x00nSavepoint>nCurrent && pPager->useJournal\x00pPager->nSavepoint==nSavepoint\x00pagerOpenSavepoint\x00sqlite3WalSavepoint\x00pPg->flags&PGHDR_DIRTY\x00!subjRequiresPage(pPg) || pPg->pgno<=pPg->pPager->dbSize\x00assertTruncateConstraintCb\x00p->inTrans>TRANS_NONE\x00SQLITE_OK==querySharedCacheTableLock(p, MASTER_ROOT, READ_LOCK)\x00pBt->pPage1\x00idx>=0 && idx<=15\x00sqlite3BtreeGetMeta\x00pPager->eState>PAGER_OPEN\x00sqlite3PagerDataVersion\x00iDbnDb\x00pDb->pSchema!=0\x00sqlite3ResetOneSchema\x00pBt->autoVacuum\x00nRef>=sqlite3PagerRefcount(pPager)\x00autoVacuumCommit\x00invalidateAllOverflowCache\x00iLastPg>nFin\x00iFreePg==iLastPg\x00iFreePg0 && IfNotOmitAV(pBt->autoVacuum))\x00nearby>0\x00pTrunk!=0\x00pTrunk->aData!=0\x00pPrevTrunk==0\x00sqlite3PagerIswriteable(pPage1->pDbPage)\x00pBt->nPage!=PENDING_BYTE_PAGE(pBt)\x00*pPgno!=PENDING_BYTE_PAGE(pBt)\x00rc!=SQLITE_OK || sqlite3PagerPageRefcount((*ppPage)->pDbPage)<=1\x00rc!=SQLITE_OK || (*ppPage)->isInit==0\x00allocateBtreePage\x00eType==PTRMAP_OVERFLOW2 || eType==PTRMAP_OVERFLOW1 || eType==PTRMAP_BTREE || eType==PTRMAP_ROOTPAGE\x00pDbPage->pBt==pBt\x00relocatePage\x00pPg->nRef>0\x00pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD\x00pPager->tempFile || !MEMDB\x00pPager->journalMode==PAGER_JOURNALMODE_OFF || pageInJournal(pPager, pPg) || pPg->pgno>pPager->dbOrigSize\x00!pPgOld || pPgOld->nRef==1\x00pPager->pTmpSpace!=0\x00sqlite3PagerMovepage\x00newPgno>0\x00sqlite3PcacheMove\x00sqlite3BitvecClear\x00setChildPtrmaps\x00pPage->pBt!=0\x00pPage->pBt->db!=0\x00pPage->pgno==sqlite3PagerPagenumber(pPage->pDbPage)\x00pPage == sqlite3PagerGetExtra(pPage->pDbPage)\x00pPage->aData == sqlite3PagerGetData(pPage->pDbPage)\x00pPage->nCell>0 || top==usableSize || CORRUPT_DB\x00btreeInitPage\x00pCell!=0\x00ptrmapPutOvflPtr\x000==PTRMAP_ISPAGE(pBt, PENDING_BYTE_PAGE(pBt))\x00ptrmapPut\x00modifyPagePointer\x00pPager->dbSize>=nPage\x00sqlite3PagerTruncateImage\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD || pPager->eState==PAGER_ERROR\x00MEMDB==0 || pPager->tempFile\x00rc!=SQLITE_IOERR_BLOCKED\x00pPager->eState==PAGER_WRITER_DBMOD\x00sqlite3PagerCommitPhaseOne\x00pPager->pWal\x00pList\x00p->pgno < p->pDirty->pgno\x00pList->pDirty==0 || isCommit\x00pagerWalFrames\x00(isCommit!=0)==(nTruncate!=0)\x00(int)pWal->szPage==szPage\x00rc==SQLITE_OK || iWrite==0\x00iOffset==walFrameOffset(iFrame, szPage)\x00sqlite3WalFrames\x00(rc&0xff)!=SQLITE_BUSY\x00walRestartLog\x00p->syncFlags & (SQLITE_SYNC_NORMAL|SQLITE_SYNC_FULL)\x00walWriteToLog\x00pWal->iReCksum>0\x00walRewriteChecksums\x00isDirectMode==0\x00!pPager->tempFile && isOpen(pPager->fd)\x00pPgHdr==0 || rc==SQLITE_OK\x00pager_incr_changecounter\x00writeMasterJournal\x00syncJournal\x00pPager->eState==PAGER_WRITER_CACHEMOD || pPager->eState==PAGER_WRITER_DBMOD || pPager->eState==PAGER_WRITER_LOCKED\x00sqlite3PagerExclusiveLock\x00pPager->tempFile || pPager->eState==PAGER_WRITER_DBMOD\x00isOpen(pPager->fd) || pList->pDirty==0\x00pPager->tempFile && rc==SQLITE_OK\x00rc!=SQLITE_OK || isOpen(pPager->fd)\x00(pList->flags&PGHDR_NEED_SYNC)==0\x00pager_write_pagelist\x00rc!=SQLITE_OK || isOpen(pFile)\x00pagerOpentemp\x00pBt->inTransaction==TRANS_WRITE\x00pBt->nTransaction>0\x00sqlite3BtreeCommitPhaseTwo\x00pPager->eState==PAGER_WRITER_LOCKED || pPager->eState==PAGER_WRITER_FINISHED || (pagerUseWal(pPager) && pPager->eState==PAGER_WRITER_CACHEMOD)\x00pPager->journalOff==JOURNAL_HDR_SZ(pPager) || !pPager->journalOff\x00sqlite3PagerCommitPhaseTwo\x00(&p[1])==pEnd || p[0].db==p[1].db\x00releaseMemArray\x00idxnResColumn\x00varaColName!=0\x00rc!=0 || !zName || (pColName->flags&MEM_Term)!=0\x00sqlite3VdbeSetColName\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00selectid\x00order\x00detail\x00isPrepareV2==1 || isPrepareV2==0\x00p->zSql==0\x00sqlite3VdbeSetSql\x00(rc & p->db->errMask)==rc\x00db->nVdbeActive>=db->nVdbeRead\x00db->nVdbeRead>=db->nVdbeWrite\x00db->nVdbeWrite>=0\x00db->nVdbeActive>0 || db->autoCommit==0 || db->nStatement==0\x00p->nFrame==0\x00p->pAuxData==0\x00pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE\x00pCx->uc.pCursor!=0\x00pVCur->pVtab->nRef>0\x00sqlite3VdbeFreeCursor\x00pCsr->eCurType==CURTYPE_SORTER\x00sqlite3VdbeSorterClose\x00pSorter->bUseThreads || pSorter->pReader==0\x00pTask->bDone==1\x00ppOut!=0\x00sqlite3ThreadJoin\x00vdbeSorterJoinThread\x00sqlite3VdbeSorterReset\x00pFile\x00sqlite3OsCloseFree\x00pTask->list.aMemory==0\x00vdbeSortSubtaskCleanup\x00closeAllCursors\x00cnt==db->nVdbeActive\x00nWrite==db->nVdbeWrite\x00nRead==db->nVdbeRead\x00checkActiveVdbeCnt\x00sqlite3VdbeEnter\x00FOREIGN KEY constraint failed\x00sqlite3VdbeHalt\x00vdbeLeave\x00i!=1\x00%s-mjXXXXXX9XXz\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00zMaster[sqlite3Strlen30(zMaster)-3]=='9'\x00zFile[0]!=0\x00rc!=SQLITE_BUSY\x00vdbeCommit\x00p->pBt->pPager!=0\x00sqlite3BtreeGetFilename\x00sqlite3BtreeGetJournalname\x00eOp==SAVEPOINT_ROLLBACK || eOp==SAVEPOINT_RELEASE\x00db->nStatement>0\x00p->iStatement==(db->nStatement+db->nSavepoint)\x00vdbeCloseStatement\x00iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK)\x00pBt->nPage>0\x00sqlite3BtreeSavepoint\x00op==SAVEPOINT_RELEASE||op==SAVEPOINT_ROLLBACK||op==SAVEPOINT_BEGIN\x00iSavepoint>=-1\x00sqlite3VtabSavepoint\x00sqlite3VdbeSetChanges\x00p->apCsr[i]==0\x00p->aMem[i].flags==MEM_Undefined\x00Cleanup\x00sqlite3VdbeFinalize\x00db->pVdbe==p\x00sqlite3VdbeDelete\x00p->db==0 || p->db==db\x00sqlite3VdbeClearObject\x00db->lookaside.bDisable >= pParse->disableLookaside\x00sqlite3ParserReset\x00p->startTime>0\x00db->xProfile!=0 || (db->mTrace & SQLITE_TRACE_PROFILE)!=0\x00p->zSql!=0\x00invokeProfileCallback\x00sqlite3LockAndPrepare\x00sqlite3_prepare\x00unknown error\x00abort due to ROLLBACK\x00sqlite3ErrStr\x00not an error\x00SQL logic error or missing database\x00access permission denied\x00callback requested query abort\x00database is locked\x00database table is locked\x00out of memory\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00table contains no data\x00database schema has changed\x00constraint failed\x00datatype mismatch\x00library routine called out of sequence\x00large file support is disabled\x00authorization denied\x00auxiliary database format error\x00bind or column index out of range\x00file is encrypted or is not a database\x00sqlite3_errmsg\x00zDb!=0 || sqlite3BtreeHoldsAllMutexes(db)\x00pSchema\x00sqlite3SchemaMutexHeld(db, j, 0)\x00sqlite3FindIndex\x00sqlite3BtreeSetCacheSize\x00sqlite3PcacheSetCachesize\x00db->aDb[iDb].pBt!=0\x00sqlite_stat1\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00sqlite3AnalysisLoad\x00zDatabase!=0 || sqlite3BtreeHoldsAllMutexes(db)\x00sqlite3FindTable\x00analysisLoader\x00aOut==0\x00aLog!=0\x00pIndex!=0\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00decodeIntArray\x00matchOther<0x80\x00patternCompare\x00!pIdx->hasStat1\x0010==sqlite3LogEst(2)\x0033==sqlite3LogEst(10)\x0023==sqlite3LogEst(5)\x00sqlite3DefaultRowEst\x00main\x00sqlite3_strnicmp(zName, \"pragma_\", 7)==0\x00sqlite3HashFind(&db->aModule, zName)==0\x00sqlite3PragmaVtabRegister\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_size\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_file_format\x00lock_status\x00locking_mode\x00max_page_count\x00mmap_size\x00optimize\x00page_count\x00page_size\x00parser_trace\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00sql_trace\x00stats\x00synchronous\x00table_info\x00temp_store\x00temp_store_directory\x00threads\x00user_version\x00vdbe_addoptrace\x00vdbe_debug\x00vdbe_eqp\x00vdbe_listing\x00vdbe_trace\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00strlen(zBuf) < sizeof(zBuf)-1\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00tbl\x00idx\x00wdth\x00hght\x00flgs\x00seqno\x00desc\x00coll\x00key\x00seq\x00unique\x00origin\x00partial\x00file\x00id\x00table\x00to\x00on_update\x00on_delete\x00match\x00parent\x00fkid\x00busy\x00log\x00checkpointed\x00timeout\x00database\x00status\x00pragmaVtabConnect\x00j < 2\x00pragmaVtabBestIndex\x00jazArg)\x00PRAGMA \x00%Q.\x00=%Q\x00pragmaVtabFilter\x00sqlite3_prepare_v2\x00pCsr->pPragma\x00pragmaVtabNext\x00v->expired==0\x00db->nVdbeWrite>0 || db->autoCommit==0 || (db->nDeferredCons==0 && db->nDeferredImmCons==0)\x00p->startTime==0\x00p->rc==SQLITE_OK\x00rc==SQLITE_ROW || rc==SQLITE_DONE || rc==SQLITE_ERROR || (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE\x00(p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp\x00sqlite3Step\x00(rc & (db->errMask))==rc\x00p->magic==VDBE_MAGIC_INIT || p->magic==VDBE_MAGIC_RESET\x00p->aMem[i].db==p->db\x00sqlite3VdbeRewind\x00sqlite3_reset\x00p->explain\x00p->magic==VDBE_MAGIC_RUN\x00p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM\x00p->nMem>9\x00pMem->z!=0\x00p->db->mallocFailed\x00%.2x\x00sqlite3VdbeList\x00p->rc==SQLITE_OK || (p->rc&0xff)==SQLITE_BUSY\x00p->bIsReader || p->readOnly!=0\x00p->explain==0\x000 < db->nProgressOps\x00VDBE Program Listing:\x0a\x00VDBE Query Plan:\x0a\x00%s\x0a\x00VDBE Trace:\x0a\x00pOp>=aOp && pOp<&aOp[p->nOp]\x00pOp->p1>0\x00pOp->p1<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p1])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p1])\x00pOp->p2>0\x00pOp->p2<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p2])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p2])\x00pOp->p3>0\x00pOp->p3<=(p->nMem+1 - p->nCursor)\x00memIsValid(&aMem[pOp->p3])\x00sqlite3VdbeCheckMemInvariants(&aMem[pOp->p3])\x00db->nProgressOps!=0\x00pOp->p1>0 && pOp->p1<=(p->nMem+1 - p->nCursor)\x00VdbeMemDynamic(pIn1)==0\x00pIn1->flags==MEM_Int\x00pOp->p2>=0 && pOp->p2nOp\x00pOp->p3>=0 && pOp->p3nOp\x00!VdbeMemDynamic(pOut)\x00pIn1->u.i>=0 && pIn1->u.inOp\x00pCaller->opcode==OP_Yield\x00pCaller->p2>=0 && pCaller->p2nOp\x00pOp->p5<=4\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00rc==SQLITE_BUSY || rc==SQLITE_OK || rc==SQLITE_ERROR\x00rc==SQLITE_OK || (p->rc&0xff)==SQLITE_CONSTRAINT\x00rc==SQLITE_OK || db->nDeferredCons>0 || db->nDeferredImmCons>0\x00pOp->p4.pI64!=0\x00!sqlite3IsNaN(*pOp->p4.pReal)\x00pOp->p4.z!=0\x00rc==SQLITE_OK || rc==SQLITE_TOOBIG\x00pOut->szMalloc>0 && pOut->zMalloc==pOut->z\x00VdbeMemDynamic(pOut)==0\x00pIn3->flags & MEM_Int\x00pOp->p1 <= SQLITE_MAX_LENGTH\x00pOp->p1>0 && pOp->p1<=p->nVar\x00pOp->p4.z==0 || pOp->p4.z==sqlite3VListNumToName(p->pVList,pOp->p1)\x00n>0 && p1>0 && p2>0\x00p1+n<=p2 || p2+n<=p1\x00pOut<=&aMem[(p->nMem+1 - p->nCursor)]\x00pIn1<=&aMem[(p->nMem+1 - p->nCursor)]\x00memIsValid(pIn1)\x00pOut!=pIn1\x00(pIn1->flags & MEM_Int)!=0\x00p->nResColumn==pOp->p2\x00pOp->p1+pOp->p2<=(p->nMem+1 - p->nCursor)+1\x00db->flags&SQLITE_CountRows\x00p->usesStmtJournal\x00p->iStatement==0 || db->flags&SQLITE_CountRows\x00memIsValid(&pMem[i])\x00(pMem[i].flags & MEM_Ephem)==0 || (pMem[i].flags & (MEM_Str|MEM_Blob))==0\x00pIn1!=pOut\x00pOp->p4type==P4_COLLSEQ\x00pOp->p4type==P4_FUNCDEF\x00pOp->p3>0 && pOp->p3<=(p->nMem+1 - p->nCursor)\x00n==0 || (pOp->p2>0 && pOp->p2+n<=(p->nMem+1 - p->nCursor)+1)\x00pOp->p3p2 || pOp->p3>=pOp->p2+n\x00pOp->p4type==P4_FUNCCTX\x00memIsValid(pCtx->argv[i])\x00op==OP_ShiftRight || op==OP_ShiftLeft\x00pOp->p2>=SQLITE_AFF_BLOB && pOp->p2<=SQLITE_AFF_REAL\x00pOp->opcode==OP_Eq || pOp->opcode==OP_Ne\x00(flags1 & MEM_Cleared)==0\x00(pOp->p5 & SQLITE_JUMPIFNULL)==0\x00pIn1!=pIn3\x00pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0\x00(pIn1->flags & MEM_Dyn) == (flags1 & MEM_Dyn)\x00(pIn3->flags & MEM_Dyn) == (flags3 & MEM_Dyn)\x00pOp->opcode==OP_Ne || pOp->opcode==OP_Eq\x00res2==0 || res2==1\x00pOp>aOp\x00pOp[-1].opcode==OP_Lt || pOp[-1].opcode==OP_Gt\x00pOp[-1].p5 & SQLITE_STOREP2\x00pOp->p4type==P4_INTARRAY\x00pOp->p4.ai\x00pOp[1].opcode==OP_Compare\x00pOp[1].p5 & OPFLAG_PERMUTE\x00pOp[-1].opcode==OP_Permutation\x00pOp[-1].p4type==P4_INTARRAY\x00aPermute!=0\x00p1>0 && p1+mx<=(p->nMem+1 - p->nCursor)+1\x00p2>0 && p2+mx<=(p->nMem+1 - p->nCursor)+1\x00p1>0 && p1+n<=(p->nMem+1 - p->nCursor)+1\x00p2>0 && p2+n<=(p->nMem+1 - p->nCursor)+1\x00memIsValid(&aMem[p1+idx])\x00memIsValid(&aMem[p2+idx])\x00inField\x00p->aOp[0].opcode==OP_Init\x00pOp->p1>=0 && pOp->p1nCursor\x00p->apCsr[pOp->p1]!=0\x00pC!=0\x00p2nField\x00pC->eCurType!=CURTYPE_VTAB\x00pC->eCurType!=CURTYPE_PSEUDO || pC->nullRow\x00pC->eCurType!=CURTYPE_SORTER\x00pC->uc.pseudoTableReg>0\x00pReg->flags & MEM_Blob\x00memIsValid(pReg)\x00pC->eCurType==CURTYPE_BTREE\x00pCrsr\x00sqlite3BtreeCursorIsValid(pCrsr)\x00avail<=65536\x00pC->nHdrParsed<=p2\x00p2nHdrParsed\x00sqlite3VdbeCheckMemInvariants(pDest)\x00t==pC->aType[p2]\x00zAffinity!=0\x00zAffinity[pOp->p2]==0\x00pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)]\x00nField>0 && pOp->p2>0 && pOp->p2+nField<=(p->nMem+1 - p->nCursor)+1\x00pOp->p3p1 || pOp->p3>=pOp->p1+pOp->p2\x00pData0<=pLast\x00zAffinity[0]==0 || pRec<=pLast\x00memIsValid(pRec)\x00i==nHdr\x00j==nByte\x00p->apCsr[pOp->p1]->eCurType==CURTYPE_BTREE\x00db->pSavepoint==0 || db->autoCommit==0\x00p1==SAVEPOINT_BEGIN||p1==SAVEPOINT_RELEASE||p1==SAVEPOINT_ROLLBACK\x00db->pSavepoint || db->isTransactionSavepoint==0\x00checkSavepointCount(db)\x00p->bIsReader\x00cannot open savepoint - SQL statements in progress\x00db->autoCommit==0 || db->nVTrans==0\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00pSavepoint==db->pSavepoint\x00desiredAutoCommit==1 || desiredAutoCommit==0\x00desiredAutoCommit==1 || iRollback==0\x00db->nVdbeActive>0\x00desiredAutoCommit==1\x00cannot commit transaction - SQL statements in progress\x00db->nStatement==0\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00p->readOnly==0 || pOp->p2==0\x00pOp->p1>=0 && pOp->p1nDb\x00DbMaskTest(p->btreeMask, pOp->p1)\x00sqlite3BtreeIsInTrans(pBt)\x00db->nStatement>=0 && db->nSavepoint>=0\x00pOp->p5==0 || pOp->p4type==P4_INT32\x00pOp->p3btreeMask, iDb)\x00pOp->p2readOnly==0\x00pDb->pBt!=0\x00sqlite3SchemaMutexHeld(db, pOp->p1, 0)\x00pOp->p5==0 || pOp->p5==OPFLAG_SEEKEQ\x00pOp->p4type==P4_KEYINFO\x00pCur->iDb==pOp->p3\x00pOp->opcode==OP_OpenWrite || pOp->p5==0 || pOp->p5==OPFLAG_SEEKEQ\x00pOp->opcode==OP_OpenRead || pOp->opcode==OP_ReopenIdx || p->readOnly==0\x00pX!=0\x00p2>0\x00p2<=(p->nMem+1 - p->nCursor)\x00memIsValid(pIn2)\x00(pIn2->flags & MEM_Int)!=0\x00p2>=2\x00pKeyInfo->enc==ENC(db)\x00pKeyInfo->db==db\x00pOp->p1>=0\x00nField>=0\x00pOrig->pBtx!=0\x00pOp->p2>=0\x00pgno==MASTER_ROOT+1\x00pCx->pKeyInfo->db==db\x00pCx->pKeyInfo->enc==ENC(db)\x00isSorter(pC)\x00pOp->p3>=0\x00pOp->p5==0\x00pOp->p2!=0\x00pC->isOrdered\x00pC->uc.pCursor!=0\x00sqlite3BtreeCursorHasHint(pC->uc.pCursor, BTREE_SEEK_EQ)==0 || CORRUPT_DB\x00pOp->opcode==OP_SeekGE || pOp->opcode==OP_SeekLE\x00pOp[1].opcode==OP_IdxLT || pOp[1].opcode==OP_IdxGT\x00pOp[1].p1==pOp[0].p1\x00pOp[1].p2==pOp[0].p2\x00pOp[1].p3==pOp[0].p3\x00pOp[1].p4.i==pOp[0].p4.i\x00pOp->p4type==P4_INT32\x00nField>0\x00oc!=OP_SeekGT || r.default_rc==-1\x00oc!=OP_SeekLE || r.default_rc==-1\x00oc!=OP_SeekGE || r.default_rc==+1\x00oc!=OP_SeekLT || r.default_rc==+1\x00memIsValid(&r.aMem[i])\x00res!=0\x00oc==OP_SeekGE || oc==OP_SeekGT\x00oc==OP_SeekLT || oc==OP_SeekLE\x00pC->isTable==0\x00memIsValid(&r.aMem[ii])\x00(r.aMem[ii].flags & MEM_Zero)==0 || r.aMem[ii].n==0\x00pIn3->flags & MEM_Blob\x00pC->isTable\x00pCrsr!=0\x00rc==SQLITE_OK || res==0\x00p->apCsr[pOp->p1]->eCurType!=CURTYPE_VTAB\x00sqlite3BtreeCursorIsValid(pC->uc.pCursor)\x00pOp->p3<=pFrame->nMem\x00memIsValid(pMem)\x00(pMem->flags & MEM_Int)!=0\x00pOp->p3==0\x00v>0\x00memIsValid(pData)\x00(pOp->p5 & OPFLAG_ISNOOP) || pC->isTable\x00pOp->p4type==P4_TABLE || pOp->p4type>=P4_STATIC\x00pKey->flags & MEM_Int\x00memIsValid(pKey)\x00pOp->opcode==OP_InsertInt\x00pC->iDb>=0\x00(pOp->p5 & OPFLAG_ISNOOP) || HasRowid(pTab)\x00pData->flags & (MEM_Blob|MEM_Str)\x00pC->deferredMoveto==0\x00pC->movetoTarget==iKey\x00pOp->p4.pTab!=0\x00(pOp->p5 & ~(OPFLAG_SAVEPOSITION|OPFLAG_AUXDELETE))==0\x00rc!=SQLITE_OK || (pOut->flags & MEM_Blob)\x00isSorter(pC)==0\x00pC->nullRow==0\x00pC->uc.pVCur!=0\x00pModule->xRowid\x00pOp->p2==0\x00isSorter(pC)==(pOp->opcode==OP_SorterSort)\x00pOp->p2>0 && pOp->p2nOp\x00pOp->p5aCounter)\x00res==0 || (res==1 && pC->isTable==0)\x00pOp->opcode!=OP_Next || pOp->p4.xAdvance==sqlite3BtreeNext\x00pOp->opcode!=OP_Prev || pOp->p4.xAdvance==sqlite3BtreePrevious\x00pOp->opcode!=OP_NextIfOpen || pOp->p4.xAdvance==sqlite3BtreeNext\x00pOp->opcode!=OP_PrevIfOpen || pOp->p4.xAdvance==sqlite3BtreePrevious\x00pOp->opcode!=OP_Next || pOp->opcode!=OP_NextIfOpen || pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found\x00pOp->opcode!=OP_Prev || pOp->opcode!=OP_PrevIfOpen || pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE || pC->seekOp==OP_Last\x00isSorter(pC)==(pOp->opcode==OP_SorterInsert)\x00pIn2->flags & MEM_Blob\x00pC->eCurType==CURTYPE_BTREE || pOp->opcode==OP_SorterInsert\x00pOp->p2>0 && pOp->p2+pOp->p3<=(p->nMem+1 - p->nCursor)+1\x00!pC->nullRow || pOp->opcode==OP_IdxRowid\x00pOp->p3>=0 && pOp->p3nCursor\x00pTabCur!=0\x00pTabCur->eCurType==CURTYPE_BTREE\x00pTabCur->uc.pCursor!=0\x00pTabCur->isTable\x00pOp->p4type==P4_INTARRAY || pOp->p4.ai==0\x00pOp->opcode==OP_IdxRowid\x00pOp->p5==0 || pOp->p5==1\x00pOp->opcode==OP_IdxLE || pOp->opcode==OP_IdxGT\x00pOp->opcode==OP_IdxGE || pOp->opcode==OP_IdxLT\x00pOp->opcode==OP_IdxLE || pOp->opcode==OP_IdxLT\x00pOp->opcode==OP_IdxGE || pOp->opcode==OP_IdxGT\x00pOp->p1>1\x00resetSchemaOnFault==0 || resetSchemaOnFault==iDb+1\x00DbMaskTest(p->btreeMask, pOp->p2)\x00pC->isEphemeral\x00DbHasProperty(db, iDb, DB_SchemaLoaded)\x00SELECT name, rootpage, sql FROM '%q'.%s WHERE %s ORDER BY rowid\x00nRoot>0\x00aRoot[nRoot]==0\x00(pnErr->flags & MEM_Int)!=0\x00(pnErr->flags & (MEM_Str|MEM_Blob))==0\x00pOp->p5nDb\x00DbMaskTest(p->btreeMask, pOp->p5)\x00z==0\x00pIn3->flags&MEM_Int\x00iSet==-1 || iSet>=0\x00pProgram->nOp>0\x00too many levels of trigger recursion\x00nMem>0\x00pProgram->nMem+pProgram->nCsr==pFrame->nChildMem || (pProgram->nCsr==0 && pProgram->nMem+1==pFrame->nChildMem)\x00pProgram->nCsr==pFrame->nChildCsr\x00(int)(pOp - aOp)==pFrame->pc\x00pFrame->pAuxData==0\x00pIn1->flags&MEM_Int\x00pIn1->flags & MEM_Int\x00t.flags==MEM_Null\x00pOp[-1].opcode==OP_CollSeq\x00(pMem->flags & ~(MEM_Null|MEM_Agg))==0\x00pOp->p2==SQLITE_CHECKPOINT_PASSIVE || pOp->p2==SQLITE_CHECKPOINT_FULL || pOp->p2==SQLITE_CHECKPOINT_RESTART || pOp->p2==SQLITE_CHECKPOINT_TRUNCATE\x00eNew==PAGER_JOURNALMODE_DELETE || eNew==PAGER_JOURNALMODE_TRUNCATE || eNew==PAGER_JOURNALMODE_PERSIST || eNew==PAGER_JOURNALMODE_OFF || eNew==PAGER_JOURNALMODE_MEMORY || eNew==PAGER_JOURNALMODE_WAL || eNew==PAGER_JOURNALMODE_QUERY\x00cannot change %s wal mode from within a transaction\x00into\x00out of\x00sqlite3BtreeIsInTrans(pBt)==0\x00p1>=0 && p1nDb\x00DbMaskTest(p->btreeMask, p1)\x00isWriteLock==0 || isWriteLock==1\x00database table is locked: %s\x00(aMem[pOp->p2].flags & MEM_Str)!=0\x00(aMem[pOp->p2].flags & MEM_Static)!=0\x00zTab || db->mallocFailed\x00memIsValid(pQuery)\x00pCur->eCurType==CURTYPE_VTAB\x00(pQuery->flags&MEM_Int)!=0 && pArgc->flags==MEM_Int\x00pModule->xColumn\x00pModule->xNext\x00pVtab->pModule->xRename\x00memIsValid(pName)\x00pName->flags & MEM_Str\x00pOp->p2==1 || pOp->p5==OE_Fail || pOp->p5==OE_Rollback || pOp->p5==OE_Abort || pOp->p5==OE_Ignore || pOp->p5==OE_Replace\x00pOp->p4type==P4_VTAB\x00memIsValid(pX)\x00nArg>1 && apArg[0] && (apArg[0]->flags&MEM_Null)\x00-- \x00pOp->p4.z==0 || strncmp(pOp->p4.z, \"-\" \"- \", 3)==0\x00pOp==p->aOp\x00-- %s\x00SQL-trace: %s\x0a\x00pOp->opcode==OP_Noop || pOp->opcode==OP_Explain\x00pOp>=&aOp[-1] && pOp<&aOp[p->nOp-1]\x00rc=%d\x0a\x00rc\x00statement aborts at %d: [%s] %s\x00DELETE%\x00rc!=SQLITE_OK || nExtraDelete==0 || sqlite3_strlike(\"DELETE%\",p->zSql,0)!=0\x00db->u1.isInterrupted\x00sqlite3VdbeExec\x00SQL: [%s]\x0a\x00REG[%d] = \x00 undefined\x00 NULL\x00 si:%lld\x00 i:%lld\x00 r:%g\x00 (rowset)\x00 subtype=0x%02x\x00(f & (MEM_Static|MEM_Ephem))==0\x00(f & (MEM_Dyn|MEM_Ephem))==0\x00(f & (MEM_Static|MEM_Dyn))==0\x00%d[\x00%02X\x00+%dz\x00sqlite3VdbeMemPrettyPrint\x00(X)\x00(8)\x00(16LE)\x00(16BE)\x00NOT NULL\x00FOREIGN KEY\x00out2Prerelease\x00sqlite3VdbeMemTooBig\x00(pFrom->flags & MEM_RowSet)==0\x00pTo->db==pFrom->db\x00srcType==MEM_Ephem || srcType==MEM_Static\x00sqlite3VdbeMemShallowCopy\x00!VdbeMemDynamic(pTo)\x00vdbeClrCopy\x00pFrom->db==0 || sqlite3_mutex_held(pFrom->db->mutex)\x00pTo->db==0 || sqlite3_mutex_held(pTo->db->mutex)\x00pFrom->db==0 || pTo->db==0 || pFrom->db==pTo->db\x00sqlite3VdbeMemMove\x00(pMem->flags & (MEM_Int|MEM_Real))==0\x00(pMem->flags & (MEM_Str|MEM_Blob))!=0\x00computeNumericType\x00(combined_flags & MEM_RowSet)==0\x00pMem1->enc==pMem2->enc || pMem1->db->mallocFailed\x00pMem1->enc==SQLITE_UTF8 || pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE\x00!pColl || pColl->xCmp\x00sqlite3MemCompare\x00(flags & ~MEM_TypeMask)==0\x00sqlite3VdbeMemInit\x00(pB1->flags & MEM_Zero)==0 || n1==0\x00(pB2->flags & MEM_Zero)==0 || n2==0\x00sqlite3BlobCompare\x00p->deferredMoveto\x00p->isTable\x00p->eCurType==CURTYPE_BTREE\x00handleDeferredMoveto\x00cursorOwnsBtShared(pCur)\x00sqlite3_mutex_held(pCur->pBtree->db->mutex)\x00pRes\x00(pIdxKey==0)==(pCur->pKeyInfo==0)\x00pCur->eState!=CURSOR_VALID || (pIdxKey==0)==(pCur->curIntKey!=0)\x00pIdxKey->default_rc==1 || pIdxKey->default_rc==0 || pIdxKey->default_rc==-1\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->isInit\x00pCur->eState==CURSOR_INVALID || pCur->apPage[pCur->iPage]->nCell>0\x00pCur->pgnoRoot==0 || pCur->apPage[pCur->iPage]->nCell==0\x00pCur->apPage[0]->intKey==pCur->curIntKey\x00pCur->curIntKey || pIdxKey\x00pPage->nCell>0\x00pPage->intKey==(pIdxKey==0)\x00biasRight==0 || biasRight==1\x00nCellKey==intKey\x00lwr+upr>=0\x00(pIdxKey->errCode!=SQLITE_CORRUPT || c==0) && (pIdxKey->errCode!=SQLITE_NOMEM || pCur->pBtree->db->mallocFailed)\x00c==0\x00lwr==upr+1 || (pPage->intKey && !pPage->leaf)\x00pPage->isInit\x00(pCur->curFlags & BTCF_ValidOvfl)==0\x00cursorHoldsMutex(p)\x00cursorOwnsBtShared\x00sqlite3BtreeMovetoUnpacked\x00pRes!=0\x00*pRes==0 || *pRes==1\x00pCur->skipNext==0 || pCur->eState!=CURSOR_VALID\x00sqlite3BtreeNext\x00*pRes==0\x00pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_SKIPNEXT\x00btreeNext\x00pCur->eState>=CURSOR_REQUIRESEEK\x00pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID\x00btreeRestoreCursorPosition\x00nKey==(i64)(int)nKey\x00btreeMoveto\x00sqlite3VdbeAllocUnpackedRecord\x00u<=pKeyInfo->nField + 1\x00sqlite3VdbeRecordUnpack\x00n>3 && n<=9\x00sqlite3GetVarint32\x00sizeof(r1)==sizeof(t2) && memcmp(&r1, &t2, sizeof(r1))==0\x00serialGet\x00pCur->iPageiPage>=0\x00moveToChild\x00pCur==0 || ppPage==&pCur->apPage[pCur->iPage]\x00pCur==0 || bReadOnly==pCur->curPagerFlags\x00pCur==0 || pCur->iPage>0\x00(*ppPage)->pgno==pgno\x00(*ppPage)->aData==sqlite3PagerGetData(pDbPage)\x00pgno!=0 || rc==SQLITE_CORRUPT\x00getAndInitPage\x00moveToLeftmost\x00pCur->iPage>0\x00pCur->apPage[pCur->iPage]\x00moveToParent\x00iIdx<=pParent->nCell\x00get4byte(&pParent->aData[pParent->hdrOffset+8])==iChild\x00get4byte(findCell(pParent, iIdx))==iChild\x00assertParentIndex\x00flags & MEM_Str\x00(*(u8*)pKey1)<=0x3F || CORRUPT_DB\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res)\x00nKey>=0\x00szHdr<=(u32)nKey\x00nField <= pKeyInfo->nField+pKeyInfo->nXField\x00vdbeAssertFieldCountWithinLimits\x00vdbeRecordCompareInt\x00pPKey2->pKeyInfo->nField+pPKey2->pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB\x00pPKey2->pKeyInfo->aSortOrder!=0\x00pPKey2->pKeyInfo->nField>0\x00idx1<=szHdr1 || CORRUPT_DB\x00(pRhs->flags & MEM_Zero)==0 || pRhs->n==0\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, rc)\x00mem1.szMalloc==0\x00CORRUPT_DB || vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, pPKey2->default_rc) || pKeyInfo->db->mallocFailed\x00serial_type<12 || sqlite3SmallTypeSizes[serial_type]==(serial_type - 12)/2\x00sqlite3VdbeSerialTypeLen\x00sqlite3VdbeRecordCompareWithSkip\x00CORRUPT_DB || (serial_type>=1 && serial_type<=9 && serial_type!=7)\x00vdbeRecordDecodeInt\x00pKeyInfo->nField+pKeyInfo->nXField>=pPKey2->nField || CORRUPT_DB\x00pKeyInfo->nField>0\x00vdbeRecordCompareDebug\x00i<10\x00sqlite3VarintLen\x00sqlite3VdbeFindCompare\x00pPKey2->aMem[0].flags & MEM_Str\x00vdbeRecordCompareDebug(nKey1, pKey1, pPKey2, res) || CORRUPT_DB || pPKey2->pKeyInfo->db->mallocFailed\x00vdbeRecordCompareString\x00pCur->skipNext!=SQLITE_OK\x00pCur->apPage[pCur->iPage]!=0\x00pCur->iPage==(-1)\x00pRoot->pgno==pCur->pgnoRoot\x00pRoot->intKey==1 || pRoot->intKey==0\x00moveToRoot\x00p->uc.pCursor!=0\x00sqlite3BtreeCursorHasMoved(p->uc.pCursor)\x00handleMovedCursor\x00pCur!=0\x00pCur->eState!=CURSOR_VALID\x00pCur->skipNext==0\x00sqlite3BtreeCursorRestore\x00pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]\x00pCur->info.nSize>0\x00pCur->info.pPayload>pCur->apPage[pCur->iPage]->aData || CORRUPT_DB\x00pCur->info.pPayloadapPage[pCur->iPage]->aDataEnd ||CORRUPT_DB\x00fetchPayload\x00sqlite3BtreeCursorIsValid(pCur)\x00!VdbeMemDynamic(pMem)\x00zData!=0\x00sqlite3VdbeMemFromBtree\x00serial_type<128\x00sqlite3VdbeOneByteSerialTypeLen\x00pLen!=0\x00pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob)\x00sqlite3VdbeSerialType\x00n<=9\x00putVarint64\x00pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0) == (int)sqlite3VdbeSerialTypeLen(serial_type)\x00sqlite3VdbeSerialPut\x00n==(db->nSavepoint + db->isTransactionSavepoint)\x00checkSavepointCount\x00p->inTrans==TRANS_WRITE\x00(pBt->btsFlags & BTS_READ_ONLY)==0\x00iStatement>0\x00iStatement>p->db->nSavepoint\x00sqlite3BtreeBeginStmt\x00idx>=1 && idx<=15\x00pBt->pPage1!=0\x00pBt->autoVacuum || iMeta==0\x00iMeta==0 || iMeta==1\x00sqlite3BtreeUpdateMeta\x00iCur>=0 && iCurnCursor\x00allocateCursor\x00wrFlag==0 || wrFlag==BTREE_WRCSR || wrFlag==(BTREE_WRCSR|BTREE_FORDELETE)\x00hasSharedCacheTableLock(p, iTable, pKeyInfo!=0, (wrFlag?2:1))\x00wrFlag==0 || !hasReadConflicts(p, iTable)\x00wrFlag==0 || p->inTrans==TRANS_WRITE\x00pBt->pPage1 && pBt->pPage1->aData\x00wrFlag==0 || (pBt->btsFlags & BTS_READ_ONLY)==0\x00wrFlag==0\x00btreeCursor\x00x==BTREE_SEEK_EQ || x==BTREE_BULKLOAD || x==0\x00sqlite3BtreeCursorHintFlags\x00:memory:\x00pVfs!=0\x00(flags&0xff)==flags\x00(flags & BTREE_UNORDERED)==0 || (flags & BTREE_SINGLE)!=0\x00(flags & BTREE_SINGLE)==0 || isTempDb\x00pBt->nRef>0\x00(pBt->pageSize & 7)==0\x00sqlite3_mutex_held(mutexOpen)\x00rc!=SQLITE_OK || sqlite3BtreeConnectionCount(*ppBtree)>0\x00sqlite3BtreeOpen\x00nUri>=0\x00EIGHT_BYTE_ALIGNMENT(SQLITE_INT_TO_PTR(journalFileSize))\x00EIGHT_BYTE_ALIGNMENT(pPager->jfd)\x00nPathname>0\x00-journal\x00\x00-wal\x00\x00!memDb\x00nolock\x00immutable\x00pPager->memDb==0\x00nExtra>=8 && nExtra<1000\x00tempFile==PAGER_LOCKINGMODE_NORMAL || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE\x00useJournal || pPager->tempFile\x00pPager->fullSync==0\x00pPager->extraSync==0\x00pPager->syncFlags==0\x00pPager->walSyncFlags==0\x00pPager->ckptSyncFlags==0\x00isOpen(pPager->fd) || tempFile\x00sqlite3PagerOpen\x00onoffalseyestruextrafull\x00szExtra>=8\x00sqlite3PcacheOpen\x00(pPg->flags&PGHDR_NEED_SYNC)==0\x00pagerStress\x00sqlite3PagerPageRefcount(pData)>0\x00pageReinit\x00sqlite3PagerReadFileheader\x00((int(*)(void *))(ap[0]))==xBusyHandler\x00ap[1]==pBusyHandlerArg\x00sqlite3PagerSetBusyhandler\x00pgnoRoot>=3 || CORRUPT_DB\x00eType!=PTRMAP_ROOTPAGE\x00eType!=PTRMAP_FREEPAGE\x00sqlite3PagerIswriteable(pBt->pPage1->pDbPage)\x00sqlite3PagerIswriteable(pRoot->pDbPage)\x00(pBt->openFlags & BTREE_SINGLE)==0 || pgnoRoot==2\x00btreeCreateTable\x00pCsr->pKeyInfo && pCsr->pBtx==0\x00pSorter->iMemory==0\x00sqlite3VdbeSorterInit\x00sqlite3BtreePrevious\x00(pCur->curFlags & (BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey))==0\x00pCur->info.nSize==0\x00(pCur->curFlags & (BTCF_ValidOvfl))==0\x00btreePrevious\x00(pCur->curFlags & BTCF_ValidNKey)==0\x00moveToRightmost\x00pCur->aiIdx[ii]==pCur->apPage[ii]->nCell\x00pCur->ix==pCur->apPage[pCur->iPage]->nCell-1\x00pCur->apPage[pCur->iPage]->leaf\x00sqlite3BtreeLast\x00(flags & (BTREE_SAVEPOSITION|BTREE_APPEND))==flags\x00(pCur->curFlags & BTCF_WriteFlag)!=0 && pBt->inTransaction==TRANS_WRITE && (pBt->btsFlags & BTS_READ_ONLY)==0\x00hasSharedCacheTableLock(p, pCur->pgnoRoot, pCur->pKeyInfo!=0, 2)\x00(pX->pKey==0)==(pCur->pKeyInfo==0)\x00pX->pKey==0\x00(flags & BTREE_SAVEPOSITION)==0 || ((pCur->curFlags&BTCF_ValidNKey)!=0 && pX->nKey==pCur->info.nKey)\x00pCur->eState==CURSOR_VALID || (pCur->eState==CURSOR_INVALID && loc)\x00pPage->intKey || pX->nKey>=0\x00pPage->leaf || !pPage->intKey\x00newCell!=0\x00szNew==pPage->xCellSize(pPage, newCell)\x00szNew <= MX_CELL_SIZE(pBt)\x00idx